// JavaScript Document
var popupTimer;

function showPopup(popupID){
	hidePopups();
	stopTimer();
	popupRef=document.getElementById(popupID);
	popupRef.style.display="block";
	popupRef.style.left="0px";
	popupRef.style.top="30px";
}

function hidePopups(){
	document.getElementById("crollco-services").style.display="none";
	document.getElementById("crollco-professionals").style.display="none";
}

function startTimer(){
	stopTimer();
	popupTimer=setTimeout("hidePopups()",300);
}

function stopTimer(){
	clearTimeout(popupTimer);
}

function showServices(){
	showPopup("crollco-services");
}
function showProfessionals(){
	showPopup("crollco-professionals");
}
function hilight(){
	this.style.color="#974b07";
}
function unhilight(){
	this.style.color="#ffffff";
}

function initMenu(){
	document.getElementById("crollco-services").onmouseover=stopTimer;
	document.getElementById("crollco-services").onmouseout=startTimer;
	document.getElementById("crollco-professionals").onmouseover=stopTimer;
	document.getElementById("crollco-professionals").onmouseout=startTimer;
	document.getElementById("menu-services").onmouseover=showServices;
	document.getElementById("menu-services").onmouseout=startTimer;
	document.getElementById("menu-professionals").onmouseover=showProfessionals;
	document.getElementById("menu-professionals").onmouseout=startTimer;
	document.getElementById("menu-faqs").onmouseover=hidePopups;
	document.getElementById("menu-contact").onmouseover=hidePopups;
	document.getElementById("menu-home").onmouseover=hidePopups;
	var lis1=document.getElementById("crollco-services").getElementsByTagName("A");
	var lis2=document.getElementById("crollco-professionals").getElementsByTagName("A");
	var i=0;
	while(lis1[i]){
		lis1[i].onmouseover=hilight;
		lis1[i].onmouseout=unhilight;
		i++;
	}
	i=0;
	while(lis2[i]){
		lis2[i].onmouseover=hilight;
		lis2[i].onmouseout=unhilight;
		i++;
	}
}
