var timerID = null; 
var timerOn = false; 
var timecount = 700; 

function showmenu(menuID1, menuID2, menuID3, menuID4) {

	if(document.getElementById(menuID1)){
		document.getElementById(menuID1).style.visibility = "visible";
	}
	
	if(document.getElementById(menuID2)){
		document.getElementById(menuID2).style.visibility = "visible";	
	}

	if(document.getElementById(menuID3)){
		document.getElementById(menuID3).style.visibility = "visible";	
	}

	if(document.getElementById(menuID4)){
		document.getElementById(menuID4).style.visibility = "visible";
	}

	return false;
}

function startTimer() { 
	if (timerOn == false) { 
		timerID=setTimeout( "hideAll()" , timecount); 
		timerOn = true; 
	} 
} 

function stopTimer() { 
	if (timerOn) { 
		clearTimeout(timerID); 
		timerID = null; 
		timerOn = false; 
	} 
} 

function hideAll(){

	var menu = "m1";
	var id = 2;

	while(document.getElementById(menu)){

		if(document.getElementById(menu).style.visibility == "visible"){
			document.getElementById(menu).style.visibility = "hidden";
		}

		menu = "m"+id;
		id++;
	
	}
}

function openWindow(theURL,winName, features) { //v2.0
  	newwindow = window.open(theURL,winName,features);
	if (window.focus) {newwindow.focus()}
}

function onMenuLink(linkID){
	document.getElementById(linkID).style.color = "000000";
}

function offMenuLink(linkID){
	document.getElementById(linkID).style.color = "FFFFFF";
}

function CheckLength(maxLength) {

	var charLeft = maxLength - window.event.srcElement.value.length;
	
	document.getElementById("chars").innerHTML = "" + charLeft;	

	if (window.event.srcElement.value.length >= maxLength+1) {
		window.event.srcElement.value = window.event.srcElement.value.substring(0, maxLength);
		//alert('You have reached the maximum length of characters permitted here.');
		return false; 
	}
}