﻿var ns4up1 = (document.layers) ? 1 : 0;  // browser sniffer

var ie4up1 = (document.all && (navigator.appVersion.indexOf("MSIE 4") == -1)) ? 1 : 0;

var ns6up1 = (document.getElementById && !document.all) ? 1 : 0;

var prox;
var proy;
var proxc;
var proyc;
function show(id) {/*--打开--*/
    clearInterval(prox);
    clearInterval(proy);
    clearInterval(proxc);
    clearInterval(proyc);
    var tr = document.getElementById("tr_" + id);
    var trs = tr.parentNode.childNodes;
    for (i = 0; i < trs.length; i++) {
        if (trs[i].GroupsID != undefined)
            trs[i].style.display = "none";
    }
    tr.style.display = "block";
    var o = document.getElementById("fd_" + id);
    o.style.display = "block";
    o.style.width = "1px";
    o.style.height = "1px";
    if (!(o.style.left)) {
        o.style.left = o.offsetLeft - 5 + "px";
        o.style.top = o.offsetTop + 20 + "px";
    }
    prox = setInterval(function() { openx(o, 648) }, 10);
}
function openx(o, x) {/*--打开x--*/
    var cx = parseInt(o.style.width);
    if (cx < x) {
        o.style.width = (cx + Math.ceil((x - cx) / 5)) + "px";
    }
    else {
        clearInterval(prox);
        proy = setInterval(function() { openy(o, 210) }, 10);
    }
}
function openy(o, y) {/*--打开y--*/
    var cy = parseInt(o.style.height);
    if (cy < y) {
        o.style.height = (cy + Math.ceil((y - cy) / 5)) + "px";
    }
    else {
        clearInterval(proy);
    }
}
function closeed(id) {/*--关闭--*/
    clearInterval(prox);
    clearInterval(proy);
    clearInterval(proxc);
    clearInterval(proyc);
    var o = document.getElementById("fd_" + id);
    var tr = document.getElementById("tr_" + id);
    if (o.style.display == "block") {
        proyc = setInterval(function() { closey(o, tr) }, 10);
    }
}
function closey(o, tr) {/*--打开y--*/
    var cy = parseInt(o.style.height);
    if (cy > 0) {
        o.style.height = (cy - Math.ceil(cy / 5)) + "px";
    }
    else {
        clearInterval(proyc);
        proxc = setInterval(function() { closex(o, tr) }, 10);
    }
}
function closex(o, tr) {/*--打开x--*/
    var cx = parseInt(o.style.width);
    if (cx > 0) {
        o.style.width = (cx - Math.ceil(cx / 5)) + "px";
    }
    else {
        clearInterval(proxc);
        o.style.display = "none";
        tr.style.display = "none";
    }
}

function nowclock() {
    if (!ns4up1 && !ie4up1 && !ns6up1) return false;
    var digital = new Date();
    var hours = digital.getHours();
    var minutes = digital.getMinutes();
    var seconds = digital.getSeconds();
    var day = digital.getDate();
    var month = digital.getMonth() + 1;
    var year = digital.getYear();
    var amOrPm = "AM";
    if (hours > 11) amOrPm = "PM";
    if (hours > 12) hours = hours - 12;
    if (hours == 0) hours = 12;
    if (minutes < 10) minutes = "0" + minutes;
    if (seconds < 10) seconds = "0" + seconds;
    if (day < 10) day = "0" + day;
    if (month < 10) month = "0" + month;
    dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
    dispDate = year + "年" + month + "月" + day + "日 ";
    if (ns4up1) {
        document.layers.nowTime.document.write(dispTime);
        document.layers.nowTime.document.close();
        document.layers.nowDate.document.write(dispDate);
        document.layers.nowDate.document.close();
    } else if (ns6up1) {
        document.getElementById("nowTime").innerHTML = dispTime;
        document.getElementById("nowDate").innerHTML = dispDate;
    } else if (ie4up1) {
        nowTime.innerHTML = dispTime;
        nowDate.innerHTML = dispDate;
    } setTimeout("nowclock()", 1000);
}

function startmarquee(lh, speed, delay, index) {
    var t;
    var p = false;
    var o = document.getElementById("marqueebox" + index);
    o.innerHTML += o.innerHTML;
    o.onmouseover = function() { p = true }
    o.onmouseout = function() { p = false }
    o.scrollTop = 0;
    function start() {
        t = setInterval(scrolling, speed);
        if (!p) o.scrollTop += 2;
    }
    function scrolling() {
        if (o.scrollTop % lh != 0) {
            o.scrollTop += 2;
            if (o.scrollTop >= o.scrollHeight / 2) o.scrollTop = 0;
        } else {
            clearInterval(t);
            setTimeout(start, delay);
        }
    }
    setTimeout(start, delay);
}

function mar() {
    if (t2.offsetTop <= t.scrollTop)
        t.scrollTop -= t1.offsetHeight;
    else
        t.scrollTop++;
}

function getid(id) {
    return document.getElementById(id);
}

function heartBeat() {
    diffY = document.documentElement.scrollTop;
    percent = 0.1 * (diffY - lastScrollY);
    if (percent > 0) percent = Math.ceil(percent);
    else percent = Math.floor(percent);
    document.getElementById("sorollDiv1").style.top = parseInt(document.getElementById("sorollDiv1").style.top) + percent + "px";
    lastScrollY = lastScrollY + percent;
}

function ChangeFlyType(value) {
    if (value == 1) {
        document.getElementById("Fltd_Return").disabled = true;
    }
    else {
        document.getElementById("Fltd_Return").disabled = false;
    }
}

function AirSearch() {
    var ctlFlyType = theForm.FlyType;
    for (i = 0; i < ctlFlyType.length; i++) {
        if (ctlFlyType[i].checked)
            var txtFlyType = ctlFlyType[i].value;
    }
    var txtOrg = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var txtFltd = document.getElementById("Fltd").value;
    var txtCustNum = document.getElementById("CustNum").options[document.getElementById("CustNum").selectedIndex].value;
    var txtCustType = document.getElementById("CustType").options[document.getElementById("CustType").selectedIndex].value;
    var txtDst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;
    var txtFltd_Return = document.getElementById("Fltd_Return").value;

    window.location = "AirList.aspx?FlyType=" + txtFlyType + "&Org=" + txtOrg + "&Fltd=" + txtFltd + "&CustNum=" + txtCustNum + "&CustType=" + txtCustType + "&Dst=" + txtDst + "&Fltd_Return=" + txtFltd_Return;
}

function ShowCustomerService() {
    CreateBackFrame();

    var KFPopup = document.getElementById("KFPopup");
    if (KFPopup != null) {
        KFPopup.style.display = "block";
    }
    else {
        var div = document.createElement("DIV");
        div.id = "KFPopup";
        div.style.left = (window.screen.width - 411) / 2;
        div.style.top = (window.screen.height - 546) / 2;
        div.style.width = 411;
        div.style.height = 246;
        div.style.position = "absolute";
        div.style.display = "none";
        theForm.appendChild(div);

        CallServer("ShowCustomerService$", "");
    }
}

function KF_CLOSE() {
    var KFPopup = document.getElementById("KFPopup");
    if (KFPopup != null) {
        KFPopup.style.display = "none";
    }
    CloseBackFrame();
}

function Login() {
    CreateBackFrame();

    var UserPopup = document.getElementById("UserPopup");
    if (UserPopup != null) {
        UserPopup.style.display = "block";
        CallServer("ShowLogin$", "");
    }
    else {
        var div = document.createElement("DIV");
        div.id = "UserPopup";
        div.style.left = (window.screen.width - 411) / 2;
        div.style.top = (window.screen.height - 546) / 2;
        div.style.width = 411;
        div.style.height = 246;
        div.style.position = "absolute";
        div.style.display = "none";
        theForm.appendChild(div);

        CallServer("ShowLogin$", "");
    }
}

function Register() {
    CreateBackFrame();

    var UserPopup = document.getElementById("UserPopup");
    if (UserPopup != null) {
        UserPopup.style.display = "block";
        CallServer("ShowRegister$", "");
    }
    else {
        var div = document.createElement("DIV");
        div.id = "UserPopup";
        div.style.left = (window.screen.width - 411) / 2;
        div.style.top = (window.screen.height - 546) / 2;
        div.style.width = 411;
        div.style.height = 246;
        div.style.position = "absolute";
        div.style.display = "none";
        theForm.appendChild(div);

        CallServer("ShowRegister$", "");
    }
}

function ForgetPass() {
    CreateBackFrame();

    var UserPopup = document.getElementById("UserPopup");
    if (UserPopup != null) {
        UserPopup.style.display = "block";
        CallServer("ShowForgetPass$", "");
    }
    else {
        var div = document.createElement("DIV");
        div.id = "UserPopup";
        div.style.left = (window.screen.width - 411) / 2;
        div.style.top = (window.screen.height - 546) / 2;
        div.style.width = 411;
        div.style.height = 246;
        div.style.position = "absolute";
        div.style.display = "none";
        theForm.appendChild(div);

        CallServer("ShowForgetPass$", "");
    }
}

function LoginClose() {
    var UserPopup = document.getElementById("UserPopup");
    if (UserPopup != null) {
        //UserPopup.style.display = "none";
        UserPopup.parentNode.removeChild(UserPopup);
    }
    CloseBackFrame();
}

function LoginSubmit() {
    var txtUserName = document.getElementById("UserLoginEmail").value;
    var txtUserPass = document.getElementById("UserLoginPass").value;
    var txtVerifyCode = document.getElementById("UserLoginVerifyCode").value;

    if (txtUserName.length == 0) {
        alert("请输入用户名！");
        document.getElementById("UserLoginEmail").focus();
        return false;
    }
    else {
        if (!IsEmail(txtUserName)) {
            alert("用户名格式错误！<br>用户名为Email格式！");
            document.getElementById("UserLoginEmail").focus();
            return false;
        }
    }

    if (txtUserPass.length < 4) {
        alert("请输入密码！");
        document.getElementById("UserLoginPass").focus();
        return false;
    }

    if (txtVerifyCode.length != 4) {
        alert("请输入验证码！");
        document.getElementById("UserLoginVerifyCode").focus();
        return false;
    }
    CreateWaitPopup("正在登陆，请稍等...");
    CallServer("Login$" + txtUserName + "|" + txtUserPass + "|" + txtVerifyCode, "");
}

function RegisterSubmit() {
    var txtEmail = document.getElementById("RegEmail").value;
    var txtUserPass = document.getElementById("RegUserPass").value;
    var txtRePass = document.getElementById("RegRePass").value;
    var txtUserName = document.getElementById("RegUserName").value;
    var txtMobile = document.getElementById("RegMobile").value;

    if (txtEmail.length == 0) {
        alert("请输入电子邮箱！");
        document.getElementById("RegEmail").focus();
        return false;
    }
    else {
        if (!IsEmail(txtEmail)) {
            alert("电子邮箱格式错误！");
            document.getElementById("RegEmail").focus();
            return false;
        }
    }

    if (txtUserPass.length < 4) {
        alert("请输入密码！");
        document.getElementById("RegUserPass").focus();
        return false;
    }

    if (txtUserPass != txtRePass) {
        alert("两次密码不同！");
        document.getElementById("RegUserPass").focus();
        return false;
    }

    if (txtUserName.length == 0) {
        alert("请输入真实姓名！");
        document.getElementById("RegUserName").focus();
        return false;
    }

    if (txtMobile.length != 11) {
        alert("请输入手机号码！");
        document.getElementById("RegMobile").focus();
        return false;
    }

    CreateWaitPopup("正在注册，请稍等...");
    CallServer("UserRegister$" + txtEmail + "|" + txtUserPass + "|" + txtUserName + "|" + txtMobile, "");
}

