if(!__u.Browser.isSupported()){location.href="http://"+MAPS_LITE_HOST+"/mapslite"+document.location.search;
}Page={MaxLoads:100,IsLoaded:false,Debug:false,printMap:null,EmbedView:false,Map:null,OnLoad:function(A){__l.Defaults.AMX_HOST=window.location.protocol+"//"+window.location.host+window.location.pathname.substr(0,window.location.pathname.lastIndexOf("/"));
__l.Defaults.MapsHostPath=__l.Defaults.AMX_HOST+__l.Defaults.MapsPath;
__l.Defaults.SP=SP?SP:"http://sp.ask.com/sh/i/maps2/";
__u.Defaults.StaticDomain=_staticDomain?_staticDomain:"http://sp.ask.com/";
__u.Defaults.SP=__l.Defaults.SP;
__l.Defaults.StaticTileHost=STATIC_TILE_HOST?STATIC_TILE_HOST:__l.Defaults.StaticTileHost;
__l.Defaults.CacheTileHost=CACHE_TILE_HOST?CACHE_TILE_HOST:__l.Defaults.CacheTileHost;
__l.Defaults.partnerId=PARTNER_ID;
__l.Defaults.StaticPrintRoot="http://sp.ask.com/sh/i/local/";
Page.EmbedView=EMBED_VIEW;
if(!(Page.EmbedView&&__u.Browser.isIE6)){__u.Events.addListener(window,"resize",Page.Resize);
}var E=new __u.QueryString(document.location.search.substring(1));
Page.patternID=E.get("o",0);
Page.Debug=E.get("fmt","")=="debug";
if(Page.Debug){__u.Console.enable();
}__l.Defaults.qsrc=E.get("qsrc",121);
SB.Header=document.getElementById("sbhdr");
SB.Container=document.getElementById("sb");
SB.Content=document.getElementById("sidebar");
SB.HeaderLinks=document.getElementById("sbhdrbtns");
SB.DirsHeader=document.getElementById("sbhdrdir");
SB.LocHeader=document.getElementById("sbhdrloc");
SB.WelHeader=document.getElementById("sbhdrwel");
SB.ResizeBar=document.getElementById("resize");
SB.ResizeBar.onclick=SB.ToggleLinkClick;
SB.ResizeButton=document.getElementById("resizebtn");
SB.SponsoredDiv=document.getElementById("sponsoredResults");
SB.Container.style.zIndex=202;
SB.Header.style.zIndex=202;
SB.ResizeBar.style.zIndex=202;
SB.SponsoredDiv.style.zIndex=202;
if(document.getElementById("ask_header")!=null){document.getElementById("ask_header").style.zIndex=203;
}View.ViewArea=document.getElementById("view");
View.Map=this.Map=new ask.Map(View.ViewArea.id);
if(usr_location!=undefined){View.Map.CenterAndZoom([{"Point":usr_location}],13);
}this.Map.OnDirectionsReady=function(J,I){};
var C=View.Map;
C.openInfoWindow=function(I,J){if(!C.gblPin){C.gblPin=new ask.Map.IndependentPoi(C);
C.gblPin.Remove=function(){};
}C.gblPin.Point=new ask.Map.Point(I.lat,I.lng);
C.gblPin.Name=J;
C.gblPin.Redraw();
};
C.getBounds=function(){var I=C.map.GetMapView();
return{minLat:I.TopLeftLatLong.Longitude,minLong:I.BottomRightLatLong.Longitude,maxLat:I.TopLeftLatLong.Latitude,maxLong:I.BottomRightLatLong.Latitude,containsPoint:function(J){return false;
}};
};
C.centerOn=function(J,I){var K=C.RouteTurn;
if(!K){K=C.RouteTurn=new ask.Map.IndependentPoi(C);
K.SetIcon("http://sp.ask.com/sh/i/maps2/icons/concentric_circles/small_circles.gif");
}K.Point=new ask.Map.Point(J.lat,J.lng);
K.Name=decodeURIComponent(J.address);
K.StepNumber=""+(I+1);
K.DlgIdContextMenu="ask.Map.RouteStep.ContextMenu";
K.Update();
K.Select(1);
};
__l.UI.locSuggest=new ask.widget.Suggest({maxWidth:200,maxHeight:250});
__l.UI.locSugSetHt();
__l.UI.locSuggest.customSetSuggestions=__l.UI.locSugSetSugg;
__l.UI.locSuggest.customShowSuggest=__l.UI.locSugShow;
__l.UI.locSuggest.customHideSuggest=__l.UI.locSugHide;
if(__l.UI.locSuggest.suggestions.length==0){__l.UI.locSuggest.setSuggestions();
}var G=false;
if(E.get("ml",null)){SB.RecreateFromPath(E.get("ml",""));
G=true;
}if(E.get("a",null)){Header.MapLoc(E.get("a",""));
G=true;
}else{if(E.get("sa",null)||E.get("fa",null)){var D=[];
D.push(E.get("sa",""));
D.push(E.get("fa",""));
Header.MapMultipleLocs(D);
G=true;
}else{if(E.get("a2",null)){var H=E.get("a1","")+" "+E.get("a2","");
Header.MapLoc(H);
G=true;
}else{if(E.get("sa2",null)&&E.get("fa2",null)){var F=E.get("sa1","")+" "+E.get("sa2","")+" to "+E.get("fa1","")+" "+E.get("fa2","");
Header.MapLoc(F);
G=true;
}}}}var B=__d.get("mapsFooter");
if(B){B.style.visibility="visible";
}Page.Resize();
if(!Page.EmbedView){SB.ToggleVis(true);
}if(!G){SB.AddNextEmptyLoc();
}Page.IsLoaded=true;
},AvailHeight:function(){var A=__u.Browser.getBounds();
return A.height-__u.Dom.getY(View.ViewArea);
},AvailWidth:function(){return document.body.clientWidth-5;
},Resize:function(){var A=Page.AvailHeight()-(!__u.Browser.isIE6?2:0);
var E=Page.AvailWidth();
var B=21;
if(A>screen.availHeight){return ;
}if(A<85){A=85;
}SB.Container.style.height=A-85+"px";
var D=10;
SB.ResizeBar.style.height=A+"px";
SB.ResizeBar.style.width=D+"px";
SB.ResizeBar.style.left=SB.ContainerWidth+"px";
var C=E-SB.ContainerWidth;
var F=__u.Browser.isIE?0:2;
if(C<D+2){C=D+2;
}View.ViewArea.style.width=C-D-F+"px";
View.ViewArea.style.height=A-B+"px";
View.ViewArea.style.left=SB.ContainerWidth+D+"px";
Page.Map&&Page.Map.Resize(C-D-F,A-B);
if(A<42){A=42;
}}};
DHTML={FadeToTransparent:function(F,B,E,D,A,C){if(F){B.style.display="none";
}},FadeToTransparentDefault:function(B,A){DHTML.FadeToTransparent(B,A,100,20,20,150);
},FadeToOpaque:function(F,B,E,D,A,C){if(F){B.style.display="block";
}},FadeToOpaqueDefault:function(B,A){DHTML.FadeToOpaque(B,A,0,100,20,50);
},ShrinkToWidth:function(H,G,F,C,E){if(H&&SB.ContainerWidth!=F){var D=0;
var B="";
SB.ContainerWidth=F;
SB.Content.style.display="none";
SB.SponsoredDiv.display="none";
for(var A=G;
A>=F;
A=A-C){B='SB.Container.style.width="'+A+'px";';
B+='SB.Header.style.width="'+A+'px";';
B+='SB.ResizeBar.style.left="'+(A)+'px";';
setTimeout(B,D);
D+=E;
}setTimeout("Page.Resize();",D+50);
}},ShrinkToWidthDefault:function(A){DHTML.ShrinkToWidth(SB.Container,300,0,50,50);
},GrowToWidth:function(H,G,F,C,E){if(H&&SB.ContainerWidth!=F){var D=0;
var B="";
for(var A=G;
A<=F;
A=A+C){B='SB.Container.style.width="'+A+'px";';
B+='SB.Header.style.width="'+A+'px";';
B+='SB.ResizeBar.style.left="'+(A)+'px";';
if(A>=F){B+="SB.ContainerWidth="+F+";SB.HeaderLinks.style.display='block';";
}setTimeout(B+";Page.Resize();",D);
D+=E;
}setTimeout("SB.Content.style.display='block';SB.SponsoredDiv.style.display='block';Page.Resize();",D+50);
}},GrowToWidthDefault:function(A){DHTML.GrowToWidth(SB.Container,0,300,50,50);
},Error:function(A){if(A){A.className+=" err";
}},HighLight:function(A){if(A){A.className+=" hilt";
}},GrayOut:function(A){if(A){A.className+=" grot";
}}};
var _ke_playing=false;
var _ke_stop=false;
var _ke_pause=false;
var _ke_locidx,_ke_frameidx;
var _cur_frame;
KE={ToggPlay:function(A){switch(A){case"PLAY":clearTimeout(_cur_frame);
_ke_stop=false;
_ke_playing=true;
if(_ke_pause){_ke_pause=false;
KE.PlayFrame(_ke_locidx,_ke_frameidx,true);
}else{KE.PlayFrame(0,0,true);
}break;
case"PAUSE":clearTimeout(_cur_frame);
_ke_pause=true;
_ke_stop=false;
_ke_playing=false;
break;
case"STOP":clearTimeout(_cur_frame);
_ke_stop=true;
_ke_playing=false;
_ke_pause=false;
_ke_locidx=0;
_ke_frameidx=0;
if(View.AutoDrive){View.AutoDrive.playOnImg.style.display="";
View.AutoDrive.pauseImg.style.display="none";
View.AutoDrive.stopImg.style.display="";
View.AutoDrive.stopOnImg.style.display="none";
}break;
}},PlayFrame:function(E,C,B){_ke_locidx=E;
_ke_frameidx=C;
if((_ke_stop||_ke_pause)&&B){return ;
}var F=SB.Locs[E];
if(F&&F.lat){if(C==0){SB.MoveTo(E);
}if(F.showDirs&&F.directionsXml){var H=F.directionsXml.getElementsByTagName("Item");
var A=H[C];
if(A){var G=A.getAttribute("s");
var K=A.firstChild.nodeValue;
K=__u.String.replaceChars(K,"{}","<>");
K=K.replace("LEFT",'<img src="'+__l.Defaults.SP+'left_turn.gif"/> <b>LEFT</b>');
K=K.replace("RIGHT",'<b>RIGHT</b> <img src="'+__l.Defaults.SP+'right_turn.gif"/>');
var J=A.getAttribute("di");
if(G){var M=G.split(",");
var I=parseFloat(M[0]);
var L=parseFloat(M[1]);
var D=E==0&&C==0;
KE.MoveBalloonTo(I,L,encodeURIComponent(K),D,C);
C++;
}}else{E++;
C=0;
}}else{E++;
C=0;
F.showBalloon(true);
}if(B&&E<SB.Locs.length-1){__u.Threading.waitFor("!SB.Locs["+E+"].showDirs || SB.Locs["+E+"].route.loaded","_cur_frame=setTimeout('KE.PlayFrame("+E+","+C+",true);',3000);",1000);
}else{if(_ke_playing){KE.ToggPlay("STOP");
}}}else{if(_ke_playing){KE.ToggPlay("STOP");
}}},MoveBalloonTo:function(E,C,G,F,B){var D=View.Map.zoom;
if(F){D=parseInt(_sb_LocTypes["street"]);
}var A=new __l.Point(E,C,G);
View.Map.centerOn(A,B);
},getContextHtml:function(G,E,H){var D=__u.GeoMath.pix2lat(E,View.Map.zoom);
var B=__u.GeoMath.pix2long(G,View.Map.zoom);
var A='<p style="border-bottom:1px solid silver;margin-top:5px;margin-bottom:5px;"/>';
var C='<p class="pad"><b>Options</b></p>';
C+='<p style="border-bottom:1px solid silver;margin-top:5px;margin-bottom:5px;"/>';
if(H!=null){C+='<p class="pad">&middot;<a class="lnkblue" title="Remove this location" href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);SB.RemoveLoc('+H+');" onmousedown="sct(44032,this);" ><b>Remove&nbsp;location</b></a></p>';
}else{C+='<p class="pad">&middot;<a class="lnkblue" title="Add a location right here" href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);KE.AddLoc('+D+","+B+');"  onmousedown="sct(44031,this);" ><b>Add location</b></a></p>';
}C+=A;
C+='<p class="pad">&middot;<a class="lnkblue" title="Center the map here" href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);View.Map.moveViewTo('+G+","+E+');"  onmousedown="sct(44034,this);" >Center here</a></p>';
C+=A;
if(H!=null){var F=SB.Locs[H];
if(F){C+='<p class="pad">&middot;<a class="lnkblue" title="Zoom to this location" href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);View.Map.moveViewToLLZ('+F.lat+","+F.lng+',3);"  onmousedown="sct(44034,this);" >Zoom&nbsp;to&nbsp;Street</a></p>';
}}else{C+='<p class="pad">&middot;<a class="lnkblue" title="Zoom in to this position"     href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);View.Map.zoomInToLatLng('+D+","+B+');"    onmousedown="sct(44035,this);" >Zoom in</a></p>';
C+='<p class="pad">&middot;<a class="lnkblue" title="Zoom out from this position"  href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);View.Map.zoomOutFromLatLng('+D+","+B+');" onmousedown="sct(44036,this);" >Zoom out</a></p>';
}C+=A;
C+='<p class="pad">&middot;<a class="lnkblue" title="See all your locations on one map" href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);View.Map.showAllOverlays();"  onmousedown="sct(44033,this);" >Show&nbsp;all&nbsp;locations</a></p>';
C+='<p class="pad">&middot;<a class="lnkblue" title="Remove all locations from the map" href="javascript:void(0);" onclick="javascript:View.ContextMenu.setVisible(false);SB.ClearLinkClick(event);"    onmousedown="sct(44032,this);" >Clear&nbsp;all&nbsp;locations</a></p>';
return C;
},AddLoc:function(E,C){if(SB.Locs.length<=SB.MaxLocs){var D=__u.Math.Round(E,5)+","+__u.Math.Round(C,5);
var B=new Loc(SB.Locs.length-1,E,C,D,null,null);
var A=new Array();
A["Address"]=D;
A["Coords"]=D;
A["Status"]=__u.Browser.isIE?"RLStartIE":"RLStart";
A["Index"]=B.id;
A["LocCount"]=SB.Locs.length;
A["sp"]=__l.Defaults.SP;
B.html=SB.getBalloonHtml(A);
SB.Locs.splice(B.id,1,B);
Loc.ReqRevLook(B);
B.showBalloon(false);
}},AddLocation:function(A){var B=ask.Map.UI.GetMapByUI(A);
View.Map=B;
if(B.IndependentPoiList.length>=SB.MaxLocs){B.HidePopups();
alert("We are only able to provide Directions for "+SB.MaxLocs+" or fewer locations.\nPlease remove one or more locations to continue.");
return ;
}setTimeout(function(){KE.AddLoc(B.ContextMenuObj.Point.Lat,B.ContextMenuObj.Point.Lon);
},0);
B.HidePopups();
}};
Logging={Log:function(A){AjaxRequest.get({"url":A,"onSuccess":function(B){Logging.LogCallBack(B);
}});
},LogCallBack:function(A){}};
Header={PageHeader:null,AddressInput:null,Loading:null,GetTitle:function(B){var G=B?"":I18N_MESSAGE_MAPS_TITLE;
if(SB.Locs.length>0){var F=SB.Locs[0];
var D=null;
if(F&&F.addr.length>0){var A=-1;
for(var C=SB.Locs.length-1;
C>0;
C--){var E=SB.Locs[C];
if(E.lat&&E.addr.length>0){A=C;
D=SB.Locs[A];
break;
}}if(!D){G=F.addr;
if(!B){G+=I18N_MESSAGE_MAPS_TITLE_SUFFIX_MAP;
}}else{if(F.mode==0){G=F.addr+" to "+D.addr;
if(!B){G+=I18N_MESSAGE_MAPS_TITLE_SUFFIX_DRIVING;
}}else{G=F.addr+" to "+D.addr;
if(!B){G+=I18N_MESSAGE_MAPS_TITLE_SUFFIX_WALKING;
}}}}}G=G.replace(/(^\s*)|(\s*$)/g,"");
return G;
},MapLoc:function(E){try{if(E.length==0){SB.ClearAll();
SB.AddEmptyLocAt(0);
View.Map.reset();
}else{var C=E.toLowerCase().indexOf(" to ");
if(C>-1){var A=E.split(" to ");
Header.MapMultipleLocs(A);
}else{SB.ClearAll();
SB.AddEmptyLocAt(0);
var D=SB.GetLocInputFromIndex(0);
if(D){D.value=E;
SB.ReqAddr(D);
}}}}catch(B){}},MapMultipleLocs:function(C){if(!C||C.length==0){return ;
}SB.ClearAll();
var F=__u.Math.Random();
var A=C.length;
for(var B=0;
B<A;
B++){SB.AddEmptyLocAt(B);
var D=SB.GetLocInputFromIndex(B);
var E=C[B];
if(D&&E.length>0){D.value=E;
}}SB.ReqAddresses(A);
},BookmarkAbsoluteUrl:function(){if(!Page.IsLoaded){return ;
}var A=__l.Defaults.MapsHostPath+"?ml="+Header.BuildAbsoluteUrl();
if(__u.Browser.isIE){window.external.AddFavorite(A,document.title);
}else{if(window.sidebar){window.sidebar.addPanel(document.title,A,"");
}}},LoadAbsoluteUrl:function(){if(!Page.IsLoaded){return ;
}location.href=__l.Defaults.MapsHostPath+"?ml="+Header.BuildAbsoluteUrl();
},EmailAbsoluteUrl:function(){if(!Page.IsLoaded){return ;
}location.href="mailto:?subject="+encodeURIComponent(document.title)+"&body="+encodeURIComponent(__l.Defaults.MapsHostPath+"?ml="+Header.BuildAbsoluteUrl());
},BuildAbsoluteUrl:function(){return encodeURIComponent(SB.LocsToString());
},LoadBaseUrl:function(){window.location.href=__l.Defaults.MapsHostPath;
},GetPhoto:function(){try{var B=12-Math.round(((13*(View.Map.zoom+1))/(__u.GeoMath.MAXZOOM-3)));
B=Math.max(1,B);
B==Math.min(13,B);
var A="http://www.globexplorer.com/ImageAtlas/print.do?group=AskJeeves&lat="+__u.Math.Round(__u.GeoMath.pix2lat(View.Map.centerY,View.Map.zoom),5)+"&lon="+__u.Math.Round(__u.GeoMath.pix2long(View.Map.centerX,View.Map.zoom),5)+"&zoom_level="+B;
window.open(A);
}catch(C){alert("Could not load the photo print page");
}}};
View={ViewArea:null,Map:null};
function iLatNode(A){return parseInt(A.getAttribute("iLat"))/__u.GeoMath.LATLONSCALE;
}function iLongNode(A){return parseInt(A.getAttribute("iLong"))/__u.GeoMath.LATLONSCALE;
}function latNode(A){return parseFloat(A.getAttribute("lat"));
}function longNode(A){return parseFloat(A.getAttribute("long"));
}function Coordinate(B,A){this.lat=B;
this.lng=A;
this.x=function(){return __u.GeoMath.long2pix(this.lng,View.Map.zoom);
};
this.y=function(){return __u.GeoMath.lat2pix(this.lat,View.Map.zoom);
};
}var _sb_dwOffsetTop=120;
var _sb_ActiveLoc=-1;
var _sb_LocsString="";
var _SB_HIDE_ARROW='<a title="Hide Sidebar" class="resizeHide"/>';
var _SB_SHOW_ARROW='<a title="Show Sidebar" class="resizeShow"/>';
var _SB_SPACER='<div style="padding:5px;"></div>';
var _SB_NEW_LOC_INDEX=-1;
var _SB_SHOW_TXT="Directions";
var _SB_HIDE_TXT="Directions";
var _SB_OTHER_MATCHES="&lt;Other addresses found&gt;";
function SB(){}SB.Container=null;
SB.Content=null;
SB.Header=null;
SB.HeaderLinks=null;
SB.ResizeBar=null;
SB.ContainerWidth=0;
SB.Locs=new Array(0);
SB.Steps=document.createElement("table");
SB.Colors=new Array("blue","red","orange","green","brown");
SB.MaxLocs=10;
SB.Mode=0;
SB.Roundtrip=false;
SB.GetIndexFromId=function(C){var B=-1;
var A=C.split("_");
if(A.length==2){B=parseInt(A[1]);
}return B;
};
SB.ExpandAll=function(){var B=0;
for(var A=0;
A<SB.Locs.length-2;
A++){SB.EnableHideDirs(A,false);
}__d.get("sbExpandAll").className="txlpbl cur";
__d.get("sbCollapseAll").className="txlpbl";
};
SB.CollapseAll=function(){for(var A=0;
A<SB.Locs.length-1;
A++){SB.EnableHideDirs(A,true);
}__d.get("sbExpandAll").className="txlpbl";
__d.get("sbCollapseAll").className="txlpbl cur";
};
SB.EnableHideDirs=function(D,C){var A=this.Mode;
var G=A==0?1:0;
if(C){SB.Locs[D].showDirs=false;
var F=__d.get("sbLocDirDiv_"+D);
if(F){F.style.display="none";
}var E=__d.get("sbType_"+A+"_"+D);
var B=__d.get("sbType_"+G+"_"+D);
if(E){E.className="optbox";
}if(B){B.className="optbox2";
}}else{SB.Locs[D].showDirs=true;
var F=__d.get("sbLocDirDiv_"+D);
if(F){F.style.display="block";
}var E=__d.get("sbType_"+A+"_"+D);
var B=__d.get("sbType_"+G+"_"+D);
if(E){E.className="optboxOpen";
}if(B){B.className="optbox2";
}}};
SB.DirsTabClick=function(B,H){if(SB.Locs.length==3&&(SB.Locs[0].lat==null||SB.Locs[1].lat==null)){return ;
}var C=0;
if(SB.Locs.length>3&&SB.Locs[0].lat==null){C=1;
}var G=document.getElementById("sbLocDirDiv_"+B);
var E=G.style.display=="none"||G.style.display.length==0;
var D=H!=SB.Locs[B].mode;
if(D){var F=SB.Locs[B];
if(F){F.clearDirs();
}}var A=E||D;
SB.Mode=H;
for(;
C<SB.Locs.length-2;
C++){SB.ToggleDirsVis(C,true,null);
}if(SB.Roundtrip&&SB.Locs[0].lat!=null){SB.ToggleDirsVis(C,true,null);
SB.ReqDirs(H,true);
}else{SB.ReqDirs(H);
}document.title=Header.GetTitle();
};
SB.RenderDisambigDiv=function(F){var E=SB.Locs[F];
var C=document.getElementById("sbLocAmbig_"+F);
if(C){if(C.style.display.length==0||C.style.display=="none"){var J='<span class="txred">Other addresses found</span><br>';
var A=Math.min(E.otherMatches.length,4);
for(var B=1;
B<A;
B++){var D=E.otherMatches[B];
var H=D.lat;
var I=D.lng;
var G=D.address;
J+='&middot;&nbsp;<a href="javascript:void(0);" class="lnkblue txsm" onclick="SB.ChangeInputValue('+F+",'"+encodeURIComponent(G).replace(/'/g,"")+"',"+H+","+I+');return false;">'+G+'</a><br style="padding:5px;">';
}if(A<E.otherMatches.length){J+="<a href=\"javascript:void(0);\" class=\"lnkblue txsm\" onclick=\"this.nextSibling.style.display=this.nextSibling.style.display=='none'?'block':'none';return false;\">more...</a>";
J+="<div style='display:none' id='moreMatches"+B+"'>";
for(var B=A;
B<E.otherMatches.length;
B++){var D=E.otherMatches[B];
var H=D.lat;
var I=D.lng;
var G=D.address;
J+='&middot;&nbsp;<a href="javascript:void(0);" class="lnkblue txsm" onclick="SB.ChangeInputValue('+F+",'"+encodeURIComponent(G).replace(/\'/g,"")+"',"+H+","+I+');return false;">'+G+'</a><br style="padding:5px;">';
}J+="</div>";
}C.innerHTML=J;
C.style.display="block";
}else{C.style.display="none";
}}};
SB.ChangeInputValue=function(C,G,E,B){var D=SB.GetLocInputFromIndex(C);
if(D){G=decodeURIComponent(G);
D.value=G;
if(E&&B){var F=SB.Locs[C];
if(F){F.lat=E;
F.lng=B;
F.addr=G;
F.otherMatches=null;
F.position();
var A=new Array();
A["Address"]=G;
A["Index"]=F.id;
A["LocCount"]=SB.Locs.length;
F.html=SB.getBalloonHtml(A);
SB.SetActiveLoc(C);
__l.UI.addRecentItem(F,G);
SB.ClearMapDirs();
Page.Map.ZoomAll();
SB.ReDraw();
SB.RedrawLocsOnMap();
F.showBalloon(true);
SB.ReqDirsNearIndex(C);
}}else{SB.ReqAddr(D);
}}};
SB.RedrawLocsOnMap=function(){for(var A=0;
A<SB.Locs.length;
A++){var B=SB.GetImageUrlForIndex(A);
SB.Locs[A].id=A;
SB.Locs[A].marker.id=A;
SB.Locs[A].redraw(B);
}};
SB.GetImageUrlForIndex=function(C,B){var A=SB.Locs.length;
var D=SB.Locs[C];
var E="";
if(B){E=__l.Defaults.LocalSP+"red_cir_"+(C+1)+".gif";
}else{E=__l.Defaults.LocalSP+"red_m_"+(C+1)+".png";
}return E;
};
SB.GetLocDivFromIndex=function(A){var B=document.getElementById("sbLocDiv_"+A);
return B;
};
SB.GetLocInputFromIndex=function(A){var B=document.getElementById("sbLocInput_"+A);
return B;
};
SB.ReOrder=function(F,E){if(SB.Locs[F].lat==null){return ;
}if(F==E||E<0){return ;
}var D=SB.Locs[F];
var A=SB.Locs[E];
if(D&&A&&A.lat){var C=SB.Locs[F].showDirs;
var B=SB.Locs[E].showDirs;
SB.Locs[F].showDirs=B;
SB.Locs[E].showDirs=C;
if(F>E){SB.Locs.splice(E,0,D);
SB.RemoveLoc(F+1,true);
}else{SB.RemoveLoc(F,true);
SB.Locs.splice(E,0,D);
}SB.ClearMapDirs();
SB.ReDraw();
SB.RedrawLocsOnMap();
SB.ReqDirsNearIndex(E);
SB.Roundtrip=false;
}};
SB.ToggleLinkClick=function(A){SB.ToggleVis(SB.ResizeButton.innerHTML.indexOf("Show")>-1,true);
};
SB.FocusLinkClick=function(C){if(!C){C=window.event;
}var A=C.srcElement;
focLink=C.srcElement!=null?C.srcElement:C.target;
var B=focLink.id.split("_");
if(B.length==2){var D=parseInt(B[1]);
SB.SetActiveLoc(D);
if(D>_SB_NEW_LOC_INDEX){SB.Locs[D].showBalloon(true);
}}};
SB.LocInputKeyPress=function(A){if(!A){A=window.event;
}if(A.keyCode==13){SB.LocImgClick(A);
}};
SB.LocImgClick=function(D){var C=D.srcElement!=null?D.srcElement:D.target;
var A=SB.GetIndexFromId(C.id);
var B=SB.GetLocInputFromIndex(A);
if(B.value.replace(/(^[\s]*$)/g,"").length>0){SB.ClearDirs(A);
SB.ReqAddr(B);
}SB.ScanForChanges(A);
};
SB.SearchBusiness=function(B,A,F){var E=B.id;
document.body.style.cursor=__u.Browser.defaultCursor;
if(__l.Keys.typing!=null){__l.Keys.typing=null;
}var C=SB.GetIndexFromId(E);
var D=SB.CheckStatus(C,A,F);
SB.ToggleVis(true);
if(D){SB.AddLocFromLocations(C,true,A);
if(SB.RecentLocs){SB.RecentLocs[SB.Locs[C].addr]=SB.Locs[C].addr;
}__l.UI.addRecentItem(SB.Locs[C],SB.Locs[C].addr);
if(SB.Locs[SB.Locs.length-1].lat!=null){SB.AddNextEmptyLoc();
}if(SB.Locs.length<=2){Page.Map.CenterAndZoom([SB.Locs[0].marker.poi],SB.GetZoomLevel(B.address));
if(Page.Map.trafficOn){if(Page.Map.GetZoomLevel()<9){setTimeout(function(){Page.Map.CloseTraffic();
},10);
}else{setTimeout(function(){__l.Proxy.lookupIncident(Page.Map,ask.Map.AddIncidentPin);
},10);
}}}else{Page.Map.ZoomAll();
}SB.SetActiveLoc(C);
SB.ReDraw();
SB.RedrawLocsOnMap();
var G=SB.Locs[C-1];
if(G){G.showDirs=true;
}SB.ReqDirsNearIndex(C);
}};
SB.ScanForChanges=function(B){for(var A=0;
A<SB.Locs.length;
A++){if(A!=B){var C=SB.Locs[A];
locInput=SB.GetLocInputFromIndex(A);
if(C&&locInput.value!=C.addr){SB.ReqAddr(locInput);
}}}};
SB.IsLatLongVal=function(A){return/^\s*-?\d+.?\d*\s*,\s*-?\d+.?\d*\s*$/.test(A);
};
SB.AddLocFromLatLong=function(F){document.body.style.cursor=__u.Browser.defaultCursor;
var C=SB.GetIndexFromId(F.id);
var D=F.value.split(",");
if(D.length==2){var E=parseFloat(D[0]);
var B=parseFloat(D[1]);
if(SB.Locs[C]){SB.Locs[C].destroy();
}var A=new Loc(C,E,B,F.value,null,null);
SB.Locs[C]=A;
View.Map.showAllOverlays();
if(SB.Locs[SB.Locs.length-1].lat!=null){SB.AddNextEmptyLoc();
}if(SB.Locs.length>2){SB.ToggleVis(true);
}SB.SetActiveLoc(C);
SB.Locs[C].showBalloon(false);
SB.ReDraw();
SB.RedrawLocsOnMap();
__l.UI.addRecentItem(SB.Locs[C],SB.Locs[C].addr);
}};
SB.CheckStatus=function(C,A,B){var E="We were unable to find this address. Please try again.";
var G=document.getElementById("sbLocMessage_"+C);
var F=false;
var D=E;
if(A.length>0){F=true;
}if(G){if(F){G.style.display="none";
}else{if(!B){G.innerHTML=D;
G.style.display="block";
DHTML.Error(document.getElementById("sbLocInputDiv_"+C));
}}}return F;
};
SB.ReqTimeout=function(C){document.body.style.cursor=__u.Browser.defaultCursor;
if(C){var A=SB.GetIndexFromId(C.id);
if(C!=SB.GetLocInputFromIndex(A)){return ;
}var B=document.getElementById("sbLocDirDiv_"+A);
if(B){B.style.display="none";
}}};
SB.ReqError=function(C){document.body.style.cursor=__u.Browser.defaultCursor;
if(C){var A=SB.GetIndexFromId(C.id);
if(C!=SB.GetLocInputFromIndex(A)){return ;
}var B=document.getElementById("sbLocDirDiv_"+A);
if(B){B.style.display="none";
}}};
SB.ReqRevError=function(B,D){document.body.style.cursor=__u.Browser.defaultCursor;
if(D){var A=SB.GetIndexFromId(D.id);
if(D!=SB.GetLocInputFromIndex(A)){return ;
}if(_rl_cancel){_rl_cancel==false;
}var C=document.getElementById("sbLocDirDiv_"+A);
if(C){C.style.display="none";
}View.Map.closeInfoWindow();
SB.Locs[A].destroy();
SB.Locs[A].lat=null;
SB.RedrawLocsOnMap();
}};
SB.ReqAddresses=function(A){document.body.style.cursor="progress";
var D=[];
for(var B=0;
B<A;
B++){var C=SB.GetLocInputFromIndex(B);
DHTML.HighLight(document.getElementById("sbLocInputDiv_"+SB.GetIndexFromId(C.id)));
D.push(C.value);
}__l.Proxy.findAddresses(D,SB.SearchBusiness,0);
};
SB.ReqAddr=function(A,B){document.body.style.cursor="progress";
DHTML.HighLight(document.getElementById("sbLocInputDiv_"+SB.GetIndexFromId(A.id)));
if(SB.IsLatLongVal(A.value)){SB.AddLocFromLatLong(A);
}else{__l.Proxy.findAddress(A.value,SB.SearchBusiness,A.id);
}};
SB.GetZoomLevel=function(B){var C=__l.ZoomLevel.City;
if(B){var A=B.split(",").length;
if(A>2){C=__l.ZoomLevel.Street;
}}return C;
};
SB.ToggleDirsLink=function(D){if(SB.Locs[0].lat==null){return ;
}if(!D){D=window.event;
}var C=D.srcElement;
C=D.srcElement!=null?D.srcElement:D.target;
if(C.tagName=="IMG"){C=C.parentNode;
}var B=SB.GetIndexFromId(C.id);
if(B==-1){return false;
}var A=SB.Locs[B].showDirs;
__throwaway=(function(E,F){return function(){SB.EnableHideDirs(E,F);
};
})(B,A);
setTimeout("__throwaway();",0);
if(!SB.Roundtrip&&B==SB.Locs.length-2){SB.ToggleDirsVis(B,true);
SB.ReqDirs(SB.Mode,true);
SB.Roundtrip=true;
}return"";
};
SB.ToggleDirTitles=["Roundtrip","Directions"];
SB.ClickLogDirToggle=function(A){sct(A.innerHTML.indexOf(SB.ToggleDirTitles[0])>=0?44028:44019,this);
};
SB.ToggleDirsVis=function(F,M,J,H){if(F==-1){F=SB.Locs.length-2;
}var A=SB.ToggleDirTitles[F==SB.Locs.length-2?0:1];
var K=document.getElementById("sbLocDirHdrDiv_"+F);
var N=document.getElementById("sbLocDirDiv_"+F);
var D=SB.Locs[F];
var J=J==null?SB.Mode:J;
var B=J==null?0:J;
var O=B==0?1:0;
var L=document.getElementById("sbType_"+B+"_"+F);
var G=document.getElementById("sbType_"+O+"_"+F);
if(M&&K&&N){var C=SB.GetLocInputFromIndex(F);
if(C){var E=SB.GetLocInputFromIndex(F+1);
var I=SB.Locs[F+1];
if(!E||!I.lat){E=SB.GetLocInputFromIndex(0);
}if(E){if(L){L.className="optboxOpen";
}if(G){G.className="optbox2";
}K.innerHTML=A;
if(D.directions&&!H){N.style.display="block";
SB.Locs[F].showDirs=true;
}else{N.innerHTML='<img alt="Loading..." width="79" height="17" src="'+__l.Defaults.SP+'loading.gif">';
N.style.display="block";
SB.Locs[F].showDirs=true;
SB.Locs[F].mode=J;
}}}}else{if(K){K.innerHTML=A;
}if(L){L.className="optbox";
}if(G){G.className="optbox2";
}N.style.display="none";
D.showDirs=false;
}};
SB.ReqAllDirs=function(){var B=0;
for(var A=0;
A<SB.Locs.length-1;
A++){if(SB.Locs[A].showDirs){setTimeout("SB.ToggleDirsVis("+A+",true);",B);
B+=100;
}else{SB.ToggleDirsVis(A,false);
}}SB.ReqDirs();
};
SB.ReqDirsNearIndex=function(A){if(SB.Locs.length==3&&(SB.Locs[0].lat==null||SB.Locs[1].lat==null)){Page.Map.DirectionManage.Remove();
return ;
}var B=0;
if(SB.Locs.length>3&&SB.Locs[0].lat==null){B=1;
}for(;
B<SB.Locs.length-2;
B++){SB.ToggleDirsVis(B,true,null,true);
}SB.ReqDirs();
};
SB.ReqDirs=function(D,B){if(SB.Locs.length>1){__l.Proxy.getSponsoredResults(SB.Locs[SB.Locs.length-2].addr,SB.SponsoredDiv);
}if(SB.Locs.length<3){Page.Map.DirectionManage.Remove();
return ;
}var D=D?D:SB.Mode;
var A=[];
var C=0;
if(SB.Locs[0].lat==null){C=1;
}for(;
C<SB.Locs.length-1;
C++){var E=new __l.Point(SB.Locs[C].lat,SB.Locs[C].lng,SB.Locs[C].addr);
E.id=SB.Locs[C].id;
A.push(E);
}if(B&&SB.Locs[0].lat!=null){var E=new __l.Point(SB.Locs[0].lat,SB.Locs[0].lng,SB.Locs[0].addr);
E.id=SB.Locs[C].id;
A.push(E);
}else{SB.Roundtrip=false;
}__l.Proxy.getDirections(A,D,SB.ReqDirsCallBack,null,null,Page.Map);
};
SB.configureDirections=function(B,G){var D=G.getElementsByTagName("table")[0];
if(!D){return ;
}var F=D.getElementsByTagName("tr");
for(var C=1;
C<F.length;
C++){var E=F[C];
A(E,B,C);
}SB.AddCloseDirsLink(B,D);
function A(I,H,J){I.style.cursor=__u.Browser.handCursor;
__u.Events.addListener(I,"click",function(){var L=I.parentNode.childNodes;
for(var K=1;
K<L.length;
K++){L[K].style.backgroundColor="";
}I.style.backgroundColor="#e0e0e0";
Page.Map.DirectionManage.SelectStep(H,J-1);
});
}};
SB.ReqDirsCallBack=function(A){if(Page.Map.trafficOn){if(Page.Map.GetZoomLevel()<9){setTimeout(function(){Page.Map.CloseTraffic();
},10);
}else{setTimeout(function(){__l.Proxy.lookupIncident(Page.Map,ask.Map.AddIncidentPin);
},10);
}}var C=0;
if(SB.Locs[0].lat==null){C=1;
}for(var B=0;
B<A.length;
B++){var D=A[B];
var E=__d.get("sbLocDirDiv_"+C);
E.innerHTML=D;
SB.configureDirections(B,E);
E.style.display="block";
C++;
}SB.ToggleVis(true);
};
SB.AddDirsInfo=function(D,F,E){var H=document.createElement("tr");
var G=document.createElement("td");
G.colSpan=3;
var B=document.createElement("div");
var C=document.createElement("div");
C.className="txgr";
var J=document.createElement("b");
J.appendChild(document.createTextNode(E));
C.appendChild(document.createTextNode("Distance: "));
C.appendChild(J);
var A=document.createElement("div");
A.className="txgr";
var I=document.createElement("b");
I.appendChild(document.createTextNode(F));
A.appendChild(document.createTextNode("Estimated time: "));
A.appendChild(I);
B.appendChild(C);
B.appendChild(A);
G.appendChild(B);
H.appendChild(G);
D.firstChild.appendChild(H);
};
SB.AddCloseDirsLink=function(C,B){var D=document.createElement("tr");
var F=document.createElement("td");
F.colSpan=3;
var E=document.createElement("div");
var A=document.createElement("a");
A.setAttribute("href","javascript:SB.ToggleDirsVis("+C+",false);");
A.className="lnkblue";
A.setAttribute("onmousedown","sct(44014,this);");
A.appendChild(document.createTextNode("Close directions"));
E.appendChild(A);
F.appendChild(E);
D.appendChild(F);
B.firstChild.appendChild(D);
};
SB.AddDirsSteps=function(A,K,I){for(var O=0;
O!=K.length;
++O){var P=K[O];
var E=O+1;
var B=document.createElement("tr");
B.id="dr_"+A+"_"+O;
var G=document.createElement("td");
G.align="left";
G.vAlign="top";
G.width="1%";
var Q=document.createElement("B");
Q.className="dirStep";
Q.appendChild(document.createTextNode(E));
G.appendChild(Q);
B.appendChild(G);
G=document.createElement("td");
G.width="45%";
G.vAlign="top";
var N=P.getAttribute("s");
var J=P.firstChild.nodeValue;
var H;
J=__u.String.replaceChars(J,"{}","<>");
if(J.indexOf("</")<=J.indexOf("<")){J=J.substring(0,J.indexOf("</"))+J.substring(J.indexOf(">")+1,J.length);
}var U=document.createElement("div");
while(J.indexOf("<")>=0){H=J.substring(0,J.indexOf("<")-1);
if(H.indexOf("LEFT")>=0){U.appendChild(document.createTextNode(H.substring(0,H.indexOf("LEFT")-1)+" "));
var S=document.createElement("img");
S.setAttribute("border","0");
S.setAttribute("src",__l.Defaults.SP+"left_turn.gif");
U.appendChild(S);
var F=document.createElement("b");
F.appendChild(document.createTextNode(" Left"));
U.appendChild(document.createElement("b").appendChild(F));
H=H.substring(H.indexOf("LEFT")+4,H.length);
U.appendChild(document.createTextNode(H));
}else{if(H.indexOf("RIGHT")>=0){U.appendChild(document.createTextNode(H.substring(0,H.indexOf("RIGHT"))));
var F=document.createElement("b");
F.appendChild(document.createTextNode("Right "));
U.appendChild(document.createElement("b").appendChild(F));
var S=document.createElement("img");
S.setAttribute("border","0");
S.setAttribute("src",__l.Defaults.SP+"right_turn.gif");
U.appendChild(S);
H=H.substring(H.indexOf("RIGHT")+5,H.length);
U.appendChild(document.createTextNode(H));
}else{U.appendChild(document.createTextNode(H));
}}U.appendChild(document.createElement(J.substring(J.indexOf("<")+1,J.indexOf(">")))).appendChild(document.createTextNode(" "+J.substring(J.indexOf(">")+1,J.indexOf("</"))));
J=J.substring(J.indexOf("</"),J.length);
J=J.substring(J.indexOf(">")+1,J.length);
}if(J.length>0){U.appendChild(document.createTextNode(J));
}if(N){var M=N.split(",");
var D=parseFloat(M[0]);
var T=parseFloat(M[1]);
var R=document.createElement("a");
R.className="lnkblack";
R.href="javascript:KE.PlayFrame("+A+","+O+",false);";
R.setAttribute("onmousedown","sct(44025,this);");
pholder=R;
R.innerHTML=U.innerHTML;
G.appendChild(R);
}else{G.appendChild(U);
}B.appendChild(G);
G=document.createElement("td");
G.className="txgr";
G.vAlign="top";
G.width="10%";
var L=P.getAttribute("di");
if(L!=null){G.appendChild(document.createTextNode(L+" mi"));
}else{var C=document.createElement("span");
C.className="txrdb";
C.appendChild(document.createTextNode("END"));
G.appendChild(C);
}B.appendChild(G);
I.firstChild.appendChild(B);
}};
SB.GetAddressType=function(B){var C="place";
if(B){var A=B.split(",").length;
if(A>2){C="address";
}}return C;
};
SB.AddLocFromLocations=function(E,A,F){var I=F[0].lat;
var J=F[0].lng;
var H=F[0].address;
var C=new Array();
C["Address"]=H;
C["Index"]=E;
C["LocCount"]=SB.Locs.length;
var B=SB.getBalloonHtml(C);
var D=new Loc(E,I,J,H,null,B);
D.type=SB.GetAddressType(H);
if(F.length>1){D.otherMatches=F;
}if(A){if(SB.Locs[E].lat){D.showDirs=SB.Locs[E].showDirs;
SB.Locs[E].destroy();
var G=SB.Locs[E-1];
if(G&&G.directions){G.directions=null;
}}SB.Locs.splice(E,1,D);
}else{SB.Locs.splice(E,0,D);
}};
SB.LocRemoveLinkClick=function(C){if(!C){C=window.event;
}var A=C.srcElement;
A=C.srcElement!=null?C.srcElement:C.target;
SB.Roundtrip=false;
var B=A.id.split("_");
if(B.length==2){var D=parseInt(B[1]);
if(D>_SB_NEW_LOC_INDEX){SB.RemoveLoc(D);
}}};
SB.MoveTo=function(B){if(!__u.Browser.isIE){var C=document.getElementById("sbLocInputDiv_"+B);
if(C){var A=parseInt(SB.Container.style.height.replace(/px/,""));
if(C.offsetTop<SB.Container.scrollTop||C.offsetTop>SB.Container.scrollTop+A){SB.Container.scrollTop=C.offsetTop;
}}}};
SB.RemoveBalloonLinkClick=function(B){for(var A=0;
A<SB.Locs.length;
A++){if(SB.Locs[A].id==B){SB.RemoveLoc(B);
break;
}}};
SB.ClearDirs=function(C){var B=SB.Locs;
if(C<0||C>=B.length){return ;
}B[C].clearDirs();
var D=C?C-1:0;
if(D>=0){var E=B[D];
var A=E.showDirs;
E.clearDirs();
E.showDirs=A;
}};
SB.OnRemoveLoc=function(A){var B=ask.Map.UI.GetObjByUI(A);
SB.RemoveLoc(B.Marker.id);
};
SB.RemoveLoc=function(A,B){SB.Locs[A].destroy(B);
if(A>=0&&A<SB.Locs.length){SB.ClearDirs(A);
if(A==SB.GetActiveLoc()){SB.SetActiveLoc(-1);
}else{if(SB.GetActiveLoc()!=-1){SB.SetActiveLoc(SB.GetActiveLoc()-1);
}}SB.Locs.splice(A,1);
SB.RedrawLocsOnMap();
SB.ReDraw();
SB.ReqDirsNearIndex(A);
}};
SB.SetActiveLoc=function(A){_sb_ActiveLoc=A;
};
SB.GetActiveLoc=function(){return _sb_ActiveLoc;
};
SB.IsVisible=function(){return SB.ResizeButton.innerHTML.indexOf("show")==-1;
};
SB.ToggleVis=function(A,B){if(!Page.EmbedView||B){if(A&&SB.ResizeButton.innerHTML.indexOf("hide")==-1){SB.ResizeButton.innerHTML=_SB_HIDE_ARROW;
DHTML.GrowToWidthDefault(SB.Container,SB.Content);
}else{if(!A&&SB.ResizeButton.innerHTML.indexOf("show")==-1){SB.ResizeButton.innerHTML=_SB_SHOW_ARROW;
SB.HeaderLinks.style.display="none";
SB.Content.style.display="none";
SB.SponsoredDiv.style.display="none";
DHTML.ShrinkToWidthDefault(SB.Container,SB.Header,SB.Content);
}}}return false;
};
SB.ClearLinkClick=function(A){SB.ClearAll();
SB.AddNextEmptyLoc();
SB.ReDraw();
};
SB.ClearAll=function(){for(var A=0;
A<SB.Locs.length;
A++){var B=SB.Locs[A];
SB.Locs[A]=null;
}Page.Map.ClearAll();
SB.Locs=new Array();
SB.Clear();
SB.ClearMapDirs();
};
SB.ClearMapDirs=function(){ask.Map.ForEach(Page.Map.Directions,function(A){A.Remove();
});
};
SB.Clear=function(){for(i=SB.Content.childNodes.length;
i!=0;
--i){SB.Content.removeChild(SB.Content.childNodes[i-1]);
}SB.Content.innerHTML="";
SB.Steps.style.display="none";
};
SB.ReDraw=function(){__l.UI.locSuggest.hideSuggest(__l.UI.locSuggest);
SB.Clear();
var H=_SB_SPACER;
var D=SB.GetActiveLoc();
if(SB.Locs){document.title=Header.GetTitle();
var B=SB.Locs.length;
if(B>0){if(SB.DirsHeader){SB.DirsHeader.style.display=B>2?"block":"none";
}if(SB.LocHeader){SB.LocHeader.style.display=B>1?"block":"none";
}if(SB.WelHeader){SB.WelHeader.style.display=B==1?"block":"none";
}for(var E=0;
E<SB.Locs.length;
E++){var A=document.createElement("div");
var I=SB.Locs[E];
if(I.addr){I.addr=I.addr.replace(/(^\s*)|(\s*$)/g,"");
}A.innerHTML=SB.BuildLocHtml(I.addr,E);
if(E==SB.MaxLocs){A.style.display="none";
}SB.Content.appendChild(A);
var G={noSearchResults:1,img:1,asTable:1};
__l.UI.locSuggest.makeSuggestible("sbLocInput_"+E,G);
__u.Events.addListener("sbLocInput_"+E,"keypress",function(K){K=__u.Events.getEvent(K);
if(K.keyCode==9||K.keyCode==27){__l.UI.locSuggest.hideSuggest(__l.UI.locSuggest);
}else{SB.LocInputKeyPress(K);
}});
var J=document.getElementById("sbLocDirDiv_"+E);
var F=document.getElementById("sbLocDirHdrDiv_"+E);
if(I.directions&&F){J.appendChild(I.directions);
if(I.showDirs){var C=I.mode==1?"1":"";
F.innerHTML=_SB_HIDE_TXT;
J.style.display="block";
}else{F.innerHTML=_SB_SHOW_TXT;
J.style.display="none";
}}if(I.otherMatches){SB.RenderDisambigDiv(E);
}SB.MoveTo(SB.GetActiveLoc());
}}if(View.AutoDrive){if(B>2){View.AutoDrive.toggleVisible(true);
}else{View.AutoDrive.toggleVisible(false);
}}SB.FocusOnLast();
}};
var _SB_LAT_PARAM="lt";
var _SB_LNG_PARAM="lg";
var _SB_ACTIVE_PARAM="al";
var _SB_CENTERX_PARAM="cx";
var _SB_CENTERY_PARAM="cy";
var _SB_ZOOM_PARAM="zm";
var _SB_VIEWTYPE_PARAM="vt";
var _SB_ADDR_PARAM="ad";
var _SB_SHOWDIR_PARAM="sd";
var _SB_DIRMODE_PARAM="dm";
SB.LocsToString=function(){var D=ask.Map.Util.veToDecartaZoom(View.Map.GetZoomLevel());
var A=View.Map.GetCenterPoint();
var E=_SB_LAT_PARAM+"="+A.Lat+"|"+_SB_LNG_PARAM+"="+A.Lon+"|";
var B=E+_SB_ACTIVE_PARAM+"="+SB.GetActiveLoc()+"|"+_SB_CENTERX_PARAM+"="+View.Map.centerX+"|"+_SB_CENTERY_PARAM+"="+View.Map.centerY+"|"+_SB_ZOOM_PARAM+"="+D+"|"+_SB_VIEWTYPE_PARAM+"="+View.Map.viewMode+"~";
if(SB.Locs){if(SB.Locs.length>0){for(var C=0;
C<SB.Locs.length;
C++){var G=SB.Locs[C];
var H=G.showDirs?1:0;
var F=G.mode?G.mode:0;
if(G.lat){B+=_SB_LAT_PARAM+"="+__u.Math.Round(G.lat,5)+"|"+_SB_LNG_PARAM+"="+__u.Math.Round(G.lng,5)+"|"+_SB_ADDR_PARAM+"="+G.addr+"|"+_SB_SHOWDIR_PARAM+"="+H+"|"+_SB_DIRMODE_PARAM+"="+F+"~";
}}}}return B;
};
SB.SetViewForLocsFromString=function(E){var A=new Array();
var B=5;
if(E){var J=E.split("~");
var P=J[0];
var L=P.split("|");
if(L.length>=B){var N,O,F,I,G,Q,D;
for(var K=0;
K<L.length;
K++){var H=L[K].split("=");
var C=H[1];
switch(H[0]){case _SB_LAT_PARAM:N=parseFloat(C);
break;
case _SB_LNG_PARAM:O=parseFloat(C);
break;
case _SB_ACTIVE_PARAM:F=parseFloat(C);
break;
case _SB_CENTERX_PARAM:I=parseFloat(C);
break;
case _SB_CENTERY_PARAM:G=parseFloat(C);
break;
case _SB_ZOOM_PARAM:Q=ask.Map.Util.decartaToVEZoom(parseFloat(C));
break;
case _SB_VIEWTYPE_PARAM:D=parseFloat(C);
break;
}}var M=new ask.Map.Point(N,O);
View.Map.CenterAndZoom([{"Point":M}],Q);
if(F>-1&&SB.Locs[F]){SB.SetActiveLoc(F);
SB.Locs[F].showBalloon();
}}}};
SB.LocsFromString=function(E){var A=new Array();
var C=1;
if(E){var J=E.split("~");
if(J.length>=C){for(var H=C;
H<=J.length-1;
H++){if(__u.String.trim((J[H])).length==0){continue;
}var B=J[H].split("|");
if(B.length>=5){var N,O,M,P,I;
for(var G=0;
G<B.length;
G++){var F=B[G].split("=");
var D=F[1];
switch(F[0]){case _SB_LAT_PARAM:N=parseFloat(D);
break;
case _SB_LNG_PARAM:O=parseFloat(D);
break;
case _SB_ADDR_PARAM:M=D;
break;
case _SB_SHOWDIR_PARAM:P=D;
break;
case _SB_DIRMODE_PARAM:I=parseFloat(D);
break;
}}var L=H-C;
var Q=SB.GetImageUrlForIndex(L);
if(N&&O){var K=new Loc(L,N,O,M,Q);
K.showDirs=P=="1";
K.mode=I?I:0;
A[L]=K;
__l.UI.addRecentItem(K,K.addr);
}}}}}return A;
};
SB.RecreateFromPath=function(A){SB.Recreate(A);
};
SB.RecreateFromHistory=function(){var A=__l.History.cache[__l.History.getCurrentLoc()];
SB.Recreate(A);
};
SB.Recreate=function(A){if(A){SB.ClearLinkClick();
SB.Locs=SB.LocsFromString(A);
SB.SetViewForLocsFromString(A);
SB.AddNextEmptyLoc();
SB.ReDraw();
SB.RedrawLocsOnMap();
SB.ReqAllDirs();
SB.ToggleVis(true);
}};
SB.BuildLocHtml=function(G,C){var D=new Array();
D["idx"]=C;
D["loc"]=G;
D["locCount"]=SB.Locs.length;
var E="";
var B=C+1;
var A="";
if(C==0){E="Start location:";
if(C==SB.Locs.length-3){A="End location";
}else{A="Location "+(C+2)+":";
}}else{if(C==SB.Locs.length-2){E="End location:";
A="Start location";
B=0;
}else{if(C==SB.Locs.length-3){E="Location "+(C+1)+":";
A="End location";
}else{if(C==SB.Locs.length-1){E="Add location";
}else{E="Location "+(C+1)+":";
A="Location "+(C+2)+":";
}}}}D["idxtxt"]=E;
D["nextidxtxt"]=A;
if(C!=_SB_NEW_LOC_INDEX&&C<SB.Locs.length){D["clr"]=SB.Colors[C];
}if(C==SB.GetActiveLoc()){D["actClr"]="#cc0000";
}D["imgUrl"]=SB.GetImageUrlForIndex(C,true);
D["nextImgUrl"]=SB.GetImageUrlForIndex(B,true);
D["sp"]=__l.Defaults.SP;
var F=SB.getLocHtml(D);
return F;
};
SB.getBalloonHtml=function(D){var H=D["Address"];
var I=D["Coords"];
var E=D["Status"];
var G=D["Index"];
var F=D["LocCount"];
var A=D["sp"];
var C=G-1;
var B="";
B+="<div>";
if(E=="RLStartIE"){B+='<p class="pad"><b>Searching for address...</b></p>';
B+='<p class="pad">'+I+"</p>";
}else{if(E=="RLStart"){B+='<p class="pad"><b>Searching for address...</b></p>';
B+='<p><img alt="working..." src="'+A+'loading.gif"/></p>';
B+='<p class="pad">'+I+"</p>";
}else{if(E=="RLCancel"){B+='<p class="pad"><b>Latitude,Longitude</b></p>';
B+='<p class="pad">'+I+"</p>";
}else{if(E=="RLErr"){B+='<p style="color:#cc0000;padding-bottom:5px;">No address found near:</p>';
B+="<p>"+I+"</p>";
}else{B+='<p class="pad"><b>Address:</b></p>';
B+='<p class="pad">'+H+"</p>";
}}}}B+="</div>";
return B;
};
SB.getLocHtml=function(C){var L=C["idx"];
var I=C["loc"];
var F=C["locCount"];
var J=C["idxtxt"];
var M=C["nextidxtxt"];
var P=C["clr"];
var N=C["actClr"];
var O=C["imgUrl"];
var G=C["nextImgUrl"];
var A=C["sp"];
var B="";
if(L<SB.MaxLocs+1){B+='<form onsubmit="return false;">';
B+='<div id="sbLocDiv_'+L+'" style="padding:0px;width:100%">';
B+='<div id="sbLocInputDiv_'+L+'"';
if(L==(F-1)){B+='class="sbLocDivNoBorder">';
}else{B+='class="sbLocDiv">';
}B+='<table cellpadding="0" cellspacing="0" width="280px" ><tr><td nowrap="on">';
if(F>0&&L!=(F-1)){B+='<div style="padding:2px;width:100%;">';
B+='<img id="sbGrabLocImg_'+L+'" class="hnd" alt="Location '+(L+1)+'" onmousedown="sct(44018);"  onclick="SB.FocusLinkClick(event);return false;" src="'+O+'"/>';
B+='&#160;<a id="sbFocusImg_'+L+'" class="txlpb txlg" onclick="SB.FocusLinkClick(event);return false;" onmousedown="sct(44018,this);" href="javascript:void(0);">'+J+"</a>";
B+="<div>";
}else{B+='<span class="txlpb txlg">'+J+"</span>";
}B+="</td>";
B+='<td colspan="2" align="right" valign="top">';
if(F>=3){var E='<span class="hnd" style="padding-right:2px;"><img id="sbLocMoveDn_'+L+'" class="hnd" title="Move down location    '+(L+1)+'"  onmousedown="sct(44023);" border="0" ondragstart="return false" onclick="SB.ReOrder('+L+","+(L+1)+');" src="'+A+'move_dn.png"/></span>';
var D='<span class="hnd" style="padding-right:2px;"><img id="sbLocMoveUp_'+L+'" class="hnd" title="Move up location      '+(L+1)+'"  onmousedown="sct(44024);" border="0" ondragstart="return false" onclick="SB.ReOrder('+L+","+(L-1)+');" src="'+A+'move_up.png"/></span>';
if(L==0){B+=E;
}else{if(L==(F-2)){B+=D;
}else{if(L==(F-1)){}else{B+=E;
B+=D;
}}}}if(F>0&&L!=(F-1)){B+='<span class="hnd" style="padding-right:2px;"><img id="sbLocRem_'+L+'" class="hnd" alt="Remove" title="Remove location '+(L+1)+'" border="0" onmousedown="sct(44027,this);" onclick="SB.LocRemoveLinkClick(event);" src="'+A+'close.gif"/></span>';
}B+='</td></tr><tr><td colspan="2"><input id="sbLocInput_'+L+'" tabindex="'+L+'" AUTOCOMPLETE="OFF" class="inputLoc"  onblur="KE.Typing=null" onfocus="KE.Typing=this;" type="text" value="'+I+'"></input></td>';
B+='<td><table cellpadding="1" cellspacing="0"><tr><td><td><a id="sbLocImg_'+L+'" alt="Go" class="go hnd" onclick="SB.LocImgClick(event);"  onmousedown="sct(44022,this);" /></td></tr></table></td>';
B+='</tr><tr><td colspan="2">';
if(L==(F-1)){B+="<span style='font-size: 11;color:Gray;font-family:Arial;'>"+I18N_MESSAGE_MAPS_HEADER_INPUT_TEXT+"</span>";
}B+='<div id="sbLocRecent_'+L+'" class="dropBox"></div></td><td></td></tr>';
B+='<tr><td colspan="2"><div id="sbLocAmbig_'+L+'" class="dropBox"></div></td><td></td></tr>';
B+='<tr><td colspan="2"><div id="sbLocMessage_'+L+'" class="mgbox"></div>';
B+="</td><td></td></tr>";
B+="</table></div></div>";
if(F>2&&L<(F-1)){var H=SB.Locs[L].mode;
var K=SB.Locs[L].showDirs;
B+='<div style="padding-top:8px"><a id="sbLocDirHdrDiv_'+L+'" title="Show/hide directions to '+M+'" href="javascript:void(0);" onfocus="this.blur();"  ';
B+='onclick="SB.ToggleDirsLink(event);" ';
B+='class="txlpb txsm">Directions</a>&#160;';
B+='<span class="'+(H==0?(K?"optboxOpen":"optbox"):"optbox2")+'" id="sbType_0_'+L+'" onclick="SB.DirsTabClick('+L+',0)" onmousedown="sct(44020,this);" >Driving</span>&#160;<span class="'+(H==1?(K?"optboxOpen":"optbox"):"optbox2")+'" id="sbType_1_'+L+'" onclick="SB.DirsTabClick('+L+',1)" onmousedown="sct(44030,this);" >Walking</span>';
if(L==(F-2)){B+='&#160;to&#160;<img src="'+G+'"/></div>';
}}B+='<div id="sbLocDirDiv_'+L+'" class="dirdiv"></div></form>';
}return B;
};
SB.AddNextEmptyLoc=function(){var A=SB.Locs.length;
if(A<=SB.MaxLocs){SB.AddEmptyLocAt(A);
}return A;
};
SB.AddEmptyLocAt=function(A){var C=document.createElement("div");
C.innerHTML=SB.BuildLocHtml("",A)+_SB_SPACER;
SB.Locs.splice(A,0,new Loc(A,null,null,"",null,null));
SB.Content.appendChild(C);
SB.FocusOnLast();
var B={noSearchResults:1,img:1,asTable:1};
__l.UI.locSuggest.makeSuggestible("sbLocInput_"+A,B);
__u.Events.addListener("sbLocInput_"+A,"keypress",function(D){D=__u.Events.getEvent(D);
if(D.keyCode==9||D.keyCode==27){__l.UI.locSuggest.hideSuggest(__l.UI.locSuggest);
}else{SB.LocInputKeyPress(D);
}});
};
SB.FocusOnLast=function(){setTimeout(function(){try{var A=SB.GetLocInputFromIndex(SB.Locs.length-1);
if(A){A.focus();
}}catch(B){}},400);
};
function Loc(A,H,J,G,L,E){this.dragStartX=0;
this.dragStartY=0;
this.orgLat=H;
this.orgLng=J;
this.lat=H;
this.lng=J;
this.id=A;
this.addr=G;
this.img=document.createElement("img");
this.div=document.createElement("div");
this.div.appendChild(this.img);
if(E==null){var F=new Array();
F["Address"]=G;
F["Index"]=A;
F["LocCount"]=SB.Locs.length;
E=SB.getBalloonHtml(F);
}this.html=E;
if(L==null){L=SB.GetImageUrlForIndex(A);
}this.imgUrl=L;
__u.Image.SetPng(this.img,L);
this.div.style.zIndex=200;
this.div.style.position="absolute";
var C=this;
var K=new __l.Point(H,J,G);
var I=new __l.Icon(L,31,10);
var D=new __l.Marker(K,I);
D.id=A;
this.marker=D;
this.div.className="hnd";
this.directions=null;
this.directionsXml=null;
this.showDirs=false;
this.otherMatches=null;
this.type="place";
this.mode=0;
if(View&&View.Map){if(this.marker.point.lat){var B=new ask.Map.IndependentPoi(View.Map,new ask.Map.Point(this.marker.point.lat,this.marker.point.lng),this.marker.location_name);
B.Marker=D;
B.Street=D.addr;
B.FullAddress=D.address;
B.Name=this.addr;
B.SetIcon(D.icon.imageUrl);
B.Update();
this.marker.poi=B;
}}this.position();
}var _sb_LocTypes=new Array();
_sb_LocTypes["address"]=3;
_sb_LocTypes["street"]=4;
_sb_LocTypes["poi"]=4;
_sb_LocTypes["intersection"]=4;
_sb_LocTypes["place"]=7;
Loc.prototype.assign=function(A){};
Loc.prototype.clearDirs=function(){this.directions=null;
this.mode=0;
};
Loc.prototype.redraw=function(A){if(A==null){A=SB.GetImageUrlForIndex(id);
}else{__u.Image.SetPng(this.img,A);
}this.marker.icon.setImage(A);
if(this.marker.poi){this.marker.poi.SetIcon(A);
}};
Loc.prototype.endLocDrag=function(C){this.lat=this.marker.point.lat;
this.lng=this.marker.point.lng;
document.body.style.cursor=__u.Browser.defaultCursor;
this.directions=null;
var A=new Array();
A["Address"]=this.addr;
A["Coords"]=__u.Math.Round(this.lat,5)+","+__u.Math.Round(this.lng,5);
A["Status"]=__u.Browser.isIE?"RLStartIE":"RLStart";
A["Index"]=this.id;
A["LocCount"]=SB.Locs.length;
A["sp"]=__l.Defaults.SP;
this.html=SB.getBalloonHtml(A);
if((__u.Browser.isIE?event:C).ctrlKey){A=new Array();
var B=__u.Math.Round(this.lat,5)+","+__u.Math.Round(this.lng,5);
A["Address"]=this.addr;
A["Coords"]=B;
A["Status"]="RLCancel";
A["LocCount"]=SB.Locs.length;
this.addr=B;
this.html=SB.getBalloonHtml(A);
if(SB.Locs[SB.Locs.length-1].lat!=null){SB.AddNextEmptyLoc();
}__l.UI.addRecentItem(this,this.addr);
SB.SetActiveLoc(this.id);
SB.Locs[this.id].showBalloon(false);
SB.ReDraw();
SB.RedrawLocsOnMap();
SB.ReqDirsNearIndex(this.id);
}else{Loc.ReqRevLook(this);
}this.showBalloon(false);
var D=this;
_loc_moved=false;
return false;
};
Loc.prototype.showBalloon=function(A,C){if(this.lat&&this.lng){SB.SetActiveLoc(this.id);
this.div.style.zIndex=200+SB.Locs.length;
var D=document.createElement("div");
D.innerHTML=this.html;
var B=this.marker;
B.poi.Select(true);
}};
Loc.prototype.position=function(){this.marker.point.lat=this.lat;
this.marker.point.lng=this.lng;
this.marker.position();
if(this.marker.poi){this.marker.poi.Point.Lat=this.lat;
this.marker.poi.Point.Lon=this.lng;
this.marker.poi.Name=this.addr;
this.marker.poi.Update();
}};
Loc.prototype.x=function(){return __u.GeoMath.long2pix(this.lng,View.Map.zoom);
};
Loc.prototype.y=function(){return __u.GeoMath.lat2pix(this.lat,View.Map.zoom);
};
Loc.prototype.destroy=function(A){this.directions=null;
this.directionsXml=null;
this.otherMatches=null;
if(!A){if(this.marker.poi){this.marker.poi=this.marker.poi.Remove();
}}};
Loc.ReqRevLook=function(B){document.body.style.cursor="progress";
var A=new __l.Point(B.lat,B.lng,B.addr);
__l.Proxy.findLocations(A,Loc.ReqRevLookCallBack,B.id);
};
var _rl_cancel=false;
Loc.ReqRevLookCallBack=function(B,A){document.body.style.cursor=__u.Browser.defaultCursor;
var C=B.id;
if(_rl_cancel){_rl_cancel==false;
return false;
}SB.ToggleVis(true);
if(A.length>0){SB.AddLocFromLocations(C,true,A);
}if(SB.Locs[SB.Locs.length-1].lat!=null){SB.AddNextEmptyLoc();
}__l.UI.addRecentItem(SB.Locs[C],SB.Locs[C].addr);
SB.Locs[C].marker.poi.Name=SB.Locs[C].addr;
SB.Locs[C].marker.poi.Update();
SB.Locs[C].marker.poi.Select(true);
SB.SetActiveLoc(C);
SB.Locs[C].showBalloon(true);
SB.ReDraw();
SB.RedrawLocsOnMap();
var D=SB.Locs[C-1];
if(D){D.showDirs=true;
}SB.ReqDirsNearIndex(C);
};
__l.UI=new function(){this.fadeUI=function(A){var B=A?30:100;
__u.Dom.setOpacity(__d.get("sbhdr"),B);
__u.Dom.setOpacity(__d.get("sb"),B);
__u.Dom.setOpacity(__d.get("view"),B);
};
this.openPrintPreview=function(){__d.get("noprintMsg").innerHTML="";
__l.UI.share.lowerBubble();
__l.UI.embed.closeEmbedWindow();
this.fadeUI(true);
var E=__u.Browser.getBounds();
var G=Math.min(800,parseInt(E.width*0.8));
var Q=parseInt(E.height*0.9);
var C=__d.get("printWindow");
var A=__d.get("printHeader");
C.style.width=G+"px";
C.style.height=Q+"px";
C.style.left=parseInt((E.width-G)/2)+"px";
C.style.top=parseInt((E.height-Q)/2)+"px";
A.style.width=G-20+"px";
__d.get("printTitle").innerHTML=Header.GetTitle(true);
var B=__d.get("printDetails");
__u.Dom.removeAllChildNodes(B);
var W=__d.get("printResults");
__u.Dom.removeAllChildNodes(W);
var L=__d.get("printDirections");
__u.Dom.removeAllChildNodes(L);
L.style.fontSize="16pt";
var D=0;
var P=0;
if(SB.Locs[0].lat==null){P=1;
}for(;
P<SB.Locs.length-1;
P++){var V=SB.Locs[P];
var S=V.marker;
if(S.point.isValid()){var K=__d.ce("span");
K.style.fontWeight="bold";
var M=__d.ce("img");
M.style.paddingRight="5px";
M.src=SB.GetImageUrlForIndex(P,true);
K.appendChild(M);
var I=__d.ce("span");
I.innerHTML=S.point.address;
K.appendChild(I);
L.appendChild(K);
if(P==SB.Locs.length-2){if(SB.Roundtrip){L.innerHTML=L.innerHTML+Page.Map.DirectionManage.directions[D];
}}else{L.innerHTML=L.innerHTML+Page.Map.DirectionManage.directions[D];
}}D++;
}var O=__d.get("printMap");
var J=700;
var U=500;
var F="";
var T=__d.get("printMapImg");
if(__u.Browser.isIE){T.src=__l.Defaults.SP+"blank.gif";
}setTimeout(function(){T.src=F;
},50);
__d.get("printMapLoading").style.display="";
var H=__d.get("printNotesTA");
H.value="";
H.style.width=J+"px";
var R=__d.get("printNotesDiv");
R.style.width=J+"px";
R.style.display="none";
var N=__d.get("printNotesTitle");
N.className="noprint";
H.onkeypress=function(){if(!R.firstChild){R.appendChild(__d.ctn(""));
}R.firstChild.nodeValue=H.value;
R.style.display=H.value.trim()?"":"none";
N.className=H.value.trim()?"":"noprint";
};
H.onblur=function(){if(!R.firstChild){R.appendChild(__d.ctn(""));
}R.firstChild.nodeValue=H.value;
R.style.display=H.value.trim()?"":"none";
N.className=H.value.trim()?"":"noprint";
};
C.style.display="";
this.printMap=ask.Map.Util.CreatePrintMap(View.Map,"printMapImg");
};
this.closePrintWindow=function(){if(View.Map.trafficOn){View.Map.LoadTraffic(true);
View.Map.ClearTraffic();
}this.printMap=null;
__d.get("printMapImg").innerHTML="";
__d.get("printWindow").style.display="none";
this.fadeUI(false);
__d.get("noprintMsg").innerHTML="Please use our Print link in the top right of the page to print.";
};
this.embed={};
this.embed.width=425;
this.embed.height=350;
this.embed.openEmbedWindow=function(){__l.UI.closePrintWindow();
__l.UI.share.lowerBubble();
__l.UI.fadeUI(true);
var D=__d.get("embedWindow");
var E=__d.get("embedHeader");
var C=__u.Browser.getBounds();
var A=Math.min(1000,parseInt(C.width*0.8));
D.style.width=A+"px";
D.style.left=parseInt((C.width-A)/2)+"px";
var B=parseInt(C.height*0.9);
D.style.height=B+"px";
D.style.top=parseInt((C.height-B)/2)+"px";
E.style.width=A-20+"px";
this.setContents(425,350);
D.style.display="";
};
this.embed.closeEmbedWindow=function(){__d.get("embedMap").src=__l.Defaults.AMX_HOST+"/inc/xslt/maps/embedBlank.htm";
__d.get("embedWindow").style.display="none";
__l.UI.fadeUI(false);
};
this.embed.onCodeClick=function(){var D=__d.get("embedCode");
var B=__d.get("embedMap");
var E;
if(__l.UI.embed.displayType=="drag"){E=__l.Defaults.MapsHostPath+"?ml="+B.contentWindow.Header.BuildAbsoluteUrl()+"&embed=1";
}else{var C=__l.UI.embed.width;
var A=__l.UI.embed.height;
E=B.contentWindow&&B.contentWindow.View?B.contentWindow.View.Map.getMapImageUrl(C,A):View.Map.getMapImageUrl(C,A);
}__l.UI.embed.setHTML(null,null,E);
D.select();
};
this.embed.onSizeClick=function(B,A){__d.get("cusWidth").disabled=true;
__d.get("cusHeight").disabled=true;
__l.UI.embed.setSize(B,A);
};
this.embed.displayType="drag";
this.embed.onTypeClick=function(A){if(__l.UI.embed.displayType!=A){__l.UI.embed.displayType=A;
__l.UI.embed.setContents(__l.UI.embed.width,__l.UI.embed.height);
var C=__d.get("embedMap");
var B=__d.get("embedStaticMap");
if(A=="drag"){B.style.display="none";
C.style.display="";
}else{B.style.display="";
C.style.display="none";
}}};
this.embed.setContents=function(C,A){var E=__d.get("embedMap");
var D,B;
if(__l.UI.embed.displayType=="drag"){D=__l.Defaults.MapsHostPath+"?ml="+Header.BuildAbsoluteUrl()+"&embed=1";
B=__d.get("embedMap");
}else{B=__d.get("embedStaticMap");
D=E.contentWindow&&E.contentWindow.View?E.contentWindow.View.Map.getMapImageUrl(C,A):View.Map.getMapImageUrl(C,A);
}if(C&&A){B.width=C;
B.height=A;
}__l.UI.embed.setHTML(C,A,D);
B.src=D;
};
this.embed.setHTML=function(D,A,F){var B,C;
if(__l.UI.embed.displayType=="drag"){B=__d.get("embedMap");
C='<iframe width="'+(D||B.width)+'" height="'+(A||B.height)+'" style="border:0;" src="'+(F||B.src)+'" />';
}else{B=__d.get("embedStaticMap");
C='<img width="'+(D||B.width)+'" height="'+(A||B.height)+'" style="border:0;" src="'+(F||B.src)+'" />';
}var E=__d.get("embedCode");
E.value=C;
};
this.embed.onCustomSizeEnter=function(C){if(!C){C=window.event;
}var B=parseInt(__d.get("cusWidth").value);
var A=parseInt(__d.get("cusHeight").value);
if(C.keyCode==13){if(!isNaN(B)&&!isNaN(A)){__l.UI.embed.setSize(B,A);
}}};
this.embed.onCustomOption=function(A){__d.get("cusWidth").disabled=false;
__d.get("cusHeight").disabled=false;
};
this.embed.setSize=function(C,A){var B;
if(__l.UI.embed.displayType=="drag"){B=__d.get("embedMap");
__l.UI.embed.setHTML(C,A);
if(__u.Browser.isIE6){__l.UI.embed.setContents(C,A);
}}else{B=__d.get("embedStaticMap");
B.src=__l.Defaults.SP+"blank.gif";
var D=View.Map.getMapImageUrl(C,A);
B.src=D;
__l.UI.embed.setHTML(C,A,D);
}if(C&&A){B.width=C;
B.height=A;
__l.UI.embed.width=C;
__l.UI.embed.height=A;
}};
this.share={};
this.share.isRaised=false;
this.share.raiseBubble=function(E){if(!__l.UI.share.isRaised){__l.UI.closePrintWindow();
__l.UI.embed.closeEmbedWindow();
var C=__d.get("sh_Prev");
C.innerHTML="";
var A=__d.get("shdet");
var L=400;
var D=170;
var J=20;
var B=2;
var I=document.createElement("div");
I.style.textAlign="left";
I.style.backgroundColor="#FFF";
I.style.position="absolute";
I.style.top=J+"px";
I.style.left=B+J+"px";
I.style.width=L-(J*2)+"px";
I.style.height=D-J-J+"px";
I.style.padding="3px";
I.innerHTML=A.innerHTML;
var G=I.getElementsByTagName("input");
var H=__l.Defaults.MapsHostPath+"?ml="+Header.BuildAbsoluteUrl();
G[0].value=H;
var F='<iframe width="425" height="350" style="border:0;overflow:hidden;" src="'+H+'" />';
G[1].value=F;
C.appendChild(I);
var K=__u.Dom.getXY(E);
C.style.left=(K[0]-L+52)+"px";
C.style.top=(K[1]+22)+"px";
new a10.Bubble(C,I,L-(J),D-(J*2),"up",true,__l.UI.share.lowerBubble,0,L-90);
C.style.visibility="visible";
__l.UI.share.isRaised=true;
}else{__l.UI.share.lowerBubble();
}};
this.share.lowerBubble=function(){var A=__d.get("sh_Prev");
A.style.visibility="hidden";
__l.UI.share.isRaised=false;
};
this.locSugSetSugg=function(){var F=/(.*)\s+\d{5}\s*$/;
var H=__l.UI.locSuggest.suggestions;
if(!__l.UI.locSuggest.firstMarker||__l.UI.locSuggest.firstMarker>H.length){__l.UI.locSuggest.firstMarker=H.length;
}function D(J,L){J=J.toLowerCase();
L=L.toLowerCase();
for(var K=0;
K<H.length;
K++){if((L==H[K].name.toLowerCase()||L==H[K].suggVal.toLowerCase())||((!(J==""&&H[K].name=="")&&J==H[K].name.toLowerCase())||J==H[K].suggVal.toLowerCase())){return K;
}}return -1;
}function B(K,N,J){K=K?K.trim():"";
N=N?N.trim():null;
if(N&&!D(K,N)){H.push({"name":K,"suggVal":N,"overlay":J});
}if(N){var M=D(K,N);
if(M>=0){var L=H[M].overlay;
if((L&&L.image)||!J){return ;
}__l.UI.locSuggest.firstMarker--;
}if(J){H.push({"name":K,"suggVal":N,"overlay":J});
}else{H.splice(__l.UI.locSuggest.firstMarker++,0,{"name":K,"suggVal":N});
}}}if(__l.UI.recentItems){var I=__l.UI.recentItems;
for(var G=0;
G<I.length;
G++){var C,E;
C=I[G].alias;
E=I[G].addr;
if(C==E){C="";
}else{var A=E.match(F);
if(A!=null&&A[1]==C){E=C;
C="";
}}B(C,E,I[G]);
}}};
this.locSugSetHt=function(){};
this.recentItems=[];
this.addRecentItem=function(E,C){var A={};
for(var B=0;
B<this.recentItems.length;
B++){var D=this.recentItems[B];
if(D.addr==E.addr){A.item=D;
A.idx=B;
break;
}}if(A.item){this.recentItems[A.idx]=A.item;
}else{if(C){E.alias=C;
}this.recentItems.push(E);
}};
this.unload=function(){if(!GlobalNav.Variables._isEraser){var H="";
var E=0;
for(var D=this.recentItems.length-1;
D>=0;
D--){var F=this.recentItems[D];
var C=F.alias?F.alias:"";
H+=F.addr;
var G="0";
var B="0";
if(F.point){G=F.point.lat;
B=F.point.lng;
}H+="~"+G+"~"+B+"~";
H+=C+"|";
E++;
if(E>9){break;
}}if(Cookie.isEnabled()&&!GlobalNav.Variables._isEraser){var A=new Date();
A.setTime(A.getTime()+31536000000);
Cookie.setCookie("clocs",H,A,"/","ask.com");
}}};
};

ask.widget.Suggest=function(A){if(!A){A={};
}this.lastSuccessfulQuery=null;
this.currentQuery=null;
this.currentResults=[];
this.pauseTimeoutID=null;
this.selectedIndex=-1;
this.pageHasMadeRequest=false;
this.hidden=true;
this.PAUSE_PERIOD=201;
this.FADE_SPEED=0.07;
this.skipNextArrowKeyEvent=false;
this.originalQuery="";
this.suggFld="";
this.suggestDiv=__d.ce("div");
this.suggestDiv.style.display="none";
this.maxHeight=A.maxHeight||200;
this.maxWidth=A.maxHeight||250;
this.suggestions=[];
this.customSetSuggestions=null;
this.customShowSuggest=null;
this.customHideSuggest=null;
this.suggestDivInner=__d.ce("div");
this.suggestDivInner.style.width=this.maxWidth+"px";
var B=__d.ce("div");
B.className="T14 b";
B.style.backgroundColor="#FFF";
B.style.borderBottom="solid 1px #ccc";
B.style.height="20px";
this.titleDiv=B;
this.titleDivHeight=this.titleDiv.offsetHeight;
this.bubble=new __u.SimpleBubble(this.suggestDivInner,{preferredDirection:"up",connectorAlign:"left",maxHeight:this.maxHeight});
this.suggestDiv=this.bubble.container;
};
ask.widget.Suggest.HILITE_BG="#316AC5";
ask.widget.Suggest.HILITE_FG="#FFFFFF";
ask.widget.Suggest.dropDownArrowImgUrl=_dropDownArrowImgUrl;
ask.widget.Suggest.prototype={suggestClick:function(B){B=__u.Events.getEvent(B);
var A=__u.Events.getTarget(B,true);
this.suggFld.value=A.suggVal;
},setSuggestions:function(B){this.suggestions=[];
if(B&&B.suggVal){var A=B.name?B.name:"";
this.suggestions.push({name:A,suggVal:B.suggVal});
}if(this.customSetSuggestions){this.customSetSuggestions.call();
}},showSuggest:function(){this.bubble.raise();
},hideSuggest:function(){if(this.bubble){this.bubble.lower();
}},arrowClick:function(C){var B=__u.Events.getTarget(C);
var A=new Date().getTime();
if(this.LastClickTime&&(A-this.LastClickTime<100)){return ;
}if(this.suggestDiv.style.display=="none"||B.targetSuggFld!=this.suggFld){this.listAll(C);
}else{this.hideSuggest();
}sct(43972,this);
this.LastClickTime=A;
},setSuggFld:function(A){this.suggFld=A;
this.setSuggestions();
if(this.bubble){this.bubble.setConnectee(A);
}},keyupSuggest:function(C){C=__u.Events.getEvent(C);
var B=__u.Events.getTarget(C,true);
switch(C.keyCode){case 40:if(__u.Browser.isSafari2orLower){if(this.skipNextArrowKeyEvent){this.skipNextArrowKeyEvent=false;
return ;
}else{this.skipNextArrowKeyEvent=true;
}}this.handleDownArrow();
return ;
case 38:if(__u.Browser.isSafari2orLower){if(this.skipNextArrowKeyEvent){this.skipNextArrowKeyEvent=false;
return ;
}else{this.skipNextArrowKeyEvent=true;
}}this.handleUpArrow();
return ;
case 13:return ;
case 37:return ;
}if(this.currentQuery==this.suggFld.value){return ;
}this.currentQuery=this.suggFld.value;
if(this.pauseTimeoutID){clearTimeout(this.pauseTimeoutID);
this.pauseTimeoutID=null;
}var A=this;
this.pauseTimeoutID=setTimeout(function(){A.pauseTimeoutID=null;
A.suggestHandler();
},this.PAUSE_PERIOD);
},handleDownArrow:function(){if(this.suggestDiv.style.display!="none"){if(this.currentResults.length>0){if(this.selectedIndex==-1){this.originalQuery=this.suggFld.value;
}if(this.selectedIndex!=-1){this.currentResults[this.selectedIndex].style.borderBottom="none";
}if(this.selectedIndex==this.currentResults.length-1){this.selectedIndex=-1;
this.suggFld.value=this.originalQuery;
this.currentQuery=this.suggFld.value;
}else{this.selectedIndex++;
var A=this.currentResults[this.selectedIndex].style;
A.borderBottom="1px solid #CC0000";
if(a10.browser.isIE6()){A.zoom="1";
}this.suggFld.value=this.currentResults[this.selectedIndex].suggVal.trim();
this.currentQuery=this.suggFld.value;
}}}},handleUpArrow:function(){if(this.suggestDiv.style.display!="none"){if(this.currentResults.length>0){if(this.selectedIndex==-1){this.originalQuery=this.suggFld.value;
}if(this.selectedIndex!=-1){this.currentResults[this.selectedIndex].style.borderBottom="none";
}if(this.selectedIndex==0){this.selectedIndex=-1;
this.suggFld.value=this.originalQuery;
this.currentQuery=this.suggFld.value;
}else{if(this.selectedIndex!=-1){this.selectedIndex--;
}else{this.selectedIndex=this.currentResults.length-1;
}var A=this.currentResults[this.selectedIndex].style;
A.borderBottom="1px solid #CC0000";
if(a10.browser.isIE6()){A.zoom="1";
}this.suggFld.value=this.currentResults[this.selectedIndex].suggVal.trim();
this.currentQuery=this.suggFld.value;
}}}},suggestHandler:function(){function B(E,D){for(var C=0;
C<D.length;
C++){if(D[C].innerHTML.indexOf(E)!=0){return false;
}}return true;
}var A=this.suggFld.value;
if(this.currentResults.length>0&&this.lastSuccessfulQuery!=null&&((A==this.lastSuccessfulQuery)||(A.length>this.lastSuccessfulQuery.length&&B(A.toLowerCase(),this.currentResults)))){return ;
}if(this.currentResults.length==0&&A.toLowerCase().indexOf(this.lastSuccessfulQuery)==0){return ;
}if(A.length>1){this.lastSuccessfulQuery=A;
this.populate(A);
}else{this.lastSuccessfulQuery=null;
this.currentResults=[];
if(this.suggestDiv.style.display!="none"){this.hideSuggest();
}}},listAll:function(C){C=__u.Events.getEvent(C);
var B=__u.Events.getTarget(C,true);
var A=B.targetSuggFld;
this.setSuggFld(A);
this.populate("");
},populate:function(K){this.selectedIndex=-1;
var H=this.suggestions;
var N=__d.ce("div");
N.className="suggestBubble suggestLh18";
this.suggestDivInner2=N;
var B=new RegExp("("+K+")","i");
var L=this.suggFld.id||"";
for(var F=0;
F<H.length;
F++){var D=H[F];
if(!K||D.name.toLowerCase().indexOf(K.toLowerCase())==0||D.suggVal.toLowerCase().indexOf(K.toLowerCase())==0){var G=D.name?("("+D.name+") "+D.suggVal):D.suggVal;
var A=__d.ce("div");
A.className="suggestZm";
A.title=D.name?D.name:D.suggVal;
A.suggVal=D.suggVal;
A.suggFld=this.suggFld;
A.id="suggestDiv"+F+L;
N.appendChild(A);
var C=D.overlay;
A.overlay=C;
if(C&&C.image&&C.parentMap){var M=C.image.src;
var E=__u.Image.SetPng(__d.ce("img"),M);
E.style.margin="2px";
E.style.cursor=__u.Browser.handCursor;
E.alt=E.title=C.location_name?C.location_name:C.address;
E.id="suggestImg"+F+L;
E.align="absmiddle";
A.appendChild(E);
}var J=__d.ce("a");
J.className="suggestL1";
J.id="suggestLink"+F+L;
J.title=A.title;
J.innerHTML=G.replace(B,"<b>$1</b>");
J.href="javascript:void(0)";
A.appendChild(J);
__u.Events.addListener(A,"mousedown",this.suggFld.suggestClickFn||function(O,P){P.suggFld.value=P.suggVal;
setTimeout(function(){P.suggFld.focus();
P.suggFld.select();
},100);
});
}}if(!H.length&&!K){var A=__d.ce("div");
A.className="suggestZm";
A.innerHTML="No recent locations";
N.appendChild(A);
}__u.Dom.removeAllChildNodes(this.suggestDivInner);
this.suggestDivInner.appendChild(this.titleDiv);
this.titleDiv.innerHTML=this.suggFld.noSearchResults?"Recent Locations":"Locations";
var I=this.suggestDivInner;
I.appendChild(N);
this.currentResults=this.suggestDivInner2.getElementsByTagName("div");
if(this.suggestDivInner2.childNodes.length>0){this.suggestDivInner2.lastChild.style.borderBottom="0px";
}if(this.currentResults.length>0||!K){this.showSuggest();
}else{this.hideSuggest();
}},addDropDownArrow:function(B,E){var F=B.parentNode;
var D;
if("suggestInputHolder"==F.id){D=F.parentNode.parentNode.parentNode;
}else{D=__d.createElement("div");
D.innerHTML="<table class='suggestCombo' id='suggestComboT' title='Address, City & State, or ZIP' cellSpacing='0' cellPadding='0' border='0'><tbody><tr><td id='suggestInputHolder'><input class='searchboxNewForm' value='' /></td><td class='suggestComboM'></td><td class='suggestDropDn' title='Recent Locations'>&nbsp;</td></tr></tbody></table>";
D=D.childNodes[0];
F.replaceChild(D,B);
}var C=D.getElementsByTagName("input")[0];
C.name=B.name;
C.id=B.id;
C.value=B.value;
C.suggestClickFn=B.suggestClickFn;
C.noSearchResults=B.noSearchResults;
var A=D.getElementsByTagName("TD")[2];
A.id=(B.id||"")+"LocsArrow";
A.targetSuggFld=C;
return A;
},makeSuggestible:function(B,C){C=C||{};
if(typeof (B)=="string"){B=__d.get(B);
}B.suggestClickFn=C.suggestClickFn;
B.noSearchResults=C.noSearchResults||0;
if(C.img||C.img===undefined){var A=("object"==typeof C.img)?C.img:this.addDropDownArrow(B,C);
B=A.targetSuggFld||B;
A.targetSuggFld=B;
this.bubble.noHideOnMousedown(A);
__u.Events.addListener(A,"click",this.arrowClick,this,true);
}__u.Events.addListener(B,"keyup",this.keyupSuggest,this,true);
__u.Events.addListener(B,"blur",function(D){__l.Keys.typing=false;
});
__u.Events.addListener(B,"click",function(){__l.Keys.typing=true;
});
__u.Events.addListener(B,"focus",function(){__l.Keys.typing=true;
this.setSuggFld(B);
this.bubble.lower();
},this,true);
__u.Events.addListener(B,"beforepaste",function(){return event&&(event.returnValue=false);
});
__u.Events.addListener(B,"paste",function(){var D=clipboardData.getData("Text");
D=D.replace(/\n/g," ").replace(/\r/g," ");
B.value=D;
return event&&(event.returnValue=false);
});
return B;
}};

