var xmlhttp;

function showState(country, loc_id)
{
	if( country == -1) {
	  return false;
	}
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	var url="getState.php";
	
	url=url+"?country="+country+"&loc="+loc_id;

	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function stateChanged()
{
  if (xmlhttp.readyState==4)
  {
	document.getElementById("txtState").innerHTML=xmlhttp.responseText;
  }
}

function GetXmlHttpObject()
{
/*
  if (window.XMLHttpRequest)
  {
  	// code for IE7+, Firefox, Chrome, Opera, Safari
  	//alert('in IE7+, FF');
	return new XMLHttpRequest();
  }
  if (window.ActiveXObject)
  {
  	//code for IE6, IE5
  	//alert('in IE5 or IE6');
  	//return new ActiveXObject("Microsoft.XMLHTTP");
  	return new ActiveXObject("Msxml2.XMLHTTP");

  }
  return null;
*/

  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
  catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
  catch (e) { try { xmlhttp = new XMLHttpRequest(); }
  catch (e) { xmlhttp = false; }}}

  return xmlhttp;

}



