
var API_HOST_URL="http://maps.afrigis.co.za/msjsapi2/";document.write("<script language='javascript' src='"+API_HOST_URL+"js/jquery-1.2.6.pack.js"+"'></script>");document.write("<script language='javascript' src='"+API_HOST_URL+"js/jquery.mousewheel.pack.js"+"'></script>");

function _fC(shortcut,callback,opt){var default_options={'type':'keydown','propagate':false,'target':document
	};if(!opt) opt=default_options;else {for(var dfo in default_options){if(typeof opt[dfo]=='undefined') opt[dfo]=default_options[dfo];}}

	var ele=opt.target;if(typeof opt.target=='string') ele=document.getElementById(opt.target);var ths=this;var _je=function(e){e=e||window.event;if(e.keyCode) code=e.keyCode;else if(e.which) code=e.which;var character=String.fromCharCode(code).toLowerCase();var keys=shortcut.toLowerCase().split("+");var kp=0;var shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"
 };var special_keys={'esc':27,'escape':27,'tab':9,'space':32,'return':13,'enter':13,'backspace':8,'scrolllock':145,'scroll_lock':145,'scroll':145,'capslock':20,'caps_lock':20,'caps':20,'numlock':144,'num_lock':144,'num':144,'pause':19,'break':19,'insert':45,'home':36,'delete':46,'end':35,'pageup':33,'page_up':33,'pu':33,'pagedown':34,'page_down':34,'pd':34,'left':37,'up':38,'right':39,'down':40,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,'f12':123
 };for(var i=0;k=keys[i],i<keys.length;i++){if(k=='ctrl'||k=='_hd'){if(e.ctrlKey) kp++;} else if(k=='shift'){if(e.shiftKey) kp++;} else if(k=='alt'){if(e.altKey) kp++;} else if(k.length>1){if(special_keys[k]==code) kp++;} else {if(character==k) kp++;else {if(shift_nums[character]&&e.shiftKey){character=shift_nums[character];if(character==k) kp++;}}
 }}

 if(kp==keys.length){callback(e);if(!opt['propagate']){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}
 return false;}}
	}

	
	if(ele.addEventListener) ele.addEventListener(opt['type'],_je,false);else if(ele.attachEvent) ele.attachEvent('on'+opt['type'],_je);else ele['on'+opt['type']]=_je;}


function _fO(){}
_fO.insidePixelRegion=function(_gd,_pY){if(!(_pY instanceof _fn)||_gd==null||typeof _gd=="undefined"||typeof _gd!="object")
return "Invalid argument";var _l1=_gd.length;var _gJ=false;var j=_l1-1;for(var i=0;i<_l1;i++){var _p3=_gd[i];var _p4=_gd[j];if(_p3.x<_pY.x&&_p4.x>=_pY.x||_p4.x<_pY.x&&_p3.x>=_pY.x){if(-_p3.y+(_pY.x-_p3.x) /(_p4.x-_p3.x)*(-_p4.y+_p3.y)<-_pY.y){_gJ=!_gJ;}}
j=i;}
return _gJ;};_fO.getRegionAroundLines=function(_gd,strokeWidth){if(typeof _gd=="undefined"||_gd==null||typeof _gd!="object")
return;if(typeof strokeWidth=="undefined"||strokeWidth==null||typeof strokeWidth!="number")
return;_gd=_fO.removeRedandentPoints(_gd);var _ge=new Array();var _gc=new Array();var _qu=_eS.getStraightLineFromPoints(_gd[0],_gd[1]);var _qv=_eS.getPerpendicularLine(_qu,_gd[0]);var _qw=_eS.getPerpendicularLine(_qu,_gd[1]);var _gj=_eS.getLinesFromDistance(_qu,strokeWidth/2);var _p2=_eS.getIntersection(_gj[0],_qv);var _pE=_eS.getIntersection(_gj[1],_qv);if(_p2!=null)
_ge.push(_p2);if(_pE!=null)
_gc.push(_pE);for(var i=1;i<_gd.length-1;i++){_qu=_eS.getStraightLineFromPoints(_gd[i],_gd[i+1]);var _gh=_eS.getLinesFromDistance(_qu,strokeWidth/2);_p2=_eS.getIntersection(_gj[0],_gh[0]);_pE=_eS.getIntersection(_gj[1],_gh[1]);if(_p2!=null)
_ge.push(_p2);if(_pE!=null)
_gc.push(_pE);_gj=_gh;}
_qu=_eS.getStraightLineFromPoints(_gd[i],_gd[i-1]);var _qx=_eS.getPerpendicularLine(_qu,_gd[i]);var _gi=_eS.getLinesFromDistance(_qu,strokeWidth/2);_p2=_eS.getIntersection(_gi[1],_qx);_pE=_eS.getIntersection(_gi[0],_qx);if(_p2!=null)
_ge.push(_p2);if(_pE!=null)
_gc.push(_pE);_gc=_gc.reverse();var _f7=_ge.concat(_gc);return _f7;};_fO.getNavigationRouteRequest=function(_sx,_go,_md,_s2,_tg){var _ty="";_ty+="LATLONG,"+_go[0].longitude()+","+_go[0]._m1();for(var i=1;i<_go.length;i++){_ty+="^LATLONG,"+_go[i].longitude()+","+_go[i]._m1();}
var _tt=AG_NAVIGATION_GATEWAY_URL;_tt+="?";_tt+="Request=GetDDPoints";_tt+="&RouningLayer="+_s2;_tt+="&routingParam="+_tg;_tt+="&jsonp="+_sx;_tt+="&waypoints="+_ty;_tt+="&requestNo="+_md;_tt+="&rnd="+Math.random();return _tt;};_fO.removeRedandentPoints=function(_gd){var _fV=new Array(_gd[0]);for(var i=1;i<_gd.length;i++){if(!(_gd[i-1]._iM(_gd[i])))
_fV.push(_gd[i]);}
return _fV;};

function _eS(){}
_eS.getIntersection=function(_qs,_qt){if(!(_qs instanceof _fF)||!(_qt instanceof _fF))
return;var _hn=_qs._ji()*_qt._jm()-_qt._ji()*_qs._jm();if(_hn==0)
return null;var x=(-_qs._jp()*_qt._jm()+_qt._jp()*_qs._jm()) / _hn;var y=(-_qs._ji()*_qt._jp()+_qt._ji()*_qs._jp()) / _hn;return new _fn(x,y);};_eS.getStraightLineFromPoints=function(_pv,_pw){if(!(_pv instanceof _fn)||!(_pw instanceof _fn))
return null;var a=_pv.y-_pw.y;var b=_pw.x-_pv.x;var c=_pv.x*a+_pv.y*b;c=-c;return new _fF(a,b,c);};_eS.getPerpendicularLine=function(_qr,_px){if(_qr instanceof _fF){var c_=_qr._ji()*_px.y-_qr._jm()*_px.x;return new _fF(_qr._jm(),-_qr._ji(),c_);}
return null;};_eS.getLinesFromDistance=function(_qr,_iR){if(_qr instanceof _fF&&typeof _iR!="undefined"&&_iR!=null&&typeof _iR=="number"){var a=_qr._ji();var b=_qr._jm();var _g5=_qr._jp()-(_iR*Math.sqrt(Math.pow(a,2)+Math.pow(b,2)));var _hf=_qr._jp()+(_iR*Math.sqrt(Math.pow(a,2)+Math.pow(b,2)));var s1=new _fF(a,b,_hf);var s2=new _fF(a,b,_g5);return new Array(s1,s2);}
return null;};function _fF(fA,fB,fC){if(typeof fA!="undefined"&&fA!=null&&typeof fA=="number")
this._2=fA;else throw "Invalied argument";if(typeof fB!="undefined"&&fB!=null&&typeof fB=="number")
this._3=fB;else throw "Invalied argument";if(typeof fC!="undefined"&&fC!=null&&typeof fC=="number")
this._4=fC;else throw "Invalied argument";this._ji=function(){return this._2;};this._jm=function(){return this._3;};this._jp=function(){return this._4;};}


function _eT(){this._bv=new Array();this._jT=function(_s0){return this._bv[_s0];};this._dI=function(_s0,value){if(typeof(value)!='undefined'){if(typeof(this._bv[_s0])=='undefined'){this._bv[_s0]=new Array();}
this._bv[_s0].push(value);}};this._q7=function(_s0,value){if(typeof(value)!='undefined'){if(typeof(this._bv[_s0])!='undefined'){var _lM=this._iW(this._bv[_s0],value);if(_lM>=0)
this._bv[_s0].splice(_lM,1);if(this._bv[_s0].length==0)
delete this._bv[_s0];}}
};this._q8=function(_s0){if(typeof(this._bv[_s0])!='undefined'){delete this._bv[_s0];}};this._kL=function(_s0){return typeof(this._bv[_s0])!='undefined';};this.clear=function(){delete this._bv;this._bv=new Array();};this._iW=function(_fV,value){for(var i=0;i<_fV.length;i++)
if(_fV[i]==value)
return i;return-1;};}


function _eU(){}
_eU.rowSpan=50;_eU.colSpan=50;_eU.noOfRows=50;_eU.noOfCols=50;_eU._rv="x";_eU.getClickMappingKeyForPosition=function(_pu){var x=Math.floor(_pu.y/_eU.rowSpan) % _eU.noOfRows;x=x<0? x+_eU.noOfRows : x;var y=Math.floor(_pu.x/_eU.colSpan) % _eU.noOfCols;y=y<0 ? y+_eU.noOfCols : y;return x+_eU._rv+y;};_eU.getBoundingBoxFromPoints=function(_gd){if(typeof _gd=="undefined"||_gd.length<=0)
throw "Array's lenght must be at least 1.";var _np=_gd[0].x;var _nj=_gd[0].x;var _nq=_gd[0].y;var _nk=_gd[0].y;for(var i=1;i<_gd.length;i++){_np=(_gd[i].x<_np) ? _gd[i].x : _np;_nj=(_gd[i].x>_nj) ? _gd[i].x : _nj;_nq=(_gd[i].y<_nq) ? _gd[i].y : _nq;_nk=(_gd[i].y>_nk) ? _gd[i].y : _nk;}
return new _fu(new _fn(_np,_nq),new _fn(_nj,_nk));};_eU.getKeysForRegion=function(_gd){var _n7=_eU.getBoundingBoxFromPoints(_gd);var _pN=_n7.min();var _pM=_n7.max();var _mQ=_pM.x-_pN.x;var _lj=_pM.y-_pN.y;var _mJ=0;var _k0=0;var _lt=0;var _me=0;if(_lj>=_eU.rowSpan*_eU.noOfRows){_mJ=0;_k0=_eU.noOfRows-1;}
else {_mJ=Math.floor(_pN.y/_eU.rowSpan) % _eU.noOfRows;_mJ=_mJ<0 ? _mJ+_eU.noOfCols : _mJ;_k0=Math.floor(_pM.y/_eU.rowSpan) % _eU.noOfRows;_k0=_k0<0 ? _k0+_eU.noOfCols : _k0;}
if(_mQ>=_eU.colSpan*_eU.noOfCols){_lt=0;_me=_eU.noOfCols-1;}
else {_lt=Math.floor(_pN.x/_eU.colSpan) % _eU.noOfCols;_lt=_lt<0 ? _lt+_eU.noOfCols : _lt;_me=Math.floor(_pM.x/_eU.colSpan) % _eU.noOfCols;_me=_me<0 ? _me+_eU.noOfCols : _me;}
var _f9=new Array();for(var x=_mJ;;x++){var _gu=false;if(x%_eU.noOfRows==_k0)
_gu=true;for(var y=_lt;;y++){var _gv=false;if(y%_eU.noOfCols==_me)
_gv=true;_f9[_f9.length]=(x%_eU.noOfRows)+_eU._rv+(y%_eU.noOfCols);if(_gv)
break;}
if(_gu)
break;}
return _f9;};

