	
	searching = false;
	open_products = Array();
	
	function expand(menu_item)
	{
		//alert(menu_item.getAttribute("open"));
		product = document.getElementById(menu_item.id + "_items");
		//menu_item.className += " hover";
		
		//if this guys open, close him and split
		if(menu_item.getAttribute("open") == "true")
		{
			unexpand(menu_item);
			return true;
		}
		
		
		//hide any open products
		hideOpenProducts();
		open_products = new Array();
		menu_item.style.backgroundColor = "#757575";
		//menu_item.style.borderBottom = "none";

		product.style.display = 'block';
		
		open_products[open_products.length] = menu_item;
		menu_item.setAttribute("open", "true");
	}
	
	
	function unexpand(menu_item2)
	{
		p2 = null;
		p2 = document.getElementById(menu_item2.id + "_items");
		p2.style.display = 'none';
		menu_item2.setAttribute("open", "false");
		menu_item2.style.backgroundColor = "transparent";
		//menu_item2.style.borderBottom = "solid red 1px;";
	}
	
	
	function hideOpenProducts()
	{
		if(open_products.length > 0)
		{
			for(i = 0; i < open_products.length; i++)
			{
					unexpand(open_products[i]);
			}
		}
	}
	
	
	function xreplace(checkMe,toberep,repwith)
	{
		var temp = checkMe;
		var i = temp.indexOf(toberep);
		while(i > -1){
		temp = temp.replace(toberep, repwith);
		i = temp.indexOf(toberep);
		}
		return temp;
	} 	
		
	
	function hoverNavs() 
	{
		topnavs = document.getElementById('topnavitems');
		rows = topnavs.childNodes;	
		for(row=0;row<rows.length;row++) 
		{
			if(rows.item(row).nodeName == "TD")
			{
				if(rows.item(row).id != "searchnav" && rows.item(row).id != "page_buttons")
				{
					
					rows.item(row).onmouseover = function(){this.className += " hover";};
					rows.item(row).onmouseout = function(){this.className = this.className.replace("hover","");};
				}
				else 
				{
					//rows.item(row).onmouseover = function(){this.className += " hover";};
					//rows.item(row).onmouseout = function(){if(!searching){this.className = this.className.replace("hover","");}};					
				}
			}
		}
		
		bottomnavs = document.getElementById('bottomnavitems');
		rows = bottomnavs.childNodes;	
		for(row=0;row<rows.length;row++) 
		{
			if(rows.item(row).nodeName == "TD")
			{
				rows.item(row).onmouseover = function(){this.className += " hover";};
				rows.item(row).onmouseout = function(){this.className = this.className.replace("hover","");};
			}
		}
		
		
		leftnavs = document.getElementById('leftmenu');
		rows = leftnavs.childNodes;	
		for(row=0;row<rows.length;row++) 
		{
			if(rows.item(row).nodeName == "DIV")
			{
				rows.item(row).onmouseover = function(){if(this.getAttribute("open") != "true") this.style.backgroundColor = '#757575';};
				rows.item(row).onmouseout = function(){if(this.getAttribute("open") != "true") this.style.backgroundColor = 'transparent';};
			}
		}
		
	}
	
	function openLink(theLink)
	{
		win = window.open(theLink,"newWin","width=600,height=600,left=100,scrollbars=yes,resizable=yes,location=yes");
		win.focus;
	}
	
		
	function showpopup(url)
	{
		var width = 600;
		var height = 500;
		newWin1 = window.open(url, "NCE", "toolbar=no,status=0,location=no,menubar=no,directories=no,scrollbars=yes,resizable=yes,screenX=100,screenY=100,left=100,top=100,width=" + width + ",height=" + height);
	}
	
	function PrintPage(thePage)
	{
		previewWindow = open(thePage, "submap", "width=650, height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes");
	}
	
	function chk(obj)
{
    var  O = obj;
    var pI = "";
    for(var propertyName in O){
     pI += propertyName + " = " + O[propertyName] + "  <br />   ";
     }
    document.write(pI)
}  

