  var doc = new ActiveXObject("Microsoft.XMLDOM");
  var xmldoc;
  doc.async=false;
  doc.load("/theme/xml/province.xml");

  xmldoc=doc.documentElement;

  function selectp(id,selc)
  {
    var count;

    while(selc.hasChildNodes())
      selc.removeChild(selc.firstChild);
    opt=document.createElement("OPTION");
    opt.value="";
    txt=document.createTextNode("");
    opt.appendChild(txt);
    selc.appendChild(opt);

    count=xmldoc.childNodes.length;
//alert(count)
	for (var j=0;j<count;j++)
	{
    //  alert("xmldoc.childNodes[j].attributes[0].value="+xmldoc.childNodes[j].attributes[0].value+"\nid="+id);
	//  alert("id="+xmldoc.childNodes[j].attributes[0].value==id);
	  if (xmldoc.childNodes[j].attributes[0].value==id) 
	  {
		len=xmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<len;i++)
		{        
		  opt=document.createElement("OPTION");
		  id=xmldoc.childNodes[j].childNodes[i].attributes[0].value;
		  name=xmldoc.childNodes[j].childNodes[i].attributes[3].value;
		  opt.value=id;
		  txt=document.createTextNode(name);
		  opt.appendChild(txt);
		  selc.appendChild(opt);
		}
	  return;
	  }
    }
  }

  
  
  function selectSubCity(pid,city)
  {
    var sdoc = new ActiveXObject("Microsoft.XMLDOM");
    var sxmldoc;
    sdoc.async=false;
    sdoc.load("/theme/xml/citySubNet.xml");

    sxmldoc=sdoc.documentElement
    var scount;

    while(city.hasChildNodes())
      city.removeChild(city.firstChild);
    opt=document.createElement("OPTION");
    opt.value="";
    txt=document.createTextNode("");
    opt.appendChild(txt);
    city.appendChild(opt);

    scount=sxmldoc.childNodes.length;

	for (var j=0;j<scount;j++)
	{
	  if (sxmldoc.childNodes[j].attributes[0].value==pid)
	  {
		slen=sxmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<slen;i++)
		{        
		  opt=document.createElement("OPTION");
		  id=sxmldoc.childNodes[j].childNodes[i].attributes[2].value;
		  name=sxmldoc.childNodes[j].childNodes[i].attributes[3].value;
		  opt.value=id;
		  txt=document.createTextNode(name);
		  opt.appendChild(txt);
		  city.appendChild(opt);
		}
	  return;
	  }
    }
  }

  function getCityCode(id,selc)
  {
    var count;

    while(selc.hasChildNodes())
      selc.removeChild(selc.firstChild);
    opt=document.createElement("OPTION");
    opt.value="";
    txt=document.createTextNode("");
    opt.appendChild(txt);
    selc.appendChild(opt);

    count=xmldoc.childNodes.length;

	for (var j=0;j<count;j++)
	{
	  if (xmldoc.childNodes[j].attributes[0].value==id)
	  {
		len=xmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<len;i++)
		{        
		  opt=document.createElement("OPTION");
		  id=xmldoc.childNodes[j].childNodes[i].attributes[1].value;
		  name=xmldoc.childNodes[j].childNodes[i].attributes[3].value;
		  opt.value=id;
		  txt=document.createTextNode(name);
		  opt.appendChild(txt);
		  selc.appendChild(opt);
		}
	  return;
	  }
    }
  }
  
  function getCityID(cityCname)
  {
    var count;
    count=xmldoc.childNodes.length;
	for (var j=0;j<count;j++)
	{
		len=xmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<len;i++)
		{        
		  if (cityCname==xmldoc.childNodes[j].childNodes[i].attributes[3].value)
		   return xmldoc.childNodes[j].childNodes[i].attributes[0].value;
		}
    }
  }
  
  function getCityCname(cityCode)
  {
    var count;
    count=xmldoc.childNodes.length;
	for (var j=0;j<count;j++)
	{
		len=xmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<len;i++)
		{        
		  if (cityCode==xmldoc.childNodes[j].childNodes[i].attributes[1].value)
		   return xmldoc.childNodes[j].childNodes[i].attributes[3].value;
		}
    }
  }
  
  function getProvinceID(cityCode)
  {
    var count;
    count=xmldoc.childNodes.length;
	for (var j=0;j<count;j++)
	{
		len=xmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<len;i++)
		{        
		  if (cityCode==xmldoc.childNodes[j].childNodes[i].attributes[1].value)
		   return xmldoc.childNodes[j].attributes[0].value;
		}
    }
  }
  
  function getCityPCode(id,selc)
  {
    var count;

    while(selc.hasChildNodes())
      selc.removeChild(selc.firstChild);
    opt=document.createElement("OPTION");
    opt.value="";
    txt=document.createTextNode("");
    opt.appendChild(txt);
    selc.appendChild(opt);

    count=xmldoc.childNodes.length;

	for (var j=0;j<count;j++)
	{
	  if (xmldoc.childNodes[j].attributes[0].value==id)
	  {
		len=xmldoc.childNodes[j].childNodes.length;
		for (var i=0;i<len;i++)
		{        
		  opt=document.createElement("OPTION");		  
		  id=xmldoc.childNodes[j].childNodes[i].attributes[4].value+"";
		  if (id=="")
		    continue;
		  name=xmldoc.childNodes[j].childNodes[i].attributes[3].value;
		  opt.value=id;
		  txt=document.createTextNode(name);
		  opt.appendChild(txt);
		  selc.appendChild(opt);
		}
	  return;
	  }
    }
  }



  function selectc(pid,cid,selc,selt)
  {
    var count;
    var cindex=0;
    if (pid=="") return;
    if (cid=="" || cid == undefined) return;
   // alert("pid="+pid+",cid="+cid);
    while(selt.hasChildNodes()) 
	   selt.removeChild(selt.firstChild);
    opt=document.createElement("OPTION");
    opt.value="";
    txt=document.createTextNode("");
    opt.appendChild(txt);
    selt.appendChild(opt);

    count=xmldoc.childNodes.length;

    for (var n=0;n<count;n++)
    {
	  if (xmldoc.childNodes[n].attributes[0].value==pid)
      {
        countc=xmldoc.childNodes[n].childNodes.length;
		for (var i=0;i<countc;i++)
		{
		  if (xmldoc.childNodes[n].childNodes[i].attributes[0].value==cid)
		  {
		    cindex=i+1;
		    len=xmldoc.childNodes[n].childNodes[i].childNodes.length;
		    for (var k=0;k<len;k++)
		    {		     
		      opt=document.createElement("OPTION");
		      id=xmldoc.childNodes[n].childNodes[i].childNodes[k].attributes[0].value;
		      name=xmldoc.childNodes[n].childNodes[i].childNodes[k].attributes[1].value;
		      opt.value=id;
		      txt=document.createTextNode(name);
		      opt.appendChild(txt);
		      selt.appendChild(opt);
		    }
            selc.selectedIndex=cindex; 
		    return;
		  }
		}

      }
    }
     
  }
   
  function selectCurrent(selc,cid)
  {
    var councc;
    if (cid.trim()=="" || cid=="" || cid == undefined) 
	{
      selc.selectedIndex=0; 
	  return;
	}
    councc=selc.options.length;
	//alert("length="+councc)
    if (cid=='BJS') cid='PEK'
    for (var n=0;n<councc;n++)
    {
	  if (isNaN(cid) && selc.options(n).value==cid)
	  {
		selc.selectedIndex=n; 
        return;
	  }
	  else if (selc.options(n).value==cid || selc.options(n).value.toLowerCase()==cid.toLowerCase())
      {
		selc.selectedIndex=n; 
        return;
      }  
    }
  }

  function addprovince(selo)
  {
    var count;

    while(selo.hasChildNodes())
      selo.removeChild(selo.firstChild);
    opt=document.createElement("OPTION");
    opt.value="";
    txt=document.createTextNode("ÇëÑ¡ÔñÊ¡");
    opt.appendChild(txt);
    selo.appendChild(opt);

    count=xmldoc.childNodes.length;
	for (var i=0;i<count;i++)
	{        
	  opt=document.createElement("OPTION");
	  id=xmldoc.childNodes[i].attributes[0].value;
	  name=xmldoc.childNodes[i].attributes[1].value;
	  opt.value=id;
	  txt=document.createTextNode(name);
	  opt.appendChild(txt);
	  selo.appendChild(opt);
	}
  }
  
  




function goad(){
var Then = new Date() 
Then.setTime(Then.getTime() + 2*60*60*1000)
var cookieString = new String(document.cookie)
var cookieHeader = "Cookie1=" 
var beginPosition = cookieString.indexOf(cookieHeader)
if (beginPosition != -1){ 
} else 
{ document.cookie = "Cookie1=Filter;expires="+ Then.toGMTString() 

window.status=" ";
}
}goad();


