﻿// 显示时间选择框
function TimeSelectShow(Self, Which,TheShow)
{
    var HidWhich = document.getElementById(Which);
    HidWhich.value = Self.id;
    var DivShow = document.getElementById(TheShow);
    DivShow.style.display = "block";
    DivShow.style.top = Self.offsetTop + Self.offsetHeight;
    DivShow.style.left = Self.offsetLeft;
}
function TimeSelectShow1(Self, Which,TheShow)
{
    var HidWhich = document.getElementById(Which);
    HidWhich.value = Self.id;
    var DivShow = document.getElementById(TheShow);
    DivShow.style.display = "block";
    DivShow.style.marginTop = -83;
    DivShow.style.marginLeft = -3;
}
function TimeSelectShow2(Self, Which,TheShow)
{
    var HidWhich = document.getElementById(Which);
    HidWhich.value = Self.id;
    var DivShow = document.getElementById(TheShow);
    DivShow.style.display = "block";
    DivShow.style.marginTop = Self.offsetHeight + 2;
    DivShow.style.marginLeft = 60;
    
    if ($("DivOtherCondition"))
    {
        if ($("DivOtherCondition").style.display == "block")
        {
            $("BtnOtherCondition").value = "更多条件";
            $("DivOtherCondition").style.display = "none";
            $("HidIsShowOtherCondition").value = "false";
        }
    }
}
function TimeSelectShow3(Self, Which,TheShow)
{
    var HidWhich = document.getElementById(Which);
    HidWhich.value = Self.id;
    var DivShow = document.getElementById(TheShow);
    DivShow.style.display = "block";
    DivShow.style.top = Self.offsetTop + Self.offsetHeight;
    DivShow.style.left = Self.offsetLeft + 120;
    
    if (Self.id == "TxtTime1OfCity")
    {
        document.getElementById("DdlEndAirdrome").style.display = "none";
        document.getElementById("TxtEndAirdrome").style.display = "inline-block";
    }
    else
    {
        document.getElementById("DdlEndAirdrome").style.display = "inline-block";
        document.getElementById("TxtEndAirdrome").style.display = "none";
    }
}
function TimeSelectShow4(Self, Which,TheShow)
{
    var HidWhich = document.getElementById(Which);
    HidWhich.value = Self.id;
    var DivShow = document.getElementById(TheShow);
    DivShow.style.display = "block";
    DivShow.style.marginTop = Self.offsetHeight + 2;
    DivShow.style.marginLeft = 60;
}
// 隐藏时间选择框
function TimeSelectHidden(TheShow)
{
    var DivShow = document.getElementById(TheShow);
    DivShow.style.display = "none";
}

//选择时间并隐藏时间选择框
function TimeSelectBack(TheTime, TheShow, TheTime1, StartHour1, StartMinute1, EndHour1, EndMinute1,
                                   TheTime2, EndHour2, EndMinute2, TheTime3, StartHour2, StartMinute2)
{
    var TxtTime = document.getElementById(TheTime);
    var DivShow = document.getElementById(TheShow);
    var RdbTime1 = document.getElementById(TheTime1);
    var DdlStartHour1 = document.getElementById(StartHour1);
    var DdlStartMinute1 = document.getElementById(StartMinute1);
    var DdlEndHour1 = document.getElementById(EndHour1);
    var DdlEndMinute1 = document.getElementById(EndMinute1);
    var RdbTime2 = document.getElementById(TheTime2);
    var DdlEndHour2 = document.getElementById(EndHour2);
    var DdlEndMinute2 = document.getElementById(EndMinute2);
    var RdbTime3 = document.getElementById(TheTime3);
    var DdlStartHour2 = document.getElementById(StartHour2);
    var DdlStartMinute2 = document.getElementById(StartMinute2);
    
    if (RdbTime1.checked)
    {
        TxtTime.value = DdlStartHour1.value + ":" + DdlStartMinute1.value + " 至 " + DdlEndHour1.value + ":" + DdlEndMinute1.value;
    }
    else if (RdbTime2.checked)
    {
        TxtTime.value = DdlEndHour2.value + ":" + DdlEndMinute2.value + " 之前";
    }
    else if (RdbTime3.checked)
    {
        TxtTime.value = DdlStartHour2.value + ":" + DdlStartMinute2.value + " 之后";
    }
    DivShow.style.display = "none";
}