function ForgetPassSubmit() {
    var txtUserName = document.getElementById("RegEmail").value;
    var txtVerifyCode = document.getElementById("UserVerifyCode").value;

    if (txtUserName.length == 0) {
        alert("请输入用户名！");
        document.getElementById("RegEmail").focus();
        return false;
    }
    else {
        if (!IsEmail(txtUserName)) {
            alert("用户名格式错误！<br>用户名为Email格式！");
            document.getElementById("RegEmail").focus();
            return false;
        }
    }

    if (txtVerifyCode.length != 4) {
        alert("请输入验证码！");
        document.getElementById("UserVerifyCode").focus();
        return false;
    }
    CreateWaitPopup("正在执行，请稍等...");
    CallServer("UserForget$" + txtUserName + "|" + txtVerifyCode, "");
}

function IsEmail(sEmail) {
    return (new RegExp(/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/).test(sEmail));
}

function CreateBackFrame() {
    var BackFrame = document.getElementById("BackFrame");

    if (BackFrame != null) {
        BackFrame.style.display = "block";
    }
    else {
        var w = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
        var h = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
        var hh = Math.max(document.body.offsetHeight, document.body.clientHeight);
        h = Math.max(h, hh);
        h = Math.max(h, window.screen.height);

        BackFrame = document.createElement("iframe");
        BackFrame.id = "BackFrame";
        BackFrame.src = "javascript:'<html><style>body{width:100%;height:100%;background-color:#000000;}</style><body></body></html>';";
        BackFrame.style.position = "absolute";
        BackFrame.style.left = 0;
        BackFrame.style.top = 0;
        BackFrame.style.width = w;
        BackFrame.style.height = h;
        BackFrame.style.display = "block";
        BackFrame.scrolling = "no";
        BackFrame.frameBorder = "0";
        BackFrame.tabIndex = "-1";
        BackFrame.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
        //document.body.firstChild.appendChild(BackFrame);
        theForm.appendChild(BackFrame);
    }
}

function CloseBackFrame() {
    var BackFrame = document.getElementById("BackFrame");
    if (BackFrame != null) {
        BackFrame.style.display = "none";
    }
}

function CreateModalPopup(sContent) {
    CloseModalPopup();

    var popupDiv = document.createElement("div");
    var popupTable = document.createElement("table");
    var popupTableBody = document.createElement("tbody");
    var contentRow = document.createElement("tr");
    var iconCell = document.createElement("td");
    var iconImage = document.createElement("img");
    var contentCell = document.createElement("td");
    var buttonRow = document.createElement("tr");
    var buttonCell = document.createElement("td");
    var buttonImage = document.createElement("img");

    var w = document.body.scrollWidth;
    var h = document.body.scrollHeight;
    var hh = document.documentElement.scrollHeight;

    popupDiv.id = "ModalPopup";
    popupDiv.style.zIndex = "1000";
    popupDiv.style.textAlign = "center"
    popupDiv.style.left = (window.screen.width - 250) / 2;
    popupDiv.style.top = document.documentElement.scrollTop + (window.screen.height - 300) / 2;
    popupDiv.style.position = "absolute";

    popupTable.cellPadding = 0;
    popupTable.cellSpacing = 0;
    popupTable.border = 0;
    popupTable.width = 250;
    popupTable.height = 100;
    popupTable.style.display = "block";
    popupTable.style.position = "relative";

    contentRow.vAlign = 'center';
    contentRow.style.height = 70;

    iconCell.style.backgroundColor = 'White';
    iconCell.style.padding = "5px";
    iconCell.style.borderTop = "1px solid black";
    iconCell.style.borderLeft = "1px solid black";
    iconCell.align = 'center';
    iconCell.width = 50;

    iconImage.src = "images/alert-large.gif";

    contentCell.style.backgroundColor = 'White';
    contentCell.style.fontFamily = 'verdana';
    contentCell.style.fontSize = '12px';
    contentCell.style.padding = "5px";
    contentCell.style.borderTop = "1px solid black";
    contentCell.style.borderRight = "1px solid black";
    contentCell.align = 'left';
    contentCell.width = 200;
    contentCell.innerHTML = sContent;

    buttonRow.vAlign = 'center';
    buttonRow.style.height = 30;

    buttonCell.style.backgroundColor = 'White';
    buttonCell.style.fontFamily = 'verdana';
    buttonCell.style.fontSize = '12px';
    buttonCell.style.padding = "5px";
    buttonCell.style.borderRight = "1px solid black";
    buttonCell.style.borderBottom = "1px solid black";
    buttonCell.style.borderLeft = "1px solid black";
    buttonCell.colSpan = '2';
    buttonCell.width = '100%';

    buttonImage.src = "images/button_c.gif";
    buttonImage.style.cursor = 'pointer';
    //alert(document.body.firstChild.id);
    //document.body.firstChild.appendChild(popupDiv);
    theForm.appendChild(popupDiv);
    popupDiv.appendChild(popupTable);
    popupTable.appendChild(popupTableBody);
    popupTableBody.appendChild(contentRow);
    contentRow.appendChild(iconCell);
    iconCell.appendChild(iconImage);
    contentRow.appendChild(contentCell);
    popupTableBody.appendChild(buttonRow);
    buttonRow.appendChild(buttonCell);
    buttonCell.appendChild(buttonImage);

    buttonImage.onclick = function() {
        //document.body.firstChild.removeChild(popupDiv);
        CloseModalPopup();
        //CloseBackFrame();
    }

    CreateBackFrame();
}

function CloseModalPopup() {
    var ModalPopup = document.getElementById("ModalPopup");
    if (ModalPopup != null) {
        //document.body.firstChild.removeChild(ModalPopup);
        //theForm.removeChild(ModalPopup);
        //ModalPopup.removeNode(true);
        ModalPopup.parentNode.removeChild(ModalPopup);
    }

    CloseBackFrame();
}

function GetAirFirst() {
    document.getElementById("AirFirst").onclick();
}

function FullAirSearch() {
    var ctlFlyType = theForm.FlyType;
    for (i = 0; i < ctlFlyType.length; i++) {
        if (ctlFlyType[i].checked)
            var txtFlyType = ctlFlyType[i].value;
    }
    var txtOrg = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var txtFltd = document.getElementById("Fltd").value;
    var txtCustNum = document.getElementById("CustNum").options[document.getElementById("CustNum").selectedIndex].value;
    var txtCustType = document.getElementById("CustType").options[document.getElementById("CustType").selectedIndex].value;
    var txtDst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;
    var txtFltd_Return = document.getElementById("Fltd_Return").value;
    var txtOrg_Return = document.getElementById("Org_Return").options[document.getElementById("Org_Return").selectedIndex].value;
    var txtDst_Return = document.getElementById("Dst_Return").options[document.getElementById("Dst_Return").selectedIndex].value;

    window.location = "AirList.aspx?FlyType=" + txtFlyType + "&Org=" + txtOrg + "&Fltd=" + txtFltd + "&CustNum=" + txtCustNum + "&CustType=" + txtCustType + "&Dst=" + txtDst + "&Fltd_Return=" + txtFltd_Return + "&Org_Return=" + txtOrg_Return + "&Dst_Return=" + txtDst_Return;
}

function FullChangeFlyType(value) {
    if (value == 1) {
        document.getElementById("ReturnDivTxt").style.display = "none";
        document.getElementById("ReturnDiv").style.display = "none";
    }
    else {
        document.getElementById("ReturnDivTxt").style.display = "block";
        document.getElementById("ReturnDiv").style.display = "block";
    }
}

function ClickFlyType(values) {
    var ctlFlyType = theForm.FlyType;
    for (i = 0; i < ctlFlyType.length; i++) {
        if (ctlFlyType[i].value == values)
            ctlFlyType[i].click();
    }
}

function ListAirByOrg(sContrl, values) {
    var liNodes = sContrl.parentNode.childNodes;
    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].className = "off";
    }

    sContrl.className = "on";

    var AgioAirDiv = document.getElementById("AgioAir");
    var AgioAirDivs = AgioAirDiv.childNodes;
    for (i = 0; i < AgioAirDivs.length; i++) {
        AgioAirDivs[i].style.display = "none";
    }

    var AgioAirCurrentDiv = document.getElementById("AgioAir_" + values);

    if (AgioAirCurrentDiv != null) {
        AgioAirCurrentDiv.style.display = "block";
    }
    else {
        var div = document.createElement("div");
        div.id = "AgioAir_" + values;
        AgioAirDiv.appendChild(div);

        CallServer("AgioAir$" + values, "");
    }
}

function ResetAirSearch() { }

function CloseAllAir() {
    for (i = 0; i < 7; i++) {
        document.getElementById("ListAllAirCode_" + i).style.display = "none";
        document.getElementById("ListAllAir_" + i).style.display = "none";
    }
}

function CloseAllStore() {
    var Divs = document.getElementsByTagName("DIV");
    for (i = 0; i < Divs.length; i++) {
        if (Divs[i].name == "DisplayAll")
            Divs[i].style.display = "none";
    }
}

function ListAllStore(Tempvalues) {
    var values = Tempvalues;

    var Flt = values.substring(0, values.indexOf('|'));
    values = values.substring(values.indexOf('|') + 1);
    var Org = values.substring(0, values.indexOf('|'));
    values = values.substring(values.indexOf('|') + 1);
    var Dst = values.substring(0, values.indexOf('|'));
    values = values.substring(values.indexOf('|') + 1);
    var Fltno = values.substring(0, values.indexOf('|'));
    values = values.substring(values.indexOf('|') + 1);
    var Fltd = values.substring(0, values.indexOf('|'));

    var sDisplayContrl = document.getElementById("Display" + Fltd.replace(/-/g, "") + Fltno);
    var sContrl = document.getElementById("" + Fltd.replace(/-/g, "") + Fltno);
    if (sContrl != null) {
        if (sContrl.enable == "0") {
            CloseAllStore();
            sContrl.style.display = "block";
            sContrl.innerHTML = "<table width='665' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td  colspan='10' height='25' bgcolor='#FFFFF3' class='search_re_td' style='padding-left:50px;'>正在查询航班...</td></tr><tr><td colspan='10' height='1' background='10_images/ticket/line_x.gif'></td></tr></table>";
            sContrl.enable = "1";
            CallServer("ListAllStore$" + Tempvalues, "");
        }
        else {
            if (sContrl.innerText.replace(/(^\s*)|(\s*$)/g, "") == "正在查询航班...") {
                CloseAllStore();
                sContrl.style.display = "block";
                CallServer("ListAllStore$" + Tempvalues, "");
            }
            else {
                if (sContrl.style.display == "block") {
                    sContrl.style.display = "none";
                }
                else {
                    CloseAllStore();
                    sContrl.style.display = "block";
                }
            }
        }
    }

}

function AirLocalSearch(indexs) {
    var ctlFlyType = theForm.FlyType;
    for (i = 0; i < ctlFlyType.length; i++) {
        if (ctlFlyType[i].checked)
            var txtFlyType = ctlFlyType[i].value;
    }
    var txtOrg = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var txtDst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;
    var txtFltd = document.getElementById("Fltd").value;
    //var txtFlyTime = document.getElementById("FlyTime").value;
    var txtFlyTime = "0000/2359";
    var txtOrg_Return = document.getElementById("Org_Return").options[document.getElementById("Org_Return").selectedIndex].value;
    var txtFltd_Return = document.getElementById("Fltd_Return").value;
    var txtDst_Return = document.getElementById("Dst_Return").options[document.getElementById("Dst_Return").selectedIndex].value;
    var txtFlyTime_Return = document.getElementById("FlyTime_Return").value;
    var txtCustType = document.getElementById("CustType").options[document.getElementById("CustType").selectedIndex].value;
    var txtCustNum = document.getElementById("CustNum").options[document.getElementById("CustNum").selectedIndex].value;
    var txtAirCode = document.getElementById("AirCode").options[document.getElementById("AirCode").selectedIndex].value;
    var txtStoreCode = document.getElementById("StoreCode").value;
    var txtStopNum = document.getElementById("StopNum").value;

    CallServer("AirLocalSearch$" + txtFlyType + "|" + txtOrg + "|" + txtDst + "|" + txtFltd + "|" + txtFlyTime + "|" + txtOrg_Return + "|" + txtFltd_Return + "|" + txtDst_Return + "|" + txtFlyTime_Return + "|" + txtCustType + "|" + txtCustNum + "|" + txtAirCode + "|" + txtStoreCode + "|" + txtStopNum + "|" + indexs, "");
}

