document.write("<div class='info' id='info' style='float:left;position:absolute;border-width:1;padding:0 5 0 5;z-index:1;'></div>")
var ie = document.all ? true : false;
if (!ie) { 
	document.captureEvents(Event.MOUSEMOVE);
	document.captureEvents(Event.MOUSEOUT);
}
document.onmousemove = getmousepos;
document.onmouseout = clear_info;

var x, y;

function getmousepos(e) {
  if (ie) { // grab the x-y pos.s if browser is IE
    if (document.documentElement && document.documentElement.scrollTop) {
	  x = event.clientX + document.documentElement.scrollLeft
      y = event.clientY + document.documentElement.scrollTop
	} else {
	  x = event.clientX + document.body.scrollLeft
      y = event.clientY + document.body.scrollTop
	}
  } else {  // grab the x-y pos.s if browser is NS
    x = e.pageX
    y = e.pageY
  }
  
  return(true);
}

function showInfo(info_tekst){
	document.getElementById("info").style.top=y-20;
	document.getElementById("info").style.left=x+20;
	document.getElementById("info").style.backgroundColor="white";
	document.getElementById("info").style.borderStyle="solid";
	document.getElementById("info").innerHTML=info_tekst;

}

function clear_info(object){
	document.getElementById("info").style.top=0;
	document.getElementById("info").style.left=0;
	document.getElementById("info").style.backgroundColor="";
	document.getElementById("info").style.borderStyle="none";
	document.getElementById("info").innerHTML='';
  return(true);
}

var xmlHttp

function popup(content_url,element_id,top,left,height,width){
	document.getElementById(element_id).style.top=top;
	document.getElementById(element_id).style.left=left;
	document.getElementById(element_id).style.height=height;
	document.getElementById(element_id).style.width=width;
	document.getElementById(element_id).style.padding='0';
	document.getElementById(element_id).style.borderStyle='solid';
	document.getElementById(element_id).style.backgroundColor='white';
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=content_url
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function (){stateChanged(element_id) }
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function clear_popup(element_id){
	document.getElementById(element_id).style.top=0;
	document.getElementById(element_id).style.left=0;
	document.getElementById(element_id).style.height=0;
	document.getElementById(element_id).style.width=0;
	document.getElementById(element_id).style.padding=0;
	document.getElementById(element_id).style.borderStyle='none';
	document.getElementById(element_id).innerHTML='';
  return(true);
}

function showContent(content_url, element_id){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=content_url
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function (){stateChanged(element_id) }
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}


function stateChanged(element_id){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById(element_id).innerHTML=xmlHttp.responseText 
	} 
} 


function GetXmlHttpObject(){ 
	var objXMLHttp=null
	if (window.XMLHttpRequest){
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject){
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


