﻿// JScript 文件
function setCheckInDate(d)
    {
	    document.getElementById("StartDate").value=d;
	    var cf=document.getElementById("CalFrame");
	    document.getElementById("EndDate").value=d;
	    showCalendar("EndDate",false,"EndDate","","");
	    document.getElementById("EndDate").value="";	
    }
	function setCheckInDate1(d)
    {
	    document.getElementById("txtStartDate").value=d;
	    var cf=document.getElementById("CalFrame");
	    document.getElementById("txtEndDate").value=d;
	    showCalendar("txtEndDate",false,"txtEndDate","","");
	    document.getElementById("txtEndDate").value="";	
    }
    function  DateAdd(interval,number,date)
    {
        switch(interval.toLowerCase()){
        case "y": return new Date(date.setFullYear(date.getFullYear()+number));
        case "m": return new Date(date.setMonth(date.getMonth()+number));
        case "d": return new Date(date.setDate(date.getDate()+number));
        case "w": return new Date(date.setDate(date.getDate()+7*number));
        case "h": return new Date(date.setHours(date.getHours()+number));
        case "n": return new Date(date.setMinutes(date.getMinutes()+number));
        case "s": return new Date(date.setSeconds(date.getSeconds()+number));
        case "l": return new Date(date.setMilliseconds(date.getMilliseconds()+number));
    } 
}

    mainLoop = function()
		{
			val = escape(queryField.value);				
			if (lastVal != val)
			{				
				var response = Index.GetSearchItems(val);
				showQueryDiv(response.value);
				lastVal = val;
			}				
			setTimeout('mainLoop()', 10);
			return true;
		}
 function SearchBackground(strType)
	    {
	        if(strType == "1")
	        {
		        document.getElementById("d011").style.backgroundImage = "url(/images/index1.gif)";
		        document.getElementById("d012").innerHTML = unescape(Index.GetRoomDatePrice('1','<%=ViewState["CyId"].ToString()%>').value);
		    }
		    if(strType == "2")
	        {
		        document.getElementById("d011").style.backgroundImage = "url(/images/index2.gif)";
		        document.getElementById("d012").innerHTML = unescape(Index.GetRoomDatePrice('2','<%=ViewState["CyId"].ToString()%>').value);
		    }
		    if(strType == "3")
	        {
		       document.getElementById("d011").style.backgroundImage = "url(/images/index3.gif)";
		        document.getElementById("d012").innerHTML = unescape(Index.GetRoomDatePrice('3','<%=ViewState["CyId"].ToString()%>').value);
		    }
		    if(strType == "4")
	        {
		        document.getElementById("d011").style.backgroundImage = "url(/images/index4.gif)";
		        document.getElementById("d012").innerHTML = unescape(Index.GetRoomDatePrice('4','<%=ViewState["CyId"].ToString()%>').value);
		    }
		}
		function SearchSubmitHotel()
		{
		    strHCNName = document.getElementById("HCNName").value;
		    strStar = document.getElementById("star").value;
		    strPrice = document.getElementById("Price").value;
		    strHKysj = document.getElementById("HKysj").value;
		    strPdId = document.getElementById("PdId").value;
		    strHAId = document.getElementById("HAId").value;
		    strStartDate = document.getElementById("StartDate").value;
		    if(strStartDate == "")
		    {
		        alert("请选择入住日期");
		        document.getElementById("StartDate").focus();
		        return false;
		    }
		    strEndDate = document.getElementById("EndDate").value;
		    if(strEndDate == "")
		    {
		        alert("请选择离店日期");
		        document.getElementById("EndDate").focus();
		        return false;
		    }

		    location.href="/hotel/hotelsearchlist200811.aspx?HCNName=" + strHCNName + "&Star=" + strStar + "&Price=" + strPrice + "&PdId=" + strPdId + "&HAId=" + strHAId + "&StartDate=" + strStartDate + "&EndDate=" + strEndDate + "&HKysj=" + strHKysj;
		    
		}
		function SearchSubmitHomeHotel()
		{
		    strHiName = document.getElementById("HiName").value;
		    strPrice = document.getElementById("Price").value;
		    strPdId = document.getElementById("PdId").value;
		    strHAId = document.getElementById("HAId").value;
		    location.href="/homehotel/?HiName=" + strHiName + "&Price=" + strPrice + "&PdId=" + strPdId + "&HAId=" + strHAId;
		}
		function SearchSubmitTripLine()
		{
		    strCyId = document.form1.CyId.value;
		    strEndCyId = document.form1.EndCyId.value;
		    strKeyWord = document.form1.KeyWord.value;
		    location.href="/TripLine/?CyId=" + strCyId + "&EndCyId=" + strEndCyId + "&KeyWord=" + strKeyWord;
		}
		function SearchSubmitSight()
		{
		    strCyId = document.form1.SCyId.value;
		    strKeyWord = document.form1.SName.value;
		    location.href="/Sight/?CyId=" + strCyId + "&SName=" + strKeyWord;
		}
		function Sfonchange(strPId,objCy)
		{
		    strResult = unescape(Index.GetCity(strPId).value);
		    aryResult = strResult.split(",");
		    objCy.length = aryResult.length - 1;
		    for(var i=0;i<aryResult.length;i++)
		    {
		        if(aryResult[i] != null && aryResult[i] != "")
		        {
		            aryOpt = aryResult[i].split("|");
		            objCy.options[i].value = aryOpt[0];
					objCy.options[i].text = aryOpt[1];
		        }
		    }
		}
            function owVirtual(URL) {
width=776;height=450;
                var left = ( screen.width - width ) / 2;
                var top = ( screen.height - height ) / 5;
                window.open(URL,'','width=776,height=450,top='+top+',left='+left+',resizable=0');
                return false;
            }
