﻿var activeobject;
var selectfix;

function showValues(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) 
	{
		if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
		{				
			posx = parseInt(e.clientX) + parseInt(document.documentElement.scrollLeft);
			posy = parseInt(e.clientY) + parseInt(document.documentElement.scrollTop);
		} 
		else 
		{				
			posx = parseInt(e.clientX) + parseInt(document.body.scrollLeft);
			posy = parseInt(e.clientY) + parseInt(document.body.scrollTop);
		}
		    
	}

	activeobject.style.top = (posy+yoffset) + "px";
	activeobject.style.left = (posx+xoffset) + "px";
	
	if(selectfix != null)
	{
	    selectfix.style.top = activeobject.style.top;
	    selectfix.style.left = activeobject.style.left;
	    selectfix.style.width = activeobject.style.width;
	    selectfix.style.height = activeobject.style.height;
	}
	
	activeobject.style.display = "block";
}

function helpOver(info) 
{	
	activeobject = document.createElement("div");
	activeobject.id = "helpinfo"
	activeobject.style.textAlign = "left";
	activeobject.style.position = "absolute";
	activeobject.style.padding = "3px";
	activeobject.style.width = "200px";
	activeobject.style.backgroundColor = "#ffffcc";
	activeobject.style.border = "1px solid Black";
	activeobject.style.zIndex = 1000;
	activeobject.style.display = "none";
	activeobject.style.font = "11px verdana";
	activeobject.innerHTML = info;
	
	document.body.appendChild(activeobject);
	
	if (IsIE())
	{
	    selectfix = document.createElement("iframe");
	    selectfix.id = "helpinfoiframe";
	    selectfix.style.position="absolute";
	    selectfix.style.padding = "5px";
        selectfix.style.zIndex = 900;
        selectfix.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
        
        document.body.appendChild(selectfix);
    }
	
	
	
	xoffset = -220;
	yoffset = 0;
	
	document.onmousemove = showValues;
	
	//fixa hover-image
	//if(document.images) 
	//{
	//	document.getElementById('helpindvtop').src = helpimghover.src;
	//}
}

function helpOut() 
{
	document.onmousemove = null;
	document.body.removeChild(activeobject);
	activeobject = null;
	
	if(selectfix != null)
	{
	    document.body.removeChild(selectfix);
	    selectfix = null;
	}
	
	//fixa hover-image
	//if(document.images)
	//{
	//	document.getElementById('helpindvtop').src = helpimgout.src;
	//}
}
function CloseInfoBox()
{
    helpinfo = document.getElementById("helpinfo");
    if(helpinfo != null)
    {
        document.body.removeChild(helpinfo);
    }
    helpinfoiframe = document.getElementById("helpinfoiframe");
    if(helpinfoiframe != null)
    {
        document.body.removeChild(helpinfoiframe);
    }
}
function IsIE()
{

    return ( navigator.appName=="Microsoft Internet Explorer" );

}
