function initGoogleMaps(){var u,f,r,t,i,n;for(console.log(googleMapStartLocation),console.table(googleMapLocationList),u=new google.maps.Map(document.getElementById("map"),{zoom:12,center:new google.maps.LatLng(googleMapStartLocation.latitude,googleMapStartLocation.longitude),mapTypeId:google.maps.MapTypeId.ROADMAP}),f=new google.maps.InfoWindow,t=0;t<googleMapLocationList.length;t++){i=googleMapLocationList[t];n=decodeHtml(i.markerContent);console.log("googleMapLocation markerContent",n);var e=n.indexOf("<h4>"),o=n.indexOf("<\/h4>"),s=n.substring(e+4,o);r=new google.maps.Marker({map:u,position:new google.maps.LatLng(i.latitude,i.longitude),title:s,icon:createIconBase(n)});google.maps.event.addListener(r,"click",function(n,t){return function(){f.setContent(decodeHtml(googleMapLocationList[t].markerContent));f.open(u,n);var i=decodeHtml(googleMapLocationList[t].markerContent);n.setIcon(createIconBase(i))}}(r,t));i.marker=r}}function changeGoogleMapsMarker(n){var t=googleMapLocationList.find(function(t){return t.customerId===n}),i;typeof i!="undefined"&&i.setIcon(createIconBase(t.markerContent));typeof t!="undefined"&&(console.log("googleMapLocation for customer",t),t.marker.setIcon(createIconBase(t.markerContent)),i=t.marker)}function decodeHtml(n){var t=document.createElement("textarea");return t.innerHTML=n,t.value}function createIconBase(n){return(n.match(/h4/g)||[]).length>2?(console.log("big marker"),iconBase+"google-maps-big-marker.png"):iconBase+"google-maps-marker.png"}var googleMapStartLocationClass=function(n,t){this.latitude=n.replace(",",".");this.longitude=t.replace(",",".")},googleMapLocationClass=function(n,t,i,r,u){this.customerId=n;this.latitude=t.replace(",",".");this.longitude=i.replace(",",".");this.name=r;this.markerContent=u;this.marker={}},googleMapStartLocation={},googleMapLocationList=[],previousMarker={},iconBase="/img/",Dealer=function(){function n(){$(".js-dealer-postalcode-search").autocomplete({serviceUrl:"/api/general/postalcodes?lcid="+Global.LCID,ajaxSettings:{timeout:2e3},paramName:"query",deferRequestBy:300,maxHeight:470,minChars:1,preventBadQueries:!1,triggerSelectOnValidInput:!1,onSelect:function(n){$(".js-dealer-dealer-search").find("[name='SearchCityId']").val(n.data);$("#js-dealer-search-link").attr("href","/"+Global.CultureCode.toLowerCase()+"/dealer?searchdealervalue="+n.value+"&searchcityid="+n.data);$(this).focus()},beforeRender:function(){},onSearchStart:function(){},onSearchComplete:function(){}})}function t(){$(".js-dealer-postalcode-search").bind({keypress:function(n){n.which&&n.which!==13&&n.keyCode&&n.keyCode!==13&&(console.log("in remove for js-dealer-dealer-search"),$(".js-dealer-dealer-search").find("[name='SearchCityId']").val(""))}})}return{initPostalCodeAutoComplete:n,initBindKeyPress:t}}()