var idName=null;
var control=null;
/*
	There are 3 divs (television,radios,vcr's) on mouseover of televisions the hidden div beneath it
	should appear. On mouseout, the div should be hidden again, after 3 seconds UNLESS the person 
	mouses over the now visible div.The div should hide only after there is no mouseover activity 
	for 3 seconds.
	
	-when you mouseover a menu the timer should stop.
	Important: handle should be  initialized to null, and set back to null every time you stop it.
	Remember, if the timer runs out, it will not set itself to null.
	**BONUS**   at no time should 2 submenus be visible.
				One way to acheive this is to do this:
				when you mouseover a menu, set all submenus to hidden, then set the one you want to visible.

*/
function showHideSub(myid,myvision)
{
	if(myid=="aboutSchool"){
		document.getElementById(myid).style.visibility=myvision;
		clearTimeout(control);//stops the timer
		document.getElementById("courses").style.visibility="hidden";
		document.getElementById("Practitioner").style.visibility="hidden";
		document.getElementById("aboutThai").style.visibility="hidden";
		document.getElementById("contact").style.visibility="hidden";
		
	}
	else if(myid=="courses"){
		document.getElementById(myid).style.visibility=myvision;
		clearTimeout(control);//stops the timer
		document.getElementById("aboutSchool").style.visibility="hidden";
		document.getElementById("Practitioner").style.visibility="hidden";
		document.getElementById("aboutThai").style.visibility="hidden";
		document.getElementById("contact").style.visibility="hidden";
		
	}
	else if(myid=="Practitioner"){
		document.getElementById(myid).style.visibility=myvision;
		clearTimeout(control);//stops the timer
		document.getElementById("aboutSchool").style.visibility="hidden";
		document.getElementById("courses").style.visibility="hidden";
		document.getElementById("aboutThai").style.visibility="hidden";
		document.getElementById("contact").style.visibility="hidden";
		
		
	}
	else if(myid=="aboutThai"){
		document.getElementById(myid).style.visibility=myvision;
		clearTimeout(control);//stops the timer
		document.getElementById("aboutSchool").style.visibility="hidden";
		document.getElementById("courses").style.visibility="hidden";
		document.getElementById("Practitioner").style.visibility="hidden";
		document.getElementById("contact").style.visibility="hidden";
		
		
	}
	else if(myid=="contact"){
		document.getElementById(myid).style.visibility=myvision;
		clearTimeout(control);//stops the timer
		document.getElementById("aboutSchool").style.visibility="hidden";
		document.getElementById("courses").style.visibility="hidden";
		document.getElementById("Practitioner").style.visibility="hidden";
		document.getElementById("aboutThai").style.visibility="hidden";
		
	}
}
function timed(myid)
{
	
	control=setTimeout("showHideSub('"+myid+"','hidden')",100);
		
}
function subMenus(myid, mycolor, myweight){
	
	//STYLE PROPERTIES
	document.getElementById(myid).style.backgroundColor=mycolor;
	document.getElementById(myid).style.fontWeight=myweight;
	clearTimeout(control);//stops the timer
}

