<!--
	function GetRegions( lngStateID )
	{
		var xmlHttp = AJAX_GetXMLHttp();
		if ( xmlHttp == null )
		{
			alert( "Error: Could not instantiate XmlHttp object." );
			return;
		}
		//build the action plan xml
		xmlHttp.open( 'GET', 'xml/contactRepLocatorXml.asp?ID=' + lngStateID, true );
		xmlHttp.send( 'ID=' + lngStateID );
		xmlHttp.onreadystatechange = function()
		{
			if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 )
			{
				//list the installers for the selected state
				ListRepresentatives( xmlHttp.responseText, lngStateID );
			}
		}
	}
	function ListRepresentatives( xmlString, lngStateID )
	{
		var xmlDoc;
		var repDataset;
		var stateName;
		var strStateName;
		var lngRepID = 0;
		var lngRptID = 0;
		var strRepTerritories = '';
		var strName = '';
		var strContactName = '';
		var strAddress1 = '';
		var strAddress2 = '';
		var strCity = '';
		var strState = '';
		var strZip = '';
		var strPhone = '';
		var strFax = '';
		var strEMail = '';
		var strWebsite = '';
		var strHtm = '';
		var i;
		var x;
		var arrRepTer;
		
		if ( xmlString.length <= 0 )
		{
			return;
		}
		// 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 state name
		stateName = xmlDoc.getElementsByTagName( 'State' );
		strStateName = stateName[0].childNodes[0].firstChild.nodeValue;
		//update the state label
		document.getElementById( 'stateLabel' ).innerHTML = '<h1>' + strStateName + '</h1>';
		//get the installer data
		repDataset = xmlDoc.getElementsByTagName( 'NOVARepresentative' );
		if ( repDataset.length != 0 )
		{
			//loop through the representatives
			for ( var i=0; i < repDataset.length; i++ )
			{
				lngRepID = repDataset[i].childNodes[0].firstChild.nodeValue;
				lngRptID = repDataset[i].childNodes[1].firstChild.nodeValue;
				strRepTerritories = repDataset[i].childNodes[2].firstChild.nodeValue;
				strName = repDataset[i].childNodes[3].firstChild.nodeValue;
				strContactName = repDataset[i].childNodes[4].firstChild.nodeValue;
				strAddress1 = repDataset[i].childNodes[5].firstChild.nodeValue;
				strAddress2 = repDataset[i].childNodes[6].firstChild.nodeValue;
				strCity = repDataset[i].childNodes[7].firstChild.nodeValue;
				strState = repDataset[i].childNodes[8].firstChild.nodeValue;
				strZip = repDataset[i].childNodes[9].firstChild.nodeValue;
				strPhone = repDataset[i].childNodes[10].firstChild.nodeValue;
				strFax = repDataset[i].childNodes[11].firstChild.nodeValue;
				strEMail = repDataset[i].childNodes[12].firstChild.nodeValue;
				strWebsite = repDataset[i].childNodes[13].firstChild.nodeValue;
				//create a div for each representative
				strHtm += '<div class=\"novaRep\">';
				if ( strName != '-1' ) { strHtm += '<h3>' + strName + '</h3>'; }
				if ( strRepTerritories != '' )
				{
					strHtm += '<div style=\"float:left; margin-right:5px;\"><h4>Territories:</h4></div>'
					arrRepTer = strRepTerritories.split( '|' );
					strHtm += '<div style=\"float:left;">';
					for ( x=0; x < arrRepTer.length; x++ )
					{
						strHtm += '<div>' + arrRepTer[x] + '</div>'
					}
					strHtm += '</div>';
					strHtm += '<br style=\"clear:left;\">';
				}
				if ( strContactName != '-1' ) { strHtm += '<div><strong>Contact:</strong>&nbsp;' + strContactName + '</div>'; }
				strHtm += '<div style=\"float:left; margin-right:5px;"><h4>Address:</h4></div>';
				strHtm += '<div style=\"float:left;">';
				if ( strAddress1 != '-1' ) { strHtm += '<div>' + strAddress1 + '</div>'; }
				if ( strAddress2 != '-1' ) { strHtm += '<div>' + strAddress2 + '</div>'; }
				strHtm += '<div>';
				if ( strCity != '-1' ) { strHtm += strCity; }
				if ( strState != '-1' ) { strHtm += ', ' + strState; }
				if ( strZip != '-1' ) { strHtm += '&nbsp;' + strZip; }
				strHtm += '</div>';
				strHtm += '</div>';
				strHtm += '<br style=\"clear:left;\">';
				if ( strPhone != '-1' ) { strHtm += '<div><strong>Phone:</strong>&nbsp;' + strPhone + '</div>'; }
				if ( strFax != '-1' ) { strHtm += '<div><strong>Fax:</strong>&nbsp;' + strFax + '</div>'; }
				if ( strEMail != '-1' ) { strHtm += '<div><strong>Email:</strong>&nbsp;<a href=\"mailto:' + strEMail + '\">' + strEMail + '</a></div>'; }
				if ( strWebsite != '-1' ) { strHtm += '<div><strong>Website:</strong>&nbsp;<a href=\"http://' + strWebsite + '\" target=\"_blank\">' + strWebsite + '</a></div>'; }
				//add the contact link
				strHtm += '<div style=\"margin-top:10px;\"><a href=\"contactRepForm.asp?ID=' + lngRepID + '&rptID=' + lngRptID + '\">Contact This Representative</a></div>';
				//close up the div
				strHtm += '</div>';
			}
			//update the list
			document.getElementById( 'stateReps' ).innerHTML = strHtm;
		}
		else
		{
			document.getElementById( 'stateReps' ).innerHTML = "<p style=\"margin-top:10px;\">This territory is temporarily unassigned. Please contact NOVA Solutions for additional information at 1-800-730-6682. We apologize for any inconvenience.</p>";
		}
	}
//-->
