/*waypoints.min*/(function($,l,n,j,d){var f=$(j),k=[],m=-99999,i=false,o=false,g="waypoint.reached",c={init:function(q,p){this.each(function(){var u=$(this),r=h(u),t=r<0?$.fn[l].defaults:k[r].options,s=$.extend({},t,p);s.offset=s.offset==="bottom-in-view"?function(){return $[n]("viewportHeight")-$(this).outerHeight()}:s.offset;if(r<0){k.push({element:u,offset:u.offset().top,options:s})}else k[r].options=s;q&&u.bind(g,q)});$[n]("refresh");return this},remove:function(){return this.each(function(){var p=h($(this));if(p>=0)k.splice(p,1)})},destroy:function(){return this.unbind(g)[l]("remove")}}
function h(q){var p=k.length-1;while(p>=0&&k[p].element[0]!==q[0])p-=1;return p}
function b(q,p){q.element.trigger(g,p);if(q.options.triggerOnce)q.element[l]("destroy")}
function e(){var q=f.scrollTop(),p=q>m,r=$.grep(k,function(t,s){return p?(t.offset>m&&t.offset<=q):(t.offset<=m&&t.offset>q)});if(!m||!q)$[n]("refresh");m=q;if(!r.length)return;if($[n].settings.continuous){$.each(p?r:r.reverse(),function(t,s){b(s,[p?"down":"up"])})}else b(r[p?r.length-1:0],[p?"down":"up"])};$.fn[l]=function(p){if(c[p]){return c[p].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof p==="function"||!p){return c.init.apply(this,arguments)}else if(typeof p==="object"){return c.init.apply(this,[null,p])}else $.error("Method "+p+" does not exist on jQuery"+l)};$.fn[l].defaults={offset:0,triggerOnce:false};var a={refresh:function(){$.each(k,function(r,t){var p=0,s=t.offset;if(typeof t.options.offset==="function"){p=t.options.offset.apply(t.element)}else if(typeof t.options.offset==="string"){var q=parseFloat(t.options.offset),p=t.options.offset.indexOf("%")?Math.ceil($[n]("viewportHeight")*(q/100)):q}else p=t.options.offset;t.offset=t.element.offset().top-p;if(m>s&&m<=t.offset){b(t,["up"])}else if(m<s&&m>=t.offset)b(t,["down"])});k.sort(function(q,p){return q.offset-p.offset})},viewportHeight:function(){return(j.innerHeight?j.innerHeight:f.height())},aggregate:function(){var p=$();$.each(k,function(q,r){p=p.add(r.element)});return p}};$[n]=function(p){if(a[p]){return a[p].apply(this)}else return a.aggregate()};$[n].settings={continuous:true,resizeThrottle:200,scrollThrottle:100};f.scroll(function(){if(!i){i=true;j.setTimeout(function(){e();i=false},$[n].settings.scrollThrottle)}}).resize(function(){if(!o){o=true;j.setTimeout(function(){$[n]("refresh");o=false},$[n].settings.resizeThrottle)}}).load(function(){$[n]("refresh");e()})})(jQuery,"waypoint","waypoints",this);
/*meta*/var Meta={checkInCookieName:"itCheckInDate",checkOutCookieName:"itCheckOutDate",numOfAdultsCookieName:"itAdultsCount",max_polling_limit:9,requests:0,multi_hotel:false,ta_id_list:false,highlighted_limit:false,text_link_limit:false,ga_section:"",today:new Date(),total_visible_limit:0,container_div_name:false,poll_count:0,query_key:false,lowest_price_providers:new Array(),lowest_price_number:1e6,show_more_link:false,checkInCookieValue:false,checkOutCookieValue:false,numOfAdultsCookieValue:2,check_out_first:false,first_time_meta_request:true,init:function(multi_hotel,ta_id_list,highlighted_limit,text_link_limit,ga_section){meta_object=this;meta_object.multi_hotel=multi_hotel;meta_object.ta_id_list=ta_id_list;meta_object.highlighted_limit=highlighted_limit;meta_object.text_link_limit=text_link_limit;meta_object.ga_section=ga_section;meta_object.total_visible_limit=highlighted_limit+text_link_limit;if(!meta_object.multi_hotel){meta_object.container_div_name=ta_id_list+'_meta_container'}else meta_object.container_div_name='multi_hotel_meta_date_container';meta_object.bindCalendar();return true},bindCalendar:function(){meta_object=this;meta_object.createCheckInDatePicker();meta_object.createCheckOutDatePicker();if(readCookie(meta_object.checkInCookieName)!=null){meta_object.checkInCookieValue=new Date(readCookie(meta_object.checkInCookieName));$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_in_field').val($.datepicker.formatDate("mm/dd/yy",meta_object.checkInCookieValue))};if(readCookie(meta_object.checkOutCookieName)!=null){meta_object.checkOutCookieValue=new Date(readCookie(meta_object.checkOutCookieName));$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_out_field').val($.datepicker.formatDate("mm/dd/yy",meta_object.checkOutCookieValue))};if((meta_object.checkInCookieValue&&meta_object.checkOutCookieValue)&&meta_object.checkOutCookieValue>meta_object.checkInCookieValue){$(this).trigger("metaSuccess");meta_object.resetRequest();meta_object.metaRequest()};$('.check_prices_button').on('click',function(){$('.check_in_field').datepicker('show')});return true},createAdultCountSelect:function(){meta_object=this;$('.'+meta_object.container_div_name).find('.adults_field').change(function(){meta_object.numOfAdultsCookieValue=this.value;createCookie(meta_object.numOfAdultsCookieName,meta_object.numOfAdultsCookieValue,2)})},createCheckInDatePicker:function(){meta_object=this;var minDateYear=meta_object.today.getFullYear(),minDateMonth=("0"+(meta_object.today.getMonth()+1)).slice(-2),minDateDay=("0"+meta_object.today.getDate()).slice(-2),maxDateYear=meta_object.today.getFullYear()+1,maxDateMonth=meta_object.today.getFullYear()+1+12,maxDateDay='28';$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_in_field').not('.hasDatePicker').datepicker({beforeShow:function(){var defaultDate=meta_object.checkInCookieValue;$(this).datepicker("option","minDate",new Date(minDateYear,(minDateMonth-1),minDateDay));$(this).datepicker("option","maxDate",new Date(maxDateYear,(maxDateMonth-1),maxDateDay));$(this).datepicker("option","showOn","focus");$(this).datepicker("option","dateFormat","mm/dd/yy");if(defaultDate!==false)$(this).datepicker("setDate",defaultDate);$(this).datepicker("refresh")},onSelect:function(dateText,inst){meta_object.checkInCookieValue=$.datepicker.parseDate("mm/dd/yy",dateText);createCookie(meta_object.checkInCookieName,meta_object.checkInCookieValue,2);$(this).trigger('change');if(!meta_object.check_out_first||meta_object.checkInCookieValue>=meta_object.checkOutCookieValue){setTimeout(function(){$(inst.input).parents('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_out_field').datepicker("show")},100)}else{$(this).trigger("metaSuccess");meta_object.resetRequest();meta_object.metaRequest()};meta_object.check_out_first=false}});$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.show_prices_button').die('click').live('click',function(){$(this).prevAll().find('.check_in_field').datepicker("show")});return true},createCheckOutDatePicker:function(){meta_object=this;var minDateYear=meta_object.today.getFullYear(),minDateMonth=("0"+(meta_object.today.getMonth()+1)).slice(-2),minDateDay=("0"+meta_object.today.getDate()).slice(-2),maxDateYear=meta_object.today.getFullYear()+1,maxDateMonth=meta_object.today.getFullYear()+1+12,maxDateDay='28';$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_out_field').not('.hasDatePicker').datepicker({beforeShow:function(){var defaultDate=meta_object.checkOutCookieValue;if(meta_object.checkInCookieValue&&(!defaultDate||meta_object.checkInCookieValue>=defaultDate))defaultDate=new Date(meta_object.checkInCookieValue.getTime()+2*24*60*60*1e3);$(this).datepicker("option","minDate",new Date(minDateYear,(minDateMonth-1),minDateDay));$(this).datepicker("option","maxDate",new Date(maxDateYear,(maxDateMonth-1),maxDateDay));$(this).datepicker("option","showOn","focus");$(this).datepicker("option","dateFormat","mm/dd/yy");if(defaultDate!=false)$(this).datepicker("setDate",defaultDate);$(this).datepicker("refresh")},onSelect:function(dateText,inst){meta_object.checkOutCookieValue=$.datepicker.parseDate("mm/dd/yy",dateText);createCookie(meta_object.checkOutCookieName,meta_object.checkOutCookieValue,2);$(this).trigger('change');if(!meta_object.checkInCookieValue||(meta_object.checkInCookieValue&&meta_object.checkInCookieValue>=meta_object.checkOutCookieValue)){meta_object.check_out_first=true;if(meta_object.checkInCookieValue<meta_object.today)meta_object.checkInCookieValue=meta_object.today;createCookie(meta_object.checkInCookieName,meta_object.checkInCookieValue,2);$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_in_field').datepicker("setDate",meta_object.checkInCookieValue);setTimeout(function(){$(inst.input).parents('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.check_in_field').datepicker("show")},100)}else if(meta_object.checkInCookieValue){$(this).trigger("metaSuccess");meta_object.resetRequest();meta_object.metaRequest()}}});return true},metaRequest:function(){if(meta_object.first_time_meta_request){pageTracker._trackEvent('Meta Pricing Visible',meta_object.ga_section,meta_object.ta_id_list);meta_object.first_time_meta_request=false;$('.meta_error').empty()};meta_object=this;meta_object.poll_count++;var api_formatted_check_in_date=$.datepicker.formatDate("yy-mm-dd",new Date(meta_object.checkInCookieValue)),api_formatted_check_out_date=$.datepicker.formatDate("yy-mm-dd",new Date(meta_object.checkOutCookieValue));if(readCookie(meta_object.numOfAdultsCookieName)!=null)meta_object.numOfAdultsCookieValue=readCookie(meta_object.numOfAdultsCookieName);var num_adults=meta_object.numOfAdultsCookieValue;$.post('/meta/ajax_call',{query_key:meta_object.query_key,poll_count:meta_object.poll_count,ta_id_list:meta_object.ta_id_list,checkInDate:api_formatted_check_in_date,checkOutDate:api_formatted_check_out_date,adults:num_adults},function(data){var meta_response_object=jQuery.parseJSON(data);if(meta_response_object=="null"||meta_response_object==null||meta_response_object.error){MetaHTML.buildErrorHtml();$('.'+meta_object.container_div_name).find('.meta_results').empty();$('.'+meta_object.container_div_name+', #check_prices_container, .check_prices_container').find('.meta_error').html(MetaHTML.getHtml());$('.multi_hotel_meta_container').empty();return false};if(meta_object.isAllDone(meta_response_object)||meta_object.poll_count>=meta_object.max_polling_limit){if(meta_object.multi_hotel){meta_object.buildMultiAvailabilityHtml(meta_response_object)}else meta_object.buildSingleAvailabilityHtml(meta_response_object);if(meta_object.multi_hotel)$('.multi_hotel_meta_container').each(function(){if($(this).find('.meta_loading_div').is(':visible')){MetaHTML.buildNotFoundHtml();$(this).html(MetaHTML.getHtml())}});return true}else{var timeout_length=meta_object.getTimeoutLength();setTimeout(function(){meta_object.metaRequest()},timeout_length)}});return false},getTimeoutLength:function(){var timeout_length=3e3;switch(meta_object.poll_count){case 1:case 2:case 3:case 4:case 5:timeout_length=2e3;break;case 6:timeout_length=5e3;break;case 7:timeout_length=1e4;break;case 8:timeout_length=15e3;break;case 9:timeout_length=2e4;break};return timeout_length},resetRequest:function(){meta_object=this;meta_object.query_key=false;meta_object.show_more_link=false;meta_object.poll_count=0;meta_object.lowest_price_providers.length=0;meta_object.lowest_price_number=1e6;$('.'+meta_object.container_div_name).find('.meta_error').empty();if(!meta_object.multi_hotel){$('.'+meta_object.container_div_name).find('.enter_dates_title').hide();$('.'+meta_object.container_div_name).find('.show_prices_button').hide();$('.'+meta_object.container_div_name).find('.meta_results').empty();MetaHTML.buildSingleLoadingHtml();$('.'+meta_object.container_div_name).find('.meta_results').html(MetaHTML.getHtml())}else $('.multi_hotel_meta_container').each(function(){$(this).empty();MetaHTML.buildMultiLoadingHtml();$(this).html(MetaHTML.getHtml())});return true},openWindow:function(url,window_id,provider_name){meta_object=this;pageTracker._trackEvent('Meta Check Rates Click',meta_object.ga_section,meta_object.ta_id_list);pageTracker._trackEvent('Meta Check Rates Provider',provider_name,meta_object.ta_id_list);var windows_width=$(window).width()*0.50,windows_height=$(window).height()*0.75,left=($(window).width()/2)-(windows_width/2),top=($(window).height()/2)-(windows_height/2);window.open(url,window_id,'top='+top+',left='+left+',width='+windows_width+',height='+windows_height+',location=1,scrollbars=1,status=1,resizable=1');return true},showMoreSites:function(){$('.'+meta_object.container_div_name).find('.show_extra_available_providers').hide();$('.'+meta_object.container_div_name).find('.meta_text_hidden_provider').each(function(){$(this).removeClass('meta_text_hidden_provider')});meta_object.show_more_link=true;return true},showMultiMoreSites:function(ta_id){$('[id="meta_'+ta_id+'"]').find('.show_extra_available_providers').hide();$('[id="meta_'+ta_id+'"]').find('.meta_text_hidden_provider').each(function(){$(this).removeClass('meta_text_hidden_provider')});return true},showLowestPricedTextlinkFirst:function(){meta_object=this;var lowest_price_text_link_amount=1e5,lowest_price_text_link_provider=false;$('.'+meta_object.container_div_name).find('.meta_text_row').each(function(){var avg_nightly_price=$(this).attr('avg_nightly_price');if(parseInt(avg_nightly_price)<parseInt(lowest_price_text_link_amount)){lowest_price_text_link_provider=$(this).attr('id');lowest_price_text_link_amount=avg_nightly_price}});var existing_first_id=$('.'+meta_object.container_div_name).find('.meta_text_row:first').attr('id');if(existing_first_id!=lowest_price_text_link_provider){var lowest_price_html=$("<div />").append($('#'+lowest_price_text_link_provider).clone()).html(),existing_first_html=$("<div />").append($('#'+existing_first_id).clone()).html();$('#'+lowest_price_text_link_provider).remove();$('#'+existing_first_id).before(lowest_price_html);$('#'+lowest_price_text_link_provider).removeClass('meta_text_hidden_provider');if($('#'+lowest_price_text_link_provider).attr('key')>=meta_object.total_visible_limit)$('[key="'+(meta_object.total_visible_limit-1)+'"]').addClass('meta_text_hidden_provider')};return true},showMultiLowestPricedTextlinkFirst:function(ta_id){meta_object=this;var lowest_price_text_link_amount=1e5,lowest_price_text_link_provider=false;$('[id="meta_'+ta_id+'"]').find('.meta_multi_text_row').each(function(){var avg_nightly_price=$(this).attr('avg_nightly_price');if(parseInt(avg_nightly_price)<parseInt(lowest_price_text_link_amount)){lowest_price_text_link_provider=$(this).attr('id');lowest_price_text_link_amount=avg_nightly_price}});var existing_first_id=$('[id="meta_'+ta_id+'"]').find('.meta_multi_text_row:first').attr('id');if(existing_first_id!=lowest_price_text_link_provider){var lowest_price_html=$("<div />").append($('[id="meta_'+ta_id+'"]').find('#'+lowest_price_text_link_provider).clone()).html(),existing_first_html=$("<div />").append($('[id="meta_'+ta_id+'"]').find('#'+existing_first_id).clone()).html();$('[id="meta_'+ta_id+'"]').find('#'+lowest_price_text_link_provider).remove();$('[id="meta_'+ta_id+'"]').find('#'+existing_first_id).before(lowest_price_html);$('[id="meta_'+ta_id+'"]').find('#'+lowest_price_text_link_provider).removeClass('meta_text_hidden_provider');if($('[id="meta_'+ta_id+'"]').find('#'+lowest_price_text_link_provider).attr('key')>=meta_object.total_visible_limit)$('[id="meta_'+ta_id+'"]').find('[key="'+(meta_object.total_visible_limit-1)+'"]').addClass('meta_text_hidden_provider')};return true},showFeaturedListing:function(){meta_object=this;if(jQuery.inArray($('.'+meta_object.container_div_name).find('.meta_highlighted_row:first').attr('id'),meta_object.lowest_price_providers)!=-1)$('.'+meta_object.container_div_name).find('.meta_highlighted_hotel_featured').show();return true},showMultiFeaturedListing:function(ta_id){meta_object=this;if(jQuery.inArray($('[id="meta_'+ta_id+'"]').find('.meta_multi_highlighted_row:first').attr('id'),meta_object.lowest_price_providers)!=-1)$('[id="meta_'+ta_id+'"]').find('.meta_highlighted_hotel_featured').show();return true},checkForLowestPricedProvider:function(provider){meta_object=this;if(provider.room[0].avg_nightly_price<meta_object.lowest_price_number){meta_object.lowest_price_number=provider.room[0].avg_nightly_price;meta_object.lowest_price_providers.length=0;meta_object.lowest_price_providers.push(provider.provider_info_key)}else if(provider.room[0].avg_nightly_price==meta_object.lowest_price_number){meta_object.lowest_price_number=provider.room[0].avg_nightly_price;meta_object.lowest_price_providers.push(provider.provider_info_key)};return true},isAllDone:function(meta_response_object){meta_object=this;var done_all=meta_response_object.done_all,valid_hotels=$.makeArray(meta_response_object.valid_hotels);if(done_all==valid_hotels.length)return true;return false},buildSingleAvailabilityHtml:function(meta_response_object){meta_object=this;meta_object.query_key=meta_response_object.query_key;var done_one=meta_response_object.done_one,done_all=meta_response_object.done_all,valid_hotels=$.makeArray(meta_response_object.valid_hotels),provider_info_list=meta_response_object.provider_info;if(done_one>0){var valid_hotel_info=valid_hotels[0],available_hotel_providers=valid_hotel_info.providers.available,pending_hotel_providers=valid_hotel_info.providers.pending,unavailable_hotel_providers=valid_hotel_info.providers.unavailable,unknown_hotel_providers=valid_hotel_info.providers.unknown;if(available_hotel_providers.length!=0){$('.'+meta_object.container_div_name).find('.meta_fine_print').show();MetaHTML.resetHtml();$.each(available_hotel_providers,function(key,provider){var display_name=provider_info_list[provider.provider_info_key].display_name,logo_url=provider_info_list[provider.provider_info_key].logo_url;meta_object.checkForLowestPricedProvider(provider);if(key<meta_object.highlighted_limit){MetaHTML.buildSingleHighlightedProviderHtml(key,provider,display_name,logo_url)}else{if(key==meta_object.total_visible_limit&&!meta_object.show_more_link){var extra_available_providers=available_hotel_providers.length-meta_object.total_visible_limit;MetaHTML.buildSingleShowMoreSitesLink(extra_available_providers)};MetaHTML.buildSingleTextLinkProviderHtml(key,provider,display_name)}})}else if(available_hotel_providers.length==0&&done_all==valid_hotels.length){MetaHTML.resetHtml();MetaHTML.buildNoAvailabilityHtml()}}else if(valid_hotels.length==0)MetaHTML.buildNotFoundHtml();$('.'+meta_object.container_div_name).find('.meta_results').html(MetaHTML.getHtml());meta_object.showLowestPricedTextlinkFirst();meta_object.showFeaturedListing();return true},buildMultiAvailabilityHtml:function(meta_response_object){meta_object=this;meta_object.query_key=meta_response_object.query_key;var done_one=meta_response_object.done_one,done_all=meta_response_object.done_all,valid_hotels=$.makeArray(meta_response_object.valid_hotels),invalid_hotels=$.makeArray(meta_response_object.invalid_hotels),unsupported_hotels=$.makeArray(meta_response_object.unsupported_hotels),provider_info_list=meta_response_object.provider_info;if(done_one>0)$(valid_hotels).each(function(){var valid_hotel_info=$(this),ta_id=valid_hotel_info[0].loc_id,current_text_link_count=$('[id="meta_'+ta_id+'"]').find('.meta_multi_text_row:not(.meta_text_hidden_provider):not(.show_extra_available_providers)').length,available_hotel_providers=valid_hotel_info[0].providers.available,pending_hotel_providers=valid_hotel_info[0].providers.pending,unavailable_hotel_providers=valid_hotel_info[0].providers.unavailable,unknown_hotel_providers=valid_hotel_info[0].providers.unknown;MetaHTML.resetHtml();meta_object.lowest_price_providers.length=0;meta_object.lowest_price_number=1e6;if(available_hotel_providers.length!=0){$.each(available_hotel_providers,function(key,provider){var display_name=provider_info_list[provider.provider_info_key].display_name,logo_url=provider_info_list[provider.provider_info_key].logo_url;meta_object.checkForLowestPricedProvider(provider);if(key<meta_object.highlighted_limit){MetaHTML.buildMultiHighlightedProviderHtml(key,provider,display_name,logo_url)}else{if(key==meta_object.total_visible_limit&&current_text_link_count<=meta_object.text_link_limit){var extra_available_providers=available_hotel_providers.length-meta_object.total_visible_limit;MetaHTML.buildMultiShowMoreSitesLink(ta_id,extra_available_providers)};MetaHTML.buildMultiTextLinkProviderHtml(key,provider,display_name,current_text_link_count)}});var button_html='';if(meta_object.hasOwnProperty('replace_button')&&meta_object.replace_button==false)button_html='<div class="multi_hotel_meta_container" id="meta_'+ta_id+'"><button id="iFTTBtn_'+ta_id+'" iFTTid="'+ta_id+'"  ta_id="'+ta_id+'" class="iFTTBtn check_prices_button">Show Prices</button></div><br clear="both" />';$('[id="meta_'+ta_id+'"]').html(button_html+MetaHTML.getHtml());meta_object.showMultiLowestPricedTextlinkFirst(ta_id);meta_object.showMultiFeaturedListing(ta_id);meta_object.bindMultiFinePrintHover(ta_id)}else if(available_hotel_providers.length==0&&done_all==valid_hotels.length){MetaHTML.resetHtml();MetaHTML.buildNoAvailabilityHtml();var button_html='';if(meta_object.hasOwnProperty('replace_button')&&meta_object.replace_button==false)button_html='<div class="multi_hotel_meta_container" id="meta_'+ta_id+'"><button id="iFTTBtn_'+ta_id+'" iFTTid="'+ta_id+'"  ta_id="'+ta_id+'" class="iFTTBtn check_prices_button">Show Prices</button></div><br clear="both" />';$('[id="meta_'+ta_id+'"]').html(button_html+MetaHTML.getHtml())}});$(invalid_hotels).each(function(key,value){var ta_id=value;MetaHTML.resetHtml();MetaHTML.buildNotFoundHtml();var button_html='';if(meta_object.hasOwnProperty('replace_button')&&meta_object.replace_button==false)button_html='<div class="multi_hotel_meta_container" id="meta_'+ta_id+'"><button id="iFTTBtn_'+ta_id+'" iFTTid="'+ta_id+'"  ta_id="'+ta_id+'" class="iFTTBtn check_prices_button">Show Prices</button></div><br clear="both" />';$('[id="meta_'+ta_id+'"]').html(button_html+MetaHTML.getHtml())});$(unsupported_hotels).each(function(key,value){var ta_id=value;MetaHTML.resetHtml();MetaHTML.buildNotFoundHtml();var button_html='';if(meta_object.hasOwnProperty('replace_button')&&meta_object.replace_button==false)button_html='<div class="multi_hotel_meta_container" id="meta_'+ta_id+'"><button id="iFTTBtn_'+ta_id+'" iFTTid="'+ta_id+'"  ta_id="'+ta_id+'" class="iFTTBtn check_prices_button">Show Prices</button></div><br clear="both" />';$('[id="meta_'+ta_id+'"]').html(button_html+MetaHTML.getHtml())});return true},bindMultiFinePrintHover:function(ta_id){$('[id="meta_'+ta_id+'"]').live("mouseenter",function(){$('#meta_fine_print_'+ta_id).show()});$('[id="meta_'+ta_id+'"]').live("mouseleave",function(){$('#meta_fine_print_'+ta_id).hide()})}};
/*meta_hover*/(function($){$.fn.iFrameToolTip=function(options){var defaults={show_results_in_popup:true,width:450,button_vPos:'above',button_hPos:'left',popup_Pos:'below',vOffset:0,hOffset:0,ga_section:'No Page Set - Hover Window',multi_ta_id_list:false,centered:false},options=$.extend(defaults,options),activeCID=0,mouse_in_div=false;return this.each(function(){cr_obj=$(this);$(cr_obj).hover(function(){$.data(this,"timer",setTimeout($.proxy(function(){buildContainerIDs=cr_obj.attr('iFTTid');activeCID=$(this).attr('iFTTid');$('.iFrameToolTip').remove();$('.ui-datepicker').hide();buildPopups(activeCID,$(this))},this),300))},function(){clearTimeout($.data(this,"timer"))})})
function buildPopups(containerID,cr_obj){var popup_html='';popup_html+='<div id="iFTTC-'+containerID+'" class="iFrameToolTip" style="display:none; position:absolute; top:0px; left:0px; background-color:#FFF; z-index:20; border:5px solid #78AEE8;">';popup_html+='<div id="iFTTC-close-popup" class="floatRight" style="cursor: pointer; padding-top: 3px; padding-right: 7px; font-weight: bold;">X</div>';popup_html+='<div id="iFTTC-'+containerID+'-content" class="floatLeft" style="margin-top: -4px;"></div>';popup_html+='</div>';$('body').append(popup_html);setHTML(containerID,cr_obj);return}
function setPosition(containerID,cr_obj){position=cr_obj.offset();if(options.button_vPos=='bottom'){vLocation=position.top+cr_obj.height()+options.vOffset}else vLocation=position.top+options.vOffset;if(options.button_hPos=='right'){hLocation=(position.left+cr_obj.width()+options.hOffset)}else hLocation=position.left-options.width+options.hOffset;if(options.popup_Pos=='above')vLocation=vLocation-$('#iFTTC-'+containerID).height();$('#iFTTC-'+containerID).css('top',vLocation+'px');if(!options.centered){$('#iFTTC-'+containerID).css('left',hLocation+'px')}else $('#iFTTC-'+containerID).css('left','435px');$('#iFTTC-'+containerID).show();mouseBinding(containerID);return}
function setHTML(containerID,cr_obj){if(options.show_results_in_popup){$.ajax({url:"/include/meta_single_hotel_hover.php",type:"POST",cache:false,data:{hotel_id:containerID,ga_section:options.ga_section}}).done(function(data){if(data!='')$('#iFTTC-'+containerID+'-content').html(data);setPosition(containerID,cr_obj)})}else $.ajax({url:"/meta/multi_hotel_hover",type:"POST",cache:false,data:{hotel_id:containerID,ga_section:options.ga_section,ta_id_list:options.multi_ta_id_list,container_id:containerID,hotel_name:cr_obj.attr('hotel_name')}}).done(function(data){if(data!='')$('#iFTTC-'+containerID+'-content').html(data);setPosition(containerID,cr_obj)});return}
function mouseBinding(containerID){$('#iFTTC-'+containerID).mouseleave(function(){if(!mouse_in_div){$('#iFTTC-'+containerID).find('.ui-datepicker').hide();$('#iFTTC-'+containerID).hide()}});$('#iFTTC-'+containerID).find('.ui-datepicker').live("mouseenter",function(){mouse_in_div=true});$('#iFTTC-'+containerID).find('#iFTTC-'+containerID+'-content').live("click",function(){mouse_in_div=true});$('#iFTTC-'+containerID).find('#iFTTC-close-popup').die("click").live("click",function(){$('#iFTTC-'+containerID).find('.ui-datepicker').hide();$('#iFTTC-'+containerID).hide()})}}})(jQuery);
/*meta_html*/var MetaHTML={display_html:"",getHtml:function(){html_object=this;return html_object.display_html},resetHtml:function(){html_object=this;html_object.display_html=""},buildChangeDatesHtml:function(checkInDate,checkOutDate,ta_id,hotel_id_list){html_object=this;html_object.display_html+='<div class="change_dates" iFTTid="'+ta_id+'" id="change_dates_'+ta_id+'"title="Showing rates for '+$.datepicker.formatDate('M dd, yy',checkInDate)+' to '+$.datepicker.formatDate('M dd, yy',checkOutDate)+'">Change dates</div>';return true},buildNoAvailabilityHtml:function(){html_object=this;html_object.display_html+='<div style="padding: 7px;background-color:#f6f6f6;">There is no availability for the dates you selected.  Please try new dates.</div>';return true},buildNotFoundHtml:function(){html_object=this;html_object.display_html+='<div style="padding: 7px;background-color:#f6f6f6;">Contact hotel for availability.</div>';return true},buildErrorHtml:function(){html_object=this;html_object.display_html='<div style="padding: 7px; color: red; font-weight: bold;">There was an error processing your request.  Please check the dates you entered and try again.</div>';return true},buildSingleLoadingHtml:function(){html_object=this;html_object.display_html='<div class="meta_loading_div"><img src="http://c3039282.cdn.cloudfiles.rackspacecloud.com/meta_ajax_loader.gif"></div>'},buildSingleHighlightedProviderHtml:function(key,provider,display_name,logo_url){html_object=this;html_object.display_html+='<a href="javascript:void(0);" onClick="meta_object.openWindow(\''+provider.ta_booking_link+'\', \''+provider.provider_info_key+'\', \''+display_name+'\');">';html_object.display_html+='<div id="'+provider.provider_info_key+'" class="meta_highlighted_row" key="'+key+'">';html_object.display_html+='<div class="meta_highlighted_hotel_logo floatLeft"><img src="'+logo_url+'"></div>';html_object.display_html+='<div class="meta_highlighted_hotel_taxes floatLeft">$'+provider.room[0].avg_taxes_fees+'<br>taxes & fees</div>';html_object.display_html+='<div class="meta_highlighted_hotel_price floatRight">$'+provider.room[0].avg_nightly_price+'*';if(key==0)html_object.display_html+='<div class="meta_highlighted_hotel_featured" style="display:none;">Featured</div>';html_object.display_html+='</div>';html_object.display_html+='</div>';html_object.display_html+='</a>';return true},buildSingleShowMoreSitesLink:function(extra_available_providers){html_object=this;html_object.display_html+='<div class="show_extra_available_providers meta_text_row">';html_object.display_html+='<div class="meta_text_provider_name floatLeft"><a href="javascript:void(0);" onClick="meta_object.showMoreSites();">'+extra_available_providers+' more sites</a></div><div class="meta_text_show_more_sites floatLeft"><img src="http://images.familyvacationcritic.com/blue-down-arrow.png"></div>';html_object.display_html+='</div>';return true},buildSingleTextLinkProviderHtml:function(key,provider,display_name){html_object=this;html_object.display_html+='<div id="'+provider.provider_info_key+'" key="'+key+'" avg_nightly_price="'+provider.room[0].avg_nightly_price+'" class="meta_text_row';if(key>=meta_object.total_visible_limit&&!meta_object.show_more_link)html_object.display_html+=' meta_text_hidden_provider';html_object.display_html+='">';html_object.display_html+='<div class="meta_text_provider_name floatLeft"><a href="javascript:void(0);" onClick="meta_object.openWindow(\''+provider.ta_booking_link+'\', \''+provider.provider_info_key+'\', \''+display_name+'\');">'+display_name+'</a></div>';html_object.display_html+='<div class="meta_text_price floatRight"><a href="javascript:void(0);" onClick="meta_object.openWindow(\''+provider.ta_booking_link+'\', \''+provider.provider_info_key+'\', \''+display_name+'\');">$'+provider.room[0].avg_nightly_price+'*</a></div>';html_object.display_html+='</div>';return true},buildMultiLoadingHtml:function(){html_object=this;html_object.display_html='<div class="meta_loading_div"><img src="http://c3039282.cdn.cloudfiles.rackspacecloud.com/meta_ajax_loader.gif" style="width: 150px;"></div>'},buildMultiShowMoreSitesLink:function(ta_id,extra_available_providers){html_object=this;html_object.display_html+='<div class="show_extra_available_providers meta_multi_text_row">';html_object.display_html+='<div class="meta_multi_text_provider_name floatLeft"><a href="javascript:void(0);" onClick="meta_object.showMultiMoreSites('+ta_id+');">'+extra_available_providers+' more sites</a> <img src="http://images.familyvacationcritic.com/blue-down-arrow.png"></div>';html_object.display_html+='</div>';return true},buildMultiHighlightedProviderHtml:function(key,provider,display_name,logo_url){html_object=this;html_object.display_html+='<a href="javascript:void(0);" onClick="meta_object.openWindow(\''+provider.ta_booking_link+'\', \''+provider.provider_info_key+'\', \''+display_name+'\');">';html_object.display_html+='<div id="'+provider.provider_info_key+'" class="meta_multi_highlighted_row floatLeft" key="'+key+'">';html_object.display_html+='<div class="floatLeft">';html_object.display_html+='<div class="meta_multi_highlighted_hotel_price floatLeft">$'+provider.room[0].avg_nightly_price+'*</div><br>';html_object.display_html+='<div class="meta_multi_highlighted_provider_name floatLeft">'+display_name;if(key==0)html_object.display_html+='<br><div class="meta_highlighted_hotel_featured floatLeft" style="display:none; padding: 0;">Featured</div>';html_object.display_html+='</div>';html_object.display_html+='</div>';html_object.display_html+='<div class="floatRight"><img src="http://c3039282.cdn.cloudfiles.rackspacecloud.com/meta_orange_arrow.png"></div>';html_object.display_html+='</div>';html_object.display_html+='</a>';return true},buildMultiTextLinkProviderHtml:function(key,provider,display_name,current_text_link_count){html_object=this;html_object.display_html+='<div id="'+provider.provider_info_key+'" key="'+key+'" avg_nightly_price="'+provider.room[0].avg_nightly_price+'" class="meta_multi_text_row floatLeft';if(key>=meta_object.total_visible_limit&&current_text_link_count<=meta_object.text_link_limit)html_object.display_html+=' meta_text_hidden_provider';html_object.display_html+='">';html_object.display_html+='<div class="meta_multi_text_provider_name floatLeft"><a href="javascript:void(0);" onClick="meta_object.openWindow(\''+provider.ta_booking_link+'\', \''+provider.provider_info_key+'\', \''+display_name+'\');">'+display_name+'</a></div>';html_object.display_html+='<div class="meta_multi_text_price floatRight"><a href="javascript:void(0);" onClick="meta_object.openWindow(\''+provider.ta_booking_link+'\', \''+provider.provider_info_key+'\', \''+display_name+'\');">$'+provider.room[0].avg_nightly_price+'*</a></div>';html_object.display_html+='</div>';return true}};
