/*创建一个xmlhttprequest对象*/
var xmlHttp;
function createRequest()
{
  try 
  {
    xmlHttp= new XMLHttpRequest();
  } 
  catch (trymicrosoft) 
  {
    try 
	{
      xmlHttp= new ActiveXObject("Msxml2.XMLHTTP");
    } 
	catch (othermicrosoft) 
	{
      try 
	  {
        xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");
      } 
	  catch (failed) 
	  {
        xmlHttp= false;
      }
    }
  }

  if (!xmlHttp)
  {
    alert("错误提示：XMLHttpRequest对象创建失败,无法验证!");
  }
}
createRequest();

function getCity(value)
{
  // 建立要连接的URL,escape()方法,它用于转义不能用明文正确发送的任何字符
  var url = "../getears.asp?aparid="+escape(value);
  // 打开到服务器的连接；open(request-type[get或post],url,asynch[同步or异步],username,password)
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = crtslct;		//设置服务器在完成后要运行的函数;
  xmlHttp.send(null);
}
function crtslct()
{
  if (xmlHttp.readyState == 4)
  {
	 var response = xmlHttp.responseText;
	 var slct=document.getElementById("chengshi");
	 slct.innerHTML=response;
  }
}
function setCity(value,value2)
{
	document.frmSearch.WXArea.value=value;	
	document.frmSearch.WXArea.title=value;	
	document.frmSearch.areas.value=value2;	
}
function setQm(value)
{
	document.frmSearch.quanming.value=value;	
	document.frmSearch.quanming.title=value;	
}
