function leftnavcontrol(element,HasSubNav,RecordID) {
	//grab the info from the top navigation bar nodes
liArray=document.getElementById("nav").childNodes; 
i=0; 


var menuliArray = document.getElementById("nav").getElementsByTagName("li"); 
//loop settings all diplsya to nothing
for (var j=0; j<menuliArray.length; j++) {
			var innerarray = menuliArray[j].getElementsByTagName("ul")
				for (var k = 0;k<innerarray.length; k++) {			
					innerarray[k].style.display = "none";
				}
}


//now we figure out what to show to the user
if (HasSubNav == "False") 
{
//just go to the products page
if (RecordID) {
	if (RecordID==1) {
	document.location="index.asp"	
	}
	else
	{
document.location="content.asp?RecordID=" + RecordID	
	}
}
else {
document.location="content.asp?RecordID=" + RecordID + "&SubNavIDID=0"
}
}
else
{
	//open up the inner sub cats for viewing
	document.getElementById("subarea_" + RecordID).style.display = 'block';
	getSubCats(RecordID);
}
	
	
}




var xmlHttp;
var rootpath;
 
rootpath = "";   // be sure to change this to your URL
 
function getSubCats(RecordID)
{
	myRand=parseInt(Math.random()*99999999);  // cache buster
	 var url=rootpath + "leftnav_subcat_lookup.asp?RecordID=" + RecordID  + "&rand=" + myRand
     
    //xmlHttp=GetXmlHttpObject(stateChanged(str))
	xmlHttp=GetXmlHttpObject(function(){stateChanged(RecordID)})
    xmlHttp.open("GET", url , true)
    xmlHttp.send(null)
	
}
 
function stateChanged(RecordID)
{
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {
		
		
		document.getElementById("subarea_" + RecordID).innerHTML=xmlHttp.responseText
		//document.getElementById('MemberArea" + MemberCount + "').innerHTML=xmlHttp.responseText
		
		 
		
    }
}

function GetXmlHttpObject(handler)
{
    var objXmlHttp=null
 
    if (navigator.userAgent.indexOf("Opera")>=0)
    {
        alert("Opera not supported...")
        return;
    }
    if (navigator.userAgent.indexOf("MSIE")>=0)
    {
        var strName="Msxml2.XMLHTTP"
        if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
        {
            strName="Microsoft.XMLHTTP"
        }
        try
        {
            objXmlHttp=new ActiveXObject(strName)
            objXmlHttp.onreadystatechange=handler
            return objXmlHttp
        }
        catch(e)
        {
            alert("Error. Scripting for ActiveX might be disabled")
            return
        }
    }
    if (navigator.userAgent.indexOf("Mozilla")>=0)
    {
        objXmlHttp=new XMLHttpRequest()
        objXmlHttp.onload=handler
        objXmlHttp.onerror=handler
        return objXmlHttp
    }
} 