function GetHelpList(sContrl,values) {
    var liNodes = sContrl.parentNode.parentNode.childNodes;
    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].className = "help_L_button02";
    }
    sContrl.parentNode.className = "help_L_button01";

    CallServer("HelpList$" + values);
}

function GetHelpFirst() {
    document.getElementById("GetFirstHelpList").onclick();
}

function GetAir(sContrl, values, indexs) {
    var liNodes = sContrl.parentNode.parentNode.childNodes;

    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].firstChild.className = "box2";
    }
    sContrl.className = "box1";
    theForm.Fltd.value = values;

    if (sContrl.datacode == "1") {
        CloseAllAir();
        if (document.getElementById("ListAllAirCode_" + indexs).innerText.replace(/(^\s*)|(\s*$)/g, "") == "暂无航班") {
            document.getElementById("ListAllAir_" + indexs).innerHTML = "<div><table width='665' border='0' align='center' cellpadding='0' cellspacing='0' onmouseover=\"this.style.backgroundColor='#FFFFF3'\" onmouseout=\"this.style.backgroundColor=''\"><tr><td width='46' height='50' align='center'></td><td width='115' class='search_re_td'><strong class='search_re_en'>正在查询航班...</td><td>&nbsp;</td></tr><tr><td colspan='10' height='1' align='center' bgcolor='#b5c5d0'></td></tr></table></div>";
            document.getElementById("ListAllAir_" + indexs).style.display = "";
            AirLocalSearch(indexs);
        }
        else {
            document.getElementById("ListAllAirCode_" + indexs).style.display = "";
            document.getElementById("ListAllAir_" + indexs).style.display = "";
        }
    }
    else {
        sContrl.datacode = "1";
        CloseAllAir();
        document.getElementById("ListAllAir_" + indexs).style.display = "";
        document.getElementById("ListAllAir_" + indexs).innerHTML = "<div><table width='665' border='0' align='center' cellpadding='0' cellspacing='0' onmouseover=\"this.style.backgroundColor='#FFFFF3'\" onmouseout=\"this.style.backgroundColor=''\"><tr><td width='46' height='50' align='center'></td><td width='115' class='search_re_td'><strong class='search_re_en'>正在查询航班...</td><td>&nbsp;</td></tr><tr><td colspan='10' height='1' align='center' bgcolor='#b5c5d0'></td></tr></table></div>";
        AirLocalSearch(indexs);
    }
}

function DisPlayLayer(values) {
    var AirCode = values.substring(0, values.indexOf('|'));
    var indexs = values.substring(values.indexOf('|') + 1);

    var liNodes = document.getElementById("ListAllAir_" + indexs).childNodes;
    if (AirCode == "ALL") {
        for (i = 0; i < liNodes.length; i++) {
            if (liNodes[i].aircode != undefined) {
                liNodes[i].style.display = "";
            }
            else {
                if ((liNodes[i].name == "DisplayLast") || (liNodes[i].name == "DisplayAll")) {
                    liNodes[i].style.display = "none";
                }
            }
        }
    }
    else {
        for (i = 0; i < liNodes.length; i++) {
            if (liNodes[i].aircode == AirCode) {
                liNodes[i].style.display = "";
            }
            else {
                if ((liNodes[i].name == "DisplayLast") || (liNodes[i].name == "DisplayAll")) {
                    liNodes[i].style.display = "none";
                }
            }
        }
    }
}

function GetReturnAir(sContrl, values, indexs) {
    var liNodes = sContrl.parentNode.parentNode.childNodes;

    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].firstChild.className = "box2";
    }
    sContrl.className = "box1";
    theForm.Fltd_Return.value = values;

    if (sContrl.datacode == "1") {
        CloseAllAir();
        if (document.getElementById("ListAllAirCode_" + indexs).innerText.replace(/(^\s*)|(\s*$)/g, "") == "暂无航班") {
            document.getElementById("ListAllAir_" + indexs).innerHTML = "<div><table width='665' border='0' align='center' cellpadding='0' cellspacing='0' onmouseover=\"this.style.backgroundColor='#FFFFF3'\" onmouseout=\"this.style.backgroundColor=''\"><tr><td width='46' height='50' align='center'></td><td width='115' class='search_re_td'><strong class='search_re_en'>正在查询航班...</td><td>&nbsp;</td></tr><tr><td colspan='10' height='1' align='center' bgcolor='#b5c5d0'></td></tr></table></div>";
            document.getElementById("ListAllAir_" + indexs).style.display = "";
            AirLocalSearch(indexs);
        }
        else {
            document.getElementById("ListAllAirCode_" + indexs).style.display = "";
            document.getElementById("ListAllAir_" + indexs).style.display = "";
        }
    }
    else {
        sContrl.datacode = "1";
        CloseAllAir();
        document.getElementById("ListAllAir_" + indexs).style.display = "";
        document.getElementById("ListAllAir_" + indexs).innerHTML = "<div><table width='665' border='0' align='center' cellpadding='0' cellspacing='0' onmouseover=\"this.style.backgroundColor='#FFFFF3'\" onmouseout=\"this.style.backgroundColor=''\"><tr><td width='46' height='50' align='center'></td><td width='115' class='search_re_td'><strong class='search_re_en'>正在查询航班...</td><td>&nbsp;</td></tr><tr><td colspan='10' height='1' align='center' bgcolor='#b5c5d0'></td></tr></table></div>";
        AirLocalSearch(indexs);
    }
}

function AirOrder(values) {
    var txtOrg = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var txtDst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;
    var txtCustType = document.getElementById("CustType").options[document.getElementById("CustType").selectedIndex].value;
    var ctlFlyType = theForm.FlyType;
    for (i = 0; i < ctlFlyType.length; i++) {
        if (ctlFlyType[i].checked)
            var txtFlyType = ctlFlyType[i].value;
    }

    CallServer("AirOrder$" + values + "|" + txtOrg + "|" + txtDst + "|" + txtFlyType + "|" + txtCustType, "");
}

function AirReturnOrder(values) {
    var txtOrg = document.getElementById("Org_Return").options[document.getElementById("Org_Return").selectedIndex].value;
    var txtDst = document.getElementById("Dst_Return").options[document.getElementById("Dst_Return").selectedIndex].value;

    CallServer("AirReturnOrder$" + values + "|" + txtOrg + "|" + txtDst, "");
}

function ChangeCustomers(values) {
    var Customers = document.getElementById("Customers").childNodes;
    if (Customers.length > values) {
        for (i = Customers.length; i > values; i--) {
            document.getElementById("Customers").removeChild(Customers[i - 1]);
        }
    }
    else if (Customers.length < values) {
        for (i = Customers.length; i < values; i++) {
            AddCustomer();
        }
    }
}

function AddCustomer() {
    var childCustomer = document.createElement("div");
    childCustomer.style.paddingLeft = 10;

    var sContent = "<table width='645' border='0' align='center' cellpadding='0' cellspacing='0'>";
    sContent += "<tr>";
    sContent += "<td height='33'>";
    sContent += "<table width='645' border='0' cellspacing='0' cellpadding='0'>";
    sContent += "<tr>";
    sContent += "<td width='79' class='Tfont_01'>登机人姓名 ：</td>";
    sContent += "<td width='106'><input name='CustName' type='text' class='texbox_01' id='CustName'  style='width: 90px;' value=''/></td>";
    sContent += "<td width='87' class='Tfont_01'><a href='#' class='link03a'>儿童购票须知</a></td>";
    sContent += "<td width='39' class='Tfont_01'></td>";
    sContent += "<td width='20'></td>";
    sContent += "<td width='38' class='Tfont_01'></td>";
    sContent += "<td width='276' class='Tfont_01'></td>";
    sContent += "</tr>";
    sContent += "</table>";
    sContent += "</td>";
    sContent += "</tr>";
    sContent += "<tr>";
    sContent += "<td height='33'>";
    sContent += "<table width='645' border='0' cellspacing='0' cellpadding='0'>";
    sContent += "<tr>";
    sContent += "<td width='79' class='Tfont_01'>证 件 类 型：</td>";
    sContent += "<td width='107'>";
    sContent += "<select name='CardType' class='texbox_02' id='CardType' style='width: 91px;'>";
    sContent += "<option value='身份证'>身份证</option>";
    sContent += "<option value='护照'>护照</option>";
    sContent += "<option value='其它'>其它</option>";
    sContent += "</select>";
    sContent += "</td>";
    sContent += "<td width='66' class='Tfont_01'>证件号码：</td>";
    sContent += "<td width='169'><input name='CardNo' type='text' class='texbox_01' id='CardNo'  style='width: 150px;' value=''/></td>";
    sContent += "<td width='85'><img src='10_images/ticket/button_de.gif' alt='' width='74' height='20' border='0' onclick='DelCustomer(this);' style='cursor:hand'/></td>";
    sContent += "<td width='139'></td>";
    sContent += "</tr>";
    sContent += "</table>";
    sContent += "</td>";
    sContent += "</tr>";
    sContent += "<tr><td height='10'></td></tr>";
    sContent += "</table>";
    childCustomer.innerHTML = sContent;
    document.getElementById("Customers").appendChild(childCustomer);
}

function ChangeSend(values) {
    if ((values == 2) || (values == 4)) {
        document.getElementById("SendAddress").style.display = "block";
    }
    else {
        document.getElementById("SendAddress").style.display = "none";
    }
}

function DelCustomer(sContrl) {
    var Customers = document.getElementById("Customers").childNodes;
    var tmpContrl = sContrl.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;

    if (Customers.length > 1) {
        document.getElementById("Customers").removeChild(tmpContrl);
        document.getElementById("CustNums").value = Customers.length;
    }
}

function AirOrderList() {
    var sFlag = true;
    var txtCustNums = document.getElementById("CustNums").options[document.getElementById("CustNums").selectedIndex].value;
    var txtInsurance = document.getElementById("Insurance").options[document.getElementById("Insurance").selectedIndex].value;

    var CustName = document.getElementsByName("CustName");
    var CardType = document.getElementsByName("CardType");
    var CardNo = document.getElementsByName("CardNo");

    var txtCustName = "";
    var txtCardType = "";
    var txtCardNo = "";

    var txtContactMan = document.getElementById("ContactMan").value;
    var txtMobile = document.getElementById("Mobile").value;
    var txtTel = document.getElementById("Tel").value;
    var txtContactEmail = document.getElementById("ContactEmail").value;
    var txtAddress = document.getElementById("Address").value;
    var txtPostCode = document.getElementById("PostCode").value;
    var txtContent = document.getElementById("Content").value;
    var txtUserID = document.getElementById("UserID").value;

    var SendTo = document.getElementsByName("SendTo");
    var txtSendTo = "";
    for (i = 0; i < SendTo.length; i++) {
        if (SendTo[i].checked) {
            txtSendTo = SendTo[i].value;
        }
    }

    if (txtCustNums != CustName.length) {
        CreateModalPopup("所选乘机人数与实际填写的乘机人数不符！");
    }
    else {

        for (i = 0; i < CustName.length; i++) {
            txtCustName += "," + CustName[i].value;
            if (CustName[i].value.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sFlag = false;
            };
        }
        for (i = 0; i < CardNo.length; i++) {
            txtCardNo += "," + CardNo[i].value;
            if (CardNo[i].value.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sFlag = false;
            };
        }
        for (i = 0; i < CardType.length; i++) {
            txtCardType += "," + CardType[i].options[CardType[i].selectedIndex].value;
        }

        if (!sFlag) {
            CreateModalPopup("请填写乘机人资料！");
        }
        else {
            var sErr = "";
            if (txtContactMan.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sErr += "<b>请填写联系人姓名！</b><br>";
            }
            if ((txtMobile.replace(/(^\s*)|(\s*$)/g, "").length == 0) && (txtTel.replace(/(^\s*)|(\s*$)/g, "").length == 0)) {
                sErr += "<b>请填写联系人手机或备用电话！</b><br>";
            }
            if (txtContactEmail.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sErr += "<b>请填写电子邮箱！</b><br>";
            }
            else {
                if (!IsEmail(txtContactEmail)) {
                    sErr += "<b>电子邮箱格式错误！</b><br>";
                }
            }

            if (sErr.length > 0) {
                CreateModalPopup(sErr);
            }
            else {
                txtCustName = txtCustName.substring(1);
                txtCardType = txtCardType.substring(1);
                txtCardNo = txtCardNo.substring(1);

                CreateWaitPopup("正在提交定单，请稍等...");

                if (txtUserID == 0) {
                    CallServer("Register$" + txtCustNums + "|" + txtCustName + "|" + txtCardType + "|" + txtCardNo + "|" + txtContactEmail + "|" + txtContactMan + "|" + txtMobile + "|" + txtTel + "|" + txtPostCode + "|" + txtAddress + "|" + txtSendTo + "|" + txtContent + "|" + txtInsurance, "");
                }
                else {
                    CallServer("AirOrderList$" + txtCustNums + "|" + txtCustName + "|" + txtCardType + "|" + txtCardNo + "|" + txtContactEmail + "|" + txtContactMan + "|" + txtMobile + "|" + txtTel + "|" + txtPostCode + "|" + txtAddress + "|" + txtSendTo + "|" + txtContent + "|" + txtInsurance, "");
                }
            }
        }
    }
}

