<!--
	//Handle all the FSCommand messages in a Flash movie
	function mapUSInstallers_DoFSCommand(command, args)
	{ 
		// IE and Navgiator have slightly different document object models
	  	// IE treats objects as members of "window" while in Navigator,
	  	// embedded objects are members of "window.document"
	  	// Evaluate the command string and decide what to do
	  	if ( command=="HighlightInstaller" )
		{ 
	  		HighlightInstaller( parseInt(args));
 		}
	}
	var lngLastHighlight = 0;
	function HighlightInstaller( lngILID )
	{
		var arr = document.getElementById( 'hidLocID' ).value.split( ',' );
		if ( lngILID != 0 )
		{
			for ( var i=0; i<arr.length; i++ )
			{
				if ( arr[i] == lngILID )
				{
					if ( document.getElementById( 'installer' + arr[i] ) )
					{
						if ( document.getElementById( 'insLogo' + arr[i] ) )
						{
							document.getElementById( 'insLogo' + arr[i] ).style.display = 'block';
						}
						document.getElementById( 'installer' + arr[i] ).style.display = 'block';
					}
				}
				else
				{
					if ( document.getElementById( 'installer' + arr[i] ) )
					{
						if ( document.getElementById( 'insLogo' + arr[i] ) )
						{
							document.getElementById( 'insLogo' + arr[i] ).style.display = 'none';
						}
						document.getElementById( 'installer' + arr[i] ).style.display = 'none';
					}
				}
			}
			lngLastHighlight = lngILID;
		}
	}
	// GetSwf
	// however the browser supports it
	function GetSwf( strId )
	{
		if ( document.all )
		{
			return document.all[ strId ];
		}
		else if ( document.getElementById )
		{
			return document.getElementById( strId );
		}
		else
		{
			return null;
		}
	}
	//load the installer locations for the selected state
	function ActivateInstallerMarkers( lngID, strIDs, strXs, strYs )
	{
		document.getElementById( 'hidLocID' ).value = strIDs;
		var swf = GetSwf( 'mapUSInstallers' );
		if ( swf )
		{
			swf.TCallLabel( '/', 'LoadMarkers');
			swf.Stop( );
		}
	}
	function SelectInstaller( lngID )
	{
		//todo
		return;
	}
	function LoadInstallers( lngID )
	{
		document.getElementById( 'hidStaID' ).value = lngID;
		var xmlHttp = AJAX_GetXMLHttp();
		if ( xmlHttp == null )
		{
			alert( "Error: Could not instantiate XmlHttp object." );
			return;
		}
		//build the action plan xml
		xmlHttp.open( 'GET', 'xml/installerDataXml.asp?ID=' + lngID, true );
		xmlHttp.send( 'ID=' + lngID );
		xmlHttp.onreadystatechange = function()
		{
			if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 )
			{
				//list the installers for the selected state
				ListInstallers( xmlHttp.responseText, lngID );
			}
		}
	}
	function ClearSession()
	{
		document.getElementById( 'hidStaID' ).value = 0;
		var xmlHttp = AJAX_GetXMLHttp();
		if ( xmlHttp == null )
		{
			alert( "Error: Could not instantiate XmlHttp object." );
			return;
		}
		//build the action plan xml
		xmlHttp.open( 'GET', 'xml/installerDataXml.asp?ID=0', true );
		xmlHttp.send( 'ID=0' );
		xmlHttp.onreadystatechange = function()
		{
			if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 )
			{
				//do nothing
			}
		}
	}
	function ListInstallers( xmlString, lngID )
	{
		var xmlDoc;
		var stateName;
		var strStateName;
		var idSet;
		var xSet;
		var ySet;
		var installerDataset;
		var strIDs = '';
		var strXs = '';
		var strYs = '';
		var lngILID = 0;
		var lngDatID = 0;
		var strName = '';
		var strAddress1 = '';
		var strAddress2 = '';
		var strCity = '';
		var strState = '';
		var strZip = '';
		var strPhone = '';
		var strTollFree = '';
		var strFax = '';
		var strWebSite = '';
		var strEMail = '';
		var strHtm = '';
		var i;
		
		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 = strStateName;
		//get the IDs
		idSet = xmlDoc.getElementsByTagName( 'InstallerIDs' );
		strIDs = idSet[0].childNodes[0].firstChild.nodeValue;
		//get the X pos
		xSet = xmlDoc.getElementsByTagName( 'InstallerXs' );
		strXs = xSet[0].childNodes[0].firstChild.nodeValue;
		//get the Y pos
		ySet = xmlDoc.getElementsByTagName( 'InstallerYs' );
		strYs = ySet[0].childNodes[0].firstChild.nodeValue;
		//update the state label
		document.getElementById( 'StateLabel' ).innerHTML = strStateName;
		//get the installer data
		installerDataset = xmlDoc.getElementsByTagName( 'IceShieldInstaller' );
		if ( installerDataset.length != 0 )
		{
			//loop through the installers
			for ( var i=0; i < installerDataset.length; i++ )
			{
				lngILID = installerDataset[i].childNodes[0].firstChild.nodeValue;
				strName = installerDataset[i].childNodes[1].firstChild.nodeValue;
				strAddress1 = installerDataset[i].childNodes[2].firstChild.nodeValue;
				strAddress2 = installerDataset[i].childNodes[3].firstChild.nodeValue;
				strCity = installerDataset[i].childNodes[4].firstChild.nodeValue;
				strState = installerDataset[i].childNodes[5].firstChild.nodeValue;
				strZip = installerDataset[i].childNodes[6].firstChild.nodeValue;
				strPhone = installerDataset[i].childNodes[7].firstChild.nodeValue;
				strTollFree = installerDataset[i].childNodes[8].firstChild.nodeValue;
				strFax = installerDataset[i].childNodes[9].firstChild.nodeValue;
				strWebSite = installerDataset[i].childNodes[10].firstChild.nodeValue;
				strEMail = installerDataset[i].childNodes[11].firstChild.nodeValue;
				lngDatID = installerDataset[i].childNodes[12].firstChild.nodeValue;
				//create a div for each installer
				strHtm += '<div id=\"installer' + lngILID + '\" style=\"margin-bottom:10px;\">';
				//check for a custom logo
				if ( lngDatID != '0' )
				{
					strHtm += '<div id=\"insLogo' + lngILID + '\" class=\"logoBox\" style=\"display:none;\"><img src=\"dataDownload.asp?ID=' + lngDatID + '\" alt=\"\" border=\"0\"></div>';
				}
				else
				{
					strHtm += '<div id=\"insLogo' + lngILID + '\" class=\"logoBox\" style=\"display:none;\"><img src=\"images/defaultLogo.jpg\" width=\"200\" height=\"84\" alt=\"\" border=\"0\"></div>';
				}
				if ( strName != '-1' ) { strHtm += '<h2>' + strName + '</h2>'; }
				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>';
				if ( strPhone != '-1' ) { strHtm += '<div><strong>Local:</strong>&nbsp;' + strPhone + '</div>'; }
				if ( strTollFree != '-1' ) { strHtm += '<div><strong>Toll Free:</strong>&nbsp;' + strTollFree + '</div>'; }
				if ( strFax != '-1' ) { strHtm += '<div><strong>Fax:</strong>&nbsp;' + strFax + '</div>'; }
				if ( strWebSite != '-1' ) { strHtm += '<div><a href=\"http://' + strWebSite + '\" target=\"_blank\">' + strWebSite + '</a></div>'; }
				if ( strEMail != '-1' ) { strHtm += '<div><a href=\"mailto:' + strEMail + '\">' + strEMail + '</a></div>'; }
				//close up the div
				strHtm += '</div>';
			}
			//update the list
			document.getElementById( 'installerList' ).style.backgroundColor = '#FFFFFF';
			document.getElementById( 'installerList' ).style.padding = '10px';
			document.getElementById( 'installerList' ).innerHTML = strHtm;
			//activate the markers
			ActivateInstallerMarkers( lngID, strIDs, strXs, strYs );
		}
		
	}
//-->
