﻿// JScript 文件
var objAjaxPage = "Hotel_HotelListHtmlStar1";
function funHotelListSearch()
		    {
		        sSearchStartDate = document.getElementById("txtSearchStartDate").value;
		        sSearchEndDate = document.getElementById("txtSearchEndDate").value;
		        sSearchHotelName = document.getElementById("txtSearchHotelName").value;
		        if(sSearchHotelName == "")
		        {
		            location.href="/hotel/hotelsearchlist200811.aspx?HCNName=" + sSearchHotelName + "&Star=" + sStar + "&Price=&PdId=&HAId=&StartDate=" + sSearchStartDate + "&EndDate=" + sSearchEndDate + "&HKysj=";
		        }
		        else
		        {
		            location.href="/hotel/hotelsearchlist200811.aspx?HCNName=" + sSearchHotelName + "&Star=&Price=&PdId=&HAId=&StartDate=" + sSearchStartDate + "&EndDate=" + sSearchEndDate + "&HKysj=";
		        }
		    }
		    document.write("<div id=\"CustPrice\"><div class=\"CustPrice1\"><input type=\"text\" size=\"5\" id=\"txtPrice1\"></div><div class=\"CustPrice2\">-</div><div class=\"CustPrice1\"><input type=\"text\" size=\"5\" id=\"txtPrice2\"></div><div class=\"CustPrice1\"><input type=\"button\" value=\"提交\" onclick=\"javascript:funCustPriceSubmit()\"></div><div class=\"CustPrice1\"><input type=\"button\" value=\"关闭\" onclick=\"javascript:document.getElementById('CustPrice').style.display = 'none';\"></div></div>");
function funCustPrice(objSpan)
{
    document.getElementById("CustPrice").style.display = "block";
    document.getElementById("CustPrice").style.left = (getX(objSpan) + 37) + "px";
	document.getElementById("CustPrice").style.top = (getY(objSpan) - 4) + "px";
}
function funCustPriceSubmit()
{
    if(document.getElementById("txtPrice1").value == "")
    {
        alert("请输入价格");
        document.getElementById("txtPrice1").focus();
        return false;
    }
    if(document.getElementById("txtPrice2").value == "")
    {
        alert("请输入价格");
        document.getElementById("txtPrice2").focus();
        return false;
    }
    if(isNaN(document.getElementById("txtPrice1").value) || parseInt(document.getElementById("txtPrice1").value) <= 0)
    {
        alert("只能输入大约0的整数");
        document.getElementById("txtPrice1").focus();
        return false;
    }
    if(isNaN(document.getElementById("txtPrice2").value) || parseInt(document.getElementById("txtPrice2").value) <= 0)
    {
        alert("只能输入大约0的整数");
        document.getElementById("txtPrice2").focus();
        return false;
    }
    if(parseInt(document.getElementById("txtPrice1").value) >= parseInt(document.getElementById("txtPrice2").value))
    {
        alert("价格区间输入错误");
        document.getElementById("txtPrice1").focus();
        return false;
    }
    location.href(Hotel_HotelListHtmlStar1.getCustPriceUrl(document.getElementById("txtPrice1").value + "-" + document.getElementById("txtPrice2").value,sStar).value);
}
