	var strCategory
	strCategory = "";
	var strSubcategory1
	strSubcategory1 = "";
	var strSubcategoryCables
	strSubcategoryCables = "";
	var strSubcategory2
	strSubcategory2 = "";
	// ===================================================
function showLayer(LayerName) {
	if (document.getElementById) { 
  		objLayer = document.getElementById(LayerName).style; 
  	} else {
		var doc = document.layers; 
		var style = '';
	    objLayer = eval('doc.' + LayerName + style);
	}
   	objLayer.visibility = 'visible';
}
// ===================================================
function hideLayer(LayerName) {
	if (document.getElementById) { 
		try{
			objLayer = document.getElementById(LayerName).style; 
   			objLayer.visibility = 'hidden';
		}
		catch(error){
			//let it slide...
		}	
  	} else {
		var doc = document.layers; 
		var style = '';
		try{
			objLayer = eval('doc.' + LayerName + style);
   			objLayer.visibility = 'hidden';
		}
		catch(error){
			//let it slide...
		}			
	}
}
// ===================================================
function pickCategory(layername) {
	//alert( strCategory + " : " + strSubcategory1 + " : " + strSubcategory2);
	if (strCategory > "") {
		document.getElementById('a'+strCategory).className = 'cDrill'; 
		hideLayer(strCategory);
		if (strSubcategory1 > "") {
			hideLayer(strSubcategory1);
			if (strSubcategory1 == "10") {
				hideLayer("model");
				document.form11.manufacturer.value = "0";
				document.form11.model.value = "0";
				document.getElementById('a'+strSubcategoryCables).className = 'cDrill';				
			} else {
				document.getElementById('a'+strSubcategory1).className = 'cDrill'; 
			}
			strSubcategory1 = "";
			if (strSubcategory2 > "") {
				document.getElementById('a'+strSubcategory2).className = 'cDrill'; 
				hideLayer(strSubcategory2);
				strSubcategory2 = "";
			}			
		}
	}	
	document.getElementById('a'+layername).className = 'cDrillOn'; 
	strCategory = layername;
	hideLayer("monitor");
	hideLayer("part");
	hideLayer("model2");
	showLayer(layername);	
}
// ===================================================
function startAgain() {
	if (strCategory > "") {
		document.getElementById('a'+strCategory).className = 'cDrill'; 
		hideLayer(strCategory);
		if (strSubcategory1 > "") {
			hideLayer(strSubcategory1);
			if (strSubcategory1 == "10") {
				hideLayer("model");
				document.form11.manufacturer.value = "0";
				document.form11.model.value = "0";
				document.getElementById('a'+strSubcategoryCables).className = 'cDrill'; 
			} else {
				document.getElementById('a'+strSubcategory1).className = 'cDrill'; 
			}
			strSubcategory1 = "";
			if (strSubcategory2 > "") {
				document.getElementById('a'+strSubcategory2).className = 'cDrill';
				hideLayer(strSubcategory2);
				strSubcategory2 = "";
			}			
		}
		strCategory = "";
		showLayer("monitor");
		showLayer("part");
	}	
	hideLayer("model2");
	document.form2.manufacturer2.value = "0";
}
// ===================================================
function pickSubcategory(layername) {
	if (strSubcategory1 > "") {
		hideLayer(strSubcategory1);
		if (strSubcategory1 == "10") {
			hideLayer("model");
			document.form11.manufacturer.value = "0";
			document.form11.model.value = "0";
			document.getElementById('a'+strSubcategoryCables).className = 'cDrill'; 
		} else {
			document.getElementById('a'+strSubcategory1).className = 'cDrill'; 
		}			
		if (strSubcategory2 > "") {
			document.getElementById('a'+strSubcategory2).className = 'cDrill'; 
			hideLayer(strSubcategory2);
			strSubcategory2 = "";
			hideLayer("model");
		}
	}
	strSubcategory1 = layername;
	document.getElementById('a'+layername).className = 'cDrillOn';
	showLayer(layername);
}
// ===================================================
function pickSubcategoryCables(layername) {
	if (strSubcategory1 > "") {
		hideLayer(strSubcategory1);		
		if (strSubcategory1 == "10") {
			hideLayer("model");
			document.form11.manufacturer.value = "0";
			document.form11.model.value = "0";
			document.getElementById('a'+strSubcategoryCables).className = 'cDrill';
		} else {
			document.getElementById('a'+strSubcategory1).className = 'cDrill';
		}
		if (strSubcategory2 > "") {
			document.getElementById('a'+strSubcategory2).className = 'cDrill';
			hideLayer(strSubcategory2);
			strSubcategory2 = "";
			hideLayer("model");
		}
	}
	strSubcategoryCables = layername;
	document.getElementById('a'+layername).className = 'cDrillOn';
	strSubcategory1 = "10";
	get_manufacturers(layername);
	showLayer("10");	
}
// ===================================================
function gotoIfValidModel() {
	if (document.form11.model.value == "0") {
		alert("Please select a model...");
	} else {
		gotoProductList('0','0');
	}
}
// ===================================================
function gotoProductList(thislevel,thisselection) {
	switch(thislevel) {
	case "1": 
		strCategory = thisselection;
		break;
	case "2":
		strSubcategory1 = thisselection;
		break;
	case "3":
		strSubcategory2 = thisselection;
		break;
	}
	if (strSubcategory1 == "10") strSubcategory1 = strSubcategoryCables;
	//alert(strSubcategory1);
	//alert( strCategory + " : " + strSubcategory1 + " : " + strSubcategory2);
	//if (strCategory > "") hideLayer(strCategory);
	//if (strSubcategory1 > "") hideLayer(strSubcategory1);
	//if (strSubcategory2 > "") hideLayer(strSubcategory2);
	window.location="products_expanded.php?cat=" + strCategory + "&sub1=" + strSubcategory1 + "&sub2=" + strSubcategory2 + "&man=" + document.form11.manufacturer.value + "&mon=" + document.form11.model.value
}
// ===================================================
function gotoMonitorList() {
	if (document.form2.manufacturer2.value == 0) {
		window.location="monitor.php";
	} else {
		if (document.form2.model2.value == 0) {
			window.location="monitor.php?mid=" + document.form2.manufacturer2.value;
		} else {
			window.location="monitor.php?id=" + document.form2.model2.value;
		}
	}
}
// ===================================================
function gotoPartList() {
	if (document.form3.part3.value == "") {
		alert('Please enter a part number.');
	} else {
		window.location="search.php?keywords=" + document.form3.part3.value + "&area=all&select=any";
	}
}
// ===================================================
function keyPartNumber(oEvent) {
	if(oEvent.keyCode == 13) { 
		gotoPartList();
	}
}
// ===================================================
function pickManufacturer(strUse) {
	if (strUse == "drilldown") {
		if (document.form11.manufacturer.value == "0") {
			hideLayer("model");
		} else {
			get_monitors();
			showLayer("model");
		}
	} else {
		if (document.form2.manufacturer2.value == "0") {
			hideLayer("model2");
		} else {
			get_monitors2();
			showLayer("model2");
		}		
	}
}
// ===================================================
var xmlHttp

