window.onload = onLoadHandler;
	
var tab1 = document.getElementById('nav-tab1-sub');
var tab2 = document.getElementById('nav-tab2-sub');
var tab3 = document.getElementById('nav-tab3-sub');

function onLoadHandler(){
	var url = document.URL;
	if(url.search("project-management")>0)
		document.getElementById("nav-tab1").className = "active-tab1";
	if(url.search("custom-solutions")>0)
		document.getElementById("nav-tab2").className = "active-tab2";
	if(url.search("services")>0)
		document.getElementById("nav-tab3").className = "active-tab3";
	
	divMouseOver();	
/*	if(url == "http://www.walshwireless.com/")
		handleSwf();*/
}

function divMouseOver(){
	tab1.mouseIsOver = false;
	tab2.mouseIsOver = false;
	tab3.mouseIsOver = false;
}
function showSubNav(tabNo){
	switch(tabNo){
		case 1: tab1.style.visibility = 'visible';
				break;
		case 2: tab2.style.visibility = 'visible';
				break;
		case 3: tab3.style.visibility = 'visible';
				break;
	}
}
function hideSubNav(tabNo){
	
	switch(tabNo){
		case 1: tab1.style.visibility = 'hidden';		
				break;
		case 2: tab2.style.visibility = 'hidden';
				break;
		case 3: tab3.style.visibility = 'hidden';
				break;
	}
}

function checkMouseStatus(tabNo){
	tab1.onmouseover = function(){
		this.mouseIsOver = true;
		showSubNav(1);
	}
	tab2.onmouseover = function(){
		this.mouseIsOver = true;
		showSubNav(2);
	}
	tab3.onmouseover = function(){
		this.mouseIsOver = true;
		showSubNav(3);
	}
	
	tab1.onmouseout = function(){
		this.mouseIsOver = false;
		hideSubNav(1);
	}
	tab2.onmouseout = function(){
		this.mouseIsOver = false;
		hideSubNav(2);
	}
	tab3.onmouseout = function(){
		this.mouseIsOver = false;
		hideSubNav(3);
	}
	
	if(tabNo == 1)
	{
		if(!tab1.mouseIsOver)
		{
			hideSubNav(1);
		}
	}
	if(tabNo == 2)
	{
		if(!tab2.mouseIsOver)
			hideSubNav(2);
	}
	if(tabNo == 3)
	{
		if(!tab3.mouseIsOver)
			hideSubNav(3);
	}
}