﻿var IndexClient=Elong.Page.IndexClient;IndexClient=Class.create();Object.extend(IndexClient.prototype,{name:"IndexClient",pageCount:0,pageindex:0,lat:0,lng:0,showToolBar:null,initialize:function(){this.initializeDOM();this.initializeEvent();this.initializeFlash();if(HotelDetailController.AjaxIsSquare==false){this.urlTemplate=new Template(HotelDetailController.UrlConfig.Hotel_List);this.urlDetailTemplate=new Template(HotelDetailController.UrlConfig.Hotel_Detail);}else{this.urlTemplate=new Template(HotelDetailController.UrlConfig.Hotel_ListSquare);this.urlDetailTemplate=new Template(HotelDetailController.UrlConfig.Hotel_DetailSquare);}this.orderUrl=new Template(HotelDetailController.UrlConfig.OrderUrl);this.afterDays=HotelDetailController.AfterDays;this.inDays=HotelDetailController.InDays;this.res=HotelDetailController.Resources;this.orderFromId=HotelDetailController.OrderFrom;this.WebCategory=HotelDetailController.WebKind;this.hotelRoom=HotelDetailController.HotelRoom;this.roomTemplate=new Template("<li ridx='#{ridx}' #{IsShow}><span class='wb11'><a mth='room' href='#?'>#{roomName}</a><span mth='room' class='#{showRoom} vea'></span></span><span class='wb12'><a mth='rate' class='#{showRule}' href='#?'>#{rateName}</a><span class='#{iscoupon}' mth='rate'></span></span><span class='wb3'>#{showPrice}</span><span class='wb4'><a mth='avgprice' class='xun' href='#?'>#{avgPrice}</a></span><span class='wb5'>#{breakfast}</span><span class='wb6'>#{bed}</span><span class='wb7'>#{net}</span><span class='wb8'>#{pay}</span><span class='wb9'>#{input}</span></li>");this.priceTemplate=new Template("<table cellspacing='0' cellpadding='0' border='0' class='sf_average'><thead><tr> <th>&nbsp;</th>#{Title}</tr></thead><tbody><tr>#{List}</tr></tbody></table>");this.roomMoreTemplate=new Template("<ul style='display:none' class='fxz clx'>#{Img}<p class='mb10'><span class='mr20' style='display:#{Beddis}'>"+this.res.Colum6+"#{Bed}</span><span class='mr20' style='display:#{Netdis}'>"+this.res.Js_Net+"#{NetMore}</span><span class='mr20' style='display:#{Areadis}'>"+this.res.Js_Area+"#{Area}</span><span class='mr20' style='display:#{Floordis}'>"+this.res.Js_Floor+"#{Floor}</span></p><p>#{Content}</p><div class='tr'><a href='#?' mth='rmhide'>"+this.res.Js_Hide+"</a></div></ul>");this.ruleTemplate=new Template("<div class='sf_voucher'>#{Rule}</div>");this.nearbyMapTemplate=new Template("<ul id='u_m_#{numid}'><li><span class='h_sz'>#{num}</span><a href='#?' onclick='client.openInfoWindow(\"m_#{numid}\")'>#{name}</a><span class='l_black'>#{distanse}</span></li><li class='ml20'>#{address}</li></ul>");this.pageTemplate=new Template("<a title='第一页' class='ls1' href='#?' onclick='client.gotoPage(0)'>&lt;&lt;</a><a class='npage'  href='#?' onclick='client.gotoPage(#{preindex})'>上一页</a>#{pagenum}<a href='#?' onclick='client.gotoPage(#{nextindex})'>下一页</a><a title='最后一页' class='ls1' href='#?' onclick='client.gotoPage(#{lastpage})'>&gt;&gt;</a><span class='l_black ml5' >共#{pagecount}页</span>");this.flashTemplate=new Template("<embed height='370' width='650' base='.' menu='false' flashvars='source=http://data.elong.com/hotels/VirtualTour/#{hotelID}_#{lang}.xml?rad=#{rad}' wmode='Window' quality='High' name='VT360' id='VT360' pluginspage='http://www.macromedia.com/go/getflashplayer' src='http://www.elong.com/hotels/Images/cmpdmdaplyr.swf?rad=#{rad}' type='application/x-shockwave-flash'/>");this.EcommentAddTemplate=new Template("<ul class='review'><li class='review-t'>Only members who have stayed in the hotel can post reviews. All comments here are personal views and do not represent the views of eLong. Your review will be posted after our webmaster checks it.  </li>  <li class='mt10'>Rate your satisfaction in the following areas:</li>  <li id='liUserName'>    <ul class='clx'>        <li class='inw'><em>*</em>Your name: <input id='UserName' method='UserName' type='text' /></li>        <li class='inw1'><em></em></li>    </ul>  </li>  <li id='liCardNo'style='display:"+(HotelDetailController.CardNo==""?"block":"none")+"'>    <ul class='clx'>        <li class='inw'><em>*</em>Your eLong card no: <input id='CardNo' method='CardNo' type='text' /></li>        <li class='inw1'></li>    </ul>  </li>  <li id='liPwd'style='display:"+(HotelDetailController.CardNo==""?"block":"none")+"'>    <ul class='clx'>        <li class='inw'><em>*</em>Password: <input id='Pwd' method='Pwd' type='password' /></li>        <li class='inw1'></li>    </ul>  </li>  <li class='mt15' id='lidpStar'>  	<ul class='review-x clx' id='review_rt'>        <li id='dpStar1'><em>*</em>Service <a href='#?' title='Terrible (5)'></a><a href='#?' title='Bad (10)'></a><a href='#?' title='Okay (15)'></a><a href='#?' title='Good (20)'></a><a href='#?' title='Excellent (25)'></a><span id='rvwtitle'></span><input type='hidden' id='dpStartxt1'/></li>        <li id='dpStar2'><em>*</em>Environment <a href='#?' title='Terrible (5)'></a><a href='#?' title='Bad (10)'></a><a href='#?' title='Okay (15)'></a><a href='#?' title='Good (20)'></a><a href='#?' title='Excellent (25)'></a><span id='rvwtitle'></span><input type='hidden' id='dpStartxt2'/></li>        <li id='dpStar3'><em>*</em>Facilities <a href='#?' title='Terrible (5)'></a><a href='#?' title='Bad (10)'></a><a href='#?' title='Okay (15)'></a><a href='#?' title='Good (20)'></a><a href='#?' title='Excellent (25)'></a><span id='rvwtitle'></span><input type='hidden' id='dpStartxt3'/></li>        <li id='dpStar4'><em>*</em>Room Rate <a href='#?' title='Terrible (5)'></a><a href='#?' title='Bad (10)'></a><a href='#?' title='Okay (15)'></a><a href='#?' title='Good (20)'></a><a href='#?' title='Excellent (25)'></a><span id='rvwtitle'></span><input type='hidden' id='dpStartxt4'/></li>  	</ul>  </li>  <li class='mt15'>  <em>*</em>Review Details  <textarea rows='5' id='Content' method='Content' class='review-s'></textarea>  </li>  <li class='mt10 tc'><input type='button' class='search_bt_s' id='btnCommentEAdd' method='btnCommentEAdd' onfocus='this.blur()' value='Submit' /></li></ul><script type='text/javascript'>$(function(){for(i=1;i<5;i++){DAddEvent(i)}});function DAddEvent(id){			 var TitleName;			 $('#dpStar'+id+' a').bind('click',function(){					TitleName=$(this).attr('title');					$(this).parent().children('a').removeClass();					$(this).addClass('hover');					$(this).prevAll('a').addClass('hover');					$(this).parent().children('span').text($(this).attr('title'));                 $(this).parent().children('input').val($(this).attr('title'));					return false;					})			 .bind('mousemove',function(){					$(this).parent().children('a').removeClass();					$(this).addClass('hover');					$(this).prevAll('a').addClass('hover');					})			 .bind('mouseout',function(){					$(this).parent().children('a').removeClass();					$(this).parent().children('a[title='+TitleName+']').addClass('hover');					$(this).parent().children('a[title='+TitleName+']').prevAll('a').addClass('hover');						$(this).parent().children('a[title='+TitleName+']').children('span').text(TitleName);					})				}</script>");this.render();if(HotelDetailController.commentCount!="0"){this.bandingRadioCss();}this.showRoomInfo();this.showMap();},initializeDOM:function(){this.btnCopy=$("#btnCopy");this.dvSearchRegion=$("#dvSearchRegion");this.LanguageType=(HotelDetailController.Language=="EN"?"en":"cn");this.spanRadio=$("#spanRadio");this.InCityName=$("#InCityName");this.RadioUrlTemplate=null;this.spanCityRegion=$("#spanCityRegion");this.spanCitySowntown=$("#spanCitySowntown");this.hCopy=$("#hCopy");this.liWay=$("#liWay");this.hrfMap=$("#hrfMap");this.hrfMap2=$("#hrfMap2");this.hrfMap3=$("#hrfMap3");this.hrf360=$("#hrf360");this.hrf3602=$("#hrf3602");this.SearchApply=$("#SearchApply");this.dvHotelListRegion=$("#dvHotelListRegion");this.btnAddComment=$("#btnAddComment");this.lidpStar=$("#lidpStar");this.imgMap=$("#imgMap");this.hotelName=$("#HotelName");this.nearbyMap=$("#nearbyMap");this.hrfCommentMore=$("#hrfCommentMore");this.hotelPhoto=$("hotelPhoto");this.imghotelPhoto=$("imghotelPhoto");},destroyDOM:function(){this.btnCopy=null;this.nearbyMap=null;},initializeEvent:function(){this.btnCopy.bind("click",this.OnClickbtnCopy.bindAsEventListener(this));this.dvSearchRegion.bind("click",this.OnClickdvSearchRegion.bindAsEventListener(this));this.spanRadio.bind("click",this.OnClickspanRadio.bindAsEventListener(this));this.InCityName.bind("change",this.OnChangeInCityName.bindAsEventListener(this));this.InCityName.bind("focus",this.OnFocusInCityName.bindAsEventListener(this));this.spanCityRegion.bind("mouseover",this.OnMouseoverspanCityRegion.bindAsEventListener(this));this.spanCitySowntown.bind("mouseover",this.OnMouseoverspanCitySowntown.bindAsEventListener(this));this.hCopy.bind("click",this.OnClickhCopy.bindAsEventListener(this));this.liWay.bind("mouseover",this.OnMouseoverliWay.bindAsEventListener(this));this.hrfMap.bind("click",this.OnClickhrfMap.bindAsEventListener(this));this.hrfMap2.bind("click",this.OnClickhrfMap.bindAsEventListener(this));this.hrfMap3.bind("click",this.OnClickhrfMap.bindAsEventListener(this));this.hrf360.bind("click",this.OnClickhrf3602.bindAsEventListener(this));this.hrf3602.bind("click",this.OnClickhrf3602.bindAsEventListener(this));this.SearchApply.bind("click",this.OnClickSearchApply.bindAsEventListener(this));this.dvHotelListRegion.bind("click",this.OnClickdvHotelListRegion.bindAsEventListener(this));this.dvHotelListRegion.bind("mouseover",this.OnOverdvHotelListRegion.bindAsEventListener(this));this.btnAddComment.bind("click",this.OnClickbtnAddComment.bindAsEventListener(this));this.nearbyMap.bind("click",this.OnlickearbyMap.bindAsEventListener(this));this.hrfCommentMore.bind("click",this.OnClickhrfCommentMore.bindAsEventListener(this));this.imghotelPhoto.bind("onerror",this.imghotelPhotoOnerror.bindAsEventListener(this));$(window).unload(this.dispose.bind(this));},destroyEvent:function(){},initializeFlash:function(A){},GetDaoDaoScript:function(){},OnClickhrfCommentMore:function(C){var D=Event.element(C);var A=D.attr("methd");if(A!=null){for(var B=0;B<7;B++){if(A==B){$("#ddCommentSimpleMore"+B)[0].style.display="none";$("#ddCommentMore"+B)[0].style.display="";break;}}}},imghotelPhotoOnerror:function(A){this.hotelPhoto.hide();},showMap:function(A){if(HotelDetailController.lat!="0.000000000"){var B="http://ditu.google.cn/staticmap?center="+HotelDetailController.lat+","+HotelDetailController.lng+"&zoom=14&size=180x130&hl="+(HotelDetailController.Language=="CN"?"zh-cn":"en")+"&maptype=mobile&markers="+HotelDetailController.lat+","+HotelDetailController.lng+",reds&key="+HotelDetailController.MapKey+"&sensor=false";this.imgMap.attr("src",B);}},OnClickbtnAddComment:function(evt){if(this.LanguageType=="cn"){window.location.href="http://dianping.elong.com/PostComment_"+HotelDetailController.hotelID+".html"+(HotelDetailController.CampaignId!=""?"?campaign_id="+HotelDetailController.CampaignId+"":"");}else{var wind=new Dialog({title:'Write Your Review ( " * " required )',htmlContent:this.EcommentAddTemplate.eval(),width:570,initEvent:function(windowElement){windowElement.bind("click",function(evt){var element=Event.element(evt);var method=element.attr("method");switch(method){case"btnCommentEAdd":if(HotelDetailController.CardNo==""){if(!validator.valid($("#CardNo").val(),"notEmpty")){$error($("#CardNo"),"Please enter your card number.");return;}if(!validator.valid($("#CardNo").val(),"number")){$error($("#CardNo"),"The card number can only be digits.");return;}if(!validator.valid($("#Pwd").val(),"notEmpty")){$error($("#Pwd"),"Please enter your password.");return;}}if(!validator.valid($("#UserName").val(),"notEmpty")){$error($("#UserName"),"Please enter your name.");return;}if(!validator.valid($("#dpStartxt1").val(),"notEmpty")){$error($("#lidpStar"),"Please enter rating for all the items.");return;}if(!validator.valid($("#dpStartxt2").val(),"notEmpty")){$error($("#lidpStar"),"Please enter rating for all the items.");return;}if(!validator.valid($("#dpStartxt3").val(),"notEmpty")){$error($("#lidpStar"),"Please enter rating for all the items.");return;}if(!validator.valid($("#dpStartxt4").val(),"notEmpty")){$error($("#lidpStar"),"Please enter rating for all the items.");return;}if(!validator.valid($("#Content").val(),"notEmpty")){$error($("#Content"),"Please enter your review.");return;}if(HotelDetailController.CardNo==""){Elong.login($("#CardNo").val(),$("#Pwd").val(),"",function(res){if(res.MemberLoginCode==1){HotelDetailController.CheckUserIsReserve(HotelDetailController.hotelID,$("#CardNo").val(),function(res){if(res.success){if(res.value){var date=new Date();var Startxt1=$("#dpStartxt1").val().replace(/[^\d]/g,"");var Startxt2=$("#dpStartxt2").val().replace(/[^\d]/g,"");var Startxt3=$("#dpStartxt3").val().replace(/[^\d]/g,"");var Startxt4=$("#dpStartxt4").val().replace(/[^\d]/g,"");HotelDetailController.InsertUserComment(HotelDetailController.hotelID,$("#UserName").val(),$("#Content").val(),2,validator.getTodayString(),$("#CardNo").val(),Startxt1,Startxt2,Startxt3,Startxt4,2,function(res){}.bind(this));wind.close();}else{$error($("#CardNo"),"Only members who have stayed in the hotel can post reviews.");return;}}}.bind(this));}else{$error($("#CardNo"),"Invalid password or card number.");return;}}.bind(this));}else{HotelDetailController.CheckUserIsReserve(HotelDetailController.hotelID,HotelDetailController.CardNo,function(res){if(res.success){if(res.value){var date=new Date();var Startxt1=$("#dpStartxt1").val().replace(/[^\d]/g,"");var Startxt2=$("#dpStartxt2").val().replace(/[^\d]/g,"");var Startxt3=$("#dpStartxt3").val().replace(/[^\d]/g,"");var Startxt4=$("#dpStartxt4").val().replace(/[^\d]/g,"");HotelDetailController.InsertUserComment(HotelDetailController.hotelID,$("#UserName").val(),$("#Content").val(),2,validator.getTodayString(),HotelDetailController.CardNo,Startxt1,Startxt2,Startxt3,Startxt4,2,function(res){}.bind(this));wind.close();}else{$error($("#btnCommentEAdd"),"Only members who have stayed in the hotel can post reviews.");return;}}}.bind(this));}break;}}.bind(this));}.bind(this)});wind.show();}},showRoomInfo:function(){if(HotelDetailController.HotelRoom==""){return;}var A=this.dvHotelListRegion.find("div[index]");for(var B=0;B<A.length;B++){this.buildRoomLine(A.eq(B),this.hotelRoom[B],0,100);}},buildRoomLine:function(node,roomList,start,length){var html,className;var curr=-1;for(var i=0;i<roomList.length;i++){if(!String.isNullOrEmpty(roomList[i].RmName)){curr++;}if(curr>=start&&curr<length){var inputStr="<input mth='order' rtid='{0}' type='button' value='"+this.res.Js_Order+"' class='bt_ord' onmousedown=\"this.className='bt_ord_disnable'\" onmouseup=\"this.className='bt_ord'\"/>";if(roomList[i].Status==1){inputStr=String.format("<input type='button' value='{0}' title='{1}' class='bt_ord com_book_dis'/>",HotelDetailController.Language=="EN"?"Full":"满房",roomList[i].SMsg);}else{if(roomList[i].Status==2){inputStr="<input type='button' title='"+roomList[i].SMsg+"' value='"+this.res.Js_Order+"' class='bt_ord com_book_dis'/>";}}className=roomList[i].IsCoupon==1?"qt":roomList[i].IsCoupon==2?"ctq":"";html=this.roomTemplate.eval({ridx:i,roomName:roomList[i].RmName,showRoom:String.isNullOrEmpty(roomList[i].RmName)?"":"com_show",rateName:roomList[i].RtName,showRule:String.isNullOrEmpty(roomList[i].Rule)?"":"xunt",showPrice:roomList[i].SPrice,avgPrice:roomList[i].AvgPrice,breakfast:roomList[i].Brkfast,bed:String.isNullOrEmpty(roomList[i].BedShort)?"-":roomList[i].BedShort,net:roomList[i].Net,iscoupon:className,pay:roomList[i].Pay,input:String.format(inputStr,roomList[i].RtID)});if(!String.isNullOrEmpty(roomList[i].RmName)){html=String.format("<ul class='tbz clx' rmid='{1}'>{0}</ul>",html,roomList[i].RmID);node.find("div[mth='dvRmList']").append(html);}else{node.find("div[mth='dvRmList'] ul:last-child").append(html);}}}},OnOverdvHotelListRegion:function(evt){var element=Event.element(evt);var method=element.attr("mth");switch(method){case"rate":var hotelIndex=element.parents("div[index]").attr("index");var roomIndex=element.parents("li[ridx]").attr("ridx");var rule=this.hotelRoom[hotelIndex][roomIndex].Rule;if(!String.isNullOrEmpty(rule)){var html=this.ruleTemplate.eval({Rule:rule});if(this.tipWindow!=null){this.tipWindow.close();}this.tipWindow=new TipWindow({htmlContent:html,eventElement:element,defer:true,width:400});}break;case"avgprice":var hotelIndex=element.parents("div[index]").attr("index");var roomIndex=element.parents("li[ridx]").attr("ridx");var dayPrice=this.hotelRoom[hotelIndex][roomIndex].DayPrice;var sbTitle=new StringBuilder();var sbList=new StringBuilder();for(var i=0;i<dayPrice.length;i++){if(i<7){sbTitle.append(String.format("<th>{0}</th>",dayPrice[i].Week));}if(i%7==0){sbList.append(String.format("<tr><td nowrap='' class='blk'>"+this.res.Js_Week+"</td>",1+i/7));}var money=HotelDetailController.IsSquare?" ":"#&yen;";var spriceStr=dayPrice[i].SPrice.length>0?String.format("<p><del class='l_black'>{0}</del></p>",dayPrice[i].SPrice):"";sbList.append(String.format("<td>{2}{0}<div class='blk'>{1}</div></td>",dayPrice[i].Price,this.hotelRoom[hotelIndex][roomIndex].Brkfast,spriceStr));if(i%7==6||i==dayPrice.length-1){sbList.append("</tr>");}}var col=dayPrice.length>=7?7:dayPrice.length;if(this.tipWindow!=null){this.tipWindow.close();}this.tipWindow=new TipWindow({htmlContent:this.priceTemplate.eval({Title:sbTitle.toString(),List:sbList.toString()}),eventElement:element,defer:true,width:90+col*70});break;case"tipf":if(this.tipWindow!=null){this.tipWindow.close();}this.tipWindow=new TipWindow({htmlContent:element.next(0).html(),eventElement:element,defer:true,width:400});break;}},OnClickdvHotelListRegion:function(evt){var element=Event.element(evt);var method=element.attr("mth");switch(method){case"room":var node=element.parents("ul[rmid]");if(node.find("ul.fxz").length>0){node.find("ul.fxz").slideToggle();element.parent().find("span").toggleClass("com_hide");}else{var hotelIndex=element.parents("div[index]").attr("index");var roomIndex=element.parents("li[ridx]").attr("ridx");var room=this.hotelRoom[hotelIndex][roomIndex];var html=this.roomMoreTemplate.eval({Img:String.isNullOrEmpty(room.RmImg)?"":String.format("<div class='mg40'><a href='javascript:void(0)' mth='showImg'><img mth='showImg' height='70' width='70' src='{0}'/><p mth='showImg' class='tc'>{1}</p></a></div>",room.RmImg,String.isNullOrEmpty(room.RmVImg)?(HotelDetailController.Language=="CN"?"点击放大":"zoom in"):(HotelDetailController.Language=="CN"?"360度全景":"Virtual Tour")),Bed:room.Bed,Beddis:String.isNullOrEmpty(room.Bed)?"none":"",NetMore:room.NetMore,Netdis:String.isNullOrEmpty(room.NetMore)?"none":"",Area:String.isNullOrEmpty(room.Area)?"":room.Area+(HotelDetailController.Language=="CN"?"平方米":"sq.m"),Areadis:String.isNullOrEmpty(room.Area)?"none":"",Floor:String.isNullOrEmpty(room.Floor)?"":room.Floor,Floordis:String.isNullOrEmpty(room.Floor)?"none":"",Content:String.isNullOrEmpty(room.Other)?"":(HotelDetailController.Language=="CN"?"其它：":"Other:")+room.Other});$(html).appendTo(node).slideDown();element.parent().find("span").toggleClass("com_hide");}break;case"rmhide":element.parents("ul.fxz:eq(0)").slideUp();break;case"order":var url=this.orderUrl.eval({language:HotelDetailController.Language.toLowerCase(),hotelid:element.parents("div[hotelid]").attr("hotelid"),roomtypeid:element.parents("ul[rmid]").attr("rmid"),rateplanid:element.attr("rtid")});HotelDetailController.SaveCookie(function(){if(Globals.cookie("ispop")=="1"&&HotelDetailController.NeedLogin){var nexturl=escape(url)+escape(url.indexOf("?")>0?"&tenpay=1":"?tenpay=1");var qqrul=String.format("http://www.elong.com/myelong/tenpay.aspx?page=wallet&hasid={0}&Key={1}&name=&nexturl={2}",Globals.cookie("haseid"),Globals.cookie("key"),nexturl);var contentHtml='<iframe id="iframeQQ" frameborder="0"  src="'+qqrul+'" width="510px" height="420px"></iframe>';var wind=new Dialog({title:"激活提示",htmlContent:contentHtml,width:540,initEvent:function(windowElement){}.bind(this)});wind.show();return;}if(this.orderFromId=="4026"&&HotelDetailController.NeedLogin||this.orderFromId=="4026"&&!HotelDetailController.NeedLogin&&Globals.cookie("sdotoelong")=="0"){if(Globals.cookie("sdotoelong")=="0"){var nexturl=escape(url)+escape(url.indexOf("?")>0?"&tenpay=1":"?tenpay=1");var shengdarul=String.format("http://www.elong.com/myelong/tenpay.aspx?page=shengda&sdoid={0}&eCardNo={1}&nexturl={2}",Globals.cookie("sdoid"),Globals.cookie("elongcandno"),nexturl);var contentHtml='<iframe id="iframeShengDa" frameborder="0"  src="'+shengdarul+'" width="510px" height="420px"></iframe>';var wind=new Dialog({title:"激活提示",htmlContent:contentHtml,width:540,initEvent:function(windowElement){}.bind(this)});wind.show();return;}}if(HotelDetailController.IsSquare&&HotelDetailController.NeedLogin){$loginDialog(String.format(HotelDetailController.UrlConfig.LoginUrl+"&timeStamp="+Math.random(),encodeURIComponent(url)),HotelDetailController.Language!="EN");}else{window.location=url;}}.bind(this));break;case"unfold":var node=element.parents("div[index]:eq(0)");if(!element.next(0).hasClass("com_hide")){var index=node.attr("index");this.buildRoomLine(node,this.hotelRoom[index],2,100);node.find("li[h='h']").show();element.text(this.res.ShowAllRoom2);}else{node.find("div[mth='dvRmList']").children().each(function(i){if(i>=3){$(this).remove();}});node.find("li[h='h']").hide();element.text(this.res.ShowAllRoom1);}element.next(0).toggleClass("com_hide");break;case"showMap":var iframeSrc=this.popupMapUrl.eval({language:HotelDetailController.Language.toLowerCase(),city:this.searchElement.txtCity.val(),title:element.attr("title"),lat:element.attr("lat"),lng:element.attr("lng")});var wind=new Dialog({title:this.res.Map,htmlContent:'<div id="t_map"><iframe  frameborder="0" scrolling="no"  src="'+iframeSrc+'" style="margin:0;padding:0;width: 515px; height: 350px;" ></iframe></div>',width:540,height:390,initEvent:function(windowElement){}.bind(this)});wind.show();break;case"show360":var html=this.flashTemplate.eval({hotelID:element.parents("div[hotelid]").attr("hotelid"),rad:Math.random(),lang:HotelDetailController.Language});var wind=new Dialog({title:this.res.View360,htmlContent:html,width:720,height:465,initEvent:function(windowElement){}.bind(this)});wind.show();break;case"showImg":var index=element.parents("div[index]").attr("index");var ridx=element.parents("ul[rmid]:eq(0)").find("li[ridx]:eq(0)").attr("ridx");var path=this.hotelRoom[index][ridx].RmVImg;if(!String.isNullOrEmpty(path)){if(this.tipWindow!=null){this.tipWindow.close();}this.tipWindow=new TipWindow({htmlContent:String.format("<embed height='300px' width='450px' base='.' menu='false' flashvars='fileName={0}?{1}' wmode='transparent' allowscriptaccess='sameDomain' quality='High' bgcolor='#FFFFFF' name='VT360' id='VT360' pluginspage='http://www.macromedia.com/go/getflashplayer' src='http://resource.elong.com/cn/hotels/images/vtourlite.swf?{1}' type='application/x-shockwave-flash'/>",path,Math.random()),eventElement:element,width:470,height:345});}else{var Imgpath=this.hotelRoom[index][ridx].RmBigImg;if(!String.isNullOrEmpty(Imgpath)){if(this.tipWindow!=null){this.tipWindow.close();}this.tipWindow=new TipWindow({htmlContent:String.format("<img height='300' width='450' src='{0}?{1}' border='0' />",Imgpath,Math.random()),eventElement:element,width:470,height:345});}}break;}},OnClickhrf360:function(evt){var element=Event.element(evt);var html=this.flashTemplate.eval({lang:this.LanguageType,rad:Math.random(),hotelID:HotelDetailController.hotelID});if(this.tipWindow!=null){this.tipWindow.close();}this.tipWindow=new TipWindow({htmlContent:html,eventElement:element,width:680,height:415});},OnClickhrf3602:function(evt){var element=Event.element(evt);var html=this.flashTemplate.eval({lang:this.LanguageType,rad:Math.random(),hotelID:HotelDetailController.hotelID});var wind=new Dialog({title:HotelDetailController.Resources.View360,htmlContent:html,width:680,height:415,initEvent:function(windowElement){}.bind(this)});wind.show();},OnClickSearchApply:function(evt){var element=Event.element(evt);var method=element.attr("method");switch(method){case"checkInDateApply":new CalendarWindow({eventElement:element,selectedDate:element.val(),language:this.LanguageType,onSelected:function(date){element.val(date);$("#checkOutDateApply").click();$("#checkInDateApply").removeClass();$("#checkInDateApply").addClass("in_w");}.bind(this)});break;case"checkOutDateApply":var Applydate=validator.convertDate($("#checkInDateApply").val());Applydate=new Date(Applydate.setHours(24));Applydate=validator.reFormatDateString(Applydate.getFullYear()+"-"+(Applydate.getMonth()+1)+"-"+Applydate.getDate());new CalendarWindow({eventElement:element,selectedDate:validator.reFormatDateString(Applydate),language:this.LanguageType,enabledFrom:validator.reFormatDateString(Applydate),onSelected:function(date){element.val(date);$("#checkOutDateApply").removeClass();$("#checkOutDateApply").addClass("in_w");}.bind(this)});break;case"btn":if(this.LanguageType=="cn"){if(!validator.valid($("#checkInDateApply").val(),"notEmpty & date")){$error($("#checkInDateApply"),HotelDetailController.Resources.script_CheckInDate_error);return;}if(!validator.valid($("#checkOutDateApply").val(),"notEmpty & date")){$error($("#checkOutDateApply"),HotelDetailController.Resources.script_CheckOutDate_error);return;}}else{if(!validator.valid($("#checkInDateApply").val(),"notEmpty & dateEn")){$error($("#checkInDateApply"),HotelDetailController.Resources.script_CheckInDate_error);return;}if(!validator.valid($("#checkOutDateApply").val(),"notEmpty & dateEn")){$error($("#checkOutDateApply"),HotelDetailController.Resources.script_CheckOutDate_error);return;}}var now=new Date();var nowDate=validator.reFormatDateString(now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate());var StartDate=$("#checkInDateApply").val();var EndDate=$("#checkOutDateApply").val();var dateStart=validator.reFormatDateString(StartDate);var dateEnd=validator.reFormatDateString(EndDate);if(dateStart<nowDate){$error($("#checkInDateApply"),HotelDetailController.Resources.script_CheckInDate_validator);return;}if(dateEnd<nowDate){$error($("#checkOutDateApply"),HotelDetailController.Resources.script_CheckOutDate_validator);return;}if(dateEnd<dateStart){$error($("#checkOutDateApply"),HotelDetailController.Resources.script_CheckOutDate_validator2);return;}var date=validator.convertDate(dateStart);date=new Date(date.setHours(24));if(!validator.valid($("#checkOutDateApply").val(),"notEmpty & dateRange",validator.getDateString(date),null)){$error($("#checkOutDateApply"),HotelDetailController.Resources.script_CheckOutDate_validator2);return false;}var checkAfteDays=this.daysBetween(dateStart,validator.reFormatDateString(new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate()));if(checkAfteDays>this.afterDays){$error($("#checkInDateApply"),HotelDetailController.Resources.script_if_head+dateStart+String.format(HotelDetailController.Resources.script_if_end,HotelDetailController.WebTelAndNo));return;}var checkInDays=this.daysBetween(dateStart,dateEnd);if(checkInDays>this.inDays){$error($("#checkOutDateApply"),HotelDetailController.Resources.script_need_head+this.inDays+String.format(HotelDetailController.Resources.script_need_end,HotelDetailController.WebTelAndNo));return;}var checkInDate=$("#checkInDateApply")[0].value;var checkOutDate=$("#checkOutDateApply")[0].value;Globals.cookie("ShHotel","",{InDate:validator.reFormatDateString(checkInDate),OutDate:validator.reFormatDateString(checkOutDate)});var url=this.urlDetailTemplate.eval({language:this.LanguageType,sort:HotelDetailController.Ajaxsort,pageindex:HotelDetailController.Ajaxpageindex,hotelid:HotelDetailController.hotelID});window.location.href=url;break;}},OnClickhrfMap:function(A){if(HotelDetailController.lat=="0.000000000"){return;}var C=Event.element(A);window.onerror=function(){return true;};var B=new Dialog({title:HotelDetailController.Resources.Map,htmlContent:'<div id="t_map" style="margin:0;padding:0;width: 625px; height: 460px"></div>',width:650,height:500,initEvent:function(D){FunctionExt.defer(function(){var E=new MapControl({containId:"t_map",showTools:true});E.addLabeledMarker(HotelDetailController.hotelName,HotelDetailController.lat,HotelDetailController.lng,HotelDetailController.hotelName,{url:"http://resource.elong.com/cn/hotels/images/hotel_map.gif",width:21,height:21});},100);}.bind(this)});B.show();},OnMouseoverliWay:function(A){if(this.showChildTip==null||this.showChildTip.windowElement==null){this.showChildTip=new TipWindow({htmlContent:HotelDetailController.CashContent,eventElement:$("#liWay"),width:400});}},OnClickhCopy:function(A){if($("#divCopyCode")[0].style.display=="none"){$("#divCopyCode")[0].style.display="block";$("#spanArrow").removeClass("com_show gth");$("#spanArrow").addClass("com_hide gth");}else{$("#divCopyCode")[0].style.display="none";$("#spanArrow").removeClass("com_hide gth");$("#spanArrow").addClass("com_show gth");}},OnMouseoverspanCityRegion:function(A){$("#ulCityRegion")[0].style.display="block";$("#ulCitySowntown")[0].style.display="none";this.spanCitySowntown.removeClass("mvb");this.spanCityRegion.addClass("mvb");},OnMouseoverspanCitySowntown:function(A){$("#ulCityRegion")[0].style.display="none";$("#ulCitySowntown")[0].style.display="block";this.spanCityRegion.removeClass("mvb");this.spanCitySowntown.addClass("mvb");},OnFocusInCityName:function(A){$("#InCityName_input").val("");$("#InCityName").removeClass();$("#InCityName").addClass("wi_115 city-i");},OnChangeInCityName:function(A){if($("#InCityName_input").val()=="undefined"||$("#InCityName_input").val()==""){$("#InCityName_input").val(this.FindCity($("#InCityName").val(),"hotelcity"));}$("#InCityName").removeClass();$("#InCityName").addClass("wi_115 city-i");},OnClickspanRadio:function(evt){if(HotelDetailController.AjaxIsSquare==true){this.RadioUrlTemplate=new Template(HotelDetailController.UrlConfig.Hotel_DetailCommentSquare);}else{this.RadioUrlTemplate=new Template(HotelDetailController.UrlConfig.Hotel_DetailComment);}var element=Event.element(evt);var method=element.attr("method");switch(method){case"d-all":window.location.href=this.RadioUrlTemplate.eval({language:this.LanguageType,hotelid:HotelDetailController.hotelID,sort:"index",pageindex:"1"});break;case"d-god":window.location.href=this.RadioUrlTemplate.eval({language:this.LanguageType,hotelid:HotelDetailController.hotelID,sort:"good",pageindex:"1"});break;case"d-n":window.location.href=this.RadioUrlTemplate.eval({language:this.LanguageType,hotelid:HotelDetailController.hotelID,sort:"bad",pageindex:"1"});break;}},OnClickdvSearchRegion:function(evt){var element=Event.element(evt);var method=element.attr("method");switch(method){case"txtEnterDate":new CalendarWindow({eventElement:element,selectedDate:element.val(),language:this.LanguageType,onSelected:function(date){element.val(date);$("#CheckOutDate").click();$("#CheckInDate").removeClass();$("#CheckInDate").addClass("wi_115 time-i");}.bind(this)});break;case"txtOutDate":var edate=validator.convertDate($("#CheckInDate").val());edate=new Date(edate.setHours(24));edate=validator.reFormatDateString(edate.getFullYear()+"-"+(edate.getMonth()+1)+"-"+edate.getDate());new CalendarWindow({eventElement:element,selectedDate:validator.reFormatDateString(edate),language:this.LanguageType,enabledFrom:validator.reFormatDateString(edate),onSelected:function(date){element.val(date);$("#CheckOutDate").removeClass();$("#CheckOutDate").addClass("wi_115 time-i");}.bind(this)});break;case"Price":$("#Price").css({color:"#000"});break;case"btnSearch":if($("#InCityName_input").val()=="undefined"||$("#InCityName_input").val()==""){$("#InCityName_input").val(this.FindCity($("#InCityName").val(),"hotelcity"));}if(!validator.valid($("#InCityName").val(),"notEmpty")){$error($("#InCityName"),HotelDetailController.Resources.script_city_null,"left");return;}if(this.LanguageType=="cn"){if(!validator.valid($("#CheckInDate").val(),"notEmpty & date")){$error($("#CheckInDate"),HotelDetailController.Resources.script_CheckInDate_error,"left");return;}if(!validator.valid($("#CheckOutDate").val(),"notEmpty & date")){$error($("#CheckOutDate"),HotelDetailController.Resources.script_CheckOutDate_error,"left");return;}}else{if(!validator.valid($("#CheckInDate").val(),"notEmpty & dateEn")){$error($("#CheckInDate"),HotelDetailController.Resources.script_CheckInDate_error,"left");return;}if(!validator.valid($("#CheckOutDate").val(),"notEmpty & dateEn")){$error($("#CheckOutDate"),HotelDetailController.Resources.script_CheckOutDate_error,"left");return;}}var now=new Date();var nowDate=validator.reFormatDateString(now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate());var StartDate=$("#CheckInDate").val();var EndDate=$("#CheckOutDate").val();var dateStart=validator.reFormatDateString(StartDate);var dateEnd=validator.reFormatDateString(EndDate);if(dateStart<nowDate){$error($("#CheckInDate"),HotelDetailController.Resources.script_CheckInDate_validator,"left");return;}if(dateEnd<nowDate){$error($("#CheckOutDate"),HotelDetailController.Resources.script_CheckOutDate_validator,"left");return;}if(dateEnd<dateStart){$error($("#CheckOutDate"),HotelDetailController.Resources.script_CheckOutDate_validator2,"left");return;}var date=validator.convertDate(dateStart);date=new Date(date.setHours(24));if(!validator.valid($("#CheckOutDate").val(),"notEmpty & dateRange",validator.getDateString(date),null)){$error($("#CheckOutDate"),HotelDetailController.Resources.script_CheckOutDate_validator2,"left");return false;}var checkAfteDays=this.daysBetween(dateStart,validator.reFormatDateString(new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate()));if(checkAfteDays>this.afterDays){$error($("#CheckInDate"),HotelDetailController.Resources.script_if_head+dateStart+String.format(HotelDetailController.Resources.script_if_end,HotelDetailController.WebTelAndNo),"left");return;}var checkInDays=this.daysBetween(dateStart,dateEnd);if(checkInDays>this.inDays){$error($("#CheckOutDate"),HotelDetailController.Resources.script_need_head+this.inDays+String.format(HotelDetailController.Resources.script_need_end,HotelDetailController.WebTelAndNo),"left");return;}if($("#InCityName_input").val()!="undefined"&&$("#InCityName_input").val()!=""){$("#InCityName_input").val(this.FindCity($("#InCityName").val(),"hotelcity"));}var cityName=$("#InCityName").val();var cityId=$("#InCityName_input").val();var checkInDate=$("#CheckInDate")[0].value;var checkOutDate=$("#CheckOutDate")[0].value;var price=$("#Price").val();var hotelName=$("#HotelName").val();var arrPrice=price.split(",");var LowPrice=arrPrice[0];var HighPrice=arrPrice[1];if(cityId==""){$error($("#InCityName"),HotelDetailController.Resources.script_city_validator,"left");return;}Globals.cookie("ShHotel","",{InDate:validator.reFormatDateString(checkInDate),OutDate:validator.reFormatDateString(checkOutDate)});var url=this.urlTemplate.eval({cityid:cityId,enterdate:validator.reFormatDateString(checkInDate),exitdate:validator.reFormatDateString(checkOutDate),lowprice:LowPrice,highprice:HighPrice,language:this.LanguageType,starlevel:-1,areaid:0,language:HotelDetailController.Language.toLowerCase(),hotelsort:1,pageindex:1});if(hotelName==""){window.location.href=url;}else{window.location.href=url+""+(HotelDetailController.CampaignId==""?"?s="+escape(hotelName):"&s="+escape(hotelName));}break;}},OnClickbtnCopy:function(B){var D=document.getElementById("txtCopy");if(window.clipboardData){D.select();window.clipboardData.setData("Text",D.value);}else{if(navigator.userAgent.indexOf("Opera")!=-1){window.location=txt;}else{if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}catch(E){alert("你使用的FireFox浏览器,复制功能被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车。\n然后将“signed.applets.codebase_principal_support”双击，设置为“true”");return;}var C=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!C){return;}var F=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!F){return;}F.addDataFlavor("text/unicode");var H=new Object();var G=new Object();var H=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);var A=D.value;D.select();H.data=A;F.setTransferData("text/unicode",H,A.length*2);var I=Components.interfaces.nsIClipboard;if(!C){return false;}C.setData(F,null,I.kGlobalClipboard);}}}},FindCity:function(cityname,citytype){var cityData;eval("cityData = "+citytype+";");var cityName="CityNameCn";if(HotelDetailController.Language=="EN"){cityName="CityNameEn";}var result=Globals.searchObj(cityName,cityname,cityData);if(result.length>0&&result[0]!=null){return decodeURIComponent(result[0].CityId);}return"";},OnlickearbyMap:function(B){var D=Event.element(B);var A=D.attr("method");switch(A){case"printmap":var E=document.body.innerHTML;document.body.innerHTML="<div class='detail_global' id='hotels_map'>"+document.getElementById("nearbyMap").innerHTML+"</div>";window.print();window.location.href=window.location.href.replace("#","");break;case"shareMap":var C=new Dialog({title:"分享",htmlContent:"<input id='txtCopy' size='50' value='"+window.location.href+"'/><input type='button' method='btncopy'  value='复制'/>",width:480,height:70,initEvent:function(F){F.bind("click",function(H){var I=Event.element(H);var G=I.attr("method");switch(G){case"btncopy":client.OnClickbtnCopy();break;}});}.bind(this)});C.show();break;case"mapatm":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("atm");break;case"mapbank":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("银行");break;case"maprestaurant":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("餐馆");break;case"mapstation":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("地铁站");break;case"mapbus":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("公交车站");break;case"mapmarket":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("超市");break;case"mapgas":$("#HotelListItem").children().each(function(F){$(this).removeClass("antion");});$(D).addClass("antion");this.searchNearBy("加油站");break;}},searchNearBy:function(A){$("#mapcontent").html();$("#mapcontent").html("<ul id='u_m_1' class='antion'><li>数据加载中.... </li></ul>");this.pageindex=0;this.map.searchNearBy(A,HotelDetailController.hotelName,this.lat,this.lng,this.pageindex,this.searchNearByCallback.bindAsEventListener(this));},render:function(){var A={dataId:"hotelcity",dataHotId:"hotelcityhot",needGetData:false,needGetDataHot:false,hotHeight:"155"};if(HotelDetailController.Language=="EN"){$("#InCityName").CitySuggest(jQuery.CitySuggest.OptionsEn,jQuery.extend({},A,{resultId:"InCityName_input",resultExtendMethod:function(C,D,B){$("#InCityName_input").val(D.CityNameEn);}}));}else{$("#InCityName").CitySuggest("cn",jQuery.extend({},A,{resultId:"InCityName_input",resultExtendMethod:function(C,D,B){$("#InCityName_input").val(D.CityCode);}}));}if(HotelDetailController.PageViewType=="detailMap"){this.map=new MapControl({containId:"detailmap",cityCode:"beijing",showTools:false});this.lat=HotelDetailController.lat;this.lng=HotelDetailController.lng;this.lat=parseFloat(this.lat)+0.006;this.lng=parseFloat(this.lng)+0.0065;this.map.setCenter(this.lat,this.lng);this.searchNearBy("餐馆");}if(HotelDetailController.Language!="EN"){this.hotelName.HotelSuggest("http://hotel.elong.com/suggest.html",{matchSubset:false,formatItem:function(B){return B;},scroll:true,scrollHeight:300,max:10,mouseDownOnSelect:true,dataType:"jsonp",delay:50,isSubmit:true,extraParams:{"CityId":function(){return $("#InCityName_input").val();}}});}},initToolBar:function(){if(this.showToolBar==null){this.showToolBar=new Dialog({title:"",htmlContent:"<div class='ht-load'><p>请稍等，您查询的数据正在搜索中......</p><p class='ld-img'></p></div>",width:480,initEvent:function(A){}.bind(this)});}},searchNearByCallback:function(result){if(result!="undefined"&&result.length>0){this.map.removeAllOverlays();var labelHtml="<div class='googleIcon clx'><div class='bm'></div><span class='abg'>"+HotelDetailController.Name+"</span></div>";var html="";for(var i=1;i<=result.length;i++){html+=this.nearbyMapTemplate.eval({num:i,numid:i,name:result[i-1]._name,address:result[i-1]._address});this.map.addMarker("m_"+i,result[i-1]._latitude,result[i-1]._longitude,{url:"http://resource.elong.com/cn/hotels/images/h_"+i+".gif",width:15,height:15},result[i-1]._name,"<b>"+result[i-1]._name+"</b><br/>"+result[i-1]._address,true,true,this.openInfoWindow.bindAsEventListener(this));this.pageCount=result[0]._pagecount;}$("#mapcontent").html();$("#mapcontent").html(html);this.pageingNearBy();}else{$("#mapcontent").html();$("#mappage").html();$("#mappage").html("");$("#mapcontent").html("<ul id='u_m_1' class='antion'><li>未找到相关数据 </li></ul>");}this.map.addLabeledMarker(HotelDetailController.hotelName,this.lat,this.lng,HotelDetailController.hotelName,{url:"http://resource.elong.com/cn/hotels/images/hotel_map.gif",width:21,height:21});},pageingNearBy:function(){var B="";if(this.pageindex==0){B="<a title='第一页' class='ls1' href='#?' class='ls1'>&lt;&lt;</a><a class='npage'  href='#?' '>上一页</a>";}else{B=String.format("<a title='第一页'  href='#?' onclick='client.gotoPage(0)'>&lt;&lt;</a><a   href='#?' onclick='client.gotoPage({0})'>上一页</a>",this.pageindex-1);}var A=0;if(this.pageindex>3){if(this.pageindex>this.pageCount-3){A=this.pageCount-4;}else{A=this.pageindex-2;}}else{A=1;}if(A<1){A=1;}if(A>1){B+="...";}for(var C=0;C<5;C++){if(this.pageCount>=A+C){if(this.pageindex==A+C-1){B+=String.format("<a href='#?' class='dq' onclick='client.gotoPage({0})'>{1}</a>",A+C-1,A+C);}else{B+=String.format("<a href='#?' onclick='client.gotoPage({0})'>{1}</a>",A+C-1,A+C);}}}if(A+4<this.pageCount){B+="...";}if(this.pageindex==this.pageCount-1){B+="<a href='#?' class='npage' >下一页</a><a title='最后一页' class='ls1' href='#?' >&gt;&gt;</a>";}else{B+=String.format("<a href='#?' onclick='client.gotoPage({0})'>下一页</a><a title='最后一页' class='ls1' href='#?' onclick='client.gotoPage({1})'>&gt;&gt;</a>",this.pageindex+1,this.pageCount-1);}B+=String.format("<span class='l_black ml5' >共{0}页</span>",this.pageCount);$("#mappage").html();$("#mappage").html(B);},gotoPage:function(A){this.pageindex=A;this.map.gotoPage(A);},openInfoWindow:function(B){$("#mapcontent").children().each(function(C){$(this).removeClass("antion");});$("#u_"+B).addClass("antion");var A=this.map.overlayList.getOverlayById(B);this.map.openOverlayTip(B);},bandingRadioCss:function(){if(HotelDetailController.Language!="EN"){if(HotelDetailController.AjaxCommentType=="index"){$("input[name=dq]").get(0).checked=true;$("#spanIndex").addClass("axz");}else{if(HotelDetailController.AjaxCommentType=="good"){$("input[name=dq]").get(1).checked=true;$("#spanGood").addClass("axz");}else{if(HotelDetailController.AjaxCommentType=="bad"){$("input[name=dq]").get(2).checked=true;$("#spanBad").addClass("axz");}}}}},daysBetween:function(A,I){var B=A.substring(5,A.lastIndexOf("-"));var F=A.substring(A.length,A.lastIndexOf("-")+1);var C=A.substring(0,A.indexOf("-"));var D=I.substring(5,I.lastIndexOf("-"));var G=I.substring(I.length,I.lastIndexOf("-")+1);var E=I.substring(0,I.indexOf("-"));var H=((Date.parse(B+"/"+F+"/"+C)-Date.parse(D+"/"+G+"/"+E))/86400000);return Math.abs(H);},dispose:function(){this.destroyEvent();this.destroyDOM();}});var client=null;$ready(function(){client=new IndexClient();});