
function rollOver( imageName, imageSrc ){

	document[imageName].src = imageSrc;

}


function hide( obj ){
		var theObj = document.getElementById(obj);
		theObj.style.display = "none";

}



function show( obj ){
		var theObj = document.getElementById(obj);
		theObj.style.display = "block";
}



var defimg, timer,currentSub,tempSub,tempimg,tempsrc;


pauselength = 750;


function init( imageName, imageSrc ){


	defimg = imageName;
	defsrc = imageSrc;
	rollOver( imageName, imageSrc );

}


function mover( imageName, imageSrc, targSub ){

	
	//clear any open images:
	if( tempimg ){
		//alert( tempimg );
		rollOver( tempimg, tempsrc, "" );
	}
	
	if( tempSub != "" ){
		hide(tempSub);
	}
	
	//clear timeout
	window.clearTimeout(timer);
	
	//mosueover the menu item
	rollOver( imageName, imageSrc );

	//show submenu if there is one
	if( targSub != "" ){
		show( targSub );
		//capture the name so you know what to shut off
		tempSub = targSub;
	}

	

}

function mout( imageName, imageSrc ){


	tempimg = imageName;
	tempsrc = imageSrc;
	
	//rollOver( imageName, imageSrc, "" );
	//start timer - the timer will expire and close the submenu if not selected first
	timer = setTimeout( "closeTemp()", pauselength );


}


function sover(){

	clearTimeout(timer);


}

function sout(){

	
	timer = setTimeout( "closeTemp()", pauselength );
	

}

tempSub="m2_submenu";

function closeTemp(){
	
	if( tempSub != "" ){
		hide(tempSub);
	}

	//mouse out of current image if there is one
	if( tempimg != "" ){
		rollOver( tempimg, tempsrc, "" );
	}
	
	//restore the default image
	if( defimg != "" ){
		rollOver( defimg, defsrc, "" );
	}
	
	tempimg = "";
	tempsrc = "";
}

function preloadImgs() { 

		
		img1 = new Image; 
		img1.src = "images/menu/m1_on.gif";
		
		img2 = new Image; 
		img2.src = "images/menu/m2_on.gif";
		
		img3 = new Image; 
		img3.src = "images/menu/m3_on.gif";
		
		img4 = new Image; 
		img4.src = "images/menu/m4_on.gif";
		
		img5 = new Image; 
		img5.src = "images/menu/m5_on.gif";
		
		img6 = new Image; 
		img6.src = "images/menu/m6_on.gif";
		
		img7 = new Image; 
		img7.src = "images/menu/m7_on.gif";

}

