function bindVotes(){$.each($(".r-act.pending"),function(e,t){var i=$(t),n=i.parents(".activity-line").attr("id").split("-")[2];i.find(".up-vote").on("click",function(e){e.preventDefault(),e.stopPropagation(),ajaxNotice("Your vote was registered and we will use it to improve the content recommendations. Thank you!","success"),Hbz.trackEvent("Activities Ratings",{category:"Up Vote",activity_id:n},!1)}),i.find(".down-vote").on("click",function(e){e.preventDefault(),e.stopPropagation(),ajaxNotice("Your vote was registered and we will use it to improve the content recommendations. Thank you!","success"),Hbz.trackEvent("Activities Ratings",{category:"Down Vote",activity_id:n},!1)}),i.removeClass("pending")})}var UUID,Hubbiz;UUID=UUID||function(){const e={},t=[];for(let e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);const i="_hbz_s_act";return e.getUUID=function(){const t=e.getCookie(i)||e.generate();return e.save(i,t),t},e.getCookie=function(e){let t=null;if(document.cookie&&""!==document.cookie){const i=document.cookie.split(";");for(let n=0;n>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&n|128]+t[n>>8&255]+"-"+t[n>>16&255]+t[n>>24&255]+t[255&a]+t[a>>8&255]+t[a>>16&255]+t[a>>24&255]},e.save=function(e,t){const i=new Date;i.setTime(i.getTime()+36e5);const n="."+Hubbiz.domain;document.cookie=[e,"=",encodeURIComponent(t),"; expires="+i.toUTCString(),"; path=/; domain=",n].join("")},e}(),(Hubbiz=Hubbiz||{}).domain=window.site_domain===undefined?"hub.biz":window.site_domain,Hubbiz.page_uuid=UUID.getUUID(),Hubbiz.visitUrl=Hubbiz.visitUrl||Hubbiz.domain,Hubbiz.eventSeq=0,Hubbiz.Analytics={defaultParams:{uuid:Hubbiz.page_uuid,referrer:window.encodeURIComponent===undefined?escape(document.referrer):encodeURIComponent(document.referrer)},trackEvent:function(e,t){(t=$.extend({},this.defaultParams,t)).timestamp=Math.round((new Date).getTime()/3e5),t.seq=Hubbiz.eventSeq++,t.action=e;const i=[];for(const e in t)i.push(e+"="+t[e]);const n=("https:"===document.location.protocol?"https://":"http://")+"counter."+Hubbiz.visitUrl+"/visits.gif?"+i.join("&");if(Hubbiz.dontTrack===undefined){if(!navigator.webdriver){(new Image).src=n}}else console.warn("Events tracking was disabled. Event:'"+e+"'"),console.info("eventData",t)}};var HubbizModal={show:function(e){var t=$("div.overlay");if(0===t.length){var i=$("
");i.css("width","100vw").css("height","100vh"),$("body").append(i).on("click","div.overlay",HubbizModal.hide),$("div.over-cont").removeClass("over-cont").addClass("overlay"),e!==undefined&&e()}else t.show(),e!==undefined&&e()},hide:function(){$("div.overlay").fadeOut(200,function(){$(this).remove()})}},ajaxInProgress=!1;$.address!==undefined&&$.address.state("/");var Hbz,coordsMap,centerMap,hasOpenedFancybox=!1,initialPage="",initialTitle=document.title,freezeState=!1;window._hbzEvents=window._hbzEvents||[];var is_resizing,$rel_cont=$("#related-content"),HbzLists=HbzLists||{};(Hbz={trackLog:{},maps:{},markers:{},showTooltip:function(e){$("."+e).fadeIn()},hideTooltip:function(e){$("."+e).fadeOut()},closeTooltip:function(e){$("."+e).fadeOut(function(){$("."+e).remove()})},createMapForCoords:function(e,t,i){var n,a,o;window.__mapsC=window.__mapsC||[],window.__mapsC.push((n=e,a=t,o=i,function(){HubbizMaps.createMapForCoords(n,a,o)}))},getRecId:function(e){const t=$(e.element),i=t.parent().data("r_id");t.data("r_id",i),window.recommendations_id=i},fancyBoxDefaultActivity:{fitToView:!1,loop:!1,type:"ajax",closeEffect:"none",openEffect:"none",showCloseButton:!0,padding:0,keys:{next:{39:"left"},prev:{37:"right"}},beforeShow:function(){var e,t,i=this.group.length,n=_.map($(".activity-url"),function(e){return $(e).attr("title")});this.index===i-1?(e=n[0],t=n[this.index-1]):0===this.index?(e=n[this.index+1],t=n[i-1]):(e=n[this.index+1],t=n[this.index-1]),$.extend(this,{tpl:{next:'
Next:
'+e+"
",prev:'
Previous:
'+t+"
",closeBtn:''}})},beforeLoad:function(){const e=($(this.element).attr("id")||"").replace("act-line-","");window.ga!==undefined&&ga("send","event","Activities","Click to View",e),""===initialPage&&(initialPage=window.location.pathname+window.location.search,initialTitle=document.title),freezeState=!0},afterClose:function(e){if("click"===e.type){var t=$(e.target).parents("a");t.length>0&&t.first().hasClass("activity-url")&&(freezeState=!0)}$(".add_to_list_container").remove(),freezeState||($.address.value(initialPage),document.title=initialTitle,window.pSUPERFLY&&pSUPERFLY.virtualPage(initialPage,initialTitle)),hasOpenedFancybox=!1},afterShow:function(){delete Hbz.maps["activity-map"],coordsMap&¢erMap&&Hbz.createMapForCoords("#activity-map",coordsMap,centerMap),coordsMap=null,centerMap=null,freezeState=!1,hasOpenedFancybox=!0,"undefined"!=typeof deal_countdown&&deal_countdown(),setTimeout(function(){$.fancybox.reposition(),HbzLists.setupListables&&HbzLists.setupListables(".obj_listable");$(".act-share-buttons")},1e3),bindAddToClipboard()},afterLoad:function(){Hbz.getRecId(this);var e=this.element;$.address.value(this.href),e&&$("html, body").scrollTop(e.offset().top)}},fancyboxDefaultMenu:{afterLoad:function(){Hbz.trackEvent("Photo Menu Viewed",{})}},fancyBoxDefaultPhoto:{loop:!0,padding:[0,0,15,0],keys:{next:{13:"left",39:"left"},prev:{8:"right",37:"right"}},beforeLoad:function(){""===initialPage&&(initialPage=window.location.pathname+window.location.search)},afterLoad:function(e){var t=e.element;Hbz.trackEvent("Photo Viewed",{activity_id:t.data("activity-id")}),$.address.value(t.data("photo-path"));var i,n,a;t.data("album-title")!==undefined&&(a=t.data("album-title"),n="\ue044 '+a+" "),void 0===n&&(n="");var o=t.data("fancybox-title")||n+i;this.title=""+o+"",init=!0},afterClose:function(){$.address.value(initialPage),openFancyboxFromUrl()},helpers:{title:{type:"inside"}}},defaultParamsEvents:{},trackEvents:function(){if(window._hbzEvents){let e;for(;e=window._hbzEvents.shift();)"form"===e.type?Hbz.trackForm($(e.selector),e.event,e.params,e.onlyOne):Hbz.trackEvent(e.event,e.params,e.onlyOne)}},trackEvent:function(e,t,i){(t=$.extend({},this.defaultParamsEvents,t)).category===undefined&&("undefined"!=typeof t.activity_id?t.category="Activity":"undefined"!=typeof t.business_id?t.category="Business":t.category="Hubbiz");var n=t.label;void 0===n&&(t.business_id!==undefined&&(n="b:"+t.business_id),t.activity_id!==undefined&&(n="a:"+t.activity_id)),Hbz.trackLog[e]&&i||(window.ga!==undefined&&ga("send","event",t.category,e,n),setTimeout(function(){"undefined"!=typeof gtag&&"Activity Opened"!==t.category&>ag("event",e,t)},250),window._loq=window._loq||[],window._mfq=window._mfq||[],_loq.push(["tag",e]),_mfq.push(["setVariable","tag",e]),Hbz.trackLog[e]=!0,Hubbiz.Analytics.trackEvent(e,t))},trackForm:function(e,t,i,n){i.category===undefined&&(i.activity_id!=undefined?i.category="Activity":i.business_id!=undefined&&(i.category="Business")),Hbz.trackLog[t]&&n||(Hbz.trackLog[t]=!0)},trackLink:function(e,t,i,n){i.category===undefined&&(i.activity_id!=undefined?i.category="Activity":i.business_id!=undefined&&(i.category="Business")),Hbz.trackLog[t]&&n||(Hbz.trackLog[t]=!0)},fav_biz:function(e,t){const i="#biz_action_"+e+" .add_favorite";$(i).fadeTo(200,.5),$.get("/biz/favorite/"+e+"?sel="+($(i).hasClass("biz_selected")?"deselect":"select")+"&from="+t,function(){$(i).hasClass("biz_selected")?$(i).removeClass("biz_selected"):$(i).addClass("biz_selected"),$(i).fadeTo(100,1)})},shareActivity:function(e){var t=(e=$(e)).attr("data-activity-id");e.addClass("loading"),$.get("/activities/"+t+"/share",{},{},"script").always(function(){e.removeClass("loading")})},load_activities:function(e){$.get("/businesses/show_business_acts/"+e,function(e){"ok"==e.status&&$("#biz-acts").html(e.activities).show()})},create_list:function(e){var t=$("#list_title_"+e).val(),i=[];""===t?$("#add-list-notice").text("Please enter the title.").css({visibility:"visible"}):$.inArray(t,i)>-1?$("#add-list-notice").text("You have made a list titled "+t).css({visibility:"visible"}):($("#add_list_spinner_"+e).show(),$.ajax({url:"/lists/post_list",data:{business_id:e,list:t,list_desc:$("#list_desc_"+e).val(),is_public:$("#list_is_public").val()},type:"post",complete:function(){$("#add_list_spinner_"+e).hide()}})),setTimeout(function(){$("#add-list-notice").css({visibility:"hidden"})},1e3)},load_clips:function(){addCopy(".copy_code")},show_overlay:HubbizModal.show,hideOverlay:HubbizModal.hide,show_selected_business_tooltip:function(){let e=$(".biz_actions");0===e.length&&(e=$(".actions-wrap")),e.on("mouseenter","a.biz_action.select_business",function(){const e=$(this);if(e.hasClass("biz_selected"))if(e.parent().hasClass("tooltip_temporary_list"))e.parent().find("a.open_selected").fadeIn();else{const t="/temporary_lists/show_popup?current_page="+$("#current_page").val(),i=$("input[type='hidden']#selected_counter").val();e.wrap("
"),e.parent().append("Go to selected businesses ("+i+")")}}),e.on("mouseleave",".tooltip_temporary_list",function(){$(this).find("a.open_selected").fadeOut()})},appendActivities:function(e,t){if(e=$(e),(t=$(t)).addClass("appended"),e.append(t),e.packery("appended",t),setTimeout(function(){e.find(".appended").removeClass("appended"),fixActImageHeight(e)},250),freezeState=!0,$.fancybox.isOpened)return $.fancybox.current.element.trigger("click")},prependActivities:function(e,t){e=$(e),(t=$(t)).addClass("prepended"),e.prepend(t),e.packery("prepended",t),e.find(".prepended").removeClass("prepended"),setTimeout(function(){fixActImageHeight(e)},200)},loadList:function(e,t){$("html").append("
"),$.ajax({url:t,dataType:"script"}).complete(function(){ajaxInProgress=!1,$(".activity-line.separator").removeClass("progress"),$(".ajax-loader").remove(),$(".follow_object").hide(),$.address.value(e)})},sendBusinessByEmail:function(e){showHubbizDialog("#send-form-container",{url:"/sends/to_email_form",ajax:!0,data:{business_id:e},title:"Send this business to e-mail",buttons:[{text:"Cancel","class":"cancel",click:function(){$(this).dialog("close")}},{text:"Send","class":"save send-button",click:function(){$(".send-object form").submit()}}]})},sendActivityByEmail:function(e,t,i){showHubbizDialog("#send-form-container",{url:"/activities/"+e+"/send_email_form",ajax:!0,data:{"is-dialog":!0,title:t,act_type:i},title:"Send link to e-mail",buttons:[{text:"Cancel","class":"cancel",click:function(){$(this).dialog("close")}},{text:"Send","class":"save send-button",click:function(){$(".send-object form").submit()}}]}),Hbz.trackEvent("Opened Send Activity",{category:"Sharing",activity_id:e},!1)},autoCompleteNear:function(){"use strict";if($("#home_s_for_q").length>0&&Bloodhound){var e=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("name"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:"/location/near?q=%QUERY"});e.initialize(),$("#home_s_for_q").focus(),$("#home_s_near input[name=near], #header_s_near input[name=near]").typeahead({name:"locations",minLength:3,highlight:!0,hint:!0},{name:"locations",source:e.ttAdapter(),templates:{suggestion:function(e){return"

"+e.name+"

"}}}).on("typeahead:hintUpdated",function(){Hbz.trackEvent("Search Near Started",{},!0)}).on("typeahead:selected",function(e,t){$("#geo_id").val(t._id),Hbz.trackEvent("Search Near Selected",{},!0)})}},shareListTwitter:function(e){Hbz.trackEvent("Shared List",{placement:"twitter"});var t=shorten_url($(e).attr("data-href"));if("Not allowed"!==t){t=encodeURIComponent(t);var i=$(e).attr("data-description"),n=575,a=400,o=($(window).width()-n)/2,s="https://twitter.com/share?text="+i+" - &url="+t+"&via=hubbiz",r="status=1,width="+n+",height="+a+",top="+($(window).height()-a)/2+",left="+o;window.open(s,"twitter",r)}return!1},shareListFacebook:function(e){var t=shorten_url($(e).attr("data-href"));if(Hbz.trackEvent("Shared List",{placement:"facebook"}),"Not allowed"!==t){t="https://www.facebook.com/sharer.php?u="+t;var i=575,n=400,a=($(window).width()-i)/2,o="status=1,width="+i+",height="+n+",top="+($(window).height()-n)/2+",left="+a;window.open(t,"facebook",o)}return!1},getUrl:function(e){var t=e.attr("href")||e.data("href")||e.data("link");return t.startsWith("/")&&(t=location.href.split("/").slice(0,3).join("/")+t),t},getTitle:function(e){return e.attr("title")||e.data("title")},getActLineData:function(e,t){e.preventDefault(),e.stopPropagation();var i=$(t).parents(".activity-line, .activity-url, .activity-body"),n=Hbz.getUrl(i),a=Hbz.getTitle(i),o=i.data("act-type")||"Post";return{url:n,text:a,actType:o=o.charAt(0).toUpperCase()+o.slice(1)}},shareTwitter:function(e,t,i){var n="https://twitter.com/share?url=";n=n+e+"&text="+t+"&via=hubbiz&hashtags=SaveThis"+i,window.open(n,"twitterShare","width=600, height=400",!1)},shareFb:function(e,t){var i="https://www.facebook.com/dialog/share?href=";i=i+e+"&redirect_uri="+e+"&content="+t+("&display=popup&app_id="+window.__fb_app_id),window.open(i,"fbShare","width=600, height=400",!1)},attachSocialShare:function(){$(".activity-body").on("click",".tw-share",function(e){var t=Hbz.getActLineData(e,this);Hbz.shareTwitter(t.url,t.text,t.actType)}).on("click",".fb-share",function(e){var t=Hbz.getActLineData(e,this);Hbz.shareFb(t.url,t.text)})},bottomNotice:function(e,t,i){$("#bottom-notice").remove(),$("body").prepend('
 
'),$("#bottom-notice").html(e).fadeIn(),i||(i=2e3),$("#bottom-notice").notifyme({type:t,expire:i,close:"anywhere"})}}).trackEvents(),PreHbz.onStart(function(){Hbz.trackEvents(),setTimeout(Hbz.trackEvents,2500)});