// JavaScript Document
function handleOver(which) { 
 	if (which == "who")
	{
		document.getElementById('secnav').style.display='block'
		document.getElementById('secnav').innerHTML='<ul><li style="padding-left:0px; margin-left:0px;"><a id="menu7" href="/theteam.html" title="THE TEAM" target="_self">&nbsp;&nbsp;&nbsp;&nbsp;THE TEAM&nbsp;&nbsp;</a>&nbsp;&nbsp;<span style="color:#000000; font-weight:bold;">|</span></li><li><a id="menu8" href="/testimonials.html" title="TESTIMONIALS" target="_self">TESTIMONIALS</a></li></ul>';
	}
	else if (which == "what")
	{
		document.getElementById('secnav').style.display='block'
		document.getElementById('secnav').innerHTML='<ul><li style="padding-left:0px; margin-left:0px;"><a id="menu9" href="/audiovideo.html" title="AV & AUTOMATION" target="_self">AV & AUTOMATION</a>&nbsp;&nbsp;<span style="color:#000000; font-weight:bold;">|</span></li><li><a id="menu10" href="/greenenergy.html" title="GREEN ENERGY" target="_self">GREEN ENERGY</a></li></ul>';
	}
	else
	{
		document.getElementById('secnav').style.display='none';
	}
 
}

menuItems=["whoweare.html", "whatwedo.html", "showcase.html", "products.html", "faqs.html", "partners.html", "contactus.html", "theteam.html", "testimonials.html", "audiovideo.html", "greenenergy.html", "autogallery.php"];
function setCurrentPage()
{
	var URL = unescape(location.href);	// get current URL in plain ASCII
	var xstart = URL.lastIndexOf("index.html") + 1;
	var xend = URL.length;
	var qind = URL.lastIndexOf("?");
	if (qind > 1)
		xend = qind;
	//alert(xstart + " " + xend)
	var hereName = URL.substring(xstart,xend);
	var i=1;
	for (i = 0; i < menuItems.length;i++)
	{
		if (hereName == menuItems[i])
		{
			
			var aName = "menu"+i;
			if ((i==7)||(i==8)) //if submenu
			{
				handleOver('who');
				document.getElementById("menu0").className = "here";
				document.getElementById(aName).className = "here";
			}
			else if ((i==9)||(i==10))
			{
				handleOver('what');
				document.getElementById("menu1").className = "here";
				document.getElementById(aName).className = "here";
			}
			else if (i==0)
			{
				handleOver('who');
				document.getElementById(aName).className = "here";
			}
			else if (i==1)
			{
				handleOver('what');
				document.getElementById(aName).className = "here";
			}
			else if (i==11)
			{
				
				document.getElementById("menu2").className = "here";
			}
			else
			{
				document.getElementById(aName).className = "here";
				
			}
			
		}
	}
}
//window.onload=setCurrentPage();
