	var xmlHttp //variable
	
	//send the content
	function dynamicContent(ParVal1,ParVal2,ParVal3)
	{  
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		  { alert ("Please update your browser");
		  return;
		  } 
		if (ParVal3.length==0)
		{ParVal3=""}

		var url="/products/read180/includes/spscall.asp?ParVal1=" + ParVal1 + "&ParVal2=" + ParVal2 + "&from=" + ParVal3;
		//alert (url)
		if (ParVal3=="")
		{xmlHttp.onreadystatechange=stateChanged1;}
		else if (ParVal3=="state")
		{xmlHttp.onreadystatechange=stateChanged2;}
		else if (ParVal3=="city")
		{xmlHttp.onreadystatechange=stateChanged3;}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	} 
	
	//if it is complete, send the data to the ID
	function stateChanged1() 
	{ 
		if (xmlHttp.readyState==4)
		{ //alert(ParVal);
		document.getElementById("StateShow").innerHTML=xmlHttp.responseText;
		}
	}
	
	function stateChanged2() 
	{ 
		if (xmlHttp.readyState==4)
		{ //alert(ParVal);
		document.getElementById("CityShow").innerHTML=xmlHttp.responseText;
		}
	}
	function stateChanged3() 
	{ 
		if (xmlHttp.readyState==4)
		{ //alert(ParVal);
		document.getElementById("SchoolShow").innerHTML=xmlHttp.responseText;
		}
	}
	
	//Creat XML http Object
	function GetXmlHttpObject()
	{		
		var xmlHttp=null;
		try
		  {xmlHttp=new XMLHttpRequest();}
		catch (e)
		  {
		  try
			{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
		  catch (e)
			{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
		  }
		return xmlHttp;
	}
	
//This function is set for the state list and city list from the sps. The function name is also set by sps list as well.
function resubmitWithState()
{
	var state = document.frmSubmit.STATE_KEY.options[document.frmSubmit.STATE_KEY.selectedIndex].value;
	dynamicContent(state,'','state');
}

function resubmitWithCity()
{
	
	var state = document.frmSubmit.STATE_KEY.options[document.frmSubmit.STATE_KEY.selectedIndex].value;
	var city = document.frmSubmit.CITY_KEY.options[document.frmSubmit.CITY_KEY.selectedIndex].value;
	dynamicContent(state,city,'city',dynamicContent.path);
	//alert(state)
	
}

function NoSchoolListIn()
{
	document.getElementById('schoolnotlistlink').style.textDecoration = "underline"
	document.getElementById('schoolnotlist').style.display="block";
}

function NoSchoolListOut()
{
	document.getElementById('schoolnotlistlink').style.textDecoration = "none"
	document.getElementById('schoolnotlist').style.display="none";
}

