var popuplayertimeout	= 1500;
var popuplayerreloadtimeout	= 750;
var popuplayerclosetimer	= 0;
var popuplayercurrentlink = "";

function showEmployeeLayer(link, left, top)
{
	showEmployeeLayerURL(link);
	box = document.getElementById("EmployeeListPlaceholderControl1_popupEmployeeLayerContainer").style;
	box.display = "block";
	box.left = left+"px";
	box.top = top-55+"px";
}

function hideEmployeeLayer()
{
	box = document.getElementById("EmployeeListPlaceholderControl1_popupEmployeeLayerContainer").style;
	box.display = "none";
	showEmployeeLayerURL('about:blank');
}

function showEmployeeLayerURL(link)
{
	window.frames["popupEmployeeLayerIframe"].location.href = link;
}

// Open Layer with timer
function openEmployeeLayer(e,link)
{
	box = document.getElementById("EmployeeListPlaceholderControl1_popupEmployeeLayerContainer").style;

	if (box.display == 'none' | box.display == '')
	{
		var cursorPosition = displayCursorPosition(e);
		popuplayerclosetimer = window.setTimeout("showEmployeeLayer('"+link+"','"+cursorPosition[0]+"','"+cursorPosition[1]+"')", popuplayertimeout);
		popuplayercurrentlink = link;
	}
	else
	{
		if (popuplayercurrentlink != link)
		{
			var cursorPosition = displayCursorPosition(e);
			popuplayerclosetimer = window.setTimeout("showEmployeeLayer('"+link+"','"+cursorPosition[0]+"','"+cursorPosition[1]+"')", popuplayerreloadtimeout);
			//showEmployeeLayerURL(link)
			popuplayercurrentlink = link;
		}
	}
}

// Cancel Open timer
function cancelOpenEmployeeLayer()
{
if(popuplayerclosetimer)
{
window.clearTimeout(popuplayerclosetimer);
popuplayerclosetimer = null;
}
}

function displayCursorPosition(event) 
{ 
 if (typeof event == "undefined") 
 { 
   event = window.event; 
 } 

 var scrollingPosition = getScrollingPosition(); 
 var cursorPosition = [0, 0]; 

 if (typeof event.pageX != "undefined" && 
     typeof event.x != "undefined") 
 { 
   cursorPosition[0] = event.pageX; 
   cursorPosition[1] = event.pageY; 
 } 
 else 
 { 
   cursorPosition[0] = event.clientX + scrollingPosition[0]; 
   cursorPosition[1] = event.clientY + scrollingPosition[1]; 
 } 

 //alert("Your mouse is currently located at: " + cursorPosition[0] + "," + cursorPosition[1]); 

 return cursorPosition; 
}

function getScrollingPosition() 
{ 
 var position = [0, 0]; 

 if (typeof window.pageYOffset != 'undefined') 
 { 
   position = [ 
       window.pageXOffset, 
       window.pageYOffset 
   ]; 
 } 

 else if (typeof document.documentElement.scrollTop 
     != 'undefined' && document.documentElement.scrollTop > 0) 
 { 
   position = [ 
       document.documentElement.scrollLeft, 
       document.documentElement.scrollTop 
   ]; 
 } 

 else if (typeof document.body.scrollTop != 'undefined') 
 { 
   position = [ 
       document.body.scrollLeft, 
       document.body.scrollTop 
   ]; 
 } 

 return position; 
}
