var ENV_PRODUCTION=true;var DEBUG_BLOCK_COOKIE=false;var DEBUG_BLOCK_API=false;var DEBUG_BLOCK_LOCALSTORAGE=false;var DEBUG_OUTPUT_ACTIVE=false;var DEBUG_AUDIT_GEOCODE=false;var DEBUG_ADS=false;var DEBUG_CURATION=false;var WS_M_NOT_FOUND="<p>The address you entered could not be found. Please check your address and try again.</p>";window.lazyLoadIWStyles=(function(){var A=0;return function(){if(A++){return }$("head").append("<link />");$("head").children(":last").attr({rel:"stylesheet",type:"text/css",href:"http://cdn.walkscore.com/css/miniwindow_v17495.css"})}})();(function(){var B={};window.ListenerMixin=B.exports=function(E){E._addListener=function(G,F){this.listeners||(this.listeners=[]);this.listeners[G]||(this.listeners[G]=[]);this.listeners[G].push(F)};E._alertListeners=function(G,I){var H=(this.listeners||[])[G]||[];for(var F=0;F<H.length;F++){H[F](I)}};E._clearListeners=function(F){delete (this.listeners[F])}};window.MapClassesMixin=B.exports=function(F){var E=this;_(["LatLng","LatLngBounds"]).each(_(function(G){if(E.google){F[G]=google.maps[G]}else{if(!(this[G]=_(E.window).spelunk(["walkscore","maps",G]))){F[G]=require("./walkscore-maps").maps[G]}}}).bind(this))};window.ws_simple_init=B.exports=(function(){var E=function(G){var F=(/function ([^\( ]+)/).exec(G.constructor.toString());return F?F[1]:""};return function(I,H){I||(I={});H||(H=[]);for(var G=0;G<H.length;G++){if(I[H[G]]===void 0){throw ("Missing "+H[G]+" in "+E(this)+" init.")}}for(var F in I){this[F]=I[F]}}})();window.walkscore=B.exports=(function(){var E={maps:{}};var G=function(H,I,J){H.ws_with=function(L,M){var K=this.coerced||(this.coerced={});J.call(this,L,function(N){M(K[L]||(K[L]=N))})};if(I){H.ws_coerce=function(L){var K;this.ws_with(L,function(M){K=M});return K}}};var F=function(I,H,J){I._ws_={app:H.app,amenity:H.amenity,idol:H,id:J||H.id};return I};E.maps.LatLng=function(I,H){this.lat_=I;this.lng_=H};(function(){var H=E.maps.LatLng.prototype;H.lat=function(J){return this._acc("lat_",J)};H.lng=function(J){return this._acc("lng_",J)};H.toUrlValue=function(J){return""+this.lat_+","+this.lng_};H._acc=function(K,J){if(!_(J).isUndefined()){this[K]=J-0}return this[K]};G(H,true,function(J,K){K(({google:function(M,L){return new google.maps.LatLng(M,L)},bing:function(M,L){return new Microsoft.Maps.Location(M,L)},mapquest:function(M,L){return{lat:M,lng:L}}}[J])(this.lat_,this.lng_))});var I=(function(){rad=function(J){return J*Math.PI/180};return function(P,N){var M=6371;var L=rad(N.lat()-P.lat());var J=rad(N.lng()-P.lng());var K=Math.sin(L/2)*Math.sin(L/2)+Math.cos(rad(P.lat()))*Math.cos(rad(N.lat()))*Math.sin(J/2)*Math.sin(J/2);var Q=2*Math.atan2(Math.sqrt(K),Math.sqrt(1-K));var O=M*Q;return O.toFixed(3)}})();H.distanceFrom=function(J){return I(this,J)*1000}})();E.maps.Marker=function(H){this._init(H)};(function(){var J=E.maps.Marker.prototype;J._init=function(L){ws_simple_init.call(this,L);if(_(L.visible).isUndefined()){this.visible=true}};J.setPosition=function(L){this.position=L;_(this.coerced).each(function(N,M){N.setPosition(L.ws_coerce(M))})};var I=function(L){var M=F(new google.maps.Marker({position:this.position.ws_coerce("google"),icon:this.icon}),this);if(this.zIndexGroup){M.setZIndexGroup(this.zIndexGroup)}if(this.clickHandler){google.maps.event.addListener(M,"click",this.clickHandler)}L(M)};var H=function(M){var L=this.position.ws_coerce("bing");var P=this.icon._ws_;if(!P){console.log(this)}var O="url("+P.url+") 0px 0px no-repeat";var N="-"+P.offset.x+"px -"+P.offset.y+"px";var Q="ws_bing_marker_"+this.id;if(!this.bing_infobox){this.bing_infobox=F(new Microsoft.Maps.Infobox(L,{htmlContent:$("<div />").append($("<div />",{id:Q,"class":"ws_bing_marker"}).css("width",P.size.w+"px").css("height",P.size.h+"px").css("position","relative").css("left",-1*(P.size.w/2)+"px").css("background",O).css("background-position",N).css("z-index",this.zIndexGroup||0)).html()}),this,Q);Microsoft.Maps.Events.addHandler(this.bing_infobox,"click",this.clickHandler)}M(this.bing_infobox)};var K=function(M){var L=this.position.ws_coerce("mapquest");var Q=this.icon._ws_;var P="url("+Q.url+") 0px 0px no-repeat";var O="-"+Q.offset.x+"px -"+Q.offset.y+"px";var R="ws_mq_marker_"+this.id;var N;MQA.withModule("htmlpoi",_(function(){if(!MQA.HtmlPoi.prototype.open){MQA.HtmlPoi.prototype.open=function(T){if(!this.map_){T.addShape(this);this.map_=T}};MQA.HtmlPoi.prototype.close=function(){if(this.map_){this.map_.removeShape(this);delete (this.map_)}}}var S=this.mq_infobox||(this.mq_infobox=F(new MQA.HtmlPoi(L),this,R));S.setHtml($("<div />").append($("<div />",{id:R,"class":"ws_bing_marker"}).css("width",Q.size.w+"px").css("height",Q.size.h+"px").css("position","relative").css("left",(-1*(Q.size.w/2)-5)+"px").css("top",(-1*Q.size.h-3)+"px").css("background",P).css("background-position",O)).html());M(S)}).bind(this))};G(J,false,function(L,M){({google:I,bing:H,mapquest:K}[L]).call(this,M)})})();E.maps.InfoWindow=function(H){this._init(H)};(function(){var J=E.maps.InfoWindow.prototype;J._init=function(L){if(window.lazyLoadIWStyles){lazyLoadIWStyles()}ws_simple_init.call(this,L);this.classes||(this.classes=[])};J.setOptions=function(L){if(L.content){this.content=L.content}if(L.classes){this.classes=L.classes}if($.browser.msie){if($.browser.version>=8){this.addClass("IE8")}if($.browser.version<8){this.addClass("IE7")}if($.browser.version<7){this.addClass("nonub")}}};J.setPosition=function(N,L,M){this.position=N};J.setOffset=function(L,M){this.offset_x=L;this.offset_y=M};J.addClass=function(L){this.removeClass(L);this.classes.push(L);return this};J.removeClass=function(L){this.classes=_(this.classes).reject(function(M){return M==L});return this};J.makeDiv=function(){var L=$("<div />",{"class":"ws_miniwindow_body"});var N=$("<div />",{"class":"ws_miniwindow_nub"});var M=$("<div />",{"class":"ws_miniwindow"});_(this.classes).each(_(M.addClass).bind(M));this.div=M.append(L.append(this.content)).append(N);return this.div};var I=function(L){var M=new (this.isSmall?MiniWindow:google.maps.InfoWindow)({idol:this});if(this.isSmall){M.setOffset(1,-25)}else{M.setContent(this.content);var N=_(function(){var O=$(".iw");if(O[0]){O.parent().css("overflow","hidden")}else{_(N).delay(100)}}).max_attempts(10);_(N).defer()}L(M)};var H=function(L){var M=this.id||"ws_bing_miniwindow";L(F(new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0,0)),this,M))};var K=function(L){var M=this.id||"ws_mq_miniwindow";MQA.withModule("htmlpoi",_(function(){_(["addClass","removeClass"]).each(function(N){if(!MQA.HtmlPoi.prototype[N]){MQA.HtmlPoi.prototype[N]=function(){var O=this._ws_.idol;return O[N].apply(O,arguments)}}});L(F(new MQA.HtmlPoi({lat:0,lng:0}),this,M))}).bind(this))};G(J,false,function(L,M){({google:I,bing:H,mapquest:K}[L]).call(this,M)})})();E.maps.Polyline=function(H){this._init(H)};(function(){var J=E.maps.Polyline.prototype;J._init=function(K){ws_simple_init.call(this,K);if(_(K.visible).isUndefined()){this.visible=true}};var I=function(K){K(F(new google.maps.Polyline({strokeColor:this.strokeColor,path:_(this.path).map(function(L){return L.ws_coerce("google")})}),this))};var H=function(K){K(F(new Microsoft.Maps.Polyline(_(this.path).map(function(L){return L.ws_coerce("bing")}),{strokeColor:Microsoft.Maps.Color.fromHex(this.strokeColor)}),this))};G(J,false,function(K,L){({google:I,bing:H}[K]).call(this,L)})})();E.maps.LatLngBounds=function(H){this._init(H)};(function(){var J=E.maps.LatLngBounds.prototype;J._init=function(L){this.extend(L)};J._toOLArray=function(){return[this._sw.lng(),this._sw.lat(),this._ne.lng(),this._ne.lat()]};J.getNorthEast=function(){return this._ne};J.getSouthWest=function(){return this._sw};J.contains=function(L){return((L.lat()>this._sw.lat()&&L.lng()>this._sw.lng())&&(L.lat()<this._ne.lat()&&L.lng()<this._ne.lng()))};J.extend=function(L){if(!L){return }if(!(this._sw&&this._ne)){this._sw=new E.maps.LatLng(L.lat(),L.lng());this._ne=new E.maps.LatLng(L.lat(),L.lng())}var M=this;_([["_sw",-1],["_ne",1]]).each(function(N){_(["lat","lng"]).each(function(O){if((L[O]()*N[1])>(M[N[0]][O]()*N[1])){M[N[0]][O](L[O]())}})});return this};var I=function(L){var M=this._toOLArray();L(F(new google.maps.LatLngBounds(new google.maps.LatLng(M[1],M[0]),new google.maps.LatLng(M[3],M[2])),this))};var H=function(L){var M=this._toOLArray();L(F(Microsoft.Maps.LocationRect.fromCorners(new Microsoft.Maps.Location(M[3],M[0]),new Microsoft.Maps.Location(M[1],M[2])),this))};var K=function(L){var M=this._toOLArray();L(F({lr:{lat:M[1],lng:M[2]},ul:{lat:M[3],lng:M[0]}},this))};G(J,true,function(L,M){({google:I,bing:H,mapquest:K}[L]).call(this,M)})})();return E})();var D=B.exports={urlifyAddress:function(E){E=E.replace(/^\s*/,"").replace(/\s*$/,"").replace(/-/g,".dash.").replace(/#/g,".num.").replace(/\//g,".slash.").replace(/&/g," and ").replace(/,/g," ").replace(/\s+/g,"-");return encodeURIComponent(E).replace(/'/g,"%27")},encodeLocalityName:function(E){return encodeURIComponent(E.replace(/ /g,"_").replace(/\//g,".slash."))},getUrlParamFromString:function(H,G){H=H.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var F="[\\?&]"+H+"=([^&#]*)";var J=new RegExp(F);var I=J.exec(G);if(I==null){return""}else{var E=I[1];E=decodeURIComponent(E).replace(/\+/g," ");return E}},boprof:function(){var E=(new Date()).getTime();return function(F){var G=(new Date()).getTime();console.log(F,G-E);E=G}},getPerformanceLevel:(function(){var E=-1;return function(){if(E>=0){return E}E=0;for(var F=0;F<3;F++){(function(){var K=(new Date).getTime(),L={},J=0;for(var I=0;I<1<<30&&J<4;I++){var G=I%1000,H="_"+G;if(!G){J=(new Date).getTime()-K}L[H]||(L[H]=[]);L[H].push({val:I});L[H].push(L[H][I&1?"shift":"pop"]())}E+=(I-1)/1000})()}return E=Math.min(Math.floor(E/5),4)}})(),PERF_ABYSMAL:0,PERF_POOR:1,PERF_OK:2,PERF_GOOD:3,PERF_GREAT:4};window.ensureWSUnderscoreMixins=B.exports=(function(){var E=false;return function(F){if(E){return }F||(F=this._);F.mixin({sum:function(G){return F(G).reduce(function(H,I){return H+I},0)},bindsplat:function(H,I,G){return function(){var J=Array.prototype.slice.call(arguments);return H.apply(I||{},G.concat(J))}},slice:function(I,H){var G={};F(H).each(function(J){if(I.hasOwnProperty(J)){G[J]=I[J]}});return G},flattenObject:function(I,L,K){var K=defaultIfNotSet(K,0);var G=[];for(var J in I){var H=getObjectType(I);if(K<L&&H=="Object"||H=="Array"){G=G.concat(F(I[J]).flattenObject(L,K+1))}else{G.push(I[J])}}return G},recharge:function(G,H){var I=0;return function(){var L=this;var K=arguments;var J=(new Date).getTime();if(J-I>H){I=J;G.apply(L,K)}}},thump:function(I,J,G){var H=0;var K=function(){var M=this;var L=arguments;I.apply(M,L);if(!G||++H<G){F(K).delay(J)}};K()},dumpMethod:function(G,H){G[H]=F(G[H]).wrap(function(K){var J=Array.prototype.slice.call(arguments,1);console.log(H,"in",J);var I=K.apply(G,J);console.log(H,"out",I);return I})},spelunk:function(H,G){var G=F(G).clone();while(H&&G.length){H=H[G.shift()]}return H},spefunc:function(H,G){var G=F(G).clone();var I=H;while(H&&G.length){I=H;H=H[G.shift()]}return F(H||function(){}).bind(I)},oreduce:function(H,G){return F(H).reduce(function(I,K,J){G(I,K,J);return I},{})},max_attempts:function(G,H){return F(G).wrap(function(I){if(H-->0){return I.apply(this,arguments)}})},lump:function(G,H){return G.slice(0,Math.floor(G.length/H)*H)},indexOf:function(H,J){if(H===void 0||H===null){throw new TypeError()}var K=Object(H);var G=K.length>>>0;if(G===0){return -1}var L=0;if(arguments.length>1){L=Number(arguments[2]);if(L!==L){L=0}else{if(L!==0&&L!==(1/0)&&L!==-(1/0)){L=(L>0||-1)*Math.floor(Math.abs(L))}}}if(L>=G){return -1}var I=L>=0?L:Math.max(G-Math.abs(L),0);for(;I<G;I++){if(I in K&&K[I]===J){return I}}return -1},watch:function(I,H,G){G||(G=-1);for(method in I){if(F(I[method]).isFunction()){(function(J){I[J]=F(I[J]).wrap(function(O){var K=[arguments.callee.caller.caller];for(var N=0;N<9&&K[0].caller;N++){K.unshift(K[0].caller)}var M=Array.prototype.slice.call(arguments,1),P=(new Date).getTime(),L=O.apply(I,M),R=(new Date).getTime()-P,Q={args:M,retval:L,time:R,stack:K.reverse()};if(R>G){console.log.apply(console,F([(new Date).getTime(),H?H:[],J,Q]).flatten())}return L})})(method)}}},onInstantiation:function(H,J){var I=function(){},G=function(){J(H.apply(this,arguments))};I.prototype=H.prototype;G.prototype=new I();G.prototype.constructor=G;return G},sort:function(G,H){return G.sort(H)}});E=true}})();var C=["getUrlParamFromString","getPerformanceLevel","urlifyAddress","boprof","encodeLocalityName","PERF_ABYSMAL","PERF_POOR","PERF_OK","PERF_GOOD","PERF_GREAT"];for(var A=0;A<C.length;A++){window[C[A]]=D[C[A]]}})();function setInputExampleText(A,C){var B=(_(A).isString()?$(A):A);B.addClass("example-text");if(Modernizr.input.placeholder){return B.attr("placeholder",C)}B.bind("focus",function(D){if(this.value==C){$(this).val("").removeClass("placeholder")}}).bind("blur",function(D){if(this.value==""){$(this).addClass("placeholder").val(C)}});if(B.val()==""){B.addClass("placeholder").val(C)}}function setActiveText(A,C){var B=(_(A).isString()?$(A):A).val(C);if(C){B.removeClass("placeholder")}else{if(!Modernizr.input.placeholder){B.addClass("placeholder")}}}function getActiveText(A){var B=(_(A).isString()?$(A):A);if(!B.hasClass("placeholder")||Modernizr.input.placeholder){return B.val()}return""}function clearSelection(){if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){var A=window.getSelection();if(A&&A.removeAllRanges){A.removeAllRanges()}}}}function showFormError(A,C){var B=$(".form-error-message");if(C){B.html(A).fadeTo(0,1)}else{B.html(A).fadeTo(0,0).fadeTo(500,1).fadeTo(2200,1).fadeTo(1000,0)}}function clearFormError(){showFormError("",true)}function collapseTable(C,H,E,D){if($(C).find("tr").length<=H+1){return }var G=true;var B=$('<span class="read-more"><a href="#">'+E+"<span></span></a></span>");var F;$(C).after(B);var A=function(){G=!G;if(G){B.removeClass("read-more").addClass("read-less").children("a").html(D+"<span></span>")}else{F=$(C).find("tr").slice(H+1);B.removeClass("read-less").addClass("read-more").children("a").html(E+"<span></span>")}if(F){F.css("display",G?"table-row":"none")}return false};B.click(A);A();$(C).bind("sortEnd",function(){if(!G){A();A()}})}function collapseList(B,G,D,C){if($(B).find("li").length<=G){return }var F=false;var A=$('<span class="read-more"><a href="#">'+D+"<span></span></a></span>");var E=$(B).after(A).find("li").slice(G).css("display","none");A.click(function(){F=!F;E.css("display",F?"list-item":"none");if(F){A.removeClass("read-more").addClass("read-less").children("a").html(C+"<span></span>")}else{A.removeClass("read-less").addClass("read-more").children("a").html(D+"<span></span>")}return false})}function InitSemiCollapseDiv(E,K,H,D){var J=$(E).eq(0);var L=D?$(D+" a").eq(0):$();var C=$(K).eq(0);var G={expanded:false,minHeight:H};var A=function(){var M=$(K);G.fullHeight=M.height("auto").height();G.minHeight=Math.min(G.minHeight,G.fullHeight);M.height(G.expanded?G.fullHeight:G.minHeight)};$(window).resize(A);A();if(G.fullHeight>G.minHeight){var B=J.html();var F=$("<span />",{"class":"ui-expand-control"}).html(B).append($("<span />",{"class":"ui-expand-icon"}));J.html("").append(F);var I=function(){if(G.expanded){F.removeClass("expanded");var M={height:G.minHeight};L.html("View more")}else{F.addClass("expanded");var M={height:G.fullHeight};L.html("View less")}C.animate(M,350);G.expanded=!G.expanded;_.defer(clearSelection)};J.click(I);L.click(I)}else{$(D).css("display","none")}}function createFlyer(D,C){var A=D.street.value;if(A=="Type an address"){A=""}var B="create";if(window.ws_flyer_cobrand){B="cobrand/"+ws_flyer_cobrand}window.location="/flyer/"+B+"/"+urlifyAddress(A);trackEvent("create flyer",C);return false}function addressSubmit(C,B,D){var A=C.street.value;if(A=="Type an Address"){return false}goToAddress(A,null,null,null,D);trackEvent("address submit",B);return false}function goToHoodTab(B,C){trackEvent(ACTIVE_COMPONENT,"tab click","neighborhood tab");var A=getHoodTabUrl(B,C);document.location=A}function showCommuteTo(B){trackEvent(ACTIVE_COMPONENT,"work address submitted");var A=urlifyAddress(B.query.value);goToTab("commute",{to:A});return false}function fixNYBoroughs(C,A){var B=_(["Brooklyn","Queens","Bronx","Staten Island","Manhattan"]);return("NY"==A&&B.include(C))?"New York":C}function getHoodUrl(B,E,D){var C=B.getAdminArea();var F=fixNYBoroughs(B.getCity(),C);C=encodeURIComponent(C);F=encodeURIComponent(replaceAll(F," ","_"));if(C=="DC"){F="Washington_D.C."}F=replaceAll(F,"Ste ","Ste. ");F=replaceAll(F,"St ","St. ");var A=encodeURIComponent(E.replace(/ /g,"_").replace(/\//g,".slash."));url="/"+[C,F,A].join("/");if(D){url+="/"+geturlStubFromCurrent()}return url}function getHoodTabUrl(A,B){return getHoodUrl(A,B,true)}function tabClick(C,A,B){var D=(C=="nearby")?"custom map":((C=="score")?"overview":C);trackEvent(ACTIVE_COMPONENT,"tab click",D);goToTab(C,A,B)}function goToTab(D,A,B){var C=geturlStubFromCurrent();navigateInternal(D,C,A,B)}function goToAddress(B,F,D,A,G){var E=(G)?G:"score";var C=urlifyLocation(B,F,D);C+=getExtraParamsFromCurrent();navigateInternal(E,C,A)}function getGoToAddressFunc(C){if(C.getQuery()){var B=C.getQuery();return function(){goToAddress(B)}}else{if(C.getLat()&&C.getLng()){var A=C.getLat();var D=C.getLng();return function(){goToAddress("loc",A,D)}}}}function getCurrentTabName(){var A=String(document.location.pathname);A=A.substr(1);var B=A.indexOf("/");A=A.substr(0,B);return A}function navigateInternal(E,C,A,B){var F="";if(A){for(key in A){F+="/"+encodeURIComponent(key)+"="+encodeURIComponent(A[key])}}if(B){var D=C.indexOf("/");C=(D==-1)?B:B+C.substr(D)}if(E=="score"||E=="commute"||E=="nearby"||E=="report"){document.location="/"+E+"/"+C+F}else{document.location="/score/"+C+F}}function geturlStubFromCurrent(C){C=defaultIfNotSet(C,false);var A=getUrlParam("street");if(isEmptyString(A)){A="loc"}var E=getUrlParam("lat");var B=getUrlParam("lng");var D=urlifyLocation(A,E,B);if(!C){D+=getExtraParamsFromCurrent()}return D}function getFlyerUrlStubFromCurrent(){var A=getUrlParam("street");if(isEmptyString(A)){A="["+getUrlParam("lat")+" "+getUrlParam("lng")+"]"}return urlifyAddress(A)}function getExtraParamsFromCurrent(){var A=getUrlParam("country");var C=getUrlParam("units");var B="";if(A){B+="/country="+A}if(C){B+="/units="+C}return B}function safeUrlLatLng(B,A){return(B&&A)?"/lat="+B+"/lng="+A:""}function goToCelebLocation(E,D){var C=E.split("?");if(C.length!=5){return }trackEvent(D,"celebrity location",C[0]);var B=C[0]+" "+C[1];var A={lat:C[4],lng:C[3]};goToTab("score",A,urlifyAddress(B))}function getUrlParam(A){if(var_exists("url_"+A)){return window["url_"+A]}return getUrlParamFromString(A,window.location.href)}function cleanAddress(A){A=replaceAll(A,"&"," and ");return A}function replaceAll(A,C,D){var B=A.indexOf(C);while(B!=-1){A=A.replace(C,D);B=A.indexOf(C)}return A}function isValidUrl(B){var A=new RegExp("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&?/.=+:]+$");return A.test(B)}removeFromArray=function(D,C,B){var A=D.slice((B||C)+1||D.length);D.length=C<0?D.length+C:C;return D.push.apply(D,A)};removeFromArrayByName=function(C,B){var A=_(C).indexOf(B);if(A!=-1){removeFromArray(C,A)}};function arrayContains(D,B){for(var A=0,C=D.length;A<C;A++){if(D[A]===B){return true}}return false}function urlifyLocation(A,C,B){return urlifyAddress(A)+safeUrlLatLng(C,B)}function unencodeAddress(A){return(decodeURIComponent(A||"").replace(/\.dash\./g,"-").replace(/\.num\./g,"#").replace(/\.slash\./g,"/").replace(/-/g," "))}function urlifyLatLng(A){return"loc/lat="+A.lat()+"/lng="+A.lng()}function urlifyParam(A,B){return(B==null)?"":A+"="+encodeURIComponent(B)}function getCityGoRoundUrl(A){var B=(A.getCity()!="")?A.getCity():A.userLatLng.lat()+","+A.userLatLng.lng();return"http://www.citygoround.org/apps/walk-score/location/?q="+encodeURI(B)}function getCityGoRoundNearbyAppsUrl(A){return"http://www.citygoround.org/apps/nearby/?q="+encodeURI(A.getQuery())}function getProxiedCityGoRoundApplicationSearchApiUrl(A){return"/data/get-city-go-round-api-apps-search.php?lat="+A.getLat()+"&lon="+A.getLng()+"&country="+encodeURI(A.getCountryCode())}function sluggify(A){A=replaceAll(A," ","-");A=replaceAll(A,"'","");A=replaceAll(A,'"',"");A=replaceAll(A,".","");A=replaceAll(A,"&","and");A=replaceAll(A,":","");A=replaceAll(A,",","");return A.toLowerCase()}function supersluggify(A){return(A.replace(/\s/g,"-").replace(/&/g,"and").replace(/\W/g,"").toLowerCase())}function isEmptyString(A){return(typeof A=="string"&&A.length==0)}function safeString(C,B,A){if(typeof C!="string"){return""}if(B){C=" "+C}if(A){C=C+" "}return C}function htmlToText(A){A=replaceAll(A,"<","&lt;");A=replaceAll(A,">","&gt;");A=replaceAll(A,"&mdash;","&amp;mdash;");A=replaceAll(A,"&rsquo;","&amp;rsquo;");return A}function stripTags(A,C){C=(((C||"<b><i><u><strong><em>")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var B=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,D=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return A.replace(D,"").replace(B,function(F,E){return C.indexOf("<"+E.toLowerCase()+">")>-1?F:""})}function stripJS(A){var B=A;B=replaceAll(B,"(","");B=replaceAll(B,")","");return B}function limitText(C,D,A){var B=A-C.val().length;if(B<0){C.val(C.val().substring(0,A));B=0}if(B<20){D.addClass("form-error-message")}else{D.removeClass("form-error-message")}if(B<50){D.html(B+" characters remaining")}else{D.html("")}}function generateAmenityKey(B,I,A,G){var C=String(I.lat());var D=String(I.lng());if(!G){if(C.indexOf(".")!=-1){C=C.substr(0,C.indexOf(".")+4);C=C.replace(/\.?0+$/,"")}if(D.indexOf(".")!=-1){D=D.substr(0,D.indexOf(".")+4);D=D.replace(/\.?0+$/,"")}}var E=B.toLowerCase();E=replaceAll(E," ","");E=replaceAll(E,"'","");E=replaceAll(E,'"',"");E=replaceAll(E,"%","");E=replaceAll(E,"&","");E=replaceAll(E,"<","");E=replaceAll(E,">","");E=Rot13.convert(E);var H=E.substr(0,Math.min(5,E.length));var F=E.substr(Math.max(0,E.length-5),5);var J=H+F+"_"+C+"_"+D;if(A=="Curated"){J+="_ws"}return J}function isUserAddedAmenity(A){return((A.length-3)==A.lastIndexOf("_ws")||A.substr(0,3)=="ws_")}function trimURL(A){var B=A.indexOf("://");if(B!=-1){return A.substr(B+3)}}function trimTitle(A,B){B||(B=78);if(A.length>B){A=A.substring(0,B-3)+"..."}return A}function forEach(F,C,B){B=B||this;var A=F.length;for(var E=0;E<A;E++){var D=C.call(B,F[E],E);if(D!==undefined){return D}}}function var_exists(A){return typeof (window[A])!="undefined"}function isSet(A){return(typeof A!="undefined")}function paramIsSet(A){return(typeof A!="undefined")}function defaultIfNotSet(A,B){return(typeof A!="undefined")?A:B}function linkTracker(D,C,A,B){return function(E){trackEvent(D,C,A,B)}}function initLinkTracking(B){for(var G in B){if(B.hasOwnProperty(G)){var A=B[G];var F=A[0];var E=A[1];var C=A[2];var D=A[3];$("#"+G).click(linkTracker(F,E,C,D))}}}function trackEvent(D,C,A,B){if(!ENV_PRODUCTION&&DEBUG_OUTPUT_ACTIVE&&console&&console.log){console.log("Track Event:",D,C,A,B)}else{if(window._gaq){_gaq.push(["_trackEvent"].concat(Array.prototype.slice.call(arguments)))}}}function trackVirtualPageview(A){if(window._gaq&&A){_gaq.push(["_trackPageview",A])}}function trackNavigation(C,B,D,A){if(B&&D){trackEvent(B,D,safeString(A))}if(C){document.location=C}}function trackNavigationNewWindow(C,B,D,A){if(B&&D){trackEvent(B,D,safeString(A))}if(C){window.open(C,"newwin")}}function formatNumber(F,C,H,E){var B=!isFinite(+F)?0:+F,A=!isFinite(+C)?0:Math.abs(C),J=(typeof E==="undefined")?",":E,D=(typeof H==="undefined")?".":H,I="",G=function(M,L){var K=Math.pow(10,L);return""+Math.round(M*K)/K};I=(A?G(B,A):""+Math.round(B)).split(".");if(I[0].length>3){I[0]=I[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,J)}if((I[1]||"").length<A){I[1]=I[1]||"";I[1]+=new Array(A-I[1].length+1).join("0")}return I.join(D)}function unformatNumber(A){A=replaceAll(String(A),",","");return Number(A)}function isNumeric(B){var A=/^[0-9]+$/;if(B.match(A)){return true}return false}function leadsWithNumber(B){var A=/^[0-9]+$/;if(B.substr(0,1).match(A)){return true}return false}function getLeadingNumber(B){if(!leadsWithNumber(B)){return false}var A=B.match(/[\d\.]+/g);if(A&&A[0]){return Number(A[0])}return false}function extractNum(A){return parseInt(String(A).replace(/^.*?(\d+).*$/,"$1"))}function getPctDiffString(B,A){if(B<A){return roundNumber(100*(1-(B/A)),2)+"% lower"}else{return roundNumber(100*((B/A)-1),2)+"% higher"}}function isIE(){return navigator.userAgent.toLowerCase().indexOf("msie")>=0}function isIE6(){return($.browser.msie&&$.browser.version<7)}function GeoData(G,B,F,D,E,I,J,H,A,C){ensure_ws();this.setData=function(Q,L,P,N,O,S,T,R,K,M){this.query=safeString(Q);this.preSnapLatLng=M;this.setLatLng(L);this.countryCode=safeString(P);this.countryName=safeString(N);this.formattedAddress=safeString(O);this.adminArea=safeString(S);this.thoroughfare=safeString(T);this.locality=safeString(R);this.postalCode=safeString(K);this.overrideUnits=null};this.setLatLng=function(K){this.latLng=defaultIfNotSet(K,null);if(this.latLng){this.snap()}};this.snap=function(){if(!this.preSnapLatLng){this.preSnapLatLng=this.latLng}this.latLng=new ws.LatLng(snapToGrid(this.getLat()),snapToGrid(this.getLng()))};this.fillDataFromGeoData=function(K){if(isEmptyString(this.query)){this.query=K.query}if(!this.preSnapLatLng){this.preSnapLatLng=K.preSnapLatLng}if(this.latLng==null){this.setLatLng(K.latLng)}if(isEmptyString(this.countryCode)){this.countryCode=K.countryCode}if(isEmptyString(this.countryName)){this.countryName=K.countryName}if(isEmptyString(this.formattedAddress)){this.formattedAddress=K.formattedAddress}if(isEmptyString(this.adminArea)){this.adminArea=K.adminArea}if(isEmptyString(this.thoroughfare)){this.thoroughfare=K.thoroughfare}if(isEmptyString(this.postalCode)){this.postalCode=K.postalCode}if(!isEmptyString(K.locality)){this.locality=K.locality}if(!isEmptyString(K.formattedAddress)){this.formattedAddress=K.formattedAddress}if(K.locBase){this.locBase=K.locBase}};this.loadJSON=function(L){var K=(L.y&&L.x)?new ws.LatLng(L.y,L.x):null;var M=(L.py&&L.px)?new ws.LatLng(L.py,L.px):null;this.setData(decodeURIComponent(L.q),K,decodeURIComponent(L.cc),decodeURIComponent(L.cn),decodeURIComponent(L.fa),decodeURIComponent(L.aa),decodeURIComponent(L.tf),decodeURIComponent(L.l),decodeURIComponent(L.pc),M);this.locBase=decodeURIComponent(L.lb)};this.toJSON=function(){var K={lb:encodeURIComponent(this.locBase),q:encodeURIComponent(this.query),cc:encodeURIComponent(this.countryCode),cn:encodeURIComponent(this.countryName),fa:encodeURIComponent(this.formattedAddress),aa:encodeURIComponent(this.adminArea),tf:encodeURIComponent(this.thoroughfare),l:encodeURIComponent(this.locality),pc:encodeURIComponent(this.postalCode)};if(this.latLng){K.y=this.latLng.lat();K.x=this.latLng.lng()}if(this.preSnapLatLng){K.py=this.preSnapLatLng.lat();K.px=this.preSnapLatLng.lng()}return K};this.overrideDefaultUnits=function(K){if(K=="mi"||K=="km"){this.overrideUnits=K}};this.getUnits=function(){if(this.overrideUnits){return this.overrideUnits}if(this.countryCode&&(this.countryCode=="US"||this.countryCode=="GB")){return"mi"}return"km"};this.getQuery=function(){return this.query};this.getLatLng=function(){return this.latLng};this.getLat=function(){return(this.latLng)?this.latLng.lat():null};this.getLng=function(){return(this.latLng)?this.latLng.lng():null};this.getLocBase=function(){return this.locBase};this.getCountryCode=function(){return this.countryCode};this.getCountryName=function(){return this.countryName};this.getAdminArea=function(){return this.adminArea};this.getThoroughfare=function(){if(this.locBase==GeoData.prototype.LOCBASE_REVERSE_GEOCODE_WITH_ADDRESS_OVERRIDE){return this.query}return this.thoroughfare};this.getCity=function(){return this.locality};this.getTransitScoreCity=function(){var K=this.locality;if(this.countryCode=="NZ"){K=this.adminArea}return K};this.getPostalCode=function(){return this.postalCode};this.getPreSnapLatLng=function(){return this.preSnapLatLng};this.correctCityNameForDisplay=function(){if(this.adminArea=="DC"){return"Washington D.C."}return this.locality};this.getUrlifiedLocation=function(){if(this.locBase==GeoData.prototype.LOCBASE_GEOCODE||this.locBase==GeoData.prototype.LOCBASE_GEOCODE_PLUS_REVERSE){return urlifyAddress(this.query)}if(this.locBase==GeoData.prototype.LOCBASE_REVERSE_GEOCODE){return urlifyLatLng(this.latLng)}return urlifyLocation(this.query,this.latLng.lat(),this.latLng.lng())};this.getFormattedAddress=function(){return this.formattedAddress};this.getShortFormattedAddress=function(){var K=[];if(this.thoroughfare){K.push(this.thoroughfare)}if(this.locality){K.push(this.correctCityNameForDisplay())}return(K.length>0)?K.join(" "):this.getQuery()};this.getBestFormattedAddress=function(){if(this.locBase==GeoData.prototype.LOCBASE_REVERSE_GEOCODE_WITH_ADDRESS_OVERRIDE){return this.query}else{if(this.thoroughfare){return this.getShortFormattedAddress()}else{return this.formattedAddress}}};this.hasData=function(){return(this.latLng!=null&&this.countryCode!="")};this.hasCity=function(){return(this.locality!="")};this.hasAdminArea=function(){return(this.adminArea!="")};this.hasCountry=function(){return(this.countryCode!="")};this.getCityStateZip=function(){return(this.adminArea!=""||this.postalCode!="")?this.locality+", "+this.adminArea+" "+this.postalCode:this.locality};this.getUrl=function(){if(!isEmptyString(this.query)){return("http://www.walkscore.com/score/"+urlifyAddress(this.query))}else{if(this.latLng){return("http://www.walkscore.com/score/"+urlifyLatLng(this.latLng))}}};this.setData(G,B,F,D,E,I,J,H,A,C)}GeoData.prototype.LOCBASE_GEOCODE=20;GeoData.prototype.LOCBASE_REVERSE_GEOCODE=21;GeoData.prototype.LOCBASE_REVERSE_GEOCODE_WITH_ADDRESS_OVERRIDE=22;GeoData.prototype.LOCBASE_GEOCODE_PLUS_REVERSE=23;function initGeoDataFromURL(){ensure_ws();var F=getUrlParam("lat");var B=getUrlParam("lng");var H=(F.length>0&&B.length>0)?new ws.LatLng(F,B):null;var A=getUrlParam("country");var G=getUrlParam("street",true,true);if(G=="loc"){G=""}else{if(!F&&!B&&/^\[[0-9\-\.]+\s[0-9\-\.]+\]$/.test(G)){var E=G.substr(1,G.length-2).split(" ");var H=new ws.LatLng(E[0],E[1])}}var C=new GeoData(cleanAddress(G),H,A);var D=getUrlParam("units");if(D){C.overrideDefaultUnits(D)}return C}function getLocationKey(B){var C=B.getQuery();var E=B.getLat();var A=B.getLng();var D=(E&&A)?"_"+String(E)+"_"+String(A):"";return C+D}function storeAddressAndScore(C,A){var B="";B+=urlifyParam("useraddr",A.getQuery());B+=urlifyParam("&googleaddr",A.getFormattedAddress());B+=urlifyParam("&street",A.getThoroughfare());B+=urlifyParam("&city",A.getCity());B+=urlifyParam("&state",A.getAdminArea());B+=urlifyParam("&postal",A.getPostalCode());B+=urlifyParam("&country",A.getCountryCode());B+=urlifyParam("&lat",A.getLat());B+=urlifyParam("&lng",A.getLng());B+=urlifyParam("&score",C);$.ajax({url:"/save-address-data.php",type:"POST",data:B})}function Checklist(A,C){this.callback=C;this.items=A;this.checked=[];for(var B in A){this.checked[B]=false}this.check=function(E){for(var D in this.items){if(this.items[D]==E&&this.checked[D]===false){this.checked[D]=true;if(this.callback&&!arrayContains(this.checked,false)){this.callback();this.callback=null}}}};this.isChecked=function(E){for(var D in this.items){if(this.items[D]==E){return this.checked[D]}}}}function CountDownHash(B,C){var A={};_(B).each(function(D){A[D]=true});return function(D){if(A[D]){delete (A[D]);if(_(A).isEmpty()){C()}}}}function linkifyName(A){A=replaceAll(A," ","_");return A}function unlinkifyName(A){A=replaceAll(A,"_"," ");return A}function getRankingsURL(A){return"http://www.walkscore.com/"+A.getAdminArea()+"/"+linkifyName(A.getCity())+"/"}function getRankingsHoodURL(A,B){return getRankingsURL(A)+linkifyName(B)}Function.prototype.inheritsFrom=function(A){if(A.constructor==Function){this.prototype=new A;this.prototype.constructor=this;this.prototype.parent=A.prototype}else{this.prototype=A;this.prototype.constructor=this;this.prototype.parent=A}return this};function bindCallback(A,B){return function(){return B.apply(A,arguments)}}function StringList(){this.list=[];this.length=function(){return this.list.length};this.get=function(A){return this.list[A]};this.indexOf=function(B){for(var A in this.list){if(this.list[A]==B){return A}}return -1};this.isInList=function(A){return(this.indexOf(A)!=-1)};this.addIfUnique=function(A){if(!this.isInList(A)){this.list.push(A)}};this.add=function(A){this.list.push(A)}}function suppressErrors(){window.onerror=function(){return true}}function restoreErrors(){window.onerror=function(){return false}}function getScoreDescription(A){if(A>=90){return"Walker&rsquo;s Paradise"}else{if(A>=70){return"Very Walkable"}else{if(A>=50){return"Somewhat Walkable"}}}return"Car-Dependent"}function estimatedWalkingTime(C){var A=convertMeters(C,"mi");var B=Math.ceil(A*20);return B+" minute walk"}function convertMeters(B,A){if(A=="mi"){return B/1609.34}return B/1000}function convertMetersForDisplay(B,A,C,D,G,E){var F=convertMeters(B,A);if(D){F=roundNumber(F,D)}if(F<=0&&D==1){F="0.0"}else{if(F<=0&&D==2){F="0.01"}}dStr=String(F);if(E){dStr+=" "}if(C){dStr+=A}if(G){dStr=(dStr.substr(0,1)=="0")?dStr.substr(1):dStr}return dStr}function am_convertMetersForDisplay(A,B){return((convertMeters(A,B)<0.1)?convertMetersForDisplay(A,B,true,2,true):convertMetersForDisplay(A,B,true,1,true).replace(/^(\d{2,})\.\d/,"$1"))}function convertTimeForDisplay(E,A,F){var B=Math.floor(E/3600);E%=3600;var C=Math.floor(E/60);var D="";if(B){D+=B+(A?"":" hr ")}if(C&&(!F||F!="hours")){D+=C+(A?"":" minutes")}return D}function positive_mod(B,A){if(B<0){return A+(B%A)}else{return B%A}}GRID_SIZE=0.0015;HALF_GRID_SIZE=GRID_SIZE/2;function snapToGrid(A){A=A*1;distanceToGrid=positive_mod(A,GRID_SIZE);if(distanceToGrid<HALF_GRID_SIZE){A=A-distanceToGrid}else{A=A+GRID_SIZE-distanceToGrid}return(Math.round(A*10000))/10000}$.fn.textWidth=function(){var B=$(this).html();var A="<span>"+B+"</span>";$(this).html(A);var C=$(this).find("span:first").width();$(this).html(B);return C};$.fn.ellipsis=function(){return this.each(function(){var E=$(this);if(E.css("overflow")=="hidden"){var G=E.html();var B=E.hasClass("multiline");B=true;var C=$(this.cloneNode(true)).hide().css("position","absolute").css("overflow","visible").width(B?E.width():"auto").height(B?"auto":E.height());E.after(C);function A(){return C.height()>E.height()}function D(){return C.width()>E.width()}var F=B?A:D;while(G.length>0&&F()){G=G.substr(0,G.length-1);C.html(G+"...")}E.html(C.html());C.remove()}})};function showMessage(D,B,A,E){var A=defaultIfNotSet(A,"center");var E=defaultIfNotSet(E,100);var C="";if(B=="alert"){C+='<img class="dialog-icon" src="http://cdn.walkscore.com/images/alert.gif" alt="" />'}C+=D;if(B=="alert"){C+='<input id="dialog-button" type="button" value="OK" onclick="hideDialog()" />'}showDialog(C,B,(B!="alert"),A,E);$("#dialog-button").focus()}function showDialog(F,L,A,J,H,B){initDialog();if(!B){startModal()}var G=$("#ws-dialog").removeClass();if(L){G.attr("class",L)}var K=(A)?'<img class="close-box" onclick="hideDialog()" src="http://cdn.walkscore.com/images/closeBox.gif" />':"";K+=F;G.html(K);if(J&&H){var I=$(window).scrollLeft();var E=$(window).scrollTop();var C=$(window).width();var D=$(window).height();if(J=="center"){J=I+(C-G.width())/2}if(J+G.width()>I+C-60){J=I+C-60-G.width()}if(H+G.height()>E+D-70){H=E+D-70-G.height()}if(J<I+20){J=I+20}if(H<E+20){H=E+20}G.css("top",H+"px").css("left",J+"px")}G.css("display","block");$("body").unbind("click",dialogCloseHandler);setTimeout(function(){$("body").bind("click",dialogCloseHandler)},200)}function dialogCloseHandler(D){var C=$(D.target);var A=C.is("select");var B=C.closest("#ws-dialog").length>0;if(!B&&!A){hideDialog()}}function hideDialog(){$("#ws-dialog").unbind().css("display","none");$("body").unbind("click",dialogCloseHandler);endModal()}function initDialog(){if($("#ws-dialog").length!=0){return }var A=document.createElement("div");A.id="ws-dialog";A.style.display="none";$("body").append(A)}function startModal(){initModal();var A=$("#popupMask");if(A.length>0&&A.css("display")=="none"){A.css("display","block");setMaskSize();hideSelectBoxes()}}function endModal(){$("#popupMask").css("display","none");displaySelectBoxes()}function initModal(){if($("#popupMask").length!=0){return }var A=document.createElement("div");A.id="popupMask";$("body").append(A);$(A).css("display","none");window.onresize=setMaskSize;window.onscroll=setMaskSize}function setMaskSize(){var B=$("body").get(0);var A=$("#popupMask");A.css("top",Math.max(document.body.scrollTop,document.documentElement.scrollTop)+"px");A.css("left",Math.max(document.body.scrollLeft,document.documentElement.scrollLeft)+"px");A.css("height",Math.max(getViewportHeight(),B.scrollHeight)+"px");A.css("width",Math.max(getViewportWidth(),B.scrollWidth)+"px")}function getViewportHeight(){if(window.innerHeight!=window.undefined){return window.innerHeight}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}return window.undefined}function getViewportWidth(){if(window.innerWidth!=window.undefined){return window.innerWidth}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}}function hideSelectBoxes(){if(navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.appVersion.split("MSIE")[1])<7){var B=document.getElementsByTagName("SELECT");for(var A=0;A<B.length;A++){B[A].style.visibility="hidden"}}}function displaySelectBoxes(){if(navigator.appName=="Microsoft Internet Explorer"&&parseFloat(navigator.appVersion.split("MSIE")[1])<7){var B=document.getElementsByTagName("SELECT");for(var A=0;A<B.length;A++){B[A].style.visibility="visible"}}}function getCraigslistHTML(A,C){var B="<p><font face='Verdana, Arial, Helvetica, sans-serif' size='3' color='#fff'>";B+=" <a target='_blank' href='"+A+"'><img border=0 style='border:0;' src='http://cdn.walkscore.com/images/walkscore-logo-baseline.gif' /></a>";B+="</font>";B+=" <font face='Verdana, Arial, Helvetica, sans-serif' size='3'><b>&nbsp;<a target='_blank' style='text-decoration:underline; color: #00f;' href='"+A+"'>"+C+"</a></b></font><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#444'> &mdash; "+getScoreDescription(C)+"</font>";B+="</p>";return B}function reportError(A){showMessage(A)}function alertThese(){if(DEBUG_OUTPUT_ACTIVE){alert(Array.prototype.join.call(arguments," :: "))}}function dbugThese(){if(DEBUG_OUTPUT_ACTIVE){dbug(Array.prototype.join.call(arguments," :: "))}}function dbug(A){if(DEBUG_OUTPUT_ACTIVE){$("#dbug").append(A+"<br />")}}function dbug2(A){if(DEBUG_OUTPUT_ACTIVE){$("#dbug").append(A)}}function dumpGLL(A){if(!A||!A.lat||!A.lng){return"(null or not recognized: "+A+")"}return"("+A.lat()+", "+A.lng()+")"}if(!window.console){window.console={};window.console.log=dbugThese}function rand(A){return(Math.floor(Math.random()*A+1))}function byte2Hex(B){var A="0123456789ABCDEF";return String(A.substr((B>>4)&15,1))+A.substr(B&15,1)}function RGB2Color(C,B,A){return"#"+byte2Hex(C)+byte2Hex(B)+byte2Hex(A)}function getScoreColor(B){var A=Array();A[0]=[223,68,51];A[1]=[235,237,129];A[2]=[173,228,108];A[3]=[78,173,66];if(B<55){return getBlendedColor(A[0],A[1],B/0.55)}else{if(B<75){return getBlendedColor(A[1],A[2],(B-55)/0.2)}else{if(B<95){return getBlendedColor(A[2],A[3],(B-75)/0.2)}else{return RGB2Color(78,173,66)}}}}function getBlendedColor(F,E,D){var C=F[0]*(1-D/100)+E[0]*D/100;var B=F[1]*(1-D/100)+E[1]*D/100;var A=F[2]*(1-D/100)+E[2]*D/100;return RGB2Color(C,B,A)}(function(C){C.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(E,F){C.fx.step[F]=function(G){if(!G.colorInit){G.start=D(G.elem,F);G.end=A(G.end);G.colorInit=true}G.elem.style[F]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2]),255),0)].join(",")+")"}});function A(E){var F;if(E&&E.constructor==Array&&E.length==3){return E}if(F=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(E)){return[parseInt(F[1]),parseInt(F[2]),parseInt(F[3])]}if(F=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(E)){return[parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55]}if(F=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(E)){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)]}if(F=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(E)){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]}if(F=/rgba\(0, 0, 0, 0\)/.exec(E)){return B.transparent}return B[C.trim(E).toLowerCase()]}function D(E,G){var F;do{F=C.curCSS(E,G);if(F!=""&&F!="transparent"||C.nodeName(E,"body")){break}G="backgroundColor"}while(E=E.parentNode);return A(F)}var B={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]}})(jQuery);function convertToTime(C){var A=Math.floor(C);var D=String(extractMinutes(C));if(D.length==1){D="0"+D}var B=(A>=12)?"pm":"am";if(A==24){A=12;B="am"}else{if(A==0){A=12}else{if(A>12){A-=12}}}return A+":"+D+B}function extractMinutes(B){var A=Math.floor(B);var C=Math.round((B-A)*60);return C}function extractHours(A){return Math.floor(A)%24}function roundNumber(B,C){C=defaultIfNotSet(C,0);var A=Math.round(B*Math.pow(10,C))/Math.pow(10,C);return A}function cleanNumber(B){if(B==null){return""}var A=B;A=replaceAll(A,"(","");A=replaceAll(A,")","");A=replaceAll(A,"-","");A=replaceAll(A," ","");return A}function trimLeadZero(A){return(String(A)).replace(/^[0]+/g,"")}var ensure_ws=function(){return window.ws||(window.ws=_({LARGE_DISTANCE:999999999999,zIndexGroups:{AMENITY_MARKERS:0,TRANSIT_MARKERS:1,HOUSE_MARKER:2,SELECTED_MARKERS:3}}).extend(walkscore.maps))};function get_image_size(B,C){var A=new Image();$(A).load(function(){C(A.width,A.height)}).error(function(){C()}).attr({src:B})}function isChrome(){return navigator.userAgent.toLowerCase().indexOf("chrome")!=-1}function isIpad(){return navigator.userAgent.match(/iPad/i)!=null}function isIOS(){return(function(A){return _([/ipad/i,/iphone/i]).detect(function(B){return A.match(B)})})(navigator.userAgent)}function lazy_ad_positioner(A){ensureWSUnderscoreMixins();var B={};window.position_ads=function(){_(A).each(function(C){var E=$("#"+C+"-placeholder").offset();var D=false;for(key in E){if(Math.abs(E[key]-((B[C]||{})[key]||0))>=1){D=true}}B[C]=E;if(D){$("#"+C).css("position","absolute").offset(E)}})};_(position_ads).thump(500,20);$(window).resize(position_ads);return position_ads}function set_cookie(B,D,G,F,C,E){var A=B+"="+escape(D);if(G){date=new Date();date.setTime(date.getTime()+(G*24*60*60*1000));A+="; expires="+date.toGMTString()}if(F){A+="; path="+escape(F)}if(C){A+="; domain="+escape(C)}if(E){A+="; secure"}document.cookie=A}function get_cookie(B){var A=document.cookie.match("(^|;) ?"+B+"=([^;]*)(;|$)");if(A){return(unescape(A[2]))}else{return null}}function delete_cookie(D){var C="/";var B="walkscore.com";var A=D+"=";A+=(C)?";path="+C:"";A+=(B)?";domain="+B:"";A+=";expires=Thu, 01-Jan-1970 00:00:01 GMT";document.cookie=A}function nomobileCookie(A){set_cookie("nomobile",A?"true":"",7,"/","walkscore.com")}var initMobileSearchForm=(function(){var A=false;function B(){if(A){return true}if(!$("#search_form")[0]){return false}$("#search_form").submit(function(C){window.location="/j/score/"+urlifyAddress($("#street_search").val());return false});$("#search").live("pageshow",function(E,D,C){if(D.prevPage[0]){$("#search_cancel").attr("href","#"+D.prevPage[0].id)}else{$("#search_cancel").remove()}});return A=true}return B})();function locate_to_accuracy_for_seconds(E,D,F,B,C,A){C||(C=1);D||(D=10);if((A&&A.coords.accuracy<=E)||C>D){return F(A)}_(_(function(){navigator.geolocation.getCurrentPosition(_(locate_to_accuracy_for_seconds).bind(this,E,D,F,B,C+1),B,{enableHighAccuracy:true,maximumAge:100})}).bind(this)).delay(A?1000:1)}function haveLocalStorage(){if(DEBUG_BLOCK_LOCALSTORAGE){return false}try{return"localStorage" in window&&window.localStorage!==null}catch(A){return false}}var LocalCache=(function(){var K=4;var A=1000*60*60*24;function G(L){this.key=L;this.size=10;this.expiration=A;this._default=null}var B=G.prototype;B.setKey=function(L){this.key=L;return this};B.setLocation=function(L){this.geoData=L;return this};B.setSize=function(L){this.size=L;return this};B.setExpiration=function(L){this.expiration=L;return this};B.setDefault=function(L){this._default=L;return this};B.isPersistent=function(){return this.storedSuccessfully};B.fetch=null;B.store=null;B.clear=null;var E,D;if(haveLocalStorage()){if((window.localStorage._ws_v||"0")!=K){window.localStorage.clear();try{window.localStorage._ws_v=K}catch(F){}}G.clearLike=function(N){for(var M=0;M<window.localStorage.length;M++){var L=window.localStorage.key(M);if(L.match(N)){window.localStorage[L]=[]}}};D=function(){var L=JSON.stringify(this._data);try{window.localStorage[this.key]=L;return this.storedSuccessfully=true}catch(M){return this.storedSuccessfully=false}};E=function(){if(this._data){return }try{this._data=JSON.parse(window.localStorage[this.key]||"[]")}catch(L){this._data=[]}}}else{D=function(){return true};E=function(){this._data=this._data||[]};G.clearLike=function(L){G.noPost=true}}var J=function(M,L){return(M.lat==L.lat&&M.lng==L.lng)};var I=function(M,L){return((M.time-L.time)>this.expiration)};var C=function(){if(!(this.geoData&&this.geoData.getLatLng&&this.geoData.getLatLng())){throw"Missing GeoData in LocalCache, with cache key "+this.key}};var H=function(){if(!this.key){throw"Missing key in LocalCache"}};B.clear=function(){this.store()};B.store=function(N){_(C).bind(this)();_(H).bind(this)();_(E).bind(this)();var M={lat:this.geoData.getLat(),lng:this.geoData.getLng(),time:(new Date).getTime()};var L=_(this._data).detect(_(J).bind(this,M));if(L){M.time=L.time;this._data=_(this._data).reject(_(J).bind(this,M))}if(N){M.data=simplifyDataStructure(N),this._data.push(M)}while(this._data.length>this.size){this._data.shift()}while(!_(D).bind(this)()&&this._data.length>=1){this._data.shift()}};B.fetch_raw=function(){return this.fetch(true)};B.fetch=function(N){_(C).bind(this)();_(H).bind(this)();_(E).bind(this)();var M={lat:this.geoData.getLat(),lng:this.geoData.getLng(),time:(new Date).getTime()};if(window._ws_init_local_cache_posts&&_ws_init_local_cache_posts[this.key]){this._data.push(_ws_init_local_cache_posts[this.key]);delete (_ws_init_local_cache_posts[this.key])}this._data=_(this._data).reject(_(I).bind(this,M));var L=_(this._data).detect(_(J).bind(this,M));return L?(N?L:L.data):simplifyDataStructure(this._default)};B.empty=function(L){_(C).bind(this)();_(H).bind(this)();_(E).bind(this)();this._data=[];_(D).bind(this)()};return G})();function SimpleCache(){this.data={};this.put=function(A,B){this.data[A]=B};this.get=function(A){return(paramIsSet(this.data[A]))?this.data[A]:null};this.hasKey=function(A){return(paramIsSet(this.data[A]))?true:false};this.clear=function(A){this.data[A]=null;delete this.data[A]};this.clearAll=function(){for(var A in this.data){delete this.data[A]}}}function countCityLikeVote(A,C){var B=A;if(B.lastIndexOf("/")==B.length-1){B=B.substr(0,B.length-1)}B=B.substr(B.lastIndexOf("/")+1);$.ajax({type:"POST",url:"/data/count-user-vote.php",data:{city:B,vote:C?"up":"down"},success:function(D){},error:function(){}})}function postParams(A,C){var B=$("<form>").attr("method","post").attr("action",A);$.each(C,function(D,E){$("<input type='hidden'>").attr("name",D).attr("value",E).appendTo(B)});B.appendTo("body");B.submit()}function getObjectType(B){var A=Object.prototype.toString.call(B).match(/^\[object ([^\]]+)\]$/);if(A){return A[1]}return"Unknown"}function simplifyDataStructure(E){var D=getObjectType(E);var A;switch(D){case"Array":A=[];for(var C=0;C<E.length;C++){A.push(simplifyDataStructure(E[C]))}break;case"Object":A={};for(var B in E){if(E.hasOwnProperty&&E.hasOwnProperty(B)){A[B]=simplifyDataStructure(E[B])}}break;case"String":case"Number":case"Boolean":return E;break;default:if(_(E).isNull()){A=null}}return A}function newAmenityPoster(B,A){return function(D){var C={};_([A.amenityService.localCache,A.amenityService.curationCache,A.dataFetcher.responseCache]).each(function(F){if(!F.isPersistent()&&!LocalCache.noPost){C[F.key]=F.fetch_raw()}});if(!_(C).isEmpty()){D.preventDefault();var E={caches:JSON.stringify(simplifyDataStructure(C))};postParams($(B).attr("href"),E)}}}function initAmenityPost(A,B){for(var D=0;D<B.length;D++){var C=$("#"+B[D]);C.click(newAmenityPoster(C,A))}}function scoreRandomNeighbors(A,B){if(!(B&&B>0)){console.log("Count reached zero... done.");return }var C=0.01;A.geoData=new GeoData(A.geoData.getQuery(),new A.LatLng(A.geoData.getLat()+((Math.random()-0.5)*C),A.geoData.getLng()+((Math.random()-0.5)*C)),A.geoData.getCountryCode());A.amenityService=new AmenityService();A.amenityManager=new AmenityManager(A.app,A.geoData);console.log("Scoring",A.geoData.getLat(),A.geoData.getLng());A.debug_no_send_amenities=true;new Scorer(A).scoreRealTime(function(D){console.log("Score:",D.score,"(Calc's Amenities)");A.debug_no_send_amenities=false;new Scorer(A).scoreRealTime(function(E){if(!A.rtcprof){A.rtcprof={};A.rtcprof.rtc_total=0;A.rtcprof.rtc_good=0;A.rtcprof.rtc_max_diff=0}var F=Math.abs(E.score-D.score);A.rtcprof.rtc_total++;if(F==0){A.rtcprof.rtc_good++}else{if(F>A.rtcprof.rtc_max_diff){A.rtcprof.rtc_max_diff=F}console.log("Off by:",F);console.log("Response:",D,"(Calc's Amenities)");console.log("Response:",E,"(Our Amenities)")}console.log("Score:",E.score,"(Our Amenities)");console.log("Total:",A.rtcprof.rtc_total,"Good:",A.rtcprof.rtc_good,"Max diff:",A.rtcprof.rtc_max_diff);scoreRandomNeighbors(A,B-1)})})}function test_RTC_performance(B,A,E){if(!(A&&A>0)){console.log("Count reached zero... done.");return }if(E){var D=0.01;B.geoData=new GeoData(B.geoData.getQuery(),new ws.LatLng(B.geoData.getLat()+((Math.random()-0.5)*D),B.geoData.getLng()+((Math.random()-0.5)*D)),B.geoData.getCountryCode());B.amenityService=new AmenityService()}B.amenityManager=new AmenityManager(B.app,B.geoData);console.log("Scoring",B.geoData.getLat(),B.geoData.getLng());var C=(new Date).getTime();new Scorer(B).scoreRealTime(function(G){if(!B.rtcprof){B.rtcprof={};B.rtcprof.rtc_total=0;B.rtcprof.rtc_time=0}var F=(new Date).getTime()-C;B.rtcprof.rtc_time+=F;console.log("Score",G.walkscore);console.log("Time",F/1000);B.rtcprof.rtc_total++;console.log("Total:",B.rtcprof.rtc_total,"Average time:",(B.rtcprof.rtc_time/B.rtcprof.rtc_total)/1000,"PPS:",B.rtcprof.rtc_total/(B.rtcprof.rtc_time/1000));test_RTC_performance(B,A-1)})}function parseJson(jsonStr){if(!jsonStr||typeof jsonStr!="string"||jsonStr.length==0){return null}try{return eval("("+jsonStr+")")}catch(err){return null}}if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());Rot13={map:null,convert:function(B){Rot13.init();var C="";for(i=0;i<B.length;i++){var A=B.charAt(i);C+=((A>="A"&&A<="Z")||(A>="a"&&A<="z")?Rot13.map[A]:A)}return C},init:function(){if(Rot13.map!=null){return }var B=new Array();var A="abcdefghijklmnopqrstuvwxyz";for(i=0;i<A.length;i++){B[A.charAt(i)]=A.charAt((i+13)%26)}for(i=0;i<A.length;i++){B[A.charAt(i).toUpperCase()]=A.charAt((i+13)%26).toUpperCase()}Rot13.map=B}};function reversespecialchars(A){if(typeof (A)=="string"){A=A.replace(/&amp;/g,"&");A=A.replace(/&quot;/g,'"');A=A.replace(/&#039;/g,"'");A=A.replace(/&lt;/g,"<");A=A.replace(/&gt;/g,">")}return A}function CustomGetTileUrl(B,C){var A=1<<C;var D=A-B.y-1;if(!window.BASE_TILE_URL){window.BASE_TILE_URL="http://tilecache-2011.walkscore.com.s3.amazonaws.com/"}return BASE_TILE_URL+C+"/"+B.x+"/"+D+".png"}function WSIDAuth(A){this._init(A)}(function(){var C=WSIDAuth.prototype;C.if_free=function(D){return this._add_continuation(A,D)};C.if_paid=function(D){return this._add_continuation(B,D)};var A="free";var B="paid";C._init=function(D){_(ws_simple_init).bind(this)(D,["wsid","domain"]);this._continuation_queue_=[];this._fire()};C._add_continuation=function(D,E){this._continuation_queue_.push({type:D,continuation:E});this._process_queue();return this};C._process_queue=function(){if(!this._type_){return }var D;while(D=this._continuation_queue_.shift()){if(D.type==this._type_){D.continuation()}}};C._fire=function(){$.ajax({url:"/auth/amenity_map_auth",type:"GET",dataType:"json",data:{wsid:this.wsid,domain:this.domain},success:_(this._handle_response).bind(this),error:_(this._handle_response).bind(this,null),timeout:3000})};C._handle_response=function(D){this._type_=(D&&D.status&&D.status!=1)?A:B;this._process_queue()}})();function ParameterManager(A){this._init(A)}(function(){var C=ParameterManager.prototype;C.add_free=function(E,D,F){this._add(A,E,D,F)};C.add_paid=function(E,D,F){this._add(B,E,D,F)};C.do_with_one=function(D,E){this._queues_[D]||(this._queues_[D]=[]);this._queues_[D].push(E);this._process_queue(D)};C.do_with_all=function(D){this.do_with_one("",D)};C.do_with_some=function(D,G){var E={};var F=CountDownHash(D,function(){G(E)});_(D).each(_(function(H){this.do_with_one(H,function(I){E[H]=I;F(H)})}).bind(this))};var A="free";var B="paid";C._init=function(D){_(ws_simple_init).bind(this)(D,["auth"]);this._values_={};this._queues_={}};C._add=function(E,G,D,H){if(!_(this._queues_).isEmpty()){throw ("ParameterManager: All parameters must be added prior to registering callbacks")}this._values_[G]=undefined;H||(H="");var F=function(I){this._values_[G]=I?(D||H):H;this._process_queue(G);this._process_queue("")};if(E==B){this.auth.if_free(_(F).bind(this,false)).if_paid(_(F).bind(this,true))}else{_(F).bind(this)(true)}};C._process_queue=function(F){if(_(this._queues_).isEmpty()){return }var E=this._values_;for(var D in E){if((!F||D==F)&&_(E[D]).isUndefined()){return }}_(this._queues_[F]||[]).each(function(G){G(F?E[F]:E)});this._queues_[F]=[]}})();var app_loader=function(A){var B=function(){ensureWSUnderscoreMixins();window.have_google=_(window.google).spelunk(["maps","Map"]);window.have_bing=_(window.Microsoft).spelunk(["Maps","Map"]);if(have_google){ensure_ws_v3_extensions()}if(have_bing){ensure_ws_bing_extensions()}A()};var C=new CountDownHash(["google","page"],B);window.google_ready=function(){C("google")};return function(){C("page")}};