function AgioAirSearch() {
    var txtOrg = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var txtDst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;

    if ((txtOrg.length == 0) && (txtDst.length == 0)) {
        CreateModalPopup("请选择出发城市和到达城市！");
    }
    else {
        window.location = "AgioAir.aspx?Org=" + txtOrg + "&Dst=" + txtDst;
    }
}

function ChangePass() {
    document.getElementById("UserPass").readOnly = false;
}

function SubmitInfo() {
    var txtUserPass = document.getElementById("UserPass").value;
    var txtUserName = document.getElementById("UserName").value;
    var txtSex = document.getElementById("Sex").value;
    var txteName = document.getElementById("eName").value;
    var txtMobile = document.getElementById("Mobile").value;
    var txtTel = document.getElementById("Tel").value;
    var txtFax = document.getElementById("Fax").value;
    var txtQQ = document.getElementById("QQ").value;
    var txtPostCode = document.getElementById("PostCode").value;
    var txtAddress = document.getElementById("Address").value;

    CallServer("SubmitInfo$" + txtUserPass + "|" + txtUserName + "|" + txtSex + "|" + txteName + "|" + txtMobile + "|" + txtTel + "|" + txtFax + "|" + txtQQ + "|" + txtPostCode + "|" + txtAddress, "");
}

function TenPay() {
    var Total = document.getElementById("TenTotal").value;

    if (Total.length == 0) {
        alert("请填写支付金额！");
        document.getElementById("TenTotal").focus();
    }
    else {
        window.location = "TenPay.aspx?Total=" + Total;
    }
}

function AliPay() {
    var Total = document.getElementById("AliTotal").value;

    if (Total.length == 0) {
        alert("请填写支付金额！");
        document.getElementById("AliTotal").focus();
    }
    else {
        window.location = "AliPay.aspx?Total=" + Total;
    }
}

function Bill99Pay() {
    var Total = document.getElementById("Bill99Total").value;

    if (Total.length == 0) {
        alert("请填写支付金额！");
        document.getElementById("Bill99Total").focus();
    }
    else {
        window.location = "99Bill.aspx?Total=" + Total;
    }
}

function CreateWaitPopup(sContent) {
    CloseWaitPopup();

    var popupDiv = document.createElement("div");
    var popupTable = document.createElement("table");
    var popupTableBody = document.createElement("tbody");
    var contentRow = document.createElement("tr");
    var iconCell = document.createElement("td");
    var iconImage = document.createElement("img");
    var contentCell = document.createElement("td");
    var buttonRow = document.createElement("tr");
    var buttonCell = document.createElement("td");
    var buttonImage = document.createElement("img");

    var w = document.body.scrollWidth;
    var h = document.body.scrollHeight;
    var hh = document.documentElement.scrollHeight;

    popupDiv.id = "WaitPopup";
    popupDiv.style.zIndex = "1000";
    popupDiv.style.textAlign = "center"
    popupDiv.style.left = (window.screen.width - 250) / 2;
    popupDiv.style.top = document.documentElement.scrollTop + (window.screen.height - 300) / 2;
    popupDiv.style.position = "absolute";

    popupTable.cellPadding = 0;
    popupTable.cellSpacing = 0;
    popupTable.border = 0;
    popupTable.width = 250;
    popupTable.height = 100;
    popupTable.style.display = "block";
    popupTable.style.position = "relative";

    contentRow.vAlign = 'center';
    contentRow.style.height = 70;

    iconCell.style.backgroundColor = 'White';
    iconCell.style.padding = "5px";
    iconCell.style.borderTop = "1px solid black";
    iconCell.style.borderLeft = "1px solid black";
    iconCell.align = 'center';
    iconCell.width = 50;

    iconImage.src = "images/alert-large.gif";

    contentCell.style.backgroundColor = 'White';
    contentCell.style.fontFamily = 'verdana';
    contentCell.style.fontSize = '12px';
    contentCell.style.padding = "5px";
    contentCell.style.borderTop = "1px solid black";
    contentCell.style.borderRight = "1px solid black";
    contentCell.align = 'left';
    contentCell.width = 200;
    contentCell.innerHTML = sContent;

    buttonRow.vAlign = 'center';
    buttonRow.style.height = 30;

    buttonCell.style.backgroundColor = 'White';
    buttonCell.style.fontFamily = 'verdana';
    buttonCell.style.fontSize = '12px';
    buttonCell.style.padding = "5px";
    buttonCell.style.borderRight = "1px solid black";
    buttonCell.style.borderBottom = "1px solid black";
    buttonCell.style.borderLeft = "1px solid black";
    buttonCell.colSpan = '2';
    buttonCell.width = '100%';

    buttonImage.src = "images/ticket/loading.gif";
    buttonImage.style.cursor = 'pointer';
    //alert(document.body.firstChild.id);
    //document.body.firstChild.appendChild(popupDiv);
    theForm.appendChild(popupDiv);
    popupDiv.appendChild(popupTable);
    popupTable.appendChild(popupTableBody);
    popupTableBody.appendChild(contentRow);
    contentRow.appendChild(iconCell);
    iconCell.appendChild(iconImage);
    contentRow.appendChild(contentCell);
    popupTableBody.appendChild(buttonRow);
    buttonRow.appendChild(buttonCell);
    buttonCell.appendChild(buttonImage);

    buttonImage.onclick = function() {
        //document.body.firstChild.removeChild(popupDiv);
        //        theForm.removeChild(popupDiv);
        //        CloseBackFrame();
    }

    CreateBackFrame();
}

function CloseWaitPopup() {
    var WaitPopup = document.getElementById("WaitPopup");
    if (WaitPopup != null) {
        //document.body.firstChild.removeChild(ModalPopup);
        //theForm.removeChild(WaitPopup);
        WaitPopup.parentNode.removeChild(WaitPopup);
    }

    CloseBackFrame();
}

function mousePosition(ev) {
    return { x: ev.pageX || (ev.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)), y: ev.pageY || (ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop))
    };
//    if (ev.pageX || ev.pageY) {
//        return { x: ev.pageX, y: ev.pageY };
//    }
//    return { x: ev.screenX, y: ev.screenY };
    //if (ev.clientX || ev.clientY) {
//        return {
//            x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
//            y: ev.clientY + document.body.scrollTop - document.body.clientTop
//        };
    //}
    //return { x: ev.x, y: ev.y };
}

function CloseProvision(Contrl) {
    var sContrl = document.getElementById(Contrl);
    if (sContrl != null) {
        sContrl.style.display = 'none';
    }
}

function ShowProvision(ev, Contrl) {
    ev = ev || window.event;
    var mousePos = mousePosition(ev); 
    var sContrl = document.getElementById(Contrl);
    if (sContrl != null) {
        sContrl.style.left = mousePos.x;
        sContrl.style.top = mousePos.y;
        sContrl.style.display = 'block';

        setTimeout("CloseProvision(" + Contrl + ")", 10000);
    }
    else {
        var div = document.createElement("DIV");
        div.id = Contrl;
        div.style.left = mousePos.x;
        div.style.top = mousePos.y;
        div.style.width = 320;
        //div.style.height = 246;
        div.style.position = "absolute";
        div.style.display = "none";
        theForm.appendChild(div);

        CallServer("ShowProvision$" + Contrl, "");
    }
}

function ResetPass() {
    var UserName = document.getElementById("UserName").value;
    var UserPass = document.getElementById("UserPass").value;
    var VerifyCode = document.getElementById("VerifyCode").value;

    CallServer("ResetPass$" + UserName + "|" + UserPass + "|" + VerifyCode, "");
}

function SubmitOrder() {
    CreateWaitPopup("正在提交定单，请稍等...");

    var Payment = document.getElementsByName("Payment");
    var txtPayment = "";
    for (i = 0; i < Payment.length; i++) {
        if (Payment[i].checked) {
            txtPayment = Payment[i].value;
        }
    }

    CallServer("AirOrderSubmit$" + txtPayment);
}

function Pay() {
    var OrderID = document.getElementById("OrderID").value;
    window.location = "Pay.aspx?OrderID=" + OrderID;
    //theForm.target = "_blank";
    //theForm.action = "Pay.aspx";
    //theForm.action = "Register.aspx";
    //theForm.submit();
}

function ChangeOrderStatus() {
    var txtOrderStatus = 0;
    var ctlOrderStatus = theForm.OrderStatus;
    for (i = 0; i < ctlOrderStatus.length; i++) {
        if (ctlOrderStatus[i].checked)
            txtOrderStatus = ctlOrderStatus[i].value;
    }
    var txtContent = document.getElementById("Content").value;
    if (txtOrderStatus != 0) {
        CallServer("UpdateOrderStatus$" + txtOrderStatus + "|" + txtContent, "");
    }
    else {
        CreateModalPopup("请选择处理方式！");
    }
}

function AirOrderSearch() {
    var OrderID = document.getElementById("OrderID").value;
    var CustName = document.getElementById("CustName").value;
    var Fltd = document.getElementById("Fltd").value;
    var OrderStatus = document.getElementById("OrderStatus").options[document.getElementById("OrderStatus").selectedIndex].value;
    var Org = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var Dst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;
    var PostDate = document.getElementById("PostDate").value;
    window.location = "MyAirOrder.aspx?OrderID=" + OrderID + "&CustName=" + CustName + "&Fltd=" + Fltd + "&OrderStatus=" + OrderStatus + "&Org=" + Org + "&Dst=" + Dst + "&PostDate=" + PostDate;
}

function ListHotelByCode(CityCode, sContrl) {
    var HotelsA = document.getElementsByName("HotelsA");
    for (i = 0; i < HotelsA.length; i++) {
        HotelsA[i].className = "hotel_over01";
    }
    sContrl.className = "hotel_on01";
    CallServer("ListHotelByCodes$" + CityCode, "");
}

function ListHotelByCodes(CityCode, sContrl) {
    var HotelsA = document.getElementsByName("HotelsA");
    for (i = 0; i < HotelsA.length; i++) {
        HotelsA[i].className = "off";
    }
    sContrl.className = "on";
    CallServer("ListHotelByCodes$" + CityCode, "");
}

