
var activeEro=null;var mapChange=false;var mouseDown=false;var panEventFired=false;var customIconList=new Array("baby.gif","beer.gif","book.gif","buildings.gif","computer.gif","construction.gif","doctor.gif","event.gif","food.gif","golf.gif","gym.gif","hiker.gif","home.gif","mail.gif","martini.gif","party.gif","piano.gif","school.gif","service.gif","shopping.gif","ski.gif","suitcase.gif","wedding.gif","xcSki.gif");var EroSize={Small:0,Large:1};var zIndex=1001;function MouseHandler(e)
{if(e.eventName=="onclick"){if(isAddingNewLocation&&e.elementID==null){isAddingNewLocation=false;var pixel=new VEPixel(e.mapX,e.mapY);var point=mapManager.Map.PixelToLatLong(pixel);var shape=new VEShape(VEShapeType.Pushpin,point);shape.SetCustomIcon("<div class='pin_personal'></div>");mapManager.Map.AddShape(shape);var locationContent={title:"",description:"",latitude:point.Latitude,longitude:point.Longitude,lastUpdated:"",shapeID:shape.GetID(),iconURL:""};var des=SetMyLocationDescription("",locationContent);totalPersonalPins++;var key=InfoBoxManager.StoreDescription('Personal',totalPersonalPins,des);shape.SetDescription(key);activeEro=new PushpinERO(shape.GetID(),mapManager.Map);activeEro.Show();SetMapCursor("auto");return true;}
else if(e.elementID!=null&&mapManager.Map.GetShapeByID(e.elementID)!=null){if(activeEro!=null&&activeEro.ShapeId!=e.elementID){activeEro.Hide();}
else if(activeEro!=null&&e.elementID==activeEro.ShapeId){activeEro.ToggleShown();return true;}
var shape=mapManager.Map.GetShapeByID(e.elementID);if(shape.GetTitle()!='cluster'&&shape.GetTitle()!='poi'){var zoomLevel=mapManager.Map.GetZoomLevel();}
activeEro=new PushpinERO(e.elementID,mapManager.Map);activeEro.Show();return true;}}}
function Decluster(shape)
{var latLongs=shape.GetDescription().split('|');var points=new Array();for(var i=0;i<latLongs.length;i++)
{var point=latLongs[i].split(',');points.push(new VELatLong(point[0],point[1]));}
mapManager.Map.SetMapView(points);}
function GenerateLocationDescription(locationID,locationContent)
{var latlong=new VELatLong(locationContent.latitude,locationContent.longitude);var shapeID=locationContent.shapeID;var title=locationContent.title.replace("'","%27").replace("\"","%28");var des=locationContent.description.replace("'","%27").replace("\"","%28");var lastUpdated=locationContent.lastUpdated;var iconURL=locationContent.iconURL;if(!iconURL||iconURL=="")
{iconURL="Images/MyLocationPin.gif";}
var divHeight="170px";var topMargin="8px";var description='<div style="height: '+divHeight+';margin-top:'+topMargin+';">';description+='<div class="popupTop">';description+='<div class="popupTopLeft">';description+='<div style="font-weight: bold; font: 12px/14px Arial;">';description+='<strong style="width: 175px; overflow: auto">'+title.replace("%27","'").replace("%28","\"")+'</strong>';description+='<br />';description+='<span style="width: 175px; height: overflow: auto">'+des.replace("%27","'").replace("%28","\"")+'</span>';description+='</div>';description+='</div>';description+='<div class="popupTopRight" style="float: right">';description+='<div class="popupTopRightVisible" style="float: left; width: 140px">';description+='<div class="popupTopRightLeft" style="width: 130px">';if(locationID!=""&&!isCurrMapFriends)
{description+='<span class="deleteButton" onclick="PersistenceManager.DeleteMyLocation(\''+shapeID+'\', \''+locationID+'\')">'+resourceDelete+'</span> | ';description+='<span class="deleteButton" onclick="restorePushPin(\''+locationID+'\',\''+shapeID+'\',\''+title+'\',\''+des+'\','+locationContent.latitude+','+locationContent.longitude+',\''+lastUpdated+'\',\''+iconURL+'\')">'+editText+'</span><br/>';}
description+="<div class='lastUpdatedClass'>"+resourceLastUpdatedAt+" "+lastUpdated+"</div>";description+='</div>';description+='<div class="popupRightRight" style="float: right; position: absolute; top: 0px; left: 300px">';description+='<div style="display:block;margin-top:5px; margin-bottom:5px;"><img style="border:1px solid black;" src="'+iconURL+'"></img>';description+='<br/><div class="popupChangeIcon" onClick="ShowSelectCustomPins(\''+locationID+'\',\''+shapeID+'\',\''+title+'\',\''+des+'\','+locationContent.latitude+','+locationContent.longitude+',\''+lastUpdated+'\',\''+iconURL+'\')">'+resourceChange+'</div></div>';description+='</div>';description+='</div>';description+='<div id=\"AP_ACTION_'+locationID+'\" class="popupActionArea" style="height:50px;top:60px; margin-left: ';if(browserManager.BrowserName=="msie")
{description+='-140px">';}
else
{description+='0px">';}
description+='<div id=\"AP_EMPTY_'+locationID+'\" style="height:70px; width:100px;"></div>';description+='<div id=\"AP_TO_'+locationID+'\" style="height:70px;display:none;"><div class="popupHeader"><strong>'+resourceDD+':</strong></div>';description+=resourceToHere+':<br/>';description+='<input type="text" id="p_toAddress'+locationID+'" style="width:158px;" onkeydown="ExecuteFindFromInput(\'p_imgTo'+(locationID)+'\', event);"/><br/>';description+='<div><img id="p_imgTo'+locationID+'" src="'+images+'GetDD.gif" class="popupLink" style="left:100px; float: right;" onclick="PersistenceManager.GDDForPopup(\'TO\', \''+(locationID)+'\', '+locationContent.latitude+','+locationContent.longitude+');" /></div>';description+='</div>';description+='<div id=\"AP_FROM_'+locationID+'\" style="height:70px;display:none;"><div class="popupHeader"><strong>'+resourceDD+': </strong></div>';description+=resourceFromHere+':<br/>';description+='<input type="text" id="p_fromAddress'+locationID+'" style="width:158px;" onkeydown="ExecuteFindFromInput(\'p_imgFrom'+(locationID)+'\', event);"/><br/>';description+='<div><img id="p_imgFrom'+(locationID)+'" src="'+images+'GetDD.gif" class="popupLink" style="left:100px; float: right;" onclick="PersistenceManager.GDDForPopup(\'FROM\', \''+(locationID)+'\', '+locationContent.latitude+','+locationContent.longitude+');"/></div>';description+='</div>';description+='<div id=\"AP_NEAR_'+locationID+'\" style="height:70px;display:none;"><div class="popupHeader"><strong>'+resourceWhatsNearby+': </strong></div>';description+='<div class="popupSubheader">'+resourceSearchForCategory+':<br/></div>';description+='<input type="text" id="p_nearby'+locationID+'" style="width:158px;" onkeydown="ExecuteFindFromInput(\'p_imgNear'+(locationID)+'\', event);"/><br/>';description+='<div style="float:left; width:120px">'+resourceWhatsNearbyExample+'</div>';description+='<div><img id="p_imgNear'+(locationID)+'" src="'+images+'GetDD.gif" class="popupLink" style="margin-top:11px; left:100px; float: right;" onclick="PersistenceManager.GNBForPOIPopup(\''+(locationID)+'\', '+locationContent.latitude+','+locationContent.longitude+');"/></div>';description+='</div>';description+='<div id=\"AP_MAP_'+locationID+'\" style="height:70px;display:none;">';description+='<div id=\"AP_MAP_SAVE_'+locationID+'\" style="display:none;">';description+='<div style="float:left;">';description+='<div class="popupHeader" style="width:120px"><strong>'+resourceSaveToAMap+': </strong></div>';description+='<div style="width:150px">'+resourceSaveToAMapPrompt+'</div>';description+='</div>';description+='<div style="">';description+='<select id="mapSelect" style="width:158px;">';description+='</select><br/></div>';description+='<div><img id="p_imgAdd'+(locationID)+'" src="'+images+'doneButton.gif" class="popupLink" style="left:100px; float: right;" onclick="POIManager.SavePOIToCustomMap(\''+(locationID)+'\','+locationContent.latitude+','+locationContent.longitude+',\''+locationContent.title.replace("'","%27").replace("\"","%28")+'\',\''+locationContent.description.replace("'","%27").replace("\"","%28")+'\',\''+locationContent.iconURL+'\');"/></div>';description+='</div>';description+='<div id=\"AP_MAP_WARN_'+locationID+'\" style="float:left;display:none">';description+='<div class="popupHeader" style="width:110px"><strong>'+resourceSaveToAMap+': </strong></div><br />';description+='<div style="width:180px">'+resourceLoginNeeded+'</div>';description+='</div>';description+='</div>';description+='</div>';description+='</div>';description+='</div>';description+='<div class="popupBottom">';description+='<table>';description+='<tr><td><table><td><img src="images/drivingicon.gif" align="left" style="margin-right:3px;margin-left:3px"></img></td>';description+='<td>'+resourceDD.toUpperCase();description+='<div></div><span class="popupLink popupDrivingFunctionTo" ';description+='onclick="YPSearchManager.ShowActionDiv(\'AP_\', \''+(locationID)+'\', \'FROM\');"';description+='><img src="images/tohereicon.gif"><span>'+resourceToHere.toUpperCase()+'</span></img></span> | ';description+='<span class="popupLink popupDrivingFunctionFrom" ';description+='onclick="YPSearchManager.ShowActionDiv(\'AP_\', \''+(locationID)+'\', \'TO\');"';description+='><img src="images/fromhereicon.gif"><span>'+resourceFromHere.toUpperCase()+'</span></img></span>';description+='</td>';description+='<td style="width:60px;margin-right:3px;"><span class="popupLink" ';description+='onclick="YPSearchManager.ShowActionDiv(\'AP_\', \''+(locationID)+'\', \'NEAR\');"';description+='><img src="images/nearbyicon.gif" align="left" style="margin-right:3px"></img>';description+='<span class="popupLink">'+resourceWhatsNearby.toUpperCase()+'</div></span></td>';description+='<td style="margin-right:3px; width:70px;"><span class="popupLink" ';description+='onclick="YPSearchManager.ShowActionDiv(\'AP_\', \''+(locationID)+'\', \'MAP\');"';description+='><img src="images/savemapicon.gif" align="left" style="margin-right:3px;margin-left:3px"></img>';description+=resourceAddToAMap.toUpperCase()+'</span></td>';description+='</tr></table>';description+='</div>';description+='</div>';description='(S)'+description;return description;}
function SetMyLocationDescription(locationID,locationContent)
{var latlong=new VELatLong(locationContent.latitude,locationContent.longitude);var shapeID=locationContent.shapeID;var title=locationContent.title;var des=locationContent.description;var lastUpdated=locationContent.lastUpdated;var iconURL=locationContent.iconURL;var deleteText="";if(!iconURL||iconURL=="")
{iconURL="Images/MyLocationPin.gif";}
if(locationID!=""&&!isCurrMapFriends)
{deleteText+="<span id='deleteButton' class='deleteButton' onclick='PersistenceManager.DeleteMyLocation(\""+shapeID+"\", \""+locationID+"\")'> "+resourceDelete+"</span><br/>";}
var description="";var disableInput="";description+="<table class='myLocationTable' align='center' cell-padding='10px'>";description+="<tr>";if(isCurrMapFriends)
{disableInput="disabled=\"true\"";}
description+="<td style='font-weight: bold; font-size: 12px'>"+titleText+"<br/><input maxlength='255' class='myLocTitle' style='border: 1px solid black;width:285px;' "+disableInput+" id='myLocTitle_"+shapeID+"' type='text' value='"+title+"'";description+="></input></td>";title=title.replace("\"","%28");;des=des.replace("'","%27").replace("\"","%28");description+="<td rowspan='2' style='vertical-align: top'><img style='border: 1px solid black' src='"+iconURL+"'/>";description+="<br/><div class='popupChangeIcon' onClick='ShowSelectCustomPins(\""+locationID+"\",\""+shapeID+"\",\""+title+"\",\""+des+"\","+latlong.Latitude+","+latlong.Longitude+",\""+lastUpdated+"\",\""+iconURL+"\")'>"+resourceChange+"</div>";description+="<div class='deleteHolder' id='deleteHolder_"+shapeID+"'>"+deleteText+"</div></td></tr>";description+="<tr>";description+="<td style='font-weight: bold; font-size: 12px'>"+descriptionText+"<br/><textarea row='5' class='myLocDescription'"+disableInput+" id='myLocDescription_"+shapeID+"' type='text' >"+des+"</textarea></td>";description+="</tr>";if(!isCurrMapFriends)
{description+="<tr><td align='right'><img alt='Done' src='"+images+"doneButton.gif' style='align: right; cursor: hand' ";description+="onclick='PersistenceManager.SaveMapLocation(\""+locationID+"\",\""+currMapID+"\","+latlong.Latitude+","+latlong.Longitude+",\""+shapeID+"\", \""+iconURL+"\");' /></td></tr>";}
description+="</table>";return description;}
function ShowSelectCustomPins(locationID,shapeID,title,description,lat,lon,lastUpdated,iconURL)
{var pushpin=mapManager.Map.GetShapeByID(shapeID);var customPinContent="";customPinContent+="<div style='float: left; height: 164px; width: 60px; padding: 10px'>";customPinContent+="<img style='width: 45px; height: 45px; border:1px solid black;' id='customStarIcon' src='"+iconURL+"'/><br/>";customPinContent+="<div class='customizeButtonText' onclick='PersistenceManager.SaveIconSelection(\""+locationID+"\")'>"+addIconText+"</div></br>";customPinContent+="<div class='customizeButtonText' onclick='restorePushPin(\""+locationID+"\",\""+shapeID+"\",\""+title+"\",\""+description+"\","+lat+","+lon+",\""+lastUpdated+"\",\""+iconURL+"\")'>&lt;"+backText+"</div>";customPinContent+="</div>";customPinContent+="<div style='padding-top: 5px'>";var i=0;for(i=0;i<customIconList.length;i++)
{var iconURL="Images/CustomIcons/"+customIconList[i];customPinContent+="<img class='customIcon' src='"+iconURL+"' "+"onclick='SelectIcon(\""+iconURL+"\")'/>";}
customPinContent+="</div>";pushpin.SetDescription(customPinContent);HideCurrentEro(null);activeEro=new PushpinERO(shapeID,mapManager.Map);activeEro.Show();}
function restorePushPin(locationID,shapeID,title,des,lat,lon,lastUpdated,iconURL)
{HideCurrentEro(null);title=title.replace("%27","'").replace("%28","\"");des=des.replace("%27","'").replace("%28","\"");var shape=mapManager.Map.GetShapeByID(shapeID);var locationContent={title:title,description:des,latitude:lat,longitude:lon,lastUpdated:lastUpdated,shapeID:shapeID,iconURL:iconURL};var des=SetMyLocationDescription(locationID,locationContent);shape.SetDescription(des);activeEro=new PushpinERO(shape.GetID(),mapManager.Map);activeEro.Show();}
function SelectIcon(iconURL)
{var starIcon=document.getElementById("customStarIcon");starIcon.src=iconURL;}
function HideCurrentEro(e)
{if(activeEro!=null&&mapChange==false&&activeEro.shown)
{activeEro.Hide();}
return true;}
function ShowCurrentEro(e){if(activeEro!=null){activeEro.Show();setTimeout(function(){mapManager.Map.AttachEvent('onclick',MouseHandler);},300);}
return true;}
function OnMouseMove(e){if(mouseDown&&!panEventFired){panEventFired=true;OnStartPan_true();}}
function OnMouseDown(e){mouseDown=true;panEventFired=false;}
function OnMouseUp(e){mouseDown=false;}
function OnStartPan(e){if(!mouseDown){OnStartPan_true();}}
function OnStartPan_true(){if((activeEro!=null)&&activeEro.shown){mapManager.Map.AttachEvent('onchangeview',ShowCurrentEro);HideCurrentEro(null);}else if(activeEro!=null){mapManager.Map.DetachEvent('onchangeview',ShowCurrentEro);}}
function PushpinERO(shapeId,mapInstance){if(shapeId==null||mapInstance==null)
{return;}
this.BaseMap=mapInstance;this.ShapeId=shapeId;this.Shape=mapInstance.GetShapeByID(this.ShapeId);this.Type=ClientCache.Retrieve('pane_'+paneNumber+'_type');if(this.Shape.GetTitle()=='cluster'){this.Type='poiCluster';}
else if(this.Shape.GetTitle()=='poi'){this.Type='poi';}
else if(this.Type=='dd'){var turnpointIds=ClientCache.Retrieve('pane_'+paneNumber+'_turnpointIds').split('|');this.prevShapeId=this.Shape.GetID();this.nextShapeId=this.Shape.GetID();for(var i=0;i<turnpointIds.length;i++){if(turnpointIds[i]==this.Shape.GetID()){if(i>0)
this.prevShapeId=turnpointIds[i-1];if(i<(turnpointIds.length-1))
this.nextShapeId=turnpointIds[i+1];}}}
this.Elements=new Array();this.Size=EroSize.Small;this.Show=function(){if(mapChange){return;}
var pixel=mapInstance.LatLongToPixel(this.Shape.GetIconAnchor());if((pixel.x<0)||(pixel.y<0)||(pixel.x>(mapManager.Map.GetWidth()))||(pixel.y>(mapManager.Map.GetHeight()))){return;}
if(this.shown){return;}
if(this.Type=='poiCluster'){pixel.x+=23;pixel.y+=18;}
else if(this.Type=='poi'){pixel.x+=10;}
centerX=(mapManager.Map.GetWidth()/2);centerY=(mapManager.Map.GetHeight()/2);if((pixel.x<centerX)&&(pixel.y<centerY))
{topLeftX=Math.round(pixel.x)+28;topLeftY=Math.round(pixel.y)+150;drawLeft=false;drawAbove=false;}
else if((pixel.x>=centerX)&&(pixel.y<=centerY))
{topLeftX=Math.round(pixel.x)-415;topLeftY=Math.round(pixel.y)+150;drawLeft=true;drawAbove=false;}
else if((pixel.x<centerX)&&(pixel.y>=centerY))
{topLeftX=Math.round(pixel.x)+28;topLeftY=Math.round(pixel.y)-73;drawLeft=false;drawAbove=true;}
else if((pixel.x>=centerX)&&(pixel.y>=centerY))
{topLeftX=Math.round(pixel.x)-411;topLeftY=Math.round(pixel.y)-73;drawLeft=true;drawAbove=true;}
var contentTop=0;var footerTop=0;var description=this.Shape.GetDescription();if(InfoBoxManager.IsFormattedKey(description)){description=InfoBoxManager.GetDescription(description);}
var title=this.Shape.GetTitle();if(description.substring(0,3)=='(S)'){this.Size=EroSize.Small;description=description.substring(3,description.length);footerTop=resources.EroFooterTopLarge;}
else if(description.substring(0,3)=='(B)'){this.Size=EroSize.Large;description=description.substring(3,description.length);footerTop=resources.EroFooterTopSmall;}
else if(description.substring(0,5)=='(DDL)'){this.Type='ddl';description=description.substring(5,description.length);description=description.replace(/mapManager.ShowInfoBoxp/g,"ShowNewEro(\""+this.prevShapeId+"\")");}
else if(description.substring(0,5)=='(DDF)'){this.Type='ddf';description=description.substring(5,description.length);description=description.replace(/mapManager.ShowInfoBoxn/g,"ShowNewEro(\""+this.nextShapeId+"\")");}
else if(description.substring(0,5)=='(DDI)'){this.Type='ddi';description=description.substring(5,description.length);description=description.replace(/mapManager.ShowInfoBoxp/g,"ShowNewEro(\""+this.prevShapeId+"\")");description=description.replace(/mapManager.ShowInfoBoxn/g,"ShowNewEro(\""+this.nextShapeId+"\")");}
if(this.Size==EroSize.Small){contentTop=-137;}
else if(this.Size==EroSize.Large){if(drawAbove==true)
contentTop=-255;else
contentTop=-137;}
if(this.Type=='ddf')
contentTop+=113;else if(this.Type=='ddl')
contentTop+=13;var header=document.createElement("div");header.id=shapeId+"h";header.style.top=topLeftY-18+contentTop+"px";header.style.left=topLeftX+"px";header.style.width="368px";header.style.height="19px";header.style.backgroundImage="url(Images/PopupHeaderSmall.gif)";header.innerHTML="<div class='EroHeader handicon' onclick='activeEro.Hide();'><span class='CloseText'>"+resourceClose+"&nbsp;</span><img class='CloseImage'  src='Images/CloseIcon.gif' /></div>";this.Elements.push(header);var container=document.createElement("div");container.id=shapeId+"c";container.style.top=topLeftY+contentTop+"px";container.style.left=topLeftX+"px";container.style.width="364px";if(this.Type=='ddf'||this.Type=='ddl'){container.style.height="176px";container.style.backgroundColor="#66676a";}
else if(this.Type=='ddi'){container.style.height="304px";container.style.backgroundColor="#66676a";}
else{container.style.height=this.Size==EroSize.Small?"200px":"318px";container.style.backgroundColor="White";}
if(title!=null&&this.Type!='poiCluster'&&this.Type!='poi'){var titleDiv=document.createElement("div");titleDiv.id=shapeId+"t";titleDiv.innerHTML=title;container.appendChild(titleDiv);}
if(description!=null){var descriptionDiv=document.createElement("div");descriptionDiv.className='InfoBox';descriptionDiv.id=shapeId+"d";container.appendChild(descriptionDiv);descriptionDiv.innerHTML=description;}
container.style.borderLeft="solid 1px #999999";container.style.borderRight="solid 1px #999999";var beak=document.createElement("img");beak.id=shapeId+"b";if(drawLeft==false&&drawAbove==false)
{beak.style.top=Math.round(pixel.y)+3+"px";beak.style.left=Math.round(pixel.x)-1+"px";beak.src="Images/PopupBeak.gif";}
else if(drawLeft==true&&drawAbove==false)
{beak.style.top=Math.round(pixel.y)+3+"px";beak.style.left=Math.round(pixel.x)-49+"px";beak.src="Images/PopupBeak2.gif";}
else if(drawLeft==false&&drawAbove==true)
{beak.style.top=Math.round(pixel.y)-40+"px";beak.style.left=Math.round(pixel.x)-1+"px";beak.src="Images/PopupBeak4.gif";}
else if(drawLeft==true&&drawAbove==true)
{beak.style.top=Math.round(pixel.y)-40+"px";beak.style.left=Math.round(pixel.x)-45+"px";beak.src="Images/PopupBeak3.gif";}
this.Elements.push(beak);if(this.Type=='ddf'||this.Type=='ddi'||this.Type=='ddl'){var footer=document.createElement("div");footer.id=shapeId+"f";footer.innerHTML="<table><tr style='height:5px;'><td style='width:5px; background:url(\"Images/GDD_InfoBox/lowerLeftCorner.png\");'></td><td style='width:354px; background:#66676a;'></td><td style='width:5px; background: url(\"Images/GDD_InfoBox/lowerRightCorner.png\") no-repeat 0% 100%;'></td></tr></table>";container.appendChild(footer);}
else{var footer=document.createElement("img");footer.id=shapeId+"f";footer.src="Images/PopupFooter.gif";if(this.Size==EroSize.Large)
{if(drawAbove==true)
{footer.style.top=topLeftY+92+footerTop+(0-((this.Type=='poiCluster'||this.Type=='poi')?0:30))+"px";}
else
{footer.style.top=topLeftY+210+footerTop+(0-((this.Type=='poiCluster'||this.Type=='poi')?0:30))+"px";}}
else
{footer.style.top=topLeftY+63+footerTop+(0-((this.Type=='poiCluster'||this.Type=='poi')?0:30))+"px";}
footer.style.left=topLeftX+"px";this.Elements.push(footer);}
this.Elements.push(container);for(var i=0;i<this.Elements.length;i++){mapInstance.AddControl(this.Elements[i]);}
this.shown=true;this.Shape.SetZIndex(zIndex);zIndex++;}
this.Hide=function()
{try
{for(var i=0;i<this.Elements.length;i++)
{mapInstance.DeleteControl(document.getElementById(this.Elements[i].id));}}
catch(e)
{}
this.Elements=new Array();this.shown=false;}
this.ToggleShown=function(){if(this.shown)
this.Hide();else
this.Show();}
this.shown=false;this.IsOutside=function(x,y)
{var result=false;var center=mapInstance.LatLongToPixel(this.Shape.GetIconAnchor());var height=0;if(this.Size==EroSize.Small)
{height=138;}
else if(this.Size==EroSize.Large)
{height=334;}
if(x<center.x-30||(x<center.x+15&&y<center.y-30)||x>center.x+368||y<center.y-height||y>center.y+2)
{result=true;}
return result;}}
function ShowNewEro(shapeID){activeEro.Hide();activeEro=null;var center=mapManager.Map.GetShapeByID(shapeID).GetPoints()[0];POIManager.HidePOIs();POI_OnZoomIn=function(e){POIManager.RefreshPOIs();mapManager.Map.DetachEvent("onchangeview",POI_OnZoomIn);};mapManager.Map.AttachEvent("onchangeview",POI_OnZoomIn);mapManager.Map.SetCenterAndZoom(center,15);}
var POI_OnZoomIn=function(e){};