var map;smileImg=new Image();smileImg.src="images/smile.gif";function sendSmile(e,a,d,c,b){ele=$("#"+e);ele.css("height","16px");ele.html('<div class="comments_link" style="height: 16px"><img src="images/smile.gif" style="vertical-align: middle; padding-right: 4px; height: 15px;"/><span style="background-color: #ffff99; color: #884811; font-weight: bold; padding: 3px; height: 16px; font-size: 11px;">Smile Sent!</span></div>');setTimeout(function(){ele.fadeOut("slow")},"1600");$.get("smiles_handler.php",{smilerid:a,smileeid:d,type:c,typeid:b},void (0))}function saveBookmark(c,b,a){ele=$("#"+c);ele.css("height","16px");ele.html('<div class="comments_link" style="height: 16px"><span style="color: #884811; font-weight: bold; padding: 3px; height: 16px; font-size: 11px;">Bookmarked! <a href="/bookmarks/index.php" title="View my bookmarks" style="text-decoration: underline;">My Bookmarks</a></span></div>');setTimeout(function(){ele.fadeOut("slow")},"1600");$.get("bookmarks/bookmarks_handler.php",{type:b,typeid:a},void (0))}function toggleBookmark(c,a,b){ele=$("#"+c);if(b=="true"){str='<img src="images/silk_book_light.gif" alt="finished reading" /><a class="viewed" href="javascript:void(0);" title="Toggle back" onClick="toggleBookmark(\''+c+"', '"+a+"', 'false')\">Finished reading</a>"}else{str='<img src="images/silk_book.gif" alt="still reading" /><a href="javascript:void(0);" title="Toggle back" onClick="toggleBookmark(\''+c+"', '"+a+"', 'true')\">Still reading</a>"}$.get("bookmarks/viewed_handler.php",{id:a},function(){ele.html(str)})}function deleteBookmark(b,a){ele=$("#"+b);ele.css("height","16px");ele.html('<div class="comments_link" style="height: 16px"><span style="background-color: #FF9; color: #884811; font-weight: bold; padding: 3px; height: 16px; font-size: 11px;">Bookmark deleted!</span></div>');$.get("bookmarks/deletion_handler.php",{id:a},void (0))}function sendCreepReport(c,a,b){ele=$("#"+c);ele.css("height","10px");ele.html('<span style="background-color: #ffff99; color: #884811; height: 10px; font-size: 10px;">Report sent. Thanks!</span>');setTimeout(function(){ele.fadeOut("slow")},"1600");$.get("creep_handler.php",{creepURL:a,info:b},void (0))}function sendUsefulnessReport(d,b,a,c){ele=$("#"+d);ele.css("height","14px");ele.html('<span style="background-color: #ffff99; color: #884811; height: 14px; font-size: 11px;">Thanks for your feedback!</span>');setTimeout(function(){ele.fadeOut("slow")},"1600");$.get("usefulness_handler.php",{id:a,type:b,isuseful:c},void (0))}function getBrowserHeight(){var a;if(window.innerHeight){a=window.innerHeight}else{if(document.documentElement){a=document.documentElement.clientHeight}else{a=600}}return a}function fixPoints(a){for(i=0;i<a.length;i++){if(a[i+1]){if((a[i].x*a[i+1].x)<0){if((parseFloat(a[i].x)>-180)&&(parseFloat(a[i].x)<-40)&&(parseFloat(a[i+1].x)<180)&&(parseFloat(a[i+1].x)>70)){a[i].x=parseFloat(a[i].x)+360}else{if((parseFloat(a[i].x)<180)&&(parseFloat(a[i].x)>70)&&(parseFloat(a[i+1].x)>-180)&&(parseFloat(a[i+1].x)<-40)){a[i+1].x=parseFloat(a[i+1].x)+360}}}}}return a}function createInfoMarker(b,d,a,c){var e=createLinkMarker(b,d,a,"",80);GEvent.addListener(e,"click",function(){e.openInfoWindowHtml(c)});return e}function charCounter(c,a,b){c.onkeyup=function(){if(c.value.length>(b-100)){a.innerHTML="Characters remaining: "+(b-c.value.length)}else{if(a.innerHTML!=""){a.innerHTML=""}}}}function toggleMapView(a){if(a){if(a.getCurrentMapType()==G_MAP_TYPE){a.setMapType(G_SATELLITE_TYPE)}else{a.setMapType(G_MAP_TYPE)}}}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function setDefaultInputText(b,a){b.value=a;b.style.color="#8C8C8C";b.onfocus=function(){if(b.value==a){b.style.color="#000000";b.value=""}};b.onblur=function(){if(b.value==""){b.style.color="#8C8C8C";b.value=a}}}function checkAll(b){for(var a=1;a<b.elements.length;a++){b.elements[a].checked=true}}function uncheckAll(b){for(var a=1;a<b.elements.length;a++){b.elements[a].checked=false}}function checkPartners(b){var d=new Date();var a=d.getTime();a+=3600*12000;d.setTime(a);var h=d.toGMTString();var g;var f;if(b.date1){g=b.date1.value}else{g=b.date1Side.value}if(b.date2){f=b.date2.value}else{f=b.date2Side.value}if(b.bookingWizCheck&&b.bookingWizCheck.checked){document.cookie="bookingWizCheckOff=true; expires="+h;var c="hotels_bw_redirect.php?searchType=hotel&process=referrer&mic=wf38dt2&fm_children=0";b.fm_City.value=b.city.value;c+="&fm_City="+b.fm_City.value;c+="&fm_hotel_checkin_date="+g;c+="&fm_hotel_checkout_date="+f;c+="&fm_Adults="+b.guests.value;c+="&fm_Rooms="+b.rooms.value;c="/"+c;newwindow=window.open(c,"name","scrollbars,height=640,width=800,resizable=1")}else{if(b.bookingWizCheck){document.cookie="bookingWizCheckOff=false; expires="+h}}if(b.hotwireCheck&&b.hotwireCheck.checked){document.cookie="hotwireCheckOff=true; expires="+h;var c="hotels_hw_redirect.php";var e=window.location.href;e=escape(e).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40");b.fm_City.value=b.city.value;c+="?fm_City="+b.fm_City.value;c+="&fm_hotel_checkin_date="+g;c+="&fm_hotel_checkout_date="+f;c+="&fm_Adults="+b.guests.value;c+="&fm_Rooms="+b.rooms.value;c+="&refer="+e;c="/"+c;newwindow2=window.open(c,"name2","height=768,width=1024,scrollbars=1,resizable=1");if(!newwindow2){popupWarning(b);return false}newwindow.moveTo(50,0)}else{if(b.hotwireCheck){document.cookie="hotwireCheckOff=false; expires="+h}}if(b.oneTimeCheck&&b.oneTimeCheck.checked){document.cookie="oneTimeCheckOff=true; expires="+h;var c="hotels_ot_redirect.php";c+="?hotelID="+b.hotelID.value;c+="&checkIn="+g;c+="&checkOut="+f;c+="&guests="+b.guests.value;c+="&rooms="+b.rooms.value;c="/"+c;hideState=document.getElementById("optProvidersHidden");if(hideState&&hideState.value){return true}newwindow=window.open(c,"name3","scrollbars,height=500,width=620,resizable=1")}else{if(b.oneTimeCheck){document.cookie="oneTimeCheckOff=false; expires="+h}}return true}function popupWarning(a){window.scroll(0,0);var b=document.createElement("div");b.setAttribute("id","popupWarning");b.style.width="598px";b.style.height="215px";b.style.position="absolute";b.style.left="0px";b.style.top="0px";b.style.background="#FFFFFF";b.style.border="10px solid #F0B64E";popHTML='<img src="http://static.travbuddy.com/images/popup_warning.gif"/><br/><a style="margin-left: 247px; font-size: 14px; font-weight: bold;" href="javascript:void(0)" onclick="popupContinue(document.'+a.name+')">No thanks, continue with search</a>';b.innerHTML=popHTML;document.body.appendChild(b)}function popupContinue(b){var c=new Date();var a=c.getTime();a+=3600*12000;c.setTime(a);var d=c.toGMTString();document.cookie="hotwireCheckOff=false; expires="+d;b.hotwireCheck.checked=false;b.submit()}function showHotelDesc(){$("#hotelDescMoreLink").hide();$("#hotelDescDots").hide();$("#hotelDescExtra").show()}function addListener(b,a,c){if(b.attachEvent){b.attachEvent("on"+a,c)}else{if(b.addEventListener){b.addEventListener(a,c,true)}else{b["on"+a]=c}}}function showHotelSelector(a,b){var h,e;if(self.pageYoffset){h=self.pageXoffset;e=self.pageYoffset}else{if(document.documentElement&&document.documentElement.scrollTop){h=document.documentElement.scrollLeft;e=document.documentElement.scrollTop}else{if(document.body){h=document.body.scrollLeft;e=document.body.scrollTop}}}var g,d;if(self.innerHeight){g=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){g=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){g=document.body.clientWidth;d=document.body.clientHeight}}}var f=h+(g-620)/2;var c=e+(d-180)/2;hotelSelectorDiv=document.getElementById("hotelSelector");hotelSelectorDiv.style.position="absolute";hotelSelectorDiv.style.top=c+"px";hotelSelectorDiv.style.left=f+"px";hotelSelectorDiv.style.display="block";optProvidersDiv=document.getElementById("selectorOptProviders");if(b){optProvidersDiv.style.display="block";hideState=document.getElementById("optProvidersHidden");hideState.value=""}else{optProvidersDiv.style.display="none";hideState=document.getElementById("optProvidersHidden");hideState.value=1}hotelSelectorHotelIDDiv=document.getElementById("hotelID");hotelSelectorHotelIDDiv.value=a;hotelSelectorDefaultIDDiv=document.getElementById("hotelSelectorDefaultID");hotelSelectorDefaultIDDiv.value=a;grayOut(true)}function hideHotelSelector(){var a=document.getElementById("hotelSelector");a.style.display="none";grayOut(false)}function grayOut(a,g){var g=g||{};var j=g.zindex||50000;var c=g.opacity||70;var d=(c/100);var h=g.bgcolor||"#FFFFFF";var f=document.getElementById("darkenScreenObject");if(!f){var e=document.getElementById("hotelFadeContainer");var b=document.createElement("div");b.style.position="absolute";b.style.top="0px";b.style.left="0px";b.style.overflow="hidden";b.style.display="none";b.id="darkenScreenObject";e.appendChild(b);f=document.getElementById("darkenScreenObject")}if(a){var e=document.getElementById("hotelFadeContainer");pageWidth=e.offsetWidth+"px";pageHeight=e.offsetHeight+"px";f.style.opacity=d;f.style.MozOpacity=d;f.style.filter="alpha(opacity="+c+")";f.style.zIndex=j;f.style.backgroundColor=h;f.style.width=pageWidth;f.style.height=pageHeight;f.style.display="block"}else{f.style.display="none"}}function getFooterDeals(b,a){$("#footerDealsContainer").load("/bb_deals_footer_handler.php",{destination_id:b,placement:a})}function getGuideDeals(b,a){$("#guideDealsContainer").load("/bb_deals_guide_handler.php",{destination_id:b,placement:a})}function getUpdateDeals(b,a){$("#updatesDealsContainer").load("/bb_deals_updates_handler.php",{destination_id:b,placement:a})};