// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

var tipObj;
var enabletip=false;

var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)

//mozgataskor pozicionaljunk
document.onmousemove = pozicional;


function tipMegjelenit(htmlstring)
{
	
	tipObj=document.getElementById("dhtmltooltip");
	tipObj.innerHTML=htmlstring;
	enabletip=true;
	//pozicional;
	tipObj.style.visibility="visible";
	return false;
}

function tipElrejt(){
	enabletip=false;
	tipObj.style.visibility="hidden";
}

function mouseGetXY(xy,e)
	 {
		var posx = 0;
		var posy = 0;
		if (!e) var e = window.event;
		if (e.pageX || e.pageY) 	{
			posx = e.pageX;
			posy = e.pageY;
		}
		else if (e.clientX || e.clientY) 	{
			posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			posy = e.clientY + document.body.scrollTop	+ document.documentElement.scrollTop;
		}
		// posx and posy contain the mouse position relative to the document
		if(xy==0){return posx;}else{return posy;} 
	}

	
function mouseGetX(e){return mouseGetXY(0,e);}
function mouseGetY(e){return mouseGetXY(1,e);} 

function getStyleClass (className) {
	if (document.styleSheets.length < 1) {
        return null;
    }
    if (document.styleSheets[0].cssRules) {
        var cssRules = 'cssRules';
    } else {
        var cssRules = 'rules';
    }
    for (var s = document.styleSheets.length-1; s >= 0; s--) {
        for (var r = document.styleSheets[s][cssRules].length-1; r >= 0; r--) {
        	if (document.styleSheets[s][cssRules][r].selectorText == className) {
            	return document.styleSheets[s][cssRules][r];
            }
        }
    }
    return null;
}


function pozicional(e) 
{
	if(enabletip)
	{
	  /*var a,b,c;
	  
	  if(IE)
	  {
	  	a=getStyleClass('DIV.head_frame').style.height;
	  	b=getStyleClass('DIV.menu_frame').style.width;
	  	c=getStyleClass('DIV.content_head').style.height;
	  }
	  else
	  {
	  	a=getStyleClass('div.head_frame').style.height;
	  	b=getStyleClass('div.menu_frame').style.width;
	  	c=getStyleClass('div.content_head').style.height;
	  }
	  
	  a=a.substring(0, a.length-2);
	  b=b.substring(0, b.length-2);
	  c=c.substring(0, c.length-2);
	  */
	  
	  tempX=mouseGetX(e)+10;//-b;
	  tempY=mouseGetY(e)+10;//-a-c;
	  
	  tipObj.style.top=tempY+"px";
	  tipObj.style.left=tempX+"px";
	  
	  return true;
	}
}