var read_cookie=function(a,b){return(b=RegExp("(^|; )"+encodeURIComponent(a)+"=([^;]*)").exec(document.cookie))?b[2]:null},chooseTab=function(a){document.cookie="tab="+a+"; path=/"},checkTabs=function(){var a=read_cookie("tab");"undefined"!=typeof a&&"map"===a&&$("#maptablink").length>0&&($("#maptablink").trigger("click"),nokia_map=new NokiaMap)};$(document).ready(function(){$(".mobile-menu").hide(),$(".show-hide").show(),$(".show-hide").click(function(){$(".mobile-menu").slideToggle()})}),$(function(){$("[data-href]").length>0&&$("[data-href]").each(function(a,b){$(b).attr("href",$(b).attr("data-href"))})});var searchRedirect=function(){var a=$("#what").val();"undefined"==typeof a&&(a="");var b=$("#where").val();return 0==b.length&&flatpack_default_location&&(b=flatpack_default_location),window.location.href=flatpack_stub+"/redirect?what="+escape(a)+"&where="+escape(b),!1},searchRedirectMobile=function(){var a=$("#mobwhat").val(),b=$("#mobwhere").val();return window.location.href=flatpack_stub+"/redirect?what="+escape(a)+"&where="+escape(b),!1},parseSuggestions=function(a){if(a.success){if(a=a.data,a.suggestions.length){var b=[];for(s in a.suggestions)b.push(a.suggestions[s].name.replace(/&amp;/gi,"&"));return b}return[]}return[]};$(document).ready(function(){function b(a){var b=$("a[id='"+a+"']");$("html,body").animate({scrollTop:b.offset().top},"slow")}if(flatpack_keywordsAutoComplete){$("#what").get(0)&&($("#what").parents("form").attr("autocomplete","off"),$("#what").keydown(function(a){9==a.keyCode&&(a.stopImmediatePropagation(),a.preventDefault(),$("#where").focus())}),$("#what").typeahead({minLength:3,source:function(a,b){$.ajax({type:"GET",url:flatpack_stub+"/autocomplete/what",dataType:"json",data:{what:a},success:function(a){a=parseSuggestions(a),b(a)}})}}));var a=$(".fp-affiliates");"undefined"!=typeof masonry&&a.imagesLoaded(function(){a.masonry({itemSelector:".fp-affiliate"})}),$("#mobwhat").get(0)&&($("#mobwhat").parents("form").attr("autocomplete","off"),$("#mobwhat").keydown(function(a){9==a.keyCode&&(a.stopImmediatePropagation(),a.preventDefault(),$("#mobwhere").focus())}),$("#mobwhat").typeahead({minLength:3,source:function(a,b){$.ajax({type:"GET",url:flatpack_stub+"/autocomplete/what",dataType:"json",data:{what:a},success:function(a){a=parseSuggestions(a),b(a)}})}}))}flatpack_locationsAutoComplete&&($("#where").get(0)&&($("#where").keydown(function(a){9==a.keyCode&&(a.stopImmediatePropagation(),a.preventDefault(),$("#searchsubmit").focus())}),$("#where").typeahead({minLength:3,source:function(a,b){$.ajax({type:"GET",url:flatpack_stub+"/autocomplete/where",dataType:"json",data:{where:a},success:function(a){a=parseSuggestions(a),b(a)}})}})),$("#mobwhere").get(0)&&($("#mobwhere").keydown(function(a){9==a.keyCode&&(a.stopImmediatePropagation(),a.preventDefault(),$("#mobsearchsubmit").focus())}),$("#mobwhere").typeahead({minLength:3,source:function(a,b){$.ajax({type:"GET",url:flatpack_stub+"/autocomplete/where",dataType:"json",data:{where:a},success:function(a){a=parseSuggestions(a),b(a)}})}}))),checkTabs(),$(".js-anchor-verified").click(function(a){a.preventDefault(),b("anchor-verified"),$(".verified-card").addClass("animated bounce")})}),jQuery(".video-link").click(function(){var a=jQuery(this)[0].getAttribute("href"),b=jQuery(this)[0].getAttribute("title");if($(".modal-video").html('<iframe width="560" height="315" src="'+a+'" frameborder="0" allowfullscreen></iframe>'),$(".modal-title").html(b),"undefined"!=typeof yextSource){var c=jQuery(this)[0].getAttribute("data-yext_pid");"undefined"!=typeof c&&recordYextEvent(yextId,"video",yextSource,c)}});var recordEvent=function(a,b){$.ajax({type:"GET",url:flatpack_stub+"/ajax/event",data:{entity_id:a,event_type:b,domain:window.location.host,path:window.location.pathname}}).done(function(a){})},recordLogEvent=function(a,b,c){$.ajax({type:"POST",url:flatpack_stub+"/ajax/logevent",data:{entity_ids:a.join(),event_type:b,domain:window.location.host,path:window.location.pathname}}).done(function(a){c&&(console.log("Entity Serve Log"),console.log(a))})};$(document).ready(function(){var a=!1;$("[data-entityserve-debug]").length>0&&(a=!0);var b=new Array;$("[data-entityserve-type]").length>0&&$("[data-entityserve-type]").each(function(a,c){$(c).attr("data-entityserve")&&(b[$(c).attr("data-entityserve-type")]||(b[$(c).attr("data-entityserve-type")]=new Array),b[$(c).attr("data-entityserve-type")].push($(c).attr("data-entityserve")))});for(var c in b)recordLogEvent(b[c],c,a)});var recordYextEvent=function(a,b,c,d){if(!a||!d)return!1;switch(b){case"email":renderYextPixel(d,a,c,"click",null,null,null,"email");break;case"website":renderYextPixel(d,a,c,"click",null,null,null,"website");break;case"phonereveal":renderYextPixel(d,a,c,"click",null,null,null,"phone");break;case"gallery":renderYextPixel(d,a,c,"click",null,null,null,"photos");break;case"specialoffer":renderYextPixel(d,a,c,"click",null,null,null,"specialoffer");break;case"facebook":renderYextPixel(d,a,c,"click",null,null,null,"facebook");break;case"twitter":renderYextPixel(d,a,c,"click",null,null,null,"twitter");break;case"video":renderYextPixel(d,a,c,"click",null,null,null,"video");break;case"name":renderYextPixel(d,a,c,"click",null,null,null,"name");break;case"bios":renderYextPixel(d,a,c,"click",null,null,null,"bios");break;case"menus":renderYextPixel(d,a,c,"click",null,null,null,"menus");break;case"products":renderYextPixel(d,a,c,"click",null,null,null,"products");break;case"events":renderYextPixel(d,a,c,"click",null,null,null,"events");break;case"phone":renderYextPixel(d,a,c,"click",null,null,null,"phone")}},getYextHTML=function(a,b,c){$.ajax({type:"GET",url:flatpack_stub+"/ajax/get_yext_html",data:{yext_id:a,type:b,pid:c},success:function(a){$("#yext_content_"+b).html(""),$("#yext_content_"+b).append(a)}})};