// generated Fri Nov 20 16:46:39 EST 2009

function phokus(){var elt=document.getElementById("ucHome_tbSearchValue");if(elt){elt.focus()}}function addEventToObject(obj,evt,func){var oldhandler=obj[evt];obj[evt]=(typeof obj[evt]!="function")?func:function(){oldhandler();func()}}function swapImageDoCallback(imageId,image,callback){document.getElementById(imageId).onload=callback;document.getElementById(imageId).src=image}function swapImage(imageId,image){document.getElementById(imageId).src=image}function AutoSelect(textbox){if(textbox.createTextRange){var oRange=textbox.createTextRange();oRange.moveStart("character",0);oRange.moveEnd("character",textbox.value.length);oRange.select()}else{if(textbox.setSelectionRange){textbox.setSelectionRange(0,textbox.value.length)}}}function cleardeafaulttext(){if(document.getElementById("ucHome_tbSearchValue").value==document.getElementById("ucHome_tbSearchValue").defaultValue){jq("#ucHome_tbSearchValue").css("color","black");document.getElementById("ucHome_tbSearchValue").value=""}}function cleardefault(id){if(document.getElementById(id).value==document.getElementById(id).defaultValue){jq("#"+id).css("color","black");document.getElementById(""+id).value=""}}function searchfocus(){initSmartBox(document.getElementById("ucHome_tbSearchValue"),document.getElementById("ucHome_tbSearchHint"),"hotel",30,460,null,"/h/travelpost/tpsmarty");jq("#ucHome_tbSearchValue").bind("keypress",sbEnterKey)}function searchfocushotelsonly(id,hiddenId){initSmartBox(document.getElementById(id),document.getElementById(hiddenId),"hotel",30,460,afterSmartySelect,"/h/travelpost/tpsmartyhotelsonly");jq("#"+id).bind("keypress",sbEnterKey)}function afterSmartySelect(data){}function cancelSmartBox(){keysInit(null);if(1==0&&_forceSelection&&_inputcode!=null&&_inputcode.value!=null&&_inputcode.value.length<1){_setValue(0)}abortSmartBox();closeSmartBox();_input=null;_stop=false}function _Callback(input){this.onError=function(status,statusText){};this.onLoad=function done(client){window.status="";if(!client.cancelled&&(_input==input)){_target.innerHTML=client.getText();var list=_getSmartboxList();_itemCount=list.childNodes.length;if(_itemCount>0){for(var i=0;i<list.childNodes.length;i++){li=list.childNodes[i];li.onmousedown=_sbMouseDown;li.onmouseover=_sbMouseOver;li.onmouseout=_sbMouseOut}_target.style.width="auto";_showChoices()}else{_hideChoices()}_cursel=-1;_prevsel=0}}}function sbEnterKey(keystroke){var theform;if(window.navigator.appName.toLowerCase().indexOf("netscape")>-1){theform=document.forms.Form1;if(keystroke.which==13){searchBtnClick();return false}}else{theform=document.Form1;if(event.keyCode==13){event.cancelBubble=true;event.returnValue=false;searchBtnClick()}}}function doSearchFromHeader(){if(document.getElementById("ucHome_tbSearchValue").value.length>0){var newpg="/search.aspx?srch="+document.getElementById("ucHome_tbSearchValue").value+"&h="+document.getElementById("ucHome_tbSearchHint").value;window.location.href=newpg}}function searchBtnClick(){doSearchFromHeader()}function evalKey(e,ControlToChangeImage,SearchBox){var theField=document.getElementById(SearchBox);if(window.event){theform=document.Form1;if(event.keyCode==13){event.cancelBubble=true;event.returnValue=false;if(theField.value.length>0){swapImageDoCallback(ControlToChangeImage,"/images/btn-searching-graysm.gif",doSearchFromHeader)}}}else{if(e.which){if(e.which==13){if(e.preventDefault){e.preventDefault()}if(theField.value.length>0){swapImageDoCallback(ControlToChangeImage,"/images/btn-searching-graysm.gif",doSearchFromHeader)}return false}}}}function dropDownGo(ddlID){ddlElem=document.getElementById(ddlID);var strCurrentUrl=window.location.href;if(strCurrentUrl.match(/p[0-9]+/)){strCurrentUrl=strCurrentUrl.replace(/\/?_?p[0-9]/,"")}if(ddlElem.options[ddlElem.selectedIndex].value.match(/(highScore|lowScore|datePosted|content)/)){strCurrentUrl=strCurrentUrl.replace(/\/?_?(highScore|lowScore|datePosted|content)/,"");strCurrentUrl=strCurrentUrl.replace("__","_")}var strNewUrl="";var strLast=strCurrentUrl.substring(strCurrentUrl.lastIndexOf("/")+1);if(strLast.match(/h[0-9]+/)){strNewUrl=strCurrentUrl+"/"+ddlElem.options[ddlElem.selectedIndex].value}else{strNewUrl=strCurrentUrl+"_"+ddlElem.options[ddlElem.selectedIndex].value}strNewUrl=strNewUrl.replace("#reviews","");strNewUrl=strNewUrl+"#reviews";window.location.href=strNewUrl}function setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie}function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0){return null}}else{begin+=2}var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length}return unescape(dc.substring(begin+prefix.length,end))}function deleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function fixDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0){date.setTime(date.getTime()-skew)}}function hideAllGetRates(){jq("div.getRatesDiv").hide();toggleFaderPane(false)}function showGetRates(resultid,hid,bordercolor,bgcolor,ref){hideAllGetRates();jq("#rsltAddToMe"+resultid).empty();var mydata="hid="+hid;if(bordercolor!=null){mydata+="&bc="+bordercolor}if(bgcolor!=null){mydata+="&bg="+bgcolor}var fsid="";try{fsid=document.getElementById("fsid").value}catch(e){fsid=""}mydata+="&fsid="+fsid+"&ref="+ref;jq.ajax({type:"POST",url:"/hotels/getrates",data:mydata,dataType:"html",success:function(html){jq("#rsltAddToMe"+resultid).append(html);jq("#rsltAddToMe"+resultid).show()},error:function(request,textStatus,error){alert(error)},cache:false})}function showGetRatesAnchored(resultid,hid,bordercolor,bgcolor,anchor,orient,ref){hideAllGetRates();jq("#rsltAddToMe"+resultid).empty();var mydata="hid="+hid;if(bordercolor!=null){mydata+="&bc="+bordercolor}if(bgcolor!=null){mydata+="&bg="+bgcolor}var fsid="";try{fsid=document.getElementById("fsid").value}catch(e){fsid=""}mydata+="&fsid="+fsid+"&ref="+ref;if(!orient){orient="left"}jq.ajax({type:"POST",url:"/hotels/getrates",data:mydata,dataType:"html",success:function(html){jq("#rsltAddToMe"+resultid).html(html);var offset=jq("#"+anchor).offset();var width=jq("#getRatesOuter"+resultid).outerWidth();var height=jq("#getRatesOuter"+resultid).outerHeight();var ancwidth=jq("#"+anchor).outerWidth();var ancheight=jq("#"+anchor).outerHeight();jq("#rsltAddToMe").css("position","relative").css("top","0").css("left","0");if(orient=="right"){jq("#getRatesOuter"+resultid).css("position","absolute").css("top",(offset.top-60)).css("left",(offset.left+(ancwidth+10)))}else{jq("#getRatesOuter"+resultid).css("position","absolute").css("top",(offset.top-60)).css("left",(offset.left-(width+10)))}jq("#rsltAddToMe"+resultid).show()},error:function(request,textStatus,error){alert(error)},cache:false})}function updateReviewHelpful(rid,utility){jq("#reviewHelpful"+rid).empty();jq("#reviewHelpful"+rid).append('<span style="float: right;">Saving...</span>');var success="Thank you for your input.";jq.ajax({type:"GET",url:"/useful-rev?rid="+rid+"&utility="+utility,dataType:"json",success:function(result){jq("#reviewHelpful"+rid).empty();jq("#reviewHelpful"+rid).append('<span class="reviewHelpfulSuccess" style="float: right;">'+success+"</span>");if(result.votesTotal){jq("#votesHelpful"+rid).empty();jq("#votesHelpful"+rid).append(result.votesHelpful+" out of "+result.votesTotal+" found this review helpful");jq("#helpfulCounts"+rid).show()}},error:function(request,textStatus,error){jq("#reviewHelpful"+rid).empty();jq("#reviewHelpful"+rid).append('<span class="reviewHelpfulSuccess" style="float: right;">'+success+"</span>")},cache:false})}function facetOpen(open,sectionid){if(open){jq("#facet-"+sectionid).children(".hidden").show();jq("#facet-"+sectionid).children(".tobehidden").hide()}else{jq("#facet-"+sectionid).children(".hidden").hide();jq("#facet-"+sectionid).children(".tobehidden").show()}}function compareRates(){var data=getRatesData();actionUrl="/in?a="+data.a+"&p="+data.p;actionUrl+="&checkin_date="+data.checkin_date+"&checkout_date="+data.checkout_date;actionUrl+="&hid="+data.hotelId+"&citycode="+data.cityCode;actionUrl+="&guests="+data.guests+"&rooms="+data.rooms+"&ref="+data.ref+"&url="+data.u;var kayakWin=singlewindowRet(0,"Kayak",1,actionUrl);if(data.checkin_date.length>0&&data.checkout_date.length>0){if(comparewindows()){formAlreadySubmitted=true}else{}}else{uncheckcomparetos()}hideAllGetRates();window.focus();kayakWin.focus();return false}jq=jQuery.noConflict();jq(function(){if(jq("#breadcrumb").length>0){jq("#newbreadcrumbs").hide();jq("#breadcrumb").show()}});function swapButtons(){if(document.getElementById("fdimgbutton")!=null&&document.getElementById("fdimgbuttondown")!=null){document.getElementById("fdimgbutton").style.display="none";document.getElementById("fdimgbuttondown").style.display="inline"}}var CMP2_HIDDEN=false;function compareToClosed(){CMP2_HIDDEN=true;jq("#compareToRow").hide();jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"hidefdcmp",metavalue:"true"}})}function compareChecked(cbox){var cbvalue="false";if(cbox.checked){cbvalue="true"}jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:cbox.value,metavalue:cbvalue}});if(cbvalue=="false"){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"fdcmpdonotprecheck",metavalue:"true"}})}else{jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"fdcmpdonotprecheck",metavalue:"false"}})}setCmp2Count()}function addCheckedCompareTos(codeArray){var codeInputs=document.getElementsByName("comparetosite");for(var i=0;i<codeInputs.length;i++){if(codeInputs[i].checked){if(CMP2_HIDDEN){codeInputs[i].checked=false}else{var cmpId=codeInputs[i].id;var cmpUrl=document.getElementById("url"+codeInputs[i].value).value;codeArray.push({code:codeInputs[i].value,group:codeInputs[i].className,input:codeInputs[i],url:cmpUrl})}}}}function getRatesData(){var checkinDate=jq("#checkin_date").val();var checkoutDate=jq("#checkout_date").val();var guests=jq("#guests1").val();var rooms=jq("#rooms").val();var hotelId=jq("#hid").val();var cityCode=jq("#citycode").val();var a=jq("#gra").val();var p=jq("#grp").val();var u=jq("#gru").val();var ref=jq("#ref").val();var ret={checkin_date:checkinDate,checkout_date:checkoutDate,guests:guests,rooms:rooms,hotelId:hotelId,cityCode:cityCode,a:a,p:p,u:u,ref:ref};return ret}function comparewindows(){var popupsOK=true;var codeArray=new Array();var data=getRatesData();addCheckedCompareTos(codeArray);codeArray=chkCompareToGroups(codeArray);for(var j=0;j<codeArray.length;j++){popupsOK=(popupsOK&&singlewindow(j,codeArray[j].code,codeArray.length,codeArray[j].url))}window.focus();if(popupsOK){var codeInputs=document.getElementsByName("comparetosite");if(codeInputs){for(var i=0;i<codeInputs.length;i++){codeInputs[i].checked=false}}}return popupsOK}function uncheckcomparetos(){var codeInputs=document.getElementById("comparetosite");if(codeInputs){for(var i=0;i<codeInputs.length;i++){codeInputs[i].checked=false}}}function singlewindow(num,code,total,url){var windowname=code;if(code.indexOf("_")>0){windowname=code.substring(0,code.indexOf("_"))}var sWidth=1000;var sHeight=600;if(screen.availWidth){sWidth=screen.availWidth;sHeight=screen.availHeight}else{if(document.all){sWidth=window.screen.availWidth;sHeight=window.screen.availHeight}}var width=Math.min(1000,Math.floor(sWidth/total-10));try{var args=replaceArgs("height={0},width={1},top={2},left={3},menubar=1,location=1,resizable=1,scrollbars=1,toolbar=1",sHeight,width,0,Math.floor(width*num+10*num));var mywin=window.open(url,windowname,args);mywin.focus()}catch(ignored){return false}return true}function singlewindowRet(num,code,total,url){var windowname=code;if(code.indexOf("_")>0){windowname=code.substring(0,code.indexOf("_"))}var sWidth=1000;var sHeight=600;if(screen.availWidth){sWidth=screen.availWidth;sHeight=screen.availHeight}else{if(document.all){sWidth=window.screen.availWidth;sHeight=window.screen.availHeight}}var width=Math.min(1000,Math.floor(sWidth/total-10));var mywin=null;try{var args=replaceArgs("height={0},width={1},top={2},left={3},menubar=1,location=1,resizable=1,scrollbars=1,toolbar=1",sHeight,width,0,Math.floor(width*num+10*num));mywin=window.open(url,windowname,args);mywin.focus()}catch(ignored){return null}return mywin}function compare2chk(fsid){var data=getRatesData();var args="ptype=hotels&retUrls=true";args+="&checkin_date="+data.checkin_date;args+="&checkout_date="+data.checkout_date;args+="&location=";args+="&citycode="+data.cityCode;args+="&guests="+data.guests;args+="&rooms="+data.rooms;if(fsid!=null){args+="&fsid="+fsid}}function allcmp2set(isOK){try{var span=document.getElementById("compareToRow");if(isOK){if(span.style.display=="none"){span.style.display=""}}else{span.style.display="none"}}catch(ignored){}}function cmp2set(isOK,code,url){try{var span=document.getElementById("site"+code);var checkbox=document.getElementById("cb"+code);var urlvar=document.getElementById("url"+code);if(isOK){if(span.style.display=="none"){span.style.display="inline";checkbox.checked=checkbox.defaultChecked;checkbox.value=code}urlvar.value=url}else{checkbox.checked=false;span.style.display="none"}}catch(ignored){}}function cmp2swap(origcode,newcode){cmp2set(true,origcode);try{var checkbox=document.getElementById("cb"+origcode);checkbox.value=newcode}catch(ignored){}}function cmp2precheck(isChecked,code){try{var checkbox=document.getElementById("cb"+code);checkbox.checked=isChecked}catch(ignored){}}function setCmp2Count(){var checkedArray=new Array();addCheckedCompareTos(checkedArray);var windowCnt=0;for(var i=0;i<checkedArray.length;i++){if(checkedArray[i].code.indexOf("KAYAK")==-1){windowCnt++}}jq("#fdcmp2count").html((windowCnt>=2)?windowCnt+" ":"")}function addFacetToUrl(url,facet){var newUrl=url;if(url&&facet){if(url.length>0&&facet.length>0){var urlSeg="&f="+facet;var idx=url.indexOf(urlSeg);if(idx>=0){}else{newUrl=url+"&f="+facet}}}return newUrl}function removeParamFromUrl(url,param){var newUrl=url;if(url&&param){if(url.length>0&&param.length>0){var idx=url.indexOf(param);if(idx>=0){newUrl=url.substring(0,idx)+url.substring(idx+param.length)}else{}}}return newUrl}function getInUrl(theUrl,param){var ret="";if(theUrl.indexOf("?")>-1){var par="?"+param+"=";var idx=theUrl.indexOf(par);var temp="";if(idx<0){par="&"+param+"=";idx=theUrl.indexOf("&"+param+"=");if(idx<0){}else{theUrl=theUrl.substring(idx+par.length);idx=theUrl.indexOf("&");ret=idx>-1?theUrl.substring(0,idx):theUrl}}else{theUrl=theUrl.substring(idx+par.length);idx=theUrl.indexOf("&");ret=idx>-1?theUrl.substring(0,idx):theUrl}}else{}return ret}function replaceInUrl(theUrl,param,newVal){var ret=theUrl;if(theUrl.indexOf("?")>-1){var par="?"+param+"=";var idx=theUrl.indexOf(par);var temp="";if(idx<0){par="&"+param+"=";idx=theUrl.indexOf("&"+param+"=");if(idx<0){ret=theUrl+"&"+param+"="+newVal}else{temp=theUrl.substring(0,idx+par.length);theUrl=theUrl.substring(idx+par.length);ret=temp+(theUrl.indexOf("&")>-1?newVal+theUrl.substring(theUrl.indexOf("&")):newVal)}}else{temp=theUrl.substring(0,idx+par.length);theUrl=theUrl.substring(idx+par.length);ret=temp+(theUrl.indexOf("&")>-1?newVal+theUrl.substring(theUrl.indexOf("&")):newVal)}}else{ret=theUrl+"?"+param+"="+newVal}return ret}function replaceIfInUrl(theUrl,param,newVal){var ret=theUrl;if(theUrl.indexOf("?")>-1){var par="?"+param+"=";var idx=theUrl.indexOf(par);var temp="";if(idx<0){par="&"+param+"=";idx=theUrl.indexOf("&"+param+"=");if(idx<0){}else{temp=theUrl.substring(0,idx+par.length);theUrl=theUrl.substring(idx+par.length);ret=temp+(theUrl.indexOf("&")>-1?newVal+theUrl.substring(theUrl.indexOf("&")):newVal)}}else{temp=theUrl.substring(0,idx+par.length);theUrl=theUrl.substring(idx+par.length);ret=temp+(theUrl.indexOf("&")>-1?newVal+theUrl.substring(theUrl.indexOf("&")):newVal)}}else{}return ret}function htmlEncodeForPost(str){var ret="";if(str){if(str.length>0){for(var i=0;i<str.length;i++){var c=str.charCodeAt(i);if(c>=128){ret+="&#"+c+";"}else{ret+=str.charAt(i)}}ret=ret.replace("&#8216;","&lsquo;");ret=ret.replace("&#8217;","&rsquo;");ret=ret.replace("&#8218;","&sbquo;");ret=ret.replace("&#8220;","&ldquo;");ret=ret.replace("&#8221;","&rdquo;");ret=ret.replace("&#8222;","&bdquo;");ret=ret.replace("&#8224;","&dagger;");ret=ret.replace("&#8225;","&Dagger;");ret=ret.replace("&#8240;","&permil;");ret=ret.replace("&#8249;","&lsaquo;");ret=ret.replace("&#8250;","&rsaquo;");ret=ret.replace("&#9824;","&spades;");ret=ret.replace("&#9827;","&clubs;");ret=ret.replace("&#9829;","&hearts;");ret=ret.replace("&#9830;","&diams;");ret=ret.replace("&#8254;","&oline;");ret=ret.replace("&#8592;","&larr;");ret=ret.replace("&#8593;","&uarr;");ret=ret.replace("&#8594;","&rarr;");ret=ret.replace("&#8595;","&darr;");ret=ret.replace("&#8482;","&trade;")}}return ret}function tog(id){jq("#"+id).toggle()}function togComment(id){jq("#reviewComments"+id).toggle();jq("#expand"+id).toggle();jq("#collapse"+id).toggle()}function rowFromComment(c,className){var ret="";if(className){}else{className=""}if(c.userRole==1){className+=(className.length>0?" hotelowner":"hotelowner")}if(className.length>0){ret+='<tr><td class="'+className+'">'}else{ret+="<tr><td>"}if(c.userRole==1){ret+='hotel rep <span class="muted">(unverified)</span>: '}else{ret+="guest: "}ret+='<a href="/member/'+c.username+'" class="uname">'+c.username+'</a><span class="reviewdate"> &ndash; Posted '+c.createdDateDisplay+'</span><br /><div class="commentBody">'+c.comment+"</div></td></tr>";return ret}function saveComment(rid){if(rid){if(rid.length>0){var comment=jq("#newcomment"+rid).val();var isowner=document.getElementById("newcommentisowner"+rid).checked;var role=0;if(isowner){role=1}if(comment&&comment!="Write a comment..."&&comment!="Write another comment..."){if(comment.length>0){document.getElementById("newcommentsave"+rid).disabled=true;jq.ajax({type:"GET",url:"/save-comment?reviewID="+rid+"&comment="+comment+"&userRole="+role,dataType:"json",success:function(result){if(result.status=="OK"){jq("#commentTable"+rid).append(jq(rowFromComment(result.createdComment,"brandnew")));jq("#newcomment"+rid).css("color","#999999");jq("#newcomment"+rid).val("Write another comment...");try{jq("#commentCount"+rid).html("Comments ("+result.commentCount+")");jq("#commentCountOwner"+rid).html('<span style="font-size: 12px; color: #333333;"> &ndash; '+result.commentCountOwner+" by hotel rep</span>")}catch(ignored){}}else{var msg="Could not save your comment.  Please try again.";if(result.status=="EMPTYCOMMENT"){msg="Couldn't save because your comment is empty."}else{if(result.status=="NOTLOGGEDIN"){msg="Couldn't save because you aren't logged in now.  Please sign in again."}}}document.getElementById("newcommentsave"+rid).disabled=false},error:function(request,textStatus,error){},cache:false})}}}}}var gottenComments={};function getComments(rid){if(rid){if(rid.length>0){var hasGotten=gottenComments[rid];if(hasGotten){}else{gottenComments[rid]=true;jq.ajax({type:"GET",url:"/get-comments?reviewID="+rid,dataType:"json",success:function(result){if(result){if(result.length){for(var i=0;i<result.length;i++){jq("#commentTable"+rid).append(jq(rowFromComment(result[i])))}}}},error:function(request,textStatus,error){},cache:false})}}}}function resetComment(rid){if(jq("#"+rid)){jq("#newcomment"+rid).css("color","#999999");jq("#newcomment"+rid).val("Write a comment...")}}function prepTextMulti(tid,defTextArray){if(jq("#"+tid)&&defTextArray.length>0){for(var i=0;i<defTextArray.length;i++){var currVal=jq("#"+tid).val();jq("#"+tid).val(currVal.replace(defTextArray[i],""))}jq("#"+tid).css("color","#000000")}}function prepText(tid,defText){if(jq("#"+tid).val()==defText){jq("#"+tid).val("")}else{}}function outbound(url,windowTitle){url=unescape(url);url=escape(url);var newWindow=singlewindowRet(1,windowTitle,1,"/out?url="+url);newWindow.focus()};

var jsck_CommonScripts="v287";
// generation time: 6ms
