// this page contains javascript functions to be used by
// the Benefits Gateway application

// javascript code for the popup layers //////////////
var numX = 0;
var numY = 0;
var bNS = (document.layers)? true:false;
var bIE5 = (navigator.userAgent.indexOf('MSIE 5')>0)? true:false;

// code to set events for the popup layers
document.onmousemove = mouseMove
if (bNS) document.captureEvents(Event.MOUSEMOVE)

// function to capture the x y coordinates
function mouseMove(e) {
	if (bNS) {numX=e.pageX; numY=e.pageY;}
	else {numX=event.x; numY=event.y;}
	if (bIE5) {				// if ie 5, must add in scrolling
		numX += document.body.scrollLeft;
		numY += document.body.scrollTop;
	}
	numX += 12;				// add offset for mouse icon
}

// function to pop up the specified announcement
function popLayer(tCell) {
    if(bNS) {
		document.layers[tCell].left = numX;
		document.layers[tCell].top = numY;
		document.layers[tCell].visibility="show";
	}
    else {
		document.all[tCell].style.left = numX;
		document.all[tCell].style.top = numY;
		document.all[tCell].style.visibility="visible";
	}
}
// function to hide the specified announcement
function hideLayer(tCell) {
    if(bNS) document.layers[tCell].visibility="hidden";
    else document.all[tCell].style.visibility="hidden";
}
//////////////////////////////////////////////////////


function openwin(winame,file,height,width) {
	window.open(file,winame,"status=no,scrollbars=yes,toolbar=no,location=no,menu=no,resizable=yes,width="+width+",height="+height);
}
// function to open the company's quote link in a new window
function openQuote(sLink) {
    window.open(sLink,null,"status=no,scrollbars=yes,toolbar=no,location=no,menu=no,resizable=no,width=500,height=570");
}
//////////////////////////////////////////////////////


// function to open the other links on the page
function openLink(file, win) {
	window.open(file, win);
}

