/* Global functions for race.com
Nav images - utilOn, utilOff
Printing - printPage
NN4 resize bug - resizeFix
*/

/*
Utility nav image swap
*/

// Initialize utility nav images
if (document.images) {
	VOIPOff = new Image(150,17);
	VOIPOff.src = "/images/nav_VOIP.gif";
	HostingColocationOff = new Image(150,17);
	HostingColocationOff.src = "/images/nav_HostingColocation.gif";
	SupportNetworkOff = new Image(150,17);
	SupportNetworkOff.src = "/images/nav_SupportNetwork.gif";
	CustomerSupportOff = new Image(150,17);
	CustomerSupportOff.src = "/images/nav_CustomerSupport.gif";
    
    VOIPOn = new Image(150,17);
	VOIPOn.src = "/images/nav_VOIP_on.gif";
	HostingColocationOn = new Image(150,17);
	HostingColocationOn.src = "/images/nav_HostingColocation_on.gif";
	SupportNetworkOn = new Image(150,17);
	SupportNetworkOn.src = "/images/nav_SupportNetwork_on.gif";
	CustomerSupportOn = new Image(150,17);
	CustomerSupportOn.src = "/images/nav_CustomerSupport_on.gif";
	
	BanHome1 = new Image(1600,300);
	BanHome1.src = "/images/ban_home_1.jpg";
	BanHome2 = new Image(1600,300);
	BanHome2.src = "/images/ban_home_2.jpg";
	BanHome3 = new Image(1600,300);
	BanHome3.src = "/images/ban_home_3.jpg";
	BanHome4 = new Image(1600,300);
	BanHome4.src = "/images/ban_home_4.jpg";
	BanHome5 = new Image(1600,300);
	BanHome5.src = "/images/ban_home_5.jpg";
	BanHome6 = new Image(1600,300);
	BanHome6.src = "/images/ban_home_6.jpg";
	BanHome7 = new Image(1600,300);
	BanHome7.src = "/images/ban_home_7.jpg";
	BanHome8 = new Image(1600,300);
	BanHome8.src = "/images/ban_home_8.jpg";
	BanHome9 = new Image(1600,300);
	BanHome9.src = "/images/ban_home_9.jpg";
	BanHome10 = new Image(1600,300);
	BanHome10.src = "/images/ban_home_10.jpg";
	BanHome11 = new Image(1600,300);
	BanHome11.src = "/images/ban_home_11.jpg";
	BanHome12 = new Image(1600,300);
	BanHome12.src = "/images/ban_home_12.jpg";
	BanHome13 = new Image(1600,300);
	BanHome13.src = "/images/ban_home_13.jpg";
	BanHome14 = new Image(1600,300);
	BanHome14.src = "/images/ban_home_14.jpg";

}


function utilOn(imgName) {
    if (document.images) { 
        imgOn = eval(imgName + "On.src");
        document [imgName].src = imgOn;
	}
}

function utilOff(imgName) {
	if (document.images) {
        imgOff = eval(imgName + "Off.src");
        document [imgName].src = imgOff;
	}
}

/*
The javascript function printPage() is called from /includes/global/footer_print.inc, and it opens a window with content formatted such that it that will fit on a standard 8.5x11 sheet of paper when printed.  
*/

var printWin;

function printPage(thePath) {
	printWin = window.open(thePath, 'printableWin','width=570,height=400,menubar=yes,toolbar=yes,scrollbars=yes');
	printWin.focus();
}

/*
Code for Netscape 4 Resize bug 
This is a workaround for a Netscape 4 bug that causes stylesheets to be corrupted when the window is resized.
*/

if (document.layers) {
	var widthCheck = window.innerWidth;
	var heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}

function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
	document.location.href = document.location.href;
}

function OpenRacePopup(winURL){
	var winObj=new Object;
	winObj=window.open(winURL,'RacePopup','menubar=no,toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600,screenX=0,screenY=0,top=0,left=0');
	if (winObj.focus) winObj.focus();
}

function OpenContentPopUp(winURL){
	var winObj=new Object;
	winObj=window.open(winURL,'Content','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=420,screenX=0,screenY=0,top=0,left=0');
	if (winObj.focus) winObj.focus();
}