///////////// SA Setup ///////////////////////////////////////////
//Iaan & Gawie
var API_HOST_URL = "http://maps.afrigis.co.za/msjsapi121/";
var MS_GATEWAY = "http://maps.afrigis.co.za/mapserver/GetTiledMap2AG.aspx";
var MARBIL_GATEWAY = "http://maps.afrigis.co.za/msjsapi121/MarbilGateway.aspx";
var DD_GATEWAY = "http://maps.afrigis.co.za/services/MapServerUtils/DDHTMLGateway.aspx";
var MAP_LAYERS = "AG_PROVINCES,AG_SUBURBS,AG_TOWNS_CENTROID,AG_STREETS";
var MAP_STYLES = "Mapstyle3,Dineke1,Point_SCHEME,Mapstyle3";
var INIT_BB = "15.46345732,-29.8445173,34.08369661,-25.80449264";
var ROUTE_LAYER = "AG_STREETS";
var ROUTE_PARAM = "TRAVELTIME";


var AvailableLayers = "[ ";
AvailableLayers += "{";
AvailableLayers += "  'LayerName': 'AG_PROVINCES',";
AvailableLayers += "  'LayerStyles': 'Dineke1,Mapstyle1,Mapstyle2,Mapstyle3,Mapstyle4,OverviewScheme', ";
AvailableLayers += "  'Routable': false, ";
AvailableLayers += "  'RouteParameters': null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_SADECS',";
AvailableLayers += "       'LayerStyles':'Mapstyle1,Mapstyle2,Polygon_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_TOWNS',";
AvailableLayers += "       'LayerStyles':'Mapstyle1,Mapstyle2,Mapstyle3,Polygon_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_SUBURBS',";
AvailableLayers += "       'LayerStyles':'Dineke1,Mapstyle1,Mapstyle2,Mapstyle3,Mapstyle4,OverviewScheme,SuburbsDrawingStyle',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_CAD_ERVEN',";
AvailableLayers += "       'LayerStyles':'Polygon_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_NAD',";
AvailableLayers += "       'LayerStyles':'Point_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName':'AG_STREETS',";
AvailableLayers += "       'LayerStyles':'AfriGISBlueStyle,Mapstyle1,Mapstyle2,Mapstyle3,Mapstyle4,Mapstyle5,OverviewScheme', ";
AvailableLayers += "       'Routable':true, ";
AvailableLayers += "       'RouteParameters':'TravelTime'},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_TOWNS_CENTROID',";
AvailableLayers += "       'LayerStyles':'Point_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_STREET_VIEW_COVERAGE',";
AvailableLayers += "       'LayerStyles':'Polyline_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_STREET_VIEW',";
AvailableLayers += "       'LayerStyles':'Point_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'AG_GRID_30SEC_GT',";
AvailableLayers += "       'LayerStyles':'Polygon_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'RRA_sales',";
AvailableLayers += "       'LayerStyles':'Polygon_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'Bricks',";
AvailableLayers += "       'LayerStyles':'Polygon_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "},";
AvailableLayers += "{";
AvailableLayers += "       'LayerName': 'C96080006_1',";
AvailableLayers += "       'LayerStyles':'Point_SCHEME',";
AvailableLayers += "       'Routable':false,";
AvailableLayers += "       'RouteParameters':null";
AvailableLayers += "}";
AvailableLayers += "]";
AvailableLayers = eval( "(" + AvailableLayers + ")" );

