function getParameterValue(n){for(var r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i,t=0;t<r.length;t++)if(i=r[t].split("="),i[0]==n)return decodeURIComponent(i[1])}function detectIE(){var n=window.navigator.userAgent,i=n.indexOf("MSIE "),u,r,t;return i>0?parseInt(n.substring(i+5,n.indexOf(".",i)),10):(u=n.indexOf("Trident/"),u>0)?(r=n.indexOf("rv:"),parseInt(n.substring(r+3,n.indexOf(".",r)),10)):(t=n.indexOf("Edge/"),t>0)?parseInt(n.substring(t+5,n.indexOf(".",t)),10):!1}var autocomplete,locationParameter,event,btn;window.google==="undefined"||window.google===null||document.getElementById("search-store")==null||(autocomplete=new google.maps.places.Autocomplete(document.getElementById("search-store")));jQuery("#searchStoreBtn").click(function(){var n=jQuery("#search-store").val(),t,i;n!==""&&(t=jQuery("#storeLocation").val(),i=t+"?location="+n,window.location.href=i)});locationParameter=getParameterValue("location");event=null;detectIE()?(function(){function n(n,t){t=t||{bubbles:!1,cancelable:!1,detail:undefined};var i=document.createEvent("CustomEvent");return i.initCustomEvent(n,t.bubbles,t.cancelable,t.detail),i}if(typeof window.CustomEvent=="function")return!1;n.prototype=window.Event.prototype;window.CustomEvent=n}(),event=new CustomEvent("click",{view:window})):event=new MouseEvent("click",{view:window});btn=document.getElementById("searchButton");locationParameter!==undefined&&(jQuery("#postal-search").val(locationParameter),setTimeout(function(){btn.dispatchEvent(event)},250))