function ChangeSearch(values) {
    var TravelSearch = document.getElementById("TravelSearch");
    var TravelSearchTable = document.getElementById("TravelSearchTable");
    if (values == 1) {
        document.getElementById("AirSearch").innerHTML = "<div class='search_b01'>机票查询</div>";
        document.getElementById("HotelSearch").innerHTML = "<a href='#' class='search_b02' onclick='ChangeSearch(2)'>酒店查询</div>";
        document.getElementById("AirSearchTable").style.display = "block";
        document.getElementById("HotelSearchTable").style.display = "none";
        if ((TravelSearch != undefined) && (TravelSearchTable != undefined)) {
            TravelSearch.innerHTML = "<a href='#' class='search_b02' onclick='ChangeSearch(3)'>旅游查询</div>";
            TravelSearchTable.style.display = "none";
        }
    }
    else if (values == 2) {
        document.getElementById("AirSearch").innerHTML = "<a href='#' class='search_b02' onclick='ChangeSearch(1)'>机票查询</div>";
        document.getElementById("HotelSearch").innerHTML = "<div class='search_b01'>酒店查询</div>";
        document.getElementById("AirSearchTable").style.display = "none";
        document.getElementById("HotelSearchTable").style.display = "block";
        if ((TravelSearch != undefined) && (TravelSearchTable != undefined)) {
            TravelSearch.innerHTML = "<a href='#' class='search_b02' onclick='ChangeSearch(3)'>旅游查询</div>";
            TravelSearchTable.style.display = "none";
        }
    }
    else {
        document.getElementById("AirSearch").innerHTML = "<a href='#' class='search_b02' onclick='ChangeSearch(1)'>机票查询</div>";
        document.getElementById("HotelSearch").innerHTML = "<a href='#' class='search_b02' onclick='ChangeSearch(2)'>酒店查询</div>";
        document.getElementById("AirSearchTable").style.display = "none";
        document.getElementById("HotelSearchTable").style.display = "none";
        if ((TravelSearch != undefined) && (TravelSearchTable != undefined)) {
            TravelSearch.innerHTML = "<div class='search_b01'>旅游查询</div>";
            TravelSearchTable.style.display = "block";
        }
    }
}

function HotelSearch() {
    var CityCode = document.getElementById("CityCode").options[document.getElementById("CityCode").selectedIndex].value;
    var CheckInDate = document.getElementById("CheckInDate").value;
    var RateMinMax = document.getElementById("RateMinMax").options[document.getElementById("RateMinMax").selectedIndex].value;
    var PropertyName = document.getElementById("PropertyName").value;
    var CheckOutDate = document.getElementById("CheckOutDate").value;
    var RankCode = document.getElementById("RankCode").options[document.getElementById("RankCode").selectedIndex].value;
    var RateMin = RateMinMax.substring(0, RateMinMax.indexOf("/"));
    var RateMax = RateMinMax.substring(RateMinMax.indexOf("/") + 1);
    var PorName = "";

    window.location = "HotelsSearch.aspx?CityCode=" + CityCode + "&CheckInDate=" + CheckInDate + "&CheckOutDate=" + CheckOutDate + "&RankCode=" + RankCode + "&PropertyName=" + PropertyName + "&RateMin=" + RateMin + "&RateMax=" + RateMax + "&PorName=" + PorName
}

function HotelsSearchs10() {
    var CityCode = document.getElementById("CityCode").value;
    var CheckInDate = document.getElementById("CheckInDate").value;
    var CheckOutDate = document.getElementById("CheckOutDate").value;
    var RankCode = document.getElementById("RankCode").options[document.getElementById("RankCode").selectedIndex].value;
    var PropertyName = document.getElementById("PropertyName").value;
    var RateMinMax = document.getElementById("RateMinMax").options[document.getElementById("RateMinMax").selectedIndex].value;
    var RateMin = RateMinMax.substring(0, RateMinMax.indexOf("/"));
    var RateMax = RateMinMax.substring(RateMinMax.indexOf("/") + 1);
    var PorName = "";

    window.location = "HotelsSearch.aspx?CityCode=" + CityCode + "&CheckInDate=" + CheckInDate + "&CheckOutDate=" + CheckOutDate + "&RankCode=" + RankCode + "&PropertyName=" + PropertyName + "&RateMin=" + RateMin + "&RateMax=" + RateMax + "&PorName=" + PorName
}

function ChangeSelectCity(values) {
    document.getElementById("CityCode").value = values;
    document.getElementById("SelectCityCName").value = values;
    CallServer("ListPorName$" + values, "");
}

function ChangeSelectCityCName(values) {
    document.getElementById("CityCode").value = values;
    var ctlSelectCity = theForm.SelectCity;
    for (i = 0; i < ctlSelectCity.length; i++) {
        if (ctlSelectCity[i].value == values)
            ctlSelectCity[i].checked = true;
    }
    CallServer("ListPorName$" + values, "");
}

function HotelsSearchs() {
    var CityCode = document.getElementById("CityCode").value;
    var CheckInDate = document.getElementById("CheckInDate").value;
    var CheckOutDate = document.getElementById("CheckOutDate").value;
    var ctlRankCode = theForm.RankCode;
    for (i = 0; i < ctlRankCode.length; i++) {
        if (ctlRankCode[i].checked)
            var RankCode = ctlRankCode[i].value;
    }
    var PropertyName = document.getElementById("PropertyName").value;
    var RateMinMax = document.getElementById("RateMinMax").options[document.getElementById("RateMinMax").selectedIndex].value;
    var RateMin = RateMinMax.substring(0, RateMinMax.indexOf("/"));
    var RateMax = RateMinMax.substring(RateMinMax.indexOf("/") + 1);
    var PorName = document.getElementById("PorName").options[document.getElementById("PorName").selectedIndex].value;
    if (PorName == "请选择") { PorName = ""; }

    window.location = "HotelsSearch.aspx?CityCode=" + CityCode + "&CheckInDate=" + CheckInDate + "&CheckOutDate=" + CheckOutDate + "&RankCode=" + RankCode + "&PropertyName=" + PropertyName + "&RateMin=" + RateMin + "&RateMax=" + RateMax + "&PorName=" + PorName
}

function HotelPage(values) {
    var CityCode = document.getElementById("HideCityCode").value;
    var CheckInDate = document.getElementById("HideCheckInDate").value;
    var CheckOutDate = document.getElementById("HideCheckOutDate").value;
    var RankCode = document.getElementById("HideRankCode").value;
    var PropertyName = document.getElementById("HidePropertyName").value;
    var RateMin = document.getElementById("HideRateMin").value;
    var RateMax = document.getElementById("HideRateMax").value;
    var PorName = document.getElementById("HidePorName").value;
    CallServer("HotelSearchPage$" + values + "|" + CityCode + "|" + CheckInDate + "|" + CheckOutDate + "|" + RankCode + "|" + PropertyName + "|" + RateMin + "|" + RateMax + "|" + PorName, "");
}

function HotelOrderConfirm() {
    var UserID = document.getElementById("UserID").value;
    var CityCode = document.getElementById("HideCityCode").value;
    var CheckInDate = document.getElementById("HideCheckInDate").value;
    var CheckOutDate = document.getElementById("HideCheckOutDate").value;
    var PropertyID = document.getElementById("PropertyID").value;
    var RoomCode = document.getElementById("RoomCode").value;
    var RateAmount = document.getElementById("RateAmount").value;
    var RoomQuantity = document.getElementById("RoomQuantity").options[document.getElementById("RoomQuantity").selectedIndex].value;
    var guestNames = document.getElementById("guestNames").value;
    var guestMobile = document.getElementById("guestMobile").value;
    var guestType = document.getElementById("guestType").options[document.getElementById("guestType").selectedIndex].value;
    var ArrivalEarlyTime = document.getElementById("ArrivalEarlyTime").options[document.getElementById("ArrivalEarlyTime").selectedIndex].value;
    var ArrivalLateTime = document.getElementById("ArrivalLateTime").options[document.getElementById("ArrivalLateTime").selectedIndex].value;
    var ContactMan = document.getElementById("ContactMan").value;
    var Mobile = document.getElementById("Mobile").value;
    var ContactEmail = document.getElementById("ContactEmail").value;
    var Tel = document.getElementById("Tel").value;
    var SpecialRequest1 = document.getElementById("SpecialRequest1").options[document.getElementById("SpecialRequest1").selectedIndex].value;
    var ctlSpecialRequest5 = theForm.SpecialRequest5;
    for (i = 0; i < ctlSpecialRequest5.length; i++) {
        if (ctlSpecialRequest5[i].checked)
            var SpecialRequest5 = ctlSpecialRequest5[i].value;
    }
    var SpecialRequest3 = document.getElementById("SpecialRequest3").options[document.getElementById("SpecialRequest3").selectedIndex].value;
    var ctlSpecialRequest4 = theForm.SpecialRequest4;
    for (i = 0; i < ctlSpecialRequest4.length; i++) {
        if (ctlSpecialRequest4[i].checked)
            var SpecialRequest4 = ctlSpecialRequest4[i].value;
    }
    var SpecialRequest2 = document.getElementById("SpecialRequest2").options[document.getElementById("SpecialRequest2").selectedIndex].value;
    var SpecialRequest = SpecialRequest1 + SpecialRequest2 + SpecialRequest3 + "0" + SpecialRequest5;

    var sErr = "";
    if (guestNames.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
        sErr += "<b>请填写入住人姓名！</b><br>";
    }
    if (ContactMan.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
        sErr += "<b>请填写联系人姓名！</b><br>";
    }
    if ((Mobile.replace(/(^\s*)|(\s*$)/g, "").length == 0) && (Tel.replace(/(^\s*)|(\s*$)/g, "").length == 0)) {
        sErr += "<b>请填写联系人手机或备用电话！</b><br>";
    }
    if (ContactEmail.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
        sErr += "<b>请填写电子邮箱！</b><br>";
    }
    else {
        if (!IsEmail(ContactEmail)) {
            sErr += "<b>电子邮箱格式错误！</b><br>";
        }
    }

    if (sErr.length > 0) {
        CreateModalPopup(sErr);
    }
    else {
        CreateWaitPopup("正在提交定单，请稍等...");

        if (UserID == 0) {
            CallServer("HotelRegister$" + CityCode + "|" + CheckInDate + "|" + CheckOutDate + "|" + PropertyID + "|" + RoomCode + "|" + RateAmount + "|" + RoomQuantity + "|" + guestNames + "|" + guestMobile + "|" + guestType + "|" + ArrivalEarlyTime + "|" + ArrivalLateTime + "|" + ContactMan + "|" + Mobile + "|" + ContactEmail + "|" + Tel + "|" + SpecialRequest, "");
        }
        else {
            CallServer("HotelOrder$" + CityCode + "|" + CheckInDate + "|" + CheckOutDate + "|" + PropertyID + "|" + RoomCode + "|" + RateAmount + "|" + RoomQuantity + "|" + guestNames + "|" + guestMobile + "|" + guestType + "|" + ArrivalEarlyTime + "|" + ArrivalLateTime + "|" + ContactMan + "|" + Mobile + "|" + ContactEmail + "|" + Tel + "|" + SpecialRequest, "");
        }
    }
}

function HotelOrderList() {
    CreateWaitPopup("正在提交定单，请稍等...");

    CallServer("HotelOrderList$", "");
}

function HotelOrderSearch() {
    var OrderID = document.getElementById("OrderID").value;
    var GuestNames = document.getElementById("GuestNames").value;
    var CheckInDate = document.getElementById("CheckInDate").value;
    var OrderStatus = document.getElementById("OrderStatus").options[document.getElementById("OrderStatus").selectedIndex].value;
    var CityName = document.getElementById("CityName").value;
    var CheckOutDate = document.getElementById("CheckOutDate").value;
    window.location = "MyHotelsOrder.aspx?OrderID=" + OrderID + "&GuestNames=" + GuestNames + "&CheckInDate=" + CheckInDate + "&OrderStatus=" + OrderStatus + "&CityName=" + CityName + "&CheckOutDate=" + CheckOutDate;
}

function SubmitRecommended() {
    var txtUserID = document.getElementById("UserID").value;
    var txtPropertyID = document.getElementById("PropertyID").value;
    var txtContent = document.getElementById("Content").value;
    var ctlRecommended = theForm.Recommended;
    for (i = 0; i < ctlRecommended.length; i++) {
        if (ctlRecommended[i].checked)
            var txtRecommended = ctlRecommended[i].value;
    }

    if (txtUserID == 0) {
        CreateModalPopup("请登录发言，并遵守相关规定！");
        return false;
    }
    else {
        if (txtContent.length == 0) {
            CreateModalPopup("请填写酒店点评,500字以内。<br>请勿发表违反国家法律的言论！");
            return false;
        }
        else {
            txtContent = txtContent.replace(/(\|)/g, "");
            CallServer("SubmitRecommended$" + txtContent + "|" + txtRecommended + "|" + txtPropertyID, "");
        }
    }
}