var IMAGERY_BASE_URLS="0-4|http://mt1.afrigis.co.za/getTile?dataset=ag.ibase.256;5-7|http://mt1.afrigis.co.za/getTile?dataset=ag.ibase.256;8-12|http://mt1.afrigis.co.za/getTile?dataset=ag.ibase.256";var DEFAULT_DD_CSS_FILE_NAME="css/DefaultDDStyle.css";var INVALID_IMG_PATH="Images/hfhfhfhf.jpg";var JSON_DrivingDirection_URL="http://maps.afrigis.co.za/services/MapServerUtils/DrivingDirectionJSON.aspx";var JSON_AddressSearch_Url="http://maps.afrigis.co.za/services/MapServerUtils/Search.aspx";var AGE=30;var AGlp=6;var MAIN_MAP=0;var OVERVIEW_MAP=1;var AGcw=new Array("ZOOM","RIGHTBUTTONCLICK","LEFTBUTTONCLICK","DOUBLECLICK","SHOWROUTING","CLEARROUTING","RESETBBOX","PAN");var NO_ROW=3;var NO_COL=3;var MAX_TILE=100;var AGmi=0;var DEFAULT_ZOOMBAR=1;var MAX_SAT_TILE=50;var OM_MM_SCALE_DIFF=3;var OM_WIDTH=128;var OM_HEIGHT=128;var OM_MAXIMIZE_IMG_PATH=API_HOST_URL+"Images/OMMaximizeButton.JPG";var OM_MINIMIZE_IMG_PATH=API_HOST_URL+"Images/OMMinimizeButton.JPG";var OM_MAX_MIN_WIDTH=17;var OM_MAX_MIN_HEIGHT=17;var AGL=160;var AGI=110;var AGJ=1;var AGK=true;var iIdCount=0;var API_KEY="242151462249623615408920696148201192147158100434233";var AGO=new Array();var AGM=new Array();function RequestParameters(mapCanvasDivID){this.AGgr=mapCanvasDivID;this.SetFeatureSelection=function(strParam){var bRedraw=AGM[this.AGgr].AGfQ.AGjq.AddFeatureSelectionParam(strParam);if(bRedraw)
AGM[this.AGgr].AGfQ.AGjn();}
this.ClearFeatureSelection=function(){var bRedraw=AGM[this.AGgr].AGfQ.AGjq.ClearFeatureSelectionParam();if(bRedraw)
AGM[this.AGgr].AGfQ.AGjn();}}
function AGMap(AGgH,uid,AGmd,AGbh,AGjb,AGgW){if(typeof uid!="string")
uid=API_KEY;this.AGgr=AGgH.id;AGgH.style.overflow="hidden";this.AGgv=uid;if(typeof AGmd=="NaN"||typeof AGmd=="undefined"||Math.floor(AGmd)!=AGmd||AGmd<1||AGmd>AGlp)
AGmd=DEFAULT_ZOOMBAR;var AGji=document.getElementById(this.AGgr);if(AGji!=null)
AGji.innerHTML="";else
return;if(AGgW!=OVERVIEW_MAP)
AGgW=MAIN_MAP;AGM[this.AGgr]=new AGMapGlobals(API_HOST_URL,AGgH,this.AGgr,AGgW,AGmd);AGM[this.AGgr].AGmi=AGmd;AGM[this.AGgr].AGfd=API_HOST_URL;if(typeof AGbh=="boolean")
AGM[this.AGgr].AGeX=AGbh;else
AGM[this.AGgr].AGeX=true;AGM[this.AGgr].AGfR=new MapCanvas(AGgH,this.AGgr,AGmd);AGM[this.AGgr].AGf6=new Point(0,0);this.AGgp=MS_GATEWAY;this.AGfs=NO_ROW;this.AGfr=NO_COL;this.AGfo=MAX_TILE;this.AGgk=MAP_LAYERS;this.AGgl=MAP_STYLES;this.AGgf=INIT_BB;this.AGgt=ROUTE_LAYER;this.AGgu=ROUTE_PARAM;this.AGbc=false;this.RequestParameters=new RequestParameters(this.AGgr);this.AGd7=function(){AGM[this.AGgr].AGeV=true;this.AGd9(this.AGgp,this.AGfs,this.AGfr,this.AGfo,this.AGgk,this.AGgl,this.AGgf,this.AGgt,this.AGgu);this.AGbc=true;}
this.GetCapabilities=function(){return AGO;}
this.SetLayers=function(AGku){var AGR=AGku.split(";");var AGdA=AGR.length;if(AGdA<1)
return false;var AGdi="";var AGdj="";for(var p=0;p<AGdA;p++){var AGS=AGR[p].split("|");if(AGS.length!=2)
return false;var AG9=false;for(var i=0;i<AvailableLayers.length;i++){if(AvailableLayers[i].LayerName==AGS[0]){var AGeB=AvailableLayers[i].LayerStyles.split(",");for(var j=0;j<AGeB.length;j++){if(AGeB[j]==AGS[1]){AG9=true;break;}}
break;}}
if(AG9==false){return false;}
AGdi=AGdi+AGS[0]+",";AGdj=AGdj+AGS[1]+",";}
if(AGdi.length>0) 
 {
AGdi=AGdi.substring(0,AGdi.length-1);AGdj=AGdj.substring(0,AGdj.length-1);var AGh8=AGM[this.AGgr].AGfQ.AGjq.AGgQ;AGh8.layers=AGdi;AGh8.styles=AGdj;AGM[this.AGgr].SetRoutingLayerConsistency(AGh8.layers,AGh8.AGjw);return true;}
else
return false;}
this.GetLayers=function(){var AGT=AGM[this.AGgr].AGfQ.AGjq.AGgQ.layers.split(",");var AGX=AGM[this.AGgr].AGfQ.AGjq.AGgQ.styles.split(",");if(AGT.length!=AGX.length)
return "";var AGku="";for(var i=0;i<AGT.length;i++) 
AGku+=AGT[i]+"|"+AGX[i]+";";if(AGku.length>0) 
AGku=AGku.substring(0,AGku.length-1);return AGku;}
this.SetRouteLayer=function(RouteableLayerName,RouteParameter){if(typeof RouteableLayerName!="string"||typeof RouteParameter!="string"){throw "The method SetRouteLayer only accepts RouteableLayerName and RouteParameter of type string";return false;}
var AGeI=RouteParameter.toLowerCase();for(var i=0;i<AvailableLayers.length;i++){if(AvailableLayers[i].LayerName==RouteableLayerName){if(AvailableLayers[i].Routable=true){if(AvailableLayers[i].RouteParameters!=null){var arrRouteParam=AvailableLayers[i].RouteParameters.split(",");for(var j=0;j<arrRouteParam.length;j++){if(arrRouteParam[j].toLowerCase()==AGeI){var AGh8=AGM[this.AGgr].AGfQ.AGjq.AGgQ;AGh8.AGjw=RouteableLayerName;AGh8.AGjx=RouteParameter;AGM[this.AGgr].SetRoutingLayerConsistency(AGh8.layers,AGh8.AGjw);return true;}} 
return false;}}
else
return false;}}
return false;}
this.GetRouteLayer=function(){var AGh8=AGM[this.AGgr].AGfQ.AGjq.AGgQ;return AGh8.AGjw+","+AGh8.AGjx;}
this.AGd6=function(AGkB,AGeb,AGea,AGdM,AGky,AGkz,AGkK,AGkL){AGM[this.AGgr].AGfE=AGeb;AGM[this.AGgr].AGfC=AGea;AGM[this.AGgr].AGfo=AGdM;AGdF=document.getElementById(AGM[this.AGgr].AGfR.AGgV);AGdF.style.position='absolute';AGdF.innerHTML="";var AGZ=(BrowserDetect.browser=="Explorer"&&BrowserDetect.version<7&&BrowserDetect.version>=5.5);for (var AGdS=0;AGdS<AGM[this.AGgr].AGfo;AGdS++){AGdQ=AGM[this.AGgr].AGfR.AGk4+AGdS;if(AGZ){var AGci=AGM[this.AGgr].AGfR.AGk3+AGdS;AGdF.innerHTML+='<img id="'+AGdQ+'" alt="" galleryimg="no" style="visibility:hidden;position:absolute;left:-10000px;top:-10000px;z-AGd4:4;" onload="AGM[\''+this.AGgr+'\'].SetPos(\''+AGdS+'\')" AGjf="-10000" AGjg="-10000" zoom="0"/>';AGdF.innerHTML+='<div id="'+AGci+'" alt="" galleryimg="no" style="position:absolute;left:-10000px;top:-10000px;z-AGd4:4;"/>';}
else
AGdF.innerHTML+='<img id="'+AGdQ+'" alt="" galleryimg="no" style="position:absolute;left:-10000px;top:-10000px;z-AGd4:4;" onload="AGM[\''+this.AGgr+'\'].SetPos(\''+AGdS+'\')" AGjf="-10000" AGjg="-10000" zoom="0"/>';}
var AGjD=document.getElementById(AGM[this.AGgr].AGfR.AGjB);AGjD.innerHTML="";for (var AGdS=0;AGdS<AGM[this.AGgr].AGfn;AGdS++){var AGjE=AGM[this.AGgr].AGfR.AGjC+AGdS;AGjD.innerHTML+='<img id="'+AGjE+'" src="'+API_HOST_URL+'Images/transparentpixel.gif" alt="" galleryimg="no" style="position:absolute;z-AGd4:2;left:-1000000px;top:-1000000px;" level="-1" xVal="-1" yVal="-1" AGjf="-1000000" AGjg="-1000000" zoom="0" onload="AGM[\''+this.AGgr+'\'].AGjG.SetPos(\''+AGdS+'\')"/>';}}
this.AGd9=function(AGkB,AGeb,AGea,AGdM,AGky,AGkz,strInitialBoundingBox,AGkK,AGkL){this.AGd6(AGkB,AGeb,AGea,AGdM,AGky,AGkz,AGkK,AGkL);this.AGd8(AGky,AGkz,strInitialBoundingBox,AGkK,AGkL,this.AGgv,this.AGgr);AGM[this.AGgr].AGfS=new AGhG(AGM[this.AGgr].AGfR.AGhF);AGM[this.AGgr].AGfS.RemoveAllObjectsFromMap();AGM[this.AGgr].AGfR.AGjR(AGM[this.AGgr].AGfE,AGM[this.AGgr].AGfC,AGM[this.AGgr].AGfG,AGM[this.AGgr].AGfD);AGM[this.AGgr].AGz();}
this.AGd8=function (layers,styles,bbox,AGjw,AGjx,userId,AGiT){AGM[this.AGgr].AGfR.AGjs();AGM[this.AGgr].AGfE=parseInt(AGM[this.AGgr].AGfE,10);AGM[this.AGgr].AGfC=parseInt(AGM[this.AGgr].AGfC,10);var AGgG=parseInt((AGM[this.AGgr].AGfR.AGgJ.offsetWidth),10);var AGgE=parseInt((AGM[this.AGgr].AGfR.AGgJ.offsetHeight),10);AGgG=(AGgG/AGM[this.AGgr].AGfC)*(AGM[this.AGgr].AGfC+1);AGgE=(AGgE/AGM[this.AGgr].AGfE)*(AGM[this.AGgr].AGfE+1);AGM[this.AGgr].AGfC=parseInt(AGM[this.AGgr].AGfC,10)+parseInt(1,10);AGM[this.AGgr].AGfE=parseInt(AGM[this.AGgr].AGfE,10)+parseInt(1,10);AGM[this.AGgr].AGfD=Math.round(AGgE/AGM[this.AGgr].AGfE);AGM[this.AGgr].AGfG=Math.round(AGgG/AGM[this.AGgr].AGfC);var FORMAT="image/png";var VERSION="1.0.0";var CRS="EPSG:4326";var AGcx="INIMAGE";var AGgP=new MapInfo( bbox,Math.round(AGM[this.AGgr].AGfG*AGM[this.AGgr].AGfC),Math.round(AGM[this.AGgr].AGfD*AGM[this.AGgr].AGfE),FORMAT,layers,styles,AGcx,AGjw,AGjx );var RM=new AGjq(this.AGgp,VERSION,CRS,AGgP,userId,AGiT);AGM[this.AGgr].AGfQ=new MainMap(AGM[this.AGgr].AGfR.AGk4,RM);}
this.SetMap=function (AG5){if(!this.AGbc)
alert("First you must have to initialize the map by calling AGd7() function");AGM[this.AGgr].AGfQ.ZoomToBoundingBox(AG5,AGM[this.AGgr].AGfl);}
this.AddObject=function(AGdt,latitude,longitude,AGds,AGlO,className){if(typeof latitude!="number"||typeof longitude!="number"){throw "The method AddObject only accepts latitude and longitude of type number";return;}
if(typeof className=="undefined")
className="";if(typeof AGds!="number")
AGds=0;if(typeof AGlO!="number")
AGlO=0;AGdt.className=className;var layer=document.getElementById(AGM[this.AGgr].AGfR.AGhF);AGM[this.AGgr].AGfS.AGD(AGdt,latitude,longitude,AGds,AGlO,layer);}
this.RemoveObjectByClassName=function(className){if(typeof className=="undefined")
return;AGM[this.AGgr].AGfS.RemoveAllObjectsFromMapByClassName(className);}
this.Pan=function(x,y){if(typeof x!="number"||typeof y!="number"){throw "The method Pan only accepts x and y of type number";return;}
AGM[this.AGgr].AGfQ.AGiM(x,y,AGM[this.AGgr].AGfl);}
this.CentreAndScale=function(AGg7,AGg8,AGmo){if(typeof AGg7!="number"||typeof AGg8!="number"){throw "The method CentreAndScale only accepts coordinates of type number";return;}
if(typeof AGmo!="number") {throw "The method CentreAndScale only accepts Zoom Level of type number";return;}
if(!this.AGbc)
alert("First you must have to initialize the map by calling AGd7() function");if( AGM[this.AGgr].AGf7.x==0&&AGM[this.AGgr].AGf7.y==0 ){this.SetInitialMapLocation(AGg7,AGg8,AGmo);}
if(AGmo>=AGM[this.AGgr].AGeR.length)
AGmo=AGM[this.AGgr].AGeR.length-1;else if(AGmo<0)
AGmo=0;try{AGmo=parseInt(AGmo,10);}
catch(err){AGmo=0;}
var AGmv=AGM[this.AGgr].AGeR[AGmo];AGM[this.AGgr].AGfh=AGmo;AGM[this.AGgr].AGfQ.AGmA(AGg8,AGg7,AGmv,AGM[this.AGgr].AGfl);}
this.GetLatLongFromPixel=function(x,y){if(typeof x!="number"||typeof y!="number"){throw "The method GetLatLongFromPixel only accepts x and y of type number";return;} 
var pt=AGM[this.AGgr].AGdd(new Point(x,y));return {Long:pt.x,Lat:pt.y};}
this.AddPoint=function( AGdU,AGdR,lat,lng,AGl5,AGl6,header,AGb8,type,className,contentWidth,contentHeight,bShadow,opacity){if(typeof lat!="number"||typeof lng!="number"){throw "The method AddPoint only accepts coordinates of type number";return false;} 
if(typeof AGl5!="number"||typeof AGl6!="number"){throw "The method AddPoint only accepts offsets of type number";return false;}
if(typeof className=="undefined")
className="";if(typeof type=="undefined")
type="DEFAULT";type=type.toUpperCase();if(typeof contentWidth!="number")
contentWidth=AGL;if(typeof contentHeight!="number")
contentHeight=AGI;if(typeof opacity!="number"||opacity<0||opacity>1)
opacity=AGJ;if(typeof bShadow!="boolean")
bShadow=AGK;var AGdT=document.createElement("img");AGdT.src=AGdU;AGdT.id=AGdR;AGdT.AGiW=this.AGgr;AGdT.className=className;AGdT.AGl5=AGl5;AGdT.AGl6=AGl6;var layer=null;if(type=="DEFAULT"){layer=document.getElementById(AGM[this.AGgr].AGfR.AGhF);AGM[this.AGgr].AGfS.AGD(AGdT,lat,lng,AGl5,AGl6,layer);AGdT.onclick=function(ev){var AGiW=this.AGiW;AGM[AGiW].AddUserPointWithText(lat,lng,header,AGb8,AGiW,this.id,layer,contentWidth,contentHeight,bShadow,opacity);return false;}}	
else 
 {
var pt=AGM[this.AGgr].AGfS.GetXYFromCoord(lat,lng);layer=document.getElementById(AGM[this.AGgr].AGfR.STATIONARY_DIV_ID);AGM[this.AGgr].AGfS.AddObjectToMapByPixelPosition(AGdT,pt.y,pt.x,AGl5,AGl6,layer);AGdT.onclick=function(ev){var AGiW=this.AGiW;var stationaryDiv=document.getElementById(AGM[AGiW].AGfR.STATIONARY_DIV_ID);var x=parseInt(stationaryDiv.style.left)+parseInt(AGdT.style.left)-parseInt(AGdT.AGl5);var y=parseInt(stationaryDiv.style.top)+parseInt(AGdT.style.top)-parseInt(AGdT.AGl6);var p=new Point(x,y);var curCoord=AGM[AGiW].AGdd(p);var lat=curCoord.y;var lng=curCoord.x;AGM[AGiW].AddUserPointWithText(lat,lng,header,AGb8,AGiW,this.id,layer,contentWidth,contentHeight,bShadow,opacity);return false;}}}
this.AddDraggableIcon=function(icon,lat,lng,xoffset,yoffset,className,description,contentWidth,contentHeight,bShadow,opacity){if(typeof icon!="object"||typeof icon.AGdP!="object")
throw "Invalid Icon in the method AddDraggableIcon";if(typeof lat!="number"||typeof lng!="number"){throw "The method AddDraggableIcon only accepts coordinates of type number";return false;} 
if(typeof xoffset!="number"||typeof yoffset!="number"){throw "The method AddDraggableIcon only accepts offsets of type number";return false;}
if(typeof className=="undefined")
className="";if(typeof contentWidth!="number")
contentWidth=AGL;if(typeof contentHeight!="number")
contentHeight=AGI;if(typeof opacity!="number"||opacity<0||opacity>1)
opacity=AGJ;if(typeof bShadow!="boolean")
bShadow=AGK;icon.AGiW=this.AGgr;icon.className=className;icon.AGl5=xoffset;icon.AGl6=yoffset;icon.MakeDraggable();icon.AGdP.Lat=lat;icon.AGdP.Long=lng;var layer=document.getElementById(AGM[this.AGgr].AGfR.AGhF);AGM[this.AGgr].AGfS.AGD(icon.AGdP,lat,lng,xoffset,yoffset,layer);icon.AGdP.onclick=function(ev){var layer=document.getElementById(AGM[this.AGiW].AGfR.AGhF);AGM[this.AGiW].AddUserPointWithText(this.Lat,this.Long,"",description,this.AGiW,icon.AGdP.id,layer,contentWidth,contentHeight,bShadow,opacity);return false;}}
this.RemoveDraggableIcon=function(icon){if(typeof icon!="object")
throw "Invalid Icon in the method RemoveDraggableIcon";try{if(icon.IsInsideMap()){var p=icon.AGdP.parentNode;p.removeChild(icon.AGdP);var AGh1=document.getElementById(this.AGgr+"_callout1");if(AGh1&&AGh1.PointID==icon.AGdP.id) 
p.removeChild(AGh1);}}
catch(err){throw "Exception in Removing Icon";}}
this.RemovePointByID=function(id){try{var obj=document.getElementById(id);var p=obj.parentNode;if(p)
p.removeChild(obj);var AGh1=document.getElementById(this.AGgr+"_callout1");if(AGh1&&AGh1.PointID&&AGh1.PointID==id){p.removeChild(AGh1);}
return true;}
catch(err){return false;}}
this.RemoveAllObjects=function(){try{AGM[this.AGgr].AGfS.RemoveAllObjectsFromMap();return true;}
catch(err){return false;}}
this.RemoveObject=function(obj){try{var parentObj=obj.parentNode;parentObj.removeChild(obj);return true;}
catch(err){return false;}}
this.RemoveObjectById=function(AGh7){var obj=document.getElementById(AGh7);return this.RemoveObject(obj);}
this.GetScale=function(){return (AGM[this.AGgr].AGfh);}
this.GetBoundingBox=function(){return (AGM[this.AGgr].AGfQ.AGjq.GetMapBoundingBox());}
this.ResetMap=function() {AGM[this.AGgr].AGfQ.AGmA(AGM[this.AGgr].AGf7.x,AGM[this.AGgr].AGf7.y,AGM[this.AGgr].AGeR[AGM[this.AGgr].AGfq],AGM[this.AGgr].AGfl);};this.AddExecutingFunction=function(AGko){for(var i=0;i<AGM[this.AGgr].AGeL.length;i++){if(AGM[this.AGgr].AGeL[i]==AGko)
return true;}
AGM[this.AGgr].AGeL.push(AGko);return true;}
this.InsertExecutingFunction=function(AGko,AGdD){if(AGdD<0)
return false;if(AGdD>AGM[this.AGgr].AGeL.length)
AGdD=AGM[this.AGgr].AGeL.length;for(var i=AGM[this.AGgr].AGeL.length-1;i>=AGdD;i--)
AGM[this.AGgr].AGeL[i+1]=AGM[this.AGgr].AGeL[i];AGM[this.AGgr].AGeL[AGdD]=AGko;return true;}
this.RemoveExecutingFunction=function(AGko){var AGkY=AGM[this.AGgr].AGeL;AGM[this.AGgr].AGeL=new Array();for(var i=0;i<AGkY.length;i++){if(AGkY[i]!=AGko)
AGM[this.AGgr].AGeL.push(AGkY[i]);}}
this.RemoveAllExecutingFunctions=function(){AGM[this.AGgr].AGeL=new Array();}
this.GetCoordinateFromMap=function(AGbj,AGbx){if(AGbj)
AGM[this.AGgr].AGgC=AGM[this.AGgr].SINGLE_POINT;else
AGM[this.AGgr].AGgC=AGM[this.AGgr].MULTIPLE_POINTS;AGM[this.AGgr].AGgB=new Array();AGM[this.AGgr].AGgA=new Array();if(typeof AGbx!="undefined")
AGM[this.AGgr].AGgz=AGbx;else
AGM[this.AGgr].AGgz=null;AGM[this.AGgr].AGfR.AGlK.style.visibility="visible";}
this.GetClickedPoints=function(){return AGM[this.AGgr].AGgB;}
this.GetClickedCoordinates=function(){return AGM[this.AGgr].AGgA;}
this.CancelCoordinateFromMap=function(){AGM[this.AGgr].AGfR.AGlK.style.visibility="hidden";}
this.GetCurrentMapArea=function(){return AGM[this.AGgr].AGfQ.AGde();}
this.SetInitialMapLocation=function(Latitude,Longitude,AGmo){if(typeof Latitude!="number"||typeof Longitude!="number"){throw "The method SetInitialMapLocation only accepts coordinates of type number";return;}
AGM[this.AGgr].AGf7.x=parseFloat(Longitude);AGM[this.AGgr].AGf7.y=parseFloat(Latitude);AGM[this.AGgr].AGfq=parseInt(AGmo);}
this.DisplayZoomBar=function(AGbf){if(AGbf)
AGM[this.AGgr].AGfR.AGme.style.visibility="visible";else
AGM[this.AGgr].AGfR.AGme.style.visibility="hidden";}
this.EnablePanning=function(AGbg){if(AGbg){AGM[this.AGgr].AGeX=true;AGM[this.AGgr].AGfR.AGcn.style.cursor="pointer";}
else{AGM[this.AGgr].AGeX=false;AGM[this.AGgr].AGfR.AGcn.style.cursor="auto";}}
this.SetZoomBarPosition=function(x,y){if(typeof x!="number"||typeof y!="number"){throw "The method SetZoomBarPosition only accepts x and y of type number";return;}
AGM[this.AGgr].AGfR.AGme.style.left=x+"px";AGM[this.AGgr].AGfR.AGme.style.top=y+"px";}
this.ResizeMap=function(){AGM[this.AGgr].AGfQ.ResizeMap();}
this.RegisterFunction=function(AGkn,AGkp,AG8){if(typeof AGkn!="string"||typeof AGkp!="string"){return false;}
if(AGkn.length==0||AGkp.length==0){return false;}
if(typeof AG8!="boolean"||!AG8)
AG8=false;else
AG8=true;AGkn=AGkn.toUpperCase();switch(AGkn){case "ZOOM":
AGM[this.AGgr].AGf2.AGC(AGkp,AG8);break;case "RIGHTBUTTONCLICK":
AGM[this.AGgr].AGfX.AGC(AGkp,AG8);break;case "LEFTBUTTONCLICK":
AGM[this.AGgr].AGfP.AGC(AGkp,AG8);break;case "DOUBLECLICK":
AGM[this.AGgr].AGfO.AGC(AGkp,AG8);break;case "SHOWROUTING":
AGM[this.AGgr].AGfY.AGC(AGkp,AG8);break;case "CLEARROUTING":
AGM[this.AGgr].AGfN.AGC(AGkp,AG8);break;case "RESETBBOX":
AGM[this.AGgr].AGfW.AGC(AGkp,AG8);break;case "PAN":
AGM[this.AGgr].AGfV.AGC(AGkp,AG8);break;default:
return false;}
return true;}
this.UnregisterFunction=function(AGkn,AGkp){if(typeof AGkn!="string"||typeof AGkp!="string"){return;}
if(AGkn.length==0||AGkp.length==0){return;}
AGkn=AGkn.toUpperCase();switch(AGkn){case "ZOOM":
AGM[this.AGgr].AGf2.RemoveFunction(AGkp);break;case "RIGHTBUTTONCLICK":
AGM[this.AGgr].AGfX.RemoveFunction(AGkp);break;case "LEFTBUTTONCLICK":
AGM[this.AGgr].AGfP.RemoveFunction(AGkp);break;case "DOUBLECLICK":
AGM[this.AGgr].AGfO.RemoveFunction(AGkp);break;case "SHOWROUTING":
AGM[this.AGgr].AGfY.RemoveFunction(AGkp);break;case "CLEARROUTING":
AGM[this.AGgr].AGfN.RemoveFunction(AGkp);break;case "RESETBBOX":
AGM[this.AGgr].AGfW.RemoveFunction(AGkp);break;case "PAN":
AGM[this.AGgr].AGfV.RemoveFunction(AGkp);break;}}
this.ExecuteUserFunctions=function(AGbi){if(typeof AGbi=="boolean")
AGM[this.AGgr].AGeY=AGbi;}
this.DrawRoute=function(AGbk){AGM[this.AGgr].DrivingDirections.DrawRoute(AGbk);}
this.GetMapCentroid=function(){var bbox=this.GetCurrentMapArea();return AGM[this.AGgr].AGcN(bbox);}
this.EnableDrivingDirectionsMenu=function(AGbg){if(AGbg==true){AGM[this.AGgr].AGeW=true;}
else if(AGbg==false){AGM[this.AGgr].AGeW=false;AGM[this.AGgr].m_objPopupMenu.AGdr();}}
this.SetZoomOnDoubleClick=function(AGbp){if(AGbp==true||AGbp==false)
AGM[this.AGgr].AGe9=AGbp;}
this.SetZoomOnMouseScroll=function(AGbp){if(AGbp==true||AGbp==false)
AGM[this.AGgr].AGfa=AGbp;}
this.DisplayImagery=function(AG7){if(AG7==true ){AGM[this.AGgr].AGeT=true;var AGdJ=document.getElementById(AGM[this.AGgr].AGfR.AGjB);AGdJ.style.visibility="visible";var bbox=AGM[this.AGgr].AGfQ.AGjq.AGgQ.AG1;var width=AGM[this.AGgr].AGfQ.AGjq.AGgQ.width;var height=AGM[this.AGgr].AGfQ.AGjq.AGgQ.height;AGM[this.AGgr].AGjG.SetTiles(bbox,width,height);}
else if(AG7==false){AGM[this.AGgr].AGeT=false;var AGdJ=document.getElementById(AGM[this.AGgr].AGfR.AGjB);AGdJ.style.visibility="hidden";}}
this.SetTransparency=function(AGer){AGM[this.AGgr].AGfQ.AGjq.AGgQ.transperency=AGer;}
this.DisplayOverviewMap=function(AG7){if(AG7==true){var AGjh=AGM[this.AGgr].AGeU;if(AGjh!=AG7){AGM[this.AGgr].AGeU=true;var AGip=document.getElementById(AGM[this.AGgr].AGfR.AGiF);AGip.style.visibility="visible";var AGbA=this.GetMapCentroid();var AGjJ=AGM[this.AGgr].AGc0();AGM[this.AGgr].AGfU.CentreAndScale(AGbA.latitude,AGbA.longitude,AGjJ);}}
else if (AG7==false){var AGjh=AGM[this.AGgr].AGeU;if(AGjh!=AG7){AGM[this.AGgr].AGeU=false;var AGip=document.getElementById(AGM[this.AGgr].AGfR.AGiF);AGip.style.visibility="hidden";}}}
this.GetSize=function(){var s=AGM[this.AGgr].AGfQ.AGdf();return new AGSize(s.width,s.height);}
this.GetPixelFromCoordinate=function(AGhZ){if(AGhZ==null||typeof AGhZ!="object"||typeof AGhZ.latitude!="number"||typeof AGhZ.longitude!="number")
return null;var p=AGM[this.AGgr].GetPixelFromLatLong(AGhZ.latitude,AGhZ.longitude);return new AGPoint(p.x,p.y);}
this.GetCoordinateFromPoint=function(AGh0){if(AGh0==null||typeof AGh0!="object"||typeof AGh0.x!="number"||typeof AGh0.y!="number")
return null;var p=AGM[this.AGgr].AGdd(new Point(AGh0.x,AGh0.y));return new AGCoord(p.y,p.x);}
this.AGd7();AGM[this.AGgr].m_objPopupMenu=new PopupMenu(this.AGgr,AGM[this.AGgr].AGfR.AGgI,AGjb);AGM[this.AGgr].DrivingDirections=new DrivingDirection(this.AGgr);this.DrivingDirections=AGM[this.AGgr].DrivingDirections;if(AGM[this.AGgr].AGfl==MAIN_MAP){var AGiq=AGM[this.AGgr].AGfR.AGiH;AGM[this.AGgr].AGfU=new AGMap(AGiq,uid,AGmd,false,null,OVERVIEW_MAP);AGM[this.AGgr].AGfU.DisplayZoomBar(false);AGM[this.AGgr].AGfU.SetZoomOnDoubleClick(false);AGM[this.AGgr].AGfU.SetZoomOnMouseScroll(false);var AGbw="AGM[\""+this.AGgr+"\"].AGbz";AGM[this.AGgr].AGcW(this.AGgv,AGbw);}}
function AGMapGlobals(AGkr,AGgH,AGiU,AGgW,AGmd){this.AGgq=AGiU;this.AGf6=new Point(0,0);this.AGfl=AGgW;this.AGfU=null;this.AGgo="";this.AGfu=OM_WIDTH;this.AGft=OM_HEIGHT;if(AGgW==OVERVIEW_MAP){var AGeu=this.AGgq.lastIndexOf("_");if(AGeu<0)
 return;this.AGgo=this.AGgq.substring(0,AGeu);}
this.AGeU=false;this.AGfT=null;this.AGf6=new Point(0,0);if(AGmd>5){if(AGgW==OVERVIEW_MAP)
this.AGeR=new Array(4194304000,2097152000,1048576000,524288000,262144000,131072000,65536000,32768000,16384000,8192000,4096000,2048000,1024000,512000,256000,128000,64000,32000,14000,5000);else
this.AGeR=new Array(524288000,262144000,131072000,65536000,32768000,16384000,8192000,4096000,2048000,1024000,512000,256000,128000,64000,32000,16000,8000,4000,2000,1000);}
else{if(AGgW==OVERVIEW_MAP)
this.AGeR=new Array(262144000,131072000,65536000,32768000,16384000,8192000,4096000,2048000,1024000,512000,256000,128000,64000);else
this.AGeR=new Array(50000000,16384000,8192000,4096000,2048000,1024000,512000,256000,128000,64000,32000,12000,6000);}
this.AGeQ=new Array();this.AGeV=false;this.AGfw=0;this.AGeX=true;this.AGeW=true;this.AGe1=0;this.AGeZ=true;this.AGfH=5;this.AGfi=4;this.AGfh=0;this.AGfv=this.AGeR[0];this.AGe0=false;this.AGfF=0;this.AGgd="Map data &copy;2008<a href=\"http://www.afrigis.co.za\" style=\"color:black\" target=\"_blank\">AfriGIS (Pty) Ltd</a>";this.AGfd=AGkr;this.AGfE=0;this.AGfC=0;this.AGfo=0;this.AGfG=0;this.AGfD=0;this.AGfn=MAX_SAT_TILE;this.AGeL=new Array();this.AGf2=new EventHandler();this.AGfX=new EventHandler();this.AGfP=new EventHandler();this.AGfO=new EventHandler();this.AGfY=new EventHandler();this.AGfN=new EventHandler();this.AGfW=new EventHandler();this.AGfV=new EventHandler();this.AGe7=false;this.AGe6=false;this.AGeS=false;this.AGe2=false;this.AGeY=true;this.AGgz=null;this.AGgB=new Array();this.AGgA=new Array();this.AGgC=null;this.SINGLE_POINT=1;this.MULTIPLE_POINTS=0;this.AGf8=new Object();this.AGf8.Longitude=0;this.AGf8.Latitude=0;this.AGe9=true;this.AGfa=true;this.AGfq="";this.AGf7=new Point(0,0);if(AGmd=="6") 
this.AGfz=20;else 
this.AGfz=13;this.AGfy;this.AGfB=0;this.AGfg=0;this.AGf1=null;this.AGfZ=null;this.AGfA=0;this.AGf4=new Point(0,0);this.AGf3=new Point(0,0);this.AGf5=0;this.AGe5=null;this.AGfQ=null;this.AGfS=null;this.AGfR=null;this.AGgn="jsapidefault";this.AGgm="msapi";this.AGff=200;this.AGfe=20;this.AGfM=null;this.AGeN=new Array();this.AGjG=new ImageryTileHandler(this.AGgq);this.AGeT=false;this.AGe4=true;this.AGe8=false;this.AGfI=0;this.AGf0=null;this.SetPos=function(AGla){var AGdQ=this.AGfR.AGk4+AGla;var elem=document.getElementById(AGdQ);if(typeof elem.AGjf!="undefined"){elem.style.width=this.AGfG+"px";elem.style.height=this.AGfD+"px";if(elem.zoom=="1" ) 
 {
elem.style.left=elem.AGjf+"px";elem.style.top=elem.AGjg+"px";elem.zoom="0";this.AGfF--;this.AGfF=this.AGfF<0 ? 0 : this.AGfF;if (this.AGfF==0){this.AGbI(this.AGeQ);AGM[this.AGgq].AGe8=false;}}
else if(elem.zoom=="0" ){elem.style.left=elem.AGjf+"px";elem.style.top=elem.AGjg+"px";}
if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version<7&&BrowserDetect.version>=5.5){var ieDiv=document.getElementById( AGM[this.AGgq].AGfR.AGk3+AGla);ieDiv.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+elem.src+"',sizingMethod='scale');";ieDiv.style.width=elem.style.width;ieDiv.style.height=elem.style.height;ieDiv.style.left=elem.style.left;ieDiv.style.top=elem.style.top;ieDiv.style.zIndex=elem.style.zIndex;}}
else{}} 
this.AGbI=function(AGY){this.AGfI=0;this.AGfQ.AGcJ.RemoveAll();this.AGfQ.AGlI.RemoveAll();var AGbb=BrowserDetect.browser=="Explorer"&&BrowserDetect.version<7&&BrowserDetect.version>=5.5;var i;for(i=0;i<this.AGfo;i++){var found=false;for (var j=0;j<AGY.length;j++){if (AGY[j]==i){found=true;break;}}
if(found){this.AGfQ.AGlI.Add(i);}
else{this.AGfQ.AGcJ.Add(i);document.getElementById(this.AGfR.AGk4+i).zoom="0";document.getElementById(this.AGfR.AGk4+i).style.width=this.AGfG+"px";document.getElementById(this.AGfR.AGk4+i).style.height=this.AGfD+"px";document.getElementById(this.AGfR.AGk4+i).style.zIndex=this.AGfH;document.getElementById(this.AGfR.AGk4+i).AGjf="-100000";document.getElementById(this.AGfR.AGk4+i).AGjg="-100000";document.getElementById(this.AGfR.AGk4+i).style.left=-100000+"px";document.getElementById(this.AGfR.AGk4+i).style.top=-100000+"px";if(AGbb){var ieDiv=document.getElementById(this.AGfR.AGk3+i);var img=document.getElementById(this.AGfR.AGk4+i);ieDiv.style.width=img.style.width;ieDiv.style.height=img.style.height;ieDiv.style.zIndex=img.style.zIndex;ieDiv.style.left=img.style.left;ieDiv.style.top=img.style.top;}}}
var AGg4=-1;for(var k=0;k<AGY.length;k++){if( AGY[k]>AGg4 )
AGg4=AGY[k];}
this.AGfQ.AGfj=AGg4+1;AGY=new Array();this.AGfF=0;}
this.AddUserPointWithText=function(lat,lng,header,AGb8,AGiW,AGi0,objLayer,width,height,boolShadow,opacity){var wrapperDiv=document.createElement('div');wrapperDiv.id=AGiW+"_callout1";wrapperDiv.PointID=AGi0;wrapperDiv.innerHTML="";bubbleBoxDiv=document.createElement('div');bubbleBoxDiv.setAttribute('id',AGiW+'_bubbleBoxDivID');bubbleBoxDiv.style.position="relative";contentDiv=document.createElement('div');contentDiv.setAttribute('id',AGiW+'_contentDivID');contentDiv.style.position="relative";contentDiv.style.width=width+"px";contentDiv.style.height=height+"px";contentDiv.style.left="18px";contentDiv.style.top="20px";contentDiv.style.zIndex="20";contentDiv.style.overflow="auto";contentDiv.innerHTML=AGb8;bubbleBoxDiv.appendChild(contentDiv);transparentBubbleDiv=document.createElement('div');transparentBubbleDiv.setAttribute('id',AGiW+'_transparentBubbleDivID');transparentBubbleDiv.style.position="absolute";transparentBubbleDiv.style.left="0px";transparentBubbleDiv.style.top="0px";transparentBubbleDiv.style.zIndex="10";topRowDiv=document.createElement('div');topRowDiv.setAttribute('id',AGiW+'_topRowDivID');topRowDiv.style.position="relative";topRowDiv.style.width=parseInt(parseInt(width)+40)+"px";topRowDiv.style.height="20px";topRowDiv.style.left="0px";topRowDiv.style.top="0px";topRowDiv.style.zIndex="10";topLeftDiv=document.createElement('div');topLeftDiv.setAttribute('id',AGiW+'_topLeftDivID');topLeftDiv.style.width="20px";topLeftDiv.style.height="20px";topLeftDiv.style.backgroundImage="url("+this.AGfd+"Images/bubbleSprite.gif)";topLeftDiv.style.backgroundRepeat="no-repeat";topLeftDiv.style.Float="left";topLeftDiv.style.zIndex="10";topLeftDiv.style.MozOpacity=opacity;topLeftDiv.style.filter="alpha(opacity="+(opacity*100)+")";topLeftDiv.style.opacity=opacity;topRowDiv.appendChild(topLeftDiv);topMidDiv=document.createElement('div');topMidDiv.setAttribute('id',AGiW+'_topMidDivID');topMidDiv.style.position="absolute";topMidDiv.style.width=width+"px";topMidDiv.style.height="19px";topMidDiv.style.backgroundColor="#FFFFFF";topMidDiv.style.textAlign="center";topMidDiv.style.borderTopWidth="1px";topMidDiv.style.borderTopStyle="solid";topMidDiv.style.borderTopColor="#9F9F9F";topMidDiv.style.display="block";topMidDiv.style.left=parseInt(topLeftDiv.style.width)+"px";topMidDiv.style.top="0px";topMidDiv.style.zIndex="10";topMidDiv.style.MozOpacity=opacity;topMidDiv.style.filter="alpha(opacity="+(opacity*100)+")";topMidDiv.style.opacity=opacity;topRowDiv.appendChild(topMidDiv);topRightDiv=document.createElement('div');topRightDiv.setAttribute('id',AGiW+'_topRightDivID');topRightDiv.style.position="absolute";topRightDiv.style.width="20px";topRightDiv.style.height="20px";topRightDiv.style.Float="right";topRightDiv.style.backgroundImage="url("+this.AGfd+"Images/bubbleSprite.gif)";topRightDiv.style.backgroundRepeat="no-repeat";topRightDiv.style.backgroundPosition="-20px 0px";topRightDiv.style.left=parseInt(topLeftDiv.style.width)+parseInt(topMidDiv.style.width)+"px";topRightDiv.style.top="0px";topRightDiv.style.zIndex="10";topRightDiv.style.MozOpacity=opacity;topRightDiv.style.filter="alpha(opacity="+(opacity*100)+")";topRightDiv.style.opacity=opacity;var closeDiv=document.createElement('div');closeDiv.setAttribute('id',AGiW+'_closeDivID');closeDiv.style.width="12px";closeDiv.style.height="12px";closeDiv.style.position="relative";closeDiv.style.backgroundImage="url("+this.AGfd+"Images/btn_close.png)";closeDiv.style.zIndex="30";closeDiv.style.top="8px";closeDiv.onclick=function(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);AGM[AGiW].AGfS.RemoveObjectFromMap(wrapperDiv);return false;}
topRightDiv.appendChild(closeDiv);topRowDiv.appendChild(topRightDiv);transparentBubbleDiv.appendChild(topRowDiv);midRowDiv=document.createElement('div');midRowDiv.setAttribute('id','midRowDivID');midRowDiv.style.position="relative";midRowDiv.style.width=(width+parseInt(topRightDiv.style.width)+parseInt(topLeftDiv.style.width))+"px";midRowDiv.style.height=height+"px";midRowDiv.style.left="0px";midRowDiv.style.top="0px";midRowDiv.style.zIndex="10";midRowLeftDiv=document.createElement('div');midRowLeftDiv.setAttribute('id','midRowLeftDivID');midRowLeftDiv.style.width="20px";midRowLeftDiv.style.height=height+"px";midRowLeftDiv.style.Float="left";midRowLeftDiv.style.backgroundColor="#FFFFFF";midRowLeftDiv.style.borderLeftWidth="1px";midRowLeftDiv.style.borderLeftStyle="solid";midRowLeftDiv.style.borderLeftColor="#9f9f9f";midRowLeftDiv.style.zIndex="10";midRowLeftDiv.style.MozOpacity=opacity;midRowLeftDiv.style.filter="alpha(opacity="+(opacity*100)+")";midRowLeftDiv.style.opacity=opacity;midRowDiv.appendChild(midRowLeftDiv);midRowMidDiv=document.createElement('div');midRowMidDiv.setAttribute('id','midRowMidDivID');midRowMidDiv.style.position="absolute";midRowMidDiv.style.width=width+"px";midRowMidDiv.style.height=height+"px";midRowMidDiv.style.backgroundColor="#FFFFFF";midRowMidDiv.style.borderBottomWidth="1px";midRowMidDiv.style.borderBottomStyle="solid";midRowMidDiv.style.borderBottomColor="#9F9F9F";midRowMidDiv.style.left=parseInt(midRowLeftDiv.style.width)+"px";midRowMidDiv.style.top="0px";midRowMidDiv.style.zIndex="10";midRowDiv.appendChild(midRowMidDiv);midRowRightDiv=document.createElement('div');midRowRightDiv.setAttribute('id','midRowRightDivID');midRowRightDiv.style.position="absolute";midRowRightDiv.style.width="19px";midRowRightDiv.style.height=height+"px";midRowRightDiv.style.Float="right";midRowRightDiv.style.backgroundColor="#FFFFFF";midRowRightDiv.style.borderRightWidth="1px";midRowRightDiv.style.borderRightStyle="solid";midRowRightDiv.style.borderRightColor="#9f9f9f";midRowRightDiv.style.left=parseInt(midRowLeftDiv.style.width)+parseInt(midRowMidDiv.style.width)+"px";midRowRightDiv.style.top="0px";midRowRightDiv.style.zIndex="10";midRowRightDiv.style.MozOpacity=opacity;midRowRightDiv.style.filter="alpha(opacity="+(opacity*100)+")";midRowRightDiv.style.opacity=opacity;midRowDiv.appendChild(midRowRightDiv);transparentBubbleDiv.appendChild(midRowDiv);bottomRowDiv=document.createElement('div');bottomRowDiv.setAttribute('id',AGiW+'_bottomRowDivID');bottomRowDiv.style.position="relative";bottomRowDiv.style.width=parseInt(parseInt(width)+40 )+"px";bottomRowDiv.style.height="20px";bottomRowDiv.style.Float="left";bottomRowDiv.style.clear="both";bottomRowDiv.style.margin="0px";bottomRowDiv.style.padding="0px";bottomRowDiv.style.left="0px";bottomRowDiv.style.top="0px";bottomRowDiv.style.zIndex="10";bottomLeftDiv=document.createElement('div');bottomLeftDiv.setAttribute('id',AGiW+'_bottomLeftDivID');bottomLeftDiv.style.width="20px";bottomLeftDiv.style.height="19px";bottomLeftDiv.style.Float="left";bottomLeftDiv.style.backgroundColor="#FFFFFF";bottomLeftDiv.style.borderLeftWidth="1px";bottomLeftDiv.style.borderLeftStyle="solid";bottomLeftDiv.style.borderLeftColor="#9f9f9f";bottomLeftDiv.style.zIndex="10";bottomLeftDiv.style.MozOpacity=opacity;bottomLeftDiv.style.filter="alpha(opacity="+(opacity*100)+")";bottomLeftDiv.style.opacity=opacity;bottomRowDiv.appendChild(bottomLeftDiv);bottomMidDiv=document.createElement('div');bottomMidDiv.setAttribute('id',AGiW+'_bottomMidDivID');bottomMidDiv.style.position="absolute";bottomMidDiv.style.width=width+"px";bottomMidDiv.style.height="19px";bottomMidDiv.style.backgroundColor="#FFFFFF";bottomMidDiv.style.left=parseInt(bottomLeftDiv.style.width)+"px";bottomMidDiv.style.top="0px";bottomMidDiv.style.zIndex="10";bottomMidDiv.style.MozOpacity=opacity;bottomMidDiv.style.filter="alpha(opacity="+(opacity*100)+")";bottomMidDiv.style.opacity=opacity;bottomRowDiv.appendChild(bottomMidDiv);bottomRightDiv=document.createElement('div');bottomRightDiv.setAttribute('id',AGiW+'_bottomRightDivID');bottomRightDiv.style.position="absolute";bottomRightDiv.style.width="20px";bottomRightDiv.style.height="20px";bottomRightDiv.style.Float="right";bottomRightDiv.style.backgroundImage="url("+this.AGfd+"Images/bubbleSprite.gif)";bottomRightDiv.style.backgroundRepeat="no-repeat";bottomRightDiv.style.backgroundPosition="-20px -20px";bottomRightDiv.style.left=parseInt(parseInt(bottomLeftDiv.style.width)+parseInt(bottomMidDiv.style.width))+"px";bottomRightDiv.style.top="0px";bottomRightDiv.style.zIndex="10";bottomRightDiv.style.MozOpacity=opacity;bottomRightDiv.style.filter="alpha(opacity="+(opacity*100)+")";bottomRightDiv.style.opacity=opacity;bottomRowDiv.appendChild(bottomRightDiv);transparentBubbleDiv.appendChild(bottomRowDiv);crnrDiv=document.createElement('div');crnrDiv.setAttribute('id',AGiW+'_crnrDivID');crnrDiv.style.position="relative";crnrDiv.style.width="20px";crnrDiv.style.height="20px";crnrDiv.style.clear="left";crnrDiv.style.backgroundImage="url("+this.AGfd+"Images/bubbleSprite.gif)";crnrDiv.style.backgroundRepeat="no-repeat";crnrDiv.style.backgroundPosition="0px -20px";crnrDiv.style.left="0px";crnrDiv.style.top="-1px";crnrDiv.style.zIndex="10";crnrDiv.style.MozOpacity=opacity;crnrDiv.style.filter="alpha(opacity="+(opacity*100)+")";crnrDiv.style.opacity=opacity;transparentBubbleDiv.appendChild(crnrDiv);if(BrowserDetect.browser=="Explorer"){AGid=document.createElement("div");AGid.setAttribute('id',AGiW+'_oCallOutShadowDivID');}
else{AGid=document.createElement("img");AGid.src=this.AGfd+"Images/CallOutSkewedShadow_v1.png";}
AGid.style.position="absolute";AGid.style.left="0px";AGid.style.width=(2*width+20)+"px";AGid.style.height=(height)+"px";AGid.style.zIndex="-10";AGid.style.top="65px";AGid.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.AGfd+"Images/CallOutSkewedShadow_v1.png',sizingMethod='scale')";AGid.style.MozOpacity=opacity;AGid.style.opacity=opacity;if (boolShadow) {
transparentBubbleDiv.appendChild(AGid);}
bubbleBoxDiv.appendChild(transparentBubbleDiv);wrapperDiv.appendChild(bubbleBoxDiv);this.AGfS.SetCalloutItem(wrapperDiv,lat,lng,0,-(height+parseInt(topRowDiv.style.height)+parseInt(bottomRowDiv.style.height)+parseInt(crnrDiv.style.height)),(width+parseInt(bottomLeftDiv.style.width)+parseInt(bottomRightDiv.style.width)),objLayer);return false;}
this.AGcY=function(AGmv){AGmv=Math.round(AGmv);for(var i=this.AGeR.length;i>=0;i--)
if( parseFloat(this.AGeR[i])>=AGmv )
return parseFloat(this.AGeR[i]);return parseFloat(this.AGeR[0]);}
this.AGcN=function(bbox){var AG3=bbox.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);return {longitude:(AGeF+AGeG)/2,latitude: (AGev+AGew)/2};}
this.AGcP=function(){var x=( this.AGfG*(this.AGfC-1) )/2-this.AGf6.x;var y=( this.AGfD*(this.AGfE-1) )/2-this.AGf6.y;x=Math.round(x);y=Math.round(y);var pt=new Point(x,y);return pt;}
this.AGdc=function(){var AGdl=Math.round(parseInt(this.AGfR.AGgJ.style.height,10)/2);var AGdm=Math.round(parseInt(this.AGfR.AGgJ.style.width,10)/2);return new Point(AGdm,AGdl);}
this.AGc1=function(){var AGlq=-1;var AGd4=-1;var AGdl=Math.round(parseInt(this.AGfR.AGgJ.style.height,10)/2);var AGdm=Math.round(parseInt(this.AGfR.AGgJ.style.width,10)/2);var AGbB=new Point(AGdm,AGdl);for(var i=0;i<this.AGfo;i++){var AGdP=document.getElementById(this.AGfR.AGk4+i);var left=parseInt(AGdP.AGjf,10)+parseInt(this.AGfR.AGld.style.left,10);var top=parseInt(AGdP.AGjg,10)+parseInt(this.AGfR.AGld.style.top,10);if(!this.AGfQ.AGem(i)){if(AGbB.x-left>this.AGfG/2) 
left=left+parseInt(this.AGfG,10);if(AGbB.y-top>this.AGfD/2)
top=top+parseInt(this.AGfD,10);var x=Math.abs(left-AGbB.x);var y=Math.abs(top-AGbB.y);var AGcd=Math.pow((Math.pow(x,2)+Math.pow(y,2)),0.5);if(AGcd>AGlq){AGd4=i;AGlq=AGcd;} }}
return AGd4;}
this.AGc2=function(AGdE,AGdV,AGdN,AGdW,AGdO){var AGd4=-1;var AGgY=-1;for(var i=0;i<AGM[this.AGgq].AGfn;i++){var img=document.getElementById(AGM[this.AGgq].AGfR.AGjC+i);var l=parseInt(img.level);var x=parseInt(img.xVal);var y=parseInt(img.yVal);if(l!=AGdE) 
 continue;if( x>=AGdV&&x<=AGdN&&y>=AGdW&&y<=AGdO) 
 continue;var AGhb=(AGdV+AGdN)/2;var AGhc=(AGdW+AGdO)/2;var dis=(x-AGhb)*(x-AGhb)+(y-AGhc)*(y-AGhc);if(dis>AGgY){AGgY=dis;AGd4=i;}}
if(AGd4<0){for(var i=0;i<AGM[this.AGgq].AGfn;i++){var img=document.getElementById(AGM[this.AGgq].AGfR.AGjC+i);var l=parseInt(img.level);if(l!=AGdE) 
 {
AGd4=i;break;}}}
return AGd4;}
this.AGj3=function(Latitude,Longitude,AGia,AGh6){var pixel=this.GetPixelFromLatLong(Latitude,Longitude);var AGgU=this.AGfQ.AGdf();var height=parseInt(AGgU.GetHeight(),10);var width=parseInt(AGgU.GetWidth(),10);if(pixel.y<AGh6&&(pixel.x+AGia)>width){this.SetPosition((-((pixel.x+AGia+15)-width)),(AGh6+10-pixel.y),(-((pixel.x+AGia+15)-width)),(AGh6+10-pixel.y));}
else if((pixel.x+AGia)>width){this.SetPosition((-((pixel.x+AGia+15)-width)),0,(-((pixel.x+AGia+15)-width)),0);}
else if(pixel.y<AGh6){this.SetPosition(0,(AGh6+10-pixel.y),0,(AGh6+10-pixel.y));}}
this.SetPosition=function(x,y,AGiP,AGiQ){var pX=0;var pY=0;var AGN=6;if(x>=(-AGN)){this.AGfR.AGld.style.left=( parseInt(this.AGfR.AGld.offsetLeft,10)+x)+"px";this.AGfR.AGhG.style.left=( parseInt(this.AGfR.AGhG.offsetLeft,10)+x)+"px";this.AGfR.StationaryDiv.style.left=( parseInt(this.AGfR.StationaryDiv.offsetLeft,10)+x)+"px";pX=x;x=0;}
if(y<=AGN){this.AGfR.AGld.style.top=( parseInt(this.AGfR.AGld.offsetTop,10)+y)+"px";this.AGfR.AGhG.style.top=( parseInt(this.AGfR.AGhG.offsetTop,10)+y)+"px";this.AGfR.StationaryDiv.style.top=( parseInt(this.AGfR.StationaryDiv.offsetTop,10)+y)+"px";pY=y;y=0;}
if(x==0&&y==0){this.AGfQ.Pan(pX,pY,this.AGfl);this.AGf0=null;return;}
if(x<(-AGN)&&y>AGN){this.AGfR.AGld.style.left=( parseInt(this.AGfR.AGld.offsetLeft,10)-AGN)+"px";this.AGfR.AGld.style.top=( parseInt(this.AGfR.AGld.offsetTop,10)+AGN)+"px";this.AGfR.AGhG.style.left=( parseInt(this.AGfR.AGhG.offsetLeft,10)-AGN)+"px";this.AGfR.AGhG.style.top=( parseInt(this.AGfR.AGhG.offsetTop,10)+AGN)+"px";this.AGfR.StationaryDiv.style.left=( parseInt(this.AGfR.StationaryDiv.offsetLeft,10)-AGN)+"px";this.AGfR.StationaryDiv.style.top=( parseInt(this.AGfR.StationaryDiv.offsetTop,10)+AGN)+"px";pX=-AGN;pY=AGN;x+=AGN;y-=AGN;}
else if(x<(-AGN)){this.AGfR.AGld.style.left=( parseInt(this.AGfR.AGld.offsetLeft,10)-AGN)+"px";this.AGfR.AGhG.style.left=( parseInt(this.AGfR.AGhG.offsetLeft,10)-AGN)+"px";this.AGfR.StationaryDiv.style.left=( parseInt(this.AGfR.StationaryDiv.offsetLeft,10)-AGN)+"px";pX=-AGN;x+=AGN;}
else if(y>AGN){this.AGfR.AGld.style.top=( parseInt(this.AGfR.AGld.offsetTop,10)+AGN)+"px";this.AGfR.AGhG.style.top=( parseInt(this.AGfR.AGhG.offsetTop,10)+AGN)+"px";this.AGfR.StationaryDiv.style.top=( parseInt(this.AGfR.StationaryDiv.offsetTop,10)+AGN)+"px";pY=AGN;y-=AGN;}
this.AGfQ.Pan(pX,pY,this.AGfl);this.AGf0=setTimeout("AGM['"+this.AGgq+"'].SetPosition("+x+","+y+","+AGiP+","+AGiQ+")",1);}
this.GetLatLongFromPixel=function(p){var pt=new Point(-1,-1);var AGb1=this.AGfQ.AGjq.GetMapBoundingBox();var AG3=AGb1.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGex=parseFloat(AGew-AGev);var AGeH=parseFloat(AGeG-AGeF);var AGgU=this.AGfQ.AGcT();var height=parseInt(AGgU.GetHeight(),10);var width=parseInt(AGgU.GetWidth(),10);AGeF+=(AGeH*p.x/width);AGew-=(AGex*p.y/height);pt.x=AGeF;pt.y=AGew;return pt;}
this.AGdd=function(p){var pt=new Point(-1,-1);var AGb1=this.AGfQ.AGde();var AG3=AGb1.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGex=parseFloat(AGew-AGev);var AGeH=parseFloat(AGeG-AGeF);var AGgU=this.AGfQ.AGdf();var height=parseInt(AGgU.GetHeight(),10);var width=parseInt(AGgU.GetWidth(),10);AGeF+=(AGeH*p.x/width);AGew-=(AGex*p.y/height);pt.x=AGeF;pt.y=AGew;return pt;}
this.GetPixelFromLatLong=function(lattitude,longitude){var pt=new Point(-1,-1);var AGb1=this.AGfQ.AGde();var AG3=AGb1.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGex=parseFloat(AGew-AGev);var AGeH=parseFloat(AGeG-AGeF);var AGgU=this.AGfQ.AGdf();var height=parseInt(AGgU.GetHeight(),10);var width=parseInt(AGgU.GetWidth(),10);var x=parseInt((width*((longitude-AGeF))/AGeH));var y=parseInt((height*((AGew-lattitude))/AGex ));pt.x=x;pt.y=y;return pt;}
this.AGz=function(){this.AGe1=0;this.AGfR.AGcn.ondblclick=MouseDoubleClick;this.AGfR.AGcn.onmousedown=MouseDown;this.AGfR.AGcn.onmousemove=MouseMove;this.AGfR.AGcn.onmouseup=MouseUp;this.AGfR.AGcn.onmouseout=MouseOut;this.AGfR.AGcn.onclick=MouseClick;if(this.AGfl==MAIN_MAP){this.AGfR.AGlR.onmousedown=MouseDownViewPort;this.AGfR.AGlR.onmousemove=MouseMoveViewPort;this.AGfR.AGlR.onmouseup=MouseUpViewPort;this.AGfR.AGlR.onmouseout=MouseOutViewPort;}
if (this.AGfR.AGcn.addEventListener) 
 this.AGfR.AGcn.addEventListener('DOMMouseScroll',wheel,false);this.AGfR.AGcn.onmousewheel=wheel;}
