var xmlhttp;


function BrandNavOn() {
	ID = document.getElementById('dropbrand');
	ID.style.display = "block";
	ID = document.getElementById('mainbrand');
	ID.style.backgroundPosition = "center right";
}

function BrandNavOff() {
	ID = document.getElementById('dropbrand');
	ID.style.display = "none";
	ID = document.getElementById('mainbrand');
	ID.style.backgroundPosition = "center left";
}


function TypeNavOn() {
	ID = document.getElementById('droptype');
	ID.style.display = "block";
	ID = document.getElementById('maintype');
	ID.style.backgroundPosition = "center right";
}

function TypeNavOff() {
	ID = document.getElementById('droptype');
	ID.style.display = "none";
	ID = document.getElementById('maintype');
	ID.style.backgroundPosition = "center left";
}




function loadXMLDoc(selVal,selURL,dispVal)
{

	do_sIFR_rollback();

	//alert(selVal);

	xmlhttp=null;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest();
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	if (xmlhttp!=null)
	  {
	  // xmlhttp.onreadystatechange=state_Change;
	  // xmlhttp.open("GET",url,true);
	  // xmlhttp.send(null);

	var searchStr;
	searchStr="x="+escape(selVal);

	xmlhttp.onreadystatechange=state_Change;
	xmlhttp.open("POST", selURL, true);
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
	xmlhttp.send(searchStr);
	document.getElementById("headtext").innerHTML = dispVal;

  
	  }
	else
	  {
	  alert("Your browser does not support XMLHTTP.");
	  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
	  {
	  // if "OK"
	  if (xmlhttp.status==200)
		{
		// alert("XML data OK")
		document.getElementById("insideprods").innerHTML=xmlhttp.responseText;
		myLightWindow._setupLinks();
		
		do_sIFR();
		
		if (window.resetPane) resetPane();	// resets indices for horizontal scrolling
		
		}
	  else
		{
		alert("Problem retrieving XML data:" + xmlhttp.statusText);
		}
	  }
}

function do_sIFR(){
		// should match sifr.replace for h1 in sifr-config
		sIFR.replace (	didot_htf_m06, 
		{
	    selector: 'h1',
		wmode: 'transparent',
	    css: [ '.sIFR-root { color: #c01820; leading: -14;  }', ]
		}
	);
};

function do_sIFR_rollback(){
		var headtext = document.getElementById("headtext");
		headtext.innerHTML = "";
		headtext.className = headtext.className = "";
};