function TravelSearch() {
    var LineType = document.getElementById("LineType").options[document.getElementById("LineType").selectedIndex].value;
    var Org = document.getElementById("TravelOrg").options[document.getElementById("TravelOrg").selectedIndex].value;
    var Dst = document.getElementById("TravelDst").value;
    var UserLineType = document.getElementById("UserLineType").options[document.getElementById("UserLineType").selectedIndex].value;
    var Price = document.getElementById("Price").options[document.getElementById("Price").selectedIndex].value;
    var MinPrice = Price.substring(0, Price.indexOf('/')); ;
    var MaxPrice = Price.substring(Price.indexOf('/') + 1); ;
    window.location = "TravelSearch.aspx?TravelLine=" + LineType + "&Org=" + Org + "&Dst=" + Dst + "&UserTravelLine=" + UserLineType + "&MinPrice=" + MinPrice + "&MaxPrice=" + MaxPrice;
}

function LineTypeChange(LineType, sContrl) {
    var liNodes = document.getElementsByName("TravelTab");
    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].className = "travel_over01";
    }

    sContrl.className = "travel_on01";
    CallServer("ListTravel10$" + LineType, "");
}

function ResetTravelSearch() {

}

function TravelSearchs() {
    var LineType = document.getElementById("LineType").options[document.getElementById("LineType").selectedIndex].value;
    var Org = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
    var Dst = document.getElementById("Dst").value;
    var UserLineType = document.getElementById("UserLineType").options[document.getElementById("UserLineType").selectedIndex].value;
    var Price = document.getElementById("Price").options[document.getElementById("Price").selectedIndex].value;
    var MinPrice = Price.substring(0, Price.indexOf('/')); ;
    var MaxPrice = Price.substring(Price.indexOf('/') + 1); ;
    window.location = "TravelSearch.aspx?TravelLine=" + LineType + "&Org=" + Org + "&Dst=" + Dst + "&UserTravelLine=" + UserLineType + "&MinPrice=" + MinPrice + "&MaxPrice=" + MaxPrice;
}

function HotLineChange(value) {
    if (value == 1) {
        document.getElementById("HotLineSpan01").className = "Travel_hotbtn_on";
        document.getElementById("HotLineSpan01").innerHTML = "国内线";
        document.getElementById("HotLineSpan02").className = "Travel_hotbtn_over";
        document.getElementById("HotLineSpan02").innerHTML = "<a href='javascript:HotLineChange(2);'>国外线</a>";

        document.getElementById("HotLineDiv01").style.display = "inline";
        document.getElementById("HotLineDiv02").style.display = "none";
    }
    else {
        document.getElementById("HotLineSpan01").className = "Travel_hotbtn_over";
        document.getElementById("HotLineSpan01").innerHTML = "<a href='javascript:HotLineChange(1);'>国内线</a>";
        document.getElementById("HotLineSpan02").className = "Travel_hotbtn_on";
        document.getElementById("HotLineSpan02").innerHTML = "国外线";

        document.getElementById("HotLineDiv01").style.display = "none";
        document.getElementById("HotLineDiv02").style.display = "inline";
    }
}

function KeyWordChange(value) {
    if (value == 1) {
        document.getElementById("KeyWordSpan01").className = "Travel_hotbtn_on";
        document.getElementById("KeyWordSpan01").innerHTML = "国内线";
        document.getElementById("KeyWordSpan02").className = "Travel_hotbtn_over";
        document.getElementById("KeyWordSpan02").innerHTML = "<a href='javascript:KeyWordChange(2);'>国外线</a>";

        document.getElementById("KeyWordDiv01").style.display = "inline";
        document.getElementById("KeyWordDiv02").style.display = "none";
    }
    else {
        document.getElementById("KeyWordSpan01").className = "Travel_hotbtn_over";
        document.getElementById("KeyWordSpan01").innerHTML = "<a href='javascript:KeyWordChange(1);'>国内线</a>";
        document.getElementById("KeyWordSpan02").className = "Travel_hotbtn_on";
        document.getElementById("KeyWordSpan02").innerHTML = "国外线";

        document.getElementById("KeyWordDiv01").style.display = "none";
        document.getElementById("KeyWordDiv02").style.display = "inline";
    }
}

function OrgChange(value, sContrl, sContrls, pages) {
    if (pages == undefined) {
        pages = 1;
    }
    if (pages == "") {
        pages = 1;
    }
    var liNodes = document.getElementsByName("TravelCityList");
    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].className = "Travel_gobtn02";
    }
    var liNode = document.getElementsByName("TravelCityLists");
    for (i = 0; i < liNode.length; i++) {
        liNode[i].style.color = "black";
    }

    var HiddenTravelLine = 0;
    var ctlHiddenTravelLine = theForm.HiddenTravelLine;
    for (i = 0; i < ctlHiddenTravelLine.length; i++) {
        if (ctlHiddenTravelLine[i].checked)
            HiddenTravelLine = ctlHiddenTravelLine[i].value;
    }

    sContrls.className = "Travel_gobtn01";
    sContrl.style.color = "white";
    
    document.getElementById("HiddenOrg").value = value;
    if (value == -1) {
        document.getElementById("OtherOrgDiv").style.display = "";
    }
    else {
        document.getElementById("OtherOrgDiv").style.display = "none";
        var TravelListDiv = document.getElementById("TravelListDiv");
        var TravelListCHD = document.getElementById("TravelList_" + value + "_" + HiddenTravelLine + "_" + pages);
        var TravelListDivs = TravelListDiv.childNodes;

        for (i = 0; i < TravelListDivs.length; i++) {
            TravelListDivs[i].style.display = "none";
        }

        if (TravelListCHD != null) {
            if (TravelListCHD.enable == 1) {
                TravelListCHD.style.display = "";
            }
            else {
                TravelListCHD.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";
                TravelListCHD.style.display = "";
                CallServer("TravelList10$" + value + "|" + HiddenTravelLine + "|" + pages, "");
            }
        }
        else {
            TravelListCHD = document.createElement("div");
            TravelListCHD.id = "TravelList_" + value + "_" + HiddenTravelLine + "_" + pages;
            TravelListCHD.style.display = '';
            TravelListCHD.enable = 0;
            TravelListCHD.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";
            TravelListDiv.appendChild(TravelListCHD);

            CallServer("TravelList10$" + value + "|" + HiddenTravelLine + "|" + pages, "");
        }
    }
}

function TravelLineChange(value) {
    var Org = document.getElementById("HiddenOrg").value;
    var pages = 1;
    if (Org > -1) {
        var TravelListDiv = document.getElementById("TravelListDiv");
        var TravelListCHD = document.getElementById("TravelList_" + Org + "_" + value + "_" + pages);
        var TravelListDivs = TravelListDiv.childNodes;

        for (i = 0; i < TravelListDivs.length; i++) {
            TravelListDivs[i].style.display = "none";
        }

        if (TravelListCHD != null) {
            if (TravelListCHD.enable == 1) {
                TravelListCHD.style.display = "";
            }
            else {
                TravelListCHD.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";
                TravelListCHD.style.display = "";
                CallServer("TravelList10$" + Org + "|" + value + "|" + pages, "");
            }
        }
        else {
            TravelListCHD = document.createElement("div");
            TravelListCHD.id = "TravelList_" + Org + "_" + value + "_" + pages;
            TravelListCHD.style.display = '';
            TravelListCHD.enable = 0;
            TravelListCHD.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";
            TravelListDiv.appendChild(TravelListCHD);

            CallServer("TravelList10$" + Org + "|" + value + "|" + pages, "");
        }
    }
}

function OtherOrgChange(value) {
    if (value != "") {
        var HiddenTravelLine = 0;
        var ctlHiddenTravelLine = theForm.HiddenTravelLine;
        for (i = 0; i < ctlHiddenTravelLine.length; i++) {
            if (ctlHiddenTravelLine[i].checked)
                HiddenTravelLine = ctlHiddenTravelLine[i].value;
        }
        window.location = "TravelSearch.aspx?TravelLine=" + HiddenTravelLine + "&Org=" + value;
    }
}

function GoPage(value) {
    var Org = document.getElementById("HiddenOrg").value;
    if (Org > -1) {
        var HiddenTravelLine = 0;
        var ctlHiddenTravelLine = theForm.HiddenTravelLine;
        for (i = 0; i < ctlHiddenTravelLine.length; i++) {
            if (ctlHiddenTravelLine[i].checked)
                HiddenTravelLine = ctlHiddenTravelLine[i].value;
        }

        var TravelListDiv = document.getElementById("TravelListDiv");
        var TravelListCHD = document.getElementById("TravelList_" + Org + "_" + HiddenTravelLine + "_" + value);
        var TravelListDivs = TravelListDiv.childNodes;

        for (i = 0; i < TravelListDivs.length; i++) {
            TravelListDivs[i].style.display = "none";
        }

        if (TravelListCHD != null) {
            if (TravelListCHD.enable == 1) {
                TravelListCHD.style.display = "";
            }
            else {
                TravelListCHD.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";
                TravelListCHD.style.display = "";
                CallServer("TravelList10$" + Org + "|" + HiddenTravelLine + "|" + value, "");
            }
        }
        else {
            TravelListCHD = document.createElement("div");
            TravelListCHD.id = "TravelList_" + Org + "_" + HiddenTravelLine + "_" + value;
            TravelListCHD.style.display = '';
            TravelListCHD.enable = 0;
            TravelListCHD.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";
            TravelListDiv.appendChild(TravelListCHD);

            CallServer("TravelList10$" + Org + "|" + HiddenTravelLine + "|" + value, "");
        }
    }
}

function TurnPage(value) {
    var TravelSearchList = document.getElementById("TravelSearchList");
    TravelSearchList.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>正在搜索旅游...</td></tr></table>";

    var TravelLine = value.substring(0, value.indexOf(','));
    value = value.substring(value.indexOf(',') + 1);
    var Org = value.substring(0, value.indexOf(','));
    value = value.substring(value.indexOf(',') + 1);
    var Dst = value.substring(0, value.indexOf(','));
    value = value.substring(value.indexOf(',') + 1);
    var UserTravelLine = value.substring(0, value.indexOf(','));
    value = value.substring(value.indexOf(',') + 1);
    var MinPrice = value.substring(0, value.indexOf(','));
    value = value.substring(value.indexOf(',') + 1);
    var MaxPrice = value.substring(0, value.indexOf(','));
    value = value.substring(value.indexOf(',') + 1);
    var TagID = value.substring(0, value.indexOf(','));
    PageNo = value.substring(value.indexOf(',') + 1);

    CallServer("TravelSearch10$" + TravelLine + "|" + Org + "|" + Dst + "|" + UserTravelLine + "|" + MinPrice + "|" + MaxPrice + "|" + TagID + "|" + PageNo, "");
}

function doZoom(sContrl,size) {
    document.getElementById(sContrl).style.fontSize = size + 'px';
}

function TravelTabChange(sContrl, TabID, TravelID) {
    var liNodes = sContrl.parentNode.childNodes;
    for (i = 0; i < liNodes.length; i++) {
        liNodes[i].className = "but02";
    }

    sContrl.className = "but01";

    var TravelTabNodes = document.getElementById("TravelTabContent").childNodes;
    for (i = 0; i < TravelTabNodes.length; i++) {
        TravelTabNodes[i].style.display = "none";
    }
    document.getElementById("TravelTabContent_" + TravelID + "_" + TabID).style.display = "";
}

function ChangeCustomersAdult(values) {
    var CustomersAdult = document.getElementById("CustomersAdult").childNodes;
    if (CustomersAdult.length > values) {
        for (i = CustomersAdult.length; i > values; i--) {
            document.getElementById("CustomersAdult").removeChild(CustomersAdult[i - 1]);
        }
    }
    else if (CustomersAdult.length < values) {
        for (i = CustomersAdult.length; i < values; i++) {
            AddCustomerAdult();
        }
    }

    ResetTravelNum();
}

