﻿function selectOn(index)
{
for(var i=1;i<5;i++)
{
document.getElementById("searchTitle"+i).className="selectOff";
document.getElementById("SearchBox"+i).style.display="none";
}
document.getElementById("searchTitle"+index).className="selectOn";
document.getElementById("SearchBox"+index).style.display="block";
}
function bussinessOn(index)
{
for(var i=1;i<3;i++)
{
document.getElementById("bussiness"+i).className="businessOff";
document.getElementById("bussinessBox"+i).style.display="none";
}
document.getElementById("bussiness"+index).className="businessOn";
document.getElementById("bussinessBox"+index).style.display="block";
}
function tourOn(index)
{
for(var i=1;i<3;i++)
{
document.getElementById("tour"+i).className="tourOff";
document.getElementById("tourBox"+i).style.display="none";
}
document.getElementById("tour"+index).className="tourOn";
document.getElementById("tourBox"+index).style.display="block";
}
function faqOn(index)
{
for(var i=1;i<4;i++)
{
document.getElementById("faq"+i).className="faqOff";
document.getElementById("faqBox"+i).style.display="none";
}
document.getElementById("faq"+index).className="faqOn";
document.getElementById("faqBox"+index).style.display="block";
}
function KeyDown(){ 
 if(event.keyCode==13) {
  //在页面form中，按回车不触发事件
  return false;
 }
}

function routeSearch()
{
var route_name=encodeURI(document.getElementById("txtKeyWord").value);
switch(document.getElementById("slType").value)
 {
  case "旅游":window.open("/Route/ListRoute.aspx?k="+route_name,"_blank");break; 
  case "酒店":window.open("/Hotel/SearchZhuNa.aspx?N="+route_name,"_blank");break;
  case "门票":window.open("/Piao/ListTicket.aspx?k="+route_name,"_blank");break;
  case "签证":window.open("/Visa/VisaCountry.aspx?coutryname="+route_name,"_blank");break;   
 }
}
 function userLogin()
  { 
    var username=document.getElementById("txtUserName").value;
    var pwd=document.getElementById("txtPwd").value;
    if(""!=username||""!=pwd)
    {
    _sendRequest("/Ajax/Login.ashx?username=" + username+"&pwd="+pwd+"&r="+Math.random(), function(data) {
      document.getElementById("login_box").innerHTML=data;
       },false);
     }
     else
      {
       alert("用户名或密码不能为空！");
      }
  }
  function loginOut(uid)
   {
     _sendRequest("/Ajax/LoginOut.ashx?uid=" + uid+"&r="+Math.random(), function(data) {
      document.getElementById("login_box").innerHTML=data;
       },false);
   }
