﻿function menu_over(obj) {
    obj.style.backgroundColor = '#e6e6e6';
    obj.style.color = '';
    obj.style.cursor = '';
}
function menu_out(obj) {
    obj.style.backgroundColor = '#ffffff';
    obj.style.color = '';
    obj.style.cursor = '';
}
function document.onclick() {
    if (WebCalendar.eventSrc != window.event.srcElement)
        hiddenCalendar();
    var e = window.event.srcElement
    try {
        if (e.id == "gn_spanIdA" || e.parentElement.id == "gn_spanIdA" || e.parentElement.parentElement.id == "gn_spanIdA" || e.id == "gj_spanIdA" || e.parentElement.id == "gj_spanIdA" || e.parentElement.parentElement.id == "gj_spanIdA") {
            gnTable.style.display = "block";
            gjTable.style.display = "none";
        } else if (e.id == "gn_spanIdB" || e.parentElement.id == "gn_spanIdB" || e.parentElement.parentElement.id == "gn_spanIdB" || e.id == "gj_spanIdB" || e.parentElement.id == "gj_spanIdB" || e.parentElement.parentElement.id == "gj_spanIdB") {
            gnTable.style.display = "none";
            gjTable.style.display = "block";

        }
        else {
            return;
        }
    } catch (e) { }
}
function showfancheng() {
    document.getElementById("fcrq").style.display = "none";
    document.getElementById("gnlm_2").style.display = "none";
    document.dcform.radio.value = "1";
}
function showvfancheng() {
    document.getElementById("fcrq").style.display = "";
    document.getElementById("gnlm_2").style.display = "none";
    document.dcform.radio.value = "2";

}
function showliancheng() {
    document.getElementById("fcrq").style.display = "";
    document.getElementById("gnlm_2").style.display = "block";
    document.dcform.radio.value = "3";
}
function gjdancheng() {
    document.getElementById("gjfcrq").style.display = "none"
    document.gjform.radio.value = "1";
}
function gjwangfan() {
    document.getElementById("gjfcrq").style.display = "block"
    document.gjform.radio.value = "2";
}
function document.onclick() {
    if (WebCalendar.eventSrc != window.event.srcElement)
        hiddenCalendar();
    var e = window.event.srcElement
    try {
        if (e.id == "gn_spanIdA" || e.parentElement.id == "gn_spanIdA" || e.parentElement.parentElement.id == "gn_spanIdA" || e.id == "gj_spanIdA" || e.parentElement.id == "gj_spanIdA" || e.parentElement.parentElement.id == "gj_spanIdA") {
            gnTable.style.display = "block";
            gjTable.style.display = "none";
        } else if (e.id == "gn_spanIdB" || e.parentElement.id == "gn_spanIdB" || e.parentElement.parentElement.id == "gn_spanIdB" || e.id == "gj_spanIdB" || e.parentElement.id == "gj_spanIdB" || e.parentElement.parentElement.id == "gj_spanIdB") {
            gnTable.style.display = "none";
            gjTable.style.display = "block";

        }
        else {
            return;
        }
    } catch (e) { }
}


function gjdancheng() {
    document.getElementById("gjfcrq").style.display = "none"
    document.gjform.radio.value = "1";
}
function gjwangfan() {
    document.getElementById("gjfcrq").style.display = "block"
    document.gjform.radio.value = "2";
}

function CheckPara() {
with (document.dcform) {
    if (EndCity01.value == StartCity01.value) {
        alert("出发城市和到达城市不能相同,请更正!");
        EndCity01.focus();
        return false;
    }
    if (!isDateString(StrDate01.value)) {
        alert("出发日期不是一个合法的日期，请更正，正确时间格式：YYYY-MM-DD");
        dcstartdate.focus();
        return false;
    }
    if (stringToDate(StrDate01.value) < stringToDate(today.value)) {
        alert("出发日期不能小于现在日期,请检查重输!");
        StrDate01.focus();
        return false;
    }
    //对往返程进行验证
   /* if (radio[0].checked) {
        if (StrDate03.value == "") {
            alert("您还没有输入返程日期,请输入（日期格式：YYYY-MM-DD）!");
            StrDate03.focus();
            return false;
        }
        if (!isDateString(StrDate03.value)) {
            alert("返程日期不是一个合法的日期，请更正，正确时间格式：YYYY-MM-DD");
            StrDate03.focus();
            return false;
        }
        if (stringToDate(StrDate03.value) < stringToDate(today.value)) {
            alert("返程日期不能小于现在日期,请检查重输!");
            StrDate03.focus();
            return false;
        }
        if (stringToDate(StrDate03.value) < stringToDate(StrDate01.value)) {
            alert("返程日期不能小于出发日期,请检查重输!");
            StrDate03.focus();
            return false;
        }
    }*/
    }
    document.dcform.searchbtn.value="机票查询中……";
	document.dcform.searchbtn.disabled="disabled";
	document.dcform.submit();
}


function nTabs(thisObj, Num) {
    if (thisObj.className == "active") return;
    var tabObj = thisObj.parentNode.id;
    var tabList = document.getElementById(tabObj).getElementsByTagName("li");

    for (i = 0; i < tabList.length; i++) {
        if (i == Num) {
            thisObj.className = "active";
            document.getElementById(tabObj + "_Content" + i).style.display = "block";
        } else {
            tabList[i].className = "normal";
            document.getElementById(tabObj + "_Content" + i).style.display = "none";
        }
    }
}