function ChangeCustomersCHD(values) {
    var CustomersCHD = document.getElementById("CustomersCHD").childNodes;
    if (CustomersCHD.length > values) {
        for (i = CustomersCHD.length; i > values; i--) {
            document.getElementById("CustomersCHD").removeChild(CustomersCHD[i - 1]);
        }
    }
    else if (CustomersCHD.length < values) {
        for (i = CustomersCHD.length; i < values; i++) {
            AddCustomerCHD();
        }
    }

    ResetTravelNum();
}

function AddCustomerAdult() {
    var childCustomer = document.createElement("div");

    var sContent = "<table width='645' border='0' align='center' cellpadding='0' cellspacing='0'>";
    sContent += "<tr>";
    sContent += "<td colspan='6'>";
    sContent += "<table width='645' border='0' cellspacing='0' cellpadding='0'>";
    sContent += "<tr>";
    sContent += "<td width='21'><img src='10_images/icon/travel_bk_m1.gif' width='21' height='21' /></td>";
    sContent += "<td width='71' class='font_gb3'>第<strong class='font_orange' id='TravelCustomersNum' name='TravelCustomersNum'>1</strong>位旅客</td>";
    sContent += "<td width='528' class='font_gray'>成人</td>";
    sContent += "<td width='25' align='right' class='font_gray'><img src='10_images/icon/travel_bk_cl.gif' alt='删除' width='14' height='13' border='0' onclick='DelCustomerAdult(this);' style='cursor:hand'/></td>";
    sContent += "</tr>";
    sContent += "</table>";
    sContent += "</td>";
    sContent += "</tr>";
    sContent += "<tr><td height='1' colspan='6' background='10_images/line_01.gif'></td></tr>";
    sContent += "<tr>";
    sContent += "<td width='71' height='30' class='bk_tdF1'>旅客姓名：</td>";
    sContent += "<td width='127' height='23'><input name='CustName' type='text' class='text_box01' id='CustName' value='' /><input name='CustType' type='hidden' id='CustType' value='成人' /></td>";
    sContent += "<td width='72' height='23' class='bk_tdF1'>证件类型：</td>";
    sContent += "<td width='109' height='23'>";
    sContent += "<select name='CardType' class='text_box02' id='CardType' style='WIDTH: 100px;'>";
    sContent += "<option value='身份证'>身份证</option>";
    sContent += "<option value='护照'>护照</option>";
    sContent += "<option value='其它'>其它</option>";
    sContent += "</select>";
    sContent += "</td>";
    sContent += "<td width='72' height='23' class='bk_tdF1'>证件号码：</td>";
    sContent += "<td width='194' height='23'><input name='CardNo' type='text' class='text_box01' id='CardNo'  style='width: 190px;' value=''/></td>";
    sContent += "</tr>";
    sContent += "<tr><td height='8' colspan='6'></td></tr>";
    sContent += "</table>";

    childCustomer.innerHTML = sContent;
    document.getElementById("CustomersAdult").appendChild(childCustomer);
}

function AddCustomerCHD() {
    var childCustomer = document.createElement("div");

    var sContent = "<table width='645' border='0' align='center' cellpadding='0' cellspacing='0'>";
    sContent += "<tr>";
    sContent += "<td colspan='6'>";
    sContent += "<table width='645' border='0' cellspacing='0' cellpadding='0'>";
    sContent += "<tr>";
    sContent += "<td width='21'><img src='10_images/icon/travel_bk_m1.gif' width='21' height='21' /></td>";
    sContent += "<td width='71' class='font_gb3'>第<strong class='font_orange' id='TravelCustomersNum' name='TravelCustomersNum'>1</strong>位旅客</td>";
    sContent += "<td width='528' class='font_gray'>儿童</td>";
    sContent += "<td width='25' align='right' class='font_gray'><img src='10_images/icon/travel_bk_cl.gif' alt='删除' width='14' height='13' border='0' onclick='DelCustomerCHD(this);' style='cursor:hand'/></td>";
    sContent += "</tr>";
    sContent += "</table>";
    sContent += "</td>";
    sContent += "</tr>";
    sContent += "<tr><td height='1' colspan='6' background='images/travel/T_line2.gif'></td></tr>";
    sContent += "<tr>";
    sContent += "<td width='71' height='30' class='bk_tdF1'>旅客姓名：</td>";
    sContent += "<td width='127' height='23'><input name='CustName' type='text' class='text_box01' id='CustName' value='' /><input name='CustType' type='hidden' id='CustType' value='儿童' /></td>";
    sContent += "<td width='72' height='23' class='bk_tdF1'>证件类型：</td>";
    sContent += "<td width='109' height='23'>";
    sContent += "<select name='CardType' class='text_box02' id='CardType' style='WIDTH: 100px;'>";
    sContent += "<option value='身份证'>身份证</option>";
    sContent += "<option value='护照'>护照</option>";
    sContent += "<option value='其它'>其它</option>";
    sContent += "</select>";
    sContent += "</td>";
    sContent += "<td width='72' height='23' class='bk_tdF1'>证件号码：</td>";
    sContent += "<td width='194' height='23'><input name='CardNo' type='text' class='text_box01' id='CardNo'  style='width: 190px;' value=''/></td>";
    sContent += "</tr>";
    sContent += "<tr><td height='8' colspan='6'></td></tr>";
    sContent += "</table>";

    childCustomer.innerHTML = sContent;
    document.getElementById("CustomersCHD").appendChild(childCustomer);
}

function DelCustomerAdult(sContrl) {
    var Customers = document.getElementById("CustomersAdult").childNodes;
    var tmpContrl = sContrl.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;

    if (Customers.length > 1) {
        document.getElementById("CustomersAdult").removeChild(tmpContrl);
        document.getElementById("CustAdultNums").value = Customers.length;
    }

    ResetTravelNum();
}

function DelCustomerCHD(sContrl) {
    var Customers = document.getElementById("CustomersCHD").childNodes;
    var tmpContrl = sContrl.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;

    if (Customers.length > 0) {
        document.getElementById("CustomersCHD").removeChild(tmpContrl);
        document.getElementById("CustCHDNums").value = Customers.length;
    }

    ResetTravelNum();
}

function ResetTravelNum() {
    var TravelCustomersNums = document.getElementsByName("TravelCustomersNum");
    for (i = 0; i < TravelCustomersNums.length; i++) {
        TravelCustomersNums[i].innerText = i + 1;
    }
    var CustPrice = document.getElementById("CustPrice").innerText;
    var CustCHDPrice = document.getElementById("CustCHDPrice").innerText;
    var CustAdultNums = document.getElementById("CustAdultNums").options[document.getElementById("CustAdultNums").selectedIndex].value;
    var CustCHDNums = document.getElementById("CustCHDNums").options[document.getElementById("CustCHDNums").selectedIndex].value;
    document.getElementById("TotalTravel").innerHTML = parseInt(CustAdultNums) + parseInt(CustCHDNums);
    document.getElementById("TotalTravelPrice").innerHTML = parseInt(CustPrice) * parseInt(CustAdultNums) + parseInt(CustCHDPrice) * parseInt(CustCHDNums);
}

function SubmitTravelOrder() {
    var sFlag = true;
    var CustAdultNums = document.getElementById("CustAdultNums").options[document.getElementById("CustAdultNums").selectedIndex].value;
    var CustCHDNums = document.getElementById("CustCHDNums").options[document.getElementById("CustCHDNums").selectedIndex].value;
    var CustPrice = document.getElementById("CustPrice").innerText;
    var CustCHDPrice = document.getElementById("CustCHDPrice").innerText;
    var TotalTravel = document.getElementById("TotalTravel").innerText;
    var TotalTravelPrice = document.getElementById("TotalTravelPrice").innerText;

    var CustName = document.getElementsByName("CustName");
    var CustType = document.getElementsByName("CustType");
    var CardType = document.getElementsByName("CardType");
    var CardNo = document.getElementsByName("CardNo");

    var txtCustName = "";
    var txtCustType = "";
    var txtCardType = "";
    var txtCardNo = "";

    var ContactMan = document.getElementById("ContactMan").value;
    var Mobile = document.getElementById("Mobile").value;
    var Tel = document.getElementById("Tel").value;
    var ContactEmail = document.getElementById("ContactEmail").value;

    var Content = document.getElementById("Content").value;
    var UserID = document.getElementById("UserID").value;
    var TravelGroupsID = document.getElementById("TravelGroupsID").value;

    if (TotalTravel != CustName.length) {
        CreateModalPopup("所选旅客人数与实际填写的旅客人数不符！");
    }
    else {
        for (i = 0; i < CustName.length; i++) {
            txtCustName += "," + CustName[i].value;
            if (CustName[i].value.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sFlag = false;
            };
        }
        for (i = 0; i < CustType.length; i++) {
            txtCustType += "," + CustType[i].value;
            if (CustType[i].value.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sFlag = false;
            };
        }
        for (i = 0; i < CardNo.length; i++) {
            txtCardNo += "," + CardNo[i].value;
            if (CardNo[i].value.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sFlag = false;
            };
        }
        for (i = 0; i < CardType.length; i++) {
            txtCardType += "," + CardType[i].options[CardType[i].selectedIndex].value;
        }

        if (!sFlag) {
            CreateModalPopup("请填写旅客资料！");
        }
        else {
            var sErr = "";
            if (ContactMan.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sErr += "<b>请填写联系人姓名！</b><br>";
            }
            if ((Mobile.replace(/(^\s*)|(\s*$)/g, "").length == 0) && (Tel.replace(/(^\s*)|(\s*$)/g, "").length == 0)) {
                sErr += "<b>请填写联系人手机或电话！</b><br>";
            }
            if (ContactEmail.replace(/(^\s*)|(\s*$)/g, "").length == 0) {
                sErr += "<b>请填写电子邮箱！</b><br>";
            }
            else {
                if (!IsEmail(ContactEmail)) {
                    sErr += "<b>电子邮箱格式错误！</b><br>";
                }
            }

            if (sErr.length > 0) {
                CreateModalPopup(sErr);
            }
            else {
                txtCustName = txtCustName.substring(1);
                txtCustType = txtCustType.substring(1);
                txtCardType = txtCardType.substring(1);
                txtCardNo = txtCardNo.substring(1);

                CreateWaitPopup("正在提交定单，请稍等...");

                if (UserID == 0) {
                    CallServer("TravelOrderRegister$" + CustAdultNums + "|" + CustCHDNums + "|" + CustPrice + "|" + CustCHDPrice + "|" + txtCustName + "|" + txtCustType + "|" + txtCardType + "|" + txtCardNo + "|" + ContactEmail + "|" + ContactMan + "|" + Mobile + "|" + Tel + "|" + Content + "|" + TravelGroupsID, "");
                }
                else {
                    CallServer("TravelOrderSubmit$" + CustAdultNums + "|" + CustCHDNums + "|" + CustPrice + "|" + CustCHDPrice + "|" + txtCustName + "|" + txtCustType + "|" + txtCardType + "|" + txtCardNo + "|" + ContactEmail + "|" + ContactMan + "|" + Mobile + "|" + Tel + "|" + Content + "|" + TravelGroupsID, "");
                }
            }
        }
    }
}

function TravelOrderList() {
    CreateWaitPopup("正在提交定单，请稍等...");

    var Payment = document.getElementsByName("Payment");
    var txtPayment = "";
    for (i = 0; i < Payment.length; i++) {
        if (Payment[i].checked) {
            txtPayment = Payment[i].value;
        }
    }

    CallServer("TravelOrderList$" + txtPayment);
}

function TravelOrderSearch() {
    var OrderID = document.getElementById("OrderID").value;
    var Org = document.getElementById("Org").value;
    var StartDate = document.getElementById("StartDate").value;
    var OrderStatus = document.getElementById("OrderStatus").options[document.getElementById("OrderStatus").selectedIndex].value;
    var PayStatus = document.getElementById("PayStatus").options[document.getElementById("PayStatus").selectedIndex].value;
    var EndDate = document.getElementById("EndDate").value;
    window.location = "MyTravelOrder.aspx?OrderID=" + OrderID + "&Org=" + Org + "&StartDate=" + StartDate + "&OrderStatus=" + OrderStatus + "&PayStatus=" + PayStatus + "&EndDate=" + EndDate;
}

