﻿var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/
function getArea(city)
{
    var url = "/func/ajax/getOpt.aspx?table=table_cityarea&valcol=pkey&textcol=areachiname&con=city&conval=" + city;
    xmlHttp.open("GET", url, true);
    xmlHttp.onreadystatechange = updateArea;
    xmlHttp.send(null);
}

function updateArea()
{
    if (xmlHttp.readyState == 4)
    {
        var response = xmlHttp.responseText;
        document.getElementById("querydistrict").outerHTML = "<select name='querydistrict' id='querydistrict'><option value=''>所有</option>" + response + "</select>";
    }
}

function doSearch()
{
    var url = "/hotel/index.aspx?querycity=" + document.all.querycity.value;
    url += "&querystar=" + document.all.querystar.value;
    url += "&queryhotel=" + document.all.queryhotel.value;
    url += "&queryprice=" + document.all.queryprice.value;
    url += "&querydistrict=" + document.all.querydistrict.value;
    window.location.href = url;
}

function toggleWeather(ind)
{
    var obj = document.getElementById("divWeather");
    obj.style.display = ind;
    if (ind=="")
    {
        obj.style.position = "absolute";
        obj.style.top = "200px";
        obj.style.left = "380px";
    }
}

function switchTab(cat, showctl, hidectls)
{
  var showactl = document.getElementById(cat + "_a" + "_" + showctl);
  showactl.style.cursor = 'hand';
  var showdivctl = document.getElementById(cat + "_div" + "_" + showctl);
  showactl.className = cat + "_selected";
  showdivctl.style.display = "";

  var allhidectl = hidectls.split("|");
  for (var x=0; x<allhidectl.length; x++)
  {
    var hideactl = document.getElementById(cat + "_a" + "_" + allhidectl[x]);
    var hidedivctl = document.getElementById(cat + "_div" + "_" + allhidectl[x]);
    hideactl.className = cat + "_unselected";
    hidedivctl.style.display = "none";
  }
}

