<!--
// Filename: supportCenterSearchForm.js
// Project : willburt.com
	
	function FilterProductModels()
	{
		//get the product ID value selected
		var lngPrdID = document.getElementById( 'prdID' ).value;
		var xmlHttp = AJAX_GetXMLHttp();
		if ( xmlHttp == null )
		{
			alert( "Error: Could not instantiate XmlHttp object." );
			return;
		}
		//get the product models
		xmlHttp.open( 'GET', 'xml/supportCenterSearchFormXml.asp?ID=' + lngPrdID, true );
		xmlHttp.send( 'ID=' + lngPrdID );
		xmlHttp.onreadystatechange = function()
		{
			if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 )
			{
				//filter the model dropdown
				PopulateModelDropdown( xmlHttp.responseText, lngPrdID );
			}
		}
	}
	
	function PopulateModelDropdown( xmlString, lngPrdID )
	{
		var xmlDoc;
		var dataset;
		var objSel;
		var strPrmName;
		var lngPrmID;
		var i;
		
		//get the dropdown we are populating
		objSel = document.getElementById( 'prmID' );
		//reset the drop down
		objSel.options.length = 1;
		// Instantiate the xml parser
		xmlDoc = AJAX_GetXMLParser();
		if ( xmlDoc == null )
		{
			alert( "Error: Could not instantiate XML parser." );
			return;
		}
		// Load the XML string
		xmlDoc = AJAX_LoadXML( xmlDoc, xmlString );
		if ( xmlDoc == null )
		{
			alert( "Error: Could not parse XML data." );
			return;
		}
		//get the dataset
		dataset = xmlDoc.getElementsByTagName( 'ProductModels' );
		if ( dataset.length != 0 )
		{
			//loop through the xml data
			for ( var i=0; i < dataset.length; i++ )
			{
				lngPrmID = dataset[i].childNodes[0].firstChild.nodeValue;
				strPrmName = dataset[i].childNodes[1].firstChild.nodeValue;
				//update the dropdown
				objSel.options[ objSel.options.length ] = new Option( strPrmName, lngPrmID, false, false );
			}
		}
	}
//-->

