function createXMLHttpRequest()
{
  if(window.XMLHttpRequest)
  {
    xmlRequest = new XMLHttpRequest();
  }
  else if(window.ActiveXObject)
  {
    try {
      xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (ex) {
      try
      {
        xmlRequest =  new ActiveXObject("Microsoft.XMLHTTP");
      }catch(e)
      {
        alert("异常");
      }
    }
  }
}
var title="";
var xmlRequest;
var eventX;
var eventY;
var menuOffX=0	//菜单距连接文字最左端距离
var menuOffY=45	//菜单距连接文字顶端距离
function sendTitle(e,titleId)
{	
	eventX = e.clientX;
	eventY = e.clientY;
	title=titleId;
	createXMLHttpRequest();
	var url = "ajax/manhead.php?title="+titleId;
	xmlRequest.open("POST",url,true);
	xmlRequest.onreadystatechange=processResponse;
	xmlRequest.send(null);
}




function processResponse()
{
  if(xmlRequest.readystate  == 4)
  {
    if (xmlRequest.status == 200) {

		var line= new Array();    
		var table = new Array();
		var showTitle = document.getElementById("showTitle");
		var temp="";
		var str2 = xmlRequest.responseText;
		table =str2.split('#');
		 for(var i=0;i<table.length-1;i++)
		 {
			line = table[i].split('@');
			
			temp = temp+'<img src="images/dot.gif">  <A HREF=index1.php?id='+title+'&shortId='+line[0]+'>'+line[1]+'</A>  '
		 }

		 showTitle.style.position = "absolute";
		showTitle.thestyle=showTitle.style
		showTitle.innerHTML=temp;
		showTitle.contentwidth=showTitle.offsetWidth
		var rightedge=document.body.clientWidth-eventX;
		var bottomedge=document.body.clientHeight-eventY;
		if (rightedge>500)
		{
			//alert(rightedge);
			showTitle.thestyle.left= 1000-rightedge;
			showTitle.thestyle.top=290;
			//showTitle.thestyle.top=document.body.scrollTop+eventY-showTitle.contentheight-event.offsetY+menuOffY;
		}else
		{
			showTitle.thestyle.left= 1000-rightedge-showTitle.contentwidth+15;
			showTitle.thestyle.top=290;
			//showTitle.thestyle.top=document.body.scrollTop+eventY-showTitle.contentheight-event.offsetY+menuOffY;
		}
		showTitle.thestyle.visibility="visible";
    }
    else
    {
      alert("服务器有问题！");
    }
  }
}