function ShowMore(value) {
    var Org = document.getElementById("HiddenOrg").value;
    var HiddenTravelLine = 0;
    var ctlHiddenTravelLine = theForm.HiddenTravelLine;
    for (i = 0; i < ctlHiddenTravelLine.length; i++) {
        if (ctlHiddenTravelLine[i].checked)
            HiddenTravelLine = ctlHiddenTravelLine[i].value;
    }
    window.location = "TravelSearch.aspx?TravelLine=" + HiddenTravelLine + "&Org=" + Org + "&UserTravelLine=" + value;
}

function ReceiveServerData(returnValue) {
    var cmd = returnValue.substring(0, returnValue.indexOf(','));
    returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

    if (cmd == "Login") {
        if (returnValue == "OK") {
            window.location.reload();
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "Register") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "AirOrderConfirm.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "UserRegister") {
        if (returnValue == "OK") {
            window.location.reload();
        }
        else {
            CloseWaitPopup();
            alert(returnValue);
        }
    }
    else if (cmd == "UserForget") {
        if (returnValue == "OK") {
            alert("找回密码成功！\n请查收邮件并根据提示修改密码。");
            window.location.reload();
        }
        else {
            CloseWaitPopup();
            alert(returnValue);
        }
    }
    else if (cmd == "ResetPass") {
        CreateModalPopup(returnValue);
    }
    else if (cmd == "AgioAir") {
        var scontrl = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        var CurrentDiv = document.getElementById("AgioAir_" + scontrl);
        CurrentDiv.innerHTML = returnValue;
    }
    else if (cmd == "AirLocalSearch") {
        //CreateModalPopup(returnValue);
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "Failure") {
            CreateModalPopup(returnValue);
        }
        else {
            if (cmdResult != "") {
                CloseAllAir();
                //alert(cmdResult);
                //alert(cmdResult.substring(1));

                document.getElementById("ListAllAirCode_" + cmdResult.substring(0, 1)).innerHTML = cmdResult.substring(1);
                document.getElementById("ListAllAir_" + cmdResult.substring(0, 1)).innerHTML = returnValue;
                document.getElementById("ListAllAirCode_" + cmdResult.substring(0, 1)).style.display = "";
                document.getElementById("ListAllAir_" + cmdResult.substring(0, 1)).style.display = "";
            }
            else {
                CreateModalPopup(returnValue);
            }
        }
    }
    else if (cmd == "ListAllStore") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        document.getElementById(cmdResult).innerHTML = returnValue;
    }
    else if (cmd == "ShowProvision") {
        var Contrl = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        var sContrl = document.getElementById(Contrl);
        if (sContrl != null) {
            sContrl.innerHTML = returnValue;
            sContrl.style.display = 'block';

            setTimeout("CloseProvision(" + Contrl + ")", 10000);
        }
    }
    else if (cmd == "AirOrder") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            var ctlFlyType = theForm.FlyType;
            for (i = 0; i < ctlFlyType.length; i++) {
                if (ctlFlyType[i].checked)
                    var txtFlyType = ctlFlyType[i].value;
            }

            if (txtFlyType == "oneway") {
                window.location = "AirOrderList.aspx";
            }
            else {
                var txtOrg = document.getElementById("Org").options[document.getElementById("Org").selectedIndex].value;
                var txtDst = document.getElementById("Dst").options[document.getElementById("Dst").selectedIndex].value;
                var txtFltd = document.getElementById("Fltd").value;

                var txtOrg_Return = document.getElementById("Org_Return").options[document.getElementById("Org_Return").selectedIndex].value;
                var txtFltd_Return = document.getElementById("Fltd_Return").value;
                var txtDst_Return = document.getElementById("Dst_Return").options[document.getElementById("Dst_Return").selectedIndex].value;

                var txtCustType = document.getElementById("CustType").options[document.getElementById("CustType").selectedIndex].value;
                var txtCustNum = document.getElementById("CustNum").options[document.getElementById("CustNum").selectedIndex].value;
                var txtAirCode = document.getElementById("AirCode").options[document.getElementById("AirCode").selectedIndex].value;
                window.location = "AirReturnList.aspx?FlyType=" + txtFlyType + "&Org=" + txtOrg + "&Fltd=" + txtFltd + "&Dst=" + txtDst + "&Org_Return=" + txtOrg_Return + "&Fltd_Return=" + txtFltd_Return + "&Dst_Return=" + txtDst_Return + "&CustType=" + txtCustType + "&CustNum=" + txtCustNum + "&AirCode=" + txtAirCode;
            }
        }
        else {
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "AirReturnOrder") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "AirOrderList.aspx";
        }
        else {
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "AirOrderList") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "AirOrderConfirm.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "AirOrderSubmit") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "AirOrder.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "UpdateOrderStatus") {
        if (returnValue == "OK") {
            window.location.reload();
        }
        else {
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "HelpList") {
        var HelpListDiv = document.getElementById("HelpListDiv");
        HelpListDiv.innerHTML = returnValue;
    }
    else if (cmd == "ShowCustomerService") {
        var KFPopup = document.getElementById("KFPopup");
        KFPopup.innerHTML = returnValue;
        KFPopup.style.display = "block";
    }
    else if (cmd == "ShowLogin") {
        var UserPopup = document.getElementById("UserPopup");
        UserPopup.innerHTML = returnValue;
        UserPopup.style.display = "block";
    }
    else if (cmd == "ShowRegister") {
        var UserPopup = document.getElementById("UserPopup");
        UserPopup.innerHTML = returnValue;
        UserPopup.style.display = "block";
    }
    else if (cmd == "ShowForgetPass") {
        var UserPopup = document.getElementById("UserPopup");
        UserPopup.innerHTML = returnValue;
        UserPopup.style.display = "block";
    }
    else if (cmd == "ListHotelByCodes") {
        var HotelListDiv = document.getElementById("HotelList");
        HotelListDiv.innerHTML = returnValue;
    }
    else if (cmd == "ListPorName") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        var PorName = document.getElementById("PorName");
        for (i = 0; i < PorName.options.length; i++) {
            PorName.options[i] = null;
            i = i - 1;
        }

        returnValue = returnValue.substring(returnValue.indexOf('$') + 1);
        do {
            PorName.options[PorName.options.length] = new Option(returnValue.substring(0, returnValue.indexOf('$')), returnValue.substring(0, returnValue.indexOf('$')));
            returnValue = returnValue.substring(returnValue.indexOf('$') + 1);
        }
        while (returnValue.length > 0)
    }
    else if (cmd == "HotelSearchPage") {
        var HotelResultDiv = document.getElementById("HotelResult");
        HotelResultDiv.innerHTML = returnValue;
    }
    else if (cmd == "HotelRegister") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "HotelsOrderConfirm.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "HotelOrder") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "HotelsOrderConfirm.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "HotelOrderList") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "HotelsOrderList.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "SubmitRecommended") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location.reload();
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "ListTravel10") {
        var TravelListDiv = document.getElementById("TravelList");
        TravelListDiv.innerHTML = returnValue;
    }
    else if (cmd == "TravelList10") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);
        var Org = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);
        var TravelLine = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);
        var Pages = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        var TravelResultDiv = document.getElementById("TravelList_" + Org + "_" + TravelLine + "_" + Pages);
        if (cmdResult == "OK") {
            TravelResultDiv.enable = 1;
            TravelResultDiv.innerHTML = returnValue;
        }
        else {
            TravelResultDiv.innerHTML = "<table width='665' border='0' cellspacing='0' cellpadding='0'><tr><td width='7'></td><td width='284' class='td_font'>暂无旅游</td></tr></table>";
        }
    }
    else if (cmd == "TravelSearch10") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            var TravelSearchList = document.getElementById("TravelSearchList");
            TravelSearchList.innerHTML = returnValue;
        }
    }
    else if (cmd == "TravelOrderRegister") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "TravelOrderConfirm.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "TravelOrderSubmit") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "TravelOrderConfirm.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "TravelOrderList") {
        var cmdResult = returnValue.substring(0, returnValue.indexOf(','));
        returnValue = returnValue.substring(returnValue.indexOf(',') + 1);

        if (cmdResult == "OK") {
            window.location = "TravelOrderList.aspx";
        }
        else {
            CloseWaitPopup();
            CreateModalPopup(returnValue);
        }
    }
    else if (cmd == "TrainFullSearch") {
        CloseWaitPopup();
        var TrainFullSearchDiv = document.getElementById("TrainFullSearchDiv");
        TrainFullSearchDiv.innerHTML = returnValue;
    }
    else if (cmd == "TrainInfo") {
        CloseWaitPopup();
        var TrainFullSearchDiv = document.getElementById("TrainFullSearchDiv");
        TrainFullSearchDiv.innerHTML = returnValue;
    }
    else if (cmd == "TrainSearchDetail") {
        CloseWaitPopup();
        var Detaildiv = returnValue.substring(0,returnValue.indexOf(','));
        var TrainSearchDetailDiv = document.getElementById(Detaildiv);
        TrainSearchDetailDiv.innerHTML = returnValue.substring(returnValue.indexOf(',')+1);
    }
    else {
        CreateModalPopup(returnValue);
    }
}

function selectTrainType(Id)
{

    if(Id=="tCZ")
    {
        document.getElementById("tCZ").style.display="block";
        document.getElementById("tCZ").style.visiable=true;
        document.getElementById("tCC").style.display="none";
        document.getElementById("tCC").style.visiable=false;
    }
    else
    {
        document.getElementById("tCZ").style.display="none";
        document.getElementById("tCZ").style.visiable=false;
        document.getElementById("tCC").style.display="block";
        document.getElementById("tCC").style.visiable=true;
    }
   
    
}

function TrainFullSearch()
{
    CreateWaitPopup("正在为您查询，请稍等...");
    
    var StartCity = document.getElementById("StartCity").value;
    var EndCity = document.getElementById("EndCity").value;
    var StartDate = document.getElementById("StartDate").value;
    document.getElementById("divSearchBox").style.display="none";
    CallServer("TrainFullSearch$" + StartCity + "|" + EndCity + "|" + StartDate);
}
function CallTrainFullSearch(StartCity,EndCity)
{
    CreateWaitPopup("正在为您查询，请稍等...");
    
    var now= new Date();
    var year=now.getFullYear();
    var month=now.getMonth();
    var day=now.getDay();
    var StartDate =  year+"-"+month+"-"+day ;
    document.getElementById("divSearchBox").style.display="none";
    CallServer("TrainFullSearch$" + StartCity + "|" + EndCity + "|" + StartDate);
}
function TrainInfo()
{
    CreateWaitPopup("正在为您查询，请稍等...");
    
    var TrainCode = document.getElementById("TrainCode").value;
    var StartDate = document.getElementById("StartDate").value;
    document.getElementById("divSearchBox").style.display="none";
    CallServer("TrainInfo$" + TrainCode + "|"  + StartDate);
}
function CallTrainInfo(TrainCode)
{
    CreateWaitPopup("正在为您查询，请稍等...");
    var now= new Date();
    var year=now.getFullYear();
    var month=now.getMonth();
    var day=now.getDay();
    var StartDate =  year+"-"+month+"-"+day ;
    document.getElementById("divSearchBox").style.display="none";
    CallServer("TrainInfo$" + TrainCode + "|"  + StartDate);
}
function TrainSearchDetail(img, TrainCode, StartDate, Detaildiv) {
    //CreateWaitPopup("正在为您查询，请稍等...");

    if (document.getElementById(Detaildiv).style.display != "none") {
        img.src = "images/Train/but_de_down.gif";
        document.getElementById(Detaildiv).style.display = "none";
        return;
    }
    if (img.src = "images/Train/but_de_down.gif") {
        img.src = "images/Train/but_de_up.gif";
        document.getElementById(Detaildiv).style.display = "block";
        document.getElementById(Detaildiv).innerHTML = "正在为您查询，请稍等...";
        CallServer("TrainSearchDetail$" + TrainCode + "|" + StartDate + "|" + Detaildiv);
    }
}
