function MarkerClusterer(n,t,i){var r,u;this.extend(MarkerClusterer,google.maps.OverlayView);this.map_=n;this.markers_=[];this.clusters_=[];this.sizes=[53,56,66,78,90];this.styles_=[];this.ready_=!1;r=i||{};this.gridSize_=r.gridSize||60;this.minClusterSize_=r.minimumClusterSize||2;this.maxZoom_=r.maxZoom||null;this.styles_=r.styles||[];this.imagePath_=r.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_;this.imageExtension_=r.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_;this.zoomOnClick_=!0;r.zoomOnClick!=undefined&&(this.zoomOnClick_=r.zoomOnClick);this.averageCenter_=!1;r.averageCenter!=undefined&&(this.averageCenter_=r.averageCenter);this.setupStyles_();this.setMap(n);this.prevZoom_=this.map_.getZoom();u=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var n=u.map_.getZoom(),t=u.map_.minZoom||0,i=Math.min(u.map_.maxZoom||100,u.map_.mapTypes[u.map_.getMapTypeId()].maxZoom);n=Math.min(Math.max(n,t),i);u.prevZoom_!=n&&(u.prevZoom_=n,u.resetViewport())});google.maps.event.addListener(this.map_,"idle",function(){u.redraw()});t&&(t.length||Object.keys(t).length)&&this.addMarkers(t,!1)}function Cluster(n){this.markerClusterer_=n;this.map_=n.getMap();this.gridSize_=n.getGridSize();this.minClusterSize_=n.getMinClusterSize();this.averageCenter_=n.isAverageCenter();this.center_=null;this.markers_=[];this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,n.getStyles(),n.getGridSize())}function ClusterIcon(n,t,i){n.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.styles_=t;this.padding_=i||0;this.cluster_=n;this.center_=null;this.map_=n.getMap();this.div_=null;this.sums_=null;this.visible_=!1;this.setMap(this.map_)}function setTheBlueDot(){var n,t;imp.impState.map!=undefined&&(n=imp.impState.map.getCenter(),imp.markerList.user==undefined?(t=new google.maps.Marker({id:"user",position:n,map:imp.impState.map,icon:user_location_pin}),imp.markerList.user=t,blueDots.push(t)):imp.markerList.user.setPosition(n))}function windowResizeEvents(){try{google.maps.event.trigger(imp.impState.map,"resize");$("#mobile-menu-container").is(":visible")==!1?($(".col-md-4 div.form-group").show(),$("#mapCanvas").show(),$(".col-md-8").show(),$("#lot-search-result-container").show(),mapWidth=$(window).width()-$(".col-md-4").width()-map_container_offset,$("#lot-search-result-container").width($(window).width()-mapWidth-20),$(".container.body-content .col-md-8").width(mapWidth),$("body div.container.body-content div.col-md-8").height($(window).height()-50),listHeight=$(window).height()-237,$("#lot-search-result-container").height(listHeight)):($("body div.container.body-content div.col-md-8").width($(window).width()-map_container_offset),$("body div.container.body-content div.col-md-8").height($(window).height()),$(".container.body-content").css("marginLeft",0),$("#btnSearch").html("<img src='"+$("#mobSearch").val()+"' height='23' />"),$("#btnCloseSearch").html("<img src='"+$("#mobClear").val()+"' height='23' />"))}catch(n){imp.searchUtil.searchCombined()}}function orientationChange(){switch(window.orientation){case-90:case 90:windowResizeEvents();break;default:windowResizeEvents()}}function attachClickEvents(){$("#btnDetails").unbind("click");$("#btnDetails").click(imp.getDetails);$("#btnSearch").unbind("click");$("#btnSearch").click(textboxSearch_Click);$("#btnCloseSearch").unbind("click");$("#btnCloseSearch").click(function(){$("#tbSearch").val("")});setFilterSelections();topFilterButton_Click();filterButton_Click();filterButtonToggle_Click();shareControls_Click();bindMobileMenuControls_Click();defaultSearchButton();$(window).unbind("hashchange");$(window).bind("hashchange",function(){$("#lotDetails").is(":visible")&&($("#close-details-link").click(),window.location.hash.match(/details/)!=null&&setDetailsPageParam("",""))})}function initialize(){var n=new google.maps.LatLng(imp.impState.lat,imp.impState.lng),t;autocomplete=new google.maps.places.Autocomplete($("#tbSearch").get(0),{types:["geocode"]});autocomplete.setBounds(new google.maps.LatLngBounds(n,n));google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()});t={zoom:imp.impState.zoom,center:new google.maps.LatLng(imp.impState.lat,imp.impState.lng),mapTypeId:google.maps.MapTypeId.ROADMAP,streetViewControl:!1};imp.impState.map=new google.maps.Map(document.getElementById("mapCanvas"),t);setMapScrollListener(imp.impState.map);imp.impState.lotResults={};getUserLocation_Search()}function fillInAddress(){var n=autocomplete.getPlace()}function textboxSearch_Click(){$("#lotDetails").hide();$(".result-item").hide();$("#tbSearch").val().length>0&&$("#tbSearch").val()!=$("#tbSearch").attr("placeholder")&&$(".searching").show();var n=new google.maps.Geocoder,t=$("#tbSearch").val();n.geocode({address:t},function(n,t){if(t==google.maps.GeocoderStatus.OK)imp.impState.lat=n[0].geometry.location.lat(),imp.impState.lng=n[0].geometry.location.lng(),imp.impState.map.setCenter(new google.maps.LatLng(imp.impState.lat,imp.impState.lng)),imp.searchUtil.searchCombined()});fireVirtualPageViewForSearch()}function topFilterButton_Click(){$(".top-filter-item").unbind("click");$(".top-filter-item").click(function(){var n=$(this).children(".image-container");$(this).children(".image-active")!=undefined&&$(this).children(".image-active").length>0?$(n).attr("class","image-container"):$(n).attr("class","image-container image-active");fireVirtualPageViewForSearch();switch($(this).attr("id")){case"top-filter1":setFilteredResults_2();break;case"top-filter2":setFilteredResults_2();break;case"top-filter3":setFilteredResults_2()}})}function filterButton_Click(){$("#filterSection .filter-buttons .filter-buttons-inner > a").unbind("click");$("#filterSection .filter-buttons .filter-buttons-inner > a").click(function(){filterButton_ToggleActive(this);var n=$(this).attr("title");fireVirtualPageViewForSearch();setFilteredResults_2()})}function fireVirtualPageViewForSearch(){var n=$("#tbSearch").val(),t=generateSearchFilterString(),i=generateAmenityString(),r=imp.impState.opCoCode+"/mapSearch?q="+encodeURIComponent(n)+"&a="+t+"&b="+i,u={event:"VirtualPageview",virtualPageURL:r,virtualPageTitle:"map search"};dataLayer.push(u)}function generateSearchFilterString(){var n="",t=$("#filters-top-row .top-filter-item .image-active");return $(t).each(function(){n.length>0&&(n+="&");$(this).parent().attr("id")=="top-filter1"?n+="daily":$(this).parent().attr("id")=="top-filter2"?n+="promos":$(this).parent().attr("id")=="top-filter3"&&(n+="monthly")}),n}function generateAmenityString(){var n="",t=$(".filter-buttons-inner > a.active");return $(t).each(function(){n.length>0&&(n+="&");var t=encodeURIComponent($(this).attr("title"));n+=t}),n}function filterButton_ToggleActive(n){var t=$(n).children("img").attr("src").replace(".png","");$(n).attr("class")!="active"?($(n).attr("class","active"),$(n).children("img").attr("src",t+"_on.png")):($(n).removeAttr("class"),$(n).children("img").attr("src",t.replace("_on","")+".png"))}function filterButtonToggle_Click(){$("#filterSection .filter-label").unbind("click");$("#filterSection .filter-label").click(function(){$("#filterSection .filter-buttons").toggle();$("#filterSection .filter-label .hide-show-toggle").text()=="+"?($("#filterSection .filter-label .hide-show-toggle").text("-"),$("#lot-search-result-container").height($("#lot-search-result-container").height()-$(".filter-label").height())):($("#filterSection .filter-label .hide-show-toggle").text("+"),$("#lot-search-result-container").height($("#lot-search-result-container").height()+$(".filter-label").height()))})}function displayLots(n,t){var u,r,f,e,o;imp.impState.lotResults=n;imp.impState.map==undefined&&(u={zoom:imp.impState.zoom,center:new google.maps.LatLng(imp.impState.lat,imp.impState.lng),mapTypeId:google.maps.MapTypeId.ROADMAP,streetViewControl:!1},imp.impState.map=new google.maps.Map(document.getElementById(t),u),setMapScrollListener(imp.impState.map));r=null;for(key in imp.markerList)key!="user"&&imp.markerList[key].setMap(null);for(key in imp.polygonList)delete imp.polygonList[key];if($("#mobile-menu-map").is(":visible")==!1&&$("#lot-search-result-container > .result_row").remove(),clusterMarkers=[],$(n).each(function(){var t=this,s=new google.maps.LatLng(t.location.lat,t.location.lng),u=new google.maps.Marker({id:t.lotId,position:s,map:imp.impState.map,title:t.lotName,icon:imp.impState.markerUrl}),e,h;if(imp.markerList[t.lotId]=u,clusterMarkers.push(u),t.outline&&imp.impState.zoom>map_min_polygon_zoom){e=[];for(var f=0,o=t.outline,c=o.length;f<c;f++)e.push(new google.maps.LatLng(o[f].lat,o[f].lng));h=new google.maps.Polygon({paths:e,map:imp.impState.map,strokeColor:imp.impState.outlineStrokeColor,strokeOpacity:.6,strokeWeight:1,fillColor:imp.impState.outlineFillColor,fillOpacity:.35});imp.polygonList[t.lotId]=h}google.maps.event.addListener(u,"click",function(){var a,v,f,c,l,o,y,n,h,e;for(imp.impState.no_idle_search=!0,imp.impState.map.setCenter(s),a=t.branchNumber+" "+t.lotNumber,v={event:"pinClick",pinClickOpco:imp.impState.opCoCode,pinClickTitle:a,pinClickName:t.lotName},dataLayer.push(v),i=0;i<infoWinArr.length;i++)infoWinArr[i].close(),resetMarker();if(infoWinArr=[],r){r.close();try{for(key in imp.markerList)key!="user"&&imp.markerList[key].setIcon(imp.impState.markerUrl)}catch(e){}resetSearchResultItem()}try{resetMarker();imp.impState.activeMarkerIcon&&u.setIcon(imp.impState.activeMarkerIcon)}catch(e){}if($(window).width()>window_max_width)r=new google.maps.InfoWindow({maxWidth:360}),f=$("#infowindow-content"),t.lotName!=undefined&&t.lotName.length>0?($(f).find(".infowindow-heading .window-title").text(t.lotName+" - Lot #"+t.lotNumber),$(f).find(".infowindow-heading .window-title").show()):($(f).find(".infowindow-heading .window-title").text(""),$(f).find(".infowindow-heading .window-title").hide()),$(f).find(".infowindow-middle .middle-left .infowindow-address").html(t.address.address1+" "+t.address.address2+", <br/>"+t.address.city+", "+t.address.provState+"<br/> "+t.address.postalCode),t.streetViewUrl!=undefined&&t.streetViewUrl.length>0?($(f).find(".infowindow-middle .middle-right .info-window-image").attr("src",t.streetViewUrl),$(f).find(".infowindow-middle .middle-right .info-window-image").show(),$(f).find(".infowindow-middle .middle-right .noImg").hide(),url=setStreetUrl(t.streetViewUrl),$(f).find(".infowindow-middle .middle-right a#infoImageLink").attr("href",url)):($(f).find(".infowindow-middle .middle-right .info-window-image").attr("src","#"),$(f).find(".infowindow-middle .middle-right .info-window-image").hide(),$(f).find(".infowindow-middle .middle-right .noImg").html("<img src='/Content/img/city_skyline.png' />"),$(f).find(".infowindow-middle .middle-right .noImg").show()),c=$(f).find(".infowindow-features"),$(c).find("img").remove(),$(t.features).each(function(n,t){var i=t;$('<img src="'+i.icon+'" title="'+i.value+'" class="info-feature" />').appendTo($(c))}),l="https://maps.google.com/maps?saddr="+imp.impState.latLoc+","+imp.impState.lngLoc+"&daddr="+t.location.lat+","+t.location.lng+"&hl="+imp.impState.languageCode,t.address.address1.length>0&&(l="https://maps.google.com/maps?saddr="+imp.impState.latLoc+","+imp.impState.lngLoc+"&daddr="+t.address.address1+","+t.address.city+","+t.address.postalCode+"&hl="+imp.impState.languageCode),$(f).find(".infowindow-directions > a").attr("href",l),$(f).find(".infowindow-details > a").attr("href","javascript:setInfoWindowEvents_Click("+t.branchNumber+","+t.lotNumber+","+t.lotId+");"),r.setContent($(f).html()),map==undefined&&(map=imp.impState.map),r.open(map,this),infoWinArr.push(r),highlightSearchResultItem(u.id),o=$("#lot-search-result-container"),y=$("#lotID."+t.lotId),o.animate({scrollTop:y.offset().top-o.offset().top+o.scrollTop()}),google.maps.event.addListener(r,"closeclick",resetSearchResultItem),google.maps.event.addListener(r,"closeclick",resetMarker);else{if($(".col-md-8").show(),$(".col-md-8 > .result-item").remove(),n=$("#result-list-item").children(".result-item").clone(),$(n).prepend('<div class="mobile-close"><a href="javascript:void(0);">&nbsp;&nbsp;X&nbsp;&nbsp;<\/a><\/div>'),$(n).find(".lot-id").text(t.lotId),$(n).find("#lotID").attr("class",t.lotId),$(n).find(".branch-number").text(t.branchNumber),$(n).find(".lot-number").text(t.lotNumber),$(n).find(".distance-sign .distance-units").text(t.distanceUnits),$(n).find(".distance-sign .distance-value").text(t.distance),$(n).find(".distance-sign .distance-value").parent().show(),t.lotName!=undefined&&t.lotName.length>0?($(n).find(".lot-name").text(t.lotName),$(n).find(".lot-name").show()):($(n).find(".lot-name").text(""),$(n).find(".lot-name").hide()),$(n).find(".lot-address").children(".address-text").text(t.address.address1+" "+t.address.address2),$(n).find(".lot-rate"),$("#mobile-menu-container").is(":visible")&&(h=$(n).find(".result_row")),$(h).show(),$(h).unbind("click"),$(h).click(function(){imp.getDetails(t.branchNumber,t.lotNumber);setDetailsPageParam(t.branchNumber,t.lotNumber)}),$(n).find(".rate-details .lot-rate .transient-rate").remove(),t.hasTransientRates&&($(n).find(".result_row").append('<div class="hourly-rate"><\/div>'),e='<div class="transient-rate" >'+t.lowestTransientRate.value+"<\/div>",$(n).find(".rate-details .lot-rate").append(e)),$(n).find(".rate-details .monthly-rate").remove(),t.hasMonthlyRates&&($(n).find(".result_row").append('<div class="monthly-rate" style="display: none;"><\/div>'),$(n).find(".result_row .rate-details").append('<div class="monthly-rate"><\/div>'),e="",e=t.lowestMonthlyRate.label?t.lowestMonthlyRate.label+" - "+t.lowestMonthlyRate.value:t.lowestMonthlyRate.value,$(n).find(".result_row .rate-details .monthly-rate").append(e)),t.hasPromotions){for($(n).find(".result_row").append('<div class="has-promotions"><\/div>'),promoTitle="",i=0;i<t.promotions.length;i++)promoTitle=promoTitle+t.promotions[i],i+1<t.promotions.length&&(promoTitle=promoTitle+",");$(n).find(".lot-promotion").html('<img src="/Content/img/icon_sale.png" alt="promotions" title="'+promoTitle+'"/>');$(n).find(".lot-promotion").show()}else $(n).find(".lot-promotion").html("");$(".col-md-8").append($(n));$(".result_row").click(function(){imp.getDetails($(this).find(".branch-number").text(),$(this).find(".lot-number").text());setDetailsPageParam(t.branchNumber,t.lotNumber);$(".navbar-fixed-top").after($("#lotDetails"));$("#lotDetails").css("top","15px");$("#mobile-menu-map").show();$("#mobile-menu-list").hide()});$(".mobile-close a").click(function(){$(".col-md-8 > .result-item").remove();resetMarker()});$(".col-md-8 > .result-item").show();$(".lot-details").hide()}});n.length<map_max_results&&(setSearchResultItem(t),$(".too_many_results").remove())}),imp.impState.zoom<15)f=[{textColor:"#ffffff",anchor:[7,12],url:"/Content/img/"+imp.impState.opCoCode+"/icon_marker_cluster.png",width:55,height:68}],e={ignoreHidden:!0,styles:f,maxZoom:15},marker_clusterer=new MarkerClusterer(imp.impState.map,clusterMarkers,e);else if(imp.impState.zoom>=15)try{marker_clusterer.clearMarkers()}catch(s){}spinner&&spinner.stop();$(".loading").hide();$(".result_row").click(function(){$(".navbar-fixed-top").after($("#lotDetails"));$("#mobile-menu-map").hide();$("#mobile-menu-list").show()});$(".lot-details").click(function(){branchNum=$(this).parent().parent().find(".branch-number").text();lotNum=$(this).parent().parent().find(".lot-number").text();setDetailsPageParam(branchNum,lotNum);imp.getDetails(branchNum,lotNum)});n.length<map_max_results?($(".too_many_results").remove(),resetSearchResultItem(),setSearchListItem_Click()):(o='<div class="too_many_results"><span class="txt-too-many">Too many results.  Please zoom-in to narrow your search.<\/span><\/div>',$("#lot-search-result-container").html(o));setFilteredResults_2()}function setMapTitle(n){if(n.length>0){var t=$("#txtTitleMap").val().replace("[CITY]",n).replace("[OPCO]",$("#txtOpCo").val());document.title=t;setMetaTitle(t);setMetaImage(imp.impState.opCoCode.toLowerCase());setMetaUrl(window.location)}}function setMetaDesc(n){$("meta[name='description']").attr("content",n);$("meta[property='og:description']").attr("content",n);$("meta[name='twitter:description']").attr("content",n);$("meta[itemprop='description']").attr("content",n)}function setMetaTitle(n){$("meta[name='title']").attr("content",n);$("meta[property='og:title']").attr("content",n);$("meta[name='twitter:title']").attr("content",n);$("meta[itemprop='name']").attr("content",n)}function setMetaUrl(n){$("meta[property='og:url']").attr("content",n)}function setMetaImage(n){var t=imp.impState.baseUrl+"/Content/img/meta_"+n+".jpg";$("meta[property='og:image']").attr("content",t);$("meta[name='twitter:image:src']").attr("content",t);$("meta[itemprop='image']").attr("content",t)}function clearMapScrollListeners(n){google.maps.event.clearListeners(n,"idle")}function setMapScrollListener(n){n!=undefined&&google.maps.event.addListener(n,"idle",function(){var t=n.getCenter();imp.impState.lat=t.lat();imp.impState.lng=t.lng();imp.impState.zoom=n.getZoom();imp.impState.no_idle_search?imp.impState.no_idle_search=!1:imp.searchUtil.searchCombined()})}function showZeroResultMessage(n){var t=$("#result-list-item").children(".result-item");$(t).find(".lot-id").text(0);$(t).find(".branch-number").text(0);$(t).find(".lot-number").text(0);$(t).find(".distance-sign").hide();$(t).find(".lot-name").text(n);$(t).find(".lot-name").show();$(t).find(".lot-rate").hide();$(t).find(".monthly-rate").hide();$(t).find(".lot-details").hide();$(t).find(".lot-address").hide();$("#lot-search-result-container > .result_row").remove();$("#lot-search-result-container").append($(t).html())}function getURLParameter(n,t){return t=typeof t!="undefined"?t:location.search,decodeURI((RegExp(n+"=(.+?)(&|$)").exec(t)||[,null])[1])}function show_map(n){var t=n.coords.latitude,i=n.coords.longitude;user_location=new google.maps.LatLng(n.coords.latitude,n.coords.longitude);marker=new google.maps.Marker({position:user_location,map:map,icon:user_location_pin,title:$("#youAreHere").val()});map.setCenter(user_location)}function showerror(){$(".mobile-locate-error").is(":visible")||imp.searchUtil.searchCombined();$(".mobile-locate-error").html("<div class='error'>X<\/div><p>"+$("#locateError").val()+"<\/p>");$(".mobile-locate-error").css("display","block");$(".mobile-locate-error").show()}function getUserLocation(n){UsrLoc=UsrLoc||{};(UsrLoc.lat==undefined||UsrLoc.lng==undefined)&&navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){UsrLoc.lat=t.coords.latitude;UsrLoc.lng=t.coords.longitude;try{user_location=new google.maps.LatLng(UsrLoc.lat,UsrLoc.lng);marker=new google.maps.Marker({position:user_location,map:imp.impState.map,icon:user_location_pin});imp.impState.lat=UsrLoc.lat;imp.impState.lng=UsrLoc.lng;imp.impState.user_location=!0;n&&imp.impState.map.setCenter(user_location)}catch(i){user_location=new google.maps.LatLng(imp.impState.lat,imp.impState.lng)}},showerror,{timeout:5e3});(UsrLoc.lat==undefined||UsrLoc.lng==undefined)&&(imp.impState.user_location=!1,user_location=new google.maps.LatLng(imp.impState.lat,imp.impState.lng),n&&imp.impState.map.setCenter(user_location));google.maps.event.trigger(imp.impState.map,"resize")}function getUserLocation_Search(){UsrLoc=UsrLoc||{};navigator.geolocation?(navigator.geolocation.getCurrentPosition(function(n){UsrLoc.lat=n.coords.latitude;UsrLoc.lng=n.coords.longitude;try{if(user_location=new google.maps.LatLng(UsrLoc.lat,UsrLoc.lng),window.location.href.match(/latlng/)||(imp.impState.lat=UsrLoc.lat,imp.impState.lng=UsrLoc.lng),imp.impState.map!=undefined){for(var t=0;t<blueDots.length;t++)blueDots[t].setMap(null);blueDots=[];marker=new google.maps.Marker({id:"user",position:user_location,map:imp.impState.map,icon:user_location_pin});imp.impState.user_location=!0;imp.markerList.user=marker}window.location.href.match(/latlng/)||imp.impState.map.setCenter(user_location)}catch(i){user_location=new google.maps.LatLng(imp.impState.lat,imp.impState.lng)}},showerror,{timeout:5e3}),(UsrLoc.lat==undefined||UsrLoc.lng==undfined)&&(imp.impState.user_location=!1,setTheBlueDot())):setTheBlueDot()}function setInfoWindowEvents_Click(n,t){setDetailsPageParam(n,t);imp.getDetails(n,t);$(".navbar-fixed-top").after($("#lotDetails"));var i=imp.impState.opCoCode+"/lotDetail?branch="+n+"&lot="+t,r="lot details for branch "+n+" and lot "+t,u={event:"VirtualPageview",virtualPageURL:i,virtualPageTitle:r};dataLayer.push(u)}function setSearchResultItem(n){var t=$("#result-list-item").children(".result-item"),u,r;if($(t).find(".feature-id").remove(),$(t).find(".hourly-rate, .monthly-rate, .has-promotions").remove(),$(t).find(".lot-id").text(n.lotId),$(t).find("#lotID").attr("class",n.lotId),$(t).find(".branch-number").text(n.branchNumber),$(t).find(".lot-number").text(n.lotNumber),$(t).find(".distance-sign .distance-units").text(n.distanceUnits),$(t).find(".distance-sign .distance-value").text(n.distance),$(t).find(".distance-sign .distance-units").text(n.distanceUnits),$(t).find(".distance-sign .distance-value").parent().show(),n.lotName!=undefined&&n.lotName.length>0?($(t).find(".lot-name").text(n.lotName+" - Lot #"+n.lotNumber),$(t).find(".lot-name").show()):($(t).find(".lot-name").text(""),$(t).find(".lot-name").hide()),n.hasPromotions&&n.promotions){for(promoTitle="",i=0;i<n.promotions.length;i++)promoTitle=promoTitle+n.promotions[i],i+1<n.promotions.length&&(promoTitle=promoTitle+",");$(t).find(".lot-promotion").html('<img src="/Content/img/icon_sale.png" alt="promotions" title="'+promoTitle+'"/>');$(t).find(".lot-promotion").show()}else $(t).find(".lot-promotion").html("");if($(t).find(".lot-address").children(".address-text").text(n.address.address1+" "+n.address.address2),$(t).find(".lot-rate"),u=$(t).find(".lot-details"),$("#mobile-menu-container").is(":visible")==!0&&(u=$(t).find(".result_row")),$(u).show(),$(u).unbind("click"),$(u).click(function(){setDetailsPageParam(n.branchNumber,n.lotNumber);imp.getDetails(n.branchNumber,n.lotNumber)}),n.features!=undefined&&n.features.length>0&&$(n.features).each(function(){$(t).find(".result_row").append('<div class="feature-id" style="display:none" >'+this.id+"<\/div>")}),$(t).find(".rate-details .lot-rate .transient-rate").remove(),n.hasTransientRates&&($(t).find(".result_row").append('<div class="hourly-rate" style="display:none" ><\/div>'),r='<div class="transient-rate" >'+n.lowestTransientRate.value+"<\/div>",$(t).find(".rate-details .lot-rate").append(r)),n.hasMonthlyRates&&($(t).find(".result_row").append('<div class="monthly-rate" style="display:none" ><\/div>'),$(t).find(".result_row .rate-details").append('<div class="monthly-rate"><\/div>'),r="",r=n.lowestMonthlyRate.label?n.lowestMonthlyRate.label+" - "+n.lowestMonthlyRate.value:n.lowestMonthlyRate.value,$(t).find(".result_row .rate-details .monthly-rate").append(r)),n.hasPromotions){for($(t).find(".result_row").append('<div class="has-promotions" style="display:none" ><\/div>'),promoTitle="",i=0;i<n.promotions.length;i++)promoTitle=promoTitle+n.promotions[i],i+1<n.promotions.length&&(promoTitle=promoTitle+",");$(t).find(".lot-promotion").html('<img src="/Content/img/icon_sale.png" alt="promotions" title="'+promoTitle+'"/>');$(t).find(".lot-promotion").show()}else $(t).find(".lot-promotion").html("");$("#lot-search-result-container").append($(t).html())}function setSearchListItem_Click(){$(".result_row .item-text .lot-name, .result_row .item-text .lot-address").unbind("click");$(".result_row .item-text .lot-name, .result_row .item-text .lot-address").click(function(){google.maps.event.trigger(imp.markerList[parseInt($(this).parent().parent().parent().find(".lot-id").text())],"click");highlightSearchResultItem(parseInt($(this).parent().parent().parent().find(".lot-id").text()));$(window).width()<640&&($("#lot-search-result-container").hide(),$("#mobile-menu-map").hide(),$("#mobile-menu-list").show(),$("#mapCanvas").show())})}function highlightSearchResultItem(n){$(".lot-id").each(function(){n==parseInt($(this).text())&&$(this).parent().addClass("selected")})}function resetSearchResultItem(){$("#lot-search-result-container").children().each(function(){$(this).removeClass("selected")})}function resetMarker(){for(key in imp.markerList)key!="user"&&imp.markerList[key].setIcon(imp.impState.markerUrl)}function shareControls_Click(){$("#top-share-container .share-button").unbind("click");$("#top-share-container .share-button").click(function(){var t="",n,i,r,u,f,e,o;t=$(location).attr("href").indexOf("details")>-1?$(location).attr("href"):imp.impState.baseUrl+imp.impState.opCoCode+"/"+imp.impState.languageCode+"?latlng="+imp.impState.lat+","+imp.impState.lng+"&zoom="+imp.impState.map.getZoom();switch($(this).attr("id")){case"share-mail":pushGAEvent("click-mail");i="";$(".detailsLotName").html()!=undefined?(dash=$(".detailsLotName").html().lastIndexOf("-"),n=$(".detailsLotName").html().substring(0,dash-1),i=$(".detailsAddress").text()+"%0D%0D"):(opCo=$(".navbar-brand").attr("href"),opCo.indexOf("imp")>-1?n="Impark":opCo.indexOf("adv")>-1?n="Advanced Parking":opCo.indexOf("met")>-1?n="Metro Parking":opCo.indexOf("ccp")>-1&&(n="City Center Parking"));n=document.title;r=$("meta[name='description']").attr("content")+"  ";u="subject="+n+"&body="+r+encodeURIComponent(t);$(this).children("a").attr("href","mailto:?"+u);break;case"share-print":pushGAEvent("click-print");window.location.href=t;window.print();break;case"share-facebook":pushGAEvent("click-facebook");f="https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t);window.open(f,"_blank");break;case"share-twitter":pushGAEvent("click-twitter");e="https://twitter.com/home?status="+encodeURIComponent(t);window.open(e,"_blank");break;case"share-googleplus":pushGAEvent("click-googleplus");o="https://plus.google.com/share?url="+encodeURIComponent(t);window.open(o,"_blank");break;default:pushGAEvent("click-unknown")}})}function pushGAEvent(n){var t={event:n};dataLayer.push(t)}function bindMobileMenuControls_Click(){$(".mobile-menu-button").unbind("click");$(".mobile-menu-button").click(function(){switch($(this).attr("id")){case"mobile-menu-map":$("#mobile-menu-loc").show();$("#mobile-menu-loc-inactive").hide();$("#mobile-menu-map").hide();$("#mobile-menu-list").show();$("#lot-search-result-container").slideUp();$("#mapCanvas").show();$("#lotDetails").hide();$(".container.body-content").show();$(".col-md-8").show();google.maps.event.trigger(imp.impState.map,"resize");break;case"mobile-menu-list":$("#mobile-menu-loc").hide();$("#mobile-menu-loc-inactive").show();$(".col-md-8 > .result-item").remove();$("#mobile-menu-map").show();$("#mobile-menu-list").hide();$("#lot-search-result-container").height($(document).height());$("#lot-search-result-container").slideDown();$("#mapCanvas").hide();$("#lotDetails").hide();$(".container.body-content").show();$(".lot-details").hide();$(".lot-details-mobile").show();$(".col-md-8").hide();$("#lot-search-result-container").width($(document).width()-15);$(".result_row.selected").removeClass("selected");break;case"mobile-menu-search":$(this).attr("class")=="mobile-menu-button active"?($(this).attr("class","mobile-menu-button"),$(".col-md-4 .form-group").slideUp(),$("#lotDetails").is(":visible")&&($(".container.body-content").hide(),$("#lotDetails").css("top","15px"))):($(this).attr("class","mobile-menu-button active"),$(".col-md-4 .form-group").slideDown(),$("#lotDetails").is(":visible")&&($(".container.body-content").show(),$("#lotDetails").css("top","65px")));$("html, body").animate({scrollTop:0},"slow");break;case"mobile-menu-loc":$("#lot-search-result-container").hide();$("#mobile-menu-list").show();$("#mobile-menu-map").hide();$("#lotDetails").hide();$("#container.body-content").show();$("#mapCanvas").show();$(".col-md-8").show();getUserLocation(!0)}})}function defaultSearchButton(){$(document).keypress(function(n){n.which==13&&$("#btnSearch").click()})}function setFilterSelections(){var t=getURLParameter("daily"),i=getURLParameter("promo"),r=getURLParameter("monthly"),n;t!="null"&&$("#top-filter1").children(".image-container").attr("class","image-container image-active");i!="null"&&$("#top-filter2").children(".image-container").attr("class","image-container image-active");r!="null"&&$("#top-filter3").children(".image-container").attr("class","image-container image-active");n=getURLParameter("filters");n!="null"&&n.length>0&&$(n.split(",")).each(function(){$(".filter-buttons > a#"+this.toString()).attr("class","active")});setFilteredResults_2()}function resetFilters(){var n="";$(".filter-buttons a").each(function(){n=$(this).children("img").attr("src");n&&n.indexOf(".png")>-1&&(n=n.replace(".png",""),n.indexOf("_on")>-1&&($(this).removeAttr("class"),$(this).children("img").attr("src",n.replace("_on","")+".png")))});$("#filters-top-row .top-filter-item .image-container").each(function(){$(this).removeClass("image-active")});$("#lot-search-result-container").show();$("#lot-search-result-container .result_row").show();for(key in imp.markerList)if(imp.markerList.hasOwnProperty(key))try{imp.markerList[key].setVisible(!0)}catch(t){}}function setFilteredResults_2(){var n=$("#filters-top-row .top-filter-item .image-active"),t=$(".filter-buttons-inner > a.active"),i=$(".feature-id"),r=$(".result_row");$(".result_row").show();$(".mobile-close").show();for(key in imp.markerList){if(imp.markerList.hasOwnProperty(key))try{imp.markerList[key].setMap(imp.impState.map);imp.markerList[key].setVisible(!0)}catch(u){}if(imp.polygonList.hasOwnProperty(key))try{imp.polygonList[key].setVisible(!0)}catch(u){}}(t.length>0||n.length>0)&&$(n).each(function(){var n;if($(this).parent().attr("id")=="top-filter1")for(n=0;n<imp.impState.lotResults.length;n++)if(!imp.impState.lotResults[n].hasTransientRates){if($(".result_row #lotID."+imp.impState.lotResults[n].lotId).parent().hide(),imp.markerList[imp.impState.lotResults[n].lotId].setVisible(!1),imp.markerList[imp.impState.lotResults[n].lotId].setMap(null),imp.polygonList.hasOwnProperty(imp.impState.lotResults[n].lotId))try{imp.polygonList[imp.impState.lotResults[n].lotId].setVisible(!1)}catch(t){}marker_clusterer&&(marker_clusterer.removeMarker(imp.markerList[imp.impState.lotResults[n].lotId]),marker_clusterer.repaint())}if($(this).parent().attr("id")=="top-filter3")for(n=0;n<imp.impState.lotResults.length;n++)if(!imp.impState.lotResults[n].hasMonthlyRates){if($(".result_row #lotID."+imp.impState.lotResults[n].lotId).parent().hide(),imp.markerList[imp.impState.lotResults[n].lotId].setVisible(!1),imp.markerList[imp.impState.lotResults[n].lotId].setMap(null),imp.polygonList.hasOwnProperty(imp.impState.lotResults[n].lotId))try{imp.polygonList[imp.impState.lotResults[n].lotId].setVisible(!1)}catch(t){}marker_clusterer&&(marker_clusterer.removeMarker(imp.markerList[imp.impState.lotResults[n].lotId]),marker_clusterer.repaint())}if($(this).parent().attr("id")=="top-filter2")for(n=0;n<imp.impState.lotResults.length;n++)if(!imp.impState.lotResults[n].hasPromotions){if($(".result_row #lotID."+imp.impState.lotResults[n].lotId).parent().hide(),imp.markerList[imp.impState.lotResults[n].lotId].setVisible(!1),imp.markerList[imp.impState.lotResults[n].lotId].setMap(null),imp.polygonList.hasOwnProperty(imp.impState.lotResults[n].lotId))try{imp.polygonList[imp.impState.lotResults[n].lotId].setVisible(!1)}catch(t){}marker_clusterer&&(marker_clusterer.removeMarker(imp.markerList[imp.impState.lotResults[n].lotId]),marker_clusterer.repaint())}});$(t).each(function(){for(var u=parseInt($(this).attr("id")),i,r,t,n=0;n<imp.impState.lotResults.length;n++){for(i=!1,r=imp.impState.lotResults[n].features,t=0;t<r.length;t++)r[t].id==u&&(i=!0);if(!i){if($(".result_row #lotID."+imp.impState.lotResults[n].lotId).parent().hide(),imp.markerList[imp.impState.lotResults[n].lotId].setVisible(!1),imp.markerList[imp.impState.lotResults[n].lotId].setMap(null),imp.polygonList.hasOwnProperty(imp.impState.lotResults[n].lotId))try{imp.polygonList[imp.impState.lotResults[n].lotId].setVisible(!1)}catch(f){}marker_clusterer&&(marker_clusterer.removeMarker(imp.markerList[imp.impState.lotResults[n].lotId]),marker_clusterer.repaint())}}});google.maps.event.trigger(imp.impState.map,"resize")}function setFilteredResults(){var t=$("#filters-top-row .top-filter-item .image-active"),n=$(".filter-buttons-inner > a.active"),i=$(".feature-id");if(n.length>0||t.length>0){$("#lot-search-result-container .result_row").hide();for(key in imp.markerList)if(key!=="user"){if(imp.markerList.hasOwnProperty(key))try{imp.markerList[key].setVisible(!1)}catch(r){}if(imp.polygonList.hasOwnProperty(key))try{imp.polygonList[key].setVisible(!1)}catch(r){}}}else{$("#lot-search-result-container .result_row").show();for(key in imp.markerList){if(imp.markerList.hasOwnProperty(key))try{imp.markerList[key].setVisible(!0)}catch(r){}if(imp.polygonList.hasOwnProperty(key))try{imp.polygonList[key].setVisible(!1)}catch(r){}}}$(i).each(function(){for(var i=this,r=$(this).contents().text(),t=0;t<n.length;t++)r==$(n.get(t)).attr("id")&&($(i).parent().show(),imp.markerList[parseInt($(i).parent().find(".lot-id").text())].setVisible(!0))});$(t).each(function(){switch($(this).parent().attr("id")){case"top-filter1":$(".hourly-rate").parent().show();topFilterSelectMarkers($(".hourly-rate"));break;case"top-filter2":$(".has-promotions").parent().show();topFilterSelectMarkers($(".has-promotions"));break;case"top-filter3":$(".monthly-rate").parent().parent().show();topFilterSelectMarkers($(".monthly-rate"))}})}function topFilterSelectMarkers(n){$(n).each(function(){var n=parseInt($(this).parent().find(".lot-id").text());isNaN(n)&&(n=parseInt($(this).parent().parent().find(".lot-id").text()));imp.markerList[n].setVisible(!0)})}function setDetailsPageParam(n,t){var i;window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));window.location.hash.match(/details/)==null?(i=window.location.href.substring(window.location.origin.length),window.location.hash="details="+n+","+t):(i=window.location.href.substring(window.location.origin.length,window.location.href.indexOf("details")-1),window.location.hash="")}function setGoogleReviewsLnk(){var n,t,i;try{imp.impState.googleReferenceId.length>0?(n=imp.impState.googleReferenceId,t={reference:n},map==undefined&&(map=imp.impState.map),i=new google.maps.places.PlacesService(map),i.getDetails(t,googleReviewsCallback)):($(".detailsRight .lnkReadAllReviews").hide(),$(".reviewsBlock").hide(),$(".detailsReviewsTitle").hide())}catch(r){}}function googleReviewsCallback(n,t){var o,s,h,f,r,u,i,e;if(t==google.maps.places.PlacesServiceStatus.OK){o=0;try{s=$(".reviewsBlock .reviewItem");for(reviewid in n.reviews){if(h=n.reviews[reviewid],f=$(s).clone(),$(f).find(".title").text(n.reviews[reviewid].author_name),$(f).find(".reviewText").text(n.reviews[reviewid].text),r=n.reviews[reviewid].rating,$(f).find(".ratings").children("img").remove(),r.toString().indexOf(".")>0){for(u=parseInt(r.split["."][0]),i=0;i<u;i++)$(f).find(".ratings").append('<img src="/Content/img/reviews_fullstar.png" />');$(f).find(".ratings").append('<img src="/Content/img/reviews_halfstar.png" />')}else for(u=parseInt(r),i=0;i<u;i++)$(f).find(".ratings").append('<img src="/Content/img/reviews_fullstar.png" />');if(o+=r,Math.ceil(r)<5)for(e=5-Math.ceil(r),i=0;i<e;i++)$(f).find(".ratings").append('<img src="/Content/img/reviews_emptystar.png" />');$(".reviewsBlock").append($(f));$(".detailsReviewsTitle").show()}if(n.url.length>0&&typeof n.reviews!="undefined"&&$("#mobile-menu-container").is(":visible")==!1?($(".detailsRight .lnkReadAllReviews").attr("href",n.url),$(".detailsRight .lnkReadAllReviews").show()):n.url.length>0&&$("#mobile-menu-container").is(":visible")==!1?($(".detailsRight a.lnkWriteReviews").attr("href",n.url),$(".detailsRight a.lnkWriteReviews").show(),$(".detailsRight .detailsReviewsTitle").show()):typeof n.reviews=="undefined"&&n.url.length>0&&$("#mobile-menu-container").is(":visible")==!0&&($(".detailsRight a.lnkWriteReviews").attr("href",n.url),$(".detailsRight a.lnkWriteReviews").show()),$("div.mobileReviews .reviewItem .ratings").children("img").remove(),$("div.mobileReviews .reviewItem .reviewsCount").text(n.user_ratings_total),r=o/n.reviews.length,r.toString().indexOf(".")>0){for(u=parseInt(r.split(".")[0]),i=0;i<u;i++)$(".mobileReviews").find(".ratings").append('<img src="/Content/img/reviews_fullstar.png" />');$(".mobileReviews").find(".ratings").append('<img src="/Content/img/reviews_halfstar.png" />')}else for(u=parseInt(r),i=0;i<u;i++)$(".mobileReviews").find(".ratings").append('<img src="/Content/img/reviews_fullstar.png" />');if(Math.ceil(r)<5)for(e=5-Math.ceil(r),i=0;i<e;i++)$(".mobileReviews").find(".ratings").append('<img src="/Content/img/reviews_emptystar.png" />');n.url.length==0?($(".detailsRight .lnkReadAllReviews").hide(),$(".detailsRight .detailsReviewsTitle").hide(),$(".mobileReviews").hide()):$("#mobile-menu-container").is(":visible")&&($(".mobileReviews").show(),$(".detailsRight .lnkReadAllReviews").hide())}catch(c){}}else $(".detailsRight .lnkReadAllReviews").hide(),$(".detailsRight .detailsReviewsTitle").hide(),$(".mobileReviews").hide()}function setStreetUrl(n){var t=parseURL("location",n,"&");t=t.replace("(","").replace(")","").replace(" ","");var i=parseURL("pitch",n,"&"),r=parseURL("heading",n,"&"),u="&cbp=12,0,0,0,0";return i&&(u="&cbp=12,0,0,0,"+Math.round(i)),r&&(u="&cbp=12,"+Math.round(r)+",0,0,0"),i&&r&&(u="&cbp=12,"+Math.round(r)+",0,0,"+Math.round(i)),"https://maps.google.com?q="+t+"&cbll="+t+"&layer=c&output=svembed"+u}function parseURL(n,t,i){for(var f=t.split(i),u,r=0;r<f.length;r++)if(u=f[r].split("="),decodeURIComponent(u[0])==n)return decodeURIComponent(u[1])}var imp;MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png";MarkerClusterer.prototype.extend=function(n,t){return function(n){for(var t in n.prototype)this.prototype[t]=n.prototype[t];return this}.apply(n,[t])};MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var n=0,t;t=this.sizes[n];n++)this.styles_.push({url:this.imagePath_+(n+1)+"."+this.imageExtension_,height:t,width:t})};MarkerClusterer.prototype.fitMapToMarkers=function(){for(var r=this.getMarkers(),t=new google.maps.LatLngBounds,i,n=0;i=r[n];n++)t.extend(i.getPosition());this.map_.fitBounds(t)};MarkerClusterer.prototype.setStyles=function(n){this.styles_=n};MarkerClusterer.prototype.getStyles=function(){return this.styles_};MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_};MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_};MarkerClusterer.prototype.getMarkers=function(){return this.markers_};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length};MarkerClusterer.prototype.setMaxZoom=function(n){this.maxZoom_=n};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_};MarkerClusterer.prototype.calculator_=function(n,t){for(var i=0,u=n.length,r=u;r!==0;)r=parseInt(r/10,10),i++;return i=Math.min(i,t),{text:u,index:i}};MarkerClusterer.prototype.setCalculator=function(n){this.calculator_=n};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_};MarkerClusterer.prototype.addMarkers=function(n,t){var r,i;if(n.length)for(r=0;i=n[r];r++)this.pushMarkerTo_(i);else if(Object.keys(n).length)for(i in n)this.pushMarkerTo_(n[i]);t||this.redraw()};MarkerClusterer.prototype.pushMarkerTo_=function(n){if(n.isAdded=!1,n.draggable){var t=this;google.maps.event.addListener(n,"dragend",function(){n.isAdded=!1;t.repaint()})}this.markers_.push(n)};MarkerClusterer.prototype.addMarker=function(n,t){this.pushMarkerTo_(n);t||this.redraw()};MarkerClusterer.prototype.removeMarker_=function(n){var t=-1,i,r;if(this.markers_.indexOf)t=this.markers_.indexOf(n);else for(i=0;r=this.markers_[i];i++)if(r==n){t=i;break}return t==-1?!1:(n.setMap(null),this.markers_.splice(t,1),!0)};MarkerClusterer.prototype.removeMarker=function(n,t){var i=this.removeMarker_(n);return!t&&i?(this.resetViewport(),this.redraw(),!0):!1};MarkerClusterer.prototype.removeMarkers=function(n,t){for(var i=!1,u,f,r=0;u=n[r];r++)f=this.removeMarker_(u),i=i||f;if(!t&&i)return this.resetViewport(),this.redraw(),!0};MarkerClusterer.prototype.setReady_=function(n){this.ready_||(this.ready_=n,this.createClusters_())};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length};MarkerClusterer.prototype.getMap=function(){return this.map_};MarkerClusterer.prototype.setMap=function(n){this.map_=n};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_};MarkerClusterer.prototype.setGridSize=function(n){this.gridSize_=n};MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_};MarkerClusterer.prototype.setMinClusterSize=function(n){this.minClusterSize_=n};MarkerClusterer.prototype.getExtendedBounds=function(n){var t=this.getProjection(),e=new google.maps.LatLng(n.getNorthEast().lat(),n.getNorthEast().lng()),o=new google.maps.LatLng(n.getSouthWest().lat(),n.getSouthWest().lng()),r=t.fromLatLngToDivPixel(e),i,u,f;return r.x+=this.gridSize_,r.y-=this.gridSize_,i=t.fromLatLngToDivPixel(o),i.x-=this.gridSize_,i.y+=this.gridSize_,u=t.fromDivPixelToLatLng(r),f=t.fromDivPixelToLatLng(i),n.extend(u),n.extend(f),n};MarkerClusterer.prototype.isMarkerInBounds_=function(n,t){return t.contains(n.getPosition())};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0);this.markers_=[]};MarkerClusterer.prototype.resetViewport=function(n){for(var r,i,t=0;r=this.clusters_[t];t++)r.remove();for(t=0;i=this.markers_[t];t++)i.isAdded=!1,n&&i.setMap(null);this.clusters_=[]};MarkerClusterer.prototype.repaint=function(){var n=this.clusters_.slice();this.clusters_.length=0;this.resetViewport();this.redraw();window.setTimeout(function(){for(var t=0,i;i=n[t];t++)i.remove()},0)};MarkerClusterer.prototype.redraw=function(){this.createClusters_()};MarkerClusterer.prototype.distanceBetweenPoints_=function(n,t){if(!n||!t)return 0;var i=(t.lat()-n.lat())*Math.PI/180,r=(t.lng()-n.lng())*Math.PI/180,u=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(r/2)*Math.sin(r/2),f=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u));return 6371*f};MarkerClusterer.prototype.addToClosestCluster_=function(n){for(var e=4e4,i=null,o=n.getPosition(),u,f,t,r=0;t=this.clusters_[r];r++)u=t.getCenter(),u&&(f=this.distanceBetweenPoints_(u,n.getPosition()),f<e&&(e=f,i=t));i&&i.isMarkerInClusterBounds(n)?i.addMarker(n):(t=new Cluster(this),t.addMarker(n),this.clusters_.push(t))};MarkerClusterer.prototype.createClusters_=function(){var i,r,t,n;if(this.ready_)for(i=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),r=this.getExtendedBounds(i),t=0;n=this.markers_[t];t++)!n.isAdded&&this.isMarkerInBounds_(n,r)&&this.addToClosestCluster_(n)};Cluster.prototype.isMarkerAlreadyAdded=function(n){if(this.markers_.indexOf)return this.markers_.indexOf(n)!=-1;for(var t=0,i;i=this.markers_[t];t++)if(i==n)return!0;return!1};Cluster.prototype.addMarker=function(n){var t,r;if(this.isMarkerAlreadyAdded(n))return!1;if(this.center_){if(this.averageCenter_){var i=this.markers_.length+1,u=(this.center_.lat()*(i-1)+n.getPosition().lat())/i,f=(this.center_.lng()*(i-1)+n.getPosition().lng())/i;this.center_=new google.maps.LatLng(u,f);this.calculateBounds_()}}else this.center_=n.getPosition(),this.calculateBounds_();if(n.isAdded=!0,this.markers_.push(n),t=this.markers_.length,t<this.minClusterSize_&&n.getMap()!=this.map_&&n.setMap(this.map_),t==this.minClusterSize_)for(r=0;r<t;r++)this.markers_[r].setMap(null);return t>=this.minClusterSize_&&n.setMap(null),this.updateIcon(),!0};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_};Cluster.prototype.getBounds=function(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),i,n=0;i=r[n];n++)t.extend(i.getPosition());return t};Cluster.prototype.remove=function(){this.clusterIcon_.remove();this.markers_.length=0;delete this.markers_};Cluster.prototype.getSize=function(){return this.markers_.length};Cluster.prototype.getMarkers=function(){return this.markers_};Cluster.prototype.getCenter=function(){return this.center_};Cluster.prototype.calculateBounds_=function(){var n=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(n)};Cluster.prototype.isMarkerInClusterBounds=function(n){return this.bounds_.contains(n.getPosition())};Cluster.prototype.getMap=function(){return this.map_};Cluster.prototype.updateIcon=function(){var f=this.map_.getZoom(),t=this.markerClusterer_.getMaxZoom(),n,i,r,u;if(t&&f>t){for(n=0;i=this.markers_[n];n++)i.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}r=this.markerClusterer_.getStyles().length;u=this.markerClusterer_.getCalculator()(this.markers_,r);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.setSums(u);this.clusterIcon_.show()};ClusterIcon.prototype.triggerClusterClick=function(){var n=this.cluster_.getMarkerClusterer();google.maps.event.trigger(n,"clusterclick",this.cluster_);n.isZoomOnClick()&&this.map_.fitBounds(this.cluster_.getBounds())};ClusterIcon.prototype.onAdd=function(){var n,t,i;this.div_=document.createElement("DIV");this.visible_&&(n=this.getPosFromLatLng_(this.center_),this.div_.style.cssText=this.createCss(n),this.div_.innerHTML=this.sums_.text);t=this.getPanes();t.overlayMouseTarget.appendChild(this.div_);i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})};ClusterIcon.prototype.getPosFromLatLng_=function(n){var t=this.getProjection().fromLatLngToDivPixel(n);return t.x-=parseInt(this.width_/2,10),t.y-=parseInt(this.height_/2,10),t};ClusterIcon.prototype.draw=function(){if(this.visible_){var n=this.getPosFromLatLng_(this.center_);this.div_.style.top=n.y+"px";this.div_.style.left=n.x+"px"}};ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none");this.visible_=!1};ClusterIcon.prototype.show=function(){if(this.div_){var n=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(n);this.div_.style.display=""}this.visible_=!0};ClusterIcon.prototype.remove=function(){this.setMap(null)};ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)};ClusterIcon.prototype.setSums=function(n){this.sums_=n;this.text_=n.text;this.index_=n.index;this.div_&&(this.div_.innerHTML=n.text);this.useStyle()};ClusterIcon.prototype.useStyle=function(){var t=Math.max(0,this.sums_.index-1),n;t=Math.min(this.styles_.length-1,t);n=this.styles_[t];this.url_=n.url;this.height_=n.height;this.width_=n.width;this.textColor_=n.textColor;this.anchor_=n.anchor;this.textSize_=n.textSize;this.backgroundPosition_=n.backgroundPosition};ClusterIcon.prototype.setCenter=function(n){this.center_=n};ClusterIcon.prototype.createCss=function(n){var t=[],i,r,u;return t.push("background-image:url("+this.url_+");"),i=this.backgroundPosition_?this.backgroundPosition_:"0 0",t.push("background-position:"+i+"; background-repeat: no-repeat;"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?t.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top: 5px;"):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?t.push("padding-left: 16px; width:"+(this.width_-this.anchor_[1])+"px;"):t.push("width:"+this.width_+"px; text-align:center;")):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;"),r=this.textColor_?this.textColor_:"black",u=this.textSize_?this.textSize_:11,t.push("cursor:pointer; top:"+n.y+"px; left:"+n.x+"px; color:"+r+"; position:absolute; font-size:"+u+'px; font-family:"Open Sans", sans-serif; font-weight:300; text-align: center;'),t.join("")};window.MarkerClusterer=MarkerClusterer;MarkerClusterer.prototype.addMarker=MarkerClusterer.prototype.addMarker;MarkerClusterer.prototype.addMarkers=MarkerClusterer.prototype.addMarkers;MarkerClusterer.prototype.clearMarkers=MarkerClusterer.prototype.clearMarkers;MarkerClusterer.prototype.fitMapToMarkers=MarkerClusterer.prototype.fitMapToMarkers;MarkerClusterer.prototype.getCalculator=MarkerClusterer.prototype.getCalculator;MarkerClusterer.prototype.getGridSize=MarkerClusterer.prototype.getGridSize;MarkerClusterer.prototype.getExtendedBounds=MarkerClusterer.prototype.getExtendedBounds;MarkerClusterer.prototype.getMap=MarkerClusterer.prototype.getMap;MarkerClusterer.prototype.getMarkers=MarkerClusterer.prototype.getMarkers;MarkerClusterer.prototype.getMaxZoom=MarkerClusterer.prototype.getMaxZoom;MarkerClusterer.prototype.getStyles=MarkerClusterer.prototype.getStyles;MarkerClusterer.prototype.getTotalClusters=MarkerClusterer.prototype.getTotalClusters;MarkerClusterer.prototype.getTotalMarkers=MarkerClusterer.prototype.getTotalMarkers;MarkerClusterer.prototype.redraw=MarkerClusterer.prototype.redraw;MarkerClusterer.prototype.removeMarker=MarkerClusterer.prototype.removeMarker;MarkerClusterer.prototype.removeMarkers=MarkerClusterer.prototype.removeMarkers;MarkerClusterer.prototype.resetViewport=MarkerClusterer.prototype.resetViewport;MarkerClusterer.prototype.repaint=MarkerClusterer.prototype.repaint;MarkerClusterer.prototype.setCalculator=MarkerClusterer.prototype.setCalculator;MarkerClusterer.prototype.setGridSize=MarkerClusterer.prototype.setGridSize;MarkerClusterer.prototype.setMaxZoom=MarkerClusterer.prototype.setMaxZoom;MarkerClusterer.prototype.onAdd=MarkerClusterer.prototype.onAdd;MarkerClusterer.prototype.draw=MarkerClusterer.prototype.draw;Cluster.prototype.getCenter=Cluster.prototype.getCenter;Cluster.prototype.getSize=Cluster.prototype.getSize;Cluster.prototype.getMarkers=Cluster.prototype.getMarkers;ClusterIcon.prototype.onAdd=ClusterIcon.prototype.onAdd;ClusterIcon.prototype.draw=ClusterIcon.prototype.draw;ClusterIcon.prototype.onRemove=ClusterIcon.prototype.onRemove;Object.keys=Object.keys||function(n){var i=[],t;for(t in n)n.hasOwnProperty(t)&&i.push(t);return i};var autocomplete,placeSearch,map,map_min_polygon_zoom=16,map_max_results=120,map_container_offset=20,arrMarkers={},user_location_circle,window_max_width=640,UsrLoc={},marker_clusterer,clusterMarkers=[],user_location_pin=imp?imp.impState.currentLocationIcon:"null",infoWinArr=[],blueDots=[];Object.size=function(n){var t=0,i;for(i in n)n.hasOwnProperty(i)&&t++;return t};$(document).ready(function(){"use strict";if(imp.markerList={},imp.polygonList={},initialize(),imp.impState.hasErrors?alert(imp.impState.errors):getURLParameter("latlng")!="null"?(imp.searchUtil.searchCombined(),setTheBlueDot()):imp.searchUtil.searchCombined(),window.location.hash.match(/details/)!=null){var t=window.location.hash,n=window.location.hash.substring(window.location.hash.indexOf("=")+1);n.length>1&&(imp.getDetails(n.split(",")[0],n.split(",")[1]),$(".navbar-fixed-top").after($("#lotDetails")))}window.onresize=windowResizeEvents;attachClickEvents()});imp=imp||{};imp.searchUtil=function(){"use strict";var n=function(){$.ajax({type:"GET",url:imp.impState.baseUrl+"api/lots/"+imp.impState.opCoCode+"/"+imp.impState.languageCode,data:{latLoc:imp.impState.latLoc,lngLoc:imp.impState.lngLoc,latCenter:imp.impState.lat,lngCenter:imp.impState.lng,csr:imp.impState.csr,branchName:imp.impState.branchName},dataType:"json"}).done(function(n){n.length>0&&(setMapTitle(n[0].branchName),$("#lotStore").attr("value",n[0].branchName));displayLots(n,"mapCanvas");$(".searching").hide();$(".col-md-8").show()}).fail(function(n,t){alert("Request failed:"+t)})},t=function(){$(".searching").show();$.ajax({type:"GET",url:imp.impState.baseUrl+"api/lots/"+imp.impState.opCoCode+"/"+imp.impState.languageCode,data:{latLoc:imp.impState.latLoc,lngLoc:imp.impState.lngLoc,latMin:imp.impState.latMin,lngMin:imp.impState.lngMin,latMax:imp.impState.latMax,lngMax:imp.impState.lngMax,csr:imp.impState.csr,branchName:imp.impState.branchName},dataType:"json"}).done(function(n){$(".searching").hide();n.length>0&&(setMapTitle(n[0].branchName),$("#lotStore").attr("value",n[0].branchName));displayLots(n,"mapCanvas");$(".searching").hide()}).fail(function(n,t){alert("Request failed:"+t)})},i=function(){var i=imp.impState.map,t,n;UsrLoc===undefined||UsrLoc.lat===undefined?(t=i.getCenter(),imp.impState.latLoc=t.lat(),imp.impState.lngLoc=t.lng()):(imp.impState.latLoc=UsrLoc.lat,imp.impState.lngLoc=UsrLoc.lng);n=i.getBounds();n===undefined?imp.searchUtil.search():(imp.impState.latMax=n.getNorthEast().lat(),imp.impState.lngMax=n.getNorthEast().lng(),imp.impState.latMin=n.getSouthWest().lat(),imp.impState.lngMin=n.getSouthWest().lng(),imp.searchUtil.searchBoundingBox())};return{search:n,searchBoundingBox:t,searchCombined:i}}();imp.getDetails=function(n,t){var i=imp.impState.baseUrl+imp.impState.opCoCode+"/"+imp.impState.languageCode+"/details/"+n+"/"+t+"?csr="+imp.impState.csr;$("#lotDetails").load(i,function(i,r,u){if(r=="error"){alert(u.statusText);return}$("#lotDetails").show();$(".body-content.container").hide();$("#close-details-link").click(function(){$("#lotDetails").hide();$(".body-content.container").show();setDetailsPageParam(n,t);$("#mobile-menu-list").is(":visible")?($("#mobile-menu-map").show(),$("#mobile-menu-list").hide()):($("#mobile-menu-map").hide(),$("#mobile-menu-list").show());google.maps.event.trigger(imp.impState.map,"resize");setMapTitle($("#lotStore").attr("value"))});setGoogleReviewsLnk();$("div#lotDetails").scrollTop(0)})};$(".mobile-locate-error").click(function(){$(this).hide()});$(".ssl-3-alert").click(function(){$(this).hide()});$(function(){$(".infowindow-details a").click(function(){return history.pushState(null,null,this.href),!1});$(window).bind("popstate",function(){var n=history.location||document.location})}),function(n){function ot(){}function r(n,i,u){if(n&&!i){var o=r(),h=o._pathname,v=o._protocol;n=/^(?:[\w0-9]+\:)?\/\//.test(n)?n.indexOf("/")===0?v+n:n:v+"//"+o._host+(n.indexOf("/")===0?n:n.indexOf("?")===0?h+n:n.indexOf("#")===0?h+o._search+n:h.replace(/[^\/]+$/g,"")+n)}else n=i?n:t.href,(!s||u)&&(n=n.replace(/^[^#]*/,"")||"#",n=t.protocol+"//"+t.host+f.basepath+n.replace(new RegExp("^#[/]?(?:"+f.type+")?"),""));vt.href=n;var e=/(?:([\w0-9]+:))?(?:\/\/(?:[^@]*@)?([^\/:\?#]+)(?::([0-9]+))?)?([^\?#]*)(?:(\?[^#]+)|\?)?(?:(#.*))?/.exec(vt.href),y=e[2]+(e[3]?":"+e[3]:""),c=e[4]||"/",l=e[5]||"",a=e[6]==="#"?"":e[6]||"",p=c+l+a,w=c.replace(new RegExp("^"+f.basepath,"i"),f.type)+l;return{_href:e[1]+"//"+y+p,_protocol:e[1],_host:y,_hostname:e[2],_port:e[3]||"",_pathname:c,_search:l,_hash:a,_relative:p,_nohash:w,_special:w+a}}function ti(n){var r="",f;g?r+=g.getItem(it):(f=u.cookie.split(it+"="),f.length>1&&(r+=f.pop().split(";").shift()||"null"));try{h=n.parse(r)||{}}catch(e){h={}}v(a+"unload",function(){if(g)g.setItem(it,n.stringify(h));else{var r={};(r[t.href]=i.state)&&(u.cookie=it+"="+n.stringify(r))}},!1)}function w(t,i,r,u){var c,f,s;r=r||{set:ot};var e=!r.set,o=!r.get,h={configurable:!0,set:function(){e=1},get:function(){o=1}};try{b(t,i,h);t[i]=t[i];b(t,i,r)}catch(l){}if(!e||!o)if(t.__defineGetter__&&(t.__defineGetter__(i,h.get),t.__defineSetter__(i,h.set),t[i]=t[i],r.get&&t.__defineGetter__(i,r.get),r.set&&t.__defineSetter__(i,r.set)),e&&o||t!==n){if(!e||!o)try{try{f=nt.create(t);b(nt.getPrototypeOf(f)===t?f:t,i,r);for(s in t)typeof t[s]=="function"&&(f[s]=t[s].bind(t));try{u.call(f,f,t)}catch(l){}t=f}catch(l){b(t.constructor.prototype,i,r)}}catch(l){return!1}}else{try{c=t[i];t[i]=null}catch(l){}if("execScript"in n)n.execScript("Public "+i,"VBScript");else try{b(t,i,{value:ot})}catch(l){}t[i]=c}return t}function ii(n,i,r){return r=r||{},n=n===et?t:n,r.set=r.set||function(t){n[i]=t},r.get=r.get||function(){return n[i]},r}function ri(n,t,i){n in p?p[n].push(t):arguments.length>3?v(n,t,i,arguments[3]):v(n,t,i)}function ui(n,t,i){var r=p[n],u;if(r){for(u=r.length;--u;)if(r[u]===t){r.splice(u,1);break}}else at(n,t,i)}function rt(t,i){var u=(""+(typeof t=="string"?t:t.type)).replace(/^on/,""),f=p[u],e,r,o;if(f){if(i=typeof t=="string"?i:t,i.target==null)for(e=["target","currentTarget","srcElement","type"];t=e.pop();)i=w(i,t,{get:t==="type"?function(){return u}:function(){return n}});for(((u==="popstate"?n.onpopstate:n.onhashchange)||ot).call(n,i),r=0,o=f.length;r<o;r++)f[r].call(n,i);return!0}return gt(t,i)}function bt(){var n=u.createEvent?u.createEvent("Event"):u.createEventObject();n.initEvent?n.initEvent("popstate",!1,!1):n.type="popstate";n.state=i.state;rt(n)}function fi(){k&&(k=!1,bt())}function o(n,i,u,f){if(!s){var e=r(i);e._relative!==r()._relative&&(y=f,u?t.replace("#"+e._special):t.hash=e._special)}!tt&&n&&(h[t.href]=n);k=!1}function st(i){if(y){yt!==t.href&&bt();i=i||n.event;var u=r(y,!0),f=r();i.oldURL||(i.oldURL=u._href,i.newURL=f._href);u._hash!==f._hash&&rt(i)}y=t.href}function kt(n){setTimeout(function(){v("popstate",function(n){yt=t.href;tt||(n=w(n,"state",{get:function(){return i.state}}));rt(n)},!1)},0);!s&&n!==!0&&i.location&&(dt(i.location.hash),fi())}function ei(t){var u=t||n.event,e=u.target||u.srcElement,s="defaultPrevented"in u?u.defaultPrevented:u.returnValue===!1;if(e&&e.nodeName==="A"&&!s){var o=r(),f=r(e.getAttribute("href",2)),h=o._href.split("#").shift()===f._href.split("#").shift();h&&f._hash&&(o._hash!==f._hash&&(i.location.hash=f._hash),dt(f._hash),u.preventDefault?u.preventDefault():u.returnValue=!1)}}function dt(t){var i=u.getElementById(t=(t||"").replace(/^#/,"")),r;i&&i.id===t&&i.nodeName==="A"&&(r=i.getBoundingClientRect(),n.scrollTo(d.scrollLeft||0,r.top+(d.scrollTop||0)-(d.clientTop||0)))}function oi(){var h=u.getElementsByTagName("script"),y=(h[h.length-1]||{}).src||"",d=y.indexOf("?")!==-1?y.split("?").pop():"",e,t,o,b;for(d.replace(/(\w+)(?:=([^&]*))?/g,function(n,t,i){f[t]=(i||(t==="basepath"?"/":"")).replace(/^(0|false)$/,"")}),si(),v(a+"hashchange",st,!1),e=[et,c,ni,n,wt,i],tt&&delete wt.state,t=0;t<e.length;t+=2)for(o in e[t])if(e[t].hasOwnProperty(o))if(typeof e[t][o]=="function")e[t+1][o]=e[t][o];else{if(b=ii(e[t],o,e[t][o]),!w(e[t+1],o,b,function(r,u){u===i&&(n.history=i=e[t+1]=r)}))return at(a+"hashchange",st,!1),!1;e[t+1]===n&&(p[o]=p[o.substr(2)]=[])}return f.redirect&&i.redirect(),!tt&&l&&ti(l),s||u[ft](a+"click",ei,!1),u.readyState==="complete"?kt(!0):(s||r()._relative===f.basepath||(k=!0),v(a+"load",kt,!1)),!0}function si(){function createVBObjects(t){var o=[],u="VBHistoryClass"+(new Date).getTime()+msie++,f=["Class "+u],i,r,s,e;for(i in t)t.hasOwnProperty(i)&&(r=t[i],r&&(r.get||r.set)?(r.get&&f.push("Public "+(i==="_"?"Default ":"")+"Property Get ["+i+"]","Call VBCVal([(accessors)].["+i+"].get.call(me),["+i+"])","End Property"),r.set&&f.push("Public Property Let ["+i+"](val)",r="Call [(accessors)].["+i+"].set.call(me,val)\nEnd Property","Public Property Set ["+i+"](val)",r)):(o.push(i),f.push("Public ["+i+"]")));for(f.push("Private [(accessors)]","Private Sub Class_Initialize()","Set [(accessors)]="+u+"FactoryJS()","End Sub","End Class","Function "+u+"Factory()","Set "+u+"Factory=New "+u,"End Function"),n.execScript(f.join("\n"),"VBScript"),n[u+"FactoryJS"]=function(){return t},s=n[u+"Factory"](),e=0;e<o.length;e++)s[o[e]]=t[o[e]];return s}function quote(n){var t=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.test(n)?'"'+n.replace(t,function(n){return n in i?i[n]:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}var msie=n.eval&&eval("/*@cc_on 1;@*/"),interval;if(msie&&!(+(/msie (\d+)/i.exec(navigator.userAgent)||[,8])[1]>7)){var originalChangeState=o,originalRedefineProperty=w,currentHref=r()._href,iFrame=u.createElement("iframe");iFrame.src="javascript:true;";iFrame=d.firstChild.appendChild(iFrame).contentWindow;n.execScript("Public history\nFunction VBCVal(o,r) If IsObject(o) Then Set r=o Else r=o End If End Function","VBScript");c={_:{get:et.toString}};i={back:e.back,forward:e.forward,go:e.go,emulate:null,_:{get:function(){return"[object History]"}}};l={parse:function(n){try{return new Function("","return "+n)()}catch(t){return null}},stringify:function(n){var t=(typeof n).charCodeAt(2);return t===114?quote(n):t===109?isFinite(n)?String(n):"null":t===111||t===108?String(n):t===106?n?function(t){var r=t?"[":"{",i,u;if(t)for(i=0;i<n.length;i++)r+=(i==0?"":",")+l.stringify(n[i]);else for(u in n)n.hasOwnProperty(u)&&(r+=(r.length==1?"":",")+quote(u)+":"+l.stringify(n[u]));return r+(t?"]":"}")}(nt.prototype.toString.call(n)==="[object Array]"):"null":"void 0"}};o=function(n,i,u,f,e){var c=iFrame.document,s=r(i);if(k=!1,s._relative===r()._relative&&!e){n&&(h[t.href]=n);return}y=f;u?iFrame.lfirst?(history.back(),o(n,s._href,0,f,1)):t.replace("#"+s._special):(s._href!=currentHref||e)&&(iFrame.lfirst||(iFrame.lfirst=1,o(n,currentHref,0,f,1)),c.open(),c.write('<script>lfirst=1;parent.location.hash="'+s._special.replace(/"/g,'\\"')+'";<\/script>'),c.close());!e&&n&&(h[t.href]=n)};w=function(t,r,u){return originalRedefineProperty.apply(this,arguments)||(t===c?c[r]=u:t===i?(i[r]=u,r==="state"&&(c=createVBObjects(c),n.history=i=createVBObjects(i))):t[r]=u.get&&u.get()),t};interval=setInterval(function(){var t=r()._href,n;t!=currentHref&&(n=u.createEventObject(),n.oldURL=currentHref,n.newURL=currentHref=t,n.type="hashchange",st(n))},100);n.JSON=l}}if(n.history){var u=n.document,d=u.documentElement,g=n.sessionStorage,nt=n.Object,l=n.JSON,t=n.location,e=n.history,i=e,ut=e.pushState,ht=e.replaceState,s=!!ut,tt="state"in e,b=nt.defineProperty,c=w({},"t")?{}:u.createElement("a"),a="",ft=n.addEventListener?"addEventListener":(a="on")&&"attachEvent",ct=n.removeEventListener?"removeEventListener":"detachEvent",lt=n.dispatchEvent?"dispatchEvent":"fireEvent",v=n[ft],at=n[ct],gt=n[lt],f={basepath:"/",redirect:0,type:"/"},it="__historyAPI__",vt=u.createElement("a"),y=t.href,yt="",k=!1,h={},p={},ni={onhashchange:null,onpopstate:null},pt=function(t,r){var u=n.history!==e;u&&(n.history=e);t.apply(e,r);u&&(n.history=i)},wt={redirect:function(i,u){if(f.basepath=u=u==null?f.basepath:u,f.type=i=i==null?f.type:i,n.top==n.self){var o=r(null,!1,!0)._relative,e=t.pathname+t.search;s?(e=e.replace(/([^\/])$/,"$1/"),o!=u&&new RegExp("^"+u+"$","i").test(e)&&t.replace(o)):e!=u&&(e=e.replace(/([^\/])\?/,"$1/?"),new RegExp("^"+u,"i").test(e)&&t.replace(u+"#"+e.replace(new RegExp("^"+u,"i"),i)+t.hash))}},pushState:function(n,t,i){ut&&pt(ut,arguments);o(n,i)},replaceState:function(n,i,r){delete h[t.href];ht&&pt(ht,arguments);o(n,r,!0)},location:{set:function(t){n.location=t},get:function(){return s?t:c}},state:{get:function(){return h[t.href]||null}}},et={assign:function(n){(""+n).indexOf("#")===0?o(null,n):t.assign(n)},reload:function(){t.reload()},replace:function(n){(""+n).indexOf("#")===0?o(null,n,!0):t.replace(n)},toString:function(){return this.href},href:{get:function(){return r()._href}},protocol:null,host:null,hostname:null,port:null,pathname:{get:function(){return r()._pathname}},search:{get:function(){return r()._search}},hash:{set:function(n){o(null,(""+n).replace(/^(#|)/,"#"),!1,y)},get:function(){return r()._hash}}};oi()&&(i.emulate=!s,n[ft]=ri,n[ct]=ui,n[lt]=rt)}}(window)