if(!ask){var ask={};
}if(!ask.Map){ask.Map=function(P,B,H,C,M){this.SavedLocations=[];
this.PoiList=[];
this.IndependentPoiList=[];
this.Directions=[];
this.DirectionManage=null;
this.Locations=[];
this.ContextMenuObj=0;
this.SavedEditDlg=0;
this.sliderCtrl=null;
this.trafficOn=false;
this.mapId=P;
this.isPrintMap=M;
this.incidents=[];
this.incidentTracker=false;
this.incident_show_num=0;
if(!VEShape.prototype.ask_VE_SetCustomIcon){VEShape.prototype.ask_VE_SetCustomIcon=VEShape.prototype.SetCustomIcon;
VEShape.prototype.SetCustomIcon=ask.Map.VE_SetCustomIcon;
}this.DisableContextMenu=0;
this.clazz="ask.Map";
this.map=new VEMap(P);
if(typeof _VEToken!="undefined"){this.map.SetClientToken(_VEToken);
}this.ContainerId=P;
var J=ask.Map.ById(P);
J["ask.Map"]=this;
this.veMapClear=this.map.Clear;
this.map.Clear=function(){alert("Map.Clear shall not be called directly. Use ask.Map.ClearAll() instead");
};
var D;
var I=(B?new VELatLong(B.Lat,B.Lon):D),A=(B?16:D),R=VEMapStyle.Road,F=H||false,K=VEMapMode.Mode2D,N=false,L=1,T=undefined;
this.map.LoadMap(I,A,R,F,K,N,L,T);
if(ask.Map.DirectionManage){this.DirectionManage=new ask.Map.DirectionManage(this);
}var S=this;
this.map.HideDashboard();
this.MapVeId2MapObj={};
if(C==undefined||C==false){ask.Map.AddAskLogo(0,1,3);
ask.Map.InitControl(S);
this.GblEroHideDisable=0;
if(!ask.Map.EroHide){ask.Map.EroHide=window.ero.hide;
window.ero.hide=function(U){if(S.GblEroHideDisable){return ;
}return ask.Map.EroHide(U);
};
}function O(U){var V=U.elementID;
if(!V){return 1;
}S.MapVeId2MapObj[S.Id2Shape(V).GetID()].Highlight(U.eventName=="onmouseover");
return true;
}this.map.AttachEvent("onmouseover",O);
this.map.AttachEvent("onmouseout",O);
this.map.AttachEvent("onstartpan",function(U){if(U.leftMouseButton){return ;
}S.HidePopups();
});
this.map.AttachEvent("onstartzoom",function(U){S.HidePopups();
});
var G=false;
this.map.AttachEvent("onmousemove",function(U){if(G){S.HidePopups();
}});
this.map.AttachEvent("onmousedown",function(U){G=true;
});
this.map.AttachEvent("onmouseup",function(U){G=false;
});
function Q(X){S.GblEroHideDisable=0;
var Y=X.elementID;
if(Y){var W=S.MapVeId2MapObj[S.Id2Shape(Y).GetID()];
W&&W.Select(true);
return ;
}if(!X.rightMouseButton){S.HidePopups();
return ;
}if(S.DisableContextMenu){return ;
}var U=S.GetContextMenuObj();
var V=X.latLong||S.map.PixelToLatLong(new VEPixel(X.mapX,X.mapY));
U.Point=new ask.Map.Point(V.Latitude,V.Longitude);
U.Show(false);
U.Update();
U.Select(true);
}this.map.AttachEvent("onclick",Q);
function E(V){try{var W=S.map.GetZoomLevel();
if(S.map.GetMapStyle()!=VEMapStyle.Birdseye){S.DisableMenu("bird",!S.map.IsBirdseyeAvailable());
}if(S.sliderCtrl.getValue()!=(-7*(W-1))){S.sliderCtrl.setValue(-7*(W-1));
}}catch(U){}if(V.mapStyle==VEMapStyle.Road){document.getElementById(P).style.backgroundColor="#B3C6D4";
}else{document.getElementById(P).style.backgroundColor="#020514";
}if(V.zoomLevel>8&&V.zoomLevel<15){S.SelectMenu("traffic",S.trafficOn);
}else{S.DisableMenu("traffic",true);
}if(S.trafficOn&&S.incidentTracker){S.ShowTrafficIcons();
}}this.map.AttachEvent("onchangeview",E);
}else{ask.Map.AddAskLogo(1,0);
}this.Id2Shape=function(U){return this.map.GetShapeByID(U);
};
this.Resize(J.clientWidth,J.clientHeight);
};
ask.Map.prototype={AltLocations:[],Location:0,GetZoomLevel:function(){return this.map.GetZoomLevel();
},SetZoomLevel:function(A){this.map.SetZoomLevel(A);
return this;
},Resize:function(A,B){this.map.Resize(A,B);
return this;
},ZoomIn:function(){this.map.ZoomIn();
return this;
},ZoomOut:function(){this.map.ZoomOut();
return this;
},BuildControl:function(B,A){var C=YAHOO.util.Dom.get(B);
C.style.top=A;
C.style.left="0px";
this.map.AddControl(C);
return this;
},ToggleMenu:function(B){var A;
if(this.map.IsBirdseyeAvailable()){A=["road","aerial","bird"];
}else{A=["road","aerial"];
}for(i in A){var C=A[i];
if(C==B){this.SelectMenu(C,true);
}else{this.SelectMenu(C,false);
}}},SelectMenu:function(A,B){if(B){YAHOO.util.Dom.get(A).className="selected";
}else{YAHOO.util.Dom.get(A).className="";
}},DisableMenu:function(A,B){if(B){YAHOO.util.Dom.get(A).className="disabled";
}else{YAHOO.util.Dom.get(A).className="";
}},AddIncidentPins:function(B,D,E){var A=B.length;
if(E&&B.length>E){A=E;
}for(var C=0;
C<A;
C++){if(D=="H"){if(B[C].severity=="H"){B[C].Show();
this.incident_show_num++;
}else{break;
}}if(D=="M"){if(B[C].severity!="L"){B[C].Show();
this.incident_show_num++;
}else{break;
}}if(D=="L"){B[C].Show();
this.incident_show_num++;
}}},DeleteIncidents:function(){for(var A=0;
A<this.incidents.length;
A++){this.map.DeleteShape(this.incidents[A]);
}this.incidents=[];
this.incidentTracker=false;
this.incident_show_num=0;
},HiddenIncidents:function(){this.incident_show_num=0;
for(var A=0;
A<this.incidents.length;
A++){this.incidents[A].Hide();
}},ShowTrafficIcons:function(){this.HiddenIncidents();
var A=this.map.GetZoomLevel();
if(A==9){this.AddIncidentPins(this.incidents,"H");
return ;
}if(A==10){this.AddIncidentPins(this.incidents,"M");
return ;
}if(A>10){this.AddIncidentPins(this.incidents,"L");
return ;
}},ShowTraffic:function(){if(YAHOO.util.Dom.get("traffic").className=="disabled"){return this;
}if(this.trafficOn){this.CloseTraffic();
}else{this.OpenTraffic();
}return this;
},OpenTraffic:function(){function A(){var F=new Date();
var D=F.getHours();
var E=F.getMinutes();
var G="AM";
if(D>=12){G="PM";
D=D-12;
}if(D==0){D=12;
}if(E<10){E="0"+E;
}return(D+":"+E+" "+G);
}__l.Proxy.lookupIncident(this,ask.Map.AddIncidentPin);
try{this.map.LoadTraffic(true);
var C=document.getElementById("MSVE_MapLegend");
if(C==null){this.map.ShowTrafficLegend();
ask.Map.AddTrafficLegend();
C=document.getElementById("MSVE_MapLegend");
}C.style.display="block";
document.getElementById("MSVE_TrafficMsg").innerHTML=A();
this.SelectMenu("traffic",!this.trafficOn);
this.trafficOn=!this.trafficOn;
}catch(B){}},CloseTraffic:function(){this.DeleteIncidents();
this.map.ClearTraffic();
document.getElementById("MSVE_MapLegend").style.display="none";
this.SelectMenu("traffic",!this.trafficOn);
this.trafficOn=!this.trafficOn;
},Zoom2Incident:function(A,B){this.map.SetCenterAndZoom(this.incidents[A].GetPoints()[0],B);
},Center2Incident:function(A){this.map.SetCenter(this.incidents[A].GetPoints()[0]);
},ShowAerial:function(){this.map.SetMapStyle(VEMapStyle.Aerial);
this.ToggleMenu("aerial");
return this;
},ShowRoad:function(){this.map.SetMapStyle(VEMapStyle.Road);
this.ToggleMenu("road");
return this;
},ShowBirdseye:function(){if(this.map.IsBirdseyeAvailable()){this.map.SetMapStyle(VEMapStyle.Birdseye);
this.ToggleMenu("bird");
}return this;
},IsBirdseye:function(){if(this.map.GetMapStyle()==VEMapStyle.Birdseye){return true;
}else{return false;
}},ShowControl:function(A){if(A==true){this.map.ShowControl(document.getElementById("menu"));
this.map.ShowControl(document.getElementById("zoom"));
this.map.ShowControl(document.getElementById("slider_top"));
this.map.ShowControl(document.getElementById("slide_bg"));
this.map.ShowControl(document.getElementById("slider_bottom"));
}else{this.map.HideControl(document.getElementById("menu"));
this.map.HideControl(document.getElementById("zoom"));
this.map.HideControl(document.getElementById("slider_top"));
this.map.HideControl(document.getElementById("slide_bg"));
this.map.HideControl(document.getElementById("slider_bottom"));
}return this;
},ZoomAll:function(){var A=[];
function B(E){var D=E.GetShape()&&E.GetShape().GetPoints();
for(var C=0;
C<D.length;
C++){A[A.length]=D[C];
}}ask.Map.ForEach(this.PoiList,B);
ask.Map.ForEach(this.SavedLocations,B);
ask.Map.ForEach(this.IndependentPoiList,B);
A.length&&this.map.SetMapView(A);
if(A.length==1){this.map.SetZoomLevel(__l.ZoomLevel.City);
}return this;
},CenterAndZoom:function(A,B){if(B){this.map.SetCenterAndZoom(ask.Map.Point2Native(A[0].Point),B);
}else{this.map.SetCenter(ask.Map.Point2Native(A[0].Point));
}return this;
},CenterAndZoomAndSelect:function(B,C){var A=this.map;
if(C){var D=function(E){setTimeout(function(){A.DetachEvent("onendzoom",D);
B[0].Select(true);
},1000);
};
A.AttachEvent("onendzoom",D);
A.SetCenterAndZoom(ask.Map.Point2Native(B[0].Point),C);
}else{var D=function(E){setTimeout(function(){A.DetachEvent("onendpan",D);
B[0].Select(true);
},1000);
};
A.AttachEvent("onendpan",D);
A.SetCenter(ask.Map.Point2Native(B[0].Point));
}return this;
},ClearAll:function(){var A=this.PoiList;
ask.Map.ForEach(A,function(B){if(B instanceof ask.Map.SavedLocation){ask.Map.ArrayRemove(A,B);
}else{B.Remove();
}});
ask.Map.ForEach(this.IndependentPoiList,function(B){B.Remove();
});
this.DirectionManage.Remove();
ask.Map.ForEach(this.SavedLocations,function(B){B.Update();
});
return this;
},LoadTraffic:function(A){this.map.LoadTraffic(A);
},ClearTraffic:function(){this.map.ClearTraffic();
},Clone:function(E,C,B,D){var A=new ask.Map(E,this.GetCenterPoint(),C,B,D);
A.SyncContent(this,E);
return A;
},SyncContent:function(J,B){var D=J;
if(!(D instanceof (ask.Map))){D=ask.Map.ById(J)["ask.Map"];
}if(!(D instanceof (ask.Map))){return ask.Map.Log("Map not found in "+J);
}this.ClearAll();
var G=this;
ask.Map.ForEach(D.IndependentPoiList,function(N){new ask.Map.IndependentPoi(G,N.Point,N.Name,N.Review,N.GetIcon(),N.GetIcon(1));
});
if(J.DirectionManage.Items.length>1){G.DirectionManage.DrawDirection(J.DirectionManage.Mode,J.DirectionManage.Items);
}if(J.trafficOn){try{this.map.LoadTraffic(true);
var L=document.getElementById("MSVE_MapLegend");
L.style.display="block";
var M=document.getElementById(B);
var E=L.cloneNode(true);
M.appendChild(E);
var C=J.incidents;
for(var F=0;
F<C.length;
F++){var K=C[F].GetPoints()[0].Latitude;
var A=C[F].GetPoints()[0].Longitude;
var H=new VEShape(VEShapeType.Pushpin,new VELatLong(K,A));
H.ask_VE_SetCustomIcon(C[F].GetCustomIcon());
this.map.AddShape(H);
}}catch(I){}}this.map.SetCenter(J.map.GetCenter());
this.map.SetMapStyle(J.map.GetMapStyle());
this.map.SetZoomLevel(J.map.GetZoomLevel());
return this;
},GetCenterPoint:function(){var D;
if(this.map.GetMapStyle()==VEMapStyle.BirdseyeHybrid||this.map.GetMapStyle()==VEMapStyle.Birdseye){var C=this.map.GetBirdseyeScene();
var B=C.LatLongToPixel(this.map.GetCenter(),this.map.GetZoomLevel());
var A=C.PixelToLatLong(B,this.map.GetZoomLevel());
D=(new _xy1).Decode(A);
}else{D=this.map.GetCenter();
}return ask.Map.Native2Point(D);
},OnSearchReady:function(E){this.ClearAll();
var A=E.Results;
for(var D=0;
D<A.length;
D++){var B=A[D];
var G=B.getAttribute("point");
G=G.split(",");
G=new ask.Map.Point(G[0],G[1]);
var C=B.getAttribute("location_name");
var F=this.IndexInSaved(G,C);
if(F>=0){this.PoiList[D]=this.SavedLocations[F];
continue;
}var H=new ask.Map.POI(this);
H.FromXml(B);
H.Update();
}this.OnResultsChanged(this);
return this;
},OnResultsChanged:function(B,A){return B;
},SaveObj:function(B){if(B instanceof ask.Map.SavedLocation){return B;
}var A=new ask.Map.SavedLocation(this,B);
this.OnResultsChanged(this);
return A;
},IndexInSaved:function(B,A){return this.IndexInList(B,A,this.SavedLocations);
},IndexInPoi:function(B,A){return this.IndexInList(B,A,this.PoiList);
},IndexInList:function(E,B,D){for(var C=0;
C<D.length;
C++){var A=D[C];
if(A.Name==B&&A.Point.Lon==E.Lon&&A.Point.Lat==E.Lat){return C;
}}return -1;
},FindObj:function(C,A){var B=this.IndexInSaved(C,A);
if(B>=0){return this.SavedLocations[B];
}B=this.IndexInPoi(C,A);
if(B>=0){return this.PoiList[B];
}return 0;
},LastID:-1,RenderId:function(){return --this.LastID;
},GetContextMenuObj:function(){return this.ContextMenuObj||(this.ContextMenuObj=new ask.Map.ContextPoint(this));
},GetSavedEditDlg:function(){return this.SavedEditDlg||(this.SavedEditDlg=new ask.Map.SavedEditDlg(this));
},HideMenu:function(){this.ContextMenuObj&&this.ContextMenuObj.Show(false);
return this;
},HidePopups:function(){this.GblEroHideDisable=0;
this.map.HideInfoBox();
this.HideMenu();
return this;
},SavedLocationsInvalidate:function(){for(var A=0;
A<this.SavedLocations.length;
A++){this.SavedLocations[A].UiUpdated=false;
}},PoiListInvalidate:function(){for(var A=0;
A<this.PoiList.length;
A++){this.PoiList[A].Update();
}},GetMapView:function(){var A=this.map.GetMapView();
var B=new Object();
B.left=A.TopLeftLatLong.Longitude;
B.top=A.TopLeftLatLong.Latitude;
B.right=A.BottomRightLatLong.Longitude;
B.bottom=A.BottomRightLatLong.Latitude;
return B;
},OnAltLocationsReady:function(C,B,A){this.ZoomAll();
},OnLocationError:function(C,A,B){},OnLocationReady:function(C,A,B){},OnDirectionsReady:function(B,A){},GetWidthPixel:function(){var A=this.map.GetMapView();
var B=this.map.LatLongToPixel(A.TopLeftLatLong);
var C=this.map.LatLongToPixel(A.BottomRightLatLong);
return C.x-B.x;
},GetHeightPixel:function(){var A=this.map.GetMapView();
var B=this.map.LatLongToPixel(A.TopLeftLatLong);
var C=this.map.LatLongToPixel(A.BottomRightLatLong);
return C.y-B.y;
},getBounds:function(){var A=this.map.GetMapView();
return{minLat:A.TopLeftLatLong.Longitude,minLong:A.BottomRightLatLong.Longitude,maxLat:A.TopLeftLatLong.Latitude,maxLong:A.BottomRightLatLong.Latitude};
},render:function(){},showAllOverlays:function(){this.ZoomAll();
},addOverlay:function(){},removeOverlay:function(){},drawOverlays:function(){},layerOverlays:function(){},closeInfoWindow:function(){this.HidePopups();
},hideNav:function(){this.map.HideDashboard();
},find:function(B,A){function C(F,G,E,H,D){A.call(window,E);
}this.map.Find(null,B,null,null,0,14,true,true,false,true,C);
},findLocations:function(A,C){function B(D){C.call(window,D);
}this.map.FindLocations(A,B);
}};
ask.Map.AddTrafficLegend=function(){var B=document.getElementById("MSVE_MapLegend");
var A=B.parentNode;
A.removeChild(B);
B=B.cloneNode(true);
B.style.display="none";
B.style.right="20px";
B.style.bottom="55px";
A.appendChild(B);
};
ask.Map.InitControl=function(D){D.BuildControl("menu","0px");
D.BuildControl("zoom","28px");
D.BuildControl("slider_top","86px");
D.BuildControl("slide_bg","108px");
D.BuildControl("slider_bottom","243px");
function C(E){E.className=E.id+"_mousedown";
}function A(E){E.className=E.id+"_normal";
}function B(E){E.className=E.id+"_mouseover";
}__u.Events.addListener(document.getElementById("zoom_in_btn"),"click",function(){D.ZoomIn();
});
__u.Events.addListener(document.getElementById("zoom_in_btn"),"mousedown",function(){C(this);
});
__u.Events.addListener(document.getElementById("zoom_in_btn"),"mouseup",function(){B(this);
});
__u.Events.addListener(document.getElementById("zoom_in_btn"),"mouseover",function(){B(this);
});
__u.Events.addListener(document.getElementById("zoom_in_btn"),"mouseout",function(){A(this);
});
__u.Events.addListener(document.getElementById("zoom_out_btn"),"click",function(){D.ZoomOut();
});
__u.Events.addListener(document.getElementById("zoom_out_btn"),"mousedown",function(){C(this);
});
__u.Events.addListener(document.getElementById("zoom_out_btn"),"mouseup",function(){B(this);
});
__u.Events.addListener(document.getElementById("zoom_out_btn"),"mouseover",function(){B(this);
});
__u.Events.addListener(document.getElementById("zoom_out_btn"),"mouseout",function(){A(this);
});
__u.Events.addListener(document.getElementById("road"),"click",function(){D.ShowRoad();
this.blur();
});
__u.Events.addListener(document.getElementById("aerial"),"click",function(){D.ShowAerial();
this.blur();
});
__u.Events.addListener(document.getElementById("bird"),"click",function(){D.ShowBirdseye();
this.blur();
});
__u.Events.addListener(document.getElementById("traffic"),"click",function(){D.ShowTraffic();
this.blur();
});
YAHOO.util.Event.onDOMReady(function(){var H=126;
var E=0;
var F=7;
var G=YAHOO.widget.Slider.getVertSlider("slide_bg","slider_handle",H,E,F);
D.sliderCtrl=G;
YAHOO.lang.augmentObject(G,{minValue:1,maxValue:19,getCalculatedValue:function(){var J=-1*this.getValue();
var I=(this.maxValue-this.minValue)/(this.thumb.topConstraint+this.thumb.bottomConstraint);
return Math.round(J*I)+this.minValue;
}});
G.subscribe("change",function(J){var I=this.getCalculatedValue();
D.map.SetZoomLevel(I);
document.getElementById("slide_bg").blur();
});
});
D.ShowRoad();
};
ask.Map.AddAskLogo=function(I,P,J){function Q(U,S,T){if(U){if(a10.browser.isIE6()&&S.indexOf(".png")!=-1){U.src="http://sp.ask.com/sh/i/pixl.gif";
T=T?T:"none";
U.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+S+"', sizingMethod='"+T+"')";
}else{U.src=S;
}}return U;
}try{var A=a10.util.getElementsByClassName("MSVE_PoweredByLogo")[I];
if(A){A.style.display="none";
}var B=a10.util.getElementsByClassName("MSVE_CopyrightForeground")[I];
if(B){B.style.position="absolute";
B.style.right="101px";
B.style.zIndex=J||"31";
}var F=a10.util.getElementsByClassName("MSVE_CopyrightBackground")[I];
if(F){F.style.position="absolute";
F.style.right="100px";
F.style.zIndex=J-1||"31";
}var R=a10.util.getElementsByClassName("MSVE_ScaleBarFg")[I];
if(R){R.style.position="absolute";
R.style.right="101px";
R.style.zIndex=J||"31";
}var D=a10.util.getElementsByClassName("MSVE_ScaleBarBg")[I];
if(D){D.style.position="absolute";
D.style.right="100px";
D.style.zIndex=J-1||"30";
}var M=a10.util.getElementsByClassName("MSVE_ScaleBarLabelFg")[I];
if(M){M.style.position="absolute";
M.style.right="101px";
M.style.zIndex=J||"31";
}var E=a10.util.getElementsByClassName("MSVE_ScaleBarLabelBg")[I];
if(E){E.style.position="absolute";
E.style.right="100px";
E.style.zIndex=J-1||"30";
}var C=a10.util.getElementsByClassName("MSVE_MapContainer")[I];
var G=Q(document.createElement("img"),"http://sp.ask.com/sh/i/local/mve_logo_83x29.png");
G.style.position="absolute";
G.style.right="12px";
G.style.bottom="17px";
G.style.zIndex=J||"100";
C.appendChild(G);
var H=Q(document.createElement("img"),"http://sp.ask.com/sh/i/local/ask_logo.png");
H.style.position="absolute";
H.style.left="10px";
H.style.bottom="8px";
H.style.zIndex=J||"100";
C.appendChild(H);
var K=Q(document.createElement("img"),"http://sp.ask.com/sh/i/local/terms_privacy.png");
if(P){var L=document.createElement("a");
L.href="javascript:void(0)";
L.onclick=function O(){window.open("http://sp.ask.com/en/docs/about/mapstermsofuse.shtml");
};
K.style.border="0px";
L.appendChild(K);
L.style.position="absolute";
L.style.left="60px";
L.style.bottom="17px";
L.style.zIndex=J||"100";
C.appendChild(L);
}else{K.style.position="absolute";
K.style.left="60px";
K.style.bottom="17px";
K.style.zIndex=J||"100";
C.appendChild(K);
}}catch(N){}};
ask.Map.Point2Native=function(A){return A&&new VELatLong(A.Lat,A.Lon);
};
ask.Map.Native2Point=function(A){return A&&new ask.Map.Point(A.Latitude,A.Longitude);
};
ask.Map.ArrayRemove=function(A,D,C){if((""+D)*1!=D){D=ask.Map.ArrayFind(A,D);
return(D<0)?A:ask.Map.ArrayRemove(A,D);
}var B=A.slice((C||D)+1||A.length);
A.length=D<0?A.length+D:D;
return A.push.apply(A,B);
};
ask.Map.ArrayFind=function(A,C){for(var B=0;
B<A.length;
B++){if(A[B]==C){return B;
}}return -1;
};
ask.Map.ById=function(A){return typeof (A)!=undefined&&(A.tagName?A:document.getElementById(A));
};
ask.Map.SubById=function(D,B){if(typeof (D)=="string"){D=document.getElementById(D);
}if(!D.getAttribute){return 0;
}if(D.getAttribute("id")==B||D.getAttribute("name")==B){return D;
}var A=0;
for(var C=0;
!A&&C<D.childNodes.length;
C++){A=ask.Map.SubById(D.childNodes[C],B);
if(A){break;
}}return A;
};
ask.Map.Show=function(D,C,A){if(arguments.length==1){A=1;
}else{if(arguments.length==2){A=(C&&("string"==typeof (C)||C.tagName))?1:C;
}}function B(E){if(E){E.style.display=(A?"":"none");
}}if(C&&("string"==typeof (C)||C.tagName)){return ask.Map.ForEachById(D,C,B);
}A=arguments.length>1?A:1;
ask.Map.ForEachById(D,B);
};
ask.Map.ShowToggle=function(C,B){function A(D){D=D;
D.style.display=(D.style.display=="none"?"":"none");
}if(B&&("string"==typeof (B)||B.tagName)){return ask.Map.ForEachById(C,B,A);
}ask.Map.ForEachById(C,A);
};
ask.Map.ForEach=function(A,B){if(A&&A.length&&B){for(var C=A.length-1;
C>=0;
C--){B(A[C]);
}}};
ask.Map.ForEachById=function(F,E,A){if(arguments.length==2){A=E;
var D=document.getElementsByName(F);
ask.Map.ForEach(D.length?D:[ask.Map.ById(F)],A);
return ;
}if(typeof (E)=="string"){return ask.Map.ForEachById(E,function(G){ask.Map.ForEachById(F,G,A);
});
}if(!E||!E.getAttribute){return 0;
}if(E.getAttribute("id")==F||E.getAttribute("name")==F){return A(E)&&E;
}var B=0;
for(var C=0;
!B&&C<E.childNodes.length;
C++){B=ask.Map.ForEachById(F,E.childNodes[C],A);
}return B;
};
ask.Map.FindMap=function(A){if(A["ask.Map"]){return A["ask.Map"];
}if(!A.parentNode){return ask.Map.FindMap(ask.Map.ById(A));
}return ask.Map.FindMap(A.parentNode);
};
ask.Map.SetEventHandler=function(B,C,E,A){ask.Map.SetEventHandler.Handler=ask.Map.SetEventHandler.Handler||function(G,H,I,F){this.EventSourceObj=G;
this.EventSourceFun=G[H];
this.EventHandlerObj=!F?window:I;
this.EventHandlerFun=!F?I:F;
};
var D=new ask.Map.SetEventHandler.Handler(B,C,E,A);
D.EventFunctionWrapper=B[C]=function(){var F=D.EventSourceFun.apply(D.EventSourceObj,arguments);
D.EventHandlerFun.apply(D.EventHandlerObj,arguments);
return F;
};
return D;
};
ask.Map.Log=window.opera?opera.postError:window.console?console.debug:function(C){var D="DebugSection";
var B=document.getElementById(D);
if(!B){return ;
B=document.createElement("ul");
B.id=D;
document.getElementsByTagName("body")[0].appendChild(B);
}var A=document.createElement("li");
B.insertBefore(A,B.firstChild);
A.innerHTML=C;
};
ask.Map.Point=function(A,B){this.Lat=A;
this.Lon=B;
};
ask.Map.Point.prototype={Lat:0,Lon:0,toString:function(){return this.Lat+","+this.Lon;
},Equals:function(A){return ask.Map.Point.Equals(this,A);
},Distance:function(A){return Math.sqrt(Math.pow(A.Lon-this.Lon,2)+Math.pow(A.Lat-this.Lat,2));
}};
ask.Map.Point.Equals=function(B,A){return B&&A&&B.Lat==A.Lat&&B.Lon==A.Lon;
};
ask.Map.Search=function(C,A,B){this.ObjFrom=A||C.ContextMenuObj;
this.Map=C;
this.What=B;
};
ask.Map.Search.Url="Search.jsp?";
ask.Map.Search.prototype={What:"",Street:"",City:"",State:"",Zip:"",ErrMessage:"",Locations:[],Results:[],Query:function(){var C=new XMLHttpRequest();
var B=ask.Map.Search.Url+"lat="+this.ObjFrom.Point.Lat+"&long="+this.ObjFrom.Point.Lon+"&q="+escape(this.What);
var A=this;
C.onreadystatechange=function(){if(C.readyState==4&&C.status==200){A.LoadXml(C.responseXML);
}};
C.open("GET",B,true);
C.send(null);
return this;
},OnReady:function(A){},LoadXml:function(A){this.ClearResults();
this.Results=A.getElementsByTagName("location");
this.ObjFrom.SearchParams=this;
this.OnReady(this);
},ClearResults:function(){this.ErrMessage="";
this.Locations=[];
this.Results=[];
},toString:function(){return this.What+" @ "+this.Street+" "+this.City+" "+this.State+" "+this.Zip+" ";
}};
ask.Map.Util={CreatePrintMap:function(D,C){if(D.IsBirdseye()){return ;
}var A=D.Clone(C,true,true,true);
var B=new VEPrintOptions(true);
A.map.SetPrintOptions(B);
return A;
},decartaToVEZoom:function(B){var A=19-B;
if(A<0){A=0;
}return A;
},veToDecartaZoom:function(B){var A=19-B;
if(A<0){A=0;
}return A;
}};
ask.Map.GetIconDef=function(B){if(B instanceof (VECustomIconSpecification)){return B;
}function A(H,G,F){F=F+10;
var J=new VECustomIconSpecification();
J.Image=(H.indexOf("://")>0)?H:ask.Map.IconUrlBase+H;
var I="<img src='"+J.Image+"'>";
J.CustomHTML="<div style='position:relative;top:"+F+"px;left:"+G+"px;'>"+I+"</div>";
if(H.indexOf(".png")!=-1&&(navigator.userAgent.toLowerCase().indexOf("msie 6.")!=-1)){J.CustomHTML="<img src='http://sp.ask.com/sh/i/pixl.gif' style='position:relative;top:"+F+"px;left:"+G+"px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+J.Image+");' />";
}J.ImageOffset=new VEPixel(G,F);
return J;
}ask.Map.IconUrl2IcoDef=ask.Map.IconUrl2IcoDef||{"red_cir_1.gif":A("red_cir_1.gif",11,35),"10.gif":A("10.gif",11,11)};
var C=ask.Map.IconUrl2IcoDef[B];
if(C){return C;
}if(B.indexOf("<")>=0){return ask.Map.IconUrl2IcoDef[B]=A(B,4,4);
}function D(H,G,F){return H?A(B,G,F):0;
}function E(H,G,F){return(H==B)?A(B,G,F):0;
}return D(B.indexOf(".gif")==1,11,11)||D(B.indexOf("red_m_")==0,0,-36)||D(B.indexOf("blue_m_")==0,0,-36)||D(B.indexOf("gr_m_")==0,0,-36)||D(B.indexOf("yellow_m_")==0,0,-36)||D(B.indexOf("pin_green")==0,0,-34)||D(B.indexOf("pin_yellow")==0,0,-34)||D(B.indexOf("point_")==0,0,-35)||D(B.indexOf("pin_yellow")==0,0,-34)||D(B.indexOf("small_circles.gif")>0,4,-8)||D(B.indexOf("large_circles.gif")>0,-8,-18)||D(B.indexOf("concentric_circles")>0,-2,-10)||E("10.gif",11,11)||E("angry_32.png",16,16)||E("applications_32.png",16,16)||E("arrow.gif",21,21)||A(B,0,-36);
};
ask.Map.VE_SetCustomIcon=function(A){var B=ask.Map.GetIconDef(A);
return this.ask_VE_SetCustomIcon(B);
};
ask.Map.IconUrlBase="http://sp.ask.com/sh/i/local/";
ask.Map.AddIncidentPin=function(A,E){function B(O){var P=O.substring(0,19);
var N=/T/g;
return P.replace(N," ");
}var F=A.GetZoomLevel();
A.DeleteIncidents();
var I=E.documentElement.getElementsByTagName("incident");
A.incident_show_num=I.length;
for(var D=0;
D<I.length;
D++){var L=I[D];
var M=L.getElementsByTagName("Severity")[0].childNodes[0].nodeValue;
var G="<table >";
G+="<tr><td style='font-size:12px;' > <b>Name:&nbsp;</b>"+L.getElementsByTagName("Name")[0].childNodes[0].nodeValue+"</td></tr>";
G+="<tr><td style='font-size:12px;'><b>Severity:&nbsp;</b>"+L.getElementsByTagName("Severity")[0].childNodes[0].nodeValue+"</td></tr>";
G+="<tr><td style='font-size:12px;' ><b>Description:&nbsp;</b>"+L.getElementsByTagName("FullDescription")[0].childNodes[0].nodeValue+"</td></tr>";
G+="<tr><td style='font-size:12px;' ><b>Updated:&nbsp;</b>"+B(L.getElementsByTagName("LastUpdated")[0].childNodes[0].nodeValue)+"</td></tr>";
G+="<br/><tr><td style='font-size:12px;' > <a class='L17' onclick='ask.Map.UI.Incident.Zoom(this,"+D+");' title='Zoom to Incident' href='#'>Zoom to Incident</a><span class='t17'><strong> · </strong></span><a class='L17' onclick='ask.Map.UI.Incident.Center(this,"+D+");' title='Center Map Here' href='#'>Center Map Here</a></td></tr>";
G+="</table>";
var J=L.getElementsByTagName("lat")[0].childNodes[0].nodeValue;
var K=L.getElementsByTagName("long")[0].childNodes[0].nodeValue;
try{var H=new VEShape(VEShapeType.Pushpin,new VELatLong(J,K));
H.SetTitle("ACCIDENT");
H.SetDescription(G);
switch(M){case"Severe":case"High":H.severity="H";
H.ask_VE_SetCustomIcon(ask.Map.IconUrlBase+"traffic_orange.gif");
A.map.AddShape(H);
break;
case"Medium":H.severity="M";
H.ask_VE_SetCustomIcon(ask.Map.IconUrlBase+"traffic_yellow.gif");
A.map.AddShape(H);
if(F<10){H.Hide();
A.incident_show_num--;
}break;
case"Low":case"Unknow":H.severity="L";
H.ask_VE_SetCustomIcon(ask.Map.IconUrlBase+"traffic_yellow.gif");
A.map.AddShape(H);
if(F<11){H.Hide();
A.incident_show_num--;
}break;
}A.incidents.push(H);
}catch(C){}}A.incidentTracker=true;
};
}
if(ask.Map&&!ask.Map.MapObj){ask.Map.MapObj=function(B,A){this.Point=A||this.Point||new ask.Map.Point(0,0);
this.Map=B;
if(B){this.ID=B.RenderId();
this.Map.MapVeId2MapObj[this.ID]=this;
}};
ask.Map.MapObj.Inherit=function(B,A){B.prototype=new ask.Map.MapObj();
B.constructor=B;
if(A){for(var C in A){B.prototype[C]=A[C];
}}};
ask.Map.MapObj.prototype={clazz:"ask.Map.MapObj",ID:null,Title:"",Description:"",Point:0,Icon:"1",IconUrl:"",Name:"",Street:"",City:"",State:"",Zip:"",SearchParams:0,ShowSearchDlg:0,ShowDirectionsDlg:0,GetFullAddress:function(){return this.Street+", "+this.City+", "+this.State+", "+this.Zip;
},Highlight:function(A){this.OnHighlightChanged(A);
},Show:function(A){var B=this.GetShape();
if(B){A?B.Show():B.Hide();
}this.OnShowChanged(A);
return this;
},Select:function(D){if(D&&!this.UiUpdated){this.Update();
}var C=this.Map.map;
var B=this.GetShape();
this.Map.HidePopups();
if(D&&B){this.Map.GblEroHideDisable=1;
var H=B.GetPoints()[0];
var I=C.GetMapView();
var G=H.Latitude;
var A=H.Longitude;
if(I.TopLeftLatLong.Longitude>A||I.BottomRightLatLong.Longitude<A||I.TopLeftLatLong.Latitude<G||I.BottomRightLatLong.Latitude>G){C.EndContinuousPan();
var E=function(J){setTimeout(function(){C.ShowInfoBox(B);
},10);
C.DetachEvent("onendpan",E);
};
C.AttachEvent("onendpan",E);
C.SetCenter(H);
}C.ShowInfoBox(B);
if(this.ShowDirectionsDlg){var F=ask.Map.ById("ask.Map.UI.Dlg.Directions.0");
}}this.OnSelectChanged(D);
return this;
},Redraw:function(){this.Update();
this.Select(false);
this.Select(true);
return this;
},Remove:function(){if(!this.ID){return this;
}this.Select(false);
this.OnRemoved();
if(!(this.ID*1<0)){this.Map.map.DeleteShape(this.GetShape());
}ask.Map.ArrayRemove(this.Map.PoiList,this);
this.Map.MapVeId2MapObj[this.ID]=0;
this.ID=0;
return 0;
},GetBubbleHtml:function(){return this.ApplyFields(this.DlgIdContextMenu).innerHTML;
},UpdateContextMenu:function(A){if(!this.ID){return this;
}var B;
if(this.ShowDirectionsDlg){this.ShowDirectionsDlg=0;
B=this.ApplyFields(this.DlgIdDirectionsDlg);
if(A.nextSibling.getElementsByTagName("input")[0]){return this;
}}if(this.ShowSearchDlg){this.ShowSearchDlg=0;
B=this.ApplyFields(this.DlgIdSearchnearDlg);
if(A.nextSibling.getElementsByTagName("input")[0]){return this;
}}A.parentNode.insertBefore(B,A.nextSibling);
return this;
},Update:function(){if(!this.ID){return this;
}var E=this.GetShape();
var B=ask.Map.Point2Native(this.Point);
E.SetCustomIcon(this.GetIcon());
E.SetPoints(B);
E.SetTitle(this.Title);
var D=this.GetBubbleHtml();
if(this.SearchParams){if(this.SearchParams.ErrMessage){ask.Map.ById("ask.Map.UI.Dlg.Error.Msg").innerHTML=this.SearchParams.ErrMessage;
D+=ask.Map.ById("ask.Map.UI.Dlg.Error").innerHTML;
}var A;
for(var C=0;
C<this.SearchParams.Locations.length;
C++){A=this.SearchParams.Locations[C];
A.ApplyFields(this.DlgIdShortListItem);
ask.Map.ById("ask.Map.UI.Dlg.Location.Name").innerHTML=A.getAttribute("location_name");
ask.Map.ById("ask.Map.UI.Dlg.Location.Name").setAttribute("title",A.getAttribute("review_synopses")||"");
ask.Map.ById("ask.Map.UI.Dlg.Location.Ico").src=(C>=26?"gr_cir_dot.gif":"gr_cir_"+String.fromCharCode(97+C)+".gif");
D+=ask.Map.ById("ask.Map.UI.Dlg.Location").innerHTML;
}for(C=0;
C<this.SearchParams.Results.length;
C++){A=this.SearchParams.Results[C];
var F=A.getAttribute("point");
F=F.split(",");
F=new ask.Map.Point(F[0],F[1]);
var G=this.Map.FindObj(F,A.getAttribute("location_name"));
if(!G){G=new ask.Map.GreyPOI(this.Map,this.SearchParams.Results,C);
}D+=G.ApplyFields(G.DlgIdShortListItem).innerHTML;
}}E.SetDescription("<span MapId='"+this.Map.ContainerId+"' MapObjId='"+this.ID+"' >"+D+"</span>");
this.UiUpdated=true;
this.OnChanged();
return this;
},DlgIdLongListItem:"ask.Map.POI.LongListItem",DlgIdShortListItem:"ask.Map.POI.ShortListItem",DlgIdContextMenu:"ask.Map.POI.ContextMenu",DlgIdSearchnearDlg:"ask.Map.UI.Dlg.Search",DlgIdDirectionsDlg:"ask.Map.UI.Dlg.Directions",ApplyFields:function(C){if(typeof (C)=="string"&&C=="ask.Map.UI.Dlg.Directions"){C=ask.Map.ById(C);
var D=C.cloneNode(true);
D.id="ask.Map.UI.Dlg.Directions.0";
}else{if(typeof (C)=="string"){C=ask.Map.ById(C);
if(C){var D=C.cloneNode(true);
D.id=0;
}}}for(var B in this){if("string"==typeof (this[B])){ask.Map.UI.SetSubById(D,B,this[B],this);
}}ask.Map.UI.SetSubById(D,"Name",this.Name);
ask.Map.UI.SetSubById(D,"Distance",ask.Map.UI.DistanceStr(this.Distance));
ask.Map.UI.SetSubById(D,"Rating",(1*this.Rating).toFixed(0));
D.setAttribute("MapObjId",this.ID);
D.setAttribute("MapId",this.Map.ContainerId);
var A=document.createElement("span");
A.appendChild(D);
return A;
},GetIcon:function(D){var B=this.Map.IndexInPoi(this.Point,this.Name);
var C="parrot_32.png";
var A="red_cir_"+(B+1)+".gif";
var E="red_m_"+(B+1)+".png";
if(D){return ask.Map.IconUrlBase+((B>10)?C:A);
}return(B>9)?C:E;
},OnShowChanged:function(A){A=A;
},OnSelectChanged:function(A){A=A;
},OnHighlightChanged:function(A){A=A;
},OnRemoved:function(){this.Map.OnResultsChanged(this.Map);
},OnChanged:function(){},AttachShape:function(A){A=A||new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
this.Map.map.AddShape(A);
this.Map.MapVeId2MapObj[this.ID]=0;
this.ID=A.GetID();
this.Map.MapVeId2MapObj[this.ID]=this;
return this;
},GetShape:function(){return(this.ID*1<0)?0:this.Map.map.GetShapeByID(this.ID);
},toString:function(){return"POI ID="+this.ID+" Title="+this.Title+" Name="+this.Name+this.GetFullAddress();
},UiUpdated:false,FromXml:function(B){for(var A=0;
A<B.attributes.length;
A++){var C=this.XmlAttr2Name(B.attributes[A].nodeName);
this[C]=B.attributes[A].nodeValue;
}var D=B.getAttribute("point");
D=D.split(",");
D=new ask.Map.Point(D[0],D[1]);
this.Point=D;
return this;
},XmlAttr2NameMap:{"location_name":"Name","addr":"Street","city":"City","state":"State","postal_code":"Zip","dist":"Distance","website_link":"Link","phone":"Phone","review_teasers":"Description","review_synopses":"Review","overall_rating":"Rating"},XmlAttr2Name:function(A){return this.XmlAttr2NameMap[A]||A;
}};
ask.Map.POI=function(D,A,E,C){ask.Map.MapObj.call(this,D,A);
var B=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
D.PoiList[D.PoiList.length]=this;
B.SetCustomIcon(this.GetIcon());
this.AttachShape(B);
this.Name=E||"";
this.Review=C||"";
};
ask.Map.MapObj.Inherit(ask.Map.POI);
ask.Map.POI.prototype.clazz="ask.Map.POI";
ask.Map.POI.prototype.DlgIdContextMenu="ask.Map.POI.ContextMenu";
ask.Map.POI.prototype.Remove=function(){this.Select(false);
this.OnRemoved();
this.Map.map.DeleteShape(this.GetShape());
ask.Map.ArrayRemove(this.Map.PoiList,this);
this.Map.MapVeId2MapObj[this.ID]=0;
this.ID=0;
};
ask.Map.POI.prototype.OnRemoved=function(){};
ask.Map.POI.prototype.Update=function(){ask.Map.MapObj.prototype.Update.call(this);
};
ask.Map.SavedLocation=function(C,B){ask.Map.MapObj.call(this,C,B.Point);
this.Map.SavedLocationsInvalidate();
this.Name=B.Name||B.Point.toString();
this.Street=B.Street;
this.City=B.City;
this.State=B.State;
this.Zip=B.Zip;
this.Distance=B.Distance;
this.Link=B.Link;
this.Phone=B.Phone;
this.Review=B.Review;
this.Rating=B.Rating;
var A=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
C.SavedLocations[C.SavedLocations.length]=this;
A.SetCustomIcon(this.GetIcon());
var D=ask.Map.ArrayFind(this.Map.PoiList,B);
if(D>=0){this.Map.PoiList[D]=this;
}this.AttachShape(A);
this.OrigTitle=this.Name;
this.Update();
B.Remove();
};
ask.Map.MapObj.Inherit(ask.Map.SavedLocation);
ask.Map.SavedLocation.prototype.clazz="ask.Map.SavedLocation";
ask.Map.SavedLocation.prototype.DlgIdLongListItem="ask.Map.SavedLocation.LongListItem";
ask.Map.SavedLocation.prototype.DlgIdShortListItem="ask.Map.POI.ShortListItem";
ask.Map.SavedLocation.prototype.DlgIdContextMenu="ask.Map.SavedLocation.ContextMenu";
ask.Map.SavedLocation.prototype.Remove=function(){this.Select(false);
this.Map.SavedLocationsInvalidate();
ask.Map.ArrayRemove(this.Map.SavedLocations,this);
ask.Map.ArrayRemove(this.Map.PoiList,this);
this.Map.MapVeId2MapObj[this.ID]=0;
this.OnRemoved();
this.Map.map.DeleteShape(this.GetShape());
this.ID=0;
this.Map.PoiListInvalidate();
return 0;
};
ask.Map.SavedLocation.prototype.Edit=function(){var A=this.Map.GetSavedEditDlg();
A.Init(this);
this.Select(false);
A.Show(false);
A.Select(true);
return A;
};
ask.Map.SavedLocation.prototype.GetIcon=function(C){if(this.IconUrl){return this.IconUrl;
}var B=this.Map.IndexInSaved(this.Point,this.Name);
if(C){if(B>26){var A="blue_m_dot.png";
}else{var A="blue_cir_"+String.fromCharCode(97+B)+".gif";
}}else{if(B>26){var A="blue_m_dot.png";
}else{var A="blue_m_"+String.fromCharCode(97+B)+".png";
}}return A;
};
ask.Map.SavedLocation.prototype.SetIcon=function(A){if(A){this.IconUrl=A;
}this.GetShape().SetCustomIcon(A);
};
ask.Map.GreyPOI=function(C,D,B){this.Index=B;
this.FromXml(D[B]);
ask.Map.MapObj.call(this,C);
var A=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
A.SetCustomIcon(this.GetIcon());
this.AttachShape(A);
this.Show(false);
};
ask.Map.MapObj.Inherit(ask.Map.GreyPOI);
ask.Map.GreyPOI.prototype.clazz="ask.Map.GreyPOI";
ask.Map.GreyPOI.prototype.DlgIdLongListItem="ask.Map.POI.LongListItem";
ask.Map.GreyPOI.prototype.DlgIdShortListItem="ask.Map.GreyPOI.ShortListItem";
ask.Map.GreyPOI.prototype.DlgIdContextMenu="ask.Map.GreyPOI.ContextMenu";
ask.Map.GreyPOI.prototype.Remove=function(){this.Select(false);
this.Map.MapVeId2MapObj[this.ID]=0;
this.OnRemoved();
this.Map.map.DeleteShape(this.GetShape());
this.ID=0;
return 0;
};
ask.Map.GreyPOI.prototype.GetIcon=function(C){var B=this.Index;
if(C){if(B>10){var A="parrot_32.png";
}else{var A=""+(B+1)+"_grey.gif";
}}else{if(B>10){var A="parrot_32.png";
}else{var A=""+(B+1)+"_grey.gif";
}}return A;
};
ask.Map.GreyPOI.prototype.Select=function(A){if(A){this.Show(true);
}return ask.Map.MapObj.prototype.Select.call(this,A);
};
ask.Map.ContextPoint=function(C,A){ask.Map.MapObj.call(this,C,A||C.GetCenterPoint());
var B=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
B.SetCustomIcon("blue_m_dot.png");
this.AttachShape(B);
};
ask.Map.MapObj.Inherit(ask.Map.ContextPoint);
ask.Map.ContextPoint.prototype.clazz="ask.Map.ContextPoint";
ask.Map.ContextPoint.prototype.DlgIdContextMenu="ask.Map.ContextMenu";
ask.Map.ContextPoint.prototype.Remove=function(){this.Show(0);
return 0;
};
ask.Map.SavedEditDlg=function(B){this.SavedLocation=0;
ask.Map.MapObj.call(this,B);
var A=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
A.SetCustomIcon("blue_m_dot.png");
this.AttachShape(A);
};
ask.Map.MapObj.Inherit(ask.Map.SavedEditDlg);
ask.Map.SavedEditDlg.prototype.clazz="ask.Map.SavedEditDlg";
ask.Map.SavedEditDlg.prototype.DlgIdContextMenu="ask.Map.SavedEditDlg";
ask.Map.SavedEditDlg.prototype.DlgIdIconSelect="ask.Map.SavedEditDlg.Icons";
ask.Map.SavedEditDlg.prototype.Icon="applications_32.png";
ask.Map.SavedEditDlg.prototype.Init=function(A){this.DlgIdContextMenu=ask.Map.SavedEditDlg.prototype.DlgIdContextMenu;
this.SavedLocation=A;
this.Point=A.Point;
this.Name=A.Name;
this.Description=A.Description;
this.IconUrl=this.Icon=A.GetIcon().Image||A.GetIcon();
this.Update();
if(this.SavedLocation.Marker&&!this.SavedLocation.Marker.mods){this.SavedLocation.Marker.mods={name:this.SavedLocation.Marker.location_name||"",description:this.SavedLocation.Marker.description||"",icon:this.SavedLocation.Marker.icon.imageUrl||"",images:this.SavedLocation.Marker.images?this.SavedLocation.Marker.images.slice(0):[],currentImage:0};
}};
ask.Map.SavedEditDlg.prototype.Save=function(){this.SavedLocation.Name=this.Name;
this.SavedLocation.Description=this.Description;
this.SavedLocation.IconUrl=this.IconUrl;
this.Map.SavedLocationsInvalidate();
this.SavedLocation.Update();
this.SavedLocation.Marker.mods.name=this.Name;
this.SavedLocation.Marker.mods.description=this.Description;
this.SavedLocation.Marker.mods.icon=this.Icon;
};
ask.Map.SavedEditDlg.prototype.IconsShow=function(){if(document.getElementById(ask.Map.SavedEditDlg.prototype.DlgIdIconSelect)){this.DlgIdContextMenu=ask.Map.SavedEditDlg.prototype.DlgIdIconSelect;
this.Update();
this.Select(true);
}else{var A=this;
window.setTimeout(function(){A.IconsShow();
},1000);
}};
ask.Map.SavedEditDlg.prototype.IconsClose=function(){this.DlgIdContextMenu=ask.Map.SavedEditDlg.prototype.DlgIdContextMenu;
this.Update();
this.Select(true);
};
ask.Map.SavedEditDlg.prototype.GetIcon=function(A){return this.IconUrl;
};
ask.Map.IndependentPoi=function(F,B,G,E,A,D){ask.Map.MapObj.call(this,F,B,G,E,A,D);
var C=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
F.IndependentPoiList[F.IndependentPoiList.length]=this;
this.Name=G||"";
this.Review=E||"";
this.IconMap=A||"gr_m_dot.png";
this.IconList=D||"gr_cir_dot.gif";
if(F.isPrintMap){if(a10.browser.isIE6()){C.ask_VE_SetCustomIcon("<div  style='cursor:default;'><img src='http://sp.ask.com/sh/i/pixl.gif' style='position:relative;top:-26px;left:0px;cursor:default;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.IconMap+");' /></div>");
}else{if(a10.browser.isIE7()){C.ask_VE_SetCustomIcon("<div  style='cursor:default;'><div style='position:relative;top:-26px;left:0px;'><img src='"+this.IconMap+"' style='cursor:default' /></div></div>");
}else{C.ask_VE_SetCustomIcon("<div  style='cursor:-moz-grab;'><div style='position:relative;top:-26px;left:0px;'><img src='"+this.IconMap+"' style='cursor:-moz-grab'  /></div></div>");
}}}else{C.SetCustomIcon(this.IconMap);
}this.AttachShape(C);
};
ask.Map.MapObj.Inherit(ask.Map.IndependentPoi);
ask.Map.IndependentPoi.prototype.clazz="ask.Map.IndependentPoi";
ask.Map.IndependentPoi.prototype.DlgIdContextMenu="ask.Map.IndependentPoi.ContextMenu";
ask.Map.IndependentPoi.prototype.GetIcon=function(A){return this.IconUrl||(A?this.IconList:this.IconMap);
};
ask.Map.IndependentPoi.prototype.SetIcon=function(A,B){if(B){this.IconList=A;
}else{this.IconMap=A;
this.ID&&this.GetShape().SetCustomIcon(A);
}return this;
};
ask.Map.IndependentPoi.prototype.Remove=function(){this.Select(false);
this.OnRemoved();
ask.Map.ArrayRemove(this.Map.IndependentPoiList,this);
if(this.ID){this.Map.map.DeleteShape(this.GetShape());
this.Map.MapVeId2MapObj[this.ID]=0;
this.ID=0;
}return 0;
};
}
if(!ask.Map.UI){ask.Map.UI={AddLocation:function(A){var B=ask.Map.UI.GetMapByUI(A);
var C=new ask.Map.SavedLocation(B,B.ContextMenuObj);
C.Update();
C.Edit();
},ClearAll:function(A){ask.Map.UI.GetMapByUI(A).ClearAll().HidePopups();
},GetMapByUI:function(A){var B=A.getAttribute("MapId");
if(B){return ask.Map.ById(B)["ask.Map"];
}return ask.Map.UI.GetMapByUI(A.parentNode?A.parentNode:ask.Map.ById(A));
},GetObjByUI:function(B){var A=ask.Map.UI.GetObjUiRoot(B);
if(!A){return 0;
}var D=A.getAttribute("MapObjId");
var C=ask.Map.UI.GetMapByUI(A);
return C.MapVeId2MapObj[D];
},GetObjUiRoot:function(A){if(!A||!A.getAttribute){return 0;
}return A.getAttribute("MapObjId")?A:ask.Map.UI.GetObjUiRoot(A.parentNode?A.parentNode:ask.Map.ById(A));
},GetSubById:function(D,B){if(typeof (D)=="string"){D=document.getElementById(D);
}if(!D.getAttribute){return 0;
}if(D.getAttribute("id")==B||D.getAttribute("name")==B){return D;
}var A=0;
for(var C=0;
!A&&C<D.childNodes.length;
C++){A=ask.Map.UI.GetSubById(D.childNodes[C],B);
if(A){break;
}}return A;
},SetSubById:function(D,C,B,F){var E=ask.Map.UI.GetSubById(D,C);
if(E){var G=E.getAttribute("name")||E.getAttribute("id");
if(E.tagName=="A"){if(F){E.title+=F.Name;
}if(G=="Name"){E.innerHTML=B;
}else{if(!B){E.innerHTML="xxx";
}else{E.href=B;
}}}else{if(E.tagName=="IMG"){if(a10.browser.isIE6()){var A=E.parentNode;
A.removeChild(E);
E=E.cloneNode(true);
E.src="http://static-dev.en.dev.ask.com/sh/i/pixl.gif";
E.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B+"')";
A.appendChild(E);
}else{E.src=(F&&G=="Icon")?F.GetIcon(1):B;
}}else{if(E.tagName=="INPUT"){E.setAttribute("value",B);
}else{E.innerHTML=B||"";
}}}}return E;
},DistanceStr:function(A){A=1*A;
if(A<2){return A.toFixed(1)+" mile";
}return A.toFixed(1)+" miles";
},TimeStr:function(D){if(!D){return"";
}if(D>60){var E=D%60;
var C=D-E;
C=C/60;
if(C>60){var B=C%60;
var A=C-B;
A=A/60;
return(A+" hour(s), "+B+" minute(s), "+E+" second(s)");
}else{return(C+" minutes, "+E+" seconds");
}}else{return(D+" seconds");
}},POI:{Save:function(A){var B=ask.Map.UI.GetObjByUI(A);
if(B instanceof ask.Map.IndependentPoi){var C=B.Marker;
__l.UI.search.save(C);
}else{B.Map.SaveObj(B).Edit();
}},Remove:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.Remove();
B.Map.HidePopups();
},Email:function(C){var D=ask.Map.UI.GetObjByUI(C);
var B=D.Name?D.Name:"Found on Ask City";
var A=D.Description;
if(D.Phone){A+="\nphone: "+D.Phone;
}if(D.City){A+="\ncity: "+D.City;
}if(D.Street){A+="\nstreet: "+D.Street;
}location.href="mailto:?subject="+encodeURIComponent(B)+"&body="+encodeURIComponent(A);
}},Dlg:{Close:function(A){var B=ask.Map.UI.GetObjByUI(A);
if(B){B.Select(false);
B.Map.HidePopups();
}},Location:{Select:function(A){ask.Map.UI.GetObjByUI(A).Select(true);
return false;
}},Search:{Show:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.ShowSearchDlg=1;
B.UpdateContextMenu(A);
},Post:function(C){var A=ask.Map.UI.GetMapByUI(C);
var G=C.parentNode.parentNode.parentNode.parentNode;
var D=ask.Map.UI.GetSubById(G,"what").value;
var B=ask.Map.UI.GetSubById(G,"where").value;
var F=ask.Map.UI.GetObjByUI(C);
if(!F){if(B){var E=new ask.Map.Location(A,B);
ask.Map.SetEventHandler(E,"OnReady",function(J,H,I){ask.Map.UI.Dlg.Search.SearchNearby(E,D);
});
E.Retrieve();
return false;
}F=A.GetContextMenuObj();
F.Point=A.GetCenterPoint();
}ask.Map.UI.Dlg.Search.SearchNearby(F,D);
return false;
},SearchNearby:function(B,A){B.SearchParams=new ask.Map.Search(B.Map,B,A);
ask.Map.SetEventHandler(B.SearchParams,"OnReady",function(){var C=B.Map.SaveObj(B);
var D=B.SearchParams;
if(B instanceof ask.Map.ContextPoint){C.Name=""+D;
}B.SearchParams=0;
B.ShowSearchDlg=0;
C.SearchParams=D;
C.ShowSearchDlg=1;
C.Map.OnSearchReady(D);
C.Update();
C.Map.ZoomAll();
C.Select(true);
});
B.SearchParams.Query();
},SelectAltLocation:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.Pick();
}},Directions:{Show:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.ShowDirectionsDlg=1;
B.UpdateContextMenu(A);
},SelectStep:function(A){alert(A.innerHTML);
}},Saved:{Remove:function(A){ask.Map.UI.GetObjByUI(A).Remove();
},Close:function(A){ask.Map.UI.GetObjByUI(A).Select(false);
}},SavedEdit:{Show:function(A){var C=ask.Map.UI.GetObjByUI(A);
var B=C.Map.GetSavedEditDlg();
B.Init(C);
C.Select(false);
B.Show(false);
B.Select(true);
},Commit:function(A){var C=A.parentNode.parentNode.parentNode.parentNode.parentNode;
var B=ask.Map.UI.GetObjByUI(A);
B.Name=ask.Map.UI.GetSubById(C,"Name").value;
B.Description=ask.Map.UI.GetSubById(C,"Description").value;
B.Save();
__l.UI.saveMarkerMods(B.SavedLocation.Marker);
},ShowIcon:function(A){ask.Map.UI.GetObjByUI(A).IconsShow();
},CloseIcon:function(A){ask.Map.UI.GetObjByUI(A).IconsClose();
},SaveIcon:function(A){var C=ask.Map.UI.GetObjUiRoot(A);
var B=ask.Map.UI.GetObjByUI(A);
B.Icon=B.IconUrl=ask.Map.UI.GetSubById(C,"IconUrl").value;
B.Save();
ask.Map.UI.GetObjByUI(A).IconsClose();
},ChangeIcon:function(A,C){var B=ask.Map.UI.GetObjUiRoot(A);
ask.Map.UI.SetSubById(B,"IconUrl",C);
ask.Map.UI.SetSubById(B,"Icon",C);
},OnIconUrlChange:function(A){var C=ask.Map.UI.GetObjUiRoot(A);
var B=ask.Map.UI.GetSubById(C,"Icon");
B.src=A.value;
}}},Zoom:{In:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.Map.CenterAndZoom([B],B.Map.map.GetZoomLevel()+1);
},Out:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.Map.CenterAndZoom([B],B.Map.map.GetZoomLevel()-1);
},All:function(A){ask.Map.UI.GetMapByUI(A).ZoomAll();
},Street:function(A){var B=ask.Map.UI.GetObjByUI(A);
B.Map.CenterAndZoom([B],__l.ZoomLevel.Street);
}},Incident:{Zoom:function(B,A){var C=__l.UI.map||Page.Map;
C.Zoom2Incident(A,__l.ZoomLevel.Street);
},Center:function(B,A){var C=__l.UI.map||Page.Map;
C.Center2Incident(A);
}}};
}
if(ask.Map&&!ask.Map.Location){ask.Map.Location=function(B,A){ask.Map.MapObj.call(this,B);
this.Address2Locate=A;
};
ask.Map.MapObj.Inherit(ask.Map.Location);
ask.Map.Location.prototype.Address2Locate="";
ask.Map.Location.prototype.AltLocations=[];
ask.Map.Location.prototype.OnAltLocationsReady=function(C,B,A){C.Map.OnAltLocationsReady(C,B,A);
};
ask.Map.Location.prototype.OnError=function(C,A,B){C.Map.OnLocationError(C,A,B);
};
ask.Map.Location.prototype.OnReady=function(C,A,B){if(C.Map){C.Map.OnLocationReady(C,A,B);
}};
ask.Map.Location.prototype.Retrieve=function(){this.Remove();
this.Name=this.Address2Locate;
var A=this;
this.Map.map.Find(null,this.Address2Locate,VEFindType.Businesses,null,null,10,false,false,false,true,function(F,G,C,B,D){if(!C||!C.length){return A.OnError(A,A.Address2Locate,"Address not found or "+D);
}for(var E=0;
E<C.length;
E++){new ask.Map.AltLocation(A,C[E]);
}if(1==C.length){return A.Select(A.AltLocations[0]);
}A.OnAltLocationsReady(A,A.AltLocations,"Address has multiple matches");
});
};
ask.Map.Location.prototype.Select=function(B){var A=B&&B.Point;
ask.Map.ForEach(this.AltLocations,function(C){C.Remove();
});
if(!B){return this.OnError(this,this.Address2Locate,"No Selection");
}if(!(B instanceof ask.Map.AltLocation)){this.OnReady(B,this.Address2Locate,"Saved Location Selected");
return B;
}this.Name=B.Name+" ( "+this.Address2Locate+" )";
this.Point=B.Point;
B.Remove();
this.AttachShape();
this.Update();
this.OnReady(this,this.Address2Locate,"Location found");
};
ask.Map.Location.prototype.GetIcon=function(A){return"http://sp.ask.com/sh/i/local/crosshairs.png";
};
ask.Map.Location.prototype.Remove=function(A){ask.Map.ForEach(this.AltLocations,function(B){B.Remove();
});
ask.Map.MapObj.prototype.Remove.call(this);
};
ask.Map.AltLocation=function(C,A){this.SearchLocation=C;
ask.Map.MapObj.call(this,C.Map,ask.Map.Native2Point(A.LatLong),A.Name);
this.Name=A.Name;
var B=new VEShape(VEShapeType.Pushpin,ask.Map.Point2Native(this.Point));
this.AttachShape(B);
C.AltLocations[C.AltLocations.length]=this;
this.Update();
};
ask.Map.MapObj.Inherit(ask.Map.AltLocation);
ask.Map.AltLocation.prototype.DlgIdLongListItem="ask.Map.AltLocation.LongListItem";
ask.Map.AltLocation.prototype.DlgIdShortListItem="ask.Map.POI.ShortListItem";
ask.Map.AltLocation.prototype.DlgIdContextMenu="ask.Map.AltLocation.ContextMenu";
ask.Map.AltLocation.prototype.GetIcon=function(B){var A=ask.Map.ArrayFind(this.SearchLocation.AltLocations,this);
if(B){return A>26?"http://sp.ask.com/sh/i/local/gr_cir_dot.gif":"http://sp.ask.com/sh/i/local/gr_cir_"+String.fromCharCode(97+A)+".gif";
}return A>26?"http://sp.ask.com/sh/i/local/gr_m_dot.png":"http://sp.ask.com/sh/i/local/gr_m_"+String.fromCharCode(97+A)+".png";
};
ask.Map.AltLocation.prototype.Pick=function(){this.SearchLocation.Select(this);
};
ask.Map.AltLocation.prototype.Remove=function(){ask.Map.ArrayRemove(this.Map.AltLocations,this);
ask.Map.ArrayRemove(this.SearchLocation.AltLocations,this);
ask.Map.MapObj.prototype.Remove.call(this);
};
}
if(ask.Map&&!ask.Map.DirectionManage){String.prototype.format=function(){var A=arguments;
return this.replace(/\{(\d+)\}/g,function(B,C){return A[C];
});
};
ask.Map.DirectionManage=function(A){this.Map=A;
};
ask.Map.DirectionManage.Convert=function(A){var B=[];
for(var C=0;
C<A.length;
C++){var D=A[C];
B.push(ask.Map.Point2Native(D.Point));
}return B;
};
ask.Map.DirectionManage.prototype={Mode:VERouteMode.Driving,Unit:VERouteDistanceUnit.Mile,Locations:[],Items:[],directions:[],Route:0,Remove:function(){this.Map.map.DeleteRoute();
this.Items=[];
this.directions=[];
return this;
},DrawDirection:function(B,A){this.Items=A;
if(A){this.Locations=ask.Map.DirectionManage.Convert(A);
}if(B){this.Mode=B;
}this.GetDirection();
return this;
},GetDirection:function(){var B=this;
var A=new VERouteOptions;
A.DrawRoute=true;
A.RouteMode=this.Mode;
A.SetBestMapView=false;
A.DistanceUnit=this.Unit;
A.ShowDisambiguation=false;
A.ShowErrorMessages=false;
A.RouteCallback=function(D){function C(I){var H=true;
for(var G=0;
G<I.RouteLegs.length;
G++){var J=I.RouteLegs[G];
if(J.Distance.toFixed(1)>20){H=false;
break;
}}return H;
}if(D!=null&&B.Mode==VERouteMode.Walking&&!C(D)){B.Map.map.DeleteRoute();
D=null;
}if(D!=null&&D.RouteLegs.length>0){B.Route=D;
var F=B.InitShape();
if(!B.Map.isPrintMap){B.AdjustPresentation(F);
B.VeRoute2HTML(D);
B.OnReady(B,B.directions);
}}else{if(B.Items.length>2&&B.Locations.length>2){B.Locations.pop();
B.GetDirection();
}else{B.directions=[];
for(var E=0;
E<B.Items.length-1;
E++){B.NullRoute2HTML();
}B.OnReady(B,B.directions);
}}};
this.Map.map.GetDirections(this.Locations,A);
},NullRoute2HTML:function(){if(this.Mode==VERouteMode.Walking){this.directions.push("<div style='padding:10px;color:#cc0000'>We are unable to find walking directions for your locations.</div>");
}else{this.directions.push("<div style='padding:10px;color:#cc0000'>We were unable to find a route connecting your locations<div>");
}},OnReady:function(B,A){this.Map.OnDirectionsReady(B,A);
},VeRoute2HTML:function(G){this.directions=[];
var I=G.RouteLegs;
var J=null;
for(var D=0;
D<I.length;
D++){var B="";
var E="<tr><td colspan='3' style='color:#006600'><div>Distance:<b> {0} </b>Estimated time:<b> {1}</b></div></td></tr>";
var H=I[D];
E=E.format(H.Distance.toFixed(1),ask.Map.UI.TimeStr(H.Time));
for(var C=0;
C<H.Itinerary.Items.length;
C++){if(C==0){continue;
}var A="";
var F=H.Itinerary.Items[C];
if(C==H.Itinerary.Items.length-1){A="<tr style='cursor: pointer;'><td valign='top' align='left'><b>{0}.</b></td><td valign='top'>Arrive in {1}</td><td  valign='top' nowrap='nowrap' style='color:#CC0000;font-weight:bold'> END</td></tr>";
A=A.format(C,this.Items[D+1].address);
}else{A="<tr style='cursor: pointer;'><td valign='top' align='left'><b>{0}.</b></td><td valign='top'>{1}</td><td  valign='top' nowrap='nowrap'' style='color:#006600''>{2} mi</td></tr>";
A=A.format(C,F.Text,F.Distance.toFixed(1));
}B+=A;
}this.directions.push("<table cellspacing='0' cellpadding='3'>"+E+B+"</table>");
}for(;
D<this.Items.length-1;
D++){this.NullRoute2HTML();
}},DisplayStepIcon:function(D,C){var A=this.Route.RouteLegs[D].Itinerary.Items;
for(var B=0;
B<A.length;
B++){if(C!=-1&&C+1==B&&C+2!=A.length){A[B].Shape.Show();
}else{A[B].Shape.Hide();
}}},SelectStep:function(B,G){this.Map.HidePopups();
this.DisplayStepIcon(B,G);
var F=this.Map.map;
var A=F.GetMapView();
var C=this.Route.RouteLegs[B].Itinerary.Items[G+1];
var E=C.LatLong;
if(A.TopLeftLatLong.Longitude>E.Longitude||A.BottomRightLatLong.Longitude<E.Longitude||A.TopLeftLatLong.Latitude<E.Latitude||A.BottomRightLatLong.Latitude>E.Latitude){F.EndContinuousPan();
var D=function(H){setTimeout(function(){F.ShowInfoBox(C.Shape);
},10);
F.DetachEvent("onendpan",D);
};
F.AttachEvent("onendpan",D);
F.SetCenter(E);
}F.ShowInfoBox(C.Shape);
},InitShape:function(){var D=[];
for(var C=0;
C<this.Route.RouteLegs.length;
C++){var A=this.Route.RouteLegs[C].Itinerary.Items;
for(var B=0;
B<A.length;
B++){A[B].Shape.SetTitle("Step "+B);
A[B].Shape.ask_VE_SetCustomIcon("http://sp.ask.com/sh/i/maps2/icons/concentric_circles/small_circles.gif");
A[B].Shape.Hide();
D.push(A[B].LatLong);
}}return D;
},AdjustPresentation:function(A){this.Map.map.SetMapView(A);
}};
}