var _ew={init: function(){this._gN=this._rs(this._ho)||"An unknown _gN";this.VERSION=this._rt(navigator.userAgent)||this._rt(navigator.appVersion)||"an unknown VERSION";this._qc=this._rs(this._hp)||"an unknown _qc";},_rs: function(data){for(var i=0;i<data.length;i++){var _hs=data[i].string;var _hq=data[i].prop;this._tO=data[i].versionSearch||data[i].identity;if(_hs){if(_hs.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(_hq)
return data[i].identity;}},_rt: function(_hs){var _lM=_hs.indexOf(this._tO);if(_lM==-1) return;return parseFloat(_hs.substring(_lM+this._tO.length+1));},_ho: [
{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"
}
],_hp : [
{string: navigator.platform,subString: "Win",identity: "Windows"
},{string: navigator.platform,subString: "Mac",identity: "Mac"
},{string: navigator.platform,subString: "Linux",identity: "Linux"
}
]
};_ew.init();if(_ew._gN=="Explorer")
document.write("<script language='javascript' src='"+API_HOST_URL+"js/AGPainterVML.js"+"'></script>");else document.write("<script language='javascript' src='"+API_HOST_URL+"js/AGPainterSVG.js"+"'></script>");

function _fD(_jh,_iV){if(typeof _jh!="number"||typeof _iV!="number")
throw "Invalid input";this.width=_jh;this.height=_iV;this._iM=function(_pg){if(_pg==null||!(_pg instanceof _fD))
throw "Invalid Size";if(this.width==_pg.width&&this.height==_pg.height)
return true;else return false;};this._tJ=function(){var _tl=this.width+","+this.height;return _tl;};this.copy=function(){return new _fD(this.width,this.height);};this.equals=this._iM;this.toString=this._tJ;}
var AGSize=_fD;

function _ff(){this.initialize=function(_o0){throw "You must implement this";};this.copy=function(){throw "You must implement this";};this.redraw=function(_l2){throw "You must implement this";};this.remove=function(){throw "You must implement this";};this._jt=function(){return null;};}
var AGOverlay=_ff;

function _fu(_pv,_pw){if( _pv==null||!(_pv instanceof _fn))
throw "Invalid input for point";if(_pw==null||!(_pw instanceof _fn))
throw "Invalid input for point";this._bn=-1;this._bo=-1;this._bh=-1;this._bi=-1;var _mS=parseInt(_pv.x,10);var _mT=parseInt(_pw.x,10);var _mV=parseInt(_pv.y,10);var _mW=parseInt(_pw.y,10);this._bn=(_mS<_mT) ? _mS : _mT;this._bh=(_mS>_mT) ? _mS : _mT;this._bo=(_mV<_mW) ? _mV : _mW;this._bi=(_mV>_mW) ? _mV : _mW;this._tJ=function(){var _sw=new _fn(this._bn,this._bo)+","+new _fn(this._bh,this._bi);return _sw;};this._iM=function(_pe){if(_pe==null||!(_pe instanceof _fu))
throw "Invalid Size";if(this._bn==_pe._bn&&this._bo==_pe._bo&&this._bh==_pe._bh&&this._bi==_pe._bi)
return true;else return false;};this._nn=function(){return new _fn((this._bn+this._bh)/2,(this._bo+this._bi)/2);};this.min=function(){return new _fn(this._bn,this._bo);};this.max=function(){return new _fn(this._bh,this._bi);};this._g9=function(_pf){if( _pf==null||!(_pf instanceof _fu))
throw "Invalid Area";if(this._bn<=_pf._bn&&this._bo<=_pf._bo&&this._bh>=_pf._bh&&this._bi>=_pf._bi)
return true;else return false;};this._g8=function(_pd){if(_pd==null||!(_pd instanceof _fn))
throw "Invalid Point";if(this._bn<=_pd.x&&this._bh>=_pd.x&&this._bo<=_pd.y&&this._bi>=_pd.y)
return true;else return false;};this._iQ=function(_pu){if(_pu==null||!(_pu instanceof _fn))
throw "Invalid Point";if(_pu.x<this._bn)
this._bn=_pu.x;if(_pu.x>this._bh)
this._bh=_pu.x;if(_pu.y<this._bo)
this._bo=_pu.y;if(_pu.y>this._bi)
this._bi=_pu.y;};this.copy=function(){return new _fu(new _fn(this._bn,this._bo),new _fn(this._bh,this._bi));};this.toString=this._tJ;this.equals=this._iM;this.mid=this._nn;this.min=this.min;this.max=this.max;this.containsRectangle=this._g9;this.containsPoint=this._g8;this.extend=this._iQ;}
var AGRectangle=_fu;

function _fn(_mR,_mU){if(typeof _mR!="number"||typeof _mU!="number")
throw "Invalid input";this.x=_mR;this.y=_mU;this._iM=function(_pd){if(_pd==null||!(_pd instanceof _fn))
throw "Invalid Point";if(this.x==_pd.x&&this.y==_pd.y)
return true;else return false;};this._tJ=function(){var _s7=this.x+","+this.y;return _s7;};this.copy=function(){return new _fn(this.x,this.y);};this.equals=this._iM;this.toString=this._tJ;}
var AGPoint=_fn;

function _eX(_he,image){if(typeof image!="string")
this.image=AG_DEFAULT_ICON.image;else this.image=image;this.shadow="";this.iconSize=new _fD(0,0);this.shadowSize=new _fD(0,0);this.iconAnchor=new _fn(0,0);this.infoDisplayAnchor=new _fn(0,0);this.printImage="";this.mozPrintImage="";this.printShadow="";this.transparent="";this.imageMap=null;this.maxHeight=0;this.dragCrossImage="";this.dragCrossSize=new _fD(10,10);this.dragCrossAnchor=new _fn(10,10);this.copy=function(){var _hg=new _eX();_hg.image=this.image;_hg.shadow=this.shadow;if(this.iconSize instanceof _fD)
_hg.iconSize=this.iconSize.copy();if(this.shadowSize instanceof _fD)
_hg.shadowSize=this.shadowSize.copy();if(this.iconAnchor instanceof _fn)
_hg.iconAnchor=this.iconAnchor.copy();if(this.infoDisplayAnchor instanceof _fn)
_hg.infoDisplayAnchor=this.infoDisplayAnchor.copy();_hg.printImage=this.printImage;_hg.mozPrintImage=this.mozPrintImage;_hg.printShadow=this.printShadow;_hg.transparent=this.transparent;_hg.imageMap=this.imageMap;_hg.maxHeight=this.maxHeight;_hg.dragCrossImage=this.dragCrossImage;_hg.dragCrossSize=this.dragCrossSize;_hg.dragCrossAnchor=this.dragCrossAnchor;return _hg;};}
var AGIcon=_eX;

_fr.prototype=new _ff;function _fr(_f3,_qI,_p5){var FILL_COLOUR='none';this._bI=null;this._co=null;if(typeof _f3==null||typeof _f3=='undefined')
throw 'Invalid Coord';this._arrAGCoord=_f3;this._dh=_qI instanceof _fP ? _qI: AG_DEFAULT_VECTOR_OPTIONS.copy();if(_p5 instanceof _fs)
this._cO=_p5;else this._cO=new _fs();this._0=true;this._Z=false;this._dq=null;this._bK=new _ft();this._H=false;this.initialize=function(_nH){this._bI=_nH;this._co=this._bI._j5(_fl.OVERLAY_PANE);this._ig();this._rx();};this.copy=function(){};this.redraw=function(_l2){if(_fe.ZOOM==_l2){var _fZ=this.getPointFromCoord(this._arrAGCoord);this._bK.redraw(_fZ);this._rx();}};this.remove=function(){this._co.removeChild(this._dq);this._q1();this._bI=null;_eP.trigger(this,"onremove");};this._ig=function(){var _fZ=this.getPointFromCoord(this._arrAGCoord);this._dq=this._bK.polyline(_fZ,this._dh);this._co.appendChild(this._dq);this._H=true;};this.getPointFromCoord=function(_f3){var _fX=new Array();for(var i=0;i<_f3.length;i++){_fX.push(this._bI._ka(_f3[i]));}
return _fX;};this._hy=function(_lr){if(typeof _lr!='number')
throw 'Index out of bound';if(this._arrAGCoord.length<3)
throw 'At least two vertex are need.'
if(_lr>=0&&_lr<this._arrAGCoord.length){this._arrAGCoord.splice(_lr,1);if(this._dq){var _gd=this.getPointFromCoord(this._arrAGCoord);this._bK.redraw(_gd);this._rx();_eP.trigger(this,"onlineupdated");}}
};this._ky=function(){return this._arrAGCoord.length;};this._kx=function(_lr){if(typeof _lr!="number") 
throw "Index must be a number";if(_lr!=Math.round(_lr))
throw "Index must be an integer";if(_lr>=0&&_lr<this._arrAGCoord.length)
return this._arrAGCoord[_lr];};this._jU=function(){};this._jn=function(){var _n7=new _ev(this._arrAGCoord[0],this._arrAGCoord[1]);for(var i=2;i<this._arrAGCoord.length;i++){_n7._iQ(this._arrAGCoord[i]);}
return _n7;};this.hide=function(){if(!this._mu())
return;if(!this._mp()){this._H=false;this._dq.style.visibility='hidden';this._q1();_eP.trigger(this,"onvisibilitychanged",false);}};this._mp=function(){return !this._H;};this._mB=function(){return ! this._mp();};this.show=function(){if(!this._mu())
return;if(this._mp()){this._H=true;this._dq.style.visibility='visible';this._rx();_eP.trigger(this,"onvisibilitychanged",true);}};this._dN=function(_oj){this._lZ(this._arrAGCoord.length,_oj);};this._lZ=function(_lr,_oj){if(typeof _lr!='number'||_lr<0||_lr>this._arrAGCoord.length||!(_oj instanceof _eE))
throw 'Invalid argument';this._arrAGCoord.splice(_lr,0,_oj);if(this._dq){var _gd=this.getPointFromCoord(this._arrAGCoord);this._bK.redraw(_gd);this._rx();_eP.trigger(this,"onlineupdated");}};this._rY=function(_nT){if(_nT!=null&&_nT instanceof _fP){this._dh=_nT.copy();this._bK._rQ(this._dh);_eP.trigger(this,"onlineupdated");}};this._mu=function(){return this._bI!=null;};this._jt=function(){if(this._cO.clickable){return this._l;}
return null;};this._rx=function(){if(this._l!=null)
this._q1();this._l=new Array();for(var i=0;i<this._arrAGCoord.length;i++)
this._l.push(this._bI._ka(this._arrAGCoord[i]));this._l=_fO.getRegionAroundLines(this._l,this._dh.strokeWidth);this._bI._dM(this);return this._l;};this._q1=function(){this._bI._rc(this);this._l=null;};this.deleteVertex=this._hy;this.getVertexCount=this._ky;this.getVertex=this._kx;this.hide=this.hide;this.getBoundingBox=this._jn;this.addVertex=this._dN;this.insertVertex=this._lZ;this.isVisible=this._mB;this.show=this.show;this.setStyle=this._rY;}
var AGPolyline=_fr;

function _fs(_gz){if(typeof _gz!="boolean")
this.clickable=false;else this.clickable=_gz;this.copy=function(){return new _fs(this.clickable);};}
var AGPolylineOptions=_fs;

function _fP(_tm,_mA,_jd,_sM,_iT){if(typeof _tm=='string')
this.strokeColour=_tm;else this.strokeColour=AG_DEFAULT_VECTOR_OPTIONS.strokeColour;if(typeof _mA=='number')
this.strokeWidth=_mA;else this.strokeWidth=AG_DEFAULT_VECTOR_OPTIONS.strokeWidth;if(typeof _jd=='number')
this.strokeOpacity=_jd;else this.strokeOpacity=AG_DEFAULT_VECTOR_OPTIONS.strokeOpacity;if(typeof _sM=='string')
this.fillColour=_sM;else this.fillColour=AG_DEFAULT_VECTOR_OPTIONS.fillColour;if(typeof _iT=='number')
this.fillOpacity=_iT;else this.fillOpacity=AG_DEFAULT_VECTOR_OPTIONS.fillOpacity;this.copy=function(){return new _fP(this.strokeColour,this.strokeWidth,this.strokeOpacity,this.fillColour,this.fillOpacity);};}
var AGVectorStyleOptions=_fP;

_fo.prototype=new _ff;function _fo(_f3,_qI,_nN){this._bI=null;this._co=null;if(typeof _f3==null||typeof _f3=='undefined')
throw 'Invalid Coord';if(_f3.length<=2)
throw 'At least two Coord required';this._arrAGCoord=_f3;if(_nN instanceof _fp)
this._cE=_nN.copy();else this._cE=new _fp();this._l=null;this._dh=_qI instanceof _fP ? _qI: AG_DEFAULT_VECTOR_OPTIONS.copy();this._dp=null;this._bJ=new _fq();this._G=false;this.initialize=function(_nH){this._bI=_nH;this._co=this._bI._j5(_fl.OVERLAY_PANE);this._ig();this._rx();};this.copy=function(){};this.redraw=function(_l2){if(_fe.ZOOM==_l2){var _fZ=this.getPointFromCoord(this._arrAGCoord);this._bJ.redraw(_fZ,this._dh);this._rx();}};this.remove=function(){this._co.removeChild(this._dp);this._q1();this._bI=null;_eP.trigger(this,"onremove");};this._ig=function(){var _fZ=this.getPointFromCoord(this._arrAGCoord);this._dp=this._bJ.polygon(_fZ,this._dh);this._co.appendChild(this._dp);this._G=true;};this.getPointFromCoord=function(_f3){var _fX=new Array();for(var i=0;i<_f3.length;i++){_fX.push(this._bI._ka(_f3[i]));}
return _fX;};this._hy=function(_lr){if(typeof _lr!='number')
throw 'Index out of bound';if(this._arrAGCoord.length<3)
throw 'At least two vertex are need.'
if(_lr>=0&&_lr<this._arrAGCoord.length){this._arrAGCoord.splice(_lr,1);if(this._dp){var _gd=this.getPointFromCoord(this._arrAGCoord);this._bJ.redraw(_gd);this._rx();_eP.trigger(this,"onlineupdated");}}
};this._ky=function(){return this._arrAGCoord.length;};this._kx=function(_lr){if(typeof _lr!="number") 
throw "Index must be a number";if(_lr!=Math.round(_lr))
throw "Index must be an integer";if(_lr>=0&&_lr<this._arrAGCoord.length)
return this._arrAGCoord[_lr];};this._jn=function(){var _n7=new _ev(this._arrAGCoord[0],this._arrAGCoord[1]);for(var i=2;i<this._arrAGCoord.length;i++){_n7._iQ(this._arrAGCoord[i]);}
return _n7;};this.hide=function(){if(!this._mu())
return;if(!this._mp()){this._dp.style.visibility='hidden';this._G=false;this._q1();_eP.trigger(this,"onvisibilitychanged",false);}};this._dN=function(_oj){this._lZ(this._arrAGCoord.length,_oj);};this._lZ=function(_lr,_oj){if(typeof _lr!='number'||_lr<0||_lr>this._arrAGCoord.length||!(_oj instanceof _eE))
throw 'Invalid argument';this._arrAGCoord.splice(_lr,0,_oj);if(this._dp){var _gd=this.getPointFromCoord(this._arrAGCoord);this._bJ.redraw(_gd);this._rx();_eP.trigger(this,"onlineupdated");}};this._mp=function(){return !this._G;};this._mB=function(){return !this._mp();};this.show=function(){if(!this._mu())
return;if(this._mp()){this._dp.style.visibility='visible';this._G=true;this._rx();_eP.trigger(this,"onvisibilitychanged",true);}};this._rY=function(_nT){if(_nT!=null&&_nT instanceof _fP){this._dh=_nT.copy();this._bJ._rZ(this._dh);_eP.trigger(this,"onlineupdated");}};this._mu=function(){return this._bI!=null;};this._jt=function(){if(this._cE.clickable){return this._l;}
return null;};this._rx=function(){if(this._l!=null)
this._q1();this._l=new Array();for(var i=0;i<this._arrAGCoord.length;i++)
this._l.push(this._bI._ka(this._arrAGCoord[i]));this._bI._dM(this);return this._l;};this._q1=function(){this._bI._rc(this);this._l=null;};this.deleteVertex=this._hy;this.getVertexCount=this._ky;this.getVertex=this._kx;this.hide=this.hide;this.getBoundingBox=this._jn;this.addVertex=this._dN;this.insertVertex=this._lZ;this.isVisible=this._mB;this.show=this.show;this.setStyle=this._rY;}
var AGPolygon=_fo;

function _fp(_gz){if(typeof _gz!="boolean")
this.clickable=false;else this.clickable=_gz;this.copy=function(){return new _fp(this.clickable);};}
var AGPolygonOptions=_fp;

function _eH(){}
_eH._rN=function(_o0,_pz){var _or=_o0._jz(_pz);if(_o0._cA instanceof _fa){_o0._cA._rz(_or);}
else {var _hx=new _fb();var _hw=new _eX(null,API_HOST_URL+"Images/routeStart.png");_hw.iconAnchor=new _fn(-15,-30);_hx.icon=_hw;_o0._cA=new _fa(_or,_hx);_o0._dL(_o0._cA);}
_o0._rU(_or);_eH.showRoute(_o0);};_eH._rB=function(_o0,_pz){var _oo=_o0._jz(_pz);if(_o0._cx instanceof _fa){_o0._cx._rz(_oo);}
else {var _hx=new _fb();var _hw=new _eX(null,API_HOST_URL+"/Images/routeStop.png");_hw.iconAnchor=new _fn(-12,-30);_hx.icon=_hw;_o0._cx=new _fa(_oo,_hx);_o0._dL(_o0._cx);}
_o0._rT(_oo);_eH.showRoute(_o0);};_eH.showRoute=function(_o0){if(_o0._cT._oCoordOrigin&&_o0._cT._oCoordDestination)
_o0._ij();};_eH.showCoord=function(_o0,_pz){var oClickedCoord=_o0._jz(_pz);alert("Latitude: "+oClickedCoord._m1()+" \nLongitude: "+oClickedCoord.longitude());};_eH.removeRoute=function(_o0){_o0._g2();};

function _eR(_qq,_sK,_iU){this._c2=_qq;this._du=_sK;this._5=_iU;this._kl=function(){return this._c2;};this._jH=function(){return this._du;};this._jJ=function(){return this._5;};}
var AGEventListener=_eR;

function _eP(){}
_eP.addListener=function(_se,_iO,_kJ){if(typeof _iO!="string")
throw "Invalid event";_iO=_iO.toLowerCase();if(typeof _se._hEvents=="undefined")
_se._hEvents=new _eT();_se._hEvents._dI(_iO,_kJ);return new _eR(_se,_iO,_kJ);};_eP.addDomListener=function(_se,_iO,_kJ){};_eP.removeListener=function(_kG){if(!_kG instanceof _eR)
return;var _qq=_kG._kl();var _sK=_kG._jH();var _iU=_kG._jJ();if(typeof _qq._hEvents=="undefined")
return;_qq._hEvents._q7(_sK,_iU);};_eP.clearListeners=function(_se,_iO){if(typeof _se._hEvents=="undefined")
return;if(typeof _iO!="string")
throw "Invalid event";_iO=_iO.toLowerCase();_se._hEvents._q8(_iO);};_eP.clearInstanceListeners=function(_se){};_eP.clearNode=function(_se){};_eP.trigger=function(_se,_iO){if(typeof _iO!="string")
throw "Invalid event";_iO=_iO.toLowerCase();if(typeof _se._hEvents=="undefined")
return;if(!_se._hEvents._kL(_iO))
return;var _sn="";for(var i=2;i<arguments.length;i++)
_sn+="arguments["+i+"],";if(_sn.length>0)
_sn=_sn.substring(0,_sn.length-1);var _kK=_se._hEvents._jT(_iO);for(var i=0;i<_kK.length;i++){try
{var h=_kK[i];if(_sn.length>0){if(h instanceof _eQ){var _n5=h._bN;var f=h._ba;_n5.AgeVe5436nTbrtiND=f;eval("_n5.AgeVe5436nTbrtiND("+_sn+");");}
else eval("_kK[i]("+_sn+");");}
else {if(h instanceof _eQ){var o=h._bN;var f=h._ba;o.AgeVe5436nTbrtiND=f;o.AgeVe5436nTbrtiND();}
else _kK[i]();}}
catch(err){}}
};_eP.bind=function(_se,_iO,object,_nm){var _tB=new _eQ(object,_nm);_eP.addListener(_se,_iO,_tB);return new _eR(_se,_iO,_tB);};_eP.bindDom=function(_se,_iO,object,_nm){};_eP.callback=function(object,_nm){};_eP.callbackArgs=function(object,_nm){};function _eQ(_n5,_je){this._bN=_n5;this._ba=_je;}
var AGEvent=_eP;

_eZ.prototype=new _ff;function _eZ(){this._bI=null;this._di=null;this._dd=null;this._dc=null;this._c9=null;this._da=null;this._db=null;this._bV=null;this._bZ=null;this._bX=null;this._bT=null;this._bY=null;this._bS=null;this._bP=null;this._bQ=null;this._bR=null;this._b3=null;this._oCoord=null;this._cK=null;this._iSelectedPanel=null;this._iPreSelectedPanel=null;this._oInnerPanel=new Array();this._arrPanels=null;this._D=true;this._z=true;this._b5=null;this._cn=null;this._cW=null;this._cf=null;this._ce=null;this._e=null;this._oInfoDisplaySize=new _fD(AG_DEFAULT_INFO_DISPLAY_SIZE.width,AG_DEFAULT_INFO_DISPLAY_SIZE.height);this.initialize=function(_nH){this._bI=_nH;this._ce=_nH._j5(_fl.FLOAT_PANE);this._b5=this._bI._jB();var _ia=AG_DEFAULT_INFO_DISPLAY_OPACITY;if(this._b5!=null&&this._b5 instanceof _e1){if(typeof this._b5.width=="number")
this._oInfoDisplaySize.width=this._b5.width;if(typeof this._b5.height=="number")
this._oInfoDisplaySize.height=this._b5.height;if(typeof this._b5.opacity=="number")
_ia=this._b5.opacity;}
this._di=document.createElement('div');this._di.style.position="absolute";this._di.style.height="auto";this._di.innerHTML="";this._di.style.display="none";this._di.style.zIndex=100;this._dd=document.createElement('div');this._dd.style.height="auto";this._dd.style.left="0px";this._dd.style.zIndex="10";this._dd.style.MozOpacity=_ia;this._dd.style.filter="alpha(opacity="+(_ia*100)+")";this._dd.style.opacity=_ia;this._dc=document.createElement('div');this._dc.style.position="absolute";this._dc.style.width=parseInt(this._oInfoDisplaySize.width+2*_dP)+"px";this._dc.style.height=_dP+"px";this._dc.style.left="0px";this._dc.style.top="0px";this._dc.style.zIndex="10";this._c9=document.createElement('div');this._c9.style.width=_dP+"px";this._c9.style.height=_dP+"px";this._c9.style.backgroundImage="url("+API_HOST_URL+"Images/bubbleSprite.gif)";this._c9.style.backgroundRepeat="no-repeat";this._c9.style.styleFloat="left";this._c9.style.cssFloat="left";this._c9.style.zIndex="10";this._c9.style.MozOpacity=_ia;this._c9.style.filter="alpha(opacity="+(_ia*100)+")";this._c9.style.opacity=_ia;this._dc.appendChild(this._c9);this._da=document.createElement('div');this._da.style.width=this._oInfoDisplaySize.width+"px";this._da.style.height=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._da.style.backgroundColor="#FFFFFF";this._da.style.borderTopWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._da.style.borderTopStyle="solid";this._da.style.borderTopColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._da.style.left=_dP+"px";this._da.style.styleFloat="left";this._da.style.cssFloat="left";this._da.style.top="0px";this._da.style.zIndex="10";this._da.style.MozOpacity=_ia;this._da.style.filter="alpha(opacity="+(_ia*100)+")";this._da.style.opacity=_ia;this._dc.appendChild(this._da);this._db=document.createElement('div');this._db.style.width=_dP+"px";this._db.style.height=_dP+"px";this._db.style.styleFloat="left";this._db.style.cssFloat="left";this._db.style.backgroundImage="url("+API_HOST_URL+"Images/bubbleSprite.gif)";this._db.style.backgroundRepeat="no-repeat";this._db.style.backgroundPosition="-"+_dP+"px 0px";this._db.style.left=_dP+this._oInfoDisplaySize.width+"px";this._db.style.top="0px";this._db.style.zIndex="10";this._db.style.MozOpacity=_ia;this._db.style.filter="alpha(opacity="+(_ia*100)+")";this._db.style.opacity=_ia;this._bV=document.createElement('div');this._bV.style.width="12px";this._bV.style.height="12px";this._bV.style.backgroundColor="#FFFFFF";this._bV.style.position="absolute";this._bV.style.backgroundImage="url("+API_HOST_URL+"Images/btn_close.png)";this._bV.style.zIndex="30";this._bV.style.top="8px";var _n5=new Object();_n5.infoDisplay=this;$(this._bV).bind("click",_n5,_e0.closeBtnClickHandler);this._db.appendChild(this._bV);this._dc.appendChild(this._db);this._dd.appendChild(this._dc);this._oPanelRowPane=document.createElement('div');this._oPanelRowPane.style.position="absolute";this._oPanelRowPane.style.width=(this._oInfoDisplaySize.width+_dP+_dP)+"px";this._oPanelRowPane.style.left="0px";this._oPanelRowPane.style.top=_dP+"px";this._oPanelRowPane.style.zIndex="10";this._oPanelLeftPane=document.createElement('div');this._oPanelLeftPane.style.width=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._oPanelLeftPane.style.styleFloat="left";this._oPanelLeftPane.style.cssFloat="left";this._oPanelLeftPane.style.backgroundColor="#FFFFFF";this._oPanelLeftPane.style.borderLeftWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._oPanelLeftPane.style.borderLeftStyle="solid";this._oPanelLeftPane.style.borderLeftColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._oPanelLeftPane.style.zIndex="10";this._oPanelLeftPane.style.left="0px";this._oPanelLeftPane.style.top="0px";this._oPanelLeftPane.style.MozOpacity=_ia;this._oPanelLeftPane.style.filter="alpha(opacity="+(_ia*100)+")";this._oPanelLeftPane.style.opacity=_ia;this._oPanelRowPane.appendChild(this._oPanelLeftPane);this._oPanelDiv=document.createElement('div');this._oPanelDiv.style.width=(this._oInfoDisplaySize.width )+"px";this._oPanelDiv.style.styleFloat="left";this._oPanelDiv.style.cssFloat="left";this._oPanelDiv.style.left=(_dP)+"px";this._oPanelDiv.style.top="0px";this._oPanelDiv.style.backgroundColor="#FFFFFF";this._oPanelDiv.style.zIndex="40";this._oPanelRowPane.appendChild(this._oPanelDiv);this._oPanelRightPane=document.createElement('div');this._oPanelRightPane.style.cssFloat="left";this._oPanelRightPane.style.styleFloat="left";this._oPanelRightPane.style.width=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._oPanelRightPane.style.backgroundColor="#FFFFFF";this._oPanelRightPane.style.borderRightWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._oPanelRightPane.style.borderRightStyle="solid";this._oPanelRightPane.style.borderRightColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._oPanelRightPane.style.left=_dP+this._oInfoDisplaySize.width+"px";this._oPanelRightPane.style.top="0px";this._oPanelRightPane.style.zIndex="10";this._oPanelRightPane.style.MozOpacity=_ia;this._oPanelRightPane.style.filter="alpha(opacity="+(_ia*100)+")";this._oPanelRightPane.style.opacity=_ia;this._oPanelRowPane.appendChild(this._oPanelRightPane);this._dd.appendChild(this._oPanelRowPane);this._bZ=document.createElement('div');this._bZ.style.position="absolute";this._bZ.style.width=(this._oInfoDisplaySize.width+_dP+_dP)+"px";this._bZ.style.height=this._oInfoDisplaySize.height+"px";this._bZ.style.left="0px";this._bZ.style.top="0px";this._bZ.style.zIndex="10";this._bX=document.createElement('div');this._bX.style.width=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._bX.style.height=this._oInfoDisplaySize.height+"px";this._bX.style.styleFloat="left";this._bX.style.cssFloat="left";this._bX.style.backgroundColor="#FFFFFF";this._bX.style.borderLeftWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._bX.style.borderLeftStyle="solid";this._bX.style.borderLeftColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._bX.style.zIndex="10";this._bX.style.MozOpacity=_ia;this._bX.style.filter="alpha(opacity="+(_ia*100)+")";this._bX.style.opacity=_ia;this._bZ.appendChild(this._bX);this._bT=document.createElement('div');this._bT.style.width=this._oInfoDisplaySize.width+"px";this._bT.style.height=this._oInfoDisplaySize.height+"px";this._bT.style.backgroundColor="#FFFFFF";this._bT.style.left=(_dP)+"px";this._bT.style.styleFloat="left";this._bT.style.cssFloat="left";this._bT.style.zIndex="10";this._bT.style.overflow="auto";this._bT.style.MozOpacity=_ia;this._bT.style.filter="alpha(opacity="+(_ia*100)+")";this._bT.style.opacity=_ia;this._bT.innerHTML="";this._bZ.appendChild(this._bT);this._bY=document.createElement('div');this._bY.style.width=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._bY.style.height=this._oInfoDisplaySize.height+"px";this._bY.style.styleFloat="left";this._bY.style.cssFloat="left";this._bY.style.backgroundColor="#FFFFFF";this._bY.style.borderRightWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._bY.style.borderRightStyle="solid";this._bY.style.borderRightColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._bY.style.left=_dP+this._oInfoDisplaySize.width+"px";this._bY.style.top="0px";this._bY.style.zIndex="10";this._bY.style.MozOpacity=_ia;this._bY.style.filter="alpha(opacity="+(_ia*100)+")";this._bY.style.opacity=_ia;this._bZ.appendChild(this._bY);this._dd.appendChild(this._bZ);this._bS=document.createElement('div');this._bS.style.position="absolute";this._bS.style.width=this._oInfoDisplaySize.width+2*_dP+"px";this._bS.style.height=_dP+"px";this._bS.style.Float="left";this._bS.style.clear="both";this._bS.style.left="0px";this._bS.style.top="0px";this._bS.style.zIndex="10";this._bP=document.createElement('div');this._bP.style.width=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._bP.style.height=(_dP )+"px";this._bP.style.styleFloat="left";this._bP.style.cssFloat="left";this._bP.style.backgroundColor="#FFFFFF";this._bP.style.borderLeftWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._bP.style.borderLeftStyle="solid";this._bP.style.borderLeftColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._bP.style.zIndex="10";this._bP.style.MozOpacity=_ia;this._bP.style.filter="alpha(opacity="+(_ia*100)+")";this._bP.style.opacity=_ia;this._bS.appendChild(this._bP);this._bQ=document.createElement('div');this._bQ.style.styleFloat="left";this._bQ.style.cssFloat="left";this._bQ.style.width=this._oInfoDisplaySize.width+"px";this._bQ.style.height=(_dP-AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH)+"px";this._bQ.style.backgroundColor="#FFFFFF";this._bQ.style.borderBottomWidth=AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH+"px";this._bQ.style.borderBottomStyle="solid";this._bQ.style.borderBottomColor=AG_DEFAULT_BUBBLE_BORDER_COLOUR;this._bQ.style.left=_dP+"px";this._bQ.style.zIndex="10";this._bQ.style.MozOpacity=_ia;this._bQ.style.filter="alpha(opacity="+(_ia*100)+")";this._bQ.style.opacity=_ia;this._bS.appendChild(this._bQ);this._bR=document.createElement('div');this._bR.style.width=_dP+"px";this._bR.style.height=_dP+"px";this._bR.style.styleFloat="left";this._bR.style.cssFloat="left";this._bR.style.backgroundImage="url("+API_HOST_URL+"Images/bubbleSprite.gif)";this._bR.style.backgroundRepeat="no-repeat";this._bR.style.backgroundPosition="-"+_dP+"px "+"-"+_dP+"px";this._bR.style.left=parseInt(_dP+this._oInfoDisplaySize.width)+"px";this._bR.style.zIndex="10";this._bR.style.MozOpacity=_ia;this._bR.style.filter="alpha(opacity="+(_ia*100)+")";this._bR.style.opacity=_ia;this._bS.appendChild(this._bR);this._dd.appendChild(this._bS);this._b3=document.createElement('div');this._b3.style.position="absolute";this._b3.style.width=_dP+"px";this._b3.style.height=_dP+"px";this._b3.style.clear="left";this._b3.style.backgroundImage="url("+API_HOST_URL+"Images/bubbleSprite.gif)";this._b3.style.backgroundRepeat="no-repeat";this._b3.style.backgroundPosition="0px "+"-"+_dP+"px";this._b3.style.left="0px";this._b3.style.top="0px";this._b3.style.zIndex="10";this._b3.style.MozOpacity=_ia;this._b3.style.filter="alpha(opacity="+(_ia*100)+")";this._b3.style.opacity=_ia;this._dd.appendChild(this._b3);this._di.appendChild(this._dd);this._ce.appendChild(this._di);if(_ew._gN=="Explorer"){this._cW=document.createElement("div");this._cW.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+API_HOST_URL+"Images/shadow.png',sizingMethod='scale')";}
else {this._cW=document.createElement("img");this._cW.src=API_HOST_URL+"Images/shadow.png";}
this._cW.style.position="absolute";this._cf=this._bI._j5(_fl.FLOAT_SHADOW_PANE);this._cf.appendChild(this._cW);this._cW.style.display="none";};this.redraw=function(_l2){switch(_l2){case _fe.ZOOM:
var _mp=this._mp();if(_mp)
this.hide();else {this._tM(this._oCoord);this.show();}
break;case _fe.PAN:
if(this._b5.stationary&&this._bI._l5==_fm.DEFAULT){var _o1=this._bI._jW();this._di.style.left=(-_o1.x+this._cn.x )+"px";this._di.style.top=(-_o1.y+this._cn.y )+"px";if(this._b5.shadow){this._cW.style.top=(-_o1.y+this._cn.y )+65+"px";this._cW.style.left=(-_o1.x+this._cn.x )+"px";}
var _oE=new _fn(parseInt(this._di.style.left),parseInt(this._di.style.top));this._rx(_oE);this._oCoord=this._bI._jy(_oE);}
else if(this._b5.stationary&&this._bI._l5==_fm.DRAG){this._cn=this._bI._kb(this._oCoord);var _nz=new _fn(this._cK.x,(-this._oInfoDisplaySize.height-3*_dP+this._cK.y) );this._cn=new _fn((this._cn.x+_nz.x),(this._cn.y+_nz.y));}
break;}};this.copy=function(){};this.remove=function(){var _oO=this._bI._j5(_fl.FLOAT_PANE);_oO.removeChild(this._di);this._bI=null;};this.selectPanel=function(_lr){if(typeof _lr!="number")
throw "Tab _lM should be a integer number";this._iSelectedPanel=_lr;this._rg(this._arrPanels);};this.hide=function(){if(!this._mu())
return;this._z=true;this._di.style.display="none";this._cW.style.display="none";};this.show=function(){if(!this._mu())
return;this._z=false;this._di.style.display="";if(this._b5.shadow)
this._cW.style.display="";};this._mp=function(){return this._z;};this._mB=function(){return !this._mp();};this._j9=function(){return this._oCoord;};this._j8=function(){return this._cK;};this._kh=function(){return this._iSelectedPanel;};this._j6=function(){return this._arrPanels;};this._ki=function(){return this._oInfoDisplaySize;};this._jv=function(){};this._iC=function(){this._D=true;};this._hI=function(){this._D=false;};this._ni=function(){};this._rj=function(){};this.initializeInfoDisplay=function(_gb){while(this._bT.hasChildNodes()){this._bT.removeChild(this._bT.firstChild);}
if(_gb.length>1){this._oPanelDiv.innerHTML="";for(var i=0;i<_gb.length;i++){this._oInnerPanel[i]=document.createElement('div');this._oInnerPanel[i].style.styleFloat="left";this._oInnerPanel[i].style.cssFloat="left";this._oInnerPanel[i].style.border='1px solid black';this._oInnerPanel[i].style.cursor="pointer";this._oInnerPanel[i].style.zIndex="200";if(i==this._iSelectedPanel){this._oInnerPanel[i].style.background='#289452';this._oInnerPanel[i].style.zIndex="400";} 
else this._oInnerPanel[i].style.background='#F3F3F3';this._oInnerPanel[i].innerHTML=_gb[i].label;var _n5=new Object();_n5.infoDisplay=this;_n5.clickIndex=i;$(this._oInnerPanel[i]).bind("click",_n5,_e0.panelClickHandler);this._oPanelDiv.appendChild(this._oInnerPanel[i]);}
var _ha=document.createElement('div');if(typeof _gb[this._iSelectedPanel].content=="string")
_ha.innerHTML=_gb[this._iSelectedPanel].content;else _ha.appendChild(_gb[this._iSelectedPanel].content);this._bT.appendChild(_ha);}
else {this._oPanelDiv.innerHTML="";if(typeof _gb[this._iSelectedPanel].content=="string")
this._bT.innerHTML+=_gb[this._iSelectedPanel].content;else this._bT.appendChild(_gb[this._iSelectedPanel].content);}
this._oPanelRowPane.style.width=2*_dP+this._oInfoDisplaySize.width+"px";this._oPanelDiv.style.width=this._oInfoDisplaySize.width+"px";this._oPanelDiv.style.top=_dP+"px";this._bZ.style.top=_dP+this._oPanelDiv.offsetHeight+"px";this._bS.style.top=_dP+this._oPanelDiv.offsetHeight+this._oInfoDisplaySize.height+"px";this._oPanelLeftPane.style.height=this._oPanelDiv.offsetHeight+"px";this._oPanelRightPane.style.height=this._oPanelDiv.offsetHeight+"px";this._b3.style.top=_dP+this._oPanelDiv.offsetHeight+this._oInfoDisplaySize.height+_dP+"px";}
this.setPosition=function(){var _oj=this._oCoord;var _pu=this._bI._ka(_oj);var _nz=new _fn(this._cK.x,(-this._oInfoDisplaySize.height-3*_dP+this._cK.y) );_pu=new _fn(_pu.x+_nz.x,_pu.y+_nz.y);_pu=new _fn(_pu.x,_pu.y-this._oPanelDiv.offsetHeight);this._di.style.position="absolute";this._di.style.top=_pu.y+"px";this._di.style.left=_pu.x+"px";this._cW.style.width=(2*this._oInfoDisplaySize.width+20+this._oPanelDiv.offsetHeight)+"px";this._cW.style.height=this._oInfoDisplaySize.height+this._oPanelDiv.offsetHeight+"px";this._cW.style.top=_pu.y+65+"px";this._cW.style.left=_pu.x+"px";if(this._b5.shadow)
this._cW.style.display="";else this._cW.style.display="none";}
this.updateDisplayContent=function(_gb){if(!this._mp()){if(_gb!=null) 
this._arrPanels=_gb;else throw "Invalid _hb.";if(this._iSelectedPanel>=_gb.length)
this._iSelectedPanel=0;this.initializeInfoDisplay(_gb);this.setPosition();}};this._rg=function(_gb){if(_gb!=null) 
this._arrPanels=_gb;else throw "Invalid _hb.";this._bT.innerHTML="";this._oInnerPanel[this._iPreSelectedPanel].style.background='#F3F3F3';this._oInnerPanel[this._iSelectedPanel].style.background='#289452';this._iPreSelectedPanel=this._iSelectedPanel;if(typeof _gb[this._iSelectedPanel].content=="string")
this._bT.innerHTML=_gb[this._iSelectedPanel].content;else this._bT.appendChild(_gb[this._iSelectedPanel].content);};this._tM=function(_oj){if( _oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";var _gb=this._j6();var _oX=this._ki();if(_oX==null||!(_oX instanceof _fD)) 
throw "Invalid Size of info display";var _pt=this._j8();if(_pt==null||!(_pt instanceof _fn))
throw "Offset is not set";var _ml=this._kh();if(_gb.length>1)
this.selectPanel(_ml);this._oCoord=_oj;this.setPosition();};this.reset=function(_oj,_gb,_qf,_pt,_mm){if( _oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";else this._oCoord=_oj;if(typeof _mm=="number")
this._iSelectedPanel=_mm;if(typeof _mm=="undefined")
this._iSelectedPanel=0;this._iPreSelectedPanel=this._iSelectedPanel;if(_gb!=null) 
this._arrPanels=_gb;else throw "Invalid _hb.";if(_qf!=null&&_qf instanceof _fD) 
this._oInfoDisplaySize=_qf;else this._oInfoDisplaySize=new _fD(AG_DEFAULT_INFO_DISPLAY_SIZE.width,AG_DEFAULT_INFO_DISPLAY_SIZE.height)
var _oY=this._bI._j5(_fl.FLOAT_PANE);if(_pt!="undefined"&&_pt instanceof _fn)
this._cK=_pt;else this._cK=new _fn(0,0);this._di.style.position="absolute";this.show();if(this._oInfoDisplaySize.width!=parseInt(this._bT.style.width)||this._oInfoDisplaySize.height!=parseInt(this._bT.style.height)){this._dc.style.width=this._oInfoDisplaySize.width+(2*_dP)+"px";this._da.style.width=this._oInfoDisplaySize.width+"px";this._da.style.left=_dP+"px";this._db.style.left=parseInt(_dP+this._oInfoDisplaySize.width)+"px";this._bZ.style.width=(this._oInfoDisplaySize.width+2*_dP )+"px";this._bZ.style.height=this._oInfoDisplaySize.height+"px";this._bX.style.height=this._oInfoDisplaySize.height+"px";this._bT.style.width=this._oInfoDisplaySize.width+"px";this._bT.style.height=this._oInfoDisplaySize.height+"px";this._bY.style.height=this._oInfoDisplaySize.height+"px";this._bY.style.left=_dP+this._oInfoDisplaySize.width+"px";this._bS.style.width=this._oInfoDisplaySize.width+(2*_dP)+"px";this._bQ.style.width=this._oInfoDisplaySize.width+"px";this._bQ.style.left=_dP+"px";this._bR.style.left=parseInt(_dP+this._oInfoDisplaySize.width)+"px";}
this.initializeInfoDisplay(_gb);this.setPosition();this._b5=this._bI._jB();if(this._b5.stationary)
this._nd();var _ia=this._b5.opacity;if(_ew._gN=="Explorer"){this._c9.style.MozOpacity=_ia;this._c9.style.filter="alpha(opacity="+(_ia*100)+")";this._c9.style.opacity=_ia;this._da.style.MozOpacity=_ia;this._da.style.filter="alpha(opacity="+(_ia*100)+")";this._da.style.opacity=_ia;}
else {this._dc.style.MozOpacity=_ia;this._dc.style.filter="alpha(opacity="+(_ia*100)+")";this._dc.style.opacity=_ia;}
this._oPanelLeftPane.style.MozOpacity=_ia;this._oPanelLeftPane.style.filter="alpha(opacity="+(_ia*100)+")";this._oPanelLeftPane.style.opacity=_ia;this._oPanelRightPane.style.MozOpacity=_ia;this._oPanelRightPane.style.filter="alpha(opacity="+(_ia*100)+")";this._oPanelRightPane.style.opacity=_ia;this._bX.style.MozOpacity=_ia;this._bX.style.filter="alpha(opacity="+(_ia*100)+")";this._bX.style.opacity=_ia;this._bY.style.MozOpacity=_ia;this._bY.style.filter="alpha(opacity="+(_ia*100)+")";this._bY.style.opacity=_ia;this._bP.style.MozOpacity=_ia;this._bP.style.filter="alpha(opacity="+(_ia*100)+")";this._bP.style.opacity=_ia;this._bQ.style.MozOpacity=_ia;this._bQ.style.filter="alpha(opacity="+(_ia*100)+")";this._bQ.style.opacity=_ia;this._bR.style.MozOpacity=_ia;this._bR.style.filter="alpha(opacity="+(_ia*100)+")";this._bR.style.opacity=_ia;this._b3.style.MozOpacity=_ia;this._b3.style.filter="alpha(opacity="+(_ia*100)+")";this._b3.style.opacity=_ia;this._cW.style.MozOpacity=_ia;this._cW.style.opacity=_ia;var infoDisplayHeight=_dP+this._oPanelDiv.offsetHeight+this._oInfoDisplaySize.height+2*_dP;var infoDisplayWidth=_dP+this._oInfoDisplaySize.width+_dP;var _gR=new _fD(infoDisplayWidth,infoDisplayHeight);this._sd(_oj,this._cK,_gR);};this._sd=function(_oj,_pt,_gR){var _qT=0,_qU=0;var _pu=this._bI._kb(_oj);_pu=new _fn(_pu.x+_pt.x,_pu.y+_pt.y);var _nh=this._bI._ki().width;var _nf=this._bI._ki().height;if((_pu.x+_gR.width)>_nh)
_qT=_nh-(_pu.x+_gR.width);if(_pu.y<_gR.height)
_qU=_gR.height-_pu.y;if((_pu.y)>_nf)
_qU=_nf-_pu.y;if(_pu.x<0)
_qT=-(_pu.x);if(_qT==0&&_qU==0)
return;if(_qT>0)
_qT+=AG_PAN_MARGIN.x;else if(_qT<0)
_qT-=AG_PAN_MARGIN.x;if(_qU>0)
_qU+=AG_PAN_MARGIN.y;else if(_qU<0)
_qU-=AG_PAN_MARGIN.y;var _pk=new _fn(_qT,_qU);this._bI._rO(_fm.DRAG);this._bI._qP(_pk.x,_pk.y);this._bI._rO(_fm.DEFAULT);};this._nd=function(){this._b5.stationary=true;var oInitialCoord=this._j9();this._cn=this._bI._kb(oInitialCoord);var _nz=new _fn(this._cK.x,(-this._oInfoDisplaySize.height-3*_dP+this._cK.y) );this._cn=new _fn((this._cn.x+_nz.x),(this._cn.y+_nz.y));};this._mu=function(){return this._bI!=null;};this.hide=this.hide;this.show=this.show;this.isVisible=this._mB;this.getPoint=this._j9;this.getPixelOffset=this._j8;this.getSelectedPanel=this._kh;this.getPanels=this._j6;this.reset=this.reset;}	
var AGInfoDisplay=_eZ;

function _e1(_mQ,_lj,_ia,_nM,_mm,_gL,_ja,_i9,_mZ,_gQ,_gO){if(typeof _mm!="number")
this.selectedPanel=0;else this.selectedPanel=parseInt(_mm);if(typeof _mQ!="number")
this.width=AG_DEFAULT_INFO_DISPLAY_SIZE.width;else this.width=parseInt(_mQ);if(typeof _lj!="number")
this.height=AG_DEFAULT_INFO_DISPLAY_SIZE.height;else this.height=parseInt(_lj);if(typeof _ia!="number")
this.opacity=AG_DEFAULT_INFO_DISPLAY_OPACITY;else this.opacity=parseFloat(_ia);if(typeof _gL!="boolean")
this.noCloseOnClick=false;else this.noCloseOnClick=_gL;if(typeof _ja=="function")
this.onOpenFn=_ja;if(typeof _i9=="function") 
this.onCloseFn=_i9;if(typeof _mZ=="number")
this.zoomLevel=parseInt(_mZ);else this.zoomLevel=AG_DEFAULT_BLOWUP_ZOOM_LEVEL;if(_nM!=null&&_nM instanceof _fn)
this.pixelOffset=_nM;else this.pixelOffset=new _fn(0,0);if(typeof _gQ!="boolean")
this.stationary=false;else this.stationary=_gQ;if(typeof _gO!="boolean")
this.shadow=true;else this.shadow=_gO;this.copy=function(){return new _e1(this.width,this.height,this.opacity,this.pixelOffset,this.selectedPanel,this.noCloseOnClick,this.onOpenFn,this.onCloseFn,this.zoomLevel,this.stationary,this.shadow);};}
var AGInfoDisplayOptions=_e1;

function _e2(_s1,_hb){if(_hb==null )
_hb="";this.label=_s1;this.content=_hb;}
var AGInfoDisplayPanel=_e2;

function _e0(){}
_e0.closeBtnClickHandler=function(e){var _oV=e.data.infoDisplay;_eP.trigger(_oV,"oncloseclick");_oV.hide();return false;};_e0.panelClickHandler=function(e){e=e||window.event;if(!e)
return false;oAGInfoDisplay=e.data.infoDisplay;var _ru=e.data.clickIndex;oAGInfoDisplay.selectPanel(_ru);return false;};

function _eE(_iX,_i0){if( typeof _iX!="number"||typeof _i0!="number" )
throw "Invalid input for _m1-longitude.";this._7=parseFloat(_iX.toFixed(AG_COORD_PRECISION_AMOUNT));this._8=parseFloat(_i0.toFixed(AG_COORD_PRECISION_AMOUNT));this._m1=function(){return this._7;};this.longitude=function(){return this._8;};this._iM=function(_os){if(_os==null||!(_os instanceof _eE))
throw "Invalid Coord";if(this._7==_os._m1()&&this._8==_os.longitude())
return true;return false;};this.copy=function(){return new _eE(this._7,this._8);}
this._tJ=function(){return this._7+","+this._8;}
this.latitude=this._m1;this.longitude=this.longitude;this.equals=this._iM;this.toString=this._tJ;}
var AGCoord=_eE;

function _ev(_ok,_ol){if(_ok==null||!(_ok instanceof _eE)||_ol==null||!(_ol instanceof _eE))
throw "Invalid _m1-longitude.";var _iY=parseFloat(_ok._m1());var _iZ=parseFloat(_ol._m1());var _i1=parseFloat(_ok.longitude());var _i2=parseFloat(_ol.longitude());var _i6=(_iY<_iZ) ? _iY : _iZ;var _i4=(_iY>_iZ) ? _iY : _iZ;var _i7=(_i1<_i2) ? _i1 : _i2;var _i5=(_i1>_i2) ? _i1 : _i2;this._c1=new _eE(_i6,_i7);this._cD=new _eE(_i4,_i5);this._iM=function(_n8){if( _n8==null||!(_n8 instanceof _ev))
throw "Invalid Rectangle";if(_n8._c1._iM(this._c1)||_n8._cD._iM(this._cD))
return true;else return false;};this._g7=function(_oj){if(_oj==null||!(_oj instanceof _eE))
throw "Invalid Coord";if(_oj._m1()<=this._cD._m1()&&_oj._m1()>=this._c1._m1()&&_oj.longitude()<=this._cD.longitude()&&_oj.longitude()>=this._c1.longitude())
return true;else return false;};this._l0=function(_n8){if(_n8==null||!(_n8 instanceof _ev))
throw "Invalid Rectangle";if(_n8._c1.longitude()>this._cD.longitude()||_n8._c1._m1()>this._cD._m1()||_n8._cD.longitude()<this._c1.longitude()||_n8._cD._m1()<this._c1._m1())
return false;else return true;};this._g6=function(_n8){if( _n8==null||!(_n8 instanceof _ev))
throw "Invalid Rectangle";if(_n8._cD.longitude()<=this._cD.longitude()&&_n8._cD._m1()<=this._cD._m1()&&_n8._c1.longitude()>=this._c1.longitude()&&_n8._c1._m1()>=this._c1._m1())
return true;else return false;};this._iQ=function(_oj){if( _oj==null||!(_oj instanceof _eE))
throw "Invalid Coord";if(this._cD._m1()<_oj._m1())
this._cD._7=_oj._m1();if(this._c1._m1()>_oj._m1())
this._c1._7=_oj._m1();if(this._cD.longitude()<_oj.longitude())
this._cD._8=_oj.longitude();if(this._c1.longitude()>_oj.longitude())
this._c1._8=_oj.longitude();};this._kk=function(){return this._c1;};this._j1=function(){return this._cD;};this._kj=function(){return new _eE(this._c1._m1(),this._cD.longitude());};this._j2=function(){return new _eE(this._cD._m1(),this._c1.longitude());};this._tI=function(){return new _eE(Math.abs(this._c1._m1()-this._cD._m1()),Math.abs(this._c1.longitude()-this._cD.longitude()));};this._tJ=function(){return this._cD._tJ()+","+this._c1._tJ();};this._mn=function(){if(this._c1._m1()==this._cD._m1()&&this._cD.longitude()==this._c1.longitude())
return true;else return false;};this._jr=function(){return new _eE((this._c1._m1()+this._cD._m1())/2,(this._cD.longitude()+this._c1.longitude())/2);};this.copy=function(){return new _ev(this._cD.copy(),this._c1.copy());};this.equals=this._iM;this.containsCoord=this._g7;this.intersects=this._l0;this.containsBoundingBox=this._g6;this.extend=this._iQ;this.getSouthWest=this._kk;this.getNorthEast=this._j1;this.getSouthEast=this._kj;this.getNorthWest=this._j2;this.toSpan=this._tI;this.isEmpty=this._mn;this.getCentre=this._jr;}
var AGBoundingBox=_ev;

function _fd(){}
_fd.doubleClickCount=0;_fd.mouseDownEvent=null;_fd.iMouseMoveCount=0;var _pi=null;_fd.getMouseCoords=function(e){e=e||window.event;if(e.pageX||e.pageY){if(e.type=="DOMMouseScroll"){if(_ew._gN=="Firefox"&&_ew.VERSION<3)
return new _fn(e.pageX/15,e.pageY/15);else return new _fn(e.pageX,e.pageY);}
else return new _fn(e.pageX,e.pageY);}
else if(e.clientX||e.clientY){var _qX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;var _qY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;return new _fn(_qX,_qY);}
return new _fn(0,0);};_fd.isRightButton=function(e){var _rn=false;e=e||window.event;if(e.which) 
_rn=(e.which==3);else if(e.button) 
_rn=(e.button==2);return _rn;};_fd.handleRightButtonClick=function(){var _nH=_fd.mouseDownEvent.data;if(_fd.doubleClickCount>=2 ){} 
else if( _fd.doubleClickCount % 2==1 ){if(_nH._hc()){var _hR=_nH._ju();var _pG=_fd.getMouseOffset(_fd.mouseDownEvent,_hR);_eA.showContextMenu(_nH,_pG);}}
_fd.doubleClickCount=0;return false;};_fd.getMouseOffset=function(e,_oR){e=e||window.event;var _h9=_fd.getPosition(_oR);var _ns=_fd.getMouseCoords(e);return new _fn((_ns.x-_h9.x),(_ns.y-_h9.y));};_fd.getPosition=function(e){var _ls=0;var _mI=0;while(e.offsetParent){_ls+=e.offsetLeft;_mI+=e.offsetTop;e=e.offsetParent;}
_ls+=e.offsetLeft;_mI+=e.offsetTop;return new _fn(_ls,_mI);};_fd.doubleClickHandler=function(e){var _nH=e.data;if(_nH._hc())
_eA.hideContextMenu(_nH);var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var _oa=_nH._js(_pL);var oClickedCoord=_nH._jy(_pL);_eP.trigger(_nH,"ondblclick",_oa,oClickedCoord);if(_oa!=null&&_oa instanceof _fa){_eP.trigger(_oa,"ondblclick",oClickedCoord);return false;}
if(_nH._tY()){var _k6=_nH._kD();if(_k6<_nH._jZ()){var _lP=_k6+1;var _gp=_nH._ju();var _pz=_fd.getMouseOffset(e,_gp);var oCoordClicked=_nH._jz(_pz);_nH._gY(oCoordClicked,_lP);}}
return false;};_fd.bDrag=false;_fd.oPointLastMousePosition=null;_fd._oK=null;_fd.oPointDragStart=null;_fd.oPointDragStop=null;_fd.mouseDownHandler=function(e){var _nH=e.data;_nH._hM();_fd.mouseDownEvent=e;if(_fd.isRightButton(e)){_fd.doubleClickCount++;setTimeout("_fd.handleRightButtonClick();",250);return false;}
if(_nH._hc())
_eA.hideContextMenu(_nH);var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var _oa=_nH._js(_pL);if(_oa!=null&&_oa instanceof _fa){var oClickedCoord=_nH._jy(_pL);_eP.trigger(_oa,"onmousedown",oClickedCoord);return false;}
if(_nH._if()){_fd.bDrag=true;_nH.setCursor();var _hR=_nH._ju();_fd.oPointDragStart=_fd.getMouseOffset(e,_hR);_fd._oK=_nH._jE();return false;}
if(_nH._cv instanceof _e6){if(_nH._ie()){var oMouseTargetPane=_nH._j5(_fl.MOUSE_TARGET_PANE);oMouseTargetPane.style.cursor=_nH._cv.draggingCursor;}}
if(_nH._ie()){_fd.bDrag=true;_fd.oPointLastMousePosition=_fd.getMouseCoords(e);_fd.iMouseMoveCount=0;}
return false;};_fd.mouseMoveHandler=function(e){var _nH=e.data;var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var _oa=_nH._js(_pL);var oClickedCoord=_nH._jy(_pL);if(_oa!=null&&_pi==null){_eP.trigger(_oa,"onmouseover",oClickedCoord);}
else if(_pi!=null&&_oa!=_pi){_eP.trigger(_pi,"onmouseout",oClickedCoord);} 
_pi=_oa;_eP.trigger(_nH,"onmousemove",oClickedCoord);if(_fd.bDrag){if(_nH._if()){var _hR=_nH._ju();var _pF=_fd.getMouseOffset(e,_hR);var _mQ=Math.abs(_fd.oPointDragStart.x-_pF.x);var _lj=Math.abs(_fd.oPointDragStart.y-_pF.y);var _ls=(_fd.oPointDragStart.x<=_pF.x) ? _fd.oPointDragStart.x : _pF.x;var _mI=(_fd.oPointDragStart.y<=_pF.y) ? _fd.oPointDragStart.y : _pF.y;var oCoordTopLeft=_nH._jz(new _fn(_ls,_mI));_fd._oK.reset(oCoordTopLeft,new _fD(_mQ,_lj));return false;}
var _pB=_fd.getMouseCoords(e);var _qT=_pB.x-_fd.oPointLastMousePosition.x;var _qU=_pB.y-_fd.oPointLastMousePosition.y;_nH._nu(new _fn(_qT,_qU));_fd.oPointLastMousePosition=_pB;_fd.iMouseMoveCount++;if(_fd.iMouseMoveCount==1) 
 _eP.trigger(_nH,"ondragstart");_eP.trigger(_nH,"ondrag");return false;}
if(_oa!=null&&_oa instanceof _fa ){_eP.trigger(_oa,"onmousemove",oClickedCoord);return false;}
return false;};_fd.mouseUpHandler=function(e,_gx){if(typeof _gx!="boolean")
_gx=false;var _nH=e.data;if(_fd.bDrag){_fd.bDrag=false;if(_nH._if()){_nH.setCursor();_fd._oK.hide();if(_gx) 
 return;var _hR=_nH._ju();_fd.oPointDragStop=_fd.getMouseOffset(e,_hR);if(_fd.oPointDragStart._iM(_fd.oPointDragStop))
return false;var _ow=_nH._jz(_fd.oPointDragStart);var _ox=_nH._jz(_fd.oPointDragStop);var oBoundingBoxSelected=new _ev(_ow,_ox);var _mZ=_nH._jo(oBoundingBoxSelected);_mZ=(_mZ>_nH._kD() ) ? _mZ : _nH._kD();_nH._gY(oBoundingBoxSelected._jr(),_mZ);return false;}
_nH.setCursor();var _pB=_fd.getMouseCoords(e);var _qT=_pB.x-_fd.oPointLastMousePosition.x;var _qU=_pB.y-_fd.oPointLastMousePosition.y;_nH._nu(new _fn(_qT,_qU));_nH._rO(_fm.DRAG);_nH._kI(_fe.PAN);_nH._kH(_fe.PAN);_nH._rO(_fm.DEFAULT);if(_fd.iMouseMoveCount>0){_fd.iMouseMoveCount=0;_eP.trigger(_nH,"ondragend");}
return false;}
var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var _oa=_nH._js(_pL);if(_oa!=null&&_oa instanceof _fa){var oClickedCoord=_nH._jy(_pL);_eP.trigger(_oa,"onmouseup",oClickedCoord);return false;}
return false;};_fd.mouseOutHandler=function(e){var _nH=e.data;var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var oClickedCoord=_nH._jy(_pL);if(_pi!=null){_eP.trigger(_pi,"onmouseout",oClickedCoord);_pi=null;}
_eP.trigger(_nH,"onmouseout",oClickedCoord);_fd.mouseUpHandler(e,true);return false;};window.onscroll=function(_iN){if(_iN.preventDefault)
_iN.preventDefault();else _iN.returnValue=false;};_fd.mouseScrollHandler=function(e){e=e||window.event;var _mh=0;var _nH=e.data;if(_nH._hc())
_eA.hideContextMenu(_nH);if(_nH._nt()){if(e.wheelDelta){_mh=e.wheelDelta/120;var _gM=_ew._gN=="Opera"&&_ew.VERSION<=9.02;if(_gM)
_mh=-_mh;}
else if(e.detail) 
_mh=-e.detail/3;var _k6=_nH._kD();var _hR=_nH._ju();var _pZ;if(_ew._gN=="Firefox"&&_ew.VERSION<3)
_pZ=_fd.getMouseCoords(e);else _pZ=_fd.getMouseOffset(e,_hR);var oCoordToBeScrolled=_nH._jz(_pZ);var _nR=_nH._ki();var _l6=parseInt( _pZ.x-_nR.width/2);var _l7=parseInt( _pZ.y-_nR.height/2);var _pX=new _fn(_l6,_l7);if(_mh<0){if(_k6>_nH._j0()){var oBoundingBoxCurrent=_eF.getBoundingBoxForZoomAtPoint(oCoordToBeScrolled,_k6-1,_nR,_pX);_fQ.zoomOnRedDisplayAnimation(_nH,_pZ,0);_nH._gY(oBoundingBoxCurrent._jr(),_k6-1);return false;}
else {return false;}}
else {if(_k6<_nH._jZ()){var oBoundingBoxCurrent=_eF.getBoundingBoxForZoomAtPoint(oCoordToBeScrolled,_k6+1,_nR,_pX);_fQ.zoomOnRedDisplayAnimation(_nH,_pZ,1);_nH._gY(oBoundingBoxCurrent._jr(),_k6+1);return false;}
else {return false;}}
if(e.preventDefault)
e.preventDefault();else e.returnValue=false;}
else {return false;}
return false;};_fd.clickHandler=function(e){var _nH=e.data;if(_fd.isRightButton(e)&&_nH._hc()){var _hR=_nH._ju();var _pG=_fd.getMouseOffset(e,_hR);_eA.showContextMenu(_nH,_pG);return false;}
if(_nH._hc())
_eA.hideContextMenu(_nH);var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var _oa=_nH._js(_pL);var oClickedCoord=_nH._jy(_pL);_eP.trigger(_nH,"onclick",_oa,oClickedCoord);if(_oa!=null){_eP.trigger(_oa,"onclick",oClickedCoord);return false;}};_fd.mouseOverHandler=function(e){var _nH=e.data;var _hU=_nH._j5(_fl.MAP_CONTAINER);var _pL=_fd.getMouseOffset(e,_hU);var oClickedCoord=_nH._jy(_pL);var _oa=_nH._js(_pL);if(_oa!=null&&_pi==null){_eP.trigger(_oa,"onmouseover",oClickedCoord);}
else if(_pi!=null&&_oa!=_pi){_eP.trigger(_pi,"onmouseout",oClickedCoord);}
_pi=_oa;_eP.trigger(_nH,"onmouseover",oClickedCoord);return false;};

function _eF(){}
_eF.getBoundingBoxForZoom=function(_om,_mZ,_qh){var _li=parseInt(_qh.width/2);var _lh=parseInt(_qh.height/2);var _nS=_fJ.getTMSTileInfo(_mZ,_om);var _nU=_nS._jn();var _m3=_nU._j2();var _rk=_nU._kj();var _h4=parseFloat( Math.abs( parseFloat(_m3._m1()-_rk._m1())));var _h7=parseFloat( Math.abs( parseFloat(_rk.longitude()-_m3.longitude())));var _mH=AG_TILE_SIZE.width;var _mF=AG_TILE_SIZE.height;var _m4=_om._m1()+parseFloat(_h4*_lh / _mF);var _rl=_om._m1()-parseFloat(_h4*_lh / _mF);var _m5=_om.longitude()-parseFloat(_h7*_li / _mH);var _rm=_om.longitude()+parseFloat(_h7*_li / _mH);var _pb=new _eE(_m4,_rm);var _qp=new _eE(_rl,_m5);return new _ev(_qp,_pb);};_eF.getBoundingBoxForPan=function(_nW,_qh,_pX){var _lz=_qh.width;var _lw=_qh.height;var _mq=_pX.x;var _mr=_pX.y;var _oZ=_nW._j2();var _qa=_nW._kj();var _h4=parseFloat(_oZ._m1()-_qa._m1());var _h7=parseFloat(_qa.longitude()-_oZ.longitude());var _ip=parseFloat((_mq*_h7) / _lz);var _io=parseFloat((_mr*_h4) / _lw);var _h5=_oZ._m1()+_io;var _h6=_oZ.longitude()-_ip;var _ik=_qa._m1()+_io;var _il=_qa.longitude()-_ip;var _pb=new _eE(_h5,_il);var _qp=new _eE(_ik,_h6);return new _ev(_qp,_pb);};_eF.getBoundingBoxForZoomAtPoint=function(_on,_mZ,_qh,_pX){var _nZ=_eF.getBoundingBoxForZoom(_on,_mZ,_qh);var _nY=_eF.getBoundingBoxForPan(_nZ,_qh,_pX);return _nY;};_eF.getBoundingBoxForResize=function(_n2,_qm,_qk){var _lo=_qk.width-_qm.width;var _ln=_qk.height-_qm.height;var oCoordSpan=_n2._tI();var oCoordOldBottomRight=_n2._kj();var _hB=oCoordSpan.longitude()*_lo / _qm.width;var _in=oCoordOldBottomRight.longitude()+_hB;var _ht=oCoordSpan._m1()*_ln / _qm.height;var _im=oCoordOldBottomRight._m1()-_ht;var oCoordNewTopLeft=_n2._j2();var oCoordNewBottomRight=new _eE(_im,_in);return new _ev(oCoordNewTopLeft,oCoordNewBottomRight);};_eF.getScaleForBoundingBox=function(_n1,_qh){var _ib=0.1;var oCoordSpan=_n1._tI();var dLat=oCoordSpan._m1();var dLong=oCoordSpan.longitude();var _hA=_qh.width / dLong;var _it=_qh.height / dLat;var _h8=(_hA>_it) ? _hA : _it;return 111322222.0 /(_ib*_h8);};

function _fv(){this._kv=function(_qz){throw "You must implement _kv function.";};}
var AGRequestManager=_fv;

function _fK(_s6,_sG){if(typeof _s6!="string"||_s6.length==0)
_s6=AG_TMS_URL;if(typeof _sG!="string"||_sG.length==0)
_sG=AG_TMS_DEFAULT_DATA_SET;this.mapServerUrl=_s6;this.dataSet=_sG;this._hr=AG_TMS_DATASET_TAG;this.ZOOMLEVEL_TAG=AG_TMS_ZOOM_LEVEL_TAG;this._tT=AG_TMS_X_TAG;this._tW=AG_TMS_Y_TAG;this.copy=function(){return new _fK(this.mapServerUrl,this.dataSet);};}
var AGTMSOptions=_fK;

_fL.prototype=new _fv;function _fL(_qE){if(typeof _qE=="undefined"||_qE==null)
_qE=AG_DEFAULT_TMS_OPTIONS;if(!(_qE instanceof _fK))
throw "Invalid MapServerOptions in _fL.";this._cR=_qE.copy();this._kv=function(_qz){var _mZ=_qz._kD();var _mR=_qz._kA();var _mU=_qz._kB();var _tc=this._cR.mapServerUrl;_tc+="?"+"REQUEST"+"="+"GetTileAG";_tc+="&"+this._cR._hr+"="+this._cR.dataSet;_tc+="&"+this._cR.ZOOMLEVEL_TAG+"="+_mZ;_tc+="&"+this._cR._tT+"="+_mR;_tc+="&"+this._cR._tW+"="+_mU;return _tc;};}
var AGTMSRequestManager=_fL;

function _eK(_s6,_s3,_tn,_mM,_sQ,_tv,_sE,_sL){if(typeof _s6!="string"||_s6.length==0)
_s6=AG_DMS_URL;if(typeof _s3!="string"||_s3.length==0)
_s3=AG_DMS_DEFAULT_LAYERS;if(typeof _tn!="string"||_tn.length==0)
_tn=AG_DMS_DEFAULT_STYLES;if(typeof _mM!="number")
_mM=AG_DMS_DEFAULT_TRANSPARENCY;if(typeof _sQ!="string"||_sQ.length==0)
_sQ=AG_DMS_FORMAT;if(typeof _tv!="string"||_tv.length==0)
_tv=AG_DMS_VERSION;if(typeof _sE!="string"||_sE.length==0)
_sE=AG_DMS_CRS;if(typeof _sL!="string"||_sL.length==0)
_sL=AG_DMS_DEFAULT_EXCEPTIONS;this._rh="REQUEST";this._tN="VERSION";this._hk="CRS";this._gt="BBOX";this._tQ="WIDTH";this._kM="HEIGHT";this._jc="FORMAT";this._m2="LAYERS";this._tz="STYLES";this._tL="TRANSPERANCY";this._iP="EXCEPTIONS";this._iS="OPTIONS";this.mapServerUrl=_s6;this.format=_sQ;this.layers=_s3;this.styles=_tn;this.transparency=parseInt(_mM);this.version=_tv;this.crs=_sE;this.exceptions=_sL;this.copy=function(){return new _eK(this.mapServerUrl,this.layers,this.styles,this.transparency,this.format,this.version,this.crs,this.exceptions);};}
var AGDMSOptions=_eK;

_eL.prototype=new _fv;function _eL(_oJ){if(typeof _oJ=="undefined"||_oJ==null)
_oJ=AG_DEFAULT_DMS_OPTION;if(!(_oJ instanceof _eK))
throw "Invalid MapServerOptions in _eL.";this._cR=_oJ.copy();this._kv=function(_qz){var _lf=Math.ceil((_qz._kA()+1) / AG_DMS_TILE_GROUP_COLS );var _lg=Math.ceil((_qz._kB()+1) / AG_DMS_TILE_GROUP_ROWS );var _lC=_lf*AG_DMS_TILE_GROUP_COLS-1;var _lG=(_lf-1)*AG_DMS_TILE_GROUP_COLS;var _lD=_lg*AG_DMS_TILE_GROUP_ROWS-1;var _lH=(_lg-1)*AG_DMS_TILE_GROUP_ROWS;var _k7=_qz._kA()-_lG;var _k8=_qz._kB()-_lH;var _n0=_fJ.getBBoxOfTile(_qz._kD(),_lG,_lH);var _n3=_fJ.getBBoxOfTile(_qz._kD(),_lC,_lD);var _op=_n0._j2();var _np=_op.longitude();var _nk=_op._m1();var _ov=_n3._kj();var _nj=_ov.longitude();var _nq=_ov._m1();var _sp=_np+","+_nq+","+_nj+","+_nk;var tW=AG_TILE_SIZE.width*AG_DMS_TILE_GROUP_COLS;var tH=AG_TILE_SIZE.height*AG_DMS_TILE_GROUP_ROWS;var _tc=this._cR.mapServerUrl;_tc+="?"+this._cR._rh+"="+"GetTiledMap2AG";_tc+="&"+this._cR._tN+"="+this._cR.version;_tc+="&"+this._cR._hk+"="+this._cR.crs;_tc+="&"+this._cR._gt+"="+"TILE:TOTALEXTENT:"+_sp+",TOTALTILES:"+AG_DMS_TILE_GROUP_COLS+","+AG_DMS_TILE_GROUP_ROWS+",CURRENTTILE:"+_k8+","+_k7;_tc+="&"+this._cR._tQ+"="+tW;_tc+="&"+this._cR._kM+"="+tH;_tc+="&"+this._cR._jc+"="+this._cR.format;_tc+="&"+this._cR._m2+"="+this._cR.layers;_tc+="&"+this._cR._tz+"="+this._cR.styles;_tc+="&"+this._cR._tL+"="+this._cR.transparency;return _tc;};}
var AGDMSRequestManager=_eL;

function _fc(){this.initialize=function(_nH){throw "You must implement this";};this.remove=function(){throw "You must implement this";};this.show=function(_ob){throw "You must implement this";};this.hide=function(){throw "You must implement this";};}
var AGMenu=_fc;

function _eB(_og,_ss,_st,_tp,_tr,_sN,_ld,_sO,_sP,_kZ,_sv,_su,_sW,_tq,_lk,_lu,_mK){if( _og!=null&&_og instanceof _fD)
this.contextSize=_og;else this.contextSize=_d0.contextSize.copy();if(typeof _ss=="string")
this.backgroundColour=_ss;else this.backgroundColour=_d0.backgroundColour;if(typeof _st=="string")
this.selectionBackgroundColour=_st;else this.selectionBackgroundColour=_d0.selectionBackgroundColour;if(typeof _tp=="string")
this.textColour=_tp;else this.textColour=_d0.textColour;if(typeof _tr=="string") 
this.selectionTextColour=_tr;else this.selectionTextColour=_d0.selectionTextColour;if(typeof _sN=="string")
this.fontFamily=_sN;else this.fontFamily=_d0.fontFamily;if(typeof _ld=="number")
this.fontSize=_ld;else this.fontSize=_d0.fontSize;if(typeof _sO=="string")
this.fontStyle=_sO;else this.fontStyle=_d0.fontStyle;if(typeof _sP=="string")
this.fontWeight=_sP;else this.fontWeight=_d0.fontWeight;if(typeof _kZ=="number")
this.borderWidth=_kZ;else this.borderWidth=_d0.borderWidth;if(typeof _sv=="string")
this.borderStyle=_sv;else this.borderStyle=_d0.borderStyle;if(typeof _su=="string")
this.borderColour=_su;else this.borderColour=_d0.borderColour;if(typeof _sW=="string")
this.iconBackgroundColour=_sW;else this.iconBackgroundColour=_d0.iconBackgroundColour;if(typeof _tq=="string")
this.disabledTextColour=_tq;else this.disabledTextColour=_d0.disabledTextColour;if(typeof _lk=="number") 
this.iconWidth=_lk;else this.iconWidth=_d0.iconWidth;if(typeof _lu=="number") 
this.leftMargin=_lu;else this.leftMargin=_d0.leftMargin;if(typeof _mK=="number") 
this.topMargin=_mK;else this.topMargin=_d0.topMargin;this.copy=function(){return new _eB(this.contextSize,this.backgroundColour,this.selectionBackgroundColour,this.textColour,this.selectionTextColour,this.fontFamily,this.fontSize,this.fontStyle,this.fontWeight,this.borderWidth,this.borderStyle,this.borderColour,this.iconBackgroundColour,this.disabledTextColour,this.iconWidth,this.leftMargin,this.topMargin);};}
var AGContextMenuOptions=_eB;

function _ez(_to,_kJ,_sX,_gB){if(typeof _to!="string")
throw "invalid text";if(typeof _kJ=="undefined")
throw "invalid _kJ";if(typeof _gB!="boolean")
_gB=true;this._dB=_to;this._5=_kJ;this._x=_gB;if(typeof _to=="string"&&_to.length>0)
this._dB=_to;else this._dv=null;if(typeof _sX=="string"&&_sX.length>0)
this._dv=_sX;else this._dv=null;this._kr=function(){return this._dB;};this._jJ=function(){return this._5;};this._jM=function(){return this._dv;};this._iw=function(){this._x=true;};this._hC=function(){this._x=false;};this._mo=function(){return this._x;};this.getText=this._kr;this.getHandler=this._jJ;this.getIconUrl=this._jM;}
var AGContextMenuItem=_ez;

function _eA(){}
_eA.clicked=function(e){var _oC=e.data.map;var _jf=e.data._kJ;var _oc=e.data.contextMenu;_oc.hide();try
{_jf(_oC,_oc._ke());}
catch(err){}
return false;};_eA.mouseOverHandler=function(e){var _oz=e.data.oCurrentMenuItem;var _oA=e.data.oCurrentMenuItemIcon;var _oB=e.data.oCurrentMenuItemText;var _oD=e.data.oAGContextMenuOption;_oz.style.backgroundColor=_oD.selectionBackgroundColour;_oA.style.backgroundColor=_oD.selectionBackgroundColour;_oB.style.backgroundColor=_oD.selectionBackgroundColour;if(e.data.oCurrentArrMenuItem._mo())
_oB.style.color=_oD.selectionTextColour;else _oB.style.color=_oD.disabledTextColour;return false;};_eA.mouseOutHandler=function(e){var _oz=e.data.oCurrentMenuItem;var _oA=e.data.oCurrentMenuItemIcon;var _oB=e.data.oCurrentMenuItemText;var _oD=e.data.oAGContextMenuOption;_oz.style.backgroundColor=_oD.backgroundColour;_oA.style.backgroundColor=_oD.iconBackgroundColour;_oB.style.backgroundColor=_oD.backgroundColour;if(e.data.oCurrentArrMenuItem._mo())
_oB.style.color=_oD.textColour;else _oB.style.color=_oD.disabledTextColour;return false;};_eA.showContextMenu=function(_nH,_qW){var _oc=_nH._jw();if(_oc!=null){_oc.show(_qW);}};_eA.hideContextMenu=function(_nH){var _oc=_nH._jw();if(_oc!=null){_oc.hide();}};_eA.dummyFunction=function(e){return false;};

_ey.prototype=new _fc;function _ey(_fW,_o6){if( _o6!=null&&_o6 instanceof _eB)
this._cB=_o6;else this._cB=_d0.copy();if(_fW!=null)
this._b=_fW;else this._b=new Array();this._N=null;this._O=document.createElement('div');this._O.style.position="absolute";this._O.style.zIndex="270";this._bI=null;this._cN=null;this.initialize=function(_nH){this._bI=_nH;this._N=_nH._ju();this._O.style.cursor="default";this._O.style.textAlign="left";this._O.style.visibility="hidden";var _hZ=this._bI._j5(_fl.MOUSE_TARGET_PANE);this._hh();this._N.appendChild(this._O);};this.redraw=function(){this._N.removeChild(this._O);this._O.innerHTML="";this._hh();this._N.appendChild(this._O);};this.remove=function(){if(this._mu()){this._N.removeChild(this._O);this._O.innerHTML="";}
this._bI=null;};this._hh=function(){this._K=new Array(this._b.length);this._L=new Array(this._b.length);this._M=new Array(this._b.length);this._O.style.height=(this._cB.contextSize.height*this._b.length)+"px";this._O.style.width=this._cB.contextSize.width+"px";var _mE=0;for(var i=0;i<this._b.length;i++){this._K[i]=document.createElement('div');this._K[i].style.position="absolute";this._K[i].style.zIndex="270";this._K[i].style.left="0px";this._K[i].style.top=_mE+"px";this._K[i].style.height=this._cB.contextSize.height+"px";this._K[i].style.width=this._cB.contextSize.width+"px";this._K[i].style.backgroundColor=this._cB.backgroundColour;this._K[i].style.fontFamily=this._cB.fontFamily;this._K[i].style.fontSize=this._cB.fontSize+"pt";this._K[i].style.fontStyle=this._cB.fontStyle;this._K[i].style.fontWeight=this._cB.fontWeight;this._K[i].style.borderWidth=this._cB.borderWidth+"px";this._K[i].style.borderStyle=this._cB.borderStyle;this._K[i].style.borderColor=this._cB.borderColour;this._L[i]=document.createElement('div');this._L[i].style.position="absolute";this._L[i].style.zIndex="270";this._L[i].style.left="0px";this._L[i].style.top="0px";this._L[i].style.height=this._cB.contextSize.height+"px";this._L[i].style.width=this._cB.iconWidth+"px";this._L[i].style.backgroundColor=this._cB.iconBackgroundColour;if(typeof this._b[i]._jM()=="string"){var _oe=document.createElement("img");_oe.setAttribute("src",this._b[i]._jM());this._L[i].appendChild(_oe);}
this._M[i]=document.createElement('div');this._M[i].style.position="absolute";this._M[i].style.zIndex="270";this._M[i].style.left=parseInt(this._L[i].style.width)+this._cB.leftMargin+"px";this._M[i].style.top=this._cB.topMargin+"px";this._M[i].style.height=this._cB.contextSize.height+"px";this._M[i].style.width=parseInt(this._cB.contextSize.width)-this._cB.iconWidth-this._cB.leftMargin+"px";this._M[i].style.backgroundColor=this._cB.backgroundColour;if(this._b[i]._mo())
this._M[i].style.color=this._cB.textColour;else this._M[i].style.color=this._cB.disabledTextColour;this._M[i].innerHTML=this._b[i]._kr();_mE+=this._cB.contextSize.height;this._K[i].appendChild(this._L[i]);this._K[i].appendChild(this._M[i]);this._O.appendChild(this._K[i]);var _of=new Object();_of.oAGContextMenuOption=this._cB;_of.oCurrentMenuItem=this._K[i];_of.oCurrentMenuItemIcon=this._L[i];_of.oCurrentMenuItemText=this._M[i];_of.oCurrentArrMenuItem=this._b[i];$(this._K[i]).bind("mouseover",_of,_eA.mouseOverHandler);$(this._K[i]).bind("mouseout",_of,_eA.mouseOutHandler);var _od=new Object();_od.map=this._bI;_od._kJ=this._b[i]._jJ();_od.contextMenu=this;if(this._b[i]._mo()){$(this._K[i]).bind("click",_od,_eA.clicked);}
else {$(this._K[i]).bind("click",_od,_eA.dummyFunction);}} 
};this.show=function(_o7){if(this._mu()){this._cN=_o7;var _qh=this._bI._ki();var _qg=this._ki();var _ls=_o7.x;var _mI=_o7.y;if(_o7.x+_qg.width>_qh.width)
_ls-=_qg.width;if(_o7.y+_qg.height>_qh.height)
_mI-=_qg.height;this._O.style.left=_ls+"px";this._O.style.top=_mI+"px";this._O.style.visibility="visible";}};this.hide=function(){if(this._mu()){this._O.style.visibility="hidden";}};this._dK=function(_o8){if(_o8!=null&&_o8 instanceof _ez)
this._b.push(_o8);else throw "Invalid ContextMenuItem";if(this._bI!=null){this.redraw();}};this._lY=function(_o8,_lr){if(_o8!=null&&_o8 instanceof _ez){if(typeof _lr=="number"){_lr=Math.floor(_lr);if(_lr>=0&&_lr<this._b.length){this._b.splice(_lr,0,_o8);if(this._bI!=null)
this.redraw();}
else throw "Index out of exception in ContextMenuItem";}
else throw "Invalid Number";}
else throw "Invalid ContextMenuItem";};this._q9=function(_of){if(_of!=null&&_of instanceof _ez){var _o5=this._b.indexOf(_of);if(_o5!=-1) 
this._ra(_o5);}
else throw "Invalid ContextMenuItem";};this._ra=function(_lr){if(typeof _lr=="number"){if(_lr>=0&&_lr<this._b.length){this._b.splice(_lr,1);if(this._bI!=null)
this.redraw();}
else throw "Index out of exception in ContextMenuItem";}
else throw "Invalid Number";};this._hJ=function(_of){if(_of!=null&&_of instanceof _ez){var _o5=this._b.indexOf(_of);if(_o5!=-1)
this._b[_o5]._hC();if(this._bI!=null)
this.redraw();}
else throw "Invalid ContextMenuItem";};this._iD=function(_of){if(_of==null||!(_of instanceof _ez))
throw "Invalid ContextMenuItem";var _o5=this._b.indexOf(_of);if(_o5!=-1)
this._b[_o5]._iw();if(this._bI!=null)
this.redraw();};this._ke=function(){return this._cN;};this._ki=function(){return new _fD(Math.round(this._O.offsetWidth),Math.round(this._O.offsetHeight));};this._mu=function(){return this._bI!=null;};this.addMenuItem=this._dK;this.insertMenuItem=this._lY;this.removeMenuItem=this._q9;this.removeMenuItemAtIndex=this._ra;this.disableMenuItem=this._hJ;this.enableMenuItem=this._iD;this.getSize=this._ki;}
var AGContextMenu=_ey;

function _eN(borderWidth,borderColour,borderStyle,backgroundColour,opacity){if(typeof borderWidth=="string")
this.borderWidth=borderWidth;else this.borderWidth=_d3;if(typeof borderColour=="string")
this.borderColour=borderColour;else this.borderColour=AG_DEFAULT_DRAG_ZOOM_MARKER_BORDER_COLOUR;if(typeof borderStyle=="string")
this.borderStyle=borderStyle;else this.borderStyle=_d2;if(typeof backgroundColour=="string")
this.backgroundColour=backgroundColour;else this.backgroundColour=AG_DEFAULT_DRAG_ZOOM_MARKER_BG_COLOUR;if(typeof opacity=="string")
this.opacity=opacity;else this.opacity=_d4;}


_eM.prototype=new _ff;function _eM(_oL){this._cq=null;this._Y=null;this._z=true;if(typeof _oL!="undefined"&&_oL!=null&&_oL instanceof DragZoomAreaMarkerOptions)
this._cc=_oL;else this._cc=_d5;this.initialize=function(_o0){this._cq=_o0;this._Y=document.createElement("div");this._Y.style.position="absolute";this._Y.style.borderWidth=this._cc.borderWidth;this._Y.style.borderColor=this._cc.borderColour;this._Y.style.borderStyle=this._cc.borderStyle;this._Y.style.backgroundColor=this._cc.backgroundColour;this._Y.style.opacity=this._cc.opacity+"";this._Y.style.filter="alpha(opacity="+this._cc.opacity*100+")";this._Y.style.mozOpacity=this._cc.opacity+"";this._Y.style.visibility="hidden";var _hW=this._cq._j5(_fl.MARKER_PANE);_hW.appendChild(this._Y);};this.copy=function(){};this.redraw=function(_l2){};this.remove=function(){var _hW=this._cq._j5(_fl.MARKER_PANE);_hW.removeChild(this._Y);};this.reset=function(_oq,_qf){var _p1=this._cq._ka(_oq);this._Y.style.left=_p1.x+"px";this._Y.style.top=_p1.y+"px";this._Y.style.width=_qf.width+"px";this._Y.style.height=_qf.height+"px";this.show();};this.show=function(){this._z=false;this._Y.style.visibility="visible";};this.hide=function(){this._z=true;this._Y.style.visibility="hidden";};this._mp=function(){return this._z;};this._mB=function(){return !this._mp();};}


function _fE(_ow,_ox,_hv,_sH,_sZ){this._dt=null;this._J=null;this._dw=null;if(_ow==null||!(_ow instanceof _eE)||_ox==null||!(_ox instanceof _eE))
throw 'Invalid Coord';this._dt=_sH;this._J=_hv;this._dw=_sZ;this._oCoordStart=_ow;this._oCoordStop=_ox;this._kn=function(){return this._oCoordStart;};this._kq=function(){return this._oCoordStop;};this._jC=function(){return this._dt;};this._jD=function(){return this._J;};this._jS=function(){return this._dw;};}


function _fw(_f1){if(typeof _f1!='object')
throw 'Invalid _fE';this._d=_f1;this._jA=function(){var _f3=new Array();_f3.push(this._d[0]._kn());for(var i=0;i<this._d.length;i++){_f3.push(this._d[i]._kq());}
return _f3;};this._j4=function(){return this._d.length;};this._ko=function(_lr){if(_lr<this._d.length)
return this._d[_lr];throw "Index out of bounds";};this._kp=function(){return this._d;};this._km=function(){};this._jG=function(){};this._kn=function(){return this._d[0]._kn();};this._kq=function(){return this._d[this._d.length-1]._kq();};this._jD=function(){var _ir=0;for(var i=0;i<oAGRouteImplement._d.length;i++){_ir+=oAGRouteImplement._d[i]._jD();}
return _ir;};}


var _ea=-1;var _d9=new Array();function _fy(){this._c=new Array();this._bO=++_ea;_d9[this._bO]=this;this._cq=null;this._oCoordOrigin=null;this._oCoordDestination=null;this._arrCoordViaPoints=null;var _sB=AG_DEFAULT_DD_COLOR;var _mP=AG_DEFAULT_DD_WEIGHT;var _ia=AG_DEFAULT_DD_OPACITY;this._cP=new _fP(_sB,_mP,_ia);this._bE=new Array();this._F=false;this._q=null;this._c3=null;this._cd=null;this._df=null;this._ds=_d1;this._bM=null;this._bu=0;this._rN=function(_oj){if(_oj instanceof _eE)
this._oCoordOrigin=_oj;};this._rB=function(_oj){if(_oj instanceof _eE)
this._oCoordDestination=_oj;};this._r0=function(_f3){if(typeof _f3=="object"&&typeof _f3.length=="number") 
 this._arrCoordViaPoints=_f3;};this._ij=function(_o0){this._cq=_o0;var _gn=new Array();if(this._oCoordOrigin==null||this._oCoordDestination==null)
throw "Origin and Destination has not been set yet.";_gn.push(this._oCoordOrigin);if(this._arrCoordViaPoints!=null){for(var i=0;i<this._arrCoordViaPoints.length;i++)
_gn.push(this._arrCoordViaPoints[i]);}
_gn.push(this._oCoordDestination);this._g3();this._F=true;this._q=_gn;_eP.trigger(this._cq,"onrouterequested",_gn);this._m9(_gn);this._oCoordOrigin=null;this._oCoordDestination=null;};this.clear=function(){this._oCoordOrigin=null;this._oCoordDestination=null;this._arrCoordViaPoints=null;this._F=false;if(this._cq!=null) 
 this._g3();};this._g3=function(){for(var i=0;i<this._bE.length;i++){this._cq._rb(this._bE[i]);}
this._re();this._q4();};this._m9=function(arrCoordWaypoints){var _sz="_d9["+this._bO+"]._rp";var _tt=_fO.getNavigationRouteRequest(_sz,arrCoordWaypoints,++this._bu,AG_ROUTE_LAYER,AG_ROUTE_PARAM);var script=document.createElement("script");script.setAttribute("src",_tt);script.setAttribute("type","text/javascript");document.body.appendChild(script);};this._j3=function(){return this._c.length;};this._kf=function(_lr){if(_lr<this._c.length)
return this._c[_lr];throw 'Index out of bound';};this._jD=function(){var _tK=0;var _nQ=new _fw();for(var i=0;i<this._m.length;i++){_nQ=this._m[i];_tK+=_nQ._jD();}
return _tK;};this._rp=function(_p9,_td){if(!this._F)
return;if(_p9=="error")
return;if(parseInt(_td)!=this._bu)
return;this._c=new Array();var _f3=new Array();var _pW=_p9.RoutingPoints.split('|');var _fU;var _tP=0;for(var i=0;i<_pW.length;i++){_fU=_pW[i].split(',');_f3.push(new _eE(parseFloat(_fU[1]),parseFloat(_fU[0])));}
this._rS(_f3);this._rX(this._c[0]._kn());this._rH(this._c[this._c.length-1]._kq());this._ii(this._c);_eP.trigger(this._cq,"onroutedrawn",this._q);};this._rX=function(_oj){if(this._c3)
this._c3._rz(_oj);else {this._c3=this._jY( API_HOST_URL+"Images/routeStart.png",_oj);this._cq._dL(this._c3);}};this._rH=function(_oj){if(this._cd)
this._cd._rz(_oj);else {this._cd=this._jY(API_HOST_URL+"Images/routeStop.png",_oj);this._cq._dL(this._cd);}};this._re=function(){this._cq._rb(this._c3);this._c3=null;};this._q4=function(){this._cq._rb(this._cd);this._cd=null;};this._jY=function(_s5,_oj){var oCoordMarker=new _eE(_oj._m1(),_oj.longitude());var _hx=new _fb();var _hw=new _eX(null,_s5);_hw.iconAnchor=new _fn(-15,-30);_hx.icon=_hw;var _o4=new _fa(oCoordMarker,_hx);return _o4;};this._ii=function(_gg){this._bE=new Array();for(var i=0;i<_gg.length;i++){var _oj=_gg[i]._jA();this._bE.push(new _fr(_oj,this._cP));this._ih(i);}};this._ih=function(_lM){this._cq._dL(this._bE[_lM]);};this._rS=function(_f3){var _mz=null;var _ow=null;var _ox=null;var _f0=new Array();for(var i=0;i<_f3.length-1;i++){_ow=_f3[i];_ox=_f3[i+1];oAgStep=new _fE(_ow,_ox);_f0.push(oAgStep);}
_nQ=new _fw(_f0);this._c.push(_nQ);};}


var _ec=new Array();var _eb=-1;function _eI(_o0,_pl){this._ds=_d1;this._bM=null;this._cm=++_eb;_ec[this._cm]=this;this._bu=-1;if(_o0 instanceof _e4)
this._cq=_o0;else this._cq=null;this._9=null;this._rF=function(_qH){if(typeof _qH=="object")
this._cJ=_qH;else return;this._bM=document.createElement('iframe');this._bM.setAttribute('src',"");this._bM.style.width="100%";this._bM.style.height="100%";this._bM.style.border='0px solid #000000';this._bM.style.overflow="auto";this._bM.style.visibility="hidden";this._cJ.appendChild(this._bM);return true;};if(typeof _pl!="undefined"&&_pl!=null&&typeof _pl=="object" ){this._cJ=_pl;this._cJ.innerHTML="";this._rF(this._cJ);}
else this._cJ=null;this._g=new Array();this._b6=AG_DEFAULT_DIRECTION_OPTIONS.copy();this._m7=function(_or,_oo,_oF){if(_oF instanceof _eJ)
this._b6=_oF;else this._b6=AG_DEFAULT_DIRECTION_OPTIONS.copy();if(!(_oo instanceof _eE)||!(_or instanceof _eE))
throw "Invalid argument";var _f3=new Array(_or,_oo);this._na(_f3);};this._na=function(_f6,_oF){if(_oF instanceof _eJ)
this._b6=_oF;else this._b6=AG_DEFAULT_DIRECTION_OPTIONS.copy();if(typeof _f6!="object")
throw "Invalid argument";if(this._cq instanceof _e4){var iLength=_f6.length;var _qb=this._cq._kg();_qb._rN(_f6[0]);_qb._rB(_f6[iLength-1]);var _f4=new Array();if(iLength>2){for(var i=1;i<iLength-1;i++){_f4.push(_f6[i]);}
_qb._r0(_f4);}
_qb._ij(this._cq);}
if(this._cJ!=null){var _th=(this._b6.routePreference==_fx.FASTEST)? "TRAVELTIME" : "LENGTH";this._m8(_f6,_th);}
{var _th=(this._b6.routePreference==_fx.FASTEST)? "TRAVELTIME" : "LENGTH";this._bu++;var _tt=_fO.getNavigationRouteRequest("_ec["+this._cm+"]._gV",_f6,this._bu,AG_ROUTE_LAYER,_th);var script=document.createElement("script");script.setAttribute("src",_tt);script.setAttribute("type","text/javascript");document.body.appendChild(script);}};this._gV=function(_p9,_md){if(_md!=this._bu)
return;var _tf=_p9.RoutingPoints;var _fV=_tf.split('|');this._g=new Array();for(var i=0;i<_fV.length;i++){var _f2=_fV[i].split(',');this._g.push(new _eE(parseFloat(_f2[1]),parseFloat(_f2[0])));}
_eP.trigger(this,"onload");};this._kz=function(){return this._g;};this.callbackDD=function(_p9){eval("this._9("+_p9+");");};this._rD=function(_tt){if(typeof _tt=='string')
this._ds=_tt;};this.clear=function(){if(this._cq instanceof _e4){var _qb=this._cq._kg();_qb._g3();}
if(this._cJ!=null){this._cJ.innerHTML="";}};this.getJSONDirections=function(_f4,_i8){if(_f4==null||typeof _f4=="undefined"||_f4.length<2)
throw "invalied argument";if(typeof _i8=="function")
this._9=_i8;var _tx="";_tx+=_f4[0]._m1()+"|"+_f4[0].longitude();for(var i=1;i<_f4.length;i++)
_tx+="$"+_f4[i]._m1()+"|"+_f4[i].longitude();var _th=(this._b6.routePreference==_fx.FASTEST)? "TRAVELTIME" : "LENGTH";var _tt=this._jF("_ec["+this._cm+"].callbackDD",_tx,_th);var script=document.createElement("script");script.setAttribute("src",_tt);script.setAttribute("type","text/javascript");document.body.appendChild(script);};this._jF=function(_sy,_tx,_ti){var _tc=AG_JSON_DRIVING_DIRECTION_URL;_tc+="?";_tc+="op=GetDirectionsJSONSet1";_tc+="&jsonp="+_sy;_tc+="&waypoints="+_tx;_tc+="&RouteLayer="+AG_ROUTE_LAYER;_tc+="&RouteParameter="+_ti;_tc+="&rnd="+Math.random();return _tc;};this._m8=function(_f5,_th){if( typeof this._cJ!='object')
throw "User div has not been set yet.";if(typeof _f5!="object")
throw "Invalid argument";var _tt="";_tt+=_d8;_tt+="?";_tt+="Waypoints="+_f5[0]._m1()+"|"+_f5[0].longitude();for(var i=1;i<_f5.length;i++)
_tt+="$"+_f5[i]._m1()+"|"+_f5[i].longitude();_tt+="&RouteParameter="+_th;_tt+="&RouteLayer="+AG_ROUTE_LAYER;_tt+="&CSS="+this._ds;this._bM.setAttribute('src',_tt);this._bM.style.visibility="visible";return true;};this._rC=function(_oF){if(_oF instanceof _eJ)
this._b6=_oF;};this._kc=function(){if(this._g.length>0)
return new _fr(this._g);else throw "Direction has not been loaded";};this._jD=function(){var unit=this._b6.unit;if(this._g.length>0){var _iR=0;for(var i=0;i<this._g.length-1;i++){var _iq=_fJ.getDistanceBetweenCoords(this._g[i],this._g[i+1],unit);_iR+=(!isNaN(_iq))?_iq:0;}
return _iR;}
else throw "Direction has not been loaded";};this._jn=function(){if(this._g.length>0){var _n7=new _ev(this._g[0],this._g[1]);for(var i=2;i<this._g.length;i++){_n7._iQ(this._g[i]);}
return _n7;}
else throw "Direction has not been loaded";};this.load=this._m7;this.loadFromWayPoints=this._na;this.setDirectionsPanelStyle=this._rD;this.clear=this.clear;this.getJSONDirections=this.getJSONDirections;this.getBoundingBox=this._jn;this.getDistance=this._jD;this.getVertices=this._kz;this.getPolyline=this._kc;}
var AGDirections=_eI;

function _eJ(_iK,_iL,_iJ,_gr,_gs,_gq){if(typeof _iK=="number")
this.travelMothod=_iK;else this.travelMothod=_fM.DRIVE;if(typeof _iL=="number")
this.unit=_iL;else this.unit=_fN.KILOMETERS;if(typeof _iJ=="string")
this.routePreference=_iJ;else this.routePreference=_fx.FASTEST;this.avoidHighway=false;this.avoidToolRoads=false;this.avoidGravelRoads=false;if(typeof _gr=="boolean")
this.avoidHighway=_gr;if(typeof _gs=="boolean")
this.avoidToolRoads=_gs;if(typeof _gq=="boolean")
this.avoidGravelRoads=_gq;this.copy=function(){return new _eJ(this.travelMothod,this.unit,this.routePreference,this.avoidHighway,this.avoidToolRoads,this.avoidGravelRoads);};}
var AGDirectionsOptions=_eJ;

//Configurations
var API_GATEWAY_URL=API_HOST_URL+"/gateways/";var _ej=100;var AGInitialMapType={DEFAULT:0,DEFAULT_WITH_IMAGERY:1 
};var AGMapServerType={TMS:0,DMS:1 
};
var AG_INITIAL_MAP_TYPE=AGInitialMapType.DEFAULT;
var AG_DEFAULT_MS_TYPE=AGMapServerType.TMS;
var AG_DEFAULT_MS_TYPE_FOR_IMAGERY=AGMapServerType.TMS;
var AG_TMS_URL="http://mt1.afrigis.co.za/getTile";
var AG_TMS_DATASET_TAG="dataset";
var AG_TMS_DEFAULT_DATA_SET="ag.vbase.256";
var AG_TMS_ZOOM_LEVEL_TAG="level";
var AG_TMS_X_TAG="x";
var AG_TMS_Y_TAG="y";
var AG_DEFAULT_TMS_OPTIONS=new _fK(AG_TMS_URL,AG_TMS_DEFAULT_DATA_SET);
var AG_TMS_DEFAULT_DATA_SET_FOR_IMAGERY="ag.vovr.256";
var AG_DEFAULT_TMS_OPTIONS_FOR_IMAGERY=new _fK(AG_TMS_URL,AG_TMS_DEFAULT_DATA_SET_FOR_IMAGERY);
var AG_IMAGERY_URL="http://mt1.afrigis.co.za/getTile";
var AG_IMAGERY_DATA_SET="ag.ibase.256";
var AG_IMAGERY_TMS_OPTIONS=new _fK(AG_IMAGERY_URL,AG_IMAGERY_DATA_SET);
var AG_DMS_URL="http://ms1.afrigis.co.za/mapserver/im.aspx";
var AG_DMS_VERSION="1.0.0";
var AG_DMS_CRS="EPSG:4326";
var AG_DMS_FORMAT="image/png";
var AG_DMS_DEFAULT_LAYERS = "AG_CONTINENTS,AG_WORLD_COUNTRIES,AG_AFRICAN_COUNTRIES,AG_SADECS,AG_PROVINCES,AG_BUILTUP_AREAS,AG_CAD_PARKS,AG_DAMS,AG_RIVERS,AG_STREETS,AG_NATIONALROAD_LABELS,AG_TOWNS_CENTROID,AG_SUBURBS_CENTROID,AG_WORLD_CAPITALS";
var AG_DMS_DEFAULT_STYLES = "Polygon_SCHEME,Polygon_SCHEME,Polygon_SCHEME,Polygon_SCHEME,Theme4,Polygon_SCHEME,Theme4,Theme4,Theme4,Theme4,Point_SCHEME,Point_SCHEME,Theme4,Point_SCHEME";
var AG_DMS_DEFAULT_TRANSPARENCY=0;
var AG_DMS_DEFAULT_EXCEPTIONS="INIMAGE";
var AG_DEFAULT_DMS_OPTION=new _eK();
var AG_DEFAULT_DMS_OPTION=new _eK(AG_DMS_URL,AG_DMS_DEFAULT_LAYERS,AG_DMS_DEFAULT_STYLES,AG_DMS_DEFAULT_TRANSPARENCY,AG_DMS_FORMAT);
var AG_DMS_DEFAULT_LAYERS_FOR_IMAGERY="AG_WORLD_COUNTRIES,AG_PROVINCES,AG_TOWNS_CENTROID,AG_SUBURBS_CENTROID,AG_STREETS";
var AG_DMS_DEFAULT_STYLES_FOR_IMAGERY="Imagery,Imagery,Imagery,Theme4,Imagery";
var AG_DMS_DEFAULT_TRANSPARENCY_FOR_IMAGERY=100;
var AG_DEFAULT_DMS_OPTIONS_FOR_IMAGERY=new _eK(AG_DMS_URL,AG_DMS_DEFAULT_LAYERS_FOR_IMAGERY,AG_DMS_DEFAULT_STYLES_FOR_IMAGERY,AG_DMS_DEFAULT_TRANSPARENCY_FOR_IMAGERY,AG_DMS_FORMAT);
var AG_CLIENT_GEOCODER_GATEWAY=API_GATEWAY_URL+"Search.aspx";
var AG_KEY_VALIDATION_GATEWAY=API_GATEWAY_URL+"AGKeyValidationGateway.aspx";
var _d8="http://maps.afrigis.co.za/services/MapServerUtils/DDHTMLGateway.aspx";
var AG_JSON_DRIVING_DIRECTION_URL=API_GATEWAY_URL+"DrivingDirectionJSON.aspx";
var AG_NAVIGATION_GATEWAY_URL=API_GATEWAY_URL+"navgw.aspx";
var AG_ROUTE_LAYER="AG_STREETS";
var AG_ROUTE_PARAM="TRAVELTIME";
var _d1=API_HOST_URL+"css/DefaultDDStyle.css";
var AG_DEFAULT_DD_COLOR="red";
var AG_DEFAULT_DD_WEIGHT=10;
var AG_DEFAULT_DD_OPACITY=0.5;
var AG_MARBIL_GATEWAY=API_GATEWAY_URL+"MarbilGateway.aspx";
var AG_ADVERTISING_SIZE=new _fD(0,0);
var AG_SHOW_ADVERTISING=null;
var AG_ADVERTISE_DURATION=20;
var AG_DMS_TILE_GROUP_ROWS=4;var AG_DMS_TILE_GROUP_COLS=4;var AG_TILE_SIZE=new _fD(256,256);var _es=new Array(524288000,262144000,131072000,65536000,32768000,16384000,8192000,4096000,2048000,1024000,512000,256000,128000,64000,32000,16000,8000,4000,2000,1000);var _ek=_es.length;var _ei=20;var _fl={IMAGERY_PANE:0,MAP_PANE:1,OVERLAY_PANE:2,MARKER_SHADOW_PANE:3,MARKER_PANE:4,FLOAT_SHADOW_PANE:5,MOUSE_TARGET_PANE:6,FLOAT_PANE:7,MAP_CONTAINER:8,STATIC_PANE:9
};var _fM={DRIVE:0,WALK:1,PUBLIC_TRANSPORT:2
};var _fN={KILOMETERS:0,MILES:1
};var _fx={FASTEST:0,SHORTEST:1
};var _fe={ZOOM:0,PAN:1
};var AG_DEFAULT_ICON=new _eX(null,API_HOST_URL+"Images/red-flag.png");
AG_DEFAULT_ICON.iconSize=new _fD(30,35);
AG_DEFAULT_ICON.shadow=API_HOST_URL+"Images/MarkerShadow.png";
AG_DEFAULT_ICON.shadowSize=new _fD(50,35);
AG_DEFAULT_ICON.iconAnchor=new _fn(-14,-35);
AG_DEFAULT_ICON.infoDisplayAnchor=new _fn(7,-35);
var SVG_NS='http://www.w3.org/2000/svg';
var AG_DEFAULT_LINE_COLOUR='blue';
var _d7=2;
var _d6=1;
var AG_DEFAULT_FILL_COLOUR='red';var AG_DEFAULT_FILL_OPACITY=.5;var AG_DEFAULT_VECTOR_OPTIONS=new _fP(AG_DEFAULT_LINE_COLOUR,_d7,_d6,AG_DEFAULT_FILL_COLOUR,AG_DEFAULT_FILL_OPACITY);var _tA=20;var AG_DEFAULT_ZOOMBAR_NO=1;var AG_TOTAL_NO_OF_ZOOMBAR=7;var _et={TOP_RIGHT:0,TOP_LEFT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3
};var _dX=new _fD(150,20);var AG_DEFAULT_CONTEXT_MENU_ITEM_BG_COLOUR="#C6C68C";var AG_DEFAULT_CONTEXT_MENU_ITEM_SELECTION_BG_COLOUR="white";var AG_DEFAULT_CONTEXT_MENU_ITEM_TEXT_COLOUR="black";var AG_DEFAULT_CONTEXT_MENU_ITEM_SELECTION_TEXT_COLOUR="red";var _dS="arial";var _dT=10;var _dU="normal";var _dV="normal";var _dR=2;var _dQ="solid";var AG_DEFAULT_CONTEXT_MENU_ITEM_BORDER_COLOUR="#6A6A36";var AG_DEFAULT_CONTEXT_MENU_ITEM_ICON_COLOUR="#E0E0E0";var AG_DEFAULT_DISABLE_MENU_ITEM_TEXT_COLOUR="gray";var _dW=20;var _dY=5;var _dZ=0;var _d0=new _eB(
_dX,AG_DEFAULT_CONTEXT_MENU_ITEM_BG_COLOUR,AG_DEFAULT_CONTEXT_MENU_ITEM_SELECTION_BG_COLOUR,AG_DEFAULT_CONTEXT_MENU_ITEM_TEXT_COLOUR,AG_DEFAULT_CONTEXT_MENU_ITEM_SELECTION_TEXT_COLOUR,_dS,_dT,_dU,_dV,_dR,_dQ,AG_DEFAULT_CONTEXT_MENU_ITEM_BORDER_COLOUR,AG_DEFAULT_CONTEXT_MENU_ITEM_ICON_COLOUR,AG_DEFAULT_DISABLE_MENU_ITEM_TEXT_COLOUR,_dW,_dY,_dZ);var _d3=2;var AG_DEFAULT_DRAG_ZOOM_MARKER_BORDER_COLOUR="blue";var _d2="dotted";var AG_DEFAULT_DRAG_ZOOM_MARKER_BG_COLOUR="#00C3F5";var _d4=0.5;var _d5=new _eN();var AG_DEFAULT_INFO_DISPLAY_SIZE=new _fD(150,150);var AG_DEFAULT_INFO_DISPLAY_OPACITY=1;var _dP=20;var AG_DEFAULT_INFO_DISPLAY_BORDER_WIDTH=1;var AG_DEFAULT_BUBBLE_BORDER_COLOUR="#9F9F9F";var AG_COORD_PRECISION_AMOUNT=6;var AG_DEFAULT_BLOWUP_SIZE=new _fD(150,150);var AG_DEFAULT_BLOWUP_ZOOM_LEVEL=5;var _fm={DEFAULT:0,DRAG:1
};var _en=new _fD(128,128);var _eo=3;var AG_CLOSE_IMG_URL=API_HOST_URL+"Images/btn_close.png";var _eg=API_HOST_URL+"Images/btn_maximize.png";var _ed=API_HOST_URL+"Images/btn_disabled_maximize.JPG";var _eh=API_HOST_URL+"Images/btn_minimize.png";var _ee=API_HOST_URL+"Images/btn_disabled_minimize.JPG";var _eq=new _fD(40,40);var _er=40;var _ef=API_HOST_URL+"Images/dummy3.png";var AG_PAN_ANIMATION_DURATION=1;var AG_PAN_ANIMATION_DISTANCE_AMOUNT=new _fn(5,5);var AG_PAN_ANIMATION_UNIT_CALLING=10;var AG_PAN_MARGIN=new _fn(10,10);var AG_CROSS_HAIR_IMAGE=API_HOST_URL+"/Images/crossHair.GIF";var AG_CROSS_HAIR_SIZE=new _fD(14,14);var _e7={MAIN_MAP:0,OVERVIEW_MAP:1,ENLARGED_MAP:2,IMAGERY_MAP:3,NORMAL_MAP:4
};var AG_DRAGGABLE_CURSOR="pointer";var AG_DRAGGING_CURSOR="pointer";var AG_STATIC_CURSOR="default";var AG_DRAG_ZOOM_CURSOR="crosshair";var AG_DEFAULT_DIRECTION_OPTIONS=new _eJ(_fM.DRIVE,_fN.KILOMETERS,_fx.FASTEST,false,false,false);var AGPanes=_fl;var AGOperations=_fe;var AGAnchor=_et;var AGTravelMethods=_fM;var AGUnits=_fN;var AGRoutePreferences=_fx;

var AG_MAP_OBJECTS=new Array();var AG_MAP_INDEX=-1;function _e4(_oH,_o3){if(typeof _oH=="undefined"||_oH==null)
throw "Invalid Map Container.";this._bf=++AG_MAP_INDEX;AG_MAP_OBJECTS[this._bf]=this;if(this._bf==0){_eu.validate();_e9._m7(_eu.key);_fC('Alt+Ctrl+Shift+J',_eO.show);}
if(_o3 instanceof _e6){this._cv=_o3;if(_o3.backgroundColour!=null)
_oH.style.backgroundColor=_o3.backgroundColour;}
else this._cv=new _e6();this._ca=_oH;this._cr=null;this._k=new Array();this._f=new Array();this._oCrossHairControl=null;this._b1=null;this._cU=null;this._ch=new _eT();this._cY=null;this._oBoundingBoxMap=null;this._cM=new _fn(0,0);this._B=false;this._t=true;this._v=true;this._w=false;this._E=true;this._s=true;this._bH=null;this._cT=new _fy();this._y=false;this._cA=null;this._cx=null;this._cb=null;this._bPanAnimationEnabled=false;this._bj=_ek;this._bp=1;this._oInfoDisplay=null;this._oCurrentInfoDisplayOptions=null;this._bInfoDisplayEnabled=true;this.oCoordSavedCenter=null;this._qd=null;this._bg=_e7.MAIN_MAP;this._c6=null;this._c7=null;this._ck=null;this._A=false;this._P=null;this._iz=function(){this._v=true;this.setCursor();};this._hF=function(){this._v=false;this.setCursor();};this._ie=function(){if(!this._if())
return this._v;return false;};this._iA=function(){this._w=true;};this._hG=function(){this._w=false;};this._if=function(){return this._w;};this._iH=function(){this._t=true;};this._hO=function(){this._t=false;};this._tY=function(){return this._t;};this._iF=function(){this._E=true;};this._hL=function(){this._E=false;};this._nt=function(){return this._E;};this._ix=function(){this._s=true;};this._hD=function(){this._s=false;};this._hc=function(){return this._s;};this._dG=function(_oh,_oi){if(typeof _oh=="undefined"||_oh==null)
throw "Invalid _hd input.";if(!(_oi instanceof _eD))
_oi=_oh.getDefaultPosition();if(this._jP(_oh)>=0)
this._q2(_oh);_oh.initialize(this,_oi);this._f.push(_oh);};this._q2=function(_hd){if(_hd==null||typeof _hd=="undefined")
throw "Invalid _hd input";var _lv=this._f.length;for(var i=0;i<_lv;i++)
if(this._f[i]==_hd){this._f.splice(i,1);_hd.remove();}};this._ju=function(){return this._cr._bW;};this._mw=function(){return this._B;};this._ki=function(){return this._cY;};this._jr=function(){return this._jn()._jr();};this._jn=function(){return this._oBoundingBoxMap;};this._rw=function(_n1){this._oBoundingBoxMap=_n1;};this._jo=function(_nU){if(!(_nU instanceof _ev))
throw "Invalid BoundingBox";var _qh=this._ki();for(var i=this._bj;i>=this._bp;i--){var _n1=_eF.getBoundingBoxForZoom(_nU._jr(),i,_qh);if(_n1._g6(_nU))
return i;}
return this._bp;};this._kD=function(){return this._bD;};this._r2=function(_mZ){this._bD=_mZ;};this._r3=function(_nr,_nl){if(_nl>_ek)
throw 'Invalid zoom level';if(_nr<1)
throw 'Invalid zoom level';var _la=this._kD();if(_la>0&&(_la<_nr||_la>_nl)) 
 throw "Zoom range does not contain current zoom level."
this._bj=_nl;this._bp=_nr;};this._j0=function(){return this._bp;};this._jZ=function(){return this._bj;};this._tX=function(){var _lb=this._kD();if(_lb>=this._bj)
return;var oCenterPointCoord=this._jr();this._gY(oCenterPointCoord,_lb+1);};this._tZ=function(){var _lb=this._kD();if(_lb<=this._bp)
return;var oCenterPointCoord=this._jr();this._gY(oCenterPointCoord,_lb-1 );};this._gY=function(_om,_mZ){this._hM();if(_om==null||!(_om instanceof _eE))
throw "Invalid centre input.";if(typeof _mZ!="number"||_mZ<this._bp||_mZ>this._bj||_mZ!=parseInt(_mZ))
throw "Invalid zoom level input.";var _mb=this._kD();if(_mb==_mZ){this._qS(_om);}
else {if(!this._B){this._lR();}
var _qh=this._ki();var _nU=_eF.getBoundingBoxForZoom(_om,_mZ,_qh);this._rw(_nU);this._r2(_mZ);var _pK=new _fn(0,0);this._rJ(_pK)
this._cM=_pK;this._kI(_fe.ZOOM);this._kH(_fe.ZOOM);if(!this._B){if(this._cv.loadInitialMap){switch(AG_INITIAL_MAP_TYPE){case AGInitialMapType.DEFAULT:
this._r4();break;case AGInitialMapType.DEFAULT_WITH_IMAGERY:
this._r5();this._r8();break;}}
this._cU=new _fz();var _p6=new _eD(new _fn(20,20),_et.BOTTOM_LEFT);this._dG(this._cU,_p6);this._jR();this._B=true;_e8.getPeriodicAdvert(this._bf);_eP.trigger(this,"onload");}
_eP.trigger(this,"onzoomend",_mb,_mZ);}};this._qS=function(_om){if(_om==null||!(_om instanceof _eE))
throw "Invalid input for centre.";var _pS=this._ka(this._jr());var _pP=this._ka(_om);var _pT=new _fn(Math.round(_pS.x-_pP.x),Math.round(_pS.y-_pP.y) );this._qQ(_pT);};this._qQ=function(_pD){this._hM();if(_pD==null||!(_pD instanceof _fn))
throw "Invalid input for _hP.";this._nu(_pD);this._kI(_fe.PAN);this._kH(_fe.PAN);};this._qR=function(_iu,_iv){if( !(_iu==1||_iu==-1||_iv==1||_iv==-1) )
throw "_iu and _iv must be either 1 or-1.";var _qf=this._ki();var _pT=new _fn(Math.round(_iu*_qf.width/2),Math.round( _iv*_qf.height/2));this._qQ(_pT);};this._qP=function(x,y){var _qT=Math.round(Math.abs(x)/AG_PAN_ANIMATION_UNIT_CALLING);if(_qT<AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qT=AG_PAN_ANIMATION_DISTANCE_AMOUNT.x;var _qU=Math.floor(Math.abs(y)/AG_PAN_ANIMATION_UNIT_CALLING);if(_qU<AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qU=AG_PAN_ANIMATION_DISTANCE_AMOUNT.y;AG_PAN_ANIMATION_DISTANCE_AMOUNT=new _fn(_qT,_qU);this._iG();_fk.smoothPan(this._bf,x,y);};this._iG=function(){this._bPanAnimationEnabled=true;};this._hM=function(){this._bPanAnimationEnabled=false;};this.isEnabledPanAnimation=function(){return this._bPanAnimationEnabled;};this._rq=function(){this.oCoordSavedCenter=this._jr();this._qd=this._kD();};this._nb=function(){if(this.oCoordSavedCenter==null||this._qd<1)
throw "No saved position.";this._gY(this.oCoordSavedCenter,this._qd);};this._dL=function(_ph,_sS,_gC){if(typeof _ph=="undefined"||_ph==null)
throw "Invalid input for overlay.";if(typeof _sS=='string')
_ph.groupName=_sS;else _ph.groupName=null;if(typeof _gC=='boolean')
_ph.excludeFromClearOverlay=_gC;else _ph.excludeFromClearOverlay=false;var _lM=this._jQ(_ph);if(_lM>=0)
this._rb(_ph);this._k.push(_ph);try
{_ph.initialize(this);}
catch(err){}
_eP.trigger(this,"onoverlayadded",_ph);};this._q5=function(_sS){if(typeof _sS!='string')
throw "Invalid group name";for(var i=0;i<this._k.length;i++){try
{if(this._k[i].groupName==_sS){this._k[i].remove();this._k.splice(i,1);i--;}}
catch(err){}}
_eP.trigger(this,"onoverlaygroupremoved",_sS);};this._rb=function(_ph){var _lM=this._jQ(_ph);if(_lM>=0){this._k.splice(_lM,1);try
{_ph.remove();}
catch(err){}
_eP.trigger(this,"onoverlayremoved",_ph);}};this._jQ=function(_ph){var _lv=this._k.length;for(var i=0;i<_lv;i++)
if(this._k[i]==_ph)
return i;return-1;};this._jP=function(_oh){var _lv=this._f.length;for(var i=0;i<_lv;i++)
if(this._f[i]==_oh)
return i;return-1;};this._g1=function(){var _gk=new Array();for(var i=0;i<this._k.length;i++){var _ph=this._k[i];if(!_ph.excludeFromClearOverlay){try
{_ph.remove();}
catch(err){}}
else _gk.push(_ph);}
this._k=_gk;_eP.trigger(this,"onoverlayscleared");};this._j5=function(_l4){switch(_l4){case _fl.IMAGERY_PANE:
return(this._cr._cl);case _fl.MAP_PANE:
return(this._cr._cw);case _fl.OVERLAY_PANE:
return(this._cr._cH);case _fl.MARKER_SHADOW_PANE:
return(this._cr._cz);case _fl.MARKER_PANE:
return(this._cr._cy);case _fl.FLOAT_SHADOW_PANE:
return(this._cr._cf);case _fl.STATIC_PANE:
return(this._cr._oStaticPane);case _fl.MOUSE_TARGET_PANE:
return(this._cr._cC);case _fl.FLOAT_PANE:
return(this._cr._ce);case _fl.MAP_CONTAINER:
return this._cr._cs;}
return null;};this._iB=function(){this._bInfoDisplayEnabled=true;};this._hH=function(){this._bInfoDisplayEnabled=false;var _oV=this._jR();_oV.hide();};this.infoDisplayEnabled=function(){return this._bInfoDisplayEnabled;};this._rA=function(_oy){if(_oy==null||!(_oy instanceof _e1))
throw "Invalid input for InfoWindowOptions.";this._oCurrentInfoDisplayOptions=_oy;};this._jB=function(){if(this._oCurrentInfoDisplayOptions==null)
this._oCurrentInfoDisplayOptions=new _e1();return this._oCurrentInfoDisplayOptions;};this._pn=function(_oj,_pa,_p7){if( _oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";if(typeof _pa!="object")
throw "Invalid input for node.";this._po(_oj,_pa,_p7);};this._pp=function(_oj,_sV,_p7){if(_oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";if(typeof _sV!="string")
throw "Invalid input for node.";this._po(_oj,_sV,_p7);};this._po=function(_oj,content,_p7){if(this._bInfoDisplayEnabled){if(_p7!=null&&(_p7 instanceof _e1))
this._rA(_p7);else {this._oCurrentInfoDisplayOptions=new _e1();} 
var _oV=this._jR();var _oy=this._jB();var arrPanel=new Array();arrPanel.push(new _e2(null,content));_oV.reset(_oj,arrPanel,new _fD(_oy.width,_oy.height),_oy.pixelOffset,_oy.selectedPanel)
_eP.trigger(_oV,"oninfodisplayopen");}
else return;};this._pr=function(_oj,_gb,_p7){if(_oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";if(_gb==null||typeof _gb!="object")
throw "Invalid input for panels.";this._pq(_oj,_gb,_p7);};this._ps=function(_oj,_gb,_p7){if(_oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";if(_gb==null||typeof _gb!="object")
throw "Invalid input for panels.";this._pq(_oj,_gb,_p7);};this._pq=function(_oj,_gb,_p7){if(this._bInfoDisplayEnabled){if(_p7!=null&&(_p7 instanceof _e1))
this._rA(_p7);else {this._oCurrentInfoDisplayOptions=new _e1();} 
var _oV=this._jR();var _oy=this._jB();_oV.reset(_oj,_gb,new _fD(_oy.width,_oy.height),_oy.pixelOffset,_oy.selectedPanel)
_eP.trigger(_oV,"oninfodisplayopen");}
else return;};this.updateInfoDisplay=function(_gb,optOnUpdate){if(this._bInfoDisplayEnabled){var _oV=this._jR();_oV.updateDisplayContent(_gb);}};this.updateActivePanel=function(fnModifier,optOnUpdate){};this._r7=function(_oj,_p7){if( _oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";var _hT=document.createElement('div');_hT.style.border="solid 1px black";_hT.style.width=AG_DEFAULT_BLOWUP_SIZE.width-2+"px";_hT.style.height=AG_DEFAULT_BLOWUP_SIZE.height-2+"px";var arrPanel=new Array();arrPanel.push(new _e2(null,_hT));var _oV=this._jR();_oV.reset(_oj,arrPanel,AG_DEFAULT_BLOWUP_SIZE);var _o3=new _e6(null,null,null,null,false)
var _o0=new _e4(_hT,_o3);_o0._rL(_e7.ENLARGED_MAP);if(_p7!=null&&_p7 instanceof _e1)
_o0._gY(_oj,_p7.zoomLevel);else _o0._gY(_oj,AG_DEFAULT_BLOWUP_ZOOM_LEVEL);_o0._hD();_o0._hL();_o0._q3();_o0._rd();};this._g4=function(){var _oV=this._jR();_oV.hide();};this._jR=function(){if(this._oInfoDisplay==null){this._oInfoDisplay=new _eZ();this._dL(this._oInfoDisplay);}
return this._oInfoDisplay;};this._jy=function(_qV){if( _qV==null||!(_qV instanceof _fn))
throw "Invalid input for _qV.";var _nK=this._jW();_nK=new _fn(_nK.x+_qV.x,_nK.y+_qV.y);return this._jz(_nK);};this._ka=function(_oj){if(_oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";var _nK=this._kb(_oj);var _nL=this._jW();return new _fn(_nK.x-_nL.x,_nK.y-_nL.y);};this._kb=function(_oj){if( _oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";var dLat=_oj._m1();var dLong=_oj.longitude();var _n7=this._jn();var _m3=_n7._j2();var _ro=_n7._kj();var _h4=parseFloat(_m3._m1()-_ro._m1());var _h7=parseFloat(_ro.longitude()-_m3.longitude());var _h1=this._ki();var width=_h1.width;var height=_h1.height;var x=Math.round((width*((dLong-_m3.longitude())) / _h7));var y=Math.round((height*((_m3._m1()-dLat)) /_h4 ));return new _fn(x,y);};this._jz=function(_qV){if(_qV==null||!(_qV instanceof _fn))
throw "Invalid input for _qV.";var _n7=this._jn();var _m3=_n7._j2();var _ro=_n7._kj();var _h4=Math.abs(_m3._m1()-_ro._m1());var _h7=Math.abs(_ro.longitude()-_m3.longitude());var _h1=this._ki();var width=_h1.width;var height=_h1.height;var _nw=_m3.longitude()+(_h7*_qV.x / width);var _nv=_m3._m1()-(_h4*_qV.y / height);return new _eE(_nv,_nw);};this._lR=function(){this._cr=new _e5(this._ca,this._jX());var _hR=this._ju();this._cY=new _fD(_hR.offsetWidth,_hR.offsetHeight);var _oI=this._j5(_fl.MOUSE_TARGET_PANE);_oI=$(_oI);_oI.bind("dblclick",this,_fd.doubleClickHandler);_oI.bind("mousedown",this,_fd.mouseDownHandler);_oI.bind("mousemove",this,_fd.mouseMoveHandler);_oI.bind("mouseup",this,_fd.mouseUpHandler);_oI.bind("click",this,_fd.clickHandler);_oI.bind("mouseover",this,_fd.mouseOverHandler);_oI.bind("mouseout",this,_fd.mouseOutHandler);if(_ew._gN=="Firefox")
_oI.bind("DOMMouseScroll",this,_fd.mouseScrollHandler);else _oI.bind("mousewheel",this,_fd.mouseScrollHandler);this._b1=new _eG("Imagery Copyright: NASA,CDSM,2006(Joburg),Cape Town,Ekurhuleni,eThekwini,Lekoa Vaal,Tshwane;Map data&copy;2009 AfriGIS(Pty) Ltd");var _p6=new _eD(new _fn(10,10),_et.BOTTOM_RIGHT);this._dG(this._b1,_p6);if(this._cv instanceof _e6&&this._cv.showCrossHair){this._oCrossHairControl=new AGCrossHair(AG_CROSS_HAIR_IMAGE,AG_CROSS_HAIR_SIZE);var oCtrlPositionCrossHair=new _eD( new _fn(0,0),_et.TOP_LEFT);this._dG(this._oCrossHairControl,oCtrlPositionCrossHair);}
var _nG=new _ez("Start",_eH._rN,API_HOST_URL+"/Images/start.png");var _nF=new _ez("End",_eH._rB,API_HOST_URL+"/Images/stop.png");var _nE=new _ez("Clear",_eH.removeRoute,API_HOST_URL+"/Images/clear.png");var oAGContextMenuItemCoord=new _ez("Latitude-Longitude",_eH.showCoord);var _fV=new Array(_nG,_nF,_nE,oAGContextMenuItemCoord);var _nD=new _ey(_fV);this._ry(_nD);};this._jW=function(){return this._cM;};this._rJ=function(_pu){var _oH=this._j5(_fl.MAP_CONTAINER);_oH.style.left=_pu.x+"px";_oH.style.top=_pu.y+"px";var _oI=this._j5(_fl.MOUSE_TARGET_PANE);_oI.style.left=-_pu.x+"px";_oI.style.top=-_pu.y+"px";var oDivStaticPane=this._j5(_fl.STATIC_PANE);oDivStaticPane.style.top=-_pu.y+"px";oDivStaticPane.style.left=-_pu.x+"px";};this._nu=function(_pO){var _l8=this._cM.x+_pO.x;var _l9=this._cM.y+_pO.y;var _pV=new _fn(_l8,_l9);this._rJ(_pV);this._cM=_pV;var oBoundingBoxCurrent=this._jn();var _qh=this._ki();this._rw(_eF.getBoundingBoxForPan(oBoundingBoxCurrent,_qh,_pO));};this._kI=function(_l3){for(var i=0;i<this._k.length;i++){try
{this._k[i].redraw(_l3);}
catch(err){}}
};this._kH=function(_l3){for(var i=0;i<this._f.length;i++){try
{this._f[i].redraw(_l3);}
catch(err){}}
};this._ri=function(){var _ql=this._cY;var oBoundingBoxOld=this._jn();this._cr._ri(this._jX()==_e7.MAIN_MAP);var _hR=this._ju();var _qj=new _fD(_hR.offsetWidth,_hR.offsetHeight);this._cY=_qj;var oBoundingBoxNew=_eF.getBoundingBoxForResize(oBoundingBoxOld,_ql,_qj);var _nU=_eF.getBoundingBoxForZoom(oBoundingBoxNew._jr(),this._kD(),_qj);this._rw(_nU);this._gY(oBoundingBoxNew._jr(),this._kD());if(this._oCrossHairControl!=null)
this._oCrossHairControl.setCrossHairPosition();this._cU._ri();this._b1._ri();};this._ry=function(_nI){if(typeof _nI!="object"||_nI==null)
throw "Invalid input for context menu.";if(this._hc()){if(this._bH!=null)
this._bH.remove();this._bH=_nI;try
{this._bH.initialize(this);}
catch(err){}}
else return false;};this._jw=function(){return this._bH;};this._rU=function(_or){this._hM();if( _or==null||!(_or instanceof _eE))
throw "Invalid input for origin _m1-longitude.";this._cT._rN(_or);};this._rT=function(_oo){this._hM();if( _oo==null||!(_oo instanceof _eE))
throw "Invalid input for destination _m1-longitude.";this._cT._rB(_oo);};this._rV=function(_f5){this._hM();if(typeof _f5=="undefined"||_f5==null||typeof _f5.length=="undefined")
throw "Invalid input for via points.";this._cT._r0(_f5);};this._kg=function(){return this._cT;};this._ij=function(){this._cT._ij(this);this._rb(this._cA);this._cA=null;this._rb(this._cx);this._cx=null;};this._g2=function(){this._cT.clear();this._rb(this._cA);this._cA=null;this._rb(this._cx);this._cx=null;};this._rF=function(_oG){this._cT._rF(_oG);};this._rG=function(_sF){this._cT._rG(_sF);};this._m8=function(){this._cT._m8();};this._jE=function(){if(this._cb==null){this._cb=new _eM();this._dL(this._cb);}
return this._cb;};this._rE=function(_oK){if( _oK==null||!(_oK instanceof _eM))
throw "invalid parameter in setDragZoomMarker function.";if( this._cb!=null&&this._cb instanceof _eM){this._rb(this._cb);}
this._cb=_oK;this._dL(this._cb);};this._dM=function(_ph){var _gd=_ph._jt();var _f8=_eU.getKeysForRegion(_gd);for(var i=0;i<_f8.length;i++)
this._ch._dI(_f8[i],_ph);};this._rc=function(_ph){var _gd=_ph._jt();if(_gd!=null){var _f8=_eU.getKeysForRegion(_gd);for(var i=0;i<_f8.length;i++)
this._ch._dI(_f8[i],_ph);}};this._js=function(_pu){var _sU=_eU.getClickMappingKeyForPosition(_pu);if(this._ch._kL(_sU)){var _ga=this._ch._jT(_sU);for(var i=_ga.length-1;i>=0;i--){var _ph=_ga[i];var _gd=_ph._jt();if(_gd==null)
return null;if(this._mx(_gd,_pu))
return _ph;}}
return null;};this._mx=function(_gd,_pu){return _fO.insidePixelRegion(_gd,_pu);};this._q3=function(){if(this._b1 instanceof _eG)
this._q2(this._b1);this._b1=null;};this._rd=function(){if(this._cU instanceof _fz)
this._q2(this._cU);this._cU=null;};this._rO=function(_my){this._l5=_my;};this._j7=function(){return this._l5;};this._kC=function(){return this._cr._kC();};this._r8=function(){if(this._ck==null){var _nP=new _fL(AG_IMAGERY_TMS_OPTIONS);this._ck=new _fI(1,_nP)
this._ck._rL(_e7.IMAGERY_MAP);this._dL(this._ck,null,true);}
else this._ck.show();this._b1.setForeColor("White");this._cU.setColour("White");this._A=true;};this._kQ=function(){if(this._ck!=null){this._ck.hide();this._A=false;}
this._b1.setForeColor("Black");this._cU.setColour("Black");};this._q6=function(){if(this._ck!=null){this._rb(this._ck);this._ck=null;this._A=false;}};this._mt=function(){return this._A;};this._g0=function(){for(var i=0;i<this._k.length;i++){if(this._k[i] instanceof _fI)
this._k[i]._g0();}};this._rL=function(_iI){this._bg=_iI;};this._jX=function(){return this._bg;};this._jl=function(){return this._cr._cX;};this._jk=function(){return this._cr._bG;};this._jj=function(){return this._cr._bF;};this._rM=function(_sY,_ta){if(_e9.status&&this._jX()==_e7.MAIN_MAP){var _lm=this._jl().width;var _ll=this._jl().height;var _nB=this._jj();var _nA=this._jk();_nB.src=_sY;_nA.link=_ta;}};this._hz=function(){AG_MAP_OBJECTS[this._bf]=null;this._cv=null;this._ca.innerHTML="";this._cr=null;this._k=new Array();this._f=null;this._b1=null;this._cU=null;this._ch=null;this._cY=null;this._oBoundingBoxMap=null;this._cM=null;this._bH=null;this._cT=null;this._cA=null;this._cx=null;this._cb=null;this._bj=-1;this._bp=-1;this._oInfoDisplay=null;this._oCurrentInfoDisplayOptions=null;this._bInfoDisplayEnabled=true;this.oCoordSavedCenter=null;this._qd=null;this._rw(new _ev(new _eE(-1,-1),new _eE(-1,-1)));};this._r6=function(){if(this._bg==_e7.MAIN_MAP){if(this._P==null){this._P=document.createElement('div');this._P.style.position="absolute";this._P.style.backgroundColor="#D6E9F8";this._P.style.width="100%";this._P.style.height="100%";this._P.style.textAlign="center";this._P.style.zIndex="999999";this._P.style.overflow="auto";this._P.innerHTML+="JavaScriptAPI has been developed by :<br/>";this._P.innerHTML+="Ashis Saha<br/>";this._P.innerHTML+="Iaan Roux<br/>";this._P.innerHTML+="Ranada Proshad Biswas<br/>";this._P.innerHTML+="Rezaul Hasan<br/>";this._P.innerHTML+="Shuvabrata Saha<br/>";this._P.innerHTML+="<br/>Thanks for using JavaScriptAPI. Press any key to return ... ";this._P.style.border="1px solid Black";this._P.style.visibility="visible";}
var _hR=this._ju();_hR.appendChild(this._P);}};this._kP=function(){if(this._bg==_e7.MAIN_MAP){if(this._P!=null&&this._P.parentNode)
this._P.parentNode.removeChild(this._P);}};this.setDraggableCursor=function(strCursor){if(this._cv!=null&&this._cv instanceof _e6){if(typeof strCursor=="string"&&strCursor.length>0)
this._cv.draggableCursor=strCursor;}};this.setDraggingCursor=function(strCursor){if(this._cv!=null&&this._cv instanceof _e6){if(typeof strCursor=="string"&&strCursor.length>0)
this._cv.draggingCursor=strCursor;}};this.setStaticCursor=function(strCursor){if(this._cv!=null&&this._cv instanceof _e6){if(typeof strCursor=="string"&&strCursor.length>0)
this._cv.staticCursor=strCursor;}};this.setCursor=function(){var oMouseTargetPane=this._j5(_fl.MOUSE_TARGET_PANE);if(this._if()){oMouseTargetPane.style.cursor=AG_DRAG_ZOOM_CURSOR;}
else {if(this._ie())
oMouseTargetPane.style.cursor=this._cv.draggableCursor;else oMouseTargetPane.style.cursor=this._cv.staticCursor;}}
this._r4=function(){if(this._c6==null){switch(AG_DEFAULT_MS_TYPE){case AGMapServerType.DMS:
var _nP=new _eL(AG_DEFAULT_DMS_OPTION);this._c6=new _fI(1,_nP)
this._dL(this._c6,null,true);break;case AGMapServerType.TMS:
var _nP=new _fL(AG_DEFAULT_TMS_OPTIONS);this._c6=new _fI(1,_nP)
this._dL(this._c6,null,true);break;}}
else this._c6.show();};this._kN=function(){if(this._c6!=null)
this._c6.hide();};this._mj=function(){if(this._c6!=null)
return this._c6._mB();return false;};this._r5=function(){if(this._c7==null){switch(AG_DEFAULT_MS_TYPE_FOR_IMAGERY){case AGMapServerType.DMS:
var _nP=new _eL(AG_DEFAULT_DMS_OPTIONS_FOR_IMAGERY);this._c7=new _fI(2,_nP)
this._dL(this._c7,null,true);break;case AGMapServerType.TMS:
var _nP=new _fL(AG_DEFAULT_TMS_OPTIONS_FOR_IMAGERY);this._c7=new _fI(2,_nP)
this._dL(this._c7,null,true);break;}}
else this._c7.show();};this._kO=function(){if(this._c7!=null)
this._c7.hide();};this._mi=function(){if(this._c7!=null)
return this._c7._mB();return false;};this.showScaleBar=function(){if(this._cU instanceof _fz)
this._cU.show();};this.hideScaleBar=function(){if(this._cU instanceof _fz)
this._cU.hide();};this.enableDragPan=this._iz;this.disableDragPan=this._hF;this.dragPanEnabled=this._ie;this.enableDragZoom=this._iA;this.disableDragZoom=this._hG;this.dragZoomEnabled=this._if;this.enableZoomOnDblClick=this._iH;this.disableZoomOnDblClick=this._hO;this.zoomOnDblClickEnabled=this._tY;this.enableMouseWheelZoom=this._iF;this.disableMouseWheelZoom=this._hL;this.mouseWheelZoomEnabled=this._nt;this.enableContextMenu=this._ix;this.disableContextMenu=this._hD;this.contextMenuEnabled=this._hc;this.addControl=this._dG;this.removeControl=this._q2;this.getContainer=this._ju;this.isLoaded=this._mw;this.getSize=this._ki;this.getCentre=this._jr;this.getBoundingBox=this._jn;this.getBoundingBoxZoomLevel=this._jo;this.getZoomLevel=this._kD;this.setZoomRange=this._r3;this.getMinZoomLevel=this._j0;this.getMaxZoomLevel=this._jZ;this.zoomIn=this._tX;this.zoomOut=this._tZ;this.centreAndScale=this._gY;this.panToCoord=this._qS;this.panBy=this._qQ;this.panDirection=this._qR;this.saveState=this._rq;this.loadState=this._nb;this.addOverlay=this._dL;this.removeGroupOverlay=this._q5;this.removeOverlay=this._rb;this.getPane=this._j5;this.enableInfoDisplay=this._iB;this.disableInfoDisplay=this._hH;this.infoDisplayEnabled=this.infoDisplayEnabled;this.openInfoDisplay=this._pn;this.openInfoDisplayHTML=this._pp;this.openInfoDisplayPanels=this._pr;this.openInfoDisplayPanelsHTML=this._ps;this.showEnlargedMap=this._r7;this.closeInfoDisplay=this._g4;this.getInfoDisplay=this._jR;this.getCoordFromMap=this._jy;this.getPointFromMap=this._ka;this.getPointFromVisibleArea=this._kb;this.getCoordFromVisibleArea=this._jz;this.resize=this._ri;this.setContextMenu=this._ry;this.getContextMenu=this._jw;this.showImagery=this._r8;this.hideImagery=this._kQ;this.isImageryVisible=this._mt;this.showDefaultMap=this._r4;this.hideDefaultMap=this._kN;this.isDefaultMapVisible=this._mj;this.showDefaultMapForImagery=this._r5;this.hideDefaultMapForImagery=this._kO;this.isDefaultMapForImageryVisible=this._mi;this.clearCache=this._g0;this.setDraggableCursor=this.setDraggableCursor;this.setDraggingCursor=this.setDraggingCursor;this.setStaticCursor=this.setStaticCursor;this.showScaleBar=this.showScaleBar;this.hideScaleBar=this.hideScaleBar;}
var AGMap=_e4;

function _e6(_sr,_sI,_sJ,_gK,bShowCrossHair,strStaticCursor){if(typeof _sr=="string")
this.backgroundColour=_sr;else this.backgroundColour=null;if(typeof _sI=="string")
this.draggableCursor=_sI;else this.draggableCursor=AG_DRAGGABLE_CURSOR;if(typeof _sJ=="string")
this.draggingCursor=_sJ;else this.draggingCursor=AG_DRAGGING_CURSOR;if(typeof _gK=="boolean") 
this.loadInitialMap=_gK;else this.loadInitialMap=true;if(typeof bShowCrossHair=="boolean")
this.showCrossHair=bShowCrossHair;else this.showCrossHair=true;if(typeof strStaticCursor=="string")
this.staticCursor=strStaticCursor;else this.staticCursor=AG_STATIC_CURSOR;this.copy=function(){return new _e6(this.backgroundColour,this.draggableCursor,this.draggingCursor,this.loadInitialMap,this.showCrossHair,this.staticCursor);};}
var AGMapOptions=_e6;

function _e5(_pm,_iI){this._dg=_pm;this._1=_iI;this._dg.setAttribute('align','left');this._dg.style.textAlign="left";this._dg.style.overflow="hidden";this._cG=null;this._bW=null;this._cs=null;this._cV=null;this._b2=null;this._cl=null;this._cw=null;this._cH=null;this._cz=null;this._cy=null;this._cf=null;this._cC=null;this._ce=null;this._bG=null;this._bF=null;this._oStaticPane=null;this._cG=document.createElement('div');this._cG.style.position="absolute";this._cG.style.width=$(this._dg).innerWidth()+"px";this._cG.style.height=$(this._dg).innerHeight()+"px";this._cG.style.overflow="hidden";this._cG.oncontextmenu=function(){return false;};this._bW=document.createElement('div');this._bW.style.position="absolute";this._bW.style.width=$(this._dg).innerWidth()+"px";this._bW.style.height=$(this._dg).innerHeight()+"px";this._bW.style.overflow="hidden";this._bW.oncontextmenu=function(){return false;};this._cs=document.createElement('div');this._cs.style.position="absolute";this._cs.style.width=$(this._dg).innerWidth()+"px";this._cs.style.height=$(this._dg).innerHeight()+"px";this._cs.oncontextmenu=function(){return false;};this._cl=document.createElement('div');this._cl.style.position="absolute";this._cl.style.zIndex="50";this._cs.appendChild(this._cl);this._cw=document.createElement('div');this._cw.style.position="absolute";this._cw.style.zIndex="100";this._cs.appendChild(this._cw);this._cH=document.createElement('div');this._cH.style.position="absolute";this._cH.style.zIndex="110";this._cs.appendChild(this._cH);this._cz=document.createElement('div');this._cz.style.position="absolute";this._cz.style.zIndex="120";this._cs.appendChild(this._cz);this._cy=document.createElement('div');this._cy.style.position="absolute";this._cy.style.zIndex="130";this._cs.appendChild(this._cy);this._cf=document.createElement('div');this._cf.style.position="absolute";this._cf.style.zIndex="140";this._cs.appendChild(this._cf);this._oStaticPane=document.createElement('div');this._oStaticPane.style.position="absolute";this._oStaticPane.style.zIndex="145";this._oStaticPane.style.width=$(this._dg).innerWidth()+"px";this._oStaticPane.style.height=$(this._dg).innerHeight()+"px";this._oStaticPane.style.left="0px";this._oStaticPane.style.top="0px";this._cs.appendChild(this._oStaticPane);this._cC=document.createElement('div');this._cC.style.position="absolute";this._cC.style.zIndex="150";this._cC.style.width=$(this._dg).innerWidth()+"px";this._cC.style.height=$(this._dg).innerHeight()+"px";this._cC.style.left="0px";this._cC.style.top="0px";this._cC.style.cursor="pointer";this._cC.style.backgroundColor="Black";this._cC.style.opacity="0";this._cC.style.filter="alpha(opacity=0)";this._cC.style.mozOpacity="0";this._cC.oncontextmenu=function(){return false;};this._cs.appendChild(this._cC);this._ce=document.createElement('div');this._ce.style.position="absolute";this._ce.style.zIndex="160";this._cs.appendChild(this._ce);this._bL=document.createElement('div');this._bL.setAttribute('id',_eY.getZoomAnimationDivId());this._bL.style.position="absolute";this._bL.style.left="0px";this._bL.style.top="0px";this._bL.style.width="0px";this._bL.style.height="0px";this._bL.style.zIndex="130";this._bL.style.border="2px dashed Red";this._bL.style.visibility="hidden";this._cs.appendChild(this._bL);this._bW.appendChild(this._cs);this._cG.appendChild(this._bW);this._bG=document.createElement('div');this._bG.style.position="absolute";this._bG.style.top="0px";this._bG.style.visibility="hidden";this._bG.style.zIndex="100";this._bG.style.cursor="pointer";this._bG.style.overflow="hidden";this._bG.style.backgroundColor="White";this._bG.style.zIndex="370";this._bG.link="";this._bG.onclick=function(_iN){window.open(this.link);};this._bF=document.createElement('img');this._bF.setAttribute('src',API_HOST_URL+"Images/white.JPG");this._bF.setAttribute('alt',"");this._bF.style.visibility="hidden";this._bF.style.position="absolute";this._bF.style.left="0px";this._bF.style.top="0px";this._bF.style.zIndex="370";this._bG.appendChild(this._bF);this._cG.appendChild(this._bG);this._dg.appendChild(this._cG);this._cX=new _fD(0,0);this._ri=function(){var _kW=0;var _kX=0;this._cG.style.width=$(this._dg).innerWidth()+"px";this._cG.style.height=$(this._dg).innerHeight()+"px";var _mQ=0;var _lj=0;if(this._1==_e7.MAIN_MAP&&_e9.status==true){_kW=parseInt( 0.15*$(this._dg).innerHeight());_kX=$(this._dg).innerWidth();if(_kW>=70&&_kX>=700){_lj=70;_mQ=700;}
else if(_kW>=60&&_kX>=600){_lj=60;_mQ=600;}
else if(_kW>=40&&_kX>=400){_lj=40;_mQ=400;}
else if(_kW>=30&&_kX>=300){_lj=30;_mQ=300;}
else {_lj=20;_mQ=200;}
this._cX=new _fD(_mQ,_lj);this._bG.style.width=$(this._dg).innerWidth()+"px";this._bG.style.height=_kW+"px";if(_mQ>0||_lj>0){var _lm=this._cX.width;var _ll=this._cX.height;var _nB=this._bF;var _nA=this._bG;_nB.style.visibility="visible";_nB.style.width=_lm+"px";_nB.style.height=_ll+"px";_nA.style.visibility="visible";var _kV=$(_nA).innerWidth();var _kU=$(_nA).innerHeight();if( _lm<_kV){var _mQ=parseInt((_kV-_lm)/2,10);_nB.style.left=_mQ+"px";}
else _nB.style.left="0px";if( _ll<_kU){var _ls=parseInt((_kU-_ll)/2,10);_nB.style.top=_ls+"px";}
else _nB.style.top="0px";}}
this._bW.style.width=$(this._dg).innerWidth()+"px";this._bW.style.height=$(this._dg).innerHeight()-_kW+"px";this._cs.style.width=$(this._dg).innerWidth()+"px";this._cs.style.height=$(this._dg).innerHeight()-_kW+"px";this._cC.style.width=$(this._dg).innerWidth()+"px";this._cC.style.height=$(this._dg).innerHeight()-_kW+"px";this._bG.style.top=this._cs.offsetHeight+"px";};this._kC=function(){return this._bL;};this._ri();}


function _eY(){}
_eY.strTileIdPrefix="AGMapTile";_eY.iTileIdCount=0;_eY.getTileIdPrefix=function(){_eY.iTileIdCount++;return _eY.strTileIdPrefix+_eY.iTileIdCount;};_eY.strZoomAnimationDivIdPrefix="_fQ";_eY.iZoomAnimationIdCount=0;_eY.getZoomAnimationDivId=function(){_eY.iZoomAnimationIdCount++;return _eY.strZoomAnimationDivIdPrefix+_eY.iZoomAnimationIdCount;};

function _ex(_lr,_gw){this._bf=_lr;this._r=_gw;this._jN=function(){return this._bf;};this._mf=function(){return this._r;};}


function _fG(_o0,_mL,_lX){this._cq=_o0;this._bx=_mL;this._br=_lX;this._o=new Array();for(var i=0;i<=this._br;i++)
this._o[i]=new Array();this._h=new Array();for(var i=0;i<this._bx;i++)
this._h.push(i);this._n=new Array();for(var i=0;i<this._bx;i++)
this._n[i]=new _fH(-1,-1,-1,new _ev(new _eE(0,0),new _eE(-1,-1)));this._j=new Array();this.getTile=function(_qy){_mZ=_qy._kD();_mR=_qy._kA();_mU=_qy._kB();oBoundingBoxTile=_qy._jn();var _gE=false;var _mG=this._jq(_qy);if(_mG>=0){_gE=true;return new _ex(_mG,_gE);}
if(this._h.length>0){var _mG=this._h.pop();this._o[_mZ].push(_mG);this._n[_mG]._gZ(_mZ,_mR,_mU,oBoundingBoxTile);this._qZ(this._n[_mG],_mG);return new _ex(_mG,_gE);}
if(this._o[_mZ].length<this._bx){var _mG=this._ks(_mZ,_mR,_mU);this._o[_mZ].push(_mG);this._n[_mG]._gZ(_mZ,_mR,_mU,oBoundingBoxTile);this._qZ(this._n[_mG],_mG);return new _ex(_mG,_gE);}
var _mG=this._jI(_mZ);this._rf(this._n[_mG]);this._n[_mG]._gZ(_mZ,_mR,_mU,oBoundingBoxTile);this._qZ(this._n[_mG],_mG);return new _ex(_mG,_gE);};this._ks=function(_lb,_mR,_mU){var _lW=this._n.length;var _sh=Math.floor( Math.random()*_lW);var i=_sh;for(var c=0;c<_lW;c++){i=(i+1) % _lW;var _tG=this._n[i];if(_tG._kD()!=_lb){var _mc=_tG._kD();var _lv=this._o[_mc].length;for(var j=0;j<_lv;j++){if(this._o[_mc][j]==i){this._o[_mc].splice(j,1);}}
this._rf(_tG);return i;}}
return-1;};this._jI=function(_mZ){var _om=this._cq._jr();var _qC=_fJ.getTMSTileInfo(_mZ,_om);var _i3=-1;var _le=-1;var _gl=this._o[_mZ];for(var i=0;i<_gl.length;i++){var _tH=_gl[i];var _tG=this._n[_tH];if(!this._mv(_tG)){var _iR=this._jD(_qC,_tG);if(_iR>_i3){_i3=_iR;_le=_tH;}}
}
return _le;};this._mv=function(_qy){if(_qy._kD()<0)
return false;var oBoundingBoxTileRegion=_qy._jn();var oBoundingBoxViewRegion=this._cq._jn();return oBoundingBoxTileRegion._l0(oBoundingBoxViewRegion);};this._jD=function(_qA,_qB){var _mS=_qA._kA();var _mV=_qA._kB();var _mT=_qB._kA();var _mW=_qB._kB();return Math.pow((_mS-_mT)*(_mS-_mT)+(_mV-_mW)*(_mV-_mW),0.5);};this._qZ=function(_qz,_mG){var _sT=this._jK(_qz);this._j[_sT]=_mG;};this._rf=function(_qz){var _sT=this._jK(_qz);this._j[_sT]=-1;};this._jq=function(_qz){var _sT=this._jK(_qz);if(this._j[_sT]>=0)
return this._j[_sT];return-1;};this._jK=function(_qz){var _rv=",";return _qz._kD()+_rv+_qz._kA()+_rv+_qz._kB();};this._ku=function(_mZ){return this._o[_mZ];};this._kt=function(_mG){return this._n[_mG];};this._ne=function(_mG){var _hl=this._n[_mG];var _mZ=_hl._kD();if( _mZ>0){var _lL=this._jO(this._o[_mZ],_mG);if(_lL>=0){this._o[_mZ].splice(_lL,1);this._rf(_hl);this._n[_mG]._gZ(-1,-1,-1,new _ev(new _eE(0,0),new _eE(-1,-1)));this._h.push(_mG);}}
};this._jO=function(_fV,value){for(var i=0;i<_fV.length;i++){if(_fV[i]==value)
return i;}
return-1;};}


function _fH(_mZ,_mR,_mU,_nU){this._bD=_mZ;this._bz=_mR;this._bA=_mU;this._oBoundingBox=_nU;this._gZ=function(_mZ,_mR,_mU,_nU){this._bD=_mZ;this._bz=_mR;this._bA=_mU;this._oBoundingBox=_nU;};this._kD=function(){return this._bD;};this._kA=function(){return this._bz;};this._kB=function(){return this._bA;};this._jn=function(){return this._oBoundingBox;};}


_fI.prototype=new _ff;var _sg=0;function _fI(_mX,_nP){if(typeof _mX!="number")
_mX=1;this._a=null;this._oBoundingBoxVisible=null;this._p=null;this._i=null;this._dC=null;this._c5=null;this._V=null;this._bB=_mX*2;this._bt=-1;this._bb=-1;this._bq=0;this._H=false;this._by=_e7.NORMAL_MAP;if(typeof _nP=="undefined"||_nP==null)
this._cS=new _fL(AG_DEFAULT_TMS_OPTIONS);else this._cS=_nP;this.initialize=function(_e3){this._a=_e3;this._hi();this._c5=new _fG(this._a,_ej,_ek);this._rK();this._bt=this._a._kD();this._bb=-1;this._H=true;};this.copy=function(){};this.redraw=function(_l2){if(!this._mB())
return;switch(_l2){case _fe.ZOOM:
if(this._bb>0)
this._kR(this._bb);if(this._bt>0 )
this._q0(this._bt);this._rK(1);this._bb=this._bt;this._bt=this._a._kD();break;case _fe.PAN:
this._rK();break;}};this.remove=function(){if(this._jX()==_e7.IMAGERY_MAP)
_hV=this._a._j5(_fl.IMAGERY_PANE);else _hV=this._a._j5(_fl.MAP_PANE);_hV.removeChild(this._V);this._a=null;this._H=false;};this._rL=function(iType){this._by=iType;};this._jX=function(){return this._by;};this.hide=function(){if(!this._mu())
return;this._si(false);this._V.style.display="none";this._H=false;};this.show=function(){if(!this._mu())
return;if(!this._mB()){this._V.style.display="";this._H=true;this.redraw(_fe.ZOOM);}};this._mB=function(){return this._H;};this._hi=function(){this._dC=_eY.getTileIdPrefix();this._V=document.createElement("div");this._V.setAttribute("id","_sg"+_sg);_sg++;this._V.style.position="absolute";this._V.style.left="0px";this._V.style.top="0px";this._V.style.visibility="visible";this._V.style.zIndex=this._bB;var _hV;if(this._jX()==_e7.IMAGERY_MAP)
_hV=this._a._j5(_fl.IMAGERY_PANE);else _hV=this._a._j5(_fl.MAP_PANE);_hV.appendChild(this._V);if(_ew._gN=="Explorer"&&_ew.VERSION<7){this._p=new Array();this._i=new Array();for(var i=0;i<_ej;i++){var _tE=document.createElement("div");_tE.setAttribute("id",this._dC+"_"+i);_tE.setAttribute("src",_ef);_tE.style.position="absolute";_tE.style.width=AG_TILE_SIZE.width+"px";_tE.style.height=AG_TILE_SIZE.height+"px";_tE.style.visibility="hidden";_tE._mw=false;_tE.zoomLevel=-1;var img=document.createElement("img");img.style.position="absolute";img.style.visibility="hidden";img._lM=i;var _tD=this;img.onload=function(){if(!_tD._mu())
return false;var _tF=_tD._p[this._lM];if(_tF.src==_ef){_tF._mw=false;return false;}
var _hm=_tD._a._kD();if( _hm==_tF.zoomLevel){_tF.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"',sizingMethod='scale')";_tF.style.visibility="visible";if(_tD._bq==1&&_tD._bb>0&&_tD._bb!=_hm) 
 _tD._kR(_tD._bb);_tD._bq=Math.max(_tD._bq-1,0);}
_tF._mw=true;}
this._i.push(img);this._V.appendChild(img);this._p.push(_tE);this._V.appendChild(_tE);}}
else {this._p=new Array();for(var i=0;i<_ej;i++){var _tE=document.createElement("img");_tE.setAttribute("id",this._dC+"_"+i);_tE.style.position="absolute";_tE.style.width=AG_TILE_SIZE.width+"px";_tE.style.height=AG_TILE_SIZE.height+"px";_tE.style.visibility="hidden";_tE._mw=false;_tE.zoomLevel=-1;var _tD=this;_tE.onload=function(){if(_tD._a._kD()==this.zoomLevel){this.style.visibility="visible";if(_tD._bq==1&&_tD._bb>0) 
 _tD._kR(_tD._bb);_tD._bq=Math.max(_tD._bq-1,0);}
this._mw=true;}
this._p.push(_tE);this._V.appendChild(_tE);}}
};this._rK=function(_ly){this._si();var _mZ=this._a._kD();if(_ly==1)
this._bq=0;this._oBoundingBoxVisible=this._a._jn()
var oCoordNW=this._oBoundingBoxVisible._j2();var _qG=_fJ.getTMSTileInfo(_mZ,oCoordNW);var oCoordTopLeftTileSpan=_qG._jn()._tI();var oCoordRightBottomMap=this._oBoundingBoxVisible._kj();var oCoordRightBottomTile=_qG._jn()._kj();var _lV=Math.ceil((oCoordRightBottomMap.longitude()-oCoordRightBottomTile.longitude()) / oCoordTopLeftTileSpan.longitude())+1;var _lU=Math.ceil((oCoordRightBottomTile._m1()-oCoordRightBottomMap._m1() ) / oCoordTopLeftTileSpan._m1())+1;var oCoordLeftTopTile=_qG._jn()._j2();var _pJ=this._a._ka(oCoordLeftTopTile);for(var i=0;i<_lV;i++){for(var j=0;j<_lU;j++){var _mR=_qG._kA()+i;var _mU=_qG._kB()+j;var oCoordTopLeftOfNewTile=new _eE(oCoordLeftTopTile._m1()-j*oCoordTopLeftTileSpan._m1(),oCoordLeftTopTile.longitude()+i*oCoordTopLeftTileSpan.longitude());var oCoordBottomRightOfNewTile=new _eE(oCoordLeftTopTile._m1()-(j+1)*oCoordTopLeftTileSpan._m1(),oCoordLeftTopTile.longitude()+(i+1)*oCoordTopLeftTileSpan.longitude());var oBoundingBoxNewTile=new _ev(oCoordTopLeftOfNewTile,oCoordBottomRightOfNewTile);var _n9=this._c5.getTile( new _fH(_mZ,_mR,_mU,oBoundingBoxNewTile));var _ny=_n9._jN();var _gE=_n9._mf();var _tE=document.getElementById(this._dC+"_"+_ny);_tE.style.zIndex=this._bB;_tE.style.width=AG_TILE_SIZE.width+"px";_tE.style.height=AG_TILE_SIZE.height+"px";if(!_gE){if(_ew._gN=="Explorer"&&_ew.VERSION<7){_tE.parentNode.removeChild(_tE);_tE=document.createElement("div");_tE.setAttribute("id",this._dC+"_"+_ny);_tE.style.position="absolute";_tE.style.width=AG_TILE_SIZE.width+"px";_tE.style.height=AG_TILE_SIZE.height+"px";_tE.style.visibility="hidden";_tE._mw=false;_tE.zoomLevel=-1;_tE.style.zIndex=this._bB;this._p[_ny]=_tE;this._V.appendChild(_tE);}
_tE.zoomLevel=_mZ;_tE.style.visibility="hidden";_tE._mw=false;if(_ly==1)
this._bq++;if(_ew._gN=="Explorer"&&_ew.VERSION<7)
this._i[_ny].setAttribute("src",this._cS._kv(new _fH(_mZ,_mR,_mU,oBoundingBoxNewTile) ));else _tE.setAttribute("src",this._cS._kv(new _fH(_mZ,_mR,_mU,oBoundingBoxNewTile)));}
else {if(_tE._mw==true){_tE.style.visibility="visible";}}
_tE.style.left=_pJ.x+(i*AG_TILE_SIZE.width)+"px";_tE.style.top=_pJ.y+(j*AG_TILE_SIZE.height)+"px";}}
if( _ly==1&&this._bq==0&&this._bt>0&&this._bt!=_mZ)
this._kR(this._bt);};this._kR=function(_mZ){var _k2=this._a._kD();if(_mZ==_k2)
return;var _gm=this._c5._ku(_mZ);for(var i=0;i<_gm.length;i++){var _mG=_gm[i];var _h2=this._p[_mG];_h2.style.visibility="hidden";}};this._q0=function(_ma){var _gm=this._c5._ku(_ma);for(var i=0;i<_gm.length;i++){var _mG=_gm[i];var _h2=this._p[_mG];var _qz=this._c5._kt(_mG);var oBoundingBoxTile=_qz._jn();var oCoordTopLeft=oBoundingBoxTile._j2();var oCoordBottomRight=oBoundingBoxTile._kj();var _p1=this._a._ka(oCoordTopLeft);var _py=this._a._ka(oCoordBottomRight);_h2.style.left=_p1.x+"px";_h2.style.top=_p1.y+"px";_h2.style.width=Math.abs(_py.x-_p1.x)+"px";_h2.style.height=Math.abs(_py.y-_p1.y)+"px";_h2.style.zIndex=this._bB-1;}};this._si=function(_gP){if(typeof _gP!="boolean")
_gP=true;var _nX=this._a._jn();var _lb=this._a._kD();for(var i=0;i<_ej;i++){var _qz=this._c5._kt(i);if(_qz._kD()==_lb&&_gP){var _n4=_qz._jn();if(_nX._l0(_n4))
continue;}
var _tE=document.getElementById(this._dC+"_"+i);if(_tE.src!=_ef&&_tE._mw==false){_tE.setAttribute("src",_ef);_tE._mw=false;this._c5._ne(i);if(this._bq==1&&this._bb>0&&this._bb!=this._a._kD()) 
 this._kR(this._bb);this._bq=Math.max(this._bq-1,0);}}
};this._mu=function(){return this._a!=null;};this._g0=function(){for(var i=0;i<_ej;i++){var _tE=document.getElementById(this._dC+"_"+i);_tE.setAttribute("src",_ef);_tE._mw=false;this._c5._ne(i);if(this._bq==1&&this._bb>0&&this._bb!=this._a._kD()) 
 this._kR(this._bb);this._bq=Math.max(this._bq-1,0);}
this.redraw(_fe.PAN);};this.hide=this.hide;this.show=this.show;this.isVisible=this._mB;this.clearCache=this._g0;}
var AGTileLayerOverlay=_fI;

function _fJ(){}
_fJ.getDistanceInKiloMetre=function(dLng1,dLat1,dLng2,dLat2){dLng1=parseFloat(dLng1);dLat1=parseFloat(dLat1);dLng2=parseFloat(dLng2);dLat2=parseFloat(dLat2);var _is=parseFloat(parseFloat(180.0)/Math.acos(-1.0));var _ic=parseFloat(6378.7);var _hu=_ic*Math.acos(Math.sin(dLat1/_is)*Math.sin(dLat2/_is)+Math.cos(dLat1/_is)*Math.cos(dLat2/_is)*Math.cos(dLng2/_is-dLng1/_is) );return _hu;};_fJ.getTMSTileInfo=function(_mZ,_oj){var oCoordDiffForATile=180.0 / Math.pow(2,_mZ-1);var x=Math.floor((_oj.longitude()+180) / oCoordDiffForATile);var y=Math.floor((-_oj._m1()+90) / oCoordDiffForATile);var _tS=-180+x*oCoordDiffForATile;var _tR=_tS+oCoordDiffForATile;var _tU=90-y*oCoordDiffForATile;var _tV=_tU-oCoordDiffForATile;var _n7=new _ev(new _eE(_tV,_tS),new _eE(_tU,_tR));return new _fH(_mZ,x,y,_n7);};_fJ.getBBoxOfTile=function(_mZ,_mR,_mU){var oCoordDiffForATile=180.0 / Math.pow(2,_mZ-1);var _tS=-180+_mR*oCoordDiffForATile;var _tR=_tS+oCoordDiffForATile;var _tU=90-_mU*oCoordDiffForATile;var _tV=_tU-oCoordDiffForATile;return new _ev(new _eE(_tV,_tS),new _eE(_tU,_tR));};_fJ.getDistanceBetweenCoords=function(_ok,_ol,unit){if(typeof unit!="number")
unit=_fN.KILOMETERS;switch(unit){case _fN.KILOMETERS : 
return _fJ.getDistanceInKiloMetre(_ok.longitude(),_ok._m1(),_ol.longitude(),_ol._m1());case _fN.MILES :
var _lT=_fJ.getDistanceInKiloMetre(_ok.longitude(),_ok._m1(),_ol.longitude(),_ol._m1());return _lT*0.621371192;}};_fJ.getDistanceMetreToPixel=function(fMetre,_mZ){_mZ=parseInt(_mZ);iScaleRatio=_es[_mZ-1];var inCM=parseFloat(fMetre*100 / iScaleRatio);var inINC=parseFloat(inCM /2.54);var inPixel=parseFloat(inINC*96);return inPixel;};

_fa.prototype=new _ff;function _fa(_oj,_p7){if(_oj==null||!(_oj instanceof _eE))
throw "Invalid input for _m1-longitude.";this._oCoord=_oj;if( _p7!=null&&_p7 instanceof _fb)
this._cQ=_p7.copy();else this._cQ=new _fb();if(this._cQ.draggable) 
 this._cQ.clickable=true;this._bI=null;this._Q=null;this._ct=null;this._C=true;this._dA="image";this._R=null;this._cu=null;this._e=null;this._arrInfoDisplayPanels=new Array();this.oInfoDisplayContent=null;this.oInfoDisplayOptions=null;this._cn=null;this._dJ=function(_n5,_oj,_oM,_oN,_n6){var pt=this._bI._ka(_oj);var _nx=new _fn((pt.x+_oM-_n6.offsetLeft),(pt.y+_oN-_n6.offsetTop));_n5.Lat=_oj._m1();_n5.Long=_oj.longitude();_n5._oM=_oM;_n5._oN=_oN;_n5.style.position="absolute";_n5.style.left=_nx.x+"px";_n5.style.top=_nx.y+"px";_n6.appendChild(_n5);this._rx(_nx);};this.initialize=function(_e3){this._bI=_e3;this._Q=this._bI._j5(_fl.MARKER_PANE);if(_ew._gN=="Explorer"&&_ew.VERSION<7 ){this._ct=document.createElement("div");if(this._cQ.icon.iconSize.width>0&&this._cQ.icon.iconSize.height>0){this._dA="scale";this._ct.style.width=this._cQ.icon.iconSize.width+"px";this._ct.style.height=this._cQ.icon.iconSize.height+"px";}
else {this._dA="image";this._ct.style.width="1px";this._ct.style.height="1px";}
this._ct.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._jL().image+"',sizingMethod='"+this._dA+"')";}
else {this._ct=document.createElement("img");this._ct.src=this._jL().image;if(this._cQ.icon.iconSize.width>0&&this._cQ.icon.iconSize.height>0){this._ct.style.width=this._cQ.icon.iconSize.width+"px";this._ct.style.height=this._cQ.icon.iconSize.height+"px";}}
this._dJ(this._ct,this._oCoord,this._jL().iconAnchor.x,this._jL().iconAnchor.y,this._Q);this._R=this._bI._j5(_fl.MARKER_SHADOW_PANE);if(_ew._gN=="Explorer" ){var sizingMethod="scale";this._cu=document.createElement("div");if(this._cQ.icon.shadowSize.width>0&&this._cQ.icon.shadowSize.height>0){sizingMethod="scale";this._cu.style.width=this._cQ.icon.shadowSize.width+"px";this._cu.style.height=this._cQ.icon.shadowSize.height+"px";}
else if(this._cQ.icon.iconSize.width>0&&this._cQ.icon.iconSize.height>0){sizingMethod="scale";this._cu.style.width=Math.round(this._cQ.icon.iconSize.width*1.5)+"px";this._cu.style.height=this._cQ.icon.iconSize.height+"px";}
else {sizingMethod="image";this._cu.style.width="1px";this._cu.style.height="1px";}
this._cu.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._jL().shadow+"',sizingMethod='"+sizingMethod+"')";}
else {this._cu=document.createElement("img");this._cu.src=this._jL().shadow;if(this._cQ.icon.shadowSize.width>0&&this._cQ.icon.shadowSize.height>0){this._cu.style.width=this._cQ.icon.shadowSize.width+"px";this._cu.style.height=this._cQ.icon.shadowSize.height+"px";}
else if(this._cQ.icon.iconSize.width>0&&this._cQ.icon.iconSize.height>0){this._cu.style.width=Math.round(this._cQ.icon.iconSize.width*1.5)+"px";this._cu.style.height=this._cQ.icon.iconSize.height+"px";}}
this._cu.style.position="absolute";var pt=this._bI._ka(this._oCoord);var _ls=pt.x+this._jL().iconAnchor.x;var _mI=pt.y+this._jL().iconAnchor.y;this._cu.style.left=_ls+"px";this._cu.style.top=_mI+"px";this._R.appendChild(this._cu);if(this._cQ.stationary)
this._nd();if(this._cQ.draggable)
this._nc();};this.copy=function(){}
this.redraw=function(_l2){switch(_l2){case _fe.ZOOM:
if(!(this._oCoord instanceof _eE))
throw "Coord not given.";var _oU=this._bI._ka(this._oCoord);var _o9=new _fn((_oU.x+this._jL().iconAnchor.x),(_oU.y+this._jL().iconAnchor.y));this._ct.style.left=_o9.x+"px";this._ct.style.top=_o9.y+"px";this._cu.style.left=_o9.x+"px";this._cu.style.top=_o9.y+"px";this._rx(_o9);if(this._cQ.stationary)
this._nd();if(this._cQ.draggable)
this._nc();break;case _fe.PAN:
if(this._cQ.stationary&&this._bI._l5==_fm.DEFAULT){var _o1=this._bI._jW();var _ls=-_o1.x+this._cn.x+this._jL().iconAnchor.x;var _mI=-_o1.y+this._cn.y+this._jL().iconAnchor.y;this._ct.style.left=_ls+"px";this._ct.style.top=_mI+"px";this._cu.style.left=_ls+"px";this._cu.style.top=_mI+"px";var _oE=new _fn((-_o1.x+this._cn.x),(-_o1.y+this._cn.y));this._rx(new _fn(parseInt(this._ct.style.left),parseInt(this._ct.style.top)));this._oCoord=this._bI._jy(_oE);}
else if((this._cQ.stationary||this._cQ.draggable)&&this._bI._l5==_fm.DRAG){this._cn=this._bI._kb(this._oCoord);}
break;}};this.remove=function(){var _hW=this._bI._j5(_fl.MARKER_PANE);_hW.removeChild(this._ct);var _hX=this._bI._j5(_fl.MARKER_SHADOW_PANE);_hX.removeChild(this._cu);if(this._oCoord==this._bI._jR()._j9())
this._bI._g4();this._q1();this._bI=null;this._ct=null;};this._pn=function(_sC,_oW){if(typeof _sC!="object")
throw("Invalid HTML _se in the _nm _pn");if(this._arrInfoDisplayPanels.length>0)
this._arrInfoDisplayPanels=new Array();if(!(_oW instanceof _e1)){_oW=new _e1();_oW.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_oW.stationary=true;_oW.pixelOffset=this._jL().infoDisplayAnchor;this._bI._pn(this._oCoord,_sC,_oW);this._arrInfoDisplayPanels.push(new _e2("",_sC));};this._pp=function(_sV,_oW){if(typeof _sV!="string")
throw("Invalid HTML string _se in the _nm _pp");if(this._arrInfoDisplayPanels.length>0)
this._arrInfoDisplayPanels=new Array();if(!(_oW instanceof _e1)){_oW=new _e1();_oW.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_oW.stationary=true;_oW.pixelOffset=this._jL().infoDisplayAnchor;this._bI._pp(this._oCoord,_sV,_oW);this._arrInfoDisplayPanels.push(new _e2("",_sV));};this._pr=function(_gb,_oW){if(typeof _gb!="object")
throw("Invalid HTML _se in the _nm _pn");if(this._arrInfoDisplayPanels.length>0)
this._arrInfoDisplayPanels=new Array();if(!(_oW instanceof _e1)){_oW=new _e1();_oW.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_oW.stationary=true;_oW.pixelOffset=this._jL().infoDisplayAnchor;this._bI._pr(this._oCoord,_gb,_oW);this._arrInfoDisplayPanels=_gb;};this._ps=function(_gb,_oW){if(typeof _gb!="object")
throw("Invalid HTML _se in the _nm _pn");if(this._arrInfoDisplayPanels.length>0)
this._arrInfoDisplayPanels=new Array();if(!(_oW instanceof _e1)){_oW=new _e1();_oW.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_oW.stationary=true;_oW.pixelOffset=this._jL().infoDisplayAnchor;this._bI._ps(this._oCoord,_gb,_oW);this._arrInfoDisplayPanels=_gb;};this._oInfoDisplayEventListener=null;this.removePreviousInfoDisplayListener=function(){if(this._oInfoDisplayEventListener){_eP.removeListener(this._oInfoDisplayEventListener);this._oInfoDisplayEventListener=null;}};this._gF=function(content,_p7){this.removePreviousInfoDisplayListener();this.oInfoDisplayContent=content;if(!(_p7 instanceof _e1)){_p7=new _e1();_p7.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_p7.stationary=true;this.oInfoDisplayOptions=_p7;this._oInfoDisplayEventListener=_eP.bind(this,"onclick",this,this._sa);if(content==null||content=="")
this.removePreviousInfoDisplayListener();};this._sa=function(){this._pn(this.oInfoDisplayContent,this.oInfoDisplayOptions);};this._gG=function(content,_p7){this.removePreviousInfoDisplayListener();this.oInfoDisplayContent=content;if(!(_p7 instanceof _e1)){_p7=new _e1();_p7.pixelOffset=this._jL().infoDisplayAnchor;}
_p7.stationary=this._cQ.stationary;this.oInfoDisplayOptions=_p7;this._oInfoDisplayEventListener=_eP.bind(this,"onclick",this,this._r9);if(content==null||content=="")
this.removePreviousInfoDisplayListener();};this._r9=function(){this._pp(this.oInfoDisplayContent,this.oInfoDisplayOptions);};this._gH=function(panels,_p7){this.removePreviousInfoDisplayListener();this.oInfoDisplayContent=panels;if(!(_p7 instanceof _e1)){_p7=new _e1();_p7.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_p7.stationary=true;this.oInfoDisplayOptions=_p7;this._oInfoDisplayEventListener=_eP.bind(this,"onclick",this,this._sc);if(panels==null||panels=="")
this.removePreviousInfoDisplayListener();};this._sc=function(){this._pr(this.oInfoDisplayContent,this.oInfoDisplayOptions);};this._gI=function(panels,_p7){this.removePreviousInfoDisplayListener();this.oInfoDisplayContent=panels;if(!(_p7 instanceof _e1)){_p7=new _e1();_p7.pixelOffset=this._jL().infoDisplayAnchor;}
if(this._cQ.stationary)
_p7.stationary=true;this.oInfoDisplayOptions=_p7;this._oInfoDisplayEventListener=_eP.bind(this,"onclick",this,this._sb);if(panels==null||panels=="")
this.removePreviousInfoDisplayListener();};this._sb=function(){this._ps(this.oInfoDisplayContent,this.oInfoDisplayOptions);};this._g4=function(){if(this._bI!=null){if(this._oCoord==this._bI._jR()._j9())
this._bI._g4();}};this._r7=function(_p7){if(!(_p7 instanceof _e1)){_p7=new _e1();_p7.pixelOffset=this._jL().infoDisplayAnchor;}
this._bI._r7(this._oCoord,_p7);};this._jL=function(){return this._cQ.icon;};this._kw=function(){if(typeof this._cQ.title=="string")
return this._cQ.title;else return null;};this._jx=function(){return this._oCoord;};this._rz=function(_oj){if(!(_oj instanceof _eE))
throw "Invalid Latitude and Longitude";var _ou=this._oCoord;this._oCoord=_oj;if(this._bI!=null){var _oU=this._bI._ka(this._oCoord);var _pI=new _fn(_oU.x+this._jL().iconAnchor.x,_oU.y+this._jL().iconAnchor.y);this._ct.style.left=_pI.x+"px";this._ct.style.top=_pI.y+"px";this._cu.style.left=_pI.x+"px";this._cu.style.top=_pI.y+"px";this._rx(_pI);if(_ou!=null&&_ou==this._bI._jR()._j9()){if(!this._bI._jR()._mp()){var _oV=this._bI._jR();_oV._tM(this._oCoord);}}
this._cn=this._bI._kb(this._oCoord);}};this._iy=function(){this._cQ.draggable=true;};this._hE=function(){this._cQ.draggable=false;};this.draggable=function(){if(this._cQ.draggable==true)
return true;else return false;};this._id=function(){};this._rI=function(_tt){if(this._cQ!=null)
this._cQ.icon.image=_tt;if(this._ct!=null){if(_ew._gN=="Explorer"&&_ew.VERSION<7 )
this._ct.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_tt+"',sizingMethod='"+this._dA+"')";else this._ct.setAttribute("src",_tt);}};this.hide=function(){if(!this._mu())
return;if(this._C){this._C=false;this._ct.style.visibility="hidden";this._cu.style.visibility="hidden";var _oV=this._bI._jR();if(this._oCoord==_oV._j9())
_oV.hide();this._q1();}};this.show=function(){if(!this._mu())
return;if(!this._C){this._C=true;this._ct.style.visibility="visible";this._cu.style.visibility="visible";var _oV=this._bI._jR();if(this._oCoord==_oV._j9())
_oV.show();this._rx( new _fn(parseInt(this._ct.style.left),parseInt(this._ct.style.top)) );}};this._mp=function(){return !this._C;};this._mB=function(){return !this._mp();};this._jt=function(){if(this._cQ.clickable)
return this._e;return null;};this._rx=function(_pI){var _oT=this._jL();if(_oT.iconSize instanceof _fD){this._e=new Array();this._e.push(new _fn(_pI.x,_pI.y));this._e.push(new _fn(_pI.x,_pI.y+_oT.iconSize.height));this._e.push(new _fn(_pI.x+_oT.iconSize.width,_pI.y+_oT.iconSize.height));this._e.push(new _fn(_pI.x+_oT.iconSize.width,_pI.y));this._bI._dM(this);}};this._q1=function(){this._bI._rc(this);this._e=null;};this._nd=function(){this._cQ.stationary=true;var oInitialCoord=this._jx();this._cn=this._bI._kb(oInitialCoord);};this._hN=function(){this._cQ.stationary=true;};this._u=false;this._cL=null;this.mousedown=function(_oj){this._u=true;this._cL=this._bI._kb(_oj);};this.mousemove=function(_oj){if(this._u){var _pA=this._bI._kb(_oj);var _lJ=Math.round(_pA.x-this._cL.x);var _lK=Math.round(_pA.y-this._cL.y);var _pQ=new _fn(parseInt(this._ct.style.left)+_lJ,parseInt(this._ct.style.top)+_lK );this._ct.style.left=_pQ.x+"px";this._ct.style.top=_pQ.y+"px";this._cu.style.left=_pQ.x+"px";this._cu.style.top=_pQ.y+"px";this._rx(_pQ);this._cL=_pA;this._oCoord=this._bI._jy(new _fn(_pQ.x-this._jL().iconAnchor.x,_pQ.y-this._jL().iconAnchor.y));if(this._cQ.stationary){this._cn=this._bI._kb(this._oCoord);}}
};this.mouseup=function(_oj){this._u=false;};this._nc=function(){_eP.bind(this,"onmousedown",this,this.mousedown);_eP.bind(this._bI,"onmousemove",this,this.mousemove);_eP.bind(this,"onmouseup",this,this.mouseup);_eP.bind(this._bI,"onmouseout",this,this.mouseup);};this._mu=function(){return this._bI!=null;};this.openInfoDisplay=this._pn;this.openInfoDisplayHTML=this._pp;this.openInfoDisplayPanels=this._pr;this.openInfoDisplayPanelsHTML=this._ps;this.bindInfoDisplayPanels=this._gH;this.bindInfoDisplayPanelsHTML=this._gI;this.bindInfoDisplay=this._gF;this.bindInfoDisplayHTML=this._gG;this.showEnlargedMap=this._r7;this.getIcon=this._jL;this.getTitle=this._kw;this.getCoord=this._jx;this.setCoord=this._rz;this.setImage=this._rI;this.hide=this.hide;this.show=this.show;this.isVisible=this._mB;this.closeInfoDisplay=this._g4;this.enableDragging=this._iy;this.disableDragging=this._hE;this.draggingEnabled=this._id;this.draggable=this.draggable;}
var AGMarker=_fa;

function _fb(_oT,_gz,_gA,_gQ,_ts){if(_oT!=null&&_oT instanceof _eX)
this.icon=_oT;else this.icon=AG_DEFAULT_ICON.copy();if(typeof _ts=="string")
this.title=_ts;else this.title="";if(typeof _gA!="boolean")
this.draggable=false;else this.draggable=_gA;if(typeof _gz!="boolean")
this.clickable=true;else this.clickable=_gz;if(typeof _gQ!="boolean")
this.stationary=false;else this.stationary=_gQ;this.copy=function(){return new _fb(this.icon.copy(),this.clickable,this.draggable,this.stationary,this.title);};}
var AGMarkerOptions=_fb;

function _eC(){this.printable=function(){throw "You must implement this";};this.selectable=function(){throw "You must implement this";};this.initialize=function(_nH,_oi){throw "You must implement this";};this.getDefaultPosition=function(){return new _eD();};this.redraw=function(_l2){throw "You must implement this";};this.remove=function(){throw "You must implement this";};}
var AGControl=_eC;

_fR.prototype=new _eC;function _fR(_mY){var _tD=this;if(typeof _mY=="NaN"||typeof _mY=="undefined"||Math.floor(_mY)!=_mY||_mY<1||_mY>AG_TOTAL_NO_OF_ZOOMBAR)
_mY=AG_DEFAULT_ZOOMBAR_NO;this._bC=parseInt(_mY);this._bI=null;this._dj=null;this._dl=null;this._dm=null;this._dk=null;this._dn=null;this._z=true;var _qJ=new _fD(0,0);var _qN=new _fD(0,0);var _qL=new _fD(0,0);var _qM=new _fD(0,0);var _qO=new _fD(0,0);switch(_mY){case 1:
_qJ=new _fD(34,0);_qN=new _fD(0,120);_qL=new _fD(34,31);_qM=new _fD(34,33);_qO=new _fD(16,16);break;case 2:
_qJ=new _fD(30,0);_qN=new _fD(30,176);_qL=new _fD(21,19);_qM=new _fD(21,19);_qO=new _fD(19,8);break;case 3:
_qJ=new _fD(30,0);_qN=new _fD(30,176);_qL=new _fD(21,19);_qM=new _fD(21,19);_qO=new _fD(19,8);break;case 4:
_qJ=new _fD(20,0);_qN=new _fD(0,221);_qL=new _fD(20,20);_qM=new _fD(20,20);_qO=new _fD(20,12);break;case 5:
_qJ=new _fD(20,0);_qN=new _fD(0,120);_qL=new _fD(20,20);_qM=new _fD(20,20);_qO=new _fD(18,9);break;case 6:
_qJ=new _fD(20,0);_qN=new _fD(20,140);_qL=new _fD(20,20);_qM=new _fD(20,20);_qO=new _fD(18,9);break;case 7:
_qJ=new _fD(23,0);_qN=new _fD(23,136);_qL=new _fD(38,28);_qM=new _fD(38,28);_qO=new _fD(26,15);break;};this.printable=function(){};this.selectable=function(){};this.redraw=function(_l2){var _mk=parseInt(parseInt(this._dm.style.height) /(_ek-1));switch(_l2){case _fe.ZOOM:
switch(this._dm.ZoomBarNo){case 1:
case 5:
case 6: 
case 7:
this._dn.style.top=parseInt(this._dl.style.top)-parseInt(_qO.height/2)-_mk*(this._bI._kD()-1)+"px";break;case 2:
case 3:
case 4:
this.setZoomSlideControl(this._bI._kD());break;}
break;}};this.initialize=function(_nH,_oi){this._bI=_nH;var _hR=_nH._ju();if( _oi==null||!(_oi instanceof _eD))
_oi=new _eD();this._dj=document.createElement('div');this._dj.style.position="absolute";this._dj.style.width=_qJ.width+"px";this._dj.style.height=_qM.height+_qN.height+_qL.height+"px";this._dj.style.zIndex="270";this._dj.style.textAlign="left";this._dj.style.cursor="pointer";this._dj.ZoomBarNo=this._bC;if(_oi.anchor==_et.TOP_RIGHT){switch(this._bC){case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
this._dj.style.right=_oi.offset.x+"px";this._dj.style.top=_oi.offset.y+"px";break;case 7:
this._dj.style.right=(_oi.offset.x+8)+"px";this._dj.style.top=_oi.offset.y+"px";break;}}
else if(_oi.anchor==_et.TOP_LEFT){this._dj.style.left=_oi.offset.x+"px";this._dj.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_RIGHT){switch(this._bC){case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
this._dj.style.right=_oi.offset.x+"px";this._dj.style.bottom=_oi.offset.y+"px";break;case 7:
this._dj.style.right=(_oi.offset.x+8)+"px";this._dj.style.bottom=_oi.offset.y+"px";break;}}
else if(_oi.anchor==_et.BOTTOM_LEFT){this._dj.style.left=_oi.offset.x+"px";this._dj.style.bottom=_oi.offset.y+"px";}
var _lF=API_HOST_URL+"zoombar/"+"zb"+this._bC+"/ZoomIn.png";this._dk=document.createElement('img');this._dk.setAttribute('src',_lF);this._dk.style.position="absolute";this._dk.style.left="0px";this._dk.style.top="0px";this._dk.style.width="100%";this._dk.style.zIndex="5";this._dk.style.height=_qL.height+"px";this._dk.style.width=_qL.width+"px";this._dk.ZoomBarNo=this._bC;switch(this._bC){case 7:
this._dk.style.left="-3px";this._dk.style.top="2px";this._dk.onmouseover=function(_iN){_fS.handleMouseOverZoomInClick(_iN,_tD);}
this._dk.onmouseout=function(_iN){_fS.handleMouseOutZoomInClick(_iN,_tD);}
break;}
this._dj.appendChild(this._dk);this._dk.onclick=function(_iN){_fS.handleZoomInClick(_iN,_tD);}
_lF=API_HOST_URL+"zoombar/"+"zb"+this._bC+"/sliderBack.png";this._dm=document.createElement('img');this._dm.setAttribute('src',_lF);if(_ew._gN=="Explorer"){this._dm=document.createElement("div");this._dm.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_lF+"',sizingMethod='scale')";}
this._dm.style.position="absolute";this._dm.style.left="0px";this._dm.style.top=_qL.height+"px";this._dm.style.width="100%";this._dm.style.height=_qN.height+"px";this._dm.style.zIndex="5";this._dm.ZoomBarNo=this._bC;this._dj.appendChild(this._dm);this._dm.onclick=function(_iN){_fS.handleSlideBarClick(_iN,_tD);}
_lF=API_HOST_URL+"zoombar/"+"zb"+this._bC+"/ZoomOut.png";this._dl=document.createElement('img');this._dl.setAttribute('src',_lF);this._dl.style.position="absolute";this._dl.style.left="0px";this._dl.style.top=_qL.height+_qN.height+"px";this._dl.style.width="100%";this._dl.style.height=_qM.height+"px";this._dl.style.width=_qM.width+"px";this._dl.style.zIndex="5";this._dl.ZoomBarNo=this._bC;switch(this._bC){case 7:
this._dl.style.left="-6px";this._dl.onmouseover=function(_iN){_fS.handleMouseOverZoomOutClick(_iN,_tD);}
this._dl.onmouseout=function(_iN){_fS.handleMouseOutZoomOutClick(_iN,_tD);}
break;}
this._dj.appendChild(this._dl);this._dl.onclick=function(_iN){_fS.handleZoomOutClick(_iN,_tD);}
if(this._bC==2||this._bC==3||this._bC==4){this.setZoomSlideControl(this._bI._kD());}
else {_lF=API_HOST_URL+"zoombar/"+"zb"+this._bC+"/arrow_blue.png";this._dn=document.createElement('img');this._dn.setAttribute('src',_lF);this._dn.setAttribute('alt',"");this._dn.style.position="absolute";this._dn.style.left="50%";this._dn.style.top=parseInt(this._dl.style.top)-parseInt(_qO.height/2)-parseInt(parseInt(this._dm.style.height) /(_ek-1))*(this._bI._kD()-1)+"px";this._dn.style.zIndex="10";this._dn.ZoomBarNo=this._bC;this._dn.onmousedown=function(_iN){_fS.SlideControllerMouseDown(_iN,_tD);return false;}
this._dn.onmouseup=function(_iN){_fS.SlideControllerMouseUp(_iN,_tD);return false;}
this._dn.onmousemove=function(_iN){_fS.SlideControllerMouseMove(_iN,_tD);return false;}
this._dn.onmouseout=function(_iN){_fS.SlideControllerMouseOut(_iN,_tD);return false;}
this._dj.appendChild(this._dn);}
_hR.appendChild(this._dj);this._z=false;};this._jV=function(){return this._bI;};this._kE=function(){return this._dm;};this._kF=function(){return this._dn;};this.getZoomInControl=function(){return this._dk;};this.getZoomOutControl=function(){return this._dl;};this.getZoomBarNumber=function(){return this._bC;};this.remove=function(){var _hR=this._bI._ju();_hR.removeChild(this._dj);this._bI=null;};this.hide=function(){if(!this._mu())
return;this._z=true;this._dj.style.display="none";};this.show=function(){if(!this._mu())
return;this._z=false;this._dj.style.display="";};this._mB=function(){return !this._z;};this._mu=function(){return this._bI!=null;};this.setZoomSlideControl=function(_mZ){while(this._dj.hasChildNodes()){this._dj.removeChild(this._dj.firstChild);}
this._dj.appendChild(this._dl);this._dj.appendChild(this._dk);this._dj.appendChild(this._dm);_lF=API_HOST_URL+"zoombar/"+"zb"+this._bC+"/scale_filler.png";var _mk=_qN.height / _ek;for(var i=0;i<_mZ;i++){var zoomSlideController=document.createElement('img');zoomSlideController.setAttribute('src',_lF);zoomSlideController.setAttribute('alt',"");if(_ew._gN=="Explorer"){zoomSlideController=document.createElement("div");zoomSlideController.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_lF+"',sizingMethod='scale')";}
zoomSlideController.style.position="absolute";zoomSlideController.style.width=_qO.width+"px";zoomSlideController.style.height=_qO.height+"px";if(this._bC=="4")
zoomSlideController.style.left="0px";else zoomSlideController.style.left="1px";zoomSlideController.style.top=parseInt(this._dl.style.top)-(_mk*i)-_mk+"px";zoomSlideController.style.zIndex="8";this._dj.appendChild(zoomSlideController);zoomSlideController.onclick=function(_iN){_fS.handleSlideBarClick(_iN,_tD);}}
};this.hide=this.hide;this.show=this.show;this.isVisible=this._mB;}
var AGZoomControl=_fR;

function _eD(_pR,_kY){if(typeof _kY!="number")
this.anchor=_et.TOP_LEFT;else this.anchor=_kY;if( _pR==null||!(_pR instanceof _fn))
this.offset=new _fn(0,0);else this.offset=_pR;this.copy=function(){return new _eD(this.offset.copy(),this.anchor);};}
var AGControlPosition=_eD;

function _fS(){}
_fS.handleZoomInClick=function(e,_qK){_qK._jV()._tX();return false;};_fS.handleZoomOutClick=function(e,_qK){_qK._jV()._tZ();return false;};_fS.handleMouseOverZoomInClick=function(e,_qK){var _lF=API_HOST_URL+"zoombar/"+"zb"+_qK.getZoomBarNumber()+"/ZoomIn_mo.png";var oZoomInControl=_qK.getZoomInControl();oZoomInControl.setAttribute('src',_lF);return false;};_fS.handleMouseOutZoomInClick=function(e,_qK){var _lF=API_HOST_URL+"zoombar/"+"zb"+_qK.getZoomBarNumber()+"/ZoomIn.png";var oZoomInControl=_qK.getZoomInControl();oZoomInControl.setAttribute('src',_lF);return false;};_fS.handleMouseOverZoomOutClick=function(e,_qK){var _lF=API_HOST_URL+"zoombar/"+"zb"+_qK.getZoomBarNumber()+"/ZoomOut_mo.png";var oZoomOutControl=_qK.getZoomOutControl();oZoomOutControl.setAttribute('src',_lF);return false;};_fS.handleMouseOutZoomOutClick=function(e,_qK){var _lF=API_HOST_URL+"zoombar/"+"zb"+_qK.getZoomBarNumber()+"/ZoomOut.png";var oZoomOutControl=_qK.getZoomOutControl();oZoomOutControl.setAttribute('src',_lF);return false;};_fS.handleSlideBarClick=function(e,_qK){e=e||window.event;if(!e)
return false;var _ns=_fd.getMouseOffset(e,_qK._kE());var _ms=parseInt(_qK._kE().style.height);var _mk=_ms / _ek;var iDiff=parseInt((_ms-_ns.y) / _mk);var oCenterPointCoord=_qK._jV()._jr();var _o0=_qK._jV();var _mg=iDiff+1;_fS.zoomMapToScale(_o0,oCenterPointCoord,_mg);return false;};var _pH=null;var _gS=false;_fS.SlideControllerMouseDown=function(_iN,_qK){_pH=_fd.getMouseOffset(_iN,_qK._kE());_gS=true;switch(_qK.getZoomBarNumber()){case 7:
var _lF=API_HOST_URL+"zoombar/"+"zb"+_qK.getZoomBarNumber()+"/arrow_blue_mo.png";var _qO=_qK._kF();_qO.setAttribute('src',_lF);break;}
return false;};_fS.SlideControllerMouseUp=function(_iN,_qK){switch(_qK.getZoomBarNumber()){case 7:
var _lF=API_HOST_URL+"zoombar/"+"zb"+_qK.getZoomBarNumber()+"/arrow_blue.png";var _qO=_qK._kF();_qO.setAttribute('src',_lF);break;}
if(_gS==true){var _ms=parseInt(_qK._kE().style.height);var _mk=_ms / _ek;var _lc=parseInt((_ms-_pH.y) / _mk);var oCenterPointCoord=_qK._jV()._jr();_fS.zoomMapToScale(_qK._jV(),oCenterPointCoord,_lc+1);_gS=false;_qK.redraw(_fe.ZOOM);return false;}
_gS=false;return false;};_fS.zoomMapToScale=function(_o0,oCenterPointCoord,_mg){var _lI=_o0._j0();var _lE=_o0._jZ();if(_mg>=_lI&&_mg<=_lE)
_o0._gY(oCenterPointCoord,_mg);else if(_mg<_lI)
_o0._gY(oCenterPointCoord,_lI);else if(_mg>_lE)
_o0._gY(oCenterPointCoord,_lE);};_fS.SlideControllerMouseMove=function(_iN,_qK){if(_gS==true){var _pA=_fd.getMouseOffset(_iN,_qK._kE());if(_pA.y<0)
_pA.y=0;var _mr=parseInt(_pA.y)-parseInt(_pH.y);var _ms=parseInt(_qK._kE().style.height);if(_pA.y>_ms)
_pA.y=_ms;var _mk=_ms / _ek;var _lc=parseInt(_pA.y / _mk);if(_lc<=_ek-1)
_qK._kF().style.top=(_qK._kF().offsetTop+_mr)+"px";else return false;_pH=_pA;}
return false;};_fS.SlideControllerMouseOut=function(_iN,_qK){_fS.SlideControllerMouseMove(_iN,_qK);_fS.SlideControllerMouseUp(_iN,_qK);return false;};

_eG.prototype=new _eC;function _eG(_sD){this._dr=_sD;this._b2=null;this.printable=function(){};this.selectable=function(){};this.redraw=function(_l2){};this.initialize=function(_nH,_oi){this._bI=_nH;var divStaticContainer=_nH._j5(_fl.STATIC_PANE);if( _oi==null||!(_oi instanceof _eD))
_oi=new _eD();this._b2=document.createElement('div');this._b2.style.position="absolute";this._b2.style.zIndex="300";this._b2.style.fontFamily="Arial";this._b2.style.fontSize="8pt";this._b2.style.fontStyle="normal";this._b2.style.fontWeight="normal";this._b2.style.textAlign="right";this._b2.innerHTML=this._dr;if(_oi.anchor==_et.TOP_RIGHT){this._b2.style.right=_oi.offset.x+"px";this._b2.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.TOP_LEFT){this._b2.style.left=_oi.offset.x+"px";this._b2.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_RIGHT){this._b2.style.right=_oi.offset.x+"px";this._b2.style.bottom=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_LEFT){this._b2.style.left=_oi.offset.x+"px";this._b2.style.bottom=_oi.offset.y+"px";}
divStaticContainer.appendChild(this._b2);};this._ri=function(){var _qf=this._bI._ki();this._bI._j5(_fl.STATIC_PANE).style.width=_qf.width+"px";this._bI._j5(_fl.STATIC_PANE).style.height=_qf.height+"px";};this.hide=function(){this._b2.style.display="none";};this.show=function(){this._b2.style.display="";};this.remove=function(){this._bI._j5(_fl.STATIC_PANE).removeChild(this._b2);};this.setForeColor=function(strColor){this._b2.style.color=strColor;};}


_fz.prototype=new _eC;function _fz(){this._b8=null;this._dD=null;this._bI=null;this._bc=0;this._bd=0;this.printable=function(){};this.selectable=function(){};this.redraw=function(_l2){switch(_l2){case _fe.ZOOM:
case _fe.PAN:
this._gT();this._b8.style.width=this._bd+"px";this._b9.style.left=this._bd+"px";this._de.style.width=this._bd+"px";this._de.innerHTML=this._bc+" "+this._dD;break;}};this.initialize=function(_nH,_oi){this._bI=_nH;this._gT();var divStaticContainer=_nH._j5(_fl.STATIC_PANE);if( _oi==null||!(_oi instanceof _eD))
_oi=new _eD();this._cF=document.createElement('div');this._cF.style.position="absolute";this._cF.style.zIndex="300";this._b7=document.createElement('div');this._b7.style.width="0px";this._b7.style.height="10px";this._b7.style.left="0px";this._b7.style.styleFloat="left";this._b7.style.cssFloat="left";this._b7.style.border="1px solid black";this._cF.appendChild(this._b7);this._b8=document.createElement('div');this._b8.style.fontFamily="Arial";this._b8.style.fontSize="8pt";this._b8.style.fontStyle="normal";this._b8.style.fontWeight="normal";this._b8.style.textAlign="left";this._b8.style.styleFloat="left";this._b8.style.cssFloat="left";this._b8.style.width=this._bd+"px";this._b8.style.height="2px";this._b8.style.borderTop="1px solid black";this._cF.appendChild(this._b8);this._b9=document.createElement('div');this._b9.style.width="0px";this._b9.style.height="10px";this._b9.style.left=this._bd+"px";this._b9.style.styleFloat="left";this._b9.style.cssFloat="left";this._b9.style.border="1px solid black";this._cF.appendChild(this._b9);this._de=document.createElement('div');this._de.style.position="absolute";this._de.style.left="0px";this._de.style.fontFamily="Arial";this._de.style.fontSize="8pt";this._de.style.fontStyle="normal";this._de.style.fontWeight="normal";this._de.style.textAlign="center";this._de.style.width=this._bd+"px";this._de.innerHTML=this._bc+" "+this._dD;this._cF.appendChild(this._de);if(_oi.anchor==_et.TOP_RIGHT){this._cF.style.right=_oi.offset.x+"px";this._cF.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.TOP_LEFT){this._cF.style.left=_oi.offset.x+"px";this._cF.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_RIGHT){this._cF.style.right=_oi.offset.x+"px";this._cF.style.bottom=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_LEFT){this._cF.style.left=_oi.offset.x+"px";this._cF.style.bottom=_oi.offset.y+"px";}
divStaticContainer.appendChild(this._cF);};this._gT=function(){var dLong1=this._bI._jn()._kk().longitude();var dLong2=this._bI._jn()._j1().longitude();var dLat1=this._bI._jn()._kk()._m1();var dLat2=this._bI._jn()._j1()._m1();var _gX=parseFloat((dLat1+dLat2)/2);var _hP=_fJ.getDistanceInKiloMetre(dLong1,_gX,dLong2,_gX);var _nh=this._bI._ki().width;var _lS=80;var _lQ=parseFloat((_hP*_lS)/_nh);var _tC=parseFloat(_lQ/5);_tC=Math.round(_tC);this._dD="km";if(_tC>0){this._bc=_tC*5;this._bd=Math.round(_lS*this._bc/_lQ);}
else {_tC=Math.round(parseFloat(_lQ/2));if(_tC>0){this._bc=_tC*2;this._bd=Math.round(_lS*this._bc/_lQ);}
else {_tC=Math.round(_lQ);if(_tC>0){this._bc=Math.round(_lQ);this._bd=Math.round(_lS*_tC/_lQ);}
else {this._dD="m";var _lQ=parseFloat((_hP*_lS*1000)/_nh);var _tC=Math.round(parseFloat(_lQ/50));if(_tC>0){this._bc=_tC*50;this._bd=Math.round(_lS*this._bc/_lQ);}
else {_tC=Math.round(parseFloat(_lQ/10));if(_tC>0){this._bc=_tC*10;this._bd=Math.round(_lS*this._bc/_lQ);}}
}}
}};this._ri=function(){var _qf=this._bI._ki();this._bI._j5(_fl.STATIC_PANE).style.width=_qf.width+"px";this._bI._j5(_fl.STATIC_PANE).style.height=_qf.height+"px";};this.hide=function(){this._cF.style.display="none";};this.show=function(){this._cF.style.display="";};this.remove=function(){var divStaticContainer=this._bI._j5(_fl.STATIC_PANE)
divStaticContainer.removeChild(this._cF);};this.setColour=function(_sB){$("*",this._cF).css("border-color",_sB);this._de.style.color=_sB;};}


AGCrossHair.prototype=new _eC;function AGCrossHair(_tt,_qf){this._cq=null;this._strUrl=_tt;this._oSize=_qf;this._H=false;this.initialize=function(_nH,_oi){this._cq=_nH;var oSizeContainer=this._cq._ki();this._oCrossHairImg=document.createElement('img');this._oCrossHairImg.style.position="absolute";this._oCrossHairImg.style.zIndex="500";this._oCrossHairImg.style.top=(oSizeContainer.height-this._oSize.height)/2+"px";this._oCrossHairImg.style.left=(oSizeContainer.width-this._oSize.width)/2+"px";this._oCrossHairImg.setAttribute('src',this._strUrl);this._cq._j5(_fl.STATIC_PANE).appendChild(this._oCrossHairImg);this._H=true;};this.redraw=function(_l2){};this.setCrossHairPosition=function(){var oSizeContainer=this._cq._ki();this._oCrossHairImg.style.top=(oSizeContainer.height-this._oSize.height)/2+"px";this._oCrossHairImg.style.left=(oSizeContainer.width-this._oSize.width)/2+"px";}
this.remove=function(){this._cq._j5(_fl.STATIC_PANE).removeChild(this._oCrossHairImg);this._oCrossHairImg=null;this._cq=null;};}


function _fB(){this._ci=new _eT();this.get=function(_sj){if(typeof _sj!='string')
throw "Invalid argument";var _sA=this.toCanonical(_sj);var _gf=this._ci._jT(_sA);if(typeof _gf=="object"&&_gf!=null&&_gf.length>0)
return _gf[0];else return null;};this.isCachable=function(_tb){return true;};this.put=function(_sj,_tb){if(typeof _sj!='string')
throw "Invalid argument";var _sk=this.toCanonical(_sj);this._ci._dI(_sk,_tb);};this.reset=function(){this._ci=new _eT();};this.toCanonical=function(_sj){var _sl=_sj.toLowerCase();_sl=jQuery.trim(_sl);for(;;){if(_sl.match(",")!=null){_sl=_sl.replace(","," ");}
else if(_sl.match(" ")!=null){_sl=_sl.replace(" "," ");}
else break;}
return _sl;};}
var AGSearchCache=_fB;

var _el=-1;var _dO=new Array();function _fA(_oP){this._bs=++_el;_dO[this._bs]=this;this._dz=null;this._bU=null;if(_oP instanceof _fB)
this._cg=_oP;else this._cg=new _fB();this._dy=null;this._rr=function(_tk,_i8){if(typeof _tk!='string'||typeof _i8!="function")
throw 'Invalid argument';if(jQuery.trim(_tk)=="")
throw "Search string should have some text";this._dy=_tk;var _p8=this._cg.get(this._dy);this._bU=_i8;if(_p8!=null){this._bU(_p8);return;}
var _tt=this._kd(_tk);var script=document.createElement("script");script.setAttribute("src",_tt);script.setAttribute("type","text/javascript");document.body.appendChild(script);};this._kd=function(_tj){this._dz="Street";var _tt=AG_CLIENT_GEOCODER_GATEWAY;_tt+="?";_tt+="SearchString="+_tj;_tt+="&SearchType="+this._dz;_tt+="&jsonp="+"_dO["+this._bs+"]._gW";_tt+="&rnd="+Math.random();return _tt;};this._gW=function(_te){var _sf=eval("("+_te+")");if(this._cg.isCachable())
this._cg.put(this._dy,_sf);this._bU(_sf);};this.search=this._rr;}
var AGSearch=_fA;

_fg.prototype=new _eC;var _em=-1;var _ep=new Array();function _fg(_nJ){if(_nJ instanceof _fi)
this._cE=_nJ.copy();else this._cE=new _fi();this._cp=null;this._cI=null;this._S=null;this._X=null;this._U=null
this._W=null;this._bm=null;this._bl=null;this._bk=null;this._b4=null;this._cZ=null;this._c0=null;this._c8=null;this._bw=10;this._be=5;this._H=false;this._bf=++_em;_ep[this._bf]=this;this.printable=function(){};this.selectable=function(){};this.getDefaultPosition=function(){return new _eD(new _fn(10,10),_et.TOP_RIGHT);};this.initialize=function(_nH,_oi){this._cp=_nH;this._b4=_oi;this._hj();var _o2=new _e6(this._cE.backgroundColour,null,null,null,false);_o2.loadInitialMap=false;this._cI=new _e4(this._S,_o2);this._cI._rL(_e7.OVERVIEW_MAP);var _mZ=Math.max(this._cp._kD()-this._cE.zoomDifference,1);this._cI._gY(this._cp._jr(),_mZ);var _nP=new _fL(AG_DEFAULT_TMS_OPTIONS);var _qD=new _fI(1,_nP)
this._cI._dL(_qD,null,true);this._cI._q3();this._cI._rd()
this._cI._hD();this._cI._hO();this._cI._hL();this._cI._hF();this._r1();this._H=true;};this.redraw=function(_l2){switch(_l2){case _fe.ZOOM:
case _fe.PAN:
var _mZ=Math.max(this._cp._kD()-this._cE.zoomDifference,1);this._cI._gY(this._cp._jr(),_mZ);this._r1();break;}};this.remove=function(){var _hY=this._cp._ju();_hY.removeChild(this._U);if(this._c8!=null)
clearTimeout(this._c8);this._cp=null;this._cI=null;this._S=null;this._X=null;this._U=null
this._W=null;this._bm=null;this._bl=null;this._bk=null;this._b4=null;this._cZ=null;this._c0=null;this._H=false;};this.hide=function(){if(this._U!=null){this._U.style.display="none";this._H=false;}};this.show=function(){if(this._U!=null){this._U.style.display="";this._H=true;}};this._mB=function(){return this._H;};this._hj=function(){this._U=document.createElement("div");this._U.style.position="absolute";this._U.style.width=this._cE.size.width+"px";this._U.style.height=this._cE.size.height+"px";switch(this._b4.anchor){case _et.TOP_RIGHT:
this._U.style.right=this._b4.offset.x+"px";this._U.style.top=this._b4.offset.y+"px";break;case _et.TOP_LEFT:
this._U.style.left=this._b4.offset.x+"px";this._U.style.top=this._b4.offset.y+"px";break;case _et.BOTTOM_RIGHT:
this._U.style.right=this._b4.offset.x+"px";this._U.style.bottom=this._b4.offset.y+"px";break;case _et.BOTTOM_LEFT:
this._U.style.left=this._b4.offset.x+"px";this._U.style.bottom=this._b4.offset.y+"px";break;}
this._U.style.border="1px solid black";this._U.style.zIndex=300;this._U.style.overflow="hidden";this._S=document.createElement("div");this._S.style.position="absolute";this._S.style.width=this._cE.size.width+"px";this._S.style.height=this._cE.size.height+"px";this._S.style.left="0px";this._S.style.top="0px";this._S.style.borderWidth="0px";this._S.style.zIndex=1;this._U.appendChild(this._S);this._X=document.createElement("div");this._X.style.position="absolute";this._X.style.backgroundColor=this._cE.viewportColour;var _jb=this._cE.viewportOpacity;this._X.style.opacity=_jb;this._X.style.filter="alpha(opacity="+_jb*100+")";this._X.style.mozOpacity=_jb;this._X.style.zIndex=3;this._X.style.border="0px solid black";this._U.appendChild(this._X);var _hY=this._cp._ju();_hY.appendChild(this._U);var _n5=new Object();_n5.overviewMap=this;var _h3=$(this._X);_h3.bind("mousedown",_n5,_fh.viewportMouseDownHandler);_h3.bind("mousemove",_n5,_fh.viewportMouseMoveHandler);_h3.bind("mouseup",_n5,_fh.viewportMouseUpHandler);_h3.bind("mouseout",_n5,_fh.viewportMouseOutHandler);if(this._cE.draggable){this._T=document.createElement("div");this._T.style.position="absolute";this._T.style.width=this._cE.size.width+"px";this._T.style.height=this._cE.size.height+"px";this._T.style.backgroundColor="black";this._T.style.opacity=0;this._T.style.filter="alpha(opacity=0)";this._T.style.mozOpacity=0;this._T.style.zIndex=2;this._U.appendChild(this._T);var _h0=$(this._T);_h0.bind("mousedown",_n5,_fh.omMouseDownHandler);_h0.bind("mousemove",_n5,_fh.omMouseMoveHandler);_h0.bind("mouseup",_n5,_fh.omMouseUpHandler);_h0.bind("mouseout",_n5,_fh.omMouseOutHandler);}
var _k1=12;this._W=document.createElement("div");this._W.style.position="absolute";this._W.style.right="0px";this._W.style.top="0px";this._W.style.width="39px";this._W.style.height="13px";this._W.style.background="black";this._W.style.zIndex=4;this._U.appendChild(this._W);this._bk=document.createElement("img");this._bk.style.position="absolute";this._bk.style.right="0px";this._bk.style.top="0px";this._bk.alt="Close";this._bk.title="Close";this._bk.setAttribute("src",AG_CLOSE_IMG_URL);this._W.appendChild(this._bk);$(this._bk).bind("click",_n5,_fh.closeButtonHandler);this._bl=document.createElement("img");this._bl.style.position="absolute";this._bl.style.right="13px";this._bl.style.top="0px";this._bl.alt="Maximize";this._bl.title="Maximize";this._bl.setAttribute("src",_ed);this._W.appendChild(this._bl);this._bm=document.createElement("img");this._bm.style.position="absolute";this._bm.style.right="26px";this._bm.style.top="0px";this._bm.alt="Minimize";this._bm.title="Minimize";this._bm.setAttribute("src",_eh);this._W.appendChild(this._bm);this._iE();this._cZ=new _fD(this._cE.size.width,this._cE.size.height);this._c0=new _fD(39,13);};this._r1=function(){var oCoordSpanOM=this._cI._jn()._tI();var _qn=this._cI._ki();var oCoordSpanMM=this._cp._jn()._tI();var _mO=Math.round(_qn.width*oCoordSpanMM.longitude() / oCoordSpanOM.longitude());var _mN=Math.round(_qn.height*oCoordSpanMM._m1() / oCoordSpanOM._m1());this._X.style.width=_mO+"px";this._X.style.height=_mN+"px";var oCoordTopLeft=this._cp._jn()._j2();var _pI=this._cI._kb(oCoordTopLeft);this._X.style.left=_pI.x+"px";this._X.style.top=_pI.y+"px";};this._qQ=function(_qo){if(_qo.width==0&&_qo.height==0)
return;var _qi=this._cp._ki();var _mO=parseInt(this._X.style.width);var _mN=parseInt(this._X.style.height);var _qT=_qi.width*_qo.width / _mO;var _qU=_qi.height*_qo.height / _mN;this._cp._qQ(new _fn(_qT,_qU));this._r1();};this._iC=function(){if(this._bl!=null){this._bl.setAttribute("src",_eg);var _n5=new Object();_n5.overviewMap=this;$(this._bl).bind("click",_n5,_fh.maximizeButtonHandler);}};this._hI=function(){if(this._bl!=null){this._bl.setAttribute("src",_ed);$(this._bl).unbind("click");}};this._iE=function(){if(this._bm!=null){this._bm.setAttribute("src",_eh);var _n5=new Object();_n5.overviewMap=this;$(this._bm).bind("click",_n5,_fh.minimizeButtonHandler);}};this._hK=function(){if(this._bm!=null){this._bm.setAttribute("src",_ee);$(this._bm).unbind("click");}};this._ni=function(){if(!this._dH())
return;if(this._c8!=null)
clearTimeout(this._c8);this._hI();var _k9=parseInt(this._U.style.width);var _k5=parseInt(this._U.style.height);if(_k9+this._be<this._cZ.width)
this._U.style.width=_k9+this._be+"px";else this._U.style.width=this._cZ.width+"px";if(_k5+this._be<this._cZ.height)
this._U.style.height=_k5+this._be+"px";else this._U.style.height=this._cZ.height+"px";if(_k9+this._be<this._cZ.width||_k5+this._be<this._cZ.height)
this._c8=setTimeout( "_ep["+this._bf+"]._ni()",this._bw);else {this._c8=null;this._iE();}};this._no=function(){if(!this._dH())
return;if(this._c8!=null)
clearTimeout(this._c8);this._hK();var _k9=parseInt(this._U.style.width);var _k5=parseInt(this._U.style.height);if(_k9-this._be>this._c0.width)
this._U.style.width=_k9-this._be+"px";else this._U.style.width=this._c0.width+"px";if(_k5-this._be>this._c0.height)
this._U.style.height=_k5-this._be+"px";else this._U.style.height=this._c0.height+"px";if(_k9-this._be>this._c0.width||_k5-this._be>this._c0.height)
this._c8=setTimeout( "_ep["+this._bf+"]._no()",this._bw);else {this._c8=null;this._iC();}};this._dH=function(){return this._cp!=null;};this.hide=this.hide;this.show=this.show;this.maximize=this._ni;this.minimize=this._no;this.isVisible=this._mB;}
var AGOverviewMapControl=_fg;

function _fi(_qf,_gA,_so,_tw,_jg,_m0){if(_qf instanceof _fD)
this.size=_qf;else this.size=new _fD(_en.width,_en.height);if(typeof _gA=="boolean")
this.draggable=_gA;else this.draggable=true;if(typeof _so=="string"&&_so.length>0)
this.backgroundColour=_so;else this.backgroundColour="white";if(typeof _tw=="string"&&_tw.length>0)
this.viewportColour=_tw;else this.viewportColour="blue";if(typeof _jg=="number"&&_jg>0&&_jg<=1)
this.viewportOpacity=_jg;else this.viewportOpacity=0.5;if(typeof _m0=="number"&&Math.abs(Math.floor(_m0))==_m0 )
this.zoomDifference=_m0;else this.zoomDifference=3;this.copy=function(){return new _fi(new _fD(this.size.width,this.size.height),this.draggable,this.backgroundColour,this.viewportColour,this.viewportOpacity,this.zoomDifference);};}
var AGOverviewMapOptions=_fi;

function _fh(){}
_fh.bViewportDrag=false;_fh.bOMDrag=false;_fh.oPointDragStart=null;_fh.oPointDragEnd=null;_fh._pH=null;_fh.viewportMouseDownHandler=function(e){if(_fd.isRightButton(e))
return false;var _pj=e.data.overviewMap;_fh.bViewportDrag=true;_fh.oPointDragStart=_fd.getMouseCoords(e);_fh._pH=new _fn(_fh.oPointDragStart.x,_fh.oPointDragStart.y);return false;};_fh.viewportMouseMoveHandler=function(e){if(_fh.bViewportDrag){var _pj=e.data.overviewMap;var _pC=_fd.getMouseCoords(e);var _qT=_pC.x-_fh._pH.x;var _qU=_pC.y-_fh._pH.y;_pj._X.style.left=parseInt(_pj._X.style.left)+_qT+"px";_pj._X.style.top=parseInt(_pj._X.style.top)+_qU+"px";_fh._pH=_pC;}
return false;};_fh.viewportMouseUpHandler=function(e){if(_fh.bViewportDrag){var _pj=e.data.overviewMap;_fh.oPointDragEnd=_fd.getMouseCoords(e);var _qT=_fh.oPointDragEnd.x-_fh._pH.x;var _qU=_fh.oPointDragEnd.y-_fh._pH.y;_pj._X.style.left=parseInt(_pj._X.style.left)+_qT+"px";_pj._X.style.top=parseInt(_pj._X.style.top)+_qU+"px";_qT=parseInt(_fh.oPointDragEnd.x-_fh.oPointDragStart.x);_qU=parseInt(_fh.oPointDragEnd.y-_fh.oPointDragStart.y);_pj._qQ(new _fD(-_qT,-_qU));_fh.bViewportDrag=false;}
return false;};_fh.viewportMouseOutHandler=function(e){return _fh.viewportMouseUpHandler(e);};_fh.closeButtonHandler=function(e){var _pj=e.data.overviewMap;_pj._cp._q2(_pj);};_fh.maximizeButtonHandler=function(e){var _pj=e.data.overviewMap;_pj._ni();};_fh.minimizeButtonHandler=function(e){var _pj=e.data.overviewMap;_pj._no();};_fh.omMouseDownHandler=function(e){if(_fd.isRightButton(e))
return false;var _pj=e.data.overviewMap;_fh.bOMDrag=true;_fh._pH=_fd.getMouseCoords(e);return false;};_fh.omMouseMoveHandler=function(e){if(_fh.bOMDrag){var _pj=e.data.overviewMap;var _pC=_fd.getMouseCoords(e);var _qT=_pC.x-_fh._pH.x;var _qU=_pC.y-_fh._pH.y;var _qi=_pj._cp._ki();var r=0;var l=0;var t=0;var b=0;var _lB=_qi.width-_pj._cE.size.width;var _lA=_qi.height-_pj._cE.size.height;switch(_pj._b4.anchor){case _et.TOP_RIGHT:
r=Math.min(parseInt(_pj._U.style.right)-_qT,_lB);r=Math.max(r,0);_pj._U.style.right=r+"px";t=Math.min(parseInt(_pj._U.style.top)+_qU,_lA);t=Math.max(t,0);_pj._U.style.top=t+"px";break;case _et.TOP_LEFT:
l=Math.min(parseInt(_pj._U.style.left)+_qT,_lB);l=Math.max(l,0);_pj._U.style.left=l+"px";t=Math.min(parseInt(_pj._U.style.top)+_qU,_lA);t=Math.max(t,0);_pj._U.style.top=t+"px";break;case _et.BOTTOM_RIGHT:
r=Math.min(parseInt(_pj._U.style.right)-_qT,_lB);r=Math.max(r,0);_pj._U.style.right=r+"px";b=Math.min(parseInt(_pj._U.style.bottom)-_qU,_lA);b=Math.max(b,0);_pj._U.style.bottom=b+"px";break;case _et.BOTTOM_LEFT:
l=Math.min(parseInt(_pj._U.style.left)+_qT,_lB);l=Math.max(l,0);_pj._U.style.left=l+"px";b=Math.min(parseInt(_pj._U.style.bottom)-_qU,_lA);b=Math.max(b,0);_pj._U.style.bottom=b+"px";break;}
_fh._pH=_pC;}
return false;};_fh.omMouseUpHandler=function(e){_fh.bOMDrag=false;return false;};_fh.omMouseOutHandler=function(e){return _fh.omMouseUpHandler(e);};

function _fQ(_nH){}
var _fT=null;_fQ.animate=function(_hQ,_mD,_mC,_k3,_k4,_lp,_lq){var _hS=document.getElementById(_hQ);var _mQ=parseInt(_hS.style.width);var _lj=parseInt(_hS.style.height);if(_lp>0&&_lq>0){var _kS=_lp;var _kT=_lq;if(_mQ+_lp>=_mD)
_kS=_mD-_mQ;if(_lj+_lq>=_mC)
_kT=_mC-_lj;var _lO=_mQ+_kS;var _lN=_lj+_kT;_hS.style.width=_lO+"px";_hS.style.height=_lN+"px";_hS.style.left=(_k3-_lO/2)+"px";_hS.style.top=(_k4-_lN/2)+"px";_hS.style.visibility="visible";if(_lO<_mD||_lN<_mC)
_fT=setTimeout("_fQ.animate('"+_hQ+"',"+_mD+","+_mC+","+_k3+","+_k4+","+_lp+","+_lq+" )",_er);else {_hS.style.visibility="hidden";_fT=null;}}
else if(_lp<0&&_lq<0){var _kS=_lp;var _kT=_lq;if(_mQ+_lp<=_mD)
_kS=_mD-_mQ;if(_lj+_lq<=_mC)
_kT=_mC-_lj;var _lO=_mQ+_kS;var _lN=_lj+_kT;_hS.style.width=_lO+"px";_hS.style.height=_lN+"px";_hS.style.left=(_k3-_lO/2)+"px";_hS.style.top=(_k4-_lN/2)+"px";_hS.style.visibility="visible";if(_lO>_mD||_lN>_mC)
_fT=setTimeout("_fQ.animate('"+_hQ+"',"+_mD+","+_mC+","+_k3+","+_k4+","+_lp+","+_lq+" )",_er);else {_hS.style.visibility="hidden";_fT=null;}}
};_fQ.zoomOnRedDisplayAnimation=function(_nH,_pZ,_gy){if(_fT!=null)
clearTimeout(_fT);var x=parseInt(_pZ.x,10);var y=parseInt(_pZ.y,10);var _lp=5;var _lq=5;if(_gy==1){var _hS=_nH._kC();_hS.style.left=x+"px";_hS.style.top=y+"px";_hS.style.width="0px";_hS.style.height="0px";_hS.style.visibility="visible";_fQ.animate(_hS.id,_eq.width,_eq.height,x,y,_lp,_lq);}
else if(_gy==0){var _hS=_nH._kC();_hS.style.left=(x-_eq.width/2)+"px";_hS.style.top=(y-_eq.height/2)+"px";_hS.style.width=_eq.width+"px";_hS.style.height=_eq.height+"px";_hS.style.visibility="visible";_fQ.animate(_hS.id,0,0,x,y,-_lp,-_lq);}
else {var _hS=_nH._kC();_hS.style.visibility="hidden";return false;}};

function _eu(){}
_eu.key="<_USER_KEY_>";_eu.validate=function(){var _tt=_eu.getValidationUrl(_eu.key,"http://afrigis.co.za","_eu.callbackValidationUrl");var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",_tt);document.body.appendChild(script);};_eu.getValidationUrl=function(_s0,strCurrentUrl,callback){var _tt=AG_KEY_VALIDATION_GATEWAY+"?";_tt+="Request=ValidateKey"
_tt+="&Key="+_s0;_tt+="&Jsonp="+callback;_tt+="&CurrentUrl"+strCurrentUrl;_tt+="&rnd="+Math.random();return _tt;};_eu.callbackValidationUrl=function(_te){if(typeof _te!="undefined"&&_te!=null){if(typeof _te=="string"&&_te=="error"){return;}
if(_te.Status.toLowerCase()=="error"){for(var i=0;i<AG_MAP_OBJECTS.length;i++){AG_MAP_OBJECTS[i]._hz();}
_e4=null;_eE=null;_fD=null;}}
};

function _e8(){}
_e8.getPeriodicAdvert=function(_ng){if(_e9.status==true){var _o0=AG_MAP_OBJECTS[_ng];var _nC=_o0._jl();var _nV=_o0._jn();var _sq=_nV._c1.longitude()+","+_nV._c1._m1()+","+_nV._cD.longitude()+","+_nV._cD._m1();var location="bb{"+_sq+"}";var _tt=_e8.getMarbilAdUrl(_nC.width,_nC.height,location,_ng,"_e8.callbackMarbilAdUsingJsonP");var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",_tt);document.body.appendChild(script);setTimeout("_e8.getPeriodicAdvert("+_ng+");",AG_ADVERTISE_DURATION*1000);}
else if(_e9.status==false){return;}
else {setTimeout("_e8.getPeriodicAdvert("+_ng+");",AG_ADVERTISE_DURATION*1000);}};_e8.getMarbilAdUrl=function(_mQ,_lj,_s4,_ng,_gU){var _tt=AG_MARBIL_GATEWAY+"?";_tt+="&Request=GetAdvertNow";_tt+="&UserName="+_e9.userName;_tt+="&Password="+_e9.password;_tt+="&Width="+_mQ;_tt+="&Height="+_lj;_tt+="&Location="+_s4;_tt+="&Jsonp="+_gU;_tt+="&MapIndex="+_ng;_tt+="&rnd="+Math.random();return _tt;}
_e8.callbackMarbilAdUsingJsonP=function(_sR,_lx){if(_sR.Status=="error"){return;}
if(_sR.length>0){var _o0=AG_MAP_OBJECTS[_lx];_o0._rM(_sR[0].ImageUrl,_sR[0].RedirectionUrl,_lx);}}


function _e9(){}
_e9.userName=null;_e9.password=null;_e9.status=null;_e9._m7=function(_sm){var _tt=AG_MARBIL_GATEWAY+"?";_tt+="&Request=GetMarbilUser";_tt+="&Key="+_sm;_tt+="&Jsonp=_e9.callbackLoad";var script=document.createElement("script");script.setAttribute("type","text/javascript");script.setAttribute("src",_tt);document.body.appendChild(script);};_e9.callbackLoad=function(_tu){if(typeof _tu!="undefined"&&_tu!=null){if(typeof _tu.Status=="string"&&_tu.Status.toLowerCase()=="error")
return;_e9.userName=_tu.UserName;_e9.password=_tu.Password;_e9.status=(_tu.AdvertStatus.toLowerCase()=="true");if(_e9.status){for(var i=0;i<AG_MAP_OBJECTS.length;i++){AG_MAP_OBJECTS[i]._ri();}}
}};

function _fk(){}
_fk.smoothPan=function(_ng,x,y){var _o0=AG_MAP_OBJECTS[_ng];var _pD=new _fn(x,y);if(_o0.isEnabledPanAnimation()){if(_pD==null||!(_pD instanceof _fn))
throw "Invalid input for _hP.";var _qe=new _fn(0,0);if(_pD.x<=0&&_pD.y>=0){if(_pD.x<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,0);else if(_pD.y>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x>-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y<AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(_pD.x,_pD.y);else if(_pD.x>-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(_pD.x,0);else if(_pD.y<AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,_pD.y);if(_qe.x==0&&_qe.y==0)
return;else {_fk.setMapContainer(_ng,_qe,x,y);}}
else if(_pD.x>=0&&_pD.y<=0){if(_pD.x>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,0);else if(_pD.y<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x<AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y>AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(_pD.x,_pD.y);else if(_pD.x<AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(_pD.x,0);else if(_pD.y>AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,_pD.y);if(_qe.x==0&&_qe.y==0)
return;else {_fk.setMapContainer(_ng,_qe,x,y);}}
else if(_pD.x>=0&&_pD.y>=0){if(_pD.x>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,0);else if(_pD.y>=AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x<AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y<AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(_pD.x,_pD.y);else if(_pD.x<AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(_pD.x,0);else if(_pD.y<AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,_pD.y);if(_qe.x==0&&_qe.y==0)
return;else {_fk.setMapContainer(_ng,_qe,x,y);}}
else if(_pD.x<=0&&_pD.y<=0){if(_pD.x<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x,0);else if(_pD.y<=-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,-AG_PAN_ANIMATION_DISTANCE_AMOUNT.y);else if(_pD.x>-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x&&_pD.y>AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(_pD.x,_pD.y);else if(_pD.x>-AG_PAN_ANIMATION_DISTANCE_AMOUNT.x)
_qe=new _fn(_pD.x,0);else if(_pD.y>AG_PAN_ANIMATION_DISTANCE_AMOUNT.y)
_qe=new _fn(0,_pD.y);if(_qe.x==0&&_qe.y==0)
return;else {_fk.setMapContainer(_ng,_qe,x,y);}}
}
else {return;}};_fk.setMapContainer=function(_ng,_qe,x,y){var _o0=AG_MAP_OBJECTS[_ng];_o0._nu(_qe);_o0._kI(_fe.PAN);_o0._kH(_fe.PAN);_pD=new _fn((x-_qe.x),(y-_qe.y));setTimeout('_fk.smoothPan('+_ng+','+_pD.x+','+_pD.y+')',AG_PAN_ANIMATION_DURATION);}


function _eO(){}
_eO.show=function(){for(var i=0;i<AG_MAP_OBJECTS.length;i++)
AG_MAP_OBJECTS[i]._r6();jQuery(document).bind('keydown',_eO.hide);};_eO.hide=function(){for(var i=0;i<AG_MAP_OBJECTS.length;i++)
AG_MAP_OBJECTS[i]._kP();jQuery(document).unbind('keydown',_eO.hide);};

function _eV(_oS,_ot,_pc){if(_oS==null||typeof _oS!="object")
throw "Invalid HTML Object";if(!(_ot instanceof _eE))
throw "Invalid coordinate";if(_pc instanceof _eW)
this._cE=_pc.copy();else this._cE=new _eW();this._cj=_oS;this._b0=_ot;this._cq=null;this._H=false;this.initialize=function(_o0){this._cq=_o0;this._rR();var divMap=this._cq._j5(_fl.FLOAT_PANE);divMap.appendChild(this._cj);this._H=true;};this.copy=function(){};this.redraw=function(_l2){switch(_l2){case _fe.ZOOM:
this._rR();break;case _fe.PAN:
break;}};this.remove=function(){if(this._cj.parentNode)
this._cj.parentNode.removeChild(this._cj);this._cq=null;this._H=false;};this._rR=function(){this._cj.style.position="absolute";var _pI=this._cq._ka(this._b0);this._cj.style.left=_pI.x+this._cE.pixelOffset.x+"px";this._cj.style.top=_pI.y+this._cE.pixelOffset.y+"px";};this.show=function(){this._cj.style.visibility="visible";this._H=true;};this.hide=function(){this._cj.style.visibility="hidden";this._H=false;};this._mB=function(){return this._H;};this._rz=function(_oj){if(!(_oj instanceof _eE))
throw "Invalid coord input";this._b0=_oj;if(this._mu())
this._rR();};this._jx=function(){return this._b0;};this._mu=function(){return this._cq!=null;};this.show=this.show;this.hide=this.hide;this.isVisible=this._mB;this.setCoord=this._rz;this.getCoord=this._jx;}
var AGHTMLOverlay=_eV;

function _eW(_pU){if(_pU!=null&&_pU instanceof _fn)
this.pixelOffset=_pU;else this.pixelOffset=new _fn(0,0);this.copy=function(){return new _eW(this.pixelOffset);};}
var AGHTMLOverlayOptions=_eW;

AGMapTypeControl.prototype=new _eC;function AGMapTypeControl(){this._cq=null;this._H=false;this._oMapTypeContainer=null;this._oTypeMap=null;this._oTypeImagery=null;this._oTypeHybrid=null;this._oMapTypeContainer=document.createElement("div");this._oMapTypeContainer.style.position="absolute";this._oMapTypeContainer.style.width="202px";this._oMapTypeContainer.style.height="20px";this._oMapTypeContainer.style.zIndex="300";this._oTypeMap=document.createElement("div");this._oTypeMap.style.position="absolute";this._oTypeMap.style.width="100px";this._oTypeMap.style.height="18px";this._oTypeMap.style.textAlign="left";this._oTypeMap.setAttribute('align','left');this._oTypeMap.style.fontSize="12px";this._oTypeMap.innerHTML="Map";this._oTypeMap.style.border="1px solid black";this._oTypeMap.style.fontWeight="normal";this._oTypeMap.style.cursor="pointer";this._oTypeMap.style.backgroundColor="Yellow";this._oMapTypeContainer.appendChild(this._oTypeMap);this._oTypeImagery=document.createElement("div");this._oTypeImagery.style.position="absolute";this._oTypeImagery.style.backgroundColor="white";this._oTypeImagery.style.width="100px";this._oTypeImagery.style.height="18px";this._oTypeImagery.style.left="101px";this._oTypeImagery.style.textAlign="left";this._oTypeImagery.style.fontSize="12px";this._oTypeImagery.setAttribute('align','left');this._oTypeImagery.innerHTML="Imagery";this._oTypeImagery.style.border="1px solid black";this._oTypeImagery.style.cursor="pointer";this._oTypeImagery.style.overflow="hidden";this._oTypeImagery.onmouseover=function(){this.style.height="80px";}
this._oTypeImagery.onmouseout=function(){this.style.height="18px";}
this._oTypeImagery.innerHTML+="<hr/>";if(_ew._gN=="Explorer")
this._oRadioButtonHybrid=document.createElement("input type='radio'");else {this._oRadioButtonHybrid=document.createElement("input");this._oRadioButtonHybrid.type="radio";} 
this._oRadioButtonHybrid.name="ImageryGroup";this._oRadioButtonHybrid.checked="checked";this._oTypeImagery.appendChild(this._oRadioButtonHybrid);this._oTypeImagery.innerHTML+="Hybrid";this._oTypeImagery.innerHTML+="<br/>";this._oMapTypeContainer.appendChild(this._oTypeImagery);if(_ew._gN=="Explorer")
this._oRadioButtonImageryOnly=document.createElement("input type='radio'");else {this._oRadioButtonImageryOnly=document.createElement("input");this._oRadioButtonImageryOnly.type="radio";} 
this._oRadioButtonImageryOnly.name="ImageryGroup";this._oTypeImagery.appendChild(this._oRadioButtonImageryOnly);this._oTypeImagery.innerHTML+="Imagery Only";this.initialize=function(_nH,_oi){this._cq=_nH;var _hR=_nH._ju();if( _oi==null||!(_oi instanceof _eD))
_oi=new _eD();if(_oi.anchor==_et.TOP_RIGHT){this._oMapTypeContainer.style.right=_oi.offset.x+"px";this._oMapTypeContainer.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.TOP_LEFT){this._oMapTypeContainer.style.left=_oi.offset.x+"px";this._oMapTypeContainer.style.top=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_RIGHT){this._oMapTypeContainer.style.right=_oi.offset.x+"px";this._oMapTypeContainer.style.bottom=_oi.offset.y+"px";}
else if(_oi.anchor==_et.BOTTOM_LEFT){this._oMapTypeContainer.style.left=_oi.offset.x+"px";this._oMapTypeContainer.style.bottom=_oi.offset.y+"px";}
_hR.appendChild(this._oMapTypeContainer);this._H=true;$(this._oTypeMap).bind("click",{map:this._cq,_n5:this._oTypeMap,type:"map"},AGMapTypeMouseManager.onmouseclick);$(this._oTypeImagery).bind("click",{map:this._cq,_n5:this._oTypeImagery,type:"imagery"},AGMapTypeMouseManager.onmouseclick);this._oTypeImagery.childNodes[2].checked=true;this._oTypeMap.style.fontWeight="bold";};this.redraw=function(_l2){};this._ri=function(){}
this.remove=function(){};this.copy=function(){};this._mB=function(){return this._H;};this.show=function(){if(!this._H){this._oMapTypeContainer.style.visibility="visible";this._H=true;}};this.hide=function(){if(this._H){this._oMapTypeContainer.style.visibility="hidden";this._H=false;}};}


function AGMapTypeMouseManager(){}
AGMapTypeMouseManager.onmouseclick=function(_iN){var _o0=_iN.data.map;var _n5=_iN.data._n5;var type=_iN.data.type;$("*",_n5.parentNode).css("background-Color","white");$("*",_n5.parentNode).css("font-Weight","normal");if(_ew._gN=="Explorer"&&type=="imagery"){_n5.childNodes[2].style.backgroundColor="Yellow";_n5.childNodes[5].style.backgroundColor="Yellow";}
_n5.style.backgroundColor="Yellow";if(type=="map"){_n5.style.fontWeight="bold";_o0._kQ();_o0._kO();_o0._r4();_o0._ri();} 
else if(type=="imagery"){_o0._kN();_o0._r8();_n5.style.fontWeight="bold";if(_n5.childNodes[2].checked==true){_o0._r5();}
else {_o0._kO();} 
_o0._ri();_n5.checked=true;}}


function AGCircle(_om,fRadiusInMeter,_qI){if(_om instanceof _eE)
this._oCoordCentre=_om;else throw "Invalied centre coord";if(typeof fRadiusInMeter!="undefined"&&fRadiusInMeter!=null&&typeof fRadiusInMeter=="Number")
throw "Invalied radius";this._fRadiusInMeter=fRadiusInMeter;this._dh=_qI instanceof _fP ? _qI : AG_DEFAULT_VECTOR_OPTIONS.copy();this._cq=null;this._oCirclePainter=new AGCirclePainter();this._oCircleElement=null;this._H=false;this.initialize=function(_o0){this._cq=_o0;var _oY=this._cq._j5(_fl.OVERLAY_PANE);var oPointCentre=this._cq._ka(this._oCoordCentre);var iRadius=_fJ.getDistanceMetreToPixel(this._fRadiusInMeter,this._cq._kD());this._oCircleElement=this._oCirclePainter.circle(oPointCentre,iRadius,this._dh);_oY.appendChild(this._oCircleElement);this._H=true;};this.copy=function(){};this.redraw=function(_l2){if(_fe.ZOOM==_l2){var oPointCentre=this._cq._ka(this._oCoordCentre);var iRadius=_fJ.getDistanceMetreToPixel(this._fRadiusInMeter,this._cq._kD());this._oCirclePainter.redraw(oPointCentre,iRadius);}};this.remove=function(){if(this._oCircleElement.parentNode){this._oCircleElement.parentNode.removeChild(this._oCircleElement);_eP.trigger(this,"onremove");}};this._jt=function(){return null;};this._mu=function(){return this._bI!=null;};this.moveCentre=function(_om){if(_om instanceof _eE){this._oCoordCentre=_om;if(this._oCircleElement){var iRadius=_fJ.getDistanceMetreToPixel(this._fRadiusInMeter,this._cq._kD());var oPointCentre=this._cq._ka(this._oCoordCentre);this._oCirclePainter.redraw(oPointCentre,iRadius);_eP.trigger(this,"onlineupdated");}}
};this.show=function(){if(!this._mB()){this._H=true;this._oCircleElement.style.visibility='visible';_eP.trigger(this,"onvisibilitychanged",true);}};this.hide=function(){if(this._mB()){this._H=false;this._oCircleElement.style.visibility='hidden';_eP.trigger(this,"onvisibilitychanged",false);}};this._mB=function(){return this._H;};this.setRadius=function(fRadiusInMeter){if(fRadiusInMeter!=null&&typeof fRadiusInMeter!="undefined"&&typeof fRadiusInMeter=="number"){this._fRadiusInMeter=fRadiusInMeter;if(this._oCircleElement){var iRadius=_fJ.getDistanceMetreToPixel(this._fRadiusInMeter,this._cq._kD());var oPointCentre=this._cq._ka(this._oCoordCentre);this._oCirclePainter.redraw(oPointCentre,iRadius);_eP.trigger(this,"onlineupdated");}}
};this._rY=function(_qI){if(_qI instanceof _fP){this._dh=_qI;if(this._oCircleElement){this._oCirclePainter._rY(_qI);_eP.trigger(this,"onlineupdated");}}
};this.moveCentre=this.moveCentre;this.show=this.show;this.hide=this.hide;this.isVisible=this._mB;this.setRadius=this.setRadius;this.setStyle=this._rY;}
var AGCircle=AGCircle;

