function CheckForDiv(strDiv)
{
	qStr = strDiv;
	
	if(qStr.length>0){
		qStr = qStr.substring(1,qStr.length);
		theParts = qStr.split("&");
		
		for(i=0;i<theParts.length;i++){
			theParts[i] = theParts[i].replace("=","='") + "'";
			ShowHide(eval(theParts[i]));
		}
	}
}

function ShowHide(theDiv)
{
	var theStyle=document.getElementById(theDiv).style;
	
	if (theStyle.display=="block"){
	
		theStyle.display="none";
	
	}else{
	
		theStyle.display="block";
	}
	
}

/*********************************/

function ShowAll()
{
	var allDivs = document.getElementsByTagName("div");
	
	for(var i = 0; i < allDivs.length; i++) 
	{	switch (allDivs[i].id){
			case "ParentMenu": allDivs[i].style.display="none"; break;
			case "StudentMenu": allDivs[i].style.display="none"; break;
			case "VolunteerMenu": allDivs[i].style.display="none"; break;
			case "ProsFamilyMenu": allDivs[i].style.display="none"; break;
			default: allDivs[i].style.display = "block";}
	}
}

/*********************************/

function HideAll()
{
	var allDivs = document.getElementsByTagName("div");
	
	for(var i = 0; i < allDivs.length; i++) 
	{	
		if(allDivs[i].className == "ShowHideDiv")
		{
			allDivs[i].style.display = "none";
		}
	}
}

/*********************************/

var elemPosX = 0;
var elemPosY = 0;

function getObjectXY(theElement){
	elemPosX = theElement.offsetLeft;
	elemPosY = theElement.offsetTop;
	theElement = theElement.offsetParent;
	while(theElement!= null){
		elemPosX += theElement.offsetLeft;
		elemPosY += theElement.offsetTop;
		theElement = theElement.offsetParent;
	}
}

function showMenu(xSub){
	xSub.display = "block";
}

function showSub(xMenu,xSub){
	getObjectXY(xMenu);
	theDiv = document.getElementById(xSub).style;
	
	theDiv.left = elemPosX - 20;
	theDiv.top = elemPosY + 20;
	
	theDiv.display = "block";
	var menuShow = setTimeout("hideSub('" + xSub + "')",5000);
}

function hideSub(xDiv){
	document.getElementById(xDiv).style.display = 'none';
}

function changeBG(xSpan,xMenu){
	xSpan.style.cursor = "pointer";
	if(xSpan.style.background.toUpperCase()=="#C0C0D0"){
		XSpan.style.background="#C0C000";
		if(menuShow)window.clearTimeout(menuShow);
	}
	else{
		xSpan.style.background="#C0C0D0";
		menuShow = setTimeout("hideSub('" + xMenu + "')",300);
	}
}

function openLink(xLink,xHow){
	if(xHow)newWin=window.open(xHow);
	else document.location.href=xLink;
}