function HotelHelp()
		{
		    var sHelp = "<table width=\"183\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"7\" colspan=\"3\"></td>";
		    sHelp += "</tr><tr><tr><td height=\"27\" colspan=\"3\" background=\"/images/hsh6.gif\" class=\"hsh6\" align=\"left\">酒店预订帮助</td></tr>";
            sHelp += "<tr><td width=\"1\" bgcolor=\"#7bbdff\"></td><td width=\"181\" bgcolor=\"#ffffff\" align=\"left\" class=\"hsh13\"><ul>";
            sHelp += "<li>我们提供的是免费预订服务，所有费用需要您在酒店前台支付。</li>";
            sHelp += "<li>网络预订价为净价，已经包含服务费。</li>";
            sHelp += "<li>双早：网络预订价中已经包含两份早餐。</li>";
            sHelp += "<li>单早：网络预订价中只包含一份早餐。</li>";
	    sHelp += "<li>无早：网络预订价中不含早餐，如需早餐可以在入住当天在酒店前台付费购买。</li>";
            sHelp += "<li>如需另外增加早餐，只需入住当天在酒店前台付费购买早餐券即可。</li>";
            sHelp += "<li>双床：房间内配备两张床。</li>";
            sHelp += "<li>大床：房间内配备一张双人大床。</li>";
		    sHelp += "</ul></td><td width=\"1\" bgcolor=\"#7bbdff\"></td></tr><tr><td colspan=\"3\" height=\"4\"><img src=\"/images/hsh7.gif\"/></td></tr></table>";
		    document.write(sHelp);
		        
		}
            function RoomCuXiao(RId,Sd,Ed) {
		width=550;height=350;
                var left = ( screen.width - width ) / 2;
                var top = ( screen.height - height ) / 5;
                window.open('/hotel/HotelCuXiao.aspx?RId=' + RId + '&StartDate=' + Sd + '&EndDate=' + Ed,'','width=550,height=350,top='+top+',left='+left+',resizable=1');
                return false;
            }
function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