this.SetScaleContent=function(){this.AGfR.AGjI.innerHTML="Scale="+this.AGfh+":"+this.AGeR[this.AGfh];}
this.AGcA=function(){try{for(var i=0;i<this.AGeL.length;i++){eval(this.AGeL[i]+"();");}}
catch(err){}}
this.AGcC=function(){if(this.AGeY){if(this.AGe7){this.AGe7=false;this.AGf2.AGcB();}
if(this.AGe6){this.AGe6=false;this.AGfY.AGcB();} 
if(this.AGeS){this.AGeS=false;this.AGfN.AGcB();}
if(this.AGe2){this.AGe2=false;this.AGfW.AGcB();}}
this.AGe7=false;this.AGe6=false;this.AGeS=false;this.AGe2=false;}
this.AGcL=function(){if(this.AGe5==true){var AGcp=AGE*1000;var location="AG0{"+AGM[this.AGgq].AGfQ.AGde()+"}";var AGbw="AGM[\""+this.AGgq+"\"].AGby";this.AGcV( this.AGgn,this.AGgm,this.AGff,this.AGfe,location,AGbw);if(this.AGfM)
clearTimeout(this.AGfM);this.AGfM=setTimeout("AGM['"+this.AGgq+"'].AGcL()",AGcp);}}
this.AGby=function(AGkq){if (AGkq.Status=="error") {
return;}
if (AGkq.length>0) {
this.AGjQ(AGkq[0].ImageUrl,AGkq[0].RedirectionUrl);}}
this.AGjQ=function(AGkt,AGkJ){if(this.AGe5==true&&this.AGfR.AGH&&this.AGfR.AGF){iImgWidth=this.AGff;iImgHeight=this.AGfe;this.AGfR.AGF.src=AGkt;this.AGfR.AGF.style.visibility="visible";this.AGfR.AGF.style.width=this.AGff+"px";this.AGfR.AGF.style.height=this.AGfe+"px";this.AGfR.AGH.link=AGkJ;this.AGfR.AGH.style.visibility="visible";var AGdv=this.AGfR.AGH.offsetWidth;var AGdu=this.AGfR.AGH.offsetHeight;if( iImgWidth<AGdv){var w=parseInt( (AGdv-iImgWidth)/2,10);this.AGfR.AGF.style.left=w+"px";}
else
this.AGfR.AGF.style.left="0px";if( iImgHeight<AGdu){var l=parseInt( (AGdu-iImgHeight)/2,10);this.AGfR.AGF.style.top=l+"px";}
else
this.AGfR.AGF.style.top="0px";this.AGfR.AGbT.style.bottom=this.AGfR.AGH.offsetHeight+"px";this.AGfR.AGjI.style.bottom=this.AGfR.AGH.offsetHeight+"px";}}
this.AGcV=function(AGkS,AGkG,AGes,AGdC,AGkw,AGkj){var url=MARBIL_GATEWAY+"?";url+="&Request=GetAdvertNow";url+="&UserName="+AGkS;url+="&Password="+AGkG;url+="&Width="+AGes;url+="&Height="+AGdC;url+="&Location="+AGkw;url+="&Jsonp="+AGkj;var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",url);document.body.appendChild(script);}
this.AGcW=function(AGkf,AGkj){var url=MARBIL_GATEWAY+"?";url+="&Request=GetMarbilUser";url+="&Key="+AGkf;url+="&Jsonp="+AGkj;var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",url);document.body.appendChild(script);}
this.AGbz=function(AGkR){if(typeof AGkR!="undefined"&&AGkR!=null){if(typeof AGkR.Status!="undefined"&&AGkR.Status.toLowerCase()=="error")
return;this.AGgn=AGkR.UserName;this.AGgm=AGkR.Password;if (AGkR.AdvertStatus.toLowerCase()=="invalid key") {document.getElementById(this.AGgq).innerHTML="";return;}
if(AGkR.AdvertStatus.toLowerCase()=="false"){this.AGe5=false;}
else {this.AGe5=true;AGM[this.AGgq].AGfQ.ResizeMap();AGM[this.AGgq].AGcL();}}}
this.SetRoutingLayerConsistency=function(AGkC,AGkN){var AGV=AGkC.split(",");var AGbO=false;for(var i=0;i<AGV.length;i++){if(AGV[i]==AGkN){AGbO=true;break;}}
this.AGe4=AGbO;if(!AGbO)
AGM[this.AGgq].AGfQ.AGjq.AGbJ();}
this.AGc0=function(){var AGb3=AGM[this.AGgq].AGfh;return AGb3;}}
function Layer(AGkv,AGU,AGbn,AGW){this.AGgi=AGkv;this.AGeO=AGU;this.AGe3=AGbn;this.AGeP=AGW;this.GetLayerName=function(){return this.AGgi;}
this.AGc4=function(){return this.AGeO;}
this.AGel=function(){return this.AGe3;}
this.AGc3=function(){if(this.AGe3)
return this.AGeP;return new Array();}
this.AGbQ=function(AGkP){var len=this.AGeO.length;for(var i=0;i<len;i++){if(this.AGeO[i]==AGkP)
return true;}
return false;}
this.AGbP=function(AGkM){AGkM=AGkM.toLowerCase();if(this.AGe3){var len=this.AGeP.length;for(var i=0;i<len;i++){if(this.AGeP[i].toLowerCase()==AGkM)
return true;}}
return false;}}
function MouseCoords(ev){ev=ev||window.event;if(ev.pageX||ev.pageY){if(ev.type=="DOMMouseScroll"){var AGbd=BrowserDetect.browser=="Firefox"&&BrowserDetect.version<3;if(AGbd){return {x:ev.pageX/15,y:ev.pageY/15};}
else{return {x:ev.pageX,y:ev.pageY};}}
else
return {x:ev.pageX,y:ev.pageY};}
else if (ev.clientX||ev.clientY) {posx=ev.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=ev.clientY+document.body.scrollTop+document.documentElement.scrollTop;return { x:posx,y:posy };}
return { x:0,y:0 };}
var AGiO;var AGiN;var AGhz=null;var AGhA=null;var AGju=new Point(0,0)
function MouseDown(ev){ev=ev||window.event;var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);if(IsRightButton(ev)){AGM[AGiW].AGe1=0;var AGju=GetMouseOffset_bd(document.getElementById(AGiW),ev);if(AGM[AGiW].AGeW)
AGM[AGiW].m_objPopupMenu.AGjY(parseInt(AGju.x,10),parseInt(AGju.y,10));var AGbR=AGM[AGiW].AGdd(AGju);AGM[AGiW].AGf8.Longitude=AGbR.x;AGM[AGiW].AGf8.Latitude=AGbR.y;if(AGM[AGiW].AGeY)
AGM[AGiW].AGfX.AGcB();return false;}
AGM[AGiW].m_objPopupMenu.AGdr();if(AGM[AGiW].AGeX&&AGM[AGiW].AGe1==0){var AGhw=MouseCoords(ev);AGiO=new Point(AGhw.x,AGhw.y);AGhz=AGhw;AGM[AGiW].AGe1=1;}
return false;}
function MouseMove(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);if(typeof AGM[AGiW].AGeV=="undefined"||(typeof AGM[AGiW].AGeV=="boolean"&&AGM[AGiW].AGeV==false))
return {x:0,y:0};if(AGM[AGiW].AGe1==1||AGM[AGiW].AGe1==2){AGM[AGiW].AGe1=2;AGhA=MouseCoords(ev);var AGjW=parseInt(AGhA.x,10)-parseInt(AGhz.x,10);var AGjX=parseInt(AGhA.y,10)-parseInt(AGhz.y,10);var i=0;var j=0;AGM[AGiW].AGfR.AGld.style.left=( parseInt(AGM[AGiW].AGfR.AGld.offsetLeft,10)+AGjW)+"px";AGM[AGiW].AGfR.AGld.style.top=( parseInt(AGM[AGiW].AGfR.AGld.offsetTop,10)+AGjX)+"px";AGM[AGiW].AGfR.AGhG.style.left=( parseInt(AGM[AGiW].AGfR.AGhG.offsetLeft,10)+AGjW)+"px";AGM[AGiW].AGfR.AGhG.style.top=( parseInt(AGM[AGiW].AGfR.AGhG.offsetTop,10)+AGjX)+"px";AGM[AGiW].AGfR.StationaryDiv.style.left=( parseInt(AGM[AGiW].AGfR.StationaryDiv.offsetLeft,10)+AGjW)+"px";AGM[AGiW].AGfR.StationaryDiv.style.top=( parseInt(AGM[AGiW].AGfR.StationaryDiv.offsetTop,10)+AGjX)+"px";mainMapWidth=AGM[AGiW].AGfQ.AGdf().GetWidth();mainMapHeight=AGM[AGiW].AGfQ.AGdf().GetHeight();AGhz=AGhA;}
return false;}
function MouseUp(ev){ev=ev||window.event;var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);AGM[AGiW].AGfA=0;if(AGM[AGiW].AGe1==2){AGM[AGiW].AGe1=0;var AGhw=MouseCoords(ev);AGiN=new Point(AGhw.x,AGhw.y);AGM[AGiW].AGfQ.Pan(AGiN.x-AGiO.x,AGiN.y-AGiO.y,AGM[AGiW].AGfl);}
AGM[AGiW].AGe1=0;return false;}
function MouseOut(ev){this.onmousemove(ev);this.onmouseup(ev);var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);AGM[AGiW].AGe1=0;if(this.id==AGM[AGiW].AGfR.AGcm)
AGM[AGiW].AGe0=false;}
function MouseClick(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);if(AGM[AGiW].AGeY)
AGM[AGiW].AGfP.AGcB();}
function ZoomOnRedDisplayAnimation(AGiW,AGhD,AGhE,AG6){if(AGM[AGiW].m_objZoomAnimation!=null)
clearTimeout(AGM[AGiW].m_objZoomAnimation);var W=40;var H=40;if(AG6==1)
 {
var AGh5=document.getElementById(AGM[AGiW].AGfR.AGl8);AGh5.style.left=AGhD+"px";AGh5.style.top=AGhE+"px";AGh5.style.width="0px";AGh5.style.height="0px";AGh5.style.visibility="visible";var AGd1=4;var AGd2=4;animate(AGiW,W,H,AGhD,AGhE,AGd1,AGd2);}
else if(AG6==0)
 {
var AGh5=document.getElementById(AGM[AGiW].AGfR.AGl8);AGh5.style.left=(AGhD-W/2)+"px";AGh5.style.top=(AGhE-H/2)+"px";AGh5.style.width=W+"px";AGh5.style.height=H+"px";AGh5.style.visibility="visible";var AGd1=-4;var AGd2=-4;animate(AGiW,0,0,AGhD,AGhE,AGd1,AGd2);}
else{AGM[AGiW].AGfR.AGl7.style.visibility="hidden";return false;}}
function animate(AGiW,AGkW,AGkV,AGbC,AGbD,AGd1,AGd2){var div=document.getElementById(AGM[AGiW].AGfR.AGl8);var cw=parseInt(div.style.width);var ch=parseInt(div.style.height);var AGll=30;if(AGd1>0&&AGd2>0) 
 {
var AGA=AGd1;var AGB=AGd2;if(cw+AGd1>=AGkW)
AGA=AGkW-cw;if(ch+AGd2>=AGkV)
AGB=AGkV-ch;var AGhV=cw+AGA;var AGhL=ch+AGB;div.style.width=AGhV+"px";div.style.height=AGhL+"px";div.style.left=(AGbC-AGhV/2)+"px";div.style.top=(AGbD-AGhL/2)+"px";if(AGhV<AGkW||AGhL<AGkV)
animationTimer=setTimeout("animate('"+AGiW+"',"+AGkW+","+AGkV+","+AGbC+","+AGbD+","+AGd1+","+AGd2+" )",AGll);else{div.style.visibility="hidden";animationTimer=null;}}
else if(AGd1<0&&AGd2<0)
 {
var AGA=AGd1;var AGB=AGd2;if(cw+AGd1<=AGkW)
AGA=AGkW-cw;if(ch+AGd2<=AGkV)
AGB=AGkV-ch;var AGhV=cw+AGA;var AGhL=ch+AGB;div.style.width=AGhV+"px";div.style.height=AGhL+"px";div.style.left=(AGbC-AGhV/2)+"px";div.style.top=(AGbD-AGhL/2)+"px";if(AGhV>AGkW||AGhL>AGkV)
animationTimer=setTimeout("animate('"+AGiW+"',"+AGkW+","+AGkV+","+AGbC+","+AGbD+","+AGd1+","+AGd2+" )",AGll);else{div.style.visibility="hidden";animationTimer=null;}}}
function wheel(ev){ev=ev||window.event;var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return false;var AGiW=this.id.substring(0,AGeu);var delta=0;if (!ev) 
ev=window.event;if(AGM[AGiW].AGfa){if (ev.wheelDelta) {delta=ev.wheelDelta/120;var AGbe=BrowserDetect.browser=="Opera"&&BrowserDetect.version<=9.02;if (AGbe){delta=-delta;}}
else if (ev.detail) 
delta=-ev.detail/3;if (delta){var AGd4=AGM[AGiW].AGfh;if (delta<0){if(AGd4<AGM[AGiW].AGeR.length-1){var AGbd=BrowserDetect.browser=="Firefox"&&BrowserDetect.version<3;if(AGbd){var AGhw=MouseCoords(ev);}
else{var AGhw=GetMouseOffset_bd(AGM[AGiW].AGfR.AGgJ,ev);}
var pt=AGM[AGiW].AGdd(new Point(AGhw.x,AGhw.y));var AGmp=pt.x;var AGmn=pt.y;var scale=AGM[AGiW].AGeR[AGd4+1];var AGgT=AGM[AGiW].AGfQ.AGcT();var AGgX=AGgT.GetWidth();var AGgO=AGgT.GetHeight();var AGbB=AGM[AGiW].AGdc();var AGmu=AGhw;var cm=new CoordMapper();var bbox=cm.AGbt(AGmn,AGmp,scale,AGgX,AGgO,AGbB,AGmu);var AGha=AGM[AGiW].AGcN(bbox);ZoomOnRedDisplayAnimation(AGiW,AGhw.x,AGhw.y,1)
 AGM[AGiW].AGfQ.AGmA(AGha.longitude,AGha.latitude,scale,MAIN_MAP);}
else{alert("Maximum zoom level reached !");return;}}
else{if(AGd4>0){var AGbd=BrowserDetect.browser=="Firefox"&&BrowserDetect.version<3;if(AGbd){var AGhw=MouseCoords(ev);}
else{var AGhw=GetMouseOffset_bd(AGM[AGiW].AGfR.AGgJ,ev);}
var pt=AGM[AGiW].AGdd(new Point(AGhw.x,AGhw.y));var AGmp=pt.x;var AGmn=pt.y;var scale=AGM[AGiW].AGeR[AGd4-1];var AGgT=AGM[AGiW].AGfQ.AGcT();var AGgX=AGgT.GetWidth();var AGgO=AGgT.GetHeight();var AGbB=AGM[AGiW].AGdc();var AGmu=AGhw;var cm=new CoordMapper();var bbox=cm.AGbt(AGmn,AGmp,scale,AGgX,AGgO,AGbB,AGmu);var AGha=AGM[AGiW].AGcN(bbox);ZoomOnRedDisplayAnimation(AGiW,AGhw.x,AGhw.y,0)
 AGM[AGiW].AGfQ.AGmA(AGha.longitude,AGha.latitude,scale,MAIN_MAP);}
else{alert("Minimum zoom level reached !");return;} }}
if (ev.preventDefault)
ev.preventDefault();ev.returnValue=false;}
else{return false;}}
var AGeh=false;var AGhx;var AGhy;var AGlW=null;var AGlV=null;function MouseDownViewPort(ev){ev=ev||window.event;if(!ev){return;}
if(AGeh==false){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);var AGhw=GetMouseOffset_bd(document.getElementById(AGM[AGiW].AGfR.AGiD),ev);AGeh=true;AGhx=AGhw;var AGlU=document.getElementById(AGM[AGiW].AGfR.AGlQ);var AGlX=parseInt(AGlU.style.left,10);var AGl1=parseInt(AGlU.style.top,10);AGlW=new Point(AGlX,AGl1);}
return false;}
function MouseMoveViewPort(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);ev=ev||window.event;if(!ev){return;}
try{if(AGeh==true){AGhy=GetMouseOffset_bd(document.getElementById(AGM[AGiW].AGfR.AGiD),ev);var AGjX=parseInt(AGhy.y)-parseInt(AGhx.y);var AGjW=parseInt(AGhy.x)-parseInt(AGhx.x);var AGlU=AGM[AGiW].AGfR.AGlR;var AGlX=parseInt(AGlU.style.left,10);var AGl1=parseInt(AGlU.style.top,10);AGlU.style.left=(AGlX+AGjW)+"px";AGlU.style.top=(AGl1+AGjX)+"px";AGhx=AGhy;return false;}}
catch(err){return;} 
return false;}
function MouseUpViewPort(e){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);e=e||window.event;if(!e){return;}
if(AGeh==true){AGeh=false;var AGhw=GetMouseOffset_bd(document.getElementById(AGM[AGiW].AGfR.AGiD),e);var AGlU=document.getElementById(AGM[AGiW].AGfR.AGlQ);var AGlX=parseInt(AGlU.style.left,10);var AGl1=parseInt(AGlU.style.top,10);AGlV=new Point(AGlX,AGl1);var AGlY=AGlV.x-AGlW.x;var AGlZ=AGlV.y-AGlW.y;var AGiJ=AGM[AGiW].AGfR.AGiE;AGM[AGiJ].AGfQ.AGiM(-AGlY,-AGlZ,OVERVIEW_MAP);}
AGeh=false;return false;}
function MouseOutViewPort(ev){this.onmousemove(ev);this.onmouseup(ev);return false;}	
var AGhB=null;var AGhC=null;var AGbq=false;function MouseBarDown(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return false;var AGiW=this.id.substring(0,AGeu);ev=ev||window.event;if(!ev){return false;}
try{var AGhw=GetMouseOffset_bd(document.getElementById(AGM[this.AGiX].AGfR.AGj4),ev);AGbq=true;AGhB=AGhw;return false;}
catch(err){return false;} 
return false;}
function SlideControllerMouseMove(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return false;var AGiW=this.id.substring(0,AGeu);ev=ev||window.event;if(!ev)
return false;if(AGbq==true){AGhC=GetMouseOffset_bd(document.getElementById(AGM[AGiW].AGfR.AGj4),ev);if(AGhC.y<0)
AGhC.y=0;var AGj1=parseInt(AGM[AGiW].AGfR.AGmx.style.height,10);if(AGhC.y>AGj1)
AGhC.y=AGj1;var AGjX=parseInt(AGhC.y)-parseInt(AGhB.y);var AGcb=parseInt(AGjX/(AGM[this.AGiX].AGfy));if(AGcb<AGM[AGiW].AGeR.length-1)
AGM[AGiW].AGfR.AGmz.style.top=(parseInt(AGM[AGiW].AGfR.AGmz.offsetTop)+AGjX)+"px";else if(AGcb>=AGM[AGiW].AGeR.length)
return false;else if(AGcb<=0)
return false;AGhB=AGhC;}
return false;}
function MouseBarUp(ev){ev=ev||window.event;if(!ev)
return false;var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);if(AGbq==true){var AGhw=GetMouseOffset_bd(document.getElementById(AGM[AGiW].AGfR.AGj4),ev);var AGcc=parseInt((AGhB.y)/(AGM[AGiW].AGfy));var AGcg=parseInt((AGhw.y)/(AGM[AGiW].AGfy));if(AGcc<0){ZoomMapToScale(0,AGiW);return false;} 
else if (AGcc<=AGM[AGiW].AGeR.length-1) {ZoomMapToScale(AGcc,AGiW,AGM[AGiW].AGmi);}
else if (AGcc>=AGM[AGiW].AGeR.length) {ZoomMapToScale(AGM[AGiW].AGeR.length-1,AGiW);return false;}
AGbq=false;return false;}
AGbq=false;return false;}
function MouseBarOut(ev){this.onmousemove(ev);this.onmouseup(ev);return false;}
var AGco=null;var AGj8=null;var AGcr=null;var AGcG=null;function IsRightButton(e) {var rightclick=false;e=e||window.event;if (e.which) 
rightclick=(e.which==3);else if (e.button) 
rightclick=(e.button==2);return rightclick;}
function GetMouseOffset_bd(target,ev){ev=ev||window.event;var AGcl=GetPosition(target);var AGhw=MouseCoords(ev);return {x:AGhw.x-AGcl.x,y:AGhw.y-AGcl.y};}
function GetPosition(e){
var left=0;var top=0;while (e.offsetParent){
left+=e.offsetLeft;top+=e.offsetTop;e=e.offsetParent;}
left+=e.offsetLeft;top+=e.offsetTop;return {x:left,y:top};}
function MouseDoubleClick(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);if(AGM[AGiW].AGe9){var AGkZ=AGM[AGiW].AGf6.x;var AGk0=AGM[AGiW].AGf6.y;var AGhw=MouseCoords(ev);var AGhK=GetMouseOffset_bd(AGM[AGiW].AGfR.AGgJ,ev);var p=new Point(Math.round(AGhK.x+Math.abs(AGkZ)),Math.round(AGhK.y+Math.abs(AGk0)));var AGjj=AGM[AGiW].GetLatLongFromPixel(p);if (AGM[AGiW].AGfh==AGM[AGiW].AGeR.length-1){alert("Maximum zoom level reached !!!");AGM[AGiW].AGfh=AGM[AGiW].AGeR.length-1;}
else
AGM[AGiW].AGfQ.AGmA(AGjj.x,AGjj.y,AGM[AGiW].AGeR[AGM[AGiW].AGfh+1],AGM[AGiW].AGfl);}
if(AGM[AGiW].AGeY)
AGM[AGiW].AGfO.AGcB();}
var AGj6=0;function ClickSlider(ev,AGiW){if(AGM[AGiW].AGfw>0)
return;ev=ev||window.event;if(!ev){return;}
var AGhw=MouseCoords(ev);var obj=GetPosition(document.getElementById(AGM[AGiW].AGfR.AGj4));AGcb=parseInt((AGhw.y-obj.y)/(AGM[AGiW].AGfy));if(AGM[AGiW].AGmi=="4")
AGcb=11-AGcb;if(AGcb<AGM[AGiW].AGeR.length)
ZoomMapToScale(AGcb+1,AGiW,AGM[AGiW].AGmi);else
ZoomMapToScale(AGM[AGiW].AGeR.length-1,AGiW);}
function ZoomInButtonClick(AGiW,AGmf){if(AGM[AGiW].AGfw>0)
return;var AGd4;AGd4=AGM[AGiW].AGfh;if(AGd4<AGM[AGiW].AGeR.length)
ZoomMapToScale(AGd4+1,AGiW,AGmf);else
alert("Maximum zoom level reached !");}
function ZoomOutButtonClick(AGiW,AGmf){if(AGM[AGiW].AGfw>0)
return;var AGd4;AGd4=AGM[AGiW].AGfh;if(AGd4>0)
ZoomMapToScale(AGd4-1,AGiW,AGmf);else
alert("Minimum zoom level reached !");} 
function ZoomMapToScale(AGj5,AGiW,AGmf){AGj5=parseInt(AGj5,10);if (AGj5>AGM[AGiW].AGfz-1){AGj5=AGM[AGiW].AGfz-1;alert("Maximum zoom level reached !");return;} 
if(AGM[AGiW].AGfh==AGj5)
 return;AGM[AGiW].AGfh=AGj5;var p=AGcO(AGiW);AGM[AGiW].AGfQ.AGmA(p.x,p.y,AGM[AGiW].AGeR[AGj5],AGM[AGiW].AGfl);AGM[AGiW].AGfg=AGj5;}
