function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
oldsrc = '';
function changeImages() {
  if (document.images) {
    for (var i=0; i<2; i+=2) {
        document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

preload("nav0_on", "/images/nav/home-over.gif");
preload("nav0_off", "/images/nav/home.gif");
preload("nav1_on", "/images/nav/company-over.gif");
preload("nav1_off", "/images/nav/company.gif");
preload("nav2_on", "/images/nav/boats-over.gif");
preload("nav2_off", "/images/nav/boats.gif");
preload("nav3_on", "/images/nav/advantage-over.gif");
preload("nav3_off", "/images/nav/advantage.gif");
preload("nav4_on", "/images/nav/contact-over.gif");
preload("nav4_off", "/images/nav/contact.gif");

preload("sub0_off", "/images/boatsnav/the_dolphin_family.gif");
preload("sub0_on", "/images/boatsnav/the_dolphin_family-over.gif");
preload("sub0_down", "/images/boatsnav/the_dolphin_family-down.gif");
preload("sub1_off", "/images/boatsnav/superskiff_pro16.gif");
preload("sub1_on", "/images/boatsnav/superskiff_pro16-over.gif");
preload("sub1_down", "/images/boatsnav/superskiff_pro16-down.gif");
preload("sub2_off", "/images/boatsnav/backcountry_pro18.gif");
preload("sub2_on", "/images/boatsnav/backcountry_pro18-over.gif");
preload("sub2_down", "/images/boatsnav/backcountry_pro18-down.gif")
preload("sub3_off", "/images/boatsnav/renegade_pro16.gif");
preload("sub3_on", "/images/boatsnav/renegade_pro16-over.gif");
preload("sub3_down", "/images/boatsnav/renegade_pro16-down.gif");
preload("sub4_off", "/images/boatsnav/superskiff_tiller16.gif");
preload("sub4_on", "/images/boatsnav/superskiff_tiller16-over.gif");
preload("sub4_down", "/images/boatsnav/superskiff_tiller16-down.gif");

preload("sub5_off", "/images/boatsnav/bull_dolphin22.gif");
preload("sub5_on", "/images/boatsnav/bull_dolphin22-over.gif");
preload("sub5_down", "/images/boatsnav/bull_dolphin22-down.gif");

preload("sub6_off", "/images/boatsnav/renegade_tiller16.gif");
preload("sub6_on", "/images/boatsnav/renegade_tiller16-over.gif");
preload("sub6_down", "/images/boatsnav/renegade_tiller16-down.gif");

preload("sub7_off", "/images/boatsnav/superskiff_pro17.gif");
preload("sub7_on", "/images/boatsnav/superskiff_pro17-over.gif");
preload("sub7_down", "/images/boatsnav/superskiff_pro17-down.gif");

function openWindow(url,windowWidth,windowHeight) {
   	var left = Math.floor( (screen.width - windowWidth) / 2);
    var top = Math.floor( (screen.height - windowHeight) / 2);
	newWindow = window.open(url,"pop","width="+windowWidth+",height="+windowHeight+",left="+left+",top="+top+",scrollbars=yes,status=yes");
	newWindow.focus();
}

function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt) {
   	var posLeft = Math.floor( (screen.width - imageWidth) / 2);
    var posTop = Math.floor( (screen.height - imageHeight) / 2);
	newWindow = window.open(alt,"newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop+",scrollbars=no");
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
function showBoatNav(toggleSwitch)
{
	toggleLayerName = "boatNav"
	if (isIE5 || isNS6) {
		eval("document.getElementById('" + toggleLayerName +"').style.visibility='" + toggleSwitch + "'"); 
	}
	else if (isIE4) {
		eval("document.all['" + toggleLayerName +"'].style.visibility='" + toggleSwitch + "'"); 
	}

	else {
		if (toggleSwitch == "hidden") { toggleSwitch = "hide"; }
		else { toggleSwitch = "show"; }
		eval("document.layers['" + toggleLayerName +"'].visibility='" + toggleSwitch + "'"); 
	}
}
