function GetObj(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")');}else if(document.layers){return eval("document.layers['"+objName+"']");}else{return eval('document.all.'+objName);}}function objLeft(e){var l=e.offsetLeft;while(e=e.offsetParent){l+=e.offsetLeft;}return l;}function objTop(e){var l=e.offsetTop;while(e=e.offsetParent){l+=e.offsetTop;}return l;}function ViewRoomIntroduction(RoomId){var ff=!(document.all);var NowState=GetObj("Room-Introduction-"+RoomId);if(NowState.className=="Hidden-Room-Introduction"){if(ff){NowState.className="View-Room-Introduction-ff";}else{NowState.className="View-Room-Introduction";}}else{NowState.className="Hidden-Room-Introduction";}}function ListRoomIntroduction(Elong_id,RoomId){var thisDHtml="<p align='center'><img src='/imgs/loading.gif'/></p><p align='center'>请稍后，正在为您查询！</p>";$("#Room-Introduction-"+Elong_id+"-"+RoomId+" div").html(thisDHtml);var ff=!(document.all);var NowState=GetObj("Room-Introduction-"+Elong_id+"-"+RoomId);if(NowState.className=="Hidden-Room-Introduction"){if(ff){NowState.className="View-Room-Introduction-ff";}else{NowState.className="View-Room-Introduction";}$.ajax({type:"get",timeout:"1000",dataType:"html",url:"/hotel/get_RoomIntro.asp?roomid="+RoomId+"&Elong_id="+Elong_id,beforeSend:function(XMLHttpRequest){},success:function(data,textStatus){$("#Room-Introduction-"+Elong_id+"-"+RoomId+" div").html(data);},error:function(a,b,c){thisDHtml="无法获取数据，请稍后再试";$("#Room-Introduction-"+Elong_id+"-"+RoomId+" div").html(thisDHtml);}});}else{NowState.className="Hidden-Room-Introduction";}}function ViewDiv(DivName,obj){var Left,Top,Height,Width;Left=objLeft(obj);Top=objTop(obj);Width=obj.offsetWidth;Height=obj.offsetHeight;if(DivName.indexOf("PriceDiv")==0){GetObj(DivName).style.left=Left+Width-5+"px";GetObj(DivName).style.top=Top-15+"px";GetObj(DivName).style.display="block";}else{GetObj(DivName).style.left=(Left-4)+"px";GetObj(DivName).style.top=Top+Height-5+"px";GetObj(DivName).style.display="block";}}function CloseDiv(DivName,obj){GetObj(DivName).style.display="none";}function CloseDivAll(){this.DivName.style.display="none";}function nextSibling(obj){var tempObj=obj;do{tempObj=tempObj.nextSibling;}while(tempObj.nextSibling&&tempObj.nextSibling.nodeType&&(tempObj.nextSibling.nodeType!=1))return tempObj;}function ViewHiddenRoom(id){if($.browser.msie&&$.browser.version<=6){if($(".hidden-Room"+id)[0].style.display=="none"){for(var i=0;i<$(".hidden-Room"+id).length;i++){$(".hidden-Room"+id)[i].style.display="block";}$(".AllRoom"+id)[0].className="AllRoom"+id+" HiddenRooms";}else{for(var i=0;i<$(".hidden-Room"+id).length;i++){$(".hidden-Room"+id)[i].style.display="none";}$(".AllRoom"+id)[0].className="AllRoom"+id+" Viewrooms";}}else{if($(".hidden-Room"+id).css("display")=="none"){$(".hidden-Room"+id).css("display","table-row");$(".AllRoom"+id).addClass("HiddenRooms");$(".AllRoom"+id).removeClass("Viewrooms");}else{$(".hidden-Room"+id).css("display","none");$(".AllRoom"+id).addClass("Viewrooms");$(".AllRoom"+id).removeClass("HiddenRooms");}}}function Change_Favorites(obj,hotelid,divid){var ajax=new AJAXRequest;var Favorites=obj;var hotelid=hotelid;var divid=divid;alert('已加入常住酒店!');ajax.get("/member/Favorites/Add_Favorites.asp?hotelid="+hotelid,function(obj){});}function list_area(city_id,city){window.open('/hotel/city_area_list.asp?city_id='+city_id+'&city='+city,'list_area','width=560,height=530,resizable=0,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=100');}function list_area_xz(city_id,city){window.open('/hotel/city_area_xz_list.asp?city_id='+city_id+'&city='+city,'list_area','width=560,height=530,resizable=0,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=100');}function reload(city_id,area_id){window.opener.location='hotel_list.asp?area_type='+area_type+'&city_id='+city_id+'&area_id='+area_id}function Submit(){if(stringToDate(document.form1.startdate.value)<stringToDate(document.form1.today.value)){alert("入住日期不能早于今日！");document.form1.startdate.focus();return(false);}if(stringToDate(document.form1.startdate.value)>=stringToDate(document.form1.enddate.value)){alert("离店日期应大于入住日期！");document.form1.enddate.focus();return(false);}if(daysBetween(document.form1.startdate.value,document.form1.enddate.value)>28){alert("入住时间段不能超过28天");document.form1.enddate.focus();return(false);}if(daysBetween(document.form1.today.value,document.form1.enddate.value)>90){ alert("如需查询三个月后的房价，请拨打电话 400-686-9999，谢谢！");document.form1.enddate.focus();return(false);}document.form1.submit();return(true);}function daysBetween(DateOne,DateTwo){var OneMonth=DateOne.substring(5,DateOne.lastIndexOf('-'));var OneDay=DateOne.substring(DateOne.length,DateOne.lastIndexOf('-')+1);var OneYear=DateOne.substring(0,DateOne.indexOf('-'));var TwoMonth=DateTwo.substring(5,DateTwo.lastIndexOf('-'));var TwoDay=DateTwo.substring(DateTwo.length,DateTwo.lastIndexOf('-')+1);var TwoYear=DateTwo.substring(0,DateTwo.indexOf('-'));var cha=((Date.parse(OneMonth+'/'+OneDay+'/'+OneYear)-Date.parse(TwoMonth+'/'+TwoDay+'/'+TwoYear))/86400000);return Math.abs(cha);}function setCheckInDate(d){document.getElementById("startdate").value=d;showCalendar('imageCalendar2',false,'enddate','startdate');}$(document).ready(function(){$(".hotelabo span a").click(function(){return false;});});