//The purpose of the function is to solve the problem of creating different XMLHTTP objects for different browsers.
function GetXmlHttpObject()
{
try
{ // Opera 8.0+, Firefox, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e)
{ // Internet Explorer Browsers
try {
//IE 6 +
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{ //IE 5.5
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
// ===================================================
function state_manufacturers(){ 
	if (xmlHttp.readyState==4){ 
		//lets get a grip on the PHP-generated XML document using some DOM
		var xmlDoc = xmlHttp.responseXML.documentElement;
	
		//check if any manufacturers exist..ie if the XML document returned an <empty> element then we assume none exist
		var empty = xmlDoc.getElementsByTagName('empty');
		if (empty.length) { 
			//get a handle to our manufacturers menu
			var our_form = document.form11.manufacturer 
	
			//remove all options by setting the options array's length to 0 
			our_form.options.length=0 
			our_form.options[0]=new Option("Select a manufacturer","0",false, false)
		} else { 
			//get a handle to our manufacturers menu
			var our_form = document.form11.manufacturer 
	
			//remove all options in the manufacturers menu by setting the options array's length to 0 
			our_form.options.length=0
			
			our_form.options[0]=new Option("Select a manufacturer","0",false, false)
			//declare some variables
			var manufacturer_id, manufacturer_name 
	
			//how many manufacturers (i.e. XML elements) did our XML document return?
			var length = xmlDoc.getElementsByTagName('man').length;
	
			// populate the select menu with new options, using the Option() constructor on each option. Loop through based on how many manufacturers we have 
			for (var i=0; i < length; i++) {
				manufacturer_id = xmlDoc.getElementsByTagName("id")[i].childNodes[0].nodeValue;
				manufacturer_name = xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue; 
				our_form.options[i+1]=new Option(manufacturer_name, manufacturer_id, false, false)
			} 
		}//else 
	}//if (xmlHttp.readyState==4) 
}
// ===================================================
function state_monitors(){ 
	if (xmlHttp.readyState==4){ 
		//lets get a grip on the PHP-generated XML document using some DOM
		var xmlDoc = xmlHttp.responseXML.documentElement;
	
		//check if any manufacturers exist..ie if the XML document returned an <empty> element then we assume none exist
		var empty = xmlDoc.getElementsByTagName('empty');
		if (empty.length) { 
			//get a handle to our manufacturers menu
			var our_form = document.form11.model 
	
			//remove all options by setting the options array's length to 0 
			our_form.options.length=0 
			our_form.options[0]=new Option("Select a model","0",false, false)
		} else { 
			//get a handle to our manufacturers menu
			var our_form = document.form11.model 
	
			//remove all options in the manufacturers menu by setting the options array's length to 0 
			our_form.options.length=0
			
			our_form.options[0]=new Option("Select a model","0",false, false)
			//declare some variables
			var monitor_id, monitor_name 
	
			//how many manufacturers (i.e. XML elements) did our XML document return?
			var length = xmlDoc.getElementsByTagName('mon').length;
	
			// populate the select menu with new options, using the Option() constructor on each option. Loop through based on how many manufacturers we have 
			for (var i=0; i < length; i++) {
				monitor_id = xmlDoc.getElementsByTagName("id")[i].childNodes[0].nodeValue;
				monitor_name = xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue; 
				our_form.options[i+1]=new Option(monitor_name, monitor_id, false, false)
			} 
		}//else 
	}//if (xmlHttp.readyState==4) 
}
// ===================================================
function state_monitors2(){ 
	if (xmlHttp.readyState==4){ 
		//lets get a grip on the PHP-generated XML document using some DOM
		var xmlDoc = xmlHttp.responseXML.documentElement;
	
		//check if any manufacturers exist..ie if the XML document returned an <empty> element then we assume none exist
		var empty = xmlDoc.getElementsByTagName('empty');
		if (empty.length) { 
			//get a handle to our manufacturers menu
			var our_form = document.form2.model2 
	
			//remove all options by setting the options array's length to 0 
			our_form.options.length=0 
			our_form.options[0]=new Option("Select a model","0",false, false)
		} else { 
			//get a handle to our manufacturers menu
			var our_form = document.form2.model2 
	
			//remove all options in the manufacturers menu by setting the options array's length to 0 
			our_form.options.length=0
			
			our_form.options[0]=new Option("Select a model","0",false, false)
			//declare some variables
			var monitor_id, monitor_name 
	
			//how many manufacturers (i.e. XML elements) did our XML document return?
			var length = xmlDoc.getElementsByTagName('mon').length;
	
			// populate the select menu with new options, using the Option() constructor on each option. Loop through based on how many manufacturers we have 
			for (var i=0; i < length; i++) {
				monitor_id = xmlDoc.getElementsByTagName("id")[i].childNodes[0].nodeValue;
				monitor_name = xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue; 
				our_form.options[i+1]=new Option(monitor_name, monitor_id, false, false)
			} 
		}//else 
	}//if (xmlHttp.readyState==4) 
}
// ===================================================
function get_manufacturers(categoryid) {
	//The user selected a car maker from the menu, so lets rock with some AJAX!!!
	if (categoryid == 0) { 
		//get a handle to our manufacturers menu
		var our_form = document.form11.manufacturer 
	
		//remove all options by setting the options array's length to 0 
		our_form.options.length=0 
		our_form.options[0]=new Option("Select a manufacturer","0",false, false) 
	} else { 
		//create object via function call
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert ("Your browser does not support AJAX!");
			return;
		}
		//create querystring to our PHP page - pass the 'id' of the selected category
		var url="/ajax_get_manufacturers.php?id=" + categoryid; 
	
		//make request, specify response function and send request
		xmlHttp.open("GET",url,true); 
		xmlHttp.onreadystatechange=state_manufacturers;
		xmlHttp.send(null);
	} 
}
// ===================================================
function get_monitors() {
	//create object via function call
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	}
	//create querystring to our PHP page - pass the 'id' of the selected category
	var url="/ajax_get_monitors.php?manid=" + document.form11.manufacturer.value +"&cat=" + strSubcategoryCables;
	//alert(url);
	//make request, specify response function and send request
	xmlHttp.open("GET",url,true); 
	xmlHttp.onreadystatechange=state_monitors;
	xmlHttp.send(null);
}
// ===================================================
function get_monitors2() {
	//create object via function call
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	}
	//create querystring to our PHP page - pass the 'id' of the selected category
	var url="/ajax_get_monitors2.php?manid=" + document.form2.manufacturer2.value;
	//alert(url);
	//make request, specify response function and send request
	xmlHttp.open("GET",url,true); 
	xmlHttp.onreadystatechange=state_monitors2;
	xmlHttp.send(null);
}