function AGcO(AGiW){var x=( AGM[AGiW].AGfG*(AGM[AGiW].AGfC-1) )/2-AGM[AGiW].AGf6.x-1;var y=( AGM[AGiW].AGfD*(AGM[AGiW].AGfE-1) )/2-AGM[AGiW].AGf6.y;x=Math.round(x);y=Math.round(y);return AGM[AGiW].GetLatLongFromPixel(new Point(x,y));}
function MoveZoomSlideDown(AGd4,AGiT){var colorIndex=0;if(AGd4<AGM[AGiT].AGeR.length){colorIndex=13-AGd4;var AGmg=AGM[AGiT].AGmi;if(AGmg=="2"||AGmg=="3"||AGmg=="4")
AGM[AGiT].AGfR.AGmx.setAttribute( 'src',AGM[AGiT].AGfd+"zoombar/zb"+AGmg+"/scale_"+colorIndex+".png");else
AGM[AGiT].AGfR.AGmz.style.top=Math.ceil(AGM[AGiT].AGfy*AGd4+AGM[AGiT].AGfR.AGmx.offsetTop-AGM[AGiT].AGfR.AGmz.offsetHeight/2)+'px';}}
var BrowserDetect={
init: function () {this.browser=this.AGjK(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.AGjK(this.dataOS)||"an unknown OS";},AGjK: function (data) {for (var i=0;i<data.length;i++)	{
var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if (dataString) {
if (dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if (dataProp)
return data[i].identity;}},searchVersion: function (dataString) {var AGd4=dataString.indexOf(this.versionSearchString);if (AGd4==-1) return;return parseFloat(dataString.substring(AGd4+this.versionSearchString.length+1));},dataBrowser: [{string: navigator.userAgent,subString: "OmniWeb",versionSearch: "OmniWeb/",identity: "OmniWeb"},{
string: navigator.vendor,subString: "Apple",identity: "Safari"},{
prop: window.opera,identity: "Opera"},{
string: navigator.vendor,subString: "iCab",identity: "iCab"},{
string: navigator.vendor,subString: "KDE",identity: "Konqueror"},{
string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{
string: navigator.vendor,subString: "Camino",identity: "Camino"},{	
 string: navigator.userAgent,subString: "Netscape",identity: "Netscape"},{
string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"},{
string: navigator.userAgent,subString: "Gecko",identity: "Mozilla",versionSearch: "rv"},{ 
 string: navigator.userAgent,subString: "Mozilla",identity: "Netscape",versionSearch: "Mozilla"}
],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"},{
string: navigator.platform,subString: "Mac",identity: "Mac"},{
string: navigator.platform,subString: "Linux",identity: "Linux"}
]};BrowserDetect.init();function Point(_x,_y){this.x=_x;this.y=_y;this.GetX=function(){return this.x;}
this.SetX=function(_x){this.x=_x;}
this.GetY=function(){return this.y;}
this.SetY=function(_y){this.y=_y;}}
function Size(AGy,AGe){this.width=AGy;this.height=AGe;this.GetWidth=function (){return this.width;}
this.SetWidth=function(AGy){this.width=AGy;}
this.GetHeight=function (){return this.height;}
this.SetWidth=function(AGe){this.height=AGe;}}
function TileList(){this.items=new Array();this.length=0;this.Add=function(item){this.items[this.length]=item;this.length++;}
this.RemoveAll=function(){this.length=0;}
this.AGi3=function(){if(this.length<=0)
return null;var AGlo=this.items[0];this.items[0]=this.items[this.length-1];this.length--;return AGlo;}}
function MapInfo(AGa,AGy,AGe,AGd,AGh,AGs,AGc,AGo,AGp,AGt){this.AG1=AGa;this.width=parseInt( AGy,10);this.height=parseInt( AGe,10);this.format=AGd;this.layers=AGh;this.styles=AGs;this.exceptions=AGc;this.AGjw=AGo;this.AGjx=AGp;this.transperency=0;if(typeof AGt=="number"&&AGt>=0&&AGt<=100)
this.transperency=parseInt(AGt+"",10);this.SetBoundingBox=function(AGa){this.AG1=AGa;}
this.GetBoundingBox=function(){return this.AG1;}
this.GetSize=function(){return new Size(this.width,this.height);}
this.SetSize=function(AGq){this.width=parseInt( AGq.width,10);this.height=parseInt( AGq.height,10);}
this.SetWidth=function(w){this.width=parseInt(w,10);} 
this.setHeight=function(h){this.height=parseInt(h);} }
function AGhG(AGhH){var AGeu=AGhH.lastIndexOf("_");if(AGeu<0)
return;this.AGkE=AGhH.substring(0,AGeu);this.AGfL=AGhH;this.TopItemInContainer=-1;this.CalloutItem=null;this.AGD=function (obj,AGcj,AGck,AGif,AGig,objLayer){var pt=this.GetXYFromCoord(AGcj,AGck);pt.x+=AGif;pt.y+=AGig;pt.x-=objLayer.offsetLeft;pt.y-=objLayer.offsetTop;obj.Lat=AGcj;obj.Long=AGck;obj.AGif=AGif;obj.AGig=AGig;obj.style.position="absolute";obj.style.top=pt.y+"px";obj.style.left=pt.x+"px";this.TopItemInContainer++;obj.style.zIndex=this.TopItemInContainer;objLayer.appendChild(obj);} 
this.AddObjectToMapByPixelPosition=function (obj,positionY,positionX,AGif,AGig,objLayer){positionX+=AGif;positionY+=AGig;obj.AGif=AGif;obj.AGig=AGig;obj.style.position="absolute";obj.style.top=positionY+"px";obj.style.left=positionX+"px";this.TopItemInContainer++;obj.style.zIndex=this.TopItemInContainer;objLayer.appendChild(obj);}
this.SetCalloutItem=function (obj,AGcj,AGck,AGif,AGig,divWidth,objLayer){if(this.CalloutItem)
this.RemoveObjectFromMap(this.CalloutItem);if(AGM[this.AGkE].AGeZ){this.CalloutItem=obj;this.AGD(obj,AGcj,AGck,AGif,AGig,objLayer);AGM[this.AGkE].AGj3(AGcj,AGck,(divWidth+AGif),-AGig);}}
this.RemoveObjectFromMap=function (obj,objLayer){if(obj){var p=obj.parentNode;if(p)
p.removeChild(obj);if(this.CalloutItem&&this.CalloutItem.id==obj.id){this.CalloutItem=null;}} }
this.RemoveAllObjectsFromMap=function (){document.getElementById(this.AGfL).innerHTML='';document.getElementById(AGM[this.AGkE].AGfR.STATIONARY_DIV_ID).innerHTML='';this.TopItemInContainer=-1;this.CalloutItem=null;}
this.RemoveAllObjectsFromMapByClassName=function (AGbL){var AGP=document.getElementById(this.AGfL).childNodes;var AGeC=AGP.length;for (var i=AGeC-1;i>=0;i--){if(typeof AGP[i].className=="string"&&AGP[i].className==AGbL){try{this.RemoveObjectFromMap(AGP[i]);}
catch(err){}}}}
this.GetXYFromCoord=function(latitude,longitude){var pt=new Point(0,0);var AGb1=AGM[this.AGkE].AGfQ.AGjq.GetMapBoundingBox();var AG3=AGb1.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGex=parseFloat( AGew-AGev);var AGeH=parseFloat( AGeG-AGeF);var AGhN=parseFloat(AGew-latitude);var AGhP=parseFloat(longitude-AGeF);var AGgU=AGM[this.AGkE].AGfQ.AGjq.GetMapSize();var height=AGgU.GetHeight();var width=AGgU.GetWidth();var AGhM=Math.round((height*AGhN)/AGex);var AGhW=Math.round((width*AGhP)/AGeH);pt.x=AGhW-Math.abs(AGM[this.AGkE].AGf6.x);pt.y=AGhM-Math.abs(AGM[this.AGkE].AGf6.y);return pt;}
this.AGjr=function(){var AGeC=document.getElementById(this.AGfL).childNodes.length 
var AGP=document.getElementById(this.AGfL).childNodes;for (var i=0;i<AGeC;i++){var AGih=AGP[i].AGif;var AGii=AGP[i].AGig;var pt=this.GetXYFromCoord(AGP[i].Lat,AGP[i].Long);pt.x-=parseInt(AGM[this.AGkE].AGfR.AGhG.offsetLeft,10);pt.y-=parseInt(AGM[this.AGkE].AGfR.AGhG.offsetTop,10);AGP[i].style.left=(pt.x+AGih)+"px";AGP[i].style.top=(pt.y+AGii)+"px";}}}
function CoordMapper(AGkh,AGdL,AGdK){this.AGfb=0.1;this.AGfc=-1;if(typeof AGkh=="string")
 {
this.AGgc=AGkh;this.AGfm=parseInt(AGdL,10);this.AGfk=parseInt(AGdK,10);}
this.AGbv=function(){var AG3=this.AGgc.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGca=this.AGfm/(AGeG-AGeF);var AGcq=this.AGfk/(AGew-AGev);var AGhg=(AGca<AGcq) ? AGca : AGcq;this.AGfc=parseFloat( 111701000.0/(this.AGfb*AGhg) );}
this.AGbu=function(AGg7,AGg9,scale,AGgX,AGgO){var AGhg=parseFloat( 111701000.0/(this.AGfb*scale) );var AGck=AGgX/AGhg;var AGcj=AGgO/AGhg;var AGhh=AGg9-AGck/2;var AGhi=AGg7-AGcj/2;var AGg5=AGg9+AGck/2;var AGg6=AGg7+AGcj/2;return AGhh+","+AGhi+","+AGg5+","+AGg6;}
this.AGbs=function(AGb4,AGgX,AGgO,AGjW,AGjX){AGgX=parseFloat(AGgX);AGgO=parseFloat(AGgO);AGjW=parseFloat(AGjW);AGjX=parseFloat(AGjX);var AG3=AGb4.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGjV=parseFloat((AGjW*(AGeG-AGeF))/AGgX);var AGjU=parseFloat((AGjX*(AGew-AGev))/AGgO);AGeF-=AGjV;AGev+=AGjU;AGeG-=AGjV;AGew+=AGjU;return AGeF+","+AGev+","+AGeG+","+AGew;}
this.AGbt=function(lat,lng,scale,AGgX,AGgO,AGbB,AGmu){var AGl9=this.AGbu(lat,lng,scale,AGgX,AGgO);var AGma=this.AGbs(AGl9,AGgX,AGgO,AGmu.x-AGbB.x,AGmu.y-AGbB.y)
return AGma;}
this.GetScale=function(){this.AGbv();return this.AGfc;}
this.AGdh=function(AGeg){var AG3=this.AGgc.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGes=(111701000.0*(AGeG-AGeF))/(this.AGfb*AGeg);var AGdC=(111701000.0*(AGew-AGev))/(this.AGfb*AGeg);return new Point(AGes,AGdC)}
this.AGcZ=function(AGkA,AGjZ,AGkD,AGj0,AGdX,AGdY){var AGhj=AGkA.split(",",4);var AGhq=parseFloat(AGhj[0]);var AGhn=parseFloat(AGhj[1]);var AGhr=parseFloat(AGhj[2]);var AGho=parseFloat(AGhj[3]);var AGhp=AGhr-AGhq;var AGhm=AGho-AGhn;var AGhu=(AGdX*AGhp)/AGjZ.GetWidth();var AGhv=(AGdY*AGhm)/AGjZ.GetHeight();var AGio=AGkD.split(",",4);var AGix=parseFloat(AGio[0]);var AGiu=parseFloat(AGio[1]);var AGiy=parseFloat(AGio[2]);var AGiv=parseFloat(AGio[3]);var AGiw=AGiy-AGix;var AGit=AGiv-AGiu;var AGec=(AGhu*AGj0.GetWidth())/AGiw;var AGed=(AGhv*AGj0.GetHeight())/AGit;AGec=Math.round(AGec);AGed=Math.round(AGed);return new Point(AGec,AGed);}
this.AGcX=function(AGkA,AGjZ,AGkD,AGj0,AGec,AGed){var AGio=AGkD.split(",",4);var AGix=parseFloat(AGio[0]);var AGiu=parseFloat(AGio[1]);var AGiy=parseFloat(AGio[2]);var AGiv=parseFloat(AGio[3]);var AGiw=AGiy-AGix;var AGit=AGiv-AGiu;var AGiz=(AGec*AGiw)/AGj0.GetWidth();var AGiA=(AGed*AGit)/AGj0.GetHeight();var AGhj=AGkA.split(",",4);var AGhq=parseFloat(AGhj[0]);var AGhn=parseFloat(AGhj[1]);var AGhr=parseFloat(AGhj[2]);var AGho=parseFloat(AGhj[3]);var AGhp=AGhr-AGhq;var AGhm=AGho-AGhn;var AGdX=(AGiz*AGjZ.GetWidth())/AGhp;var AGdY=(AGiA*AGjZ.GetHeight())/AGhm;AGdX=Math.round(AGdX);AGdY=Math.round(AGdY);return new Point(AGdX,AGdY);}
this.AGdb=function(AGkA,AGkD,AGj0){var AGhj=AGkA.split(",",4);var AGhq=parseFloat(AGhj[0]);var AGhn=parseFloat(AGhj[1]);var AGhr=parseFloat(AGhj[2]);var AGho=parseFloat(AGhj[3]);var AGhp=AGhr-AGhq;var AGhm=AGho-AGhn;var AGio=AGkD.split(",",4);var AGix=parseFloat(AGio[0]);var AGiu=parseFloat(AGio[1]);var AGiy=parseFloat(AGio[2]);var AGiv=parseFloat(AGio[3]);var AGiw=AGiy-AGix;var AGit=AGiv-AGiu;var AGef=(AGhp*AGj0.GetWidth())/AGiw;var AGee=(AGhm*AGj0.GetHeight())/AGit;AGef=Math.round(AGef);AGee=Math.round(AGee);return new Size(AGef,AGee);}}
function MapCanvas(AGk,AGiV,AGmd){this.AGkE=AGiV;this.AGhF=AGiV+"_MovingContainer";this.STATIONARY_DIV_ID=AGiV+"_Stationary";this.AGgR=AGiV+"_MapPanel";this.AGgI=AGiV+"_MapContent";this.AGlc=AGiV+"_tileMapDiv";this.AGgV=AGiV+"_map_tiles";this.AGjB=AGiV+"_SatelliteMaptiles";this.AGcm=AGiV+"_DragLayer";this.AGbV=AGiV+"_CrossHair";this.AGmb=AGiV+"_ZoomBarContainer";this.AGbS=AGiV+"_Copyright";this.AGjH=AGiV+"_Scale";this.AGbM=AGiV+"_commIframeMarbil";this.AGj4=AGiV+"_SliderBar";this.AGj2=AGiV+"_SlideControl";this.AGml=AGiV+"_ZoomInButton";this.AGms=AGiV+"_ZoomOutButton";this.AGk4=AGiV+"_TIID";this.AGk3=AGiV+"_TIDID";this.AGjC=AGiV+"_STIID";this.AGlJ=AGiV+"_UserLayer";this.AGG=AGiV+"_Advertise";this.AGiF=AGiV+"_OvMapWrapper";this.AGiD=AGiV+"_OvMapContainer";this.AGiE=AGiV+"_OvMap";this.AGlQ=AGiV+"_viewport";this.AGi6=AGiV+"_PopupMenu";this.AGi7=AGiV+"_StartHere";this.AGi5=AGiV+"_EndHere";this.AGi4=AGiV+"_ClickHere";this.AGl8=AGiV+"_zoomAnimation";this.AGhJ=document.getElementById(AGk.id);this.AGgS=null;this.AGgJ=null;this.AGld=null;this.AGhG=null;this.StationaryDiv=null;this.AGcn=null;this.AGbW=null;this.AGme=null;this.AGH=null;this.AGbT=null;this.AGjI=null;this.AGl7=null;this.AGgS=document.createElement('div');this.AGgS.setAttribute('id',this.AGgR);this.AGgS.setAttribute('align','left');this.AGgS.style.position="relative";this.AGgS.style.width=AGk.offsetWidth;this.AGgS.style.height=AGk.offsetHeight;this.AGgS.style.overflow="hidden";this.AGgS.style.zIndex="0";this.AGgJ=document.createElement('div');this.AGgJ.setAttribute('id',this.AGgI);this.AGgJ.style.position="relative";this.AGgJ.style.left="0px";this.AGgJ.style.top="0px";this.AGgJ.style.overflow="hidden";this.AGgJ.style.zIndex="0";var AGbN=document.createElement('iframe');AGbN.setAttribute('id',this.AGbM);AGbN.setAttribute('name',this.AGbM);AGbN.setAttribute('src',"");AGbN.style.width="1px";AGbN.style.height="1px";AGbN.style.position="absolute";AGbN.style.left="0px";AGbN.style.top="0px";AGbN.style.visibility="hidden";this.AGgJ.appendChild(AGbN);this.AGld=document.createElement('div');this.AGld.setAttribute('id',this.AGlc);this.AGld.style.position="relative";this.AGld.style.left="0px";this.AGld.style.top="0px";this.AGld.style.zIndex="0";var AGgF=document.createElement('div');AGgF.setAttribute('id',this.AGgV);AGgF.style.cursor="pointer";AGgF.style.zIndex="1";AGgF.style.position="relative";AGgF.style.left="0px";AGgF.style.top="0px";this.AGld.appendChild(AGgF);this.AGdI=document.createElement('div');this.AGdI.setAttribute('id',this.AGjB);this.AGdI.style.position="absolute";this.AGdI.style.left="0px";this.AGdI.style.top="0px";this.AGdI.style.zIndex="0";this.AGld.appendChild(this.AGdI);this.AGgJ.appendChild(this.AGld);this.AGhG=document.createElement('div');this.AGhG.setAttribute('id',this.AGhF);this.AGhG.style.position="relative";this.AGhG.style.cursor="pointer";this.AGhG.style.left="0px";this.AGhG.style.top="0px";this.AGhG.style.zIndex="60";this.AGgJ.appendChild(this.AGhG);this.StationaryDiv=document.createElement('div');this.StationaryDiv.setAttribute('id',this.STATIONARY_DIV_ID);this.StationaryDiv.style.position="absolute";this.StationaryDiv.style.cursor="pointer";this.StationaryDiv.style.left="0px";this.StationaryDiv.style.top="0px";this.StationaryDiv.style.zIndex="60";this.AGgJ.appendChild(this.StationaryDiv);this.AGcn=document.createElement('div');this.AGcn.setAttribute('id',this.AGcm);this.AGcn.style.position="absolute";this.AGcn.style.left="0px";this.AGcn.style.top="0px";this.AGcn.style.width="100%";this.AGcn.style.height="100%";this.AGcn.style.cursor="pointer";this.AGcn.style.backgroundColor="Black";this.AGcn.style.opacity="0";this.AGcn.style.filter="alpha(opacity=0)";this.AGcn.style.mozOpacity="0";this.AGcn.style.zIndex="20";this.AGcn.onmouseover="AGM[\'"+this.AGkE+"\'].AGe0=true;"
this.AGgJ.appendChild(this.AGcn);this.AGl7=document.createElement('div');this.AGl7.setAttribute('id',this.AGl8);this.AGl7.style.position="absolute";this.AGl7.style.left="0px";this.AGl7.style.top="0px";this.AGl7.style.width="64px";this.AGl7.style.height="64px";this.AGl7.style.border="2px dashed Red";this.AGl7.style.visibility="hidden";this.AGl7.style.zIndex="10";this.AGgJ.appendChild(this.AGl7);this.AGlK=document.createElement('div');this.AGlK.setAttribute('id',this.AGlJ);this.AGlK.style.position="absolute";this.AGlK.style.left="0px";this.AGlK.style.top="0px";this.AGlK.style.width="100%";this.AGlK.style.height="100%";this.AGlK.style.cursor="auto";this.AGlK.style.backgroundColor="Black";this.AGlK.style.opacity="0";this.AGlK.style.filter="alpha(opacity=0)";this.AGlK.style.mozOpacity="0";this.AGlK.style.zIndex="100";this.AGlK.style.visibility="hidden";this.AGlK.onmousedown=function(ev){var AGeu=this.id.lastIndexOf("_");if(AGeu<0)
return;var AGiW=this.id.substring(0,AGeu);var pt=GetMouseOffset_bd(AGM[AGiW].AGfR.AGgJ,ev);AGM[AGiW].AGgB.push({X:pt.x,Y:pt.y});pt=AGM[AGiW].AGdd(pt)
AGM[AGiW].AGgA.push({Longitude:pt.x,Latitude:pt.y});if(AGM[AGiW].AGgC==AGM[AGiW].SINGLE_POINT){try{AGM[AGiW].AGfR.AGlK.style.visibility="hidden";if(AGM[AGiW].AGgz!=null)
eval(AGM[AGiW].AGgz+"();");}
catch(err){}}}
this.AGgJ.appendChild(this.AGlK);this.AGbW=document.createElement('div');this.AGbW.setAttribute('id',this.AGbV);this.AGbW.style.position="absolute";this.AGbW.style.left="600px";this.AGbW.style.top="350px";this.AGbW.style.zIndex="10";this.AGbW.innerHTML="<img id='"+this.AGbV+"' src='"+AGM[this.AGkE].AGfd+"Images/crossHair.gif' alt='' galleryimg='no'/>";this.AGgJ.appendChild(this.AGbW);var AGmc=30;var AGmr=30;var AGmy=120;var AGmk=30;var AGmm=30;var AGmt=30;if(AGmd=="2"||AGmd=="3"||AGmd=="4"||AGmd=="5"){AGmr=20;AGmk=20;AGmy=114;AGmm=20;AGmt=20;}
if(AGmd=="4"||AGmd=="5"){AGmc=20;}
if(AGmd=="5"){AGmy=120;}
else if(AGmd=="6"){AGmy=140;}
this.AGme=document.createElement('div');this.AGme.setAttribute('id',this.AGmb);this.AGme.style.position="absolute";this.AGme.style.left="10px";this.AGme.style.top="10px";this.AGme.style.width=AGmc+"px";this.AGme.style.zIndex="70";this.AGme.style.textAlign="left";this.AGme.style.cursor="pointer";this.AGme.AGmh=AGmd;this.AGme.AGiX=this.AGkE;this.AGgJ.appendChild(this.AGme);var AGdU=AGM[this.AGkE].AGfd+"zoombar/"+"zb"+AGmd+"/ZoomOut.png";this.AGmq=document.createElement('img');this.AGmq.setAttribute('id',this.AGms);this.AGmq.setAttribute('src',AGdU);this.AGmq.style.position="absolute";this.AGmq.style.left="0px";if(AGmd=="4")
this.AGmq.style.top=AGmr+AGmy+"px";else 
this.AGmq.style.top="0px";this.AGmq.style.width="100%";this.AGmq.style.zIndex="5";this.AGmq.style.height=AGmr+"px";this.AGmq.style.width=AGmt+"px";this.AGmq.AGmh=AGmd;this.AGmq.AGiX=this.AGkE;this.AGme.appendChild(this.AGmq);this.AGmq.onclick=function(ev){ZoomOutButtonClick(this.AGiX,this.AGmh)}
if(AGmd=="2"||AGmd=="3"||AGmd=="4" )
AGdU=AGM[this.AGkE].AGfd+"zoombar/"+"zb"+AGmd+"/scale_13.png";else
AGdU=AGM[this.AGkE].AGfd+"zoombar/"+"zb"+AGmd+"/sliderBack.png";this.AGmx=document.createElement('img');this.AGmx.setAttribute('id',this.AGj4);this.AGmx.setAttribute('src',AGdU);this.AGmx.style.position="absolute";this.AGmx.style.left="0px";this.AGmx.style.top=AGmr+"px";this.AGmx.style.width="100%";this.AGmx.style.height=AGmy+"px";this.AGmx.style.zIndex="5";this.AGmx.AGmh=AGmd;this.AGmx.AGiX=this.AGkE;this.AGme.appendChild(this.AGmx);this.AGmx.onclick=function(ev){ClickSlider(ev,this.AGiX);}
AGdU=AGM[this.AGkE].AGfd+"zoombar/"+"zb"+AGmd+"/ZoomIn.png";this.AGmj=document.createElement('img');this.AGmj.setAttribute('id',this.AGml);this.AGmj.setAttribute('src',AGdU);this.AGmj.style.position="absolute";this.AGmj.style.left="0px";if(AGmd=="4")
this.AGmj.style.top="0px";else
this.AGmj.style.top=AGmr+AGmy+"px";this.AGmj.style.width="100%";this.AGmj.style.height=AGmk+"px";this.AGmj.style.width=AGmm+"px";this.AGmj.style.zIndex="5";this.AGmj.AGmh=AGmd;this.AGmj.AGiX=this.AGkE;this.AGme.appendChild(this.AGmj);this.AGmj.onclick=function(ev){ZoomInButtonClick(this.AGiX,this.AGmh)}
if(!(AGmd=="2"||AGmd=="3"||AGmd=="4")){AGdU=AGM[this.AGkE].AGfd+"zoombar/"+"zb"+AGmd+"/arrow_blue.png";this.AGmz=document.createElement('img');this.AGmz.setAttribute('id',this.AGj2);this.AGmz.setAttribute('src',AGdU);this.AGmz.setAttribute('alt',"");this.AGmz.style.position="absolute";this.AGmz.style.left="50%";this.AGmz.style.top=AGmr+"px";this.AGmz.style.zIndex="10";this.AGmz.AGmh=AGmd;this.AGmz.AGiX=this.AGkE;this.AGmz.onmousedown=MouseBarDown;this.AGmz.onmouseup=MouseBarUp;this.AGmz.onmousemove=SlideControllerMouseMove;this.AGmz.onmouseout=MouseBarOut;this.AGme.appendChild(this.AGmz);}
AGM[this.AGkE].AGfy=AGmy/(AGM[this.AGkE].AGfz-1);this.AGgS.appendChild(this.AGgJ);this.AGiH=null;this.AGlR=null;if(AGM[this.AGkE].AGfl==MAIN_MAP){this.AGiI=document.createElement('div');this.AGiI.setAttribute('id',this.AGiF);this.AGiI.style.position="absolute";this.AGiI.style.right="5px";this.AGiI.style.top="5px";this.AGiI.style.width=AGM[this.AGkE].AGfu+"px";this.AGiI.style.height=AGM[this.AGkE].AGft+"px";if(AGM[this.AGkE].AGeU==true)
this.AGiI.style.visibility="visible";else
this.AGiI.style.visibility="hidden";this.AGiI.style.zIndex="150";this.AGiI.style.background="#FFFFFF";this.AGiI.style.border='1px solid #000000';this.AGiI.style.background='#000000';this.AGiI.style.overflow="hidden";this.AGgS.appendChild(this.AGiI);this.AGg2=document.createElement('img');this.AGg2.setAttribute('src',OM_MINIMIZE_IMG_PATH);this.AGg2.setAttribute('alt',"Minimize");this.AGg2.style.position="absolute";this.AGg2.style.right="0px";this.AGg2.style.top="0px";this.AGg2.setAttribute('width',OM_MAX_MIN_WIDTH);this.AGg2.setAttribute('height',OM_MAX_MIN_HEIGHT);this.AGg2.style.width=OM_MAX_MIN_WIDTH+"px";this.AGg2.style.height=OM_MAX_MIN_HEIGHT+"px";this.AGg2.style.zIndex="10";this.AGg2.status="Minimize";this.AGg2.AGiW=this.AGkE;this.AGg2.onclick=function (ev){if(this.status=="Minimize"){AGM[this.AGiW].AGfQ.AGhd();this.src=OM_MAXIMIZE_IMG_PATH;this.setAttribute('alt',"Maximize");this.status="Maximize";}
else if(this.status=="Maximize"){AGM[this.AGiW].AGfQ.AGgZ();this.src=OM_MINIMIZE_IMG_PATH;this.setAttribute('alt',"Minimize");this.status="Minimize";}}
this.AGiI.appendChild(this.AGg2);this.AGiG=document.createElement('div');this.AGiG.setAttribute('id',this.AGiD);this.AGiG.style.position="absolute";this.AGiG.style.right="0px";this.AGiG.style.top="0px";this.AGiG.style.width=AGM[this.AGkE].AGfu+"px";this.AGiG.style.height=AGM[this.AGkE].AGft+"px";this.AGiG.style.zIndex="5";this.AGiG.style.background="#FFFFFF";this.AGiG.style.overflow="hidden";this.AGiI.appendChild(this.AGiG);this.AGiH=document.createElement('div');this.AGiH.setAttribute('id',this.AGiE);this.AGiH.style.position="absolute";this.AGiH.style.right="0px";this.AGiH.style.top="0px";this.AGiH.style.width=AGM[this.AGkE].AGfu+"px";this.AGiH.style.height=AGM[this.AGkE].AGft+"px";this.AGiH.style.zIndex="5";this.AGiH.style.background="#FFFFFF";this.AGiG.appendChild(this.AGiH);this.AGlR=document.createElement('div');this.AGlR.setAttribute('id',this.AGlQ);this.AGlR.style.position="absolute";this.AGlR.style.left="70px";this.AGlR.style.top="35px";this.AGlR.style.width="115px";this.AGlR.style.height="60px";this.AGlR.style.zIndex="10";this.AGlR.style.backgroundColor="#000000";this.AGlR.style.filter="alpha(opacity=15)";this.AGlR.style.mozOpacity=0.25;this.AGlR.style.opacity=0.25;this.AGlR.style.KhtmlOpacity=0.25;this.AGiG.appendChild(this.AGlR);}
this.AGbT=document.createElement('div');this.AGbT.setAttribute('id',this.AGbS);this.AGbT.style.position="absolute";this.AGbT.style.right="0px";this.AGbT.style.bottom="0px";this.AGbT.style.marginBottom="5px";this.AGbT.style.marginRight="5px";this.AGbT.style.zIndex="0";this.AGbT.style.fontFamily="Arial";this.AGbT.style.fontSize="8pt";this.AGbT.style.fontStyle="normal";this.AGbT.style.fontWeight="normal";this.AGbT.style.textAlign="right";this.AGbT.innerHTML=AGM[this.AGkE].AGgd;this.AGgS.appendChild(this.AGbT);this.AGjI=document.createElement('div');this.AGjI.setAttribute('id',this.AGjH);this.AGjI.style.position="absolute";this.AGjI.style.left="0px";this.AGjI.style.bottom="0px";this.AGjI.style.marginBottom="5px";this.AGjI.style.marginLeft="5px";this.AGjI.style.zIndex="0";this.AGjI.style.fontFamily="Arial";this.AGjI.style.fontSize="8pt";this.AGjI.style.fontStyle="normal";this.AGjI.style.fontWeight="normal";this.AGjI.style.textAlign="left";this.AGjI.innerHTML="";this.AGgS.appendChild(this.AGjI);this.AGhJ.appendChild(this.AGgS);var AGlt=this.AGgS.offsetWidth-parseInt(this.AGbT.style.marginRight,10)-parseInt(this.AGjI.style.marginLeft,10);this.AGbT.style.width=(Math.floor( AGlt*7/11 )-2)+"px";this.AGjI.style.width=(Math.floor(AGlt*4/11)-2)+"px";if(AGM[this.AGkE].AGe5==null||AGM[this.AGkE].AGe5==true){this.AGH=document.createElement('div');this.AGH.setAttribute('id',this.AGG);this.AGH.style.position="absolute";this.AGH.style.left="0px";this.AGH.style.bottom="0px";this.AGH.style.visibility="hidden";this.AGH.style.zIndex="100";this.AGH.style.cursor="pointer";this.AGH.style.backgroundColor="White";this.AGH.link="";this.AGH.onclick=function(ev){window.open(this.link);}
this.AGF=document.createElement('img');this.AGF.setAttribute('src',API_HOST_URL+"Images/white.JPG");this.AGF.setAttribute('alt',"");this.AGF.style.visibility="hidden";this.AGF.style.position="absolute";this.AGF.style.left="0px";this.AGF.style.top="0px";this.AGH.appendChild(this.AGF);this.AGgS.appendChild(this.AGH);}
if(AGM[this.AGkE].AGfl==OVERVIEW_MAP){this.AGbT.style.visibility="hidden";this.AGjI.style.visibility="hidden";this.AGbW.style.visibility="hidden";}
this.AGjR=function(AGlh,AGk5,AGlk,AGk9){var AGbY=parseInt((document.getElementById(this.AGbV).offsetWidth),10);var AGbX=parseInt((document.getElementById(this.AGbV).offsetHeight),10);var AGhY=document.getElementById(this.AGbV);AGhY.style.left=Math.round(((AGlh-1)*AGlk)/2-AGbY/2)+'px';AGhY.style.top=Math.round(((AGk5-1)*AGk9)/2-AGbX/2)+'px';} 
this.AGjs=function (){var AGiR=document.getElementById(this.AGkE);this.AGgJ.style.width=(parseInt(AGiR.offsetWidth) )+"px";if(AGM[this.AGkE].AGe5==null||AGM[this.AGkE].AGe5==true) {this.AGH.style.overflow="hidden";var AGdw=parseInt( 0.15*this.AGhJ.offsetHeight);AGdw=(AGdw<20) ? 20 : AGdw;if(AGdw<30){AGM[this.AGkE].AGff=200;AGM[this.AGkE].AGfe=20;}
else if(AGdw<40){AGM[this.AGkE].AGff=300;AGM[this.AGkE].AGfe=30;}
else if(AGdw<60){AGM[this.AGkE].AGff=400;AGM[this.AGkE].AGfe=40;}
else if(AGdw<70){AGM[this.AGkE].AGff=600;AGM[this.AGkE].AGfe=60;}
else{AGM[this.AGkE].AGff=700;AGM[this.AGkE].AGfe=70;}
this.AGH.style.width=this.AGgJ.style.width;this.AGH.style.height=AGdw+"px";if(AGM[this.AGkE].AGe5==true){this.AGgJ.style.height=(parseInt(this.AGhJ.offsetHeight)-AGM[this.AGkE].AGfe)+"px";this.AGbT.style.bottom=AGdw+"px";this.AGjI.style.bottom=AGdw+"px";}
else
this.AGgJ.style.height=(parseInt(this.AGhJ.offsetHeight))+"px";}
else{this.AGgJ.style.height=(parseInt(AGiR.offsetHeight)-2)+"px";}}}
function AGjq( AGl,AGx,AGb,AGj,AGu,AGm){this.AG2="&BBOX"
this.AGbZ="&CRS"
this.AGcz="&EXCEPTIONS"
this.AGcH="&FORMAT"
this.AGdq="&HEIGHT"
this.AGeA="&LAYERS"
this.AGjp="REQUEST"
this.AGkU="&STYLES"
this.AGk6="&TILECOLUMN"
this.AGlg="&TILEROW"
this.AGln="&TOKEN"
this.AGlN="&VERSION"
this.AGl4="&WIDTH"
this.AGjy="&ROUTING"
this.AGjP="&Service"
this.AGcH="&FORMAT";this.AGlN="&VERSION";this.AGbZ="&CRS";this.AGcy="&AGcx";this.AGlw="&TRANSPERANCY";this.AGlC="&UID";this.FEATUREINFO_TAG="&OPTIONS";this.mapServerUrl=AGl;this.version=AGx;this.crs=AGb;this.AGgQ=AGj;this.AGjv="";this.AGgb=0;this.AGgw=AGu;this.AGgq=AGm;this.AGf9="";this.AGga=new Array();this.m_FeatureInfoParam="";this.AGka=false;this.AGct=false;this.AGjA=false;this.AGcU=function (AGls,AGlr,AGli,AGk7){var req=this.mapServerUrl;req+="?";req+=this.AGjp+"=GetTiledMap2AG";req+=this.AGlN+"="+this.version;req+=this.AGbZ+"="+this.crs;req+=this.AGl4+"="+this.AGgQ.width;req+=this.AGdq+"="+this.AGgQ.height;req+=this.AGeA+"="+this.AGgQ.layers;req+=this.AGkU+"="+this.AGgQ.styles;req+=this.AG2+"=TILE:TOTALEXTENT:"+this.AGgQ.AG1+","
 req+="TOTALTILES:"+AGls+","+AGlr+",";req+="CURRENTTILE:"+AGli+","+AGk7;req+=this.AGcH+"="+this.AGgQ.format
 req+=this.AGcy+"="+this.AGgQ.exceptions
 req+=this.AGlC+"="+this.AGgw;req+=this.AGlw+"="+this.AGgQ.transperency;if(this.AGjA)
req+=this.AGf9;req+=this.m_FeatureInfoParam;return req;}
this.AGbU=function(AGQ){if(AGQ.length<2)
return false;var AGkO=this.AGjy+"="+this.AGgQ.AGjw+"$"+this.AGgQ.AGjx+"$";for (var i=0;i<AGQ.length;i++){if(typeof AGQ[i].Longitude=="undefined"||typeof AGQ[i].Latitude=="undefined")
return false;AGkO+="LATLONG,"+AGQ[i].Longitude+","+AGQ[i].Latitude+"^";}
this.AGf9=AGkO.substring(0,AGkO.length-1);this.AGjA=true;return true;}
this.AGbJ=function(){var AGjt=this.AGjA;this.AGjA=false;this.AGf9="";return AGjt;}
this.AddFeatureSelectionParam=function(strParam){if(this.m_FeatureInfoParam!="&"+strParam){this.m_FeatureInfoParam="&"+strParam;return true;}
return false;}
this.ClearFeatureSelectionParam=function(){if(this.m_FeatureInfoParam!=""){this.m_FeatureInfoParam="";return true;}
return false;}
this.GetJsonDrivingDirectionRequest=function (AGki,routingPoints){if(routingPoints.length<2)
return null;var req=JSON_DrivingDirection_URL;req+="?";req+="op=GetDirectionsJSONSet1";req+="&jsonp="+AGki;req+="&waypoints=";for(var i=0;i<routingPoints.length;i++){if(typeof(routingPoints[i].Latitude)!="number"||typeof(routingPoints[i].Longitude)!="number"){return null;}
if(i!=routingPoints.length-1)
req+=routingPoints[i].Latitude+"|"+routingPoints[i].Longitude+"$";else
req+=routingPoints[i].Latitude+"|"+routingPoints[i].Longitude;}
req+="&RouteLayer="+this.AGgQ.AGjw;req+="&RouteParameter="+this.AGgQ.AGjx;req+="&rnd="+Math.random();return req;}
this.GetMapSize=function (){return this.AGgQ.GetSize();}
this.SetMapSize=function (AGq){this.AGgQ.SetSize(AGq);}
this.GetMapBoundingBox=function (){return this.AGgQ.GetBoundingBox();}
this.SetMapBoundingBox=function (AGa){this.AGgQ.SetBoundingBox(AGa);}} 
function MainMap(AGf,AGn){var AGeu=AGf.lastIndexOf("_");if(AGeu<0)
return;this.AGkE=AGf.substring(0,AGeu);this.AGjq=AGn;this.AGgD=AGf;this.AGfj=0;var i=0;this.AGcJ=new TileList();this.AGlI=new TileList();for(i=0;i<AGM[this.AGkE].AGfo;i++)
this.AGcJ.Add(i);this.AGcI=new TileList();this.AGlH=new TileList();for(i=0;i<AGM[this.AGkE].AGfn;i++)
this.AGcI.Add(i);var AGdG=new Array(AGM[this.AGkE].AGfo);var AGdH=new Array(AGM[this.AGkE].AGfo);for(i=0;i<AGM[this.AGkE].AGfo;i++){AGdG[i]=new Array(AGM[this.AGkE].AGfC-1);AGdH[i]=new Array(AGM[this.AGkE].AGfC-1);}
this.AGda=function(AGg9,AGg7,AGmv,AGjo){var cm=new CoordMapper();var bbox=cm.AGbu(AGg7,AGg9,AGmv,this.AGjq.AGgQ.width,this.AGjq.AGgQ.height);this.AGdn(bbox,"zoom");}
this.AGc9=function(AGjW,AGjX){var cm=new CoordMapper();var bbox=cm.AGbs(this.AGjq.AGgQ.AG1,this.AGjq.AGgQ.width,this.AGjq.AGgQ.height,AGjW,AGjX);this.AGdn(bbox,"pan");}
this.AGdp=function(AGg9,AGg7,AGmw,AGjo){if(AGjo!=AGM[this.AGkE].AGfl)
return;if(AGjo==MAIN_MAP){if(AGM[this.AGkE].AGeU==false)
return;var AGiL=AGM[this.AGkE].AGc0();AGM[this.AGkE].AGfU.CentreAndScale(AGg7,AGg9,AGiL);var AGiJ=AGM[this.AGkE].AGfR.AGiE;this.AGjT(this.AGkE,AGiJ);}
else if(AGjo==OVERVIEW_MAP){var AGhs=AGM[this.AGkE].AGgo;this.AGjT(AGhs,this.AGkE);}}
this.AGdo=function(AGjW,AGjX,AGjo){if(AGjo!=AGM[this.AGkE].AGfl)
return;if(AGjo==MAIN_MAP){var cm=new CoordMapper();var AGhl=this.AGjq.AGgQ;var AGkA=AGhl.AG1;var AGjZ=new Size(AGhl.width,AGhl.height);var AGiJ=AGM[this.AGkE].AGfR.AGiE;var AGis=AGM[AGiJ].AGfQ.AGjq.AGgQ;var AGkD=AGis.AG1;var AGj0=new Size(AGis.width,AGis.height);var AGiK=cm.AGcZ(AGkA,AGjZ,AGkD,AGj0,AGjW,AGjX);AGM[AGiJ].AGfQ.AGiM(AGiK.x,AGiK.y,MAIN_MAP);this.AGjT(this.AGkE,AGiJ);}
else if(AGjo==OVERVIEW_MAP){var cm=new CoordMapper();var AGis=this.AGjq.AGgQ;var AGkD=AGis.AG1;var AGj0=new Size(AGis.width,AGis.height);var AGhs=AGM[this.AGkE].AGgo;var AGhl=AGM[AGhs].AGfQ.AGjq.AGgQ;var AGkA=AGhl.AG1;var AGjZ=new Size(AGhl.width,AGhl.height);var AGht=cm.AGcX(AGkA,AGjZ,AGkD,AGj0,AGjW,AGjX);AGM[AGhs].AGfQ.AGiM(AGht.x,AGht.y,OVERVIEW_MAP);this.AGjT(AGhs,this.AGkE);}}
this.AGjT=function(AGhk,AGir){var AGis=AGM[AGir].AGfQ.AGjq.AGgQ;var AGkD=AGis.AG1;var AGj0=new Size(AGis.width,AGis.height);var AGkA=AGM[AGhk].AGfQ.AGde();var AGhj=AGkA.split(",",4);var AGhq=parseFloat(AGhj[0]);var AGhn=parseFloat(AGhj[1]);var AGhr=parseFloat(AGhj[2]);var AGho=parseFloat(AGhj[3]);var cm=new CoordMapper();var AGl0=cm.AGdb(AGkA,AGkD,AGj0);var AGlU=document.getElementById(AGM[AGhk].AGfR.AGlQ);AGlU.style.width=parseInt(AGl0.GetWidth())+"px";AGlU.style.height=parseInt(AGl0.GetHeight())+"px";var AGlS=AGM[AGir].GetPixelFromLatLong(AGho,AGhq);AGlU.style.left=parseInt(AGlS.x)+"px";AGlU.style.top=parseInt(AGlS.y)+"px";}
this.AGdn=function(bbox,AGiB){this.SetBoundingBox(bbox);if(AGM[this.AGkE].AGeY)
AGM[this.AGkE].AGe2=true;if(AGM[this.AGkE].AGeT)
AGM[this.AGkE].AGjG.SetTiles(bbox,this.AGjq.AGgQ.width,this.AGjq.AGgQ.height);AGiB=AGiB.toLowerCase()
if(AGiB=="zoom"){if(AGM[this.AGkE].AGf0!=null)
clearTimeout(AGM[this.AGkE].AGf0);this.AGc6();AGM[this.AGkE].AGfS.AGjr();}
else if (AGiB=="pan")
this.AGc5();else 
return;AGM[this.AGkE].AGeZ=true;AGM[this.AGkE].SetScaleContent();AGM[this.AGkE].AGcA();AGM[this.AGkE].AGcC();}
this.ZoomToBoundingBox=function(AG4,AGjo){var AGgX=parseInt(this.AGjq.GetMapSize().GetWidth(),10);var AGgO=parseInt(this.AGjq.GetMapSize().GetHeight(),10);var cm=new CoordMapper(AG4,AGgX,AGgO);var AGmv=Math.round(cm.GetScale());AGmv=AGM[this.AGkE].AGcY(AGmv);var AGha=AGM[this.AGkE].AGcN(AG4);this.AGmA(AGha.longitude,AGha.latitude,AGmv,AGjo);}
this.AGmA=function(longitude,latitude,scale,AGjo){var AGd4=0;for(i=0;i<AGM[this.AGkE].AGeR.length;i++){if(AGM[this.AGkE].AGeR[i]==scale){AGd4=i;break;}}
if(AGM[this.AGkE].AGeY&&AGM[this.AGkE].AGfv!=AGM[this.AGkE].AGeR[AGd4])
AGM[this.AGkE].AGe7=true;AGM[this.AGkE].AGfv=AGM[this.AGkE].AGeR[AGd4];AGM[this.AGkE].AGfh=AGd4;MoveZoomSlideDown(AGM[this.AGkE].AGfh,this.AGkE);if(AGM[this.AGkE].AGfI==0){AGM[this.AGkE].AGfI++;this.AGj7(longitude,latitude,scale,this.AGkE);}
else{this.AGbE();this.AGj7(longitude,latitude,scale,this.AGkE);}
this.AGda(longitude,latitude,scale,AGjo);this.AGdp(longitude,latitude,AGd4,AGjo);} 
this.AGj7=function(longitude,latitude,scale,AGiW){var i,j;var AGbb=BrowserDetect.browser=="Explorer"&&BrowserDetect.version<7&&BrowserDetect.version>=5.5;var AGcK=GetDoubleClickPoint(longitude,latitude,AGiW);var AGkh=AGM[AGiW].AGfQ.AGjq.GetMapBoundingBox();var AGgT=AGM[AGiW].AGfQ.AGjq.GetMapSize();var cm=new CoordMapper(AGkh,AGgT.width,AGgT.height);var pt=cm.AGdh(scale);var AGjF=new Point(pt.x,pt.y);AGjF.x=AGjF.x/AGgT.width;AGjF.y=AGjF.y/AGgT.height;var AGhT=Math.round(pt.x/AGM[AGiW].AGfC);var AGhR=Math.round(pt.y/AGM[AGiW].AGfE);var tx=AGcK.x-Math.abs(AGM[AGiW].AGf6.x)-parseInt(AGM[AGiW].AGfR.AGld.style.left,10);var ty=AGcK.y-Math.abs(AGM[AGiW].AGf6.y)-parseInt(AGM[AGiW].AGfR.AGld.style.top,10);AGM[AGiW].AGf6.x=Math.round(-AGM[AGiW].AGfG/2);AGM[AGiW].AGf6.y=Math.round(-AGM[AGiW].AGfD/2);AGM[AGiW].AGfR.AGld.style.left=AGM[AGiW].AGf6.x+"px";AGM[AGiW].AGfR.AGld.style.top=AGM[AGiW].AGf6.y+"px";var AGbB=AGM[AGiW].AGcP();for(i=0;i<AGM[AGiW].AGfQ.AGlI.length;i++){var AGd3=AGM[AGiW].AGfQ.AGlI.items[i];var AGdP=document.getElementById(AGM[AGiW].AGfR.AGk4+AGd3);var l1=tx-parseInt(AGdP.style.left,10);var t1=ty-parseInt(AGdP.style.top,10);var l2=Math.round(AGhT*l1/AGM[AGiW].AGfG);var t2=Math.round(AGhR*t1/AGM[AGiW].AGfD);var AGhO=AGbB.x-l2;var AGhU=AGbB.y-t2;AGdP.AGjf=AGhO;AGdP.AGjg=AGhU;AGdP.style.left=AGhO+"px";AGdP.style.top=AGhU+"px";AGdP.style.width=AGhT+"px";AGdP.style.height=AGhR+"px";AGdP.style.zIndex=AGM[AGiW].AGfi;if(AGbb){var AGch=document.getElementById(AGM[AGiW].AGfR.AGk3+AGd3);AGch.style.left=AGdP.style.left;AGch.style.top=AGdP.style.top;AGch.style.width=AGdP.style.width;AGch.style.height=AGdP.style.height;AGch.style.zIndex=AGdP.style.zIndex;}}
for(i=0;i<AGM[AGiW].AGfQ.AGlH.length;i++){var AGd3=AGM[AGiW].AGfQ.AGlH.items[i];var AGdP=document.getElementById(AGM[AGiW].AGfR.AGjC+AGd3);var AGin=parseInt(AGdP.style.width,10);var AGim=parseInt(AGdP.style.height,10);var AGhT=Math.round(AGjF.x*AGin );var AGhR=Math.round(AGjF.y*AGim );var l1=tx-parseInt(AGdP.style.left,10);var t1=ty-parseInt(AGdP.style.top,10);var l2=Math.round(AGhT*l1/AGin);var t2=Math.round(AGhR*t1/AGim);var AGhO=AGbB.x-l2;var AGhU=AGbB.y-t2;AGdP.AGjf=AGhO;AGdP.AGjg=AGhU;AGdP.style.left=AGhO+"px";AGdP.style.top=AGhU+"px";AGdP.style.width=AGhT+"px";AGdP.style.height=AGhR+"px";AGdP.style.zIndex=AGM[AGiW].AGjG.AGfi;}}
this.AGbE=function(){this.AGcJ.RemoveAll();this.AGlI.RemoveAll();AGM[this.AGkE].AGe8=false;var i;for(i=0;i<AGM[this.AGkE].AGfo;i++){var AGk8=document.getElementById(AGM[this.AGkE].AGfR.AGk4+i);if( AGk8.zoom=="0"&&AGk8.style.width==AGM[this.AGkE].AGfG+"px"&&AGk8.style.height==AGM[this.AGkE].AGfD+"px"&&this.AGen(i) )
this.AGlI.Add(i);else{AGk8.src="";AGk8.style.width=AGM[this.AGkE].AGfG+"px";AGk8.style.height=AGM[this.AGkE].AGfD+"px";AGk8.AGjf=-100000;AGk8.AGjg=-100000;AGk8.style.left=-100000+"px";AGk8.style.top=-100000+"px";AGk8.style.zIndex=AGM[this.AGkE].AGfH;AGk8.zoom="0";this.AGcJ.Add(i);}}}
function GetDoubleClickPoint(longitude,latitude,AGiW){var AGb1=AGM[AGiW].AGfQ.AGjq.GetMapBoundingBox();var AG3=AGb1.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var AGex=parseFloat(AGew-AGev);var AGeH=parseFloat(AGeG-AGeF);var px=Math.round(AGM[AGiW].AGfG*AGM[AGiW].AGfC*(longitude-AGeF)/AGeH);var py=Math.round(AGM[AGiW].AGfD*AGM[AGiW].AGfE*(AGew-latitude)/AGex);return new Point(px,py);}
this.AGjn=function(){var AGkT=this.AGde();var AGha=AGM[this.AGkE].AGcN(AGkT);var AGdz=AGM[this.AGkE].AGfh;if(typeof AGdz!="number")
AGdz=0;else if (AGdz<0)
AGdz=0;else if(AGdz>=AGM[this.AGkE].AGeR.length)
AGdz=AGM[this.AGkE].AGeR.length-1;var AGb5=AGM[this.AGkE].AGeR[AGdz];this.AGmA(AGha.longitude,AGha.latitude,AGb5,AGM[this.AGkE].AGfl);}
this.Pan=function(AGjW,AGjX,AGjo){var AGhQ;AGhQ=this.AGdg(AGjW,AGjX);if(AGhQ.x!=0||AGhQ.y!=0){AGM[this.AGkE].AGeZ=false;this.AGc9(AGhQ.x,AGhQ.y);}
this.AGdo(AGjW,AGjX,AGjo);if(AGM[this.AGkE].AGeY)
AGM[this.AGkE].AGfV.AGcB();}
this.AGiM=function(AGjW,AGjX,AGjo){AGM[this.AGkE].AGfR.AGld.style.left=( parseInt(AGM[this.AGkE].AGfR.AGld.offsetLeft,10)+AGjW)+"px";AGM[this.AGkE].AGfR.AGld.style.top=( parseInt(AGM[this.AGkE].AGfR.AGld.offsetTop,10)+AGjX)+"px";AGM[this.AGkE].AGfR.AGhG.style.left=( parseInt(AGM[this.AGkE].AGfR.AGhG.offsetLeft,10)+AGjW)+"px";AGM[this.AGkE].AGfR.AGhG.style.top=( parseInt(AGM[this.AGkE].AGfR.AGhG.offsetTop,10)+AGjX)+"px";this.Pan(AGjW,AGjX,AGjo);}
this.AGc5=function(){var AGbl=(BrowserDetect.browser=="Opera");var AGbo=(BrowserDetect.browser=="Safari");var AGgy=AGM[this.AGkE].AGfE;var AGgx=AGM[this.AGkE].AGfC;for (var i=0;i<AGM[this.AGkE].AGfE;i++){for (var j=0;j<AGM[this.AGkE].AGfC;j++){var pt=new Point(j*AGM[this.AGkE].AGfG,i*AGM[this.AGkE].AGfD)
if (!this.AGek(pt)){var AGhS=this.AGc8();AGM[this.AGkE].AGeQ.push(AGhS);requestString=this.AGjq.AGcU(AGgy,AGgx,i,j);var AGle=parseInt(AGM[this.AGkE].AGfR.AGld.style.left,10);var AGlf=parseInt(AGM[this.AGkE].AGfR.AGld.style.top,10);var AGjf=Math.floor(j*AGM[this.AGkE].AGfG-AGle+AGM[this.AGkE].AGf6.x);var AGjg=Math.floor(i*AGM[this.AGkE].AGfD-AGlf+AGM[this.AGkE].AGf6.y);document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).AGjf=AGjf;document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).AGjg=AGjg;document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).zoom="0";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.width=AGM[this.AGkE].AGfG+"px";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.height=AGM[this.AGkE].AGfD+"px";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.zIndex=AGM[this.AGkE].AGfH;if(AGbl||AGbo)
document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).src=API_HOST_URL+INVALID_IMG_PATH;document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).src=requestString;}}} }
this.AGc6=function(){AGM[this.AGkE].AGeQ=new Array();AGM[this.AGkE].AGfF=0;var AGlb=new Array();var AGgy=AGM[this.AGkE].AGfE;var AGgx=AGM[this.AGkE].AGfC;var AGbl=(BrowserDetect.browser=="Opera");var AGbo=(BrowserDetect.browser=="Safari");for (var i=0;i<AGM[this.AGkE].AGfE;i++){for (var j=0;j<AGM[this.AGkE].AGfC;j++){var pt=new Point(j*AGM[this.AGkE].AGfG,i*AGM[this.AGkE].AGfD)
var AGhS=this.AGc8();AGM[this.AGkE].AGeQ.push(AGhS);AGM[this.AGkE].AGfF++;requestString=this.AGjq.AGcU(AGgy,AGgx,i,j);var AGle=parseInt(AGM[this.AGkE].AGfR.AGld.style.left,10);var AGlf=parseInt(AGM[this.AGkE].AGfR.AGld.style.top,10);var AGjf=Math.floor(j*AGM[this.AGkE].AGfG-AGle+AGM[this.AGkE].AGf6.x);var AGjg=Math.floor(i*AGM[this.AGkE].AGfD-AGlf+AGM[this.AGkE].AGf6.y);document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).zoom="1";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).AGjf=AGjf;document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).AGjg=AGjg;document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.left="-100000px";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.top="-100000px";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.width=AGM[this.AGkE].AGfG+"px";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.height=AGM[this.AGkE].AGfD+"px";document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).style.zIndex=AGM[this.AGkE].AGfH;if(AGbl||AGbo)
document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).src=API_HOST_URL+INVALID_IMG_PATH;document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGhS).src=requestString;}} 
AGM[this.AGkE].AGe8=true;}
this.SetBoundingBox=function(bbox){this.AGjq.SetMapBoundingBox(bbox);} 
this.AGdg=function(AGei,AGej){var pt=new Point(0,0);if (AGei>=0){AGei+=AGM[this.AGkE].AGf6.x;if (AGei>0)
pt.x=AGei/Math.abs(AGei)*(Math.floor(Math.abs(AGei)/(AGM[this.AGkE].AGfG+1))+1)*AGM[this.AGkE].AGfG;AGM[this.AGkE].AGf6.x=-(pt.x-AGei);}
else{AGei+=(AGM[this.AGkE].AGfG+AGM[this.AGkE].AGf6.x);if (AGei<0)
pt.x=AGei/Math.abs(AGei)*(Math.floor(Math.abs(AGei)/(AGM[this.AGkE].AGfG+1))+1)*AGM[this.AGkE].AGfG;AGM[this.AGkE].AGf6.x=-(AGM[this.AGkE].AGfG+(pt.x-AGei));}
if (AGej>=0){AGej+=AGM[this.AGkE].AGf6.y;if (AGej>0)
pt.y=AGej/Math.abs(AGej)*(Math.floor(Math.abs(AGej)/(AGM[this.AGkE].AGfD+1))+1)*AGM[this.AGkE].AGfD;AGM[this.AGkE].AGf6.y=-(pt.y-AGej);}
else{AGej+=(AGM[this.AGkE].AGfD+AGM[this.AGkE].AGf6.y);if (AGej<0)
pt.y=AGej/Math.abs(AGej)*(Math.floor(Math.abs(AGej)/(AGM[this.AGkE].AGfD+1))+1)*AGM[this.AGkE].AGfD;AGM[this.AGkE].AGf6.y=-(AGM[this.AGkE].AGfD+(pt.y-AGej));}
return pt;} 
this.AGek=function(pt){var AGle=parseInt(AGM[this.AGkE].AGfR.AGld.style.left,10);var AGlf=parseInt(AGM[this.AGkE].AGfR.AGld.style.top,10);if(AGM[this.AGkE].AGe8!=true){for(i=0;i<AGM[this.AGkE].AGfQ.AGlI.length;i++){var AGd3=AGM[this.AGkE].AGfQ.AGlI.items[i];var left=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGd3).AGjf,10)+AGle);var width=AGM[this.AGkE].AGfG;var top=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGd3).AGjg,10)+AGlf);var height=AGM[this.AGkE].AGfD;if ( (pt.x>left&&pt.x<left+width)&&(pt.y>top&&pt.y<top+height)) 
return true;}}
else{var AGlj=AGM[this.AGkE].AGeQ;for(var i=0;i<AGlj.length;i++){var AGd3=AGlj[i];var left=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGd3).AGjf,10)+AGle);var width=AGM[this.AGkE].AGfG;var top=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGd3).AGjg,10)+AGlf);var height=AGM[this.AGkE].AGfD;if ( (pt.x>left&&pt.x<left+width)&&(pt.y>top&&pt.y<top+height)) 
return true;}}
return false;}
this.AGc8=function(){var AGhS=this.AGcJ.AGi3();if(AGhS!=null){this.AGlI.Add(AGhS);return AGhS;}
else{AGhS=AGM[this.AGkE].AGc1();if(AGhS<0){for (var i=0;i<AGM[this.AGkE].AGfo;i++){var w=parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+i).style.width,10);var h=parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+i).style.height,10);if(w!=AGM[this.AGkE].AGfG||h!=AGM[this.AGkE].AGfD)
return i;}}
return AGhS;}}
this.AGc7=function(AGdE,AGdV,AGdN,AGdW,AGdO){var AGhS=this.AGcI.AGi3();if(AGhS!=null){this.AGlH.Add(AGhS);return AGhS;}
else{AGhS=AGM[this.AGkE].AGc2(AGdE,AGdV,AGdN,AGdW,AGdO);return AGhS;}}
this.AGem=function(AGeq){var AGl3=0;var AGlT=0;var AGlM=parseInt(AGM[this.AGkE].AGfR.AGgJ.style.height,10)+AGl3;var AGl2=parseInt(AGM[this.AGkE].AGfR.AGgJ.style.width,10)+AGlT;var AGlm=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).AGjf,10)+parseInt(AGM[this.AGkE].AGfR.AGld.style.left,10) );var AGlB=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).AGjg,10)+parseInt(AGM[this.AGkE].AGfR.AGld.style.top,10) );var width=parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).style.width,10);var height=parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).style.height,10);var AGbm=true;if (((AGlm+width)<AGlT)||(AGlm>AGl2)||((AGlB+height)<AGl3)||(AGlB>AGlM))
AGbm=false;return AGbm;}
this.AGen=function(AGeq){var AGl3=0;var AGlT=0;var AGlM=parseInt(AGM[this.AGkE].AGfR.AGgJ.style.height,10)+AGl3;var AGl2=parseInt(AGM[this.AGkE].AGfR.AGgJ.style.width,10)+AGlT;var AGlm=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).style.left,10)+parseInt(AGM[this.AGkE].AGfR.AGld.style.left,10) );var AGlB=parseInt ( parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).style.top,10)+parseInt(AGM[this.AGkE].AGfR.AGld.style.top,10) );var width=parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).style.width,10);var height=parseInt(document.getElementById(AGM[this.AGkE].AGfR.AGk4+AGeq).style.height,10);var AGbm=true;if (((AGlm+width)<AGlT)||(AGlm>AGl2)||((AGlB+height)<AGl3)||(AGlB>AGlM)){AGbm=false;}
return AGbm;}
this.AGdf=function(){return new Size(Math.round(AGM[this.AGkE].AGfG*(AGM[this.AGkE].AGfC-1)),Math.round(AGM[this.AGkE].AGfD*(AGM[this.AGkE].AGfE-1)))}
this.AGcT=function(){return this.AGjq.GetMapSize();}
this.AGde=function(){var AGcE=this.AGcT();var pt=new Point (0,0);pt.x=Math.abs(AGM[this.AGkE].AGf6.x);pt.y=Math.abs(AGcE.GetHeight()-(AGM[this.AGkE].AGfD+AGM[this.AGkE].AGf6.y));var AGey=AGM[this.AGkE].GetLatLongFromPixel(pt);pt.x=Math.abs(AGcE.GetWidth()-(AGM[this.AGkE].AGfG+AGM[this.AGkE].AGf6.x));pt.y=Math.abs(AGM[this.AGkE].AGf6.y);var AGez=AGM[this.AGkE].GetLatLongFromPixel(pt);return (""+AGey.x+","+AGey.y+","+AGez.x+","+AGez.y);}
this.AGhd=function(){if(AGM[this.AGkE].AGfT!=null)
clearTimeout(AGM[this.AGkE].AGfT);var iStep=30;var AGd1=Math.floor(-1*AGM[this.AGkE].AGfu/iStep);var AGd2=Math.floor(-1*AGM[this.AGkE].AGft/iStep);AGd1=(AGd1>=0) ?-1 : AGd1;AGd2=(AGd2>=0) ?-1 : AGd2;this.AGg3(OM_MAX_MIN_WIDTH,OM_MAX_MIN_HEIGHT,AGd1,AGd2);}
this.AGgZ=function(){if(AGM[this.AGkE].AGfT!=null)
clearTimeout(AGM[this.AGkE].AGfT);var iStep=30;var AGd1=Math.ceil( AGM[this.AGkE].AGfu/iStep);var AGd2=Math.ceil( AGM[this.AGkE].AGft/iStep);AGd1=(AGd1<=0) ? 1 : AGd1;AGd2=(AGd2<=0) ? 1 : AGd2;this.AGg3(AGM[this.AGkE].AGfu,AGM[this.AGkE].AGft,AGd1,AGd2);}
this.AGjS=function(AGes,AGdC){var AGip=document.getElementById(AGM[this.AGkE].AGfR.AGiF);AGip.style.width=AGes+"px";AGip.style.height=AGdC+"px";}
this.AGg3=function(AGep,AGeo,AGdZ,AGd0){var AGh5=document.getElementById(AGM[this.AGkE].AGfR.AGiF);var cw=parseInt(AGh5.style.width,10);var ch=parseInt(AGh5.style.height,10);if(AGdZ>0||AGd0>0) 
 {
var AGA=0;var AGB=0;if(cw+AGdZ<=AGep)
AGA=AGdZ;else
AGA=AGep-cw;if(ch+AGd0<=AGeo)
AGB=AGd0;else
AGB=AGeo-ch;var AGhV=cw+AGA;var AGhL=ch+AGB;AGh5.style.width=AGhV+"px";AGh5.style.height=AGhL+"px";if(AGhV<AGep||AGhL<AGeo)
AGM[this.AGkE].AGfT=setTimeout("AGM['"+this.AGkE+"'].AGfQ.AGg3("+AGep+","+AGeo+","+AGdZ+","+AGd0+")",1);else
AGM[this.AGkE].AGfT=null;}
else if(AGdZ<0||AGd0<0)
 {
var AGA=0;var AGB=0;if(cw+AGdZ>=AGep)
AGA=AGdZ;else
AGA=AGep-cw;if(ch+AGd0>=AGeo)
AGB=AGd0;else
AGB=AGeo-ch;var AGhV=cw+AGA;var AGhL=ch+AGB;AGh5.style.width=AGhV+"px";AGh5.style.height=AGhL+"px";if(AGhV>AGep||AGhL>AGeo)
AGM[this.AGkE].AGfT=setTimeout("AGM['"+this.AGkE+"'].AGfQ.AGg3("+AGep+","+AGeo+","+AGdZ+","+AGd0+")",1);else
AGM[this.AGkE].AGfT=null;}}
this.AGcO=function(){var bbox=this.AGde();return AGM[this.AGkE].AGcN(bbox);}
this.ResizeMap=function(){var AGjJ=AGM[this.AGkE].AGfh;var AGmv=AGM[this.AGkE].AGeR[AGjJ];var AGbA=this.AGcO();var AGiR=document.getElementById(this.AGkE);AGM[this.AGkE].AGfR.AGgS.style.width=AGiR.offsetWidth+"px";AGM[this.AGkE].AGfR.AGgS.style.height=AGiR.offsetHeight+"px";AGM[this.AGkE].AGfR.AGjs();var AGgG=parseInt((AGM[this.AGkE].AGfR.AGgJ.offsetWidth),10);var AGgE=parseInt((AGM[this.AGkE].AGfR.AGgJ.offsetHeight),10);AGgG=AGgG/(AGM[this.AGkE].AGfC-1)*(AGM[this.AGkE].AGfC);AGgE=AGgE/(AGM[this.AGkE].AGfE-1)*(AGM[this.AGkE].AGfE);AGM[this.AGkE].AGfD=Math.round(AGgE/AGM[this.AGkE].AGfE);AGM[this.AGkE].AGfG=Math.round(AGgG/AGM[this.AGkE].AGfC);AGM[this.AGkE].AGfQ.AGjq.AGgQ.width=Math.round(AGM[this.AGkE].AGfG*AGM[this.AGkE].AGfC);AGM[this.AGkE].AGfQ.AGjq.AGgQ.height=Math.round(AGM[this.AGkE].AGfD*AGM[this.AGkE].AGfE);AGM[this.AGkE].AGfR.AGjR(AGM[this.AGkE].AGfE,AGM[this.AGkE].AGfC,AGM[this.AGkE].AGfG,AGM[this.AGkE].AGfD);var AGgH=AGM[this.AGkE].AGfR;var AGlt=AGgH.AGgS.offsetWidth-parseInt(AGgH.AGbT.style.marginRight,10)-parseInt(AGgH.AGjI.style.marginLeft,10);AGgH.AGbT.style.width=(Math.floor( AGlt*7/11)-2)+"px";AGgH.AGjI.style.width=(Math.floor(AGlt*4/11)-2)+"px";AGM[this.AGkE].AGfQ.AGmA(AGbA.longitude,AGbA.latitude,AGmv,AGM[this.AGkE].AGfl);AGM[this.AGkE].AGcL();}}
function PopupMenu( AGkE,AGkx,AGb7){this.AGkE=AGkE;this.AGkH="Default";document.getElementById(AGkE).oncontextmenu=function (ev){return false;}
this.AGi6=this.AGkE+"_PopupMenu";this.AGja=document.createElement('div');this.AGja.setAttribute('id',this.AGi6);this.AGja.style.position="absolute";this.AGja.style.zIndex="75";if(AGb7==null||typeof AGb7=='undefined'){this.AGkH="Default";this.AGh9=null;this.AGh4=null;this.AGi7=this.AGkE+"_StartHere";this.AGi5=this.AGkE+"_EndHere";this.AGi4=this.AGkE+"_Clear";this.AGhX="#D2D2B4";this.AGjN="#FFFFFF";this.AGkc=null;this.AGcv=null;this.AGja.style.width="120px";if(BrowserDetect.browser=="Explorer")
this.AGja.style.height="63px";else
this.AGja.style.height="60px";this.AGja.style.textAlign="center";this.AGja.style.cursor="default";this.AGja.style.backgroundColor="#000000";this.AGja.AGiX=this.AGkE;this.AGja.style.borderLeft='1px solid #000000';this.AGja.style.borderTop='1px solid #000000';this.AGja.style.borderRight='2px solid #000000';this.AGja.style.borderBottom='2px solid #000000';this.AGja.onmouseout=function(ev){AGM[this.AGiX].m_objPopupMenu.AGbH();}
this.AGje=document.createElement('div');this.AGje.setAttribute('id',this.AGi7);this.AGje.style.position="absolute";this.AGje.style.left="0px";this.AGje.style.top="0px";this.AGje.style.width="100%";this.AGje.style.height="20px";this.AGje.style.backgroundColor=this.AGhX;this.AGje.innerHTML="Start Here";this.AGje.AGiX=this.AGkE;this.AGje.onmouseover=function(ev){AGM[this.AGiX].m_objPopupMenu.AGjO();}
this.AGje.onclick=function(ev){AGM[this.AGiX].m_objPopupMenu.AGkb();}
this.AGja.appendChild(this.AGje);this.AGi9=document.createElement('div');this.AGi9.setAttribute('id',this.AGi5);this.AGi9.style.position="absolute";this.AGi9.style.left="0px";this.AGi9.style.top="20px";this.AGi9.style.width="100%";this.AGi9.style.height="20px";this.AGi9.style.backgroundColor=this.AGhX;this.AGi9.innerHTML="End Here";this.AGi9.AGiX=this.AGkE;this.AGi9.onmouseover=function(ev){AGM[this.AGiX].m_objPopupMenu.AGjM();}
this.AGi9.onclick=function(ev){AGM[this.AGiX].m_objPopupMenu.AGcu();}
this.AGja.appendChild(this.AGi9);this.AGi8=document.createElement('div');this.AGi8.setAttribute('id',this.AGi4);this.AGi8.style.position="absolute";this.AGi8.style.left="0px";this.AGi8.style.top="40px";this.AGi8.style.width="100%";this.AGi8.style.height="20px";this.AGi8.style.backgroundColor=this.AGhX;this.AGi8.innerHTML="Clear";this.AGi8.AGiX=this.AGkE;this.AGi8.onmouseover=function(ev){AGM[this.AGiX].m_objPopupMenu.AGjL();}
this.AGi8.onclick=function(ev){AGM[this.AGiX].m_objPopupMenu.AGbG();}
this.AGja.appendChild(this.AGi8);this.AGbH=function(){this.AGja.style.backgroundColor=this.AGhX;this.AGje.style.backgroundColor=this.AGhX;this.AGi9.style.backgroundColor=this.AGhX;this.AGi8.style.backgroundColor=this.AGhX;}
this.AGjO=function(){this.AGbH();this.AGje.style.backgroundColor=this.AGjN;}
this.AGjM=function(){this.AGbH();this.AGi9.style.backgroundColor=this.AGjN;}
this.AGjL=function(){this.AGbH();this.AGi8.style.backgroundColor=this.AGjN;}
this.AGkb=function(){this.AGdr();this.AGh9=new Object();this.AGh9.Latitude=AGM[this.AGkE].AGf8.Latitude;this.AGh9.Longitude=AGM[this.AGkE].AGf8.Longitude;this.AGbK();this.AGiC=document.createElement("img");this.AGiC.src=AGM[this.AGkE].AGfd+"Images/start.png";this.SetRoutingImage(this.AGiC,this.AGh9);this.AGiZ();}
this.AGcu=function(){this.AGdr();this.AGh4=new Object();this.AGh4.Latitude=AGM[this.AGkE].AGf8.Latitude;this.AGh4.Longitude=AGM[this.AGkE].AGf8.Longitude;this.AGbF();this.AGb9=document.createElement("img");this.AGb9.src=AGM[this.AGkE].AGfd+"Images/end.png";this.SetRoutingImage(this.AGb9,this.AGh4);this.AGiZ();}
this.AGbG=function(){this.AGdr();this.AGh9=null;this.AGh4=null;this.AGbK();this.AGbF();AGM[this.AGkE].DrivingDirections.Clear();}
this.SetRoutingImage=function(AGdF,AGbR){var AGih=-14;var AGii=-32;var layer=document.getElementById(AGM[this.AGkE].AGfR.AGhF);AGM[this.AGkE].AGfS.AGD(AGdF,AGbR.Latitude,AGbR.Longitude,AGih,AGii,layer);AGdF.style.visibility="visible";}
this.AGbK=function(){if(this.AGiC!=null){try{AGM[this.AGkE].AGfS.RemoveObjectFromMap(this.AGiC);}
catch(err){}
this.AGiC=null;}}
this.AGbF=function(){if(this.AGb9!=null){try{AGM[this.AGkE].AGfS.RemoveObjectFromMap(this.AGb9);}
catch(err){}
this.AGb9=null;}}
this.AGiZ=function(){if(this.AGh9==null||this.AGh4==null)
return;this.AGbK();this.AGbF();AGM[this.AGkE].DrivingDirections.SetOrigin(this.AGh9.Latitude,this.AGh9.Longitude);AGM[this.AGkE].DrivingDirections.SetDestination(this.AGh4.Latitude,this.AGh4.Longitude);this.AGh9=null;this.AGh4=null;AGM[this.AGkE].DrivingDirections.DrawRoute();}}
else{this.AGkH="Customized";this.AGja.appendChild(AGb7);}
this.AGgJ=document.getElementById(AGkx);this.AGgJ.appendChild(this.AGja);this.AGgN=parseInt(this.AGgJ.offsetWidth,10);this.AGgK=parseInt(this.AGgJ.offsetHeight,10);if(this.AGkH=="Default"){this.AGjd=parseInt(this.AGja.offsetWidth,10);this.AGjc=parseInt(this.AGja.offsetHeight,10);}
else{this.AGjd=parseInt(AGb7.offsetWidth,10);this.AGjc=parseInt(AGb7.offsetHeight,10);}
this.AGdr=function(){this.AGja.style.visibility="hidden";}
this.AGjY=function(AGi1,AGi2){if(this.AGkH=="Default") 
this.AGbH();if(AGi1+this.AGjd>this.AGgN)
AGi1-=this.AGjd;if(AGi2+this.AGjc>this.AGgK)
AGi2-=this.AGjc;this.AGja.style.left=AGi1+"px";this.AGja.style.top=AGi2+"px";this.AGja.style.visibility="visible";}
this.AGdr();}
function DrivingDirection(AGr){this.AGkE=AGr;this.AGh9=null;this.AGh4=null;this.AGjz=new Array();this.AGiC=null;this.AGb9=null;this.AGkI=null;this.AGh2=null;this.AGkl=null;this.AGh3=null;this.SetOrigin=function(Latitude,Longitude){if(typeof Latitude!="number"||typeof Longitude!="number"){throw "The method SetOrigin only accepts coordinates of type number";return;}
this.AGh9=new Object();this.AGh9.Latitude=Latitude;this.AGh9.Longitude=Longitude;}
this.SetDestination=function(Latitude,Longitude){if(typeof Latitude!="number"||typeof Longitude!="number"){throw "The method SetDestination only accepts coordinates of type number";return;}
this.AGh4=new Object();this.AGh4.Latitude=Latitude;this.AGh4.Longitude=Longitude;}
this.Clear=function(){this.AGh9=null;this.AGh4=null;this.AGjz=new Array();var AGdk=AGM[this.AGkE].AGfQ.AGjq.AGbJ();if(AGdk){if(AGM[this.AGkE].AGeY)
AGM[this.AGkE].AGeS=true;AGM[this.AGkE].AGfQ.AGjn();}}
this.DrawRoute=function(AGbr){if(AGM[this.AGkE].AGe4==false)
return false;if(this.AGh9==null||this.AGh4==null)
return false;this.AGjz=new Array();this.AGjz.push(this.AGh9);this.AGjz.push(this.AGh4);AGM[this.AGkE].AGfQ.AGjq.AGbU(this.AGjz);if(AGM[this.AGkE].AGeY)
AGM[this.AGkE].AGe6=true;if(AGbr==true)
AGM[this.AGkE].AGfQ.ZoomToBoundingBox(this.AGcR(),AGM[this.AGkE].AGfl);else
AGM[this.AGkE].AGfQ.AGjn();return true;}
this.GetPoints=function(){return this.AGjz;}
this.AGcR=function(){var AGcF=0.25;var AGg0=-500;var AGhe=500;var AGg1=-500;var AGhf=500;for(var i=0;i<this.AGjz.length;i++){var AGk2=parseFloat(this.AGjz[i].Longitude);var AGk1=parseFloat(this.AGjz[i].Latitude);if(AGg1<AGk2)
AGg1=AGk2;if(AGhf>AGk2)
AGhf=AGk2;if(AGg0<AGk1)
AGg0=AGk1;if(AGhe>AGk1)
AGhe=AGk1;}
var AGcf=parseFloat(AGg1-AGhf);var AGce=parseFloat(AGg0-AGhe);AGg1+=(AGcF*AGcf);AGg0+=(AGcF*AGce);AGhf-=(AGcF*AGcf);AGhe-=(AGcF*AGce);return AGhf+","+AGhe+","+AGg1+","+AGg0;}
this.SetPanel=function(AGie){try{this.AGh2=AGie;this.AGh2.innerHTML="";var AGdB=0;var AGkm=this.AGkE+"_DDIFrame";while(document.getElementById(AGkm+AGdB)!=null)
AGdB++;var AGks=AGkm+AGdB;this.AGh3=document.createElement('iframe');this.AGh3.setAttribute('id',AGks);this.AGh3.setAttribute('name',AGks);this.AGh3.setAttribute('src',"");this.AGh3.style.width="100%";this.AGh3.style.height="100%";this.AGh3.style.border='0px solid #000000';this.AGh3.style.overflow="auto";this.AGh3.style.visibility="hidden";this.AGh2.appendChild(this.AGh3);return true;}
catch(err){this.AGh2=null;return false;}}
this.SetCSSUrl=function(AGkk){this.AGkl=AGkk;}
this.Load=function(){if(AGM[this.AGkE].AGe4==false)
return false;if(this.AGh3==null){return false;}
if(this.AGh9==null||this.AGh4==null){alert("Driving Directions could not be retrieved.\nPlease select an orgin and a destination.")
return false;}
var url=DD_GATEWAY;url+="?";url+="Waypoints="+this.AGh9.Latitude+"|"+this.AGh9.Longitude+"$"+this.AGh4.Latitude+"|"+this.AGh4.Longitude;url+="&RouteParameter="+AGM[this.AGkE].AGfQ.AGjq.AGgQ.AGjx;url+="&RouteLayer="+AGM[this.AGkE].AGfQ.AGjq.AGgQ.AGjw;var AGb0=this.AGkl;if(AGb0==null)
AGb0=API_HOST_URL+DEFAULT_DD_CSS_FILE_NAME;url+="&CSS="+AGb0;this.AGh3.setAttribute('src',url);this.AGh3.style.visibility="visible";return true;}
this.GetDrivingDirectionsViaJSON=function(AGkj){if(this.AGh9==null||this.AGh4==null){alert("Driving Directions could not be retrieved.\nPlease select an orgin and a destination.")
return false;}
var arrRoutingPoints=new Array();arrRoutingPoints.push(this.AGh9);arrRoutingPoints.push(this.AGh4);var url=AGM[this.AGkE].AGfQ.AGjq.GetJsonDrivingDirectionRequest(AGkj,arrRoutingPoints);var script=document.createElement("script");script.setAttribute("src",url);script.setAttribute("type","text/javascript");document.body.appendChild(script);}}
function EventHandler(){this.AGeM=new Array();this.AGeK=new Array();this.AGC=function(AGko,AG8){var AGba=false;for(var i=0;i<this.AGeM.length;i++){if(this.AGeM[i]==AGko){AGba=true;break;}}
if(!AGba){this.AGeM.push(AGko);this.AGeK.push(AG8);}}
this.RemoveFunction=function(AGko){for(var i=0;i<this.AGeM.length;i++){if(this.AGeM[i]==AGko){for(var j=i+1;j<this.AGeM.length;j++){this.AGeM[j-1]=this.AGeM[j];this.AGeK[j-1]=this.AGeK[j];}
this.AGeM.pop();this.AGeK.pop();return;}}}
this.Clear=function(){this.AGeM=new Array();this.AGeK=new Array();}
this.AGcB=function(){for(var i=0;i<this.AGeM.length;i++){var AGkp=this.AGeM[i];if(this.AGeK[i]){this.RemoveFunction(AGkp);i--;}
try{eval(AGkp+"();");}
catch(err){}}}}
function ImageryTileHandler (AGkE){this.AGgs=AGkE;this.AGdy=-5;this.AGfx=0;this.AGfH=2;this.AGfi=1;this.AGeJ=new Array();this.AGfp=12;for(var i=0;i<=this.AGfp;i++)
this.AGeJ[i]="";var AGlG=IMAGERY_BASE_URLS.split(";");for(var i=0;i<AGlG.length;i++){var AGkF=AGlG[i];var AGkX=AGkF.split("|");if(AGkX.length!=2)
continue;var AGkQ=AGkX[1];var AGd5=AGkX[0].split("-");if(AGd5.length!=2)
continue;var AGj9=parseInt(AGd5[0],10);var AGcs=parseInt(AGd5[1],10);for(var j=AGj9;j<=AGcs;j++)
this.AGeJ[j]=AGkQ;}
this.AGlu=function(AGlz,view) {var AGlP={
x: (view.AG0.x1-view.AG0.x0)/view.size.x,y: (view.AG0.y1-view.AG0.y0)/view.size.y};var AGlx={
x: AGlz.scale.x/AGlz.size.x,y: AGlz.scale.y/AGlz.size.y};var level=Math.floor((Math.log(Math.abs(AGlP.x/AGlx.x))/Math.log(0.5)+Math.log(Math.abs(AGlP.x/AGlx.x))/Math.log(0.5))*0.5+0.4);if (level<0) level=0;var scale={ 
x: AGlz.scale.x*Math.pow(0.5,level),y: AGlz.scale.y*Math.pow(0.5,level)};return {
level: level,x0: Math.floor((view.AG0.x0-AGlz.origin.x)/scale.x),y0: Math.floor((view.AG0.y0-AGlz.origin.y)/scale.y),x1: Math.ceil((view.AG0.x1-AGlz.origin.x)/scale.x)-1,y1: Math.ceil((view.AG0.y1-AGlz.origin.y)/scale.y)-1};}
this.AGlv=function(AGlz,view,AGlA) {var AGlP={
x: (view.AG0.x1-view.AG0.x0)/view.size.x,y: (view.AG0.y1-view.AG0.y0)/view.size.y};var scale={ 
x: AGlz.scale.x*Math.pow(0.5,AGlA.level),y: AGlz.scale.y*Math.pow(0.5,AGlA.level)};var AG0={
x0: Math.round((AGlA.x*scale.x+AGlz.origin.x-view.AG0.x0)/AGlP.x),y0: Math.round((AGlA.y*scale.y+AGlz.origin.y-view.AG0.y0)/AGlP.y),x1: Math.round(((AGlA.x+1)*scale.x+AGlz.origin.x-view.AG0.x0)/AGlP.x),y1: Math.round(((AGlA.y+1)*scale.y+AGlz.origin.y-view.AG0.y0)/AGlP.y)};var AGkg=this.AGcM();return {
level: AGlA.level,x: AGlA.x,y: AGlA.y,url: AGkg+"&level="+AGlA.level+"&x="+AGlA.x+"&y="+AGlA.y,offset: {
x: AG0.x0,y: AG0.y0},size: {
x: AG0.x1-AG0.x0,y: AG0.y1-AG0.y0}};}
this.AGcQ=function(AGdE,iX,iY){if(AGdE<=7)
return "bmng.topo.bathy.200401";else
return "spot5";}
this.AGcM=function(){var AGb6=AGM[this.AGgs].AGfh;return this.AGeJ[AGb6];}
this.AGcS=function(AGdE,iX,iY){for(var i=0;i<AGM[this.AGgs].AGfQ.AGlH.length;i++){var AGd4=AGM[this.AGgs].AGfQ.AGlH.items[i];var img=document.getElementById(AGM[this.AGgs].AGfR.AGjC+AGd4);if(img.level==(AGdE+"")&&img.xVal==(iX+"")&&img.yVal==(iY+""))
return AGd4;}
return-1;}
this.SetTiles=function(AGkh,AGdL,AGdK){var AGlz={
 url: "http://s0.tileservice.worldwindcentral.com/getTile?interface=map&version=1",size: { x: 256,y: 256 },origin: { x:-180.0,y: 90.0 },scale: { x: 360.0,y:-360.0 } };var AG3=AGkh.split(",",4);var AGeF=parseFloat(AG3[0]);var AGev=parseFloat(AG3[1]);var AGeG=parseFloat(AG3[2]);var AGew=parseFloat(AG3[3]);var view={
 size: { x: AGdL,y: AGdK},AG0: { x0: AGeF,y0: AGew,x1: AGeG,y1: AGev }};var AGly=this.AGlu(AGlz,view);var AGgL=AGM[this.AGgs].AGfR.AGld.offsetLeft-AGM[this.AGgs].AGf6.x;var AGgM=AGM[this.AGgs].AGfR.AGld.offsetTop-AGM[this.AGgs].AGf6.y;var AGb2=AGly.level;var AGhh=AGly.x0;var AGg5=AGly.x1;var AGhi=AGly.y0;var AGg6=AGly.y1;this.AGfx=0;var AGbp=false;if(this.AGdy!=AGb2){AGbp=true;this.AGfx=0;}
this.AGdy=AGb2;for (var y=AGly.y0;y<=AGly.y1;++y) {for (var x=AGly.x0;x<=AGly.x1;++x) {var AGlA=this.AGlv(AGlz,view,{ level: AGly.level,x: x,y: y });var AGcD=this.AGcS(AGly.level,x,y);if(AGcD<0){var AGd4=AGM[this.AGgs].AGfQ.AGc7(AGb2,AGhh,AGg5,AGhi,AGg6);if(AGd4>=0){var img=document.getElementById(AGM[this.AGgs].AGfR.AGjC+AGd4);img.setAttribute('width',AGlA.size.x);img.setAttribute('height',AGlA.size.y);img.style.left="-1000000px";img.style.top="-1000000px";img.AGjf=(AGlA.offset.x-AGgL);img.AGjg=(AGlA.offset.y-AGgM);img.style.width=AGlA.size.x+"px";img.style.height=AGlA.size.y+"px";img.style.zIndex=this.AGfH;img.level=AGly.level+"";img.xVal=x+"";img.yVal=y+"";if(AGbp){this.AGfx++;img.zoom="1";}
else
img.zoom="0";img.setAttribute('src',AGlA.url);}}
else{var img=document.getElementById(AGM[this.AGgs].AGfR.AGjC+AGcD);img.setAttribute('width',AGlA.size.x);img.setAttribute('height',AGlA.size.y);img.AGjf=(AGlA.offset.x-AGgL);img.AGjg=(AGlA.offset.y-AGgM);img.style.left=(AGlA.offset.x-AGgL)+"px";img.style.top=(AGlA.offset.y-AGgM)+"px";img.style.width=AGlA.size.x+"px";img.style.height=AGlA.size.y+"px";}}}}
this.SetPos=function(AGla){var AGdQ=AGM[this.AGgs].AGfR.AGjC+AGla;var elem=document.getElementById(AGdQ);if(typeof elem.AGjf!="undefined"){if(elem.zoom=="1" ) 
 {
elem.style.left=elem.AGjf+"px";elem.style.top=elem.AGjg+"px";elem.zoom="0";if(elem.level+""==this.AGdy+""){this.AGfx--;this.AGfx=this.AGfx<0 ? 0 : this.AGfx;if (this.AGfx==0){this.AGbI(this.AGdy);}}}
else if(elem.zoom=="0" ){elem.style.left=elem.AGjf+"px";elem.style.top=elem.AGjg+"px";}}
else{}} 
this.AGbI=function(AGdx){AGM[this.AGgs].AGfQ.AGcI=new TileList();AGM[this.AGgs].AGfQ.AGlH=new TileList();for(var i=0;i<AGM[this.AGgs].AGfn;i++){var AGdP=document.getElementById(AGM[this.AGgs].AGfR.AGjC+i);if(AGdP.level+""!=AGdx+""){AGM[this.AGgs].AGfQ.AGcI.Add(i);AGdP.AGjf="-1000000";AGdP.AGjg="-1000000";AGdP.style.left="-1000000px";AGdP.style.top="-1000000px";AGdP.level="-1";AGdP.xVal="-1";AGdP.yVal="-1";AGdP.zoom="0";}
else{AGM[this.AGgs].AGfQ.AGlH.Add(i);}}}}
function AGSearch(){this.SearchType=null;this.SearchStreet=function(AGjK,callbackFunction){if (typeof AGjK!="string"||AGjK==""||typeof callbackFunction!="string"||callbackFunction=="") {return;}
this.SearchType="Street";this.AddressSearchWithJsonRequest(AGjK,callbackFunction);}
this.AddressSearchWithJsonRequest=function(AGkd,callbackFunction){var url=JSON_AddressSearch_Url;url+="?";url+="SearchString="+AGkd;url+="&SearchType="+this.SearchType;url+="&jsonp="+callbackFunction;url+="&rnd="+Math.random();var sc=document.createElement("script");sc.setAttribute("type","text/javascript");sc.setAttribute("src",url);document.body.appendChild(sc);}}
function AGPoint(x,y){this.x=parseInt(x,10);this.y=parseInt(y,10);}
function AGCoord(lat,lng){this.latitude=lat;this.longitude=lng;}
function AGSize(width,height){this.width=width;this.height=height;}
function MouseEventManager(){this.MakeDraggable=function(htmlObject,bUpdateLatLong){if(bUpdateLatLong==true)
htmlObject.bUpdateLatLong="true";else
htmlObject.bUpdateLatLong="false";var mousePosOnMapIcon1=null;var mousePosOnMapIcon2=null;var bZoomMapIconDrag=false;htmlObject.onmousedown=function(ev){var AGiW=this.AGiW;ev=ev||window.event;if(!ev)
return false;try{var AGh1=document.getElementById(this.AGiW+"_callout1");if(AGh1){var p=AGh1.parentNode;p.removeChild(AGh1);}
var AGhw=MouseCoords(ev);bZoomMapIconDrag=true;mousePosOnMapIcon1=AGhw;return false;}
catch(err){return false;} 
return false;}
htmlObject.onmousemove=function(ev){ev=ev||window.event;if(!ev)
return false;if(bZoomMapIconDrag==true){mousePosOnMapIcon2=MouseCoords(ev);var AGjW=parseInt(mousePosOnMapIcon2.x)-parseInt(mousePosOnMapIcon1.x);var AGjX=parseInt(mousePosOnMapIcon2.y)-parseInt(mousePosOnMapIcon1.y);htmlObject.style.left=(parseInt(htmlObject.style.left)+AGjW)+"px";htmlObject.style.top=(parseInt(htmlObject.style.top)+AGjX)+"px";mousePosOnMapIcon1=mousePosOnMapIcon2;}
return false;}
htmlObject.onmouseup=function(ev){if(bZoomMapIconDrag==true&&htmlObject.bUpdateLatLong=="true"){htmlObject.UpdateLatLong();}
bZoomMapIconDrag=false;return false;}
htmlObject.onmouseout=function(ev){htmlObject.onmousemove(ev);htmlObject.onmouseup(ev);return false;}
htmlObject.UpdateLatLong=function(){var AGiW=htmlObject.AGiW;var movingContainer=document.getElementById(AGM[AGiW].AGfR.AGhF);var x=parseInt(movingContainer.style.left)+parseInt(this.style.left)-parseInt(this.AGl5);var y=parseInt(movingContainer.style.top)+parseInt(this.style.top)-parseInt(this.AGl6);var p=new Point(x,y);var agcoord=AGM[this.AGiW].AGdd(p);this.Lat=agcoord.y;this.Long=agcoord.x;}}}
function DraggableIcon(imgUrl,AGdQ){if(typeof imgUrl!="string")
throw "DraggableIcon only accepts string as Image URL";this.AGdP=document.createElement("img");this.AGdP.src=imgUrl;if(typeof AGdQ!="string"){AGdQ="AGDICoN"+iIdCount;iIdCount++;}
this.AGdP.id=AGdQ;this.AGdP.className=null;this.AGiW=null;this.AGl5=null;this.AGl6=null;this.getImgUrl=function(){return this.AGdP.src;}
this.getImgId=function(){if(typeof this.AGdP.id=="string")
return this.AGdP.id;throw "Undefined Id";}
this.MakeDraggable=function(){this.mem=new MouseEventManager();this.AGdP.AGiW=this.AGiW;this.AGdP.AGl5=this.AGl5;this.AGdP.AGl6=this.AGl6;this.mem.MakeDraggable(this.AGdP,true);}
this.IsInsideMap=function(){if(this.AGiW==null)
return false;var imgElement=this.AGdP;if( imgElement!=null){try{var p=imgElement.parentNode;if(AGM[this.AGiW].AGfR.AGhF==p.id)
return true;else
return false;}
catch(err){return false;}}
else
return false;}
this.GetCoords=function(){if(this.IsInsideMap()){return new AGCoord(parseFloat(this.AGdP.Lat),parseFloat(this.AGdP.Long));}
else{throw "Icon is not available in the map";}}
this.GetPosition=function(){if(this.IsInsideMap()){var AGiW=this.AGiW;var movingContainer=document.getElementById(AGM[this.AGiW].AGfR.AGhF);var x=parseInt(movingContainer.style.left)+parseInt(this.AGdP.style.left)-parseInt(this.AGl5);var y=parseInt(movingContainer.style.top)+parseInt(this.AGdP.style.top)-parseInt(this.AGl6);return new AGPoint(x,y);}
else
throw "Icon is not available in the map";}}