// JavaScript Document

function setActives() {
	var page = window.location.pathname;	
	var idVal = "";
	var categoryVal = "";
	if(page.match("index")) {				
	  idVal = "1";		
	} else if(page.match("office-furniture")) {
    idVal = "2";
		var str = window.location.search;
		// send in a start and finish to return a stubstring
		// this will be the cat value and the id of the <li> in products
		categoryVal = str.substring(str.indexOf("=")+1, str.indexOf("&"));
		if(!(categoryVal.match("cat=")))
			document.getElementById(categoryVal).className = "active";
	} else if(page.match("inventory")) {
		idVal = "3";
	} else if(page.match("services")) {
		idVal = "4";
	} else if(page.match("company")) {
		idVal = "5";
	} else if(page.match("environment")) {
		idVal = "6";
	} else if(page.match("contact")) {
		idVal = "7";
	} 		
	document.getElementById(idVal).className = "active";
}