// JavaScript Document
var obj

function EnclosureSize_onChange(strValue)
{
	var url = "includes/ajax_searchenclosuresize.asp?criteria=" + strValue;

	if (window.XMLHttpRequest) {
		obj = new XMLHttpRequest();
		obj.onreadystatechange = EnclosureSize_Response;
		obj.open("GET", url, true);
		obj.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		obj = new ActiveXObject("Microsoft.XMLHTTP");
		if (obj) {
			obj.onreadystatechange = EnclosureSize_Response;
			obj.open("GET", url, true);
			obj.send();
		}
	}

	return false;
}

function EnclosureSize_Response()
{
	var PT_ID, Highlights

	if(obj.readyState == 4)
		if(obj.status == 200)
		{
			PT_ID = obj.responseText.substring(0, obj.responseText.indexOf('|', 0));
			Highlights = obj.responseText.substring((obj.responseText.indexOf('|', 0) + 1), obj.responseText.length - (obj.responseText.indexOf('|', 0) - 2));

			if (String(Highlights).substring(String(Highlights).length, String(Highlights).length - 1) != ','){
				Highlights = Highlights + ','
			}
	
			if (PT_ID != '')
				window.location.href = 'prodtype.asp?PT_ID=' + PT_ID + '&highlight=' + Highlights;
		}
}

function WallMountableEnclosures_onChange(strValue)
{
	window.location.href = 'prodtype.asp?PT_ID=' + strValue;
	
	/*
	var url = "includes/ajax_searchwallmountableenclosures.asp?criteria=" + strValue;

	if (window.XMLHttpRequest) {
		obj = new XMLHttpRequest();
		obj.onreadystatechange = WallMountableEnclosures_Response;
		obj.open("GET", url, true);
		obj.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		obj = new ActiveXObject("Microsoft.XMLHTTP");
		if (obj) {
			obj.onreadystatechange = WallMountableEnclosures_Response;
			obj.open("GET", url, true);
			obj.send();
		}
	}

	return false;
	*/
}

function WallMountableEnclosures_Response()
{
	if(obj.readyState == 4)
		if(obj.status == 200)
		{
			PT_ID = obj.responseText.substring(0, obj.responseText.indexOf('|', 0));
			Highlights = obj.responseText.substring((obj.responseText.indexOf('|', 0) + 1), obj.responseText.length - (obj.responseText.indexOf('|', 0) - 2));

			if (PT_ID != '')
				window.location.href = 'prodtype.asp?PT_ID=' + PT_ID + '&highlight=' + Highlights;
		}
}

function SealedEnclosures_onChange(strValue)
{
	window.location.href = 'prodtype.asp?PT_ID=' + strValue;

	/*
	var url = "includes/ajax_searchsealedenclosures.asp?criteria=" + strValue;

	if (window.XMLHttpRequest) {
		obj = new XMLHttpRequest();
		obj.onreadystatechange = WallMountableEnclosures_Response;
		obj.open("GET", url, true);
		obj.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		obj = new ActiveXObject("Microsoft.XMLHTTP");
		if (obj) {
			obj.onreadystatechange = WallMountableEnclosures_Response;
			obj.open("GET", url, true);
			obj.send();
		}
	}

	return false;
	*/
}

function SealedEnclosures_Response()
{
	if(obj.readyState == 4)
		if(obj.status == 200)
		{
			PT_ID = obj.responseText.substring(0, obj.responseText.indexOf('|', 0));
			Highlights = obj.responseText.substring((obj.responseText.indexOf('|', 0) + 1), obj.responseText.length - (obj.responseText.indexOf('|', 0) - 2));

			if (PT_ID != '')
				window.location.href = 'prodtype.asp?PT_ID=' + PT_ID + '&highlight=' + Highlights;
		}
}