<!----- special javascript for cascading menus ------>
function reDo() { 
	window.location.reload(); 
} 
window.onresize = reDo; 
//Define global variables 
var timerID = null; 
var timerOn = false; 
var timecount = 1000; 
// Change this to the time delay that you desire 
var what = null; 
var newbrowser = true; 
var check = false; 

// Here we are defining some global variables that we will use in the script. The most important one is the timecount variable – this is the delay (in milliseconds) that will be used to hide layers after the user has moused away from them. 

// The reDo() function is to accommodate browsers that will not dynamically regenerate the DOM when the browser window has been resized – so we force it to do so. 

function init() { 
	if (document.layers) { 
		layerRef="document.layers"; 
		styleSwitch=""; 
		visibleVar="show"; 
		screenSize = window.innerWidth; 
		what ="ns4"; 
	} 
	else if(document.all) { 
		layerRef="document.all"; 
		styleSwitch=".style"; 
		visibleVar="visible"; 
		screenSize = document.body.clientWidth + 18; 
		what ="ie4"; 
	} 
	else if(document.getElementById) { 
		layerRef="document.getElementByID"; 
		styleSwitch=".style"; 
		visibleVar="visible"; 
		what="dom1"; 
	} 
	else { 
		what="none"; 
		newbrowser = false; 
	} 
	check = true; 
} 

// The function init() determines for us what browser version that we are dealing with and assigns a values to 
// the variables what, layerRef, styleSwitch and visibleVar, which we will use in our layer visibility toggling functions. 
// We also assign the Boolean value ‘true’ to the check variable. 

// Armed with this information we can now get stuck in to the meat of the script. 


// Toggles the layer visibility on 
function showLayer(layerName) { 
	if(check) { 
		if (what =="none") { 
		return; 
		} 
		else if (what == "dom1") { 
			document.getElementById(layerName).style.visibility="visible"; 
		} 
		else { 
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"'); 
		} 
	} 
	else { 
		return; 
	} 
} 

// First, we make sure that the init() function has done it’s job with if(check) – this looks to see if the variable check is true, and then works it’s way through the function. Our first port of call is for DOM1 compliant browsers, where we set the visibility of the layer to visible. For all other browsers we make use of the information gleaned in the init() function. We evaluate the layerRef variable value (document.all for old IE browsers or document.layers for Netscape 4.x), with the layer name, add in the styleSwitch value (.style for old IE and nothing for NN4.x). This eval command allows us to dynamically build the correct command for the appropriate browser. 


// Toggles the layer visibility off 
function hideLayer(layerName) { 
	if(check) { 
		if (what =="none") { 
			return; 
		} 
		else if (what == "dom1") { 
			document.getElementById(layerName).style.visibility="hidden"; 
		} 
		else { 
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"'); 
		} 
	} 
	else { 
		return; 
	} 
} 

// The hideLayer function is almost identical to the showLayer function in it’s working, except that it changes the visibility property to hidden. 


function hideAll() { 
	hideLayer('products');
	hideLayer('venco');
	hideLayer('venco_pickup');
	hideLayer('venco_truck');
	hideLayer('venco_trailer');
	hideLayer('venturo');
	hideLayer('venturo_htcranes');
	hideLayer('venturo_etcranes');
	hideLayer('venturo_mastcranes');
	hideLayer('venturo_cranebodies');
	hideLayer('ir');
	hideLayer('ferrari');
	hideLayer('ferrari300');
	hideLayer('ferrari500');
	hideLayer('ferrari700');
	hideLayer('ferrari900');
//Put all layers used in the nav here. 
//Copy the hideLayer() function above. 
} 

// This function allows us to hide every layer used in out menu system in one fell swoop! This means that we can make sure that all layers are turned off, before making the appropriate layer visible. All you need to do is call the hideLayer function for each layer used in your menu system. 


function startTime() { 
	if (timerOn == false) { 
		timerID=setTimeout( "hideAll()" , timecount); 
		timerOn = true; 
	} 
} 

// This function starts the timer to hide every layer. We use this function to turn all layers off, if the user has moused away from them for more than out timecount value (set at 1000miliseconds in the global variable section) 

function stopTime() { 
	if (timerOn) { 
 		clearTimeout(timerID); 
		timerID = null; 
		timerOn = false; 
	} 
} 

// Similarly, the stopTime function stops the timer altogether. 

function onLoad() { 
	init(); 
} 

// This final function runs the init function when the page loads. We also use an onLoad event in the body tag to double check this. 
<!----- end special javascript for cascading menus ------>
<!----- extra stuff for popup menus ------>

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

<!----- end extra stuff for popup menus ------>