// JavaScript Document
Infowmtt = null;

document.onmousemove = updateWMTT;

function updateWMTT(e)
 {
     x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;                                                                  
     y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
     if (Infowmtt != null)
      {
          Infowmtt.style.left = (x ) + "px";
          Infowmtt.style.top  = (y+20)+"px"; //(y + 20) + "px";
      }                                                                                                                                            }

function showWMTT(id)
 {
			Infowmtt = document.getElementById("ToolTipDiv");
			Infowmtt.innerHTML="<b>Lade...</b>";
			Infowmtt.style.display = "block";
			httpReceiveInfo.abort();

			receiveInfo(id);
 }




 function hideWMTT()
 {
	Infowmtt.style.display = "none";
	httpReceiveInfo.abort();
 }




var GetInfourl = "/pflajax/user.php";

//initiates the first data query
function receiveInfo(id) {
	if (httpReceiveInfo.readyState == 4 || httpReceiveInfo.readyState == 0) 
	{
	    httpReceiveInfo.open("GET",GetInfourl + '?userid=' + URLencode(id), true);
    	    httpReceiveInfo.onreadystatechange = handlehHttpReceiveInfo; 
  	    httpReceiveInfo.send(null);
	}
}

//deals with the servers reply to requesting new content
function handlehHttpReceiveInfo()
{
  if (httpReceiveInfo.readyState == 4)
  {
    results = httpReceiveInfo.responseText;
    if(Infowmtt)
    {
    	oDiv = document.getElementById("ToolTipDiv");
    	oDiv.innerHTML=results;
    }
  }
}


//initiates the XMLHttpRequest object
//as found here: http://www.webpasties.com/xmlHttpRequest
function getHTTPObject() {
  var xmlhttp;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.

    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
@end @*/

 if (window.XMLHttpRequest) { // Mozilla, Safari,...
                    xmlhttp = new XMLHttpRequest();
                } else if (window.ActiveXObject) { // IE
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }

  return xmlhttp;
}


// initiates the two objects for sending and receiving data
var httpReceiveInfo= getHTTPObject();

function URLencode(sStr)
 {
    return sStr.replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
  }