//checks if the window has been resized
window.onresize = rePosLayer;

function submenu(cmd) {
//command to show the menu when button is pressed
if (cmd=="show"){
//IE controller
				if(document.all){
				 ielayershow();
				 }
//NN controller
				if(!document.all && document.getElementById){
				 nnlayershow();
				 }
				} 
}//end submenu function

//command for IE to show the layer
function ielayershow()  {
						document.getElementById("submenu").style.left=((document.body.clientWidth/2)-232)+"px";
						document.all.submenu.style.visibility="visible";
						}
//command for IE to show the layer
function nnlayershow()  {
						document.getElementById("submenu").style.left=((document.body.clientWidth/2)-232)+"px";
						document.getElementById("submenu").style.visibility="visible";
						}
function rePosLayer() {
						document.getElementById("submenu").style.left=((document.body.clientWidth/2)-232)+"px";
			     }
				 
//timer to hide submenu
var timerOn = false; 
var timecount = 1000; 

function startTime() {  
if (timerOn == false) {   
						timerID=setTimeout ("hideAll()" , timecount);   
						timerOn = true;   
						}  
					  } 
function stopTime() {  
if (timerOn) {   
						clearTimeout(timerID);   
						timerID = null;   
						timerOn = false;   
}  
} 
function hideAll(){
document.getElementById("submenu").style.visibility="hidden";
stopTime()
}
