var xmlhttp;

function showCountry(loc_type, snow_id, adventure_id, international_id, nz_id)
{
	//if( loc_type == -1 || (loc_type != snow_id && loc_type != adventure_id && loc_type != international_id && loc_type != nz_id) ) {
	if( loc_type == -1 ) {
	  return false;
	}
	
	if( loc_type == nz_id ) {
	}

	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	var url="getCountry.php";
	
	url=url+"?loc="+loc_type;

	xmlhttp.onreadystatechange=stateChanged;
/*
	if( loc_type != snow_id && loc_type != adventure_id && loc_type != international_id && loc_type != nz_id ) {
		alert('enter');
	  document.getElementById("txtCountry").style.display = "none";
	  document.getElementById("txtCountry").innerHTML = "";
	  var label = document.getElementById("txtCountry");
	  while( label.hasChildNodes() ) {
	   alert('has child');
	  label.removeChild( label.lastChild ); 
	  }
	}
*/
	
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function stateChanged()
{
  if (xmlhttp.readyState==4)
  {
	document.getElementById("txtCountry").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;

}



