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