/*
 * deCarta JavaScript Mapping API
 * Copyright 2006-2009 deCarta. All rights reserved.
 * version DDS 4.4.2sp02
 *
 * Bundles:
 *   ExplorerCanvas
 *   Project: http://excanvas.sourceforge.net/
 *   License: Apache 2.0
 *   License Location: http://excanvas.sourceforge.net/COPYING
 */
if(!document.createElement("canvas").getContext){(function(){var Y=Math;var q=Y.round;var o=Y.sin;var B=Y.cos;var H=Y.abs;var N=Y.sqrt;var d=10;var f=d/2;function A(){return this.context_||(this.context_=new D(this))}var v=Array.prototype.slice;function g(j,m,p){var i=v.call(arguments,2);return function(){return j.apply(m,i.concat(v.call(arguments)))}}function ad(i){return String(i).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function R(j){if(!j.namespaces.g_vml_){j.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!j.namespaces.g_o_){j.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))}},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j<m.length;j++){this.initElement(m[j])}},initElement:function(j){if(!j.getContext){j.getContext=A;R(j.ownerDocument);j.innerHTML="";j.attachEvent("onpropertychange",z);j.attachEvent("onresize",V);var i=j.attributes;if(i.width&&i.width.specified){j.style.width=i.width.nodeValue+"px"}else{j.width=j.clientWidth}if(i.height&&i.height.specified){j.style.height=i.height.nodeValue+"px"}else{j.height=j.clientHeight}}return j}};function z(j){var i=j.srcElement;switch(j.propertyName){case"width":i.getContext().clearRect();i.style.width=i.attributes.width.nodeValue+"px";i.firstChild.style.width=i.clientWidth+"px";break;case"height":i.getContext().clearRect();i.style.height=i.attributes.height.nodeValue+"px";i.firstChild.style.height=i.clientHeight+"px";break}}function V(j){var i=j.srcElement;if(i.firstChild){i.firstChild.style.width=i.clientWidth+"px";i.firstChild.style.height=i.clientHeight+"px"}}e.init();var n=[];for(var ac=0;ac<16;ac++){for(var ab=0;ab<16;ab++){n[ac*16+ab]=ac.toString(16)+ab.toString(16)}}function C(){return[[1,0,0],[0,1,0],[0,0,1]]}function J(p,m){var j=C();for(var i=0;i<3;i++){for(var af=0;af<3;af++){var Z=0;for(var ae=0;ae<3;ae++){Z+=p[i][ae]*m[ae][af]}j[i][af]=Z}}return j}function x(j,i){i.fillStyle=j.fillStyle;i.lineCap=j.lineCap;i.lineJoin=j.lineJoin;i.lineWidth=j.lineWidth;i.miterLimit=j.miterLimit;i.shadowBlur=j.shadowBlur;i.shadowColor=j.shadowColor;i.shadowOffsetX=j.shadowOffsetX;i.shadowOffsetY=j.shadowOffsetY;i.strokeStyle=j.strokeStyle;i.globalAlpha=j.globalAlpha;i.font=j.font;i.textAlign=j.textAlign;i.textBaseline=j.textBaseline;i.arcScaleX_=j.arcScaleX_;i.arcScaleY_=j.arcScaleY_;i.lineScale_=j.lineScale_}var b={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"};function M(j){var p=j.indexOf("(",3);var i=j.indexOf(")",p+1);var m=j.substring(p+1,i).split(",");if(m.length==4&&j.substr(3,1)=="a"){alpha=Number(m[3])}else{m[3]=1}return m}function c(i){return parseFloat(i)/100}function u(j,m,i){return Math.min(i,Math.max(m,j))}function I(af){var m,j,i;h=parseFloat(af[0])/360%360;if(h<0){h++}s=u(c(af[1]),0,1);l=u(c(af[2]),0,1);if(s==0){m=j=i=l}else{var Z=l<0.5?l*(1+s):l+s-l*s;var ae=2*l-Z;m=a(ae,Z,h+1/3);j=a(ae,Z,h);i=a(ae,Z,h-1/3)}return"#"+n[Math.floor(m*255)]+n[Math.floor(j*255)]+n[Math.floor(i*255)]}function a(j,i,m){if(m<0){m++}if(m>1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}function F(j){var ae,Z=1;j=String(j);if(j.charAt(0)=="#"){ae=j}else{if(/^rgb/.test(j)){var p=M(j);var ae="#",af;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){af=Math.floor(c(p[m])*255)}else{af=Number(p[m])}ae+=n[u(af,0,255)]}Z=p[3]}else{if(/^hsl/.test(j)){var p=M(j);ae=I(p);Z=p[3]}else{ae=b[j]||j}}}return{color:ae,alpha:Z}}var r={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||r.style,variant:m.fontVariant||r.variant,weight:m.fontWeight||r.weight,size:m.fontSize||r.size,family:m.fontFamily||r.family}}function w(m,j){var i={};for(var af in m){i[af]=m[af]}var ae=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ae*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ae/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=ae*(4/3)*Z}else{i.size=ae}}}}}i.size*=0.981;return i}function aa(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}function S(i){switch(i){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function D(j){this.m_=C();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=j;var i=j.ownerDocument.createElement("div");i.style.width=j.clientWidth+"px";i.style.height=j.clientHeight+"px";i.style.overflow="hidden";i.style.position="absolute";j.appendChild(i);this.element_=i;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var t=D.prototype;t.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};t.beginPath=function(){this.currentPath_=[]};t.moveTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};t.lineTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};t.bezierCurveTo=function(m,j,ai,ah,ag,ae){var i=this.getCoords_(ag,ae);var af=this.getCoords_(m,j);var Z=this.getCoords_(ai,ah);K(this,af,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}t.quadraticCurveTo=function(ag,m,j,i){var af=this.getCoords_(ag,m);var ae=this.getCoords_(j,i);var ah={x:this.currentX_+2/3*(af.x-this.currentX_),y:this.currentY_+2/3*(af.y-this.currentY_)};var Z={x:ah.x+(ae.x-this.currentX_)/3,y:ah.y+(ae.y-this.currentY_)/3};K(this,ah,Z,ae)};t.arc=function(aj,ah,ai,ae,j,m){ai*=d;var an=m?"at":"wa";var ak=aj+B(ae)*ai-f;var am=ah+o(ae)*ai-f;var i=aj+B(j)*ai-f;var al=ah+o(j)*ai-f;if(ak==i&&!m){ak+=0.125}var Z=this.getCoords_(aj,ah);var ag=this.getCoords_(ak,am);var af=this.getCoords_(i,al);this.currentPath_.push({type:an,x:Z.x,y:Z.y,radius:ai,xStart:ag.x,yStart:ag.y,xEnd:af.x,yEnd:af.y})};t.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};t.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};t.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};t.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};t.createRadialGradient=function(p,ae,m,j,Z,i){var af=new U("gradientradial");af.x0_=p;af.y0_=ae;af.r0_=m;af.x1_=j;af.y1_=Z;af.r1_=i;return af};t.drawImage=function(ao,m){var ah,af,aj,aw,am,ak,aq,ay;var ai=ao.runtimeStyle.width;var an=ao.runtimeStyle.height;ao.runtimeStyle.width="auto";ao.runtimeStyle.height="auto";var ag=ao.width;var au=ao.height;ao.runtimeStyle.width=ai;ao.runtimeStyle.height=an;if(arguments.length==3){ah=arguments[1];af=arguments[2];am=ak=0;aq=aj=ag;ay=aw=au}else{if(arguments.length==5){ah=arguments[1];af=arguments[2];aj=arguments[3];aw=arguments[4];am=ak=0;aq=ag;ay=au}else{if(arguments.length==9){am=arguments[1];ak=arguments[2];aq=arguments[3];ay=arguments[4];ah=arguments[5];af=arguments[6];aj=arguments[7];aw=arguments[8]}else{throw Error("Invalid number of arguments")}}}var ax=this.getCoords_(ah,af);var p=aq/2;var j=ay/2;var av=[];var i=10;var ae=10;av.push(" <g_vml_:group",' coordsize="',d*i,",",d*ae,'"',' coordorigin="0,0"',' style="width:',i,"px;height:",ae,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]||this.m_[1][1]!=1||this.m_[1][0]){var Z=[];Z.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",q(ax.x/d),",","Dy=",q(ax.y/d),"");var at=ax;var ar=this.getCoords_(ah+aj,af);var ap=this.getCoords_(ah,af+aw);var al=this.getCoords_(ah+aj,af+aw);at.x=Y.max(at.x,ar.x,ap.x,al.x);at.y=Y.max(at.y,ar.y,ap.y,al.y);av.push("padding:0 ",q(at.x/d),"px ",q(at.y/d),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",Z.join(""),", sizingmethod='clip');")}else{av.push("top:",q(ax.y/d),"px;left:",q(ax.x/d),"px;")}av.push(' ">','<g_vml_:image src="',ao.src,'"',' style="width:',d*aj,"px;"," height:",d*aw,'px"',' cropleft="',am/ag,'"',' croptop="',ak/au,'"',' cropright="',(ag-am-aq)/ag,'"',' cropbottom="',(au-ak-ay)/au,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",av.join(""))};t.stroke=function(aj){var ah=[];var Z=false;var m=10;var ak=10;ah.push("<g_vml_:shape",' filled="',!!aj,'"',' style="position:absolute;width:',m,"px;height:",ak,'px;"',' coordorigin="0,0"',' coordsize="',d*m,",",d*ak,'"',' stroked="',!aj,'"',' path="');var al=false;var ae={x:null,y:null};var ai={x:null,y:null};for(var af=0;af<this.currentPath_.length;af++){var j=this.currentPath_[af];var ag;switch(j.type){case"moveTo":ag=j;ah.push(" m ",q(j.x),",",q(j.y));break;case"lineTo":ah.push(" l ",q(j.x),",",q(j.y));break;case"close":ah.push(" x ");j=null;break;case"bezierCurveTo":ah.push(" c ",q(j.cp1x),",",q(j.cp1y),",",q(j.cp2x),",",q(j.cp2y),",",q(j.x),",",q(j.y));break;case"at":case"wa":ah.push(" ",j.type," ",q(j.x-this.arcScaleX_*j.radius),",",q(j.y-this.arcScaleY_*j.radius)," ",q(j.x+this.arcScaleX_*j.radius),",",q(j.y+this.arcScaleY_*j.radius)," ",q(j.xStart),",",q(j.yStart)," ",q(j.xEnd),",",q(j.yEnd));break}if(j){if(ae.x==null||j.x<ae.x){ae.x=j.x}if(ai.x==null||j.x>ai.x){ai.x=j.x}if(ae.y==null||j.y<ae.y){ae.y=j.y}if(ai.y==null||j.y>ai.y){ai.y=j.y}}}ah.push(' ">');if(!aj){y(this,ah)}else{G(this,ah,ae,ai)}ah.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",ah.join(""))};function y(m,ae){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ae.push("<g_vml_:stroke",' opacity="',Z,'"',' joinstyle="',m.lineJoin,'"',' miterlimit="',m.miterLimit,'"',' endcap="',S(m.lineCap),'"',' weight="',i,'px"',' color="',p,'" />')}function G(ao,ag,aI,ap){var ah=ao.fillStyle;var az=ao.arcScaleX_;var ay=ao.arcScaleY_;var j=ap.x-aI.x;var p=ap.y-aI.y;if(ah instanceof U){var al=0;var aD={x:0,y:0};var av=0;var ak=1;if(ah.type_=="gradient"){var aj=ah.x0_/az;var m=ah.y0_/ay;var ai=ah.x1_/az;var aK=ah.y1_/ay;var aH=ao.getCoords_(aj,m);var aG=ao.getCoords_(ai,aK);var ae=aG.x-aH.x;var Z=aG.y-aH.y;al=Math.atan2(ae,Z)*180/Math.PI;if(al<0){al+=360}if(al<0.000001){al=0}}else{var aH=ao.getCoords_(ah.x0_,ah.y0_);aD={x:(aH.x-aI.x)/j,y:(aH.y-aI.y)/p};j/=az*d;p/=ay*d;var aB=Y.max(j,p);av=2*ah.r0_/aB;ak=2*ah.r1_/aB-av}var at=ah.colors_;at.sort(function(aL,i){return aL.offset-i.offset});var an=at.length;var ar=at[0].color;var aq=at[an-1].color;var ax=at[0].alpha*ao.globalAlpha;var aw=at[an-1].alpha*ao.globalAlpha;var aC=[];for(var aF=0;aF<an;aF++){var am=at[aF];aC.push(am.offset*ak+av+" "+am.color)}ag.push('<g_vml_:fill type="',ah.type_,'"',' method="none" focus="100%"',' color="',ar,'"',' color2="',aq,'"',' colors="',aC.join(","),'"',' opacity="',aw,'"',' g_o_:opacity2="',ax,'"',' angle="',al,'"',' focusposition="',aD.x,",",aD.y,'" />')}else{if(ah instanceof T){if(j&&p){var af=-aI.x;var aA=-aI.y;ag.push("<g_vml_:fill",' position="',af/j*az*az,",",aA/p*ay*ay,'"',' type="tile"',' src="',ah.src_,'" />')}}else{var aJ=F(ao.fillStyle);var au=aJ.color;var aE=aJ.alpha*ao.globalAlpha;ag.push('<g_vml_:fill color="',au,'" opacity="',aE,'" />')}}}t.fill=function(){this.stroke(true)};t.closePath=function(){this.currentPath_.push({type:"close"})};t.getCoords_=function(p,j){var i=this.m_;return{x:d*(p*i[0][0]+j*i[1][0]+i[2][0])-f,y:d*(p*i[0][1]+j*i[1][1]+i[2][1])-f}};t.save=function(){var i={};x(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(C(),this.m_)};t.restore=function(){if(this.aStack_.length){x(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function k(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function X(j,i,p){if(!k(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}t.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];X(this,J(i,this.m_),false)};t.rotate=function(j){var p=B(j);var m=o(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];X(this,J(i,this.m_),false)};t.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];X(this,J(i,this.m_),true)};t.transform=function(Z,p,af,ae,j,i){var m=[[Z,p,0],[af,ae,0],[j,i,1]];X(this,J(m,this.m_),true)};t.setTransform=function(ae,Z,ag,af,p,j){var i=[[ae,Z,0],[ag,af,0],[p,j,1]];X(this,i,true)};t.drawText_=function(ak,ai,ah,an,ag){var am=this.m_,aq=1000,j=0,ap=aq,af={x:0,y:0},ae=[];var i=w(E(this.font),this.element_);var p=aa(i);var ar=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=ar.direction=="ltr"?"right":"left";break;case"start":Z=ar.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":af.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":af.y=-i.size/2.25;break}switch(Z){case"right":j=aq;ap=0.05;break;case"center":j=ap=aq/2;break}var ao=this.getCoords_(ai+af.x,ah+af.y);ae.push('<g_vml_:line from="',-j,' 0" to="',ap,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!ag,'" stroked="',!!ag,'" style="position:absolute;width:1px;height:1px;">');if(ag){y(this,ae)}else{G(this,ae,{x:-j,y:0},{x:ap,y:i.size})}var al=am[0][0].toFixed(3)+","+am[1][0].toFixed(3)+","+am[0][1].toFixed(3)+","+am[1][1].toFixed(3)+",0,0";var aj=q(ao.x/d)+","+q(ao.y/d);ae.push('<g_vml_:skew on="t" matrix="',al,'" ',' offset="',aj,'" origin="',j,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',ad(ak),'" style="v-text-align:',Z,";font:",ad(p),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",ae.join(""))};t.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};t.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};t.measureText=function(m){if(!this.textMeasureEl_){var i='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};t.clip=function(){};t.arcTo=function(){};t.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var W=P.prototype=new Error;W.INDEX_SIZE_ERR=1;W.DOMSTRING_SIZE_ERR=2;W.HIERARCHY_REQUEST_ERR=3;W.WRONG_DOCUMENT_ERR=4;W.INVALID_CHARACTER_ERR=5;W.NO_DATA_ALLOWED_ERR=6;W.NO_MODIFICATION_ALLOWED_ERR=7;W.NOT_FOUND_ERR=8;W.NOT_SUPPORTED_ERR=9;W.INUSE_ATTRIBUTE_ERR=10;W.INVALID_STATE_ERR=11;W.SYNTAX_ERR=12;W.INVALID_MODIFICATION_ERR=13;W.NAMESPACE_ERR=14;W.INVALID_ACCESS_ERR=15;W.VALIDATION_ERR=16;W.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P})()}var deCarta={};function GLOBALS(){}GLOBALS.HYBRID="HYBRID";GLOBALS.STREET="STREET";GLOBALS.SATELLITE="SATELLITE";GLOBALS.PAN_PIXEL_DISTANCE=300;GLOBALS.DEFAULT_MAP_TILE_SIZE=256;GLOBALS.DEFAULT_MAP_WIDTH="800px";GLOBALS.DEFAULT_MAP_HEIGHT="500px";GLOBALS.API_VERSION="4.4.2sp02";GLOBALS.API_BUILD="$LastChangedRevision: 53002 $";GLOBALS.API_RELEASECLASS="RELEASE";GLOBALS.ALLOWDOMEVENTS=true;GLOBALS.DEBUG_JSON=false;function Credentials(){}Credentials.url="http://ws.decarta.com/openls/openls";Credentials.jsonServletName="JSON";Credentials.clientName="";Credentials.clientPassword="";Credentials.configuration="us-carto";Credentials.transparentConfiguration="transparent-tile";Credentials.mapType="STREET";Credentials.ISOCountryCode="US";Credentials.trafficEnabled=false;Credentials.rel="4.4.2sp02";Credentials.dgkey="";Credentials.imgPath="img/";Credentials.errorTile=Credentials.imgPath+"tile.png";Credentials.transparentPNG=Credentials.imgPath+"tile.png";Credentials.transparentGIF=Credentials.imgPath+"x.gif";Credentials.infoWindowCloseButton=Credentials.imgPath+"close.png";Credentials.pinIconPath=Credentials.imgPath+"greenDot.png";Credentials.zoomUnselectedIconPath=Credentials.imgPath+"zoom.png";Credentials.zoomSelectedIconPath=Credentials.imgPath+"zoomChecked.png";Credentials.zoomOutIconPath=Credentials.imgPath+"zoomBottom.png";Credentials.zoomInIconPath=Credentials.imgPath+"zoomTop.png";deCarta.AJAXContentLoader={};deCarta.AJAXContentLoader.load=function(b,g,a){if(a&&a.mode=="iframe"){var c=document.createElement("iframe");c.style.width=a.height||"0px";c.style.height=a.width||"0px";c.style.border="0px";c.src=b;if(typeof(g)=="function"){c.onload=g}a.dom.appendChild(c)}else{if(!Utilities.ie){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(d){}}var f=new XMLHttpRequest();f.open("GET",b,true);f.onreadystatechange=function(){if(f.readyState==4){if(f.status==200){g(f.responseText)}else{g(f.responseText)}}};f.send(null)}};function Address(e,i,c,b,g,f,d,a){if(e||e==0){this.buildingNumber=e}else{this.buildingNumber=""}this.landmark="";this.street=i||"";this.streetNameAndNumber="";this.speedLimit="";this.countryCode="";this.countrySubdivision=c||"";this.countrySecondarySubdivision=b||"";this.countryTertiarySubdivision="";this.municipality=g||"";this.postalCode=f||"";this.municipalitySubdivision=d||"";this.locale=a||new Locale("en","US");this.type="Structured"}Address.prototype.getBuildingNumber=function(){return this.buildingNumber};Address.prototype.setBuildingNumber=function(a){this.buildingNumber=a};Address.prototype.getStreet=function(){return this.street};Address.prototype.setStreet=function(a){this.street=a};Address.prototype.getCountrySubdivision=function(){return this.countrySubdivision};Address.prototype.setCountrySubdivision=function(a){this.countrySubdivision=a};Address.prototype.getCountrySecondarySubdivision=function(){return this.countrySecondarySubdivision};Address.prototype.setCountrySecondarySubdivision=function(a){this.countrySecondarySubdivision=a};Address.prototype.getMunicipality=function(){return this.municipality};Address.prototype.setMunicipality=function(a){this.municipality=a};Address.prototype.getMunicipalitySubdivision=function(){return this.municipalitySubdivision};Address.prototype.setMunicipalitySubdivision=function(a){this.municipalitySubdivision=a};Address.prototype.getPostalCode=function(){return this.postalCode};Address.prototype.setPostalCode=function(a){this.postalCode=a};Address.prototype.getLocale=function(){return this.locale};Address.prototype.setLocale=function(a){this.locale=a};Address.prototype.toString=function(){var a="";if(this.buildingNumber!=""){a+=this.buildingNumber+" "}if(this.street!=""){a+=this.street+" "}if(this.municipality!=""){a+=this.municipality+" "}if(this.countrySubdivision!=""){a+=this.countrySubdivision+" "}if(this.postalCode!=""){a+=this.postalCode}return a};deCarta.Animator=function(){};deCarta.Animator.prototype.objsToAnimate=null;deCarta.Animator.prototype.objsType=null;deCarta.Animator.prototype.scopeObj=null;deCarta.Animator.prototype.onendCallback=null;deCarta.Animator.prototype.animation=null;deCarta.Animator.prototype.animationId=null;deCarta.Animator.prototype.setObjsToAnimate=function(a){if(!deCarta.Array.isArray(a)){a=[a]}var b;var f=a[0].type;var e=["pin"];var c=e.length;for(b=0;b<c;b++){if(f==e[b]){break}}if(b>=c){throw new Exception("requesting to animate invalid object type: "+this.objsType)}var d=a.length;for(b=0;b<d;b++){if(a[b].type!=f){throw new Exception("obj index: "+b+" is of invalid type: "+a[b].type)}}this.objsType=f;this.objsToAnimate=a};deCarta.Animator.prototype.setScopeObj=function(a){this.scopeObj=a};deCarta.Animator.prototype.setOnendCallback=function(a){if(typeof a!="function"){throw new Exception("deCarta.Animator.setOnendCallback: callback not a function")}this.onendCallback=a};deCarta.Animator.prototype.setAnimation=function(a){};deCarta.Array={};deCarta.Array.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"};deCarta.Array.indexOf=function(d,a,c){var b=d.length;c=(!c||isNaN(c))?0:c;c=(c<=0)?0:c;c=(c>=b-1)?b-1:c;for(;c<b;c++){if(d[c]===a){return c}}return -1};function BoundingBox(b,a){if(!(b&&(b.lat||b.lat==0)&&(b.lon||b.lon==0))||!(a&&(a.lat||a.lat==0)&&(a.lon||a.lon==0))){throw new Exception("Error instantiating BoundingBox, invalid parameters: "+b+a)}this.minPosition=new Position(Math.min(b.lat,a.lat),Math.min(b.lon,a.lon));this.maxPosition=new Position(Math.max(b.lat,a.lat),Math.max(b.lon,a.lon));this.heightInDegrees=this.maxPosition.lat-this.minPosition.lat;this.widthInDegrees=this.maxPosition.lon-this.minPosition.lon;this.getUpperLeftPosition=function(){var c=new Position(this.maxPosition.lat,this.minPosition.lon);return c};this.getLowerRightPosition=function(){var c=new Position(this.minPosition.lat,this.maxPosition.lon);return c};this.getMaxPosition=function(){return this.maxPosition};this.setMaxPosition=function(d){if(!(d&&(d.lat||d.lat==0)&&(d.lon||d.lon==0))){throw new Exception("setMaxPosition: Error, invalid parameter : "+d)}var c=new Position(this.minPosition.lat,this.minPosition.lon);this.maxPosition.lat=Math.max(c.lat,d.lat);this.maxPosition.lon=Math.max(c.lon,d.lon);this.minPosition.lat=Math.min(c.lat,d.lat);this.minPosition.lon=Math.min(c.lon,d.lon)};this.getMinPosition=function(){return this.minPosition};this.setMinPosition=function(c){if(!(c&&(c.lat||c.lat==0)&&(c.lon||c.lon==0))){throw new Exception("setMaxPosition: Error, invalid parameter : "+c)}var d=new Position(this.maxPosition.lat,this.maxPosition.lon);this.maxPosition.lat=Math.max(d.lat,c.lat);this.maxPosition.lon=Math.max(d.lon,c.lon);this.minPosition.lat=Math.min(d.lat,c.lat);this.minPosition.lon=Math.min(d.lon,c.lon)};this.getCenterPosition=function(){var d=parseFloat(this.maxPosition.lat-((this.maxPosition.lat-this.minPosition.lat)/2));var c=parseFloat(this.maxPosition.lon-((this.maxPosition.lon-this.minPosition.lon)/2));return new Position(d,c)};this.getRadius=function(){if(this.heightInDegrees>this.widthInDegrees){return(this.heightInDegrees*111.111)/2}else{return(this.widthInDegrees*111.111)/2}};this.contains=function(c){if(c.lat>this.minPosition.lat&&c.lon>this.minPosition.lon&&c.lat<this.maxPosition.lat&&c.lon<this.maxPosition.lon){return true}else{return false}};this.extendedContains=function(c){if(c.lat>this.minPosition.lat-this.heightInDegrees&&c.lon>this.minPosition.lon-this.widthInDegrees&&c.lat<this.maxPosition.lat+this.heightInDegrees&&c.lon<this.maxPosition.lon+this.widthInDegrees){return true}else{return false}};this.equals=function(c){if(c&&this.minPosition.toString()==c.getMinPosition().toString()&&this.maxPosition.toString()==c.getMaxPosition().toString()){return true}else{return false}};this.toString=function(){return this.minPosition.toString()+" "+this.maxPosition.toString()}}deCarta.CopyrightMessage=function(a){this.init(a)};deCarta.CopyrightMessage.prototype.map=null;deCarta.CopyrightMessage.prototype.type="CopyrightMessage";deCarta.CopyrightMessage.prototype.frame=null;deCarta.CopyrightMessage.prototype.cssClass="decarta-copyright";deCarta.CopyrightMessage.prototype.message=null;deCarta.CopyrightMessage.prototype.init=function(a){this.message=a};deCarta.CopyrightMessage.prototype.build=function(){this.frame=document.createElement("DIV");this.frame.id=this.cssClass;this.frame.className=this.cssClass;this.frame.innerHTML=this.message;Utilities.setUnselectable(this.frame)};deCarta.CopyrightMessage.prototype.appendThis=function(){if(!this.frame){this.build()}return this.frame};deCarta.CopyrightMessage.prototype.removeThis=function(){this.map=null;return this.frame};deCarta.CopyrightMessage.prototype.position=function(a){this.frame.style.top=(a.height-20)+"px";this.frame.style.left="1px"};function DDSShape(){this.borderColor="(0.0.0)";this.borderColorRed=0;this.borderColorGreen=0;this.borderColorBlue=0;this.borderStyle="SOLID";this.borderWidth="2";this.fillColor="(0.0.0)";this.fillColorRed=0;this.fillColorBlue=0;this.fillColorGreen=0;this.id=null;this.opacity="65";this.opacityFloat=0.65;this.strokeOpacity="65";this.strokeOpacityFloat=0.65;this.fillOpacity="65";this.fillOpacityFloat=0.65;this.map=null;this.isVisible=true;this.rendering=null}DDSShape.prototype.inside=null;DDSShape.prototype.setBorderColor=function(b){if(!b.match(/\([0-9]+\.[0-9]+\.[0-9]+\)/)){throw new Exception("Error setting RGB value in DDSShape.setBorderColor. Please use format (255.255.255)");return}this.borderColor=b;var a=b.replace("(","").replace(")","").split(".");this.borderColorRed=parseInt(a[0],10);this.borderColorGreen=parseInt(a[1],10);this.borderColorBlue=parseInt(a[2],10)};DDSShape.prototype.getBorderColor=function(){return this.borderColor};DDSShape.prototype.setBorderStyle=function(a){if(a=="SOLID"||a=="DASH"||a=="DOT"||a=="DASHDOTDOT"||a=="ALTBLACKDASH"||a=="RAIL"||a=="NONE"){this.borderStyle=a}else{throw new Exception("Error setting border style value in DDSShape.setBorderStyle. Please use format SOLID, DASH, DOT, DASHDOTDOT, ALTBLACKDASH, RAIL, NONE");return}};DDSShape.prototype.getBorderStyle=function(){return this.borderStyle};DDSShape.prototype.setBorderWidth=function(a){this.borderWidth=a};DDSShape.prototype.getBorderWidth=function(){return this.borderWidth};DDSShape.prototype.setFillColor=function(b){if(!b.match(/\([0-9]+\.[0-9]+\.[0-9]+\)/)){throw new Exception("Error setting RGB value in DDSShape.setColor. Please use format (255.255.255)");return}this.fillColor=b;var a=b.replace("(","").replace(")","").split(".");this.fillColorRed=parseInt(a[0],10);this.fillColorGreen=parseInt(a[1],10);this.fillColorBlue=parseInt(a[2],10)};DDSShape.prototype.getFillColor=function(){return this.fillColor};DDSShape.prototype.getId=function(){return this.id};DDSShape.prototype.setOpacity=function(a){var b=parseInt(a,10)/100;if(isNaN(b)){throw new Exception("DDSShape.prototype.setOpacity: invalid argument of: "+a)}this.opacity=a;this.opacityFloat=b;this.strokeOpacityFloat=b;this.fillOpacityFloat=b};DDSShape.prototype.getOpacity=function(){return this.opacity};DDSShape.prototype.setStrokeOpacity=function(a){var b=parseInt(a,10)/100;if(isNaN(b)){throw new Exception("DDSShape.prototype.setStrokeOpacity: invalid argument of: "+a)}this.strokeOpacity=a;this.strokeOpacityFloat=b};DDSShape.prototype.getStrokeOpacity=function(){return this.strokeOpacity};DDSShape.prototype.setFillOpacity=function(a){var b=parseInt(a,10)/100;if(isNaN(b)){throw new Exception("DDSShape.prototype.setStrokeOpacity: invalid argument of: "+a)}this.fillOpacity=a;this.fillOpacityFloat=b};DDSShape.prototype.getFillOpacity=function(){return this.fillOpacity};DDSShape.prototype.hide=function(){if(this.isVisible==true){this.isVisible=false;if(this.map){if(this.map.getShapeRendering()=="client"){this.map.redraw()}else{this.map.reDrawMap()}}}};DDSShape.prototype.show=function(){if(this.isVisible==false){this.isVisible=true;if(this.map){if(this.map.getShapeRendering()=="client"){this.map.redraw()}else{this.map.reDrawMap()}}}};DDSShape.prototype.equals=function(a){if(a&&this.id==a.id){return true}else{return false}};DDSShape.getMercPixels=function(e,m){if(this.mercPixels[e]){return(this.mercPixels[e])}var a=this.positions;if(this.generalize){a=Utilities.generalize(a,e,10,m);this.generalized[e]=a}var f=Utilities.radsPerPixelAtZoomLevel(m,e);var k=a.length;var c=[];for(var g=0;g<k;g++){var j=(a[g]);var b=Math.round(Utilities.lat2pix(j.lat,f));var d=Math.round(Utilities.lon2pix(j.lon,f));c[g]=new PixelPoint(d,b)}this.mercPixels[e]=c;return(this.mercPixels[e])};function DDSCircle(b,a){this.id=Math.floor(Math.random()*10000000);this.type="circle";this.radius=a||new Radius(100,new UOM("M"));this.position=b}DDSCircle.prototype=new DDSShape();DDSCircle.prototype.constructor=DDSCircle;DDSCircle.prototype.setPosition=function(a){this.position=a;if(this.map!=null&&this.map.getShapeRendering()=="client"){this.map.redraw()}};DDSCircle.prototype.getPosition=function(){return this.position};DDSCircle.prototype.setRadius=function(a){this.radius=a;if(this.map!=null&&this.map.getShapeRendering()=="client"){this.map.redraw()}};DDSCircle.prototype.getRadius=function(){return this.radius};DDSCircle.prototype.inside=function(b){var a=deCarta.Math.greatCircleDist(this.position,b,this.radius.uom);if(a<this.radius.distance){return true}else{return false}};function DDSLine(a){this.id=Math.floor(Math.random()*10000000);this.type="line";this.generalize=true;this.generalized=[];this.mercPixels=[];this.positions=[];this.width=a||2;this.VR7="";this.clip=false;this.setFillColor("(0.0.0)");this.setBorderWidth("0")}DDSLine.prototype=new DDSShape();DDSLine.prototype.constructor=DDSLine;DDSLine.prototype.setColor=function(a){try{this.setBorderColor(a);this.setFillColor(a)}catch(b){throw new Exception("Error setting RGB value in DDSLine.setColor. Please use format (255.255.255)")}};DDSLine.prototype.setPositions=function(a){this.positions=a;this.generalized=[];this.mercPixels=[];if(this.map!=null&&this.map.getShapeRendering()=="client"){this.map.redraw()}};DDSLine.prototype.getPositions=function(){return this.positions};DDSLine.prototype.setWidth=function(a){this.width=a};DDSLine.prototype.getWidth=function(){return this.width};DDSLine.prototype.setVR7=function(a){this.VR7=a};DDSLine.prototype.getVR7=function(){return this.VR7};DDSLine.prototype.setGeneralize=function(a){this.generalize=a};DDSLine.prototype.getGeneralize=function(){return this.generalize};DDSLine.prototype.setClip=function(a){this.clip=(a)?true:false};DDSLine.prototype.getMercPixels=DDSShape.getMercPixels;DDSLine.prototype.getMercPixelsClipped=function(z,t,b){var G,F;var m=this.getMercPixels(z,t);var e=m.length;if(e<2){return m}var u=[];for(G=0;G<e-1;G++){u[G]=[];u[G][0]=m[G];u[G][1]=m[G+1]}var E=u.length;var I=Utilities.radsPerPixelAtZoomLevel(t,z);var f=Math.round(Utilities.lat2pix(b.maxPosition.lat,I));var A=Math.round(Utilities.lat2pix(b.minPosition.lat,I));var w=Math.round(Utilities.lon2pix(b.maxPosition.lon,I));var c=Math.round(Utilities.lon2pix(b.minPosition.lon,I));for(G=0;G<E;G++){a(u[G])}var J=[];var g=0;var H="oc";var o="oc0";var k="oc1";var B=1;var n=2;var r=4;var v=8;G=0;while(G<E){var d=u[G];if(!(d[o]|d[k])){J[g++]=d;G++;continue}else{if(d[o]&d[k]){G++;continue}else{for(F=0;F<2;F++){var C=d[H+F];var q,p;if(!C){continue}if(C&B){q=d[0].x+(d[1].x-d[0].x)*(f-d[0].y)/(d[1].y-d[0].y);p=f}else{if(C&n){q=d[0].x+(d[1].x-d[0].x)*(A-d[0].y)/(d[1].y-d[0].y);p=A}}if(C&r){q=w;p=d[0].y+(d[1].y-d[0].y)*(w-d[0].x)/(d[1].x-d[0].x)}else{if(C&v){q=c;p=d[0].y+(d[1].y-d[0].y)*(c-d[0].x)/(d[1].x-d[0].x)}}if(isNaN(q)||!isFinite(q)||isNaN(p)||!isFinite(p)){G++;break}var D=new PixelPoint(q,p);d[F]=D}a(d)}}}return J;function a(i){var N="oc";var L=1;var M=2;var K=4;var x=8;for(var j=0;j<2;j++){var y=i[j];i[N+j]=0;if(y.x>w){i[N+j]+=K}else{if(y.x<c){i[N+j]+=x}}if(y.y>f){i[N+j]=L}else{if(y.y<A){i[N+j]=M}}}}};function DDSPolygon(){this.id=Math.floor(Math.random()*10000000);this.type="polygon";this.generalize=true;this.generalized=[];this.mercPixels=[];this.positions=[];this.VR7=""}DDSPolygon.prototype=new DDSShape();DDSPolygon.prototype.constructor=DDSPolygon;DDSPolygon.prototype.setPositions=function(a){this.positions=a;if(!this.positions[this.positions.length-1].equals(this.positions[0])){this.positions.push(this.positions[0].clone())}this.generalized=[];this.mercPixels=[];if(this.map!=null&&this.map.getShapeRendering()=="client"){this.map.redraw()}};DDSPolygon.prototype.getPositions=function(){return this.positions};DDSPolygon.prototype.setVR7=function(a){this.VR7=a;if(this.map!=null){this.map.redraw()}};DDSPolygon.prototype.getVR7=function(){return this.VR7};DDSPolygon.prototype.setGeneralize=function(a){this.generalize=a};DDSPolygon.prototype.getGeneralize=function(){return this.generalize};DDSPolygon.prototype.inside=function(a){return deCarta.Math.pointInPolygon(this.positions,a)};DDSPolygon.prototype.getMercPixels=DDSShape.getMercPixels;deCarta.DOMDimensions=function(a){this.init(a)};deCarta.DOMDimensions.prototype.left=null;deCarta.DOMDimensions.prototype.top=null;deCarta.DOMDimensions.prototype.right=null;deCarta.DOMDimensions.prototype.bottom=null;deCarta.DOMDimensions.prototype.width=null;deCarta.DOMDimensions.prototype.height=null;deCarta.DOMDimensions.prototype.init=function(a){try{if(!a||(a&&!a.style)){throw new Exception("passed in element not valid")}this.width=parseInt(a.clientWidth,10);this.height=parseInt(a.clientHeight,10);this.left=parseInt(Utilities.getAbsoluteLeft(a),10);this.top=parseInt(Utilities.getAbsoluteTop(a),10);this.right=this.left+this.width;this.bottom=this.top+this.height;if(isNaN(this.width)||isNaN(this.height)||isNaN(this.left)||isNaN(this.top)||isNaN(this.right)||isNaN(this.bottom)){throw new Exception("element does not have calculable dimensions")}}catch(b){throw new Exception("DOMDimensions: Argument not applicable: "+b.message)}};function EventRegistry(){}EventRegistry.addListener=function(c,a,b){if(c.type=="map"&&(a=="rightclick"||a=="dblclick"||a=="click"||a=="mousedown"||a=="mouseout"||a=="mouseup"||a=="move"||a=="movestart"||a=="moveend"||a=="zoomend")){c.addEventListener(a,b)}else{if(c.type=="pin"&&(a=="rightclick"||a=="dblclick"||a=="click"||a=="mousedown"||a=="mouseover"||a=="mouseout"||a=="mouseup")){c.addEventListener(a,b)}else{throw new Exception(a+" is unsupported event type for "+c.type)}}};EventRegistry.clearListeners=function(b,a){b.clearListeners(a)};EventRegistry.clearInstanceListeners=function(a){a.clearInstanceListeners()};deCarta.Events={};deCarta.Events.addEvent=function(d,c,b){var a=deCarta.Events.eventKey;if(!deCarta.IdManager.checkTag(d,a)){deCarta.IdManager.setTag(d,a,deCarta.IdManager.getUniqueId())}if(d.attachEvent){if(d["e"+c+b]){return}d["e"+c+b]=b;d[c+b]=function(){d["e"+c+b](window.event)};d.attachEvent("on"+c,d[c+b])}else{if(d.addEventListener){d.addEventListener(c,b,false)}else{d["on"+c]=b}}};deCarta.Events.removeEvent=function(c,b,a){if(c.detachEvent){if(c[b+a]){c.detachEvent("on"+b,c[b+a]);c["e"+b+a]=null;c[b+a]=null}}else{if(c.removeEventListener){c.removeEventListener(b,a,false)}else{c["on"+b]=undefined}}};deCarta.Events.checkIfTarget=function(c,b){var a=deCarta.Events.eventKey;if(c&&c[a]){if(b&&(b.target||b.srcElement)){var d=b.target||b.srcElement;if(d[a]==c[a]){return true}}}return false};deCarta.Events.eventKey="deCartaEventId";(function(){if(Error){Exception=Error}else{Exception=function(b){this.message=b||"an exception has occurred";var a=this;this.toString=function(){return a.message}}}})();function FreeFormAddress(b,a){if(!b||b.toString()==""){throw new Exception("Error instantiating FreeFormAddress, invalid parameters.");return false}this.locale=a||new Locale("en","US");this.address=b;this.type="FreeForm"}FreeFormAddress.prototype.getLocale=function(){return this.locale};FreeFormAddress.prototype.toString=function(){return this.address};function GeocodedAddress(){this.position=null;this.freeFormAddress=null;this.structuredAddress=null;this.boundingBox=null;this.matchType=""}GeocodedAddress.prototype.toString=function(){return this.position+"\n"+this.freeFormAddress+"\n"+this.boundingBox+"\n"+this.matchType};function Geocoder(){this.xmlRecFac=new deCarta.XMLStringBuilder();this.returnFreeForm=true;var b=[];var a=this;this.authenticate=function(d,c){if(!d||!c||d==""||c==""){throw new Exception("Error authenticating Geocoder, invalid parameters.");return false}Credentials.clientName=d;Credentials.clientPassword=c;this.xmlRecFac.clientName=d;this.xmlRecFac.clientPassword=c};this.setConfiguration=function(c){if(!c){throw new Exception("error calling Geocoder.setConfiguration()")}Credentials.configuration=c;this.xmlRecFac.configuration=c};this.geocode=function(c,g,d){var f=Utilities.getRequestId();if(typeof g=="function"){b[f]=g}else{throw new Exception("Geocode.geocode: callBack must be a function, arg was: "+g)}var e=this.xmlRecFac.createGeocodeRequest(c,f,this.returnFreeForm);JSRequest.send(e,a.geocodeCallback,null,d)};this.reverseGeocode=function(c,g,d){var f=Utilities.getRequestId();if(typeof g=="function"){b[f]=g}else{throw new Exception("Geocode.reverseGeocode: callBack must be a function, arg was: "+g)}var e=this.xmlRecFac.createReverseGeocodeRequest(c,f);JSRequest.send(e,a.reverseGeocodeCallback,null,d)};this.reverseGeocodeCallback=function(e){var d=e.XLS.Response.requestID;var c;if(deCarta.JSONParser.parseErrors(e)){c=new Address()}else{c=deCarta.JSONParser.parseAddress(e.XLS.Response.ReverseGeocodeResponse.ReverseGeocodedLocation.Address)}if((d>=0)&&b[d]){b[d](c);b[d]=undefined}};this.geocodeCallback=function(j){var m=[];var c=[];var e=[];var g=j.XLS.Response.requestID;if(deCarta.JSONParser.parseErrors(j)){}else{if(j.XLS.Response.GeocodeResponse.GeocodeResponseList){var k;if(j.XLS.Response.GeocodeResponse.GeocodeResponseList.GeocodedAddress.length==undefined){k=[];k.push(j.XLS.Response.GeocodeResponse.GeocodeResponseList.GeocodedAddress)}else{k=j.XLS.Response.GeocodeResponse.GeocodeResponseList.GeocodedAddress}for(var d=0;d<k.length;d++){var f=new GeocodedAddress();m.push(new Position(k[d].Point.pos));f.position=new Position(k[d].Point.pos.toString());if(k[d].Address.freeFormAddress){f.freeFormAddress=new FreeFormAddress(k[d].Address.freeFormAddress);c.push(new FreeFormAddress(k[d].Address.freeFormAddress))}else{if(k[d].Address.Place){f.structuredAddress=deCarta.JSONParser.parseAddress(k[d].Address);c.push(deCarta.JSONParser.parseAddress(k[d].Address))}}if(k[d].BoundingBox){f.boundingBox=new BoundingBox(new Position(k[d].BoundingBox.pos[0].content),new Position(k[d].BoundingBox.pos[1].content))}f.matchType=k[d].GeocodeMatchCode.matchType;f.accuracy=k[d].GeocodeMatchCode.accuracy;e.push(f)}}}if((g>=0)&&b[g]){b[g](m,c,e);b[g]=undefined}}}function Icon(f,d,b,e,a,c){if(!f||(d!=0&&!d)||(b!=0&&!b)||(e!=0&&!e)||(a!=0&&!a)){throw new Exception("Error instantiating Icon, missing parameters. Icon(src,iconAnchorX,iconAnchorY,width,height) all required. The last parameter overlay is optional.")}this._previousX=null;this._previousY=null;this.src=f;this.anchorX=d;this.anchorY=b;this.width=e;this.height=a;this.overlay=c||new TextOverlay("",1,1)}Icon.prototype.getAnchorX=function(){return this.anchorX};Icon.prototype.getAnchorY=function(){return this.anchorY};Icon.prototype.getHeight=function(){return this.height};Icon.prototype.getOverlay=function(){return this.overlay};Icon.prototype.getSrc=function(){return this.src};Icon.prototype.getWidth=function(){return this.width};Icon.prototype.setAnchorX=function(a){this._previousX=this.anchorX;this.anchorX=a};Icon.prototype.setAnchorY=function(a){this._previousY=this.anchorY;this.anchorY=a};Icon.prototype.setHeight=function(a){this.height=a};Icon.prototype.setOverlay=function(a){this.overlay=a};Icon.prototype.setSrc=function(a){this.src=a};Icon.prototype.setWidth=function(a){this.width=a};deCarta.IdManager={};deCarta.IdManager.getUniqueId=function(c){var b=deCarta.IdManager.getUniqueId.seedNumber++;var a=null;if(c){a=""+c+b}else{a=b}return a};deCarta.IdManager.getUniqueId.seedNumber=10000;deCarta.IdManager.setTag=function(c,a,d){var b=deCarta.IdManager.tagDitionary;d=d||true;if(!c[b]){c[b]={}}c[b][a]=d};deCarta.IdManager.checkTag=function(c,a){var b=deCarta.IdManager.tagDitionary;if(c&&a){if(c[b]){return c[b][a]}}return undefined};deCarta.IdManager.tagDitionary="deCartaTagDictionary";function InfoWindow(b,c,e,d,a){this.init(b,c,e,d,a)}InfoWindow.prototype.xOffset=-20;InfoWindow.prototype.yOffset=0;InfoWindow.prototype.bubble=null;InfoWindow.prototype.bubbleClassName="decarta-bubble";InfoWindow.prototype.bubbleIgnoreMapEvents=false;InfoWindow.prototype.bubbleContent=null;InfoWindow.prototype.bubbleContentClassName="decarta-bubbleContent";InfoWindow.prototype.bubbleContentIgnoreMapEvents=false;InfoWindow.prototype.bubbleContentSelectable=false;InfoWindow.prototype.bubbleClose=null;InfoWindow.prototype.bubbleCloseClassName="decarta-close";InfoWindow.prototype.bubbleCloseIgnoreMapEvents=true;InfoWindow.prototype.associatedPin=null;InfoWindow.prototype.onCloseCallback=null;InfoWindow.prototype.onHideCallback=null;InfoWindow.prototype.onShowCallback=null;InfoWindow.prototype.shouldAutoCenter=false;InfoWindow.prototype.setAutoCenter=function(a){a=a||false;this.shouldAutoCenter=a};InfoWindow.prototype.setOnClose=function(a){this.onCloseCallback=a};InfoWindow.prototype.setOnHide=function(a){this.onHideCallback=a};InfoWindow.prototype.setOnShow=function(a){this.onShowCallback=a};InfoWindow.prototype.setIgnoreMapEvents=function(b){for(var a in b){if(b.hasOwnProperty(a)){this[a]=b[a]}}this.resetMapEventIgnorance()};InfoWindow.prototype.setContentSelectable=function(a){this.bubbleContentSelectable=a;this.resetSelectability()};InfoWindow.prototype.init=function(d,e,g,f,b){var c;this.build();if(d){this.bubble=d;this.bubble.id="decarta-bubble";this.bubbleContent.style.position="absolute";this.bubble.appendChild(this.bubbleContent);if(this.bubbleClose){this.bubble.appendChild(this.bubbleClose)}}if(b){this.bubble.style.width=b.width+"px";this.bubble.style.height=b.height+"px";this.bubble.style.backgroundImage="url("+b.src+")";this.bubble.style.backgroundRepeat="no-repeat";this.bubble.style.backgroundColor="transparent";this.bubble.style.borderStyle="none"}if(f){if(!this.bubbleClose){this.buildCloseIcon(f.src)}this.bubbleClose.style.position="absolute";this.bubbleClose.style.top=f.anchorY+"px";this.bubbleClose.style.left=f.anchorX+"px";if(f.height){this.bubbleClose.style.height=f.height+"px"}if(f.width){this.bubbleClose.style.width=f.width+"px"}}if(e){this.xOffset=e}if(g){this.yOffset=g}if(Utilities.ie6){var a=this.bubble.getElementsByTagName("img");for(c=0;c<a.length;c++){if(a[c].src.match(/\bpng\b/g)){Utilities.fixPng(a[c])}}}};InfoWindow.prototype.build=function(){try{this.bubble=document.createElement("div");this.bubble.id=this.bubbleClassName;this.bubble.className=this.bubbleClassName;this.bubbleContent=document.createElement("div");this.bubbleContent.id=this.bubbleContentClassName;this.bubbleContent.className=this.bubbleContentClassName;if(Credentials.infoWindowCloseButton){this.buildCloseIcon(Credentials.infoWindowCloseButton)}this.bubble.appendChild(this.bubbleContent)}catch(a){throw new Exception("build error:"+a.message)}};InfoWindow.prototype.buildCloseIcon=function(a){this.bubbleClose=document.createElement("img");if(a){this.bubbleClose.src=a}this.bubbleClose.id=this.bubbleCloseClassName;this.bubbleClose.className=this.bubbleCloseClassName;this.bubbleClose.owner=this;deCarta.Events.addEvent(this.bubbleClose,"click",InfoWindow.eventClose);this.bubble.appendChild(this.bubbleClose)};InfoWindow.prototype.setPosition=function(b,a){a=a||0;b=b||0;this.bubble.style.top=a-this.yOffset+"px";this.bubble.style.left=b-this.xOffset+"px"};InfoWindow.prototype.setContent=function(a){if(a){this.bubbleContent.innerHTML=a}else{this.bubbleContent.innerHTML=""}this.resetSelectability();this.resetMapEventIgnorance()};InfoWindow.prototype.resetSelectability=function(){var d=(this.bubbleContentSelectable)?Utilities.setSelectable:Utilities.setUnselectable;var a=this.bubbleContent;d(a);if(a.hasChildNodes()){var b=a.getElementsByTagName("*");for(var c=0;c<b.length;c++){d(b[c])}}};InfoWindow.prototype.resetMapEventIgnorance=function(){var d,c,e,b,a;if(this.bubbleIgnoreMapEvents){deCarta.IdManager.setTag(this.bubble,"ignoreForMapEvents");if(this.bubble.hasChildNodes()){b=this.bubble.childNodes;for(d=0;d<b.length;d++){e=b[d];if(e.id!=this.bubbleContentClassName&&e.id!=this.bubbleCloseClassName){a=e.getElementsByTagName("*");for(c=0;c<a.length;c++){deCarta.IdManager.setTag(a[c],"ignoreForMapEvents")}}}}}if(this.bubbleContentIgnoreMapEvents){deCarta.IdManager.setTag(this.bubbleContent,"ignoreForMapEvents");a=this.bubbleContent.getElementsByTagName("*");for(d=0;d<a.length;d++){deCarta.IdManager.setTag(a[d],"ignoreForMapEvents")}}if(this.bubbleCloseIgnoreMapEvents&&this.bubbleClose){deCarta.IdManager.setTag(this.bubbleClose,"ignoreForMapEvents")}};InfoWindow.prototype.show=function(a){this.bubble.style.zIndex=Pin.zIndexCounter+10000;this.bubbleContent.style.zIndex=Pin.zIndexCounter+10000;if(this.bubbleClose){this.bubbleClose.style.zIndex=Pin.zIndexCounter+10000}this.bubble.style.display="block";if(a){this.associatedPin=a}else{this.associatedPin=null}if(this.onShowCallback){this.onShowCallback()}this.autoCenter()};InfoWindow.prototype.hide=function(){this.bubble.style.display="none";if(this.onHideCallback){this.onHideCallback()}};InfoWindow.prototype.autoCenter=function(){var o=this.associatedPin;if(!(o&&o.map)||!this.shouldAutoCenter){return}var B=o.map;var i=o.pinImg.clientHeight;var q=o.pinImg.clientWidth;var z=parseInt(o.pinImg.style.top);var E=parseInt(o.pinImg.style.left);var F=Utilities.radsPerPixelAtZoomLevel(B.getTileSize(),B.getZoomController().selected);var t=o.getViewableBoundingBox(F);var D=t.getUpperLeftPosition();var v=B.posToMercPix(D);var A=new PixelPoint(v.x+q,v.y-i);var y=this.bubble.clientHeight;var x=this.bubble.clientWidth;var p=parseInt(this.bubble.style.top);var w=parseInt(this.bubble.style.left);var r=v.y+(z-p);var c=v.x-(E-w);var b=new PixelPoint(c,r);var n=new PixelPoint(c+x,r-y);var m=Math.max(v.y,b.y);var a=Math.min(A.y,n.y);var f=Math.max(A.x,n.x);var C=Math.min(v.x,b.x);var k=new PixelPoint(f,a);var d=new PixelPoint(C,m);var u=B.mercPixToPos(k);var e=B.mercPixToPos(d);var g=new BoundingBox(e,u);var j=g.getCenterPosition();B.panToPosition(j)};InfoWindow.eventClose=function(){var a=this.owner;if(a.onCloseCallback){a.onCloseCallback()}a.hide()};deCarta.JSONParser={};deCarta.JSONParser.parseAddress=function(d){var b=new Address();var a=d.Place;if(d.Place&&d.Place.length){for(var c=0;c<a.length;c++){e(b,a[c])}}else{if(d.Place&&d.Place.type){e(b,a)}}b.postalCode=(d.PostalCode)?d.PostalCode:"";b.countryCode=d.countryCode;if(d.StreetAddress&&d.StreetAddress.Street){b.street=d.StreetAddress.Street.content||((typeof d.StreetAddress.Street=="string")?d.StreetAddress.Street:"");b.speedLimit=d.StreetAddress.Street.speedLimit||"";if(d.StreetAddress.Building){b.buildingNumber=d.StreetAddress.Building.number}}return b;function e(g,f){switch(f.type){case"CountrySubdivision":g.countrySubdivision=f.content;break;case"CountrySecondarySubdivision":g.countrySecondarySubdivision=f.content;break;case"CountryTertiarySubdivision":g.countryTertiarySubdivision=f.content;break;case"MunicipalitySubdivision":g.municipalitySubdivision=f.content;break;case"Municipality":g.municipality=f.content;break;case"Landmark":g.landmark=f.content;break}}};deCarta.JSONParser.parsePOI=function(q){var f=q.POI.POIAttributeList.POIInfoList.POIInfo;var m={};for(var d=0;d<f.length;d++){var j=f[d];var i;for(var g in j){if(g=="name"){i=j[g]}else{if(g=="value"){m[i]=j[g]}}}}if(q.POI.ID){m.ID=q.POI.ID}var c=q.POI.POIName;var r=q.POI.phoneNumber;var k=q.POI.Point.pos;var b=q.Distance.value;var a=q.Distance.uom;var o=deCarta.JSONParser.parseAddress(q.POI.Address);var e=new POI(c,new Position(k),o,r,m);e.distance={value:parseInt(b),uom:new UOM(a)};return e};deCarta.JSONParser.parseRoutes=function(e){var d;var c=e.XLS.Response.DetermineRouteResponse;var b=f(c);if(c.AlternateRoute){var j=c.AlternateRoute;var a=j.length;if(a==undefined){b.alternates[0]=f(j)}else{for(d=0;d<a;d++){b.alternates[d]=f(j[d])}}}return b;function f(q){var w=new Route();var o=q.RouteSummary;w.TotalTime=Utilities.podParse(o.TotalTime);w.TotalTimeObject=Utilities.podParseJSON(o.TotalTime);w.TotalDistance=o.TotalDistance.value;w.uom=new UOM(o.TotalDistance.uom);var n=o.BoundingBox;if(n){var p=new Position(n.pos[0].content);var r=new Position(n.pos[1].content);w.boundingBox=new BoundingBox(p,r);w.centerPosition=w.boundingBox.getCenterPosition()}var x=q.RouteHandle;if(x&&x.routeID){w.routeID=x.routeID}var t=q.viaPointSequence;if(t){w.viaPointSequence=t}var v=q.RouteGeometry;if(v){var m=v.LineString.pos;var u=m.length;if(u==undefined){w.RouteGeometry[0]=new Position(m)}else{for(d=0;d<u;d++){w.RouteGeometry[d]=new Position(m[d])}}}var i=q.RouteInstructionsList;if(i){var k=i.RouteInstruction;var y=k.length;if(y==undefined){w.RouteInstructions[0]=g(k)}else{for(d=0;d<y;d++){w.RouteInstructions[d]=g(k[d])}}}return w}function g(k){var i=new RouteInstruction();i.Instruction=k.Instruction;i.distance=k.distance.value;i.duration=Utilities.podParse(k.duration);i.position=new Position(k.Point);i.tour=k.tour;return i}};deCarta.JSONParser.parseErrors=function(b){var a=(b.XLS.ResponseHeader.ErrorList)?true:false;return a};deCarta.JSONViewer=function(){deCarta.StyleManager.init();var i=0;var b="";var f=false;var d=0;var a="decarta-json-reflector";var e="decarta-json-type";var g="decarta-json-relation";var j="decarta-json-string";var c="decarta-json-number";this.reflect=function(w){var o;if(!f){i++}if(typeof(w)==="string"){r(null,w);return}else{if(typeof(w)==="number"){v(null,w);return}else{if(typeof(w)==="boolean"){D(null,w);return}else{if(typeof(w)==="null"){A(null,w);return}else{if(typeof(w)==="undefined"){u(null,w);return}else{if(f){if(Object.prototype.toString.call(w)==="[object Array]"){z(null,w);o=d;d=0;for(var E=0;E<w.length;E++){d++;this.reflect(w[E])}d=o;return}else{q(null);f=false;this.reflect(w);f=true;return}}else{for(var k in w){if(typeof(w[k])==="string"){r(k,w[k])}else{if(typeof(w[k])==="number"){v(k,w[k])}else{if(typeof(w[k])==="boolean"){D(k,w[k])}else{if(typeof(w[k])==="null"){A(k,w[k])}else{if(typeof(w[k])==="undefined"){u(k,w[k])}else{if(Object.prototype.toString.call(w[k])==="[object Array]"){z(k,w[k]);f=true;o=d;d=0;for(var C=0;C<w[k].length;C++){d++;this.reflect(w[k][C])}d=o;f=false}else{q(k);this.reflect(w[k])}}}}}}}}}}}}}i--;function r(t,G){var n;if(t){n=x("string ")+t+F()+y(G)}else{n=x("string ")+y(G)}m(n)}function v(t,G){var n;if(t){n=x("number ")+t+F()+B(G)}else{n=x("number ")+B(G)}m(n)}function D(t,G){var n;if(t){n=x("boolean ")+t+F()+B(G)}else{n=x("boolean ")+B(G)}m(n)}function A(t,G){var n;if(t){n=x("null ")+t+F()+B(G)}else{n=x("null ")+B(G)}m(n)}function u(t,G){var n;if(t){n=x("undefined ")+t+F()+B(G)}else{n=x("undefined ")+B(G)}m(n)}function z(t,G){var n;if(t){n=x("array ")+t+" ("+G.length+")"}else{n=x("array ")+" ("+G.length+")"}m(n)}function q(t){var n;if(t){n=x("object ")+t}else{n=x("object ")}m(n)}function x(n){return"<span class='"+e+"'>"+n+"</span>"}function F(){return"<span class='"+g+"'> = </span>"}function y(n){return"<span class='"+j+"'>\""+n+'"</span>'}function B(t){return"<span class='"+c+"'>"+t+"</span>"}function m(n){if(f){b+=p()+"["+d+"]"+n+"\n"}else{b+=p()+n+"\n"}}function p(){var t="";for(var n=0;n<i;n++){t+="\t"}return t}};this.show=function(){var k;k=document.getElementById(a);if(!k){k=document.createElement("pre");k.id=a;document.body.appendChild(k)}k.innerHTML+=b};this.clear=function(){b="";document.getElementById(a).innerHTML=""}};function JSRequest(){}JSRequest.host=null;JSRequest.TIMEOUT=60000;JSRequest.tHandler=function(a){throw new Exception("JSRequest timeout on requestID: "+a)};JSRequest.qtHandler=[];JSRequest.xmlhttp=true;JSRequest.hostInProgress=false;JSRequest.holder=[];JSRequest.callbackFunctions=[];JSRequest.interceptorXMLHTTPRequest=null;JSRequest.interceptorXMLRequest=null;JSRequest.interceptorJSONResponse=null;JSRequest.registerXMLHTTPRequestInterceptor=function(a){JSRequest.interceptorXMLHTTPRequest=a};JSRequest.registerXMLRequestInterceptor=function(a){JSRequest.interceptorXMLRequest=a};JSRequest.registerQueryTimeoutHandler=function(b,a){JSRequest.qtHandler[b]=a};JSRequest.registerJSONResponseInterceptor=function(a){JSRequest.interceptorJSONResponse=a};JSRequest.callbackRegistry=function(a){if(GLOBALS.DEBUG_JSON&&a){if(!window.jsonViewer){window.jsonViewer=new deCarta.JSONViewer()}window.jsonViewer.reflect(a);window.jsonViewer.show()}try{if(a&&(a.response!=null)){if(typeof JSRequest.interceptorJSONResponse==="function"){a.response=JSRequest.interceptorJSONResponse(a.response)}if(JSRequest.callbackFunctions[a.requestID]){if(deCarta.Array.isArray(a.response.XLS.Response)){if(a.response.XLS.Response[0].requestID==-1){a.response.XLS.Response[0].requestID=a.requestID}}else{if(a.response.XLS.Response.requestID==-1){a.response.XLS.Response.requestID=a.requestID}}JSRequest.callbackFunctions[a.requestID](a.response);JSRequest.callbackFunctions[a.requestID]=undefined;JSRequest.qtHandler[a.requestID]=undefined}}if(document.getElementById(a.requestID+":"+a.chunkNo)){document.getElementsByTagName("head").item(0).removeChild(document.getElementById(a.requestID+":"+a.chunkNo))}}catch(b){throw new Exception(b.message)}};JSRequest.checkTimeout=function(c){var b=(c.split(":"))[0];if(JSRequest.callbackFunctions[b]||JSRequest.qtHandler[b]){JSRequest.host=null;JSRequest.tHandler(b);if(typeof JSRequest.qtHandler[b]=="function"){JSRequest.qtHandler[b](b);JSRequest.qtHandler[b]=undefined}JSRequest.callbackFunctions[b]=undefined;var a=document.getElementById(c);if(a){document.getElementsByTagName("head").item(0).removeChild(a)}}};JSRequest.timeoutHandler=function(b,a){JSRequest.tHandler=b;JSRequest.TIMEOUT=a||60000};JSRequest.send=function(e,j,u,n,m){if(!e){return}var k=u?"responseFormat="+u:(typeof JSRequest.interceptorXMLRequest==="function"||typeof JSRequest.interceptorXMLResponse==="function")?"responseFormat=ALL":"responseFormat=JSON";var g=(m)?m:Credentials.url;if((/\/openls$|\/openls\/$/.test(g))&&!m){g=g.substring(0,Credentials.url.lastIndexOf("openls"))+Credentials.jsonServletName}if(JSRequest.xmlhttp){JSRequest.sendXHR(e,j,k,g);return}if(JSRequest.host==null&&!m){JSRequest.holder.push(e);JSRequest.holder.push(j);JSRequest.holder.push(u);JSRequest.holder.push(n);if(JSRequest.hostInProgress){return}JSRequest.hostInProgress=true;n=JSRequest.getHostTimeout;var b=new deCarta.XMLStringBuilder();var c=b.createRUOKRequest(Utilities.getRequestId());e=c;j=JSRequest.getHost;k="responseFormat=JSON"}if(typeof JSRequest.interceptorXMLRequest==="function"&&JSRequest.host!=null){e=JSRequest.interceptorXMLRequest(Utilities.normalizePrefixes(e))}var w=1800;var z=g.length;var a=80;var y=(encodeURIComponent(e)).length;var p;var x=1;while(true){if(z+a+(y/x)<w){p=x;break}x++}var r="";var A=Math.ceil(e.length/p);var t=Utilities.parseRequestIDFromXLS(e);var q=0;for(x=1;x<=p;x++){JSRequest.callbackFunctions[t]=j;JSRequest.qtHandler[t]=n;var f;if(q==0){f=Math.round(A*x-A)}else{f=q}var d=Math.round(A*x);q=d;var o=e.substring(f,d);r=encodeURIComponent(o);var B=document.createElement("script");B.setAttribute("type","text/javascript");var v=g+"?reqID="+t+"&chunkNo="+x+"&numChunks="+p+"&callback=JSRequest.callbackRegistry&data="+r+"&"+k;v=v.replace(new RegExp("\\+","g"),"%2b");B.setAttribute("src",v);B.setAttribute("id",t+":"+x);document.getElementsByTagName("head").item(0).appendChild(B);if(JSRequest.TIMEOUT!=-1){setTimeout("JSRequest.checkTimeout('"+t+":"+x+"')",JSRequest.TIMEOUT)}}};JSRequest.sendXHR=function(xml,callback,responseFormat,url){try{if(!Utilities.ie){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(e){}}var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",url+"?"+responseFormat,true)}catch(e){throw new Exception(e.message+"Depending on your browser settings you may have troubles running JavaScript code that uses the XMLHTTPRequest from your local file system.  XMLHTTPRequest verifies that the request to the server is from a script that is downloaded from that same server.  To remedy this problem, place your app inside tomcat and access from localhost.  Or see the feature of using dynamic script tags (JSON/GET) to bypass this security issue.")}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(xmlhttp.responseText==""){throw new Exception("Problem connecting to DDS Web Services: Please try again later or contact support")}if(xmlhttp.responseText&&xmlhttp.responseText!=null&&xmlhttp.responseText.indexOf("problem connecting to DDS")>0){throw new Exception("Problem connecting to DDS: Please try again later or contact support")}var r=eval(("("+xmlhttp.responseText+")"));if(typeof JSRequest.interceptorJSONResponse==="function"){r.response=JSRequest.interceptorJSONResponse(r.response)}if(r.response){callback(r.response)}else{callback(r)}}};if(typeof JSRequest.interceptorXMLHTTPRequest==="function"){JSRequest.interceptorXMLHTTPRequest(xmlhttp)}xmlhttp.send(xml);return};JSRequest.getHost=function(f){var d=f.XLS.Response.RUOKResponse.hostName;var a=Credentials.url;var e,g;if(a.indexOf("https://")>-1){e="https://"}else{e="http://"}var c=a.substring(e.length);if(c.indexOf(":")>-1){g=c.substring(c.indexOf(":"))}else{g=c.substring(c.indexOf("/"))}JSRequest.host=e+d+g;Credentials.url=JSRequest.host;for(var b=0;b<JSRequest.holder.length;b++){JSRequest.send(JSRequest.holder[b],JSRequest.holder[b+1],JSRequest.holder[b+2],JSRequest.holder[b+3]);b=b+3}JSRequest.holder=[];JSRequest.hostInProgress=false};JSRequest.getHostTimeout=function(b){for(var a=0;a<JSRequest.holder.length;a++){if(typeof JSRequest.holder[a+3]=="function"){JSRequest.holder[a+3](null)}a=a+3}JSRequest.holder=[];JSRequest.hostInProgress=false};JSRequest.setXMLHTTPMode=function(){JSRequest.xmlhttp=true};JSRequest.setDynamicScriptTagMode=function(){JSRequest.xmlhttp=false};deCarta.LinkedList=function(){this.length=0;this.head=null;this.index=deCarta.LinkedList.Config.genIndex()};deCarta.LinkedList.Config={};deCarta.LinkedList.Config.itemBackPointer="dCLLItemPointer";deCarta.LinkedList.Config.itemBackPointerIndex=0;deCarta.LinkedList.Config.genIndex=function(){return(deCarta.LinkedList.Config.itemBackPointer+deCarta.LinkedList.Config.itemBackPointerIndex++)};deCarta.LinkedList.prototype.add=function(a){var b=null;try{b=new deCarta.LinkedListItem(a,this.index)}catch(c){throw new Exception("Error LinkedList.add(): "+c.message)}if(!this.head){this.head=b;this.head.next=null;this.head.prev=null}else{this.head.prev=b;b.next=this.head;b.prev=null;this.head=b}this.length++};deCarta.LinkedList.prototype.remove=function(b){var c=null;var a=null;if(this.length<=0){return null}if(!b){c=this.head;this.head=c.next}else{if((b.data)&&b.data.hasOwnProperty(this.index)){c=b}else{if(b.hasOwnProperty(this.index)){c=b[this.index]}else{throw new Exception("Attempting to remove an item that's not really a part of the LinkedList.")}}}if(c.prev){c.prev.next=c.next}else{this.head=c.next}if(c.next){c.next.prev=c.prev}a=c.destroy(this.index);this.length--;return a};deCarta.LinkedList.prototype.removeByKey=function(f,b){var e;var d=this.length;var a=this.head;var c;var g=new Array();if(!f||!b){throw new Exception("Attempt to removeByKey keyName: "+f+" and keyVal: "+b)}if(this.length<=0){return null}for(e=0;e<d;e++){c=a;a=c.next;if(b==c.data[f.toString()]){g.push(this.remove(c))}}if(!g.length){return null}else{return g}};deCarta.LinkedList.prototype.removeById=function(c,g){var f;var e=this.length;var b=this.head;var d;var a=null;if(!c||!g){throw new Exception("Attempt to removeByKey keyName: "+c+" and keyVal: "+g)}if(this.length<=0){return null}for(f=0;f<e;f++){d=b;b=d.next;if(g==d.data[c.toString()]){a=this.remove(d);return a}}return null};deCarta.LinkedList.prototype.removeAll=function(){var a=[];var b=null;while(this.length>0){b=this.remove();a.push(b)}return a};deCarta.LinkedList.prototype.returnAsArray=function(){var a=[];var b;var d=this.head;var c=null;for(b=0;b<this.length;b++){a.push(d.data);c=d.next;d=c}return a};deCarta.LinkedList.prototype.operateOnData=function(a){var b;var d=this.head;var c=null;if(typeof a!="function"){throw new Exception("Attempt operateOnData without a function.")}for(b=0;b<this.length;b++){a(d.data);c=d.next;d=c}};deCarta.LinkedListItem=function(b,a){if(!b||(typeof b!="object")||!a){throw new Exception("LinkedList Error: Attempt to add null or primitive.")}if(b.hasOwnProperty(a)){throw new Exception("LinkedList Error: newData already containsproperty backpointer: "+a)}this.data=b;b[a]=this;this.next=null;this.prev=null};deCarta.LinkedListItem.prototype.destroy=function(b){var a=this.data;this.data=null;this.next=null;this.prev=null;delete a[b];return a};function Locale(b,a){this.language=b.toUpperCase();this.country=a.toUpperCase()}Locale.prototype.getLanguage=function(){return this.language};Locale.prototype.setLanguage=function(a){this.language=a.toUpperCase()};Locale.prototype.getCountry=function(){return this.country};Locale.prototype.setCountry=function(a){this.country=a.toUpperCase()};Locale.prototype.toString=function(){return this.country+"_"+this.language};function Map(E){deCarta.StyleManager.init();if(!(E&&E.style)){throw new Exception("Must supply a div element to construct the map.")}this.mapDiv=E;var b=parseInt(deCarta.StyleManager.getCurrentStyle(E,"height"));b=(!isNaN(b))?b:this.mapDiv.offsetHeight;b=(b)?b+"px":GLOBALS.DEFAULT_MAP_HEIGHT;this.mapDiv.style.height=b;var aA=parseInt(deCarta.StyleManager.getCurrentStyle(E,"width"));aA=(!isNaN(aA))?aA:this.mapDiv.offsetWidth;aA=(aA)?aA+"px":GLOBALS.DEFAULT_MAP_WIDTH;this.mapDiv.style.width=aA;this.type="map";var at=this;var a={};var V=undefined;var ax=null;var v=null;var P=null;var C=null;var ak=null;var aH=new deCarta.XMLStringBuilder();aH.mapType=GLOBALS.STREET;var aK="server";var ay=false;var e=[];var F=new Array();var L=new deCarta.LinkedList();var j={};var av=null;var J=null;var c=Utilities.ie;var u="px";var am=0;var T=true;var az=false;var R=0;var O=0;var D=false;var ap=false;var aF=0;var aD=0;var p=false;var G=true;var Z=true;var ah=new Date();var S=new Date();var d=false;var ac=false;var aC=false;var f=37;var Q=null;var x=GLOBALS.DEFAULT_MAP_TILE_SIZE;var g=x;var ab=0;var aE=0;var w=2;var X=false;var al=new PixelPoint(0,0);var aq=0;var an=0;var au=0;var ar=0;var aI=0;var ao=0;var aa=0;var Y=0;this.authenticate=function(aM,aL){if(!aM||!aL||aM==""||aL==""){throw new Exception("Error calling Map.authenticate(), bad params")}Credentials.clientName=aM;Credentials.clientPassword=aL;aH.clientName=aM;aH.clientPassword=aL};this.setURL=function(aL){Credentials.url=aL};this.setConfiguration=function(aL){if(!aL){throw new Exception("error calling Map.setConfiguration() with argument: "+aL)}Credentials.configuration=aL;aH.configuration=aL};this.setTransparentConfiguration=function(aL){if(!aL){throw new Exception("error calling Map.setTransparentConfiguration() with arg: "+aL)}Credentials.transparentConfiguration=aL;aH.transparentConfiguration=aL};this.setMapStyle=function(aL){Credentials.configuration=aL;aH.configuration=aL;if(j[GLOBALS.STREET]&&j[GLOBALS.STREET].refUrl){j[GLOBALS.STREET].refUrl.setParameter("config",aL);j[GLOBALS.STREET].refresh()}};this.setMapFormat=function(aL){aH.streetImgFormat=aL;if(j[GLOBALS.STREET]&&j[GLOBALS.STREET].refUrl){j[GLOBALS.STREET].refUrl.setParameter("format",aL);j[GLOBALS.STREET].refresh()}};this.changeCurrentMapStyle=function(aL){setMapStyle(aL)};this.reDrawMap=function(aL){if(!j[GLOBALS.STREET]&&!j[GLOBALS.SATELLITE]&&!j[GLOBALS.HYBRID]){return false}at.centerOnPosition(at.getCenterPosition(),aL);return true};this.addCopyrightMessage=function(aM,aL,aN){if(deCarta.String.isString(aM)){ax=new deCarta.CopyrightMessage(aM)}else{ax=aM}at.addMapControl(ax);if(aL&&aN){ax.position=function(){};ax.frame.style.top=aN+u;ax.frame.style.left=aL+u}};this.centerOnPosition=function(aL,aP,aN){var aQ=Utilities.getRequestId();if(typeof aP=="function"){e[aQ]=aP}else{e[aQ]=null}var aO=Utilities.getRequestId();var aM=aH.createMapRequest(aL,x,aQ,v?v.getZoomLevel():5,null,aN,aO);JSRequest.send(aM,function(aR){Q=aL.clone();I();at.hidePinsBeforeZoom();W(aR)},null,function(aR){e[aR]=undefined})};this.panToPosition=function(aS,aP){var aL=aS.clone();var aO=at.getCenterPosition();var aR=this.posToMercPix(aO);var aN=this.posToMercPix(aL);var aM=new PixelPoint(Math.round(aR.x-aN.x),Math.round(aR.y-aN.y));if(Q&&v.getRadius()){var aQ=Utilities.centerContextToBoundingBox(aO,v.getRadius());if(aQ.extendedContains(aL)){if(typeof aP=="function"){e.panToPosition=aP}else{e.panToPosition=null}if(aM.x==0&&aM.y==0){if(e.panToPosition){e.panToPosition(at.getCenterPosition());e.panToPosition=undefined}return}else{t(aM.x,-1*aM.y)}}else{this.centerOnPosition(aL,aP)}}else{this.centerOnPosition(aL,aP)}};this.getCenterPosition=function(){if(!Q){throw new Exception("Center Position not set")}var aN=au-aI;var aM=ar-ao;if(aN==0&&aM==0){return Q}var aL=at.posToMercPix(Q);aL.x-=aN;aL.y+=aM;var aO=at.mercPixToPos(aL);return aO};this.addCustomInfoWindow=function(aL){if(J&&ak){J.removeChild(ak.bubble)}ak=aL;if(J){J.appendChild(ak.bubble)}};this.getInfoWindow=function(){var aL=ak||null;return aL};this.addAndCenterOnPin=function(aL){this.addPin(aL);this.panToPosition(aL.position)};this.addPin=function(aL){if(Q==null){throw new Exception("Error adding Pin, you can not add a pin until the center Position is set. Please use the callback of map.centerPosition().")}try{L.add(aL)}catch(aM){return}aL.map=at;aL.setPosition(aL.position);J.appendChild(aL.pinImg);if(aL.pinTxt){J.appendChild(aL.pinTxt)}};this.getPins=function(){return L.returnAsArray()};this.getPinById=function(aM){var aL=null;L.operateOnData(function(aN){if(!aN){return null}if(aN.getId()==aM){aL=aN}});return aL};this.hidePins=function(){L.operateOnData(function(aL){if(!aL){return}aL.pinImg.style.display="none";aL.pinTxt.style.display="none"})};this.showPins=function(){L.operateOnData(function(aL){aL.pinImg.style.display="block";aL.pinTxt.style.display="block"})};this.removeAllPins=function(){var aL;while(L.length>0){aL=L.remove();if(c){Utilities.purge(aL.pinImg)}J.removeChild(aL.pinImg);aL.pinImg=null;if(aL.pinTxt){if(c){Utilities.purge(aL.pinTxt)}J.removeChild(aL.pinTxt);aL.pinTxt=null}}};this.removePin=function(aM){var aL=null;try{aL=L.remove(aM)}catch(aN){return}if(!aL){return}aL.destroy()};this.removePinById=function(aN){try{var aL=L.removeById("id",aN)}catch(aM){return}if(!aL){return}if(aL.pinTxt){Utilities.purge(aL.pinTxt);J.removeChild(aL.pinTxt);aL.pinTxt=null}Utilities.purge(aL.pinImg);J.removeChild(aL.pinImg)};this.removePinsById=function(aP){var aL=null;var aN=null;var aM;try{aL=L.removeByKey("id",aP)}catch(aO){return}if(!aL){return}for(aM=0,aN=aL.length;aM<aN;aM++){if(aL[aM].pinTxt){Utilities.purge(aL[aM].pinTxt);J.removeChild(aL[aM].pinTxt);aL[aM].pinTxt=null}Utilities.purge(aL[aM].pinImg);J.removeChild(aL[aM].pinImg)}};this.setDragEnabled=function(aL){if(!"boolean"==(typeof aL)){throw new Exception("Map.setDragEnabled requires boolean")}T=aL};this.setShapeClippingEnabled=function(aL){if(!"boolean"==(typeof aL)){throw new Exception("Map.setShapeClippingEnabled requires boolean")}ay=aL};this.setDoubleClickRecenteringEnabled=function(aL){if(!"boolean"==(typeof aL)){throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean")}Z=aL};this.setDoubleClickRecenterAndZoom=function(aL){if(aL){ac=true}else{ac=false}};this.setDigitalZoomEnabled=function(aL){if(aL){G=true}else{G=false}};this.setPanTimeoutDelay=function(aL){f=aL||37};this.addOverlay=function(aL){if(deCarta.Array.isArray(aL)){var aN=aL.length;for(var aM=0;aM<aN;aM++){aL[aM].map=at;aH.overlays.push(aL[aM])}}else{aL.map=at;aH.overlays.push(aL)}ag()};this.getOverlays=function(){var aM=[];var aN=aH.overlays.length;for(var aL=0;aL<aN;aL++){aM[aL]=aH.overlays[aL]}return aM};this.removeOverlay=function(aL){aL.map=null;var aN=new Array();for(var aM=0;aM<aH.overlays.length;aM++){if(aH.overlays[aM]&&!aH.overlays[aM].equals(aL)){aN.push(aH.overlays[aM])}}aH.overlays=aN;if(aN.length==0){ag(true)}else{ag()}};this.removeOverlayById=function(aN){var aM=new Array();for(var aL=0;aL<aH.overlays.length;aL++){if(aH.overlays[aL]&&aH.overlays[aL].id!=(aN)){aM.push(aH.overlays[aL])}else{aH.overlays[aL].map=null}}aH.overlays=aM;if(aM.length==0){ag(true)}else{ag()}};this.removeAllOverlays=function(){if(aH&&aH.overlays&&(aH.overlays.length<=0)){return}aH.overlays=[];ag(true)};this.addRouteIDOverlay=function(aL){aH.routeIDOverlay=aL};this.removeRouteIDOverlay=function(){aH.routeIDOverlay=null};this.setShapeRendering=function(aL){if(!aL||!aL=="client"||!aL=="server"){throw new Exception("map.setShapeRendering() error: use 'client' or 'server'")}if(aL=="server"){ae()}else{ag()}aK=aL;aH.rendering=aL};this.getShapeRendering=function(){return aK};this.redraw=function(){ag()};this.panWest=function(){t(GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panEast=function(){t(-GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panNorth=function(){t(0,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouth=function(){t(0,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthEast=function(){t(-GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthEast=function(){t(-GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthWest=function(){t(GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthWest=function(){t(GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.addScaleBar=function(aL){V=aL;at.addMapControl(V)};this.addMapTypeController=function(aL){if(!aL){throw new Exception("error adding mapTypeController to map")}C=aL;at.addMapControl(C)};this.setMapType=function(aM){if(!(aM==GLOBALS.STREET||aM==GLOBALS.HYBRID||aM==GLOBALS.SATELLITE)){throw new Exception("unsupported mapType. Use '"+GLOBALS.STREET+"' || '"+GLOBALS.HYBRID+"' || '"+GLOBALS.SATELLITE+"'")}aH.mapType=aM;var aL=false;if(!j||Utilities.isObjectEmpty(j)){return}if(aM==GLOBALS.STREET){if(j[GLOBALS.HYBRID]){j[GLOBALS.HYBRID].hide()}if(j[GLOBALS.SATELLITE]){j[GLOBALS.SATELLITE].hide()}if(!j[GLOBALS.STREET]){K(GLOBALS.STREET);aL=true}else{j[GLOBALS.STREET].show()}}else{if(aM==GLOBALS.HYBRID){if(j[GLOBALS.STREET]){j[GLOBALS.STREET].hide()}if(!j[GLOBALS.SATELLITE]){K(GLOBALS.SATELLITE);aL=true}else{j[GLOBALS.SATELLITE].show()}if(!j[GLOBALS.HYBRID]){K(GLOBALS.HYBRID);aL=true}else{j[GLOBALS.HYBRID].show()}}else{if(aM==GLOBALS.SATELLITE){if(j[GLOBALS.HYBRID]){j[GLOBALS.HYBRID].hide()}if(j[GLOBALS.STREET]){j[GLOBALS.STREET].hide()}if(!j[GLOBALS.SATELLITE]){K(GLOBALS.SATELLITE);aL=true}else{j[GLOBALS.SATELLITE].show()}}}}if(aL){this.centerOnPosition(at.getCenterPosition())}};this.addZoomController=function(aL){v=aL;at.addMapControl(v);if(P){v.frame.style.top="61px";v.frame.style.left="21px"}};this.addPanController=function(aL){P=aL;at.addMapControl(P);if(v){v.frame.style.top="61px";v.frame.style.left="21px"}};this.getZoomController=function(){return v};this.getPanController=function(){return P};this.resize=function(aU,aL,aS){var aO=parseInt(at.mapDiv.style.width);var aT=parseInt(at.mapDiv.style.height);at.mapDiv.style.height=parseInt(aU)+u;at.mapDiv.style.width=parseInt(aL)+u;at.positionMapControls();if(!J){return}aE=Math.ceil(parseInt(aU)/x)+w;if(aE%2==0){aE++}ab=Math.ceil(parseInt(aL)/x)+w;if(ab%2==0){ab++}for(var aP in j){if(j.hasOwnProperty(aP)){var aR=j[aP];aR.resize(ab,aE)}}var aN=au-aI-(parseInt(aL)-aO)/2;var aM=ar-ao-(parseInt(aU)-aT)/2;var aQ=at.posToMercPix(Q);aQ.x-=aN;aQ.y+=aM;Q=at.mercPixToPos(aQ);aI=au;ao=ar;if(typeof aS=="function"){aS(at.getCenterPosition())}};this.getBoundingBox=function(){var aO=at.posToMercPix(at.getCenterPosition());var aM=(aE*x/2);var aS=(ab*x/2);var aP=new PixelPoint(aO.x+aS,aO.y+aM);var aQ=new PixelPoint(aO.x-aS,aO.y-aM);var aL=at.mercPixToPos(aP);var aN=at.mercPixToPos(aQ);var aR=new BoundingBox(aN,aL);return aR};this.getBoundingBoxViewable=function(){var aN=at.posToMercPix(at.getCenterPosition());var aM=parseInt(at.mapDiv.style.height)/2;var aS=parseInt(at.mapDiv.style.width)/2;var aQ=new PixelPoint(aN.x+aS,aN.y+aM);var aP=new PixelPoint(aN.x-aS,aN.y-aM);var aR=at.mercPixToPos(aQ);var aL=at.mercPixToPos(aP);var aO=new BoundingBox(aL,aR);return aO};this.setOnlyLoadTilesInViewport=function(aL){X=(aL)?true:false};this.getOnlyLoadTilesInViewport=function(){return X};this.getGridSize=function(){return aE+" "+ab};this.setTileBuffer=function(aL){if(aL){w=2}else{w=1}};this.setTileBorder=function(aM){if(aM){am=1}else{am=0}for(var aN in j){if(j.hasOwnProperty(aN)){if(j[aN].tileArray){for(var aO=0;aO<aE;++aO){for(var aL=0;aL<ab;++aL){j[aN].tileArray[aL][aO].border=am}}}}}};this.getTileSize=function(){return x};this.setTileSize=function(aL){x=parseInt(aL,10);g=x;if(J){p=true}};this.positionToMapLayerPixel=function(aR){if(!aR||!Q){throw new Exception("Map.positionToMapLayerPixel: bad input: "+aR)}var aN=at.posToMercPix(at.getCenterPosition());var aL=parseInt(at.mapDiv.style.height)/2;var aQ=parseInt(at.mapDiv.style.width)/2;var aO=new PixelPoint(aN.x-aQ+au,aN.y+aL-ar);var aM=this.posToMercPix(aR);var aP=new PixelPoint(-(aO.roundX()-aM.roundX()),(aO.roundY()-aM.roundY()));return aP};this.addMapControl=function(aO){if(!aO){throw new Exception("adding invalid control to map.")}else{if(!aO.type||aO.map){throw new Exception("adding invalid control to map, with properties type:"+aO.type+" map:"+aO.map)}}var aM=aO.type;if(this.existsMapControl(aM)){this.removeMapControl(aM)}a[aM]=aO;aO.map=this;var aL=aO.appendThis();if(aL){this.getMapDiv().appendChild(aL)}var aN=new deCarta.DOMDimensions(this.getMapDiv());aO.position(aN)};this.existsMapControl=function(aL){if(a[aL]){return true}else{return false}};this.removeMapControl=function(aL){if(!aL||!(aL&&a[aL])){return}var aM=a[aL];a[aL]=undefined;this.getMapDiv().removeChild(aM.removeThis());Utilities.purge(aM)};this.positionMapControls=function(){var aL;var aM=new deCarta.DOMDimensions(this.getMapDiv());for(aL in a){if(a.hasOwnProperty(aL)&&a[aL].position){a[aL].position(aM)}}};this.getMapLayers=function(){return j};this.hide=function(){this.getMapDiv().style.display="none"};this.show=function(){this.getMapDiv().style.display="block";this.positionMapControls()};this.setCompatibility=function(aM,aL){switch(aM){case"restrictDragToDiv":if(aL){this.addEventListener("mouseout",r)}else{this.clearListeners("mouseout")}break;default:throw new Exception("Map.setCompatibility: illegal flag: "+aM.toString()+" passed in as argument.");break}};function m(){ak=new InfoWindow()}this.addEventListener=function(aN,aO){var aM=false;for(var aL=0;aL<F.length;aL++){if(F[aL]==aN){F[aN]=aO;aM=true;break}}if(!aM){F.push(aN);F[aN]=aO}};this.clearInstanceListeners=function(){for(var aL=0;aL<F.length;aL++){F[F[aL]]=null;F[aL]=null}};this.clearListeners=function(aM){for(var aL=0;aL<F.length;aL++){if(F[aL]==aM){F[F[aL]]=null;F[aL]=null}}};function af(aN){if(!GLOBALS.ALLOWDOMEVENTS){return true}aN=aN?aN:window.event;var aL;if(aN.target){aL=aN.target}else{if(aN.srcElement){aL=aN.srcElement}}if(aL&&aL.nodeType==3){aL=aL.parentNode}if(deCarta.IdManager.checkTag(aL,"ignoreForMapEvents")){return true}if(aN.type=="mouseup"){if(F.mouseup){var aO=new PixelPoint(aN.clientX,aN.clientY);var aM=at.screenPixToPos(aO);F.mouseup(aM)}r(aN);S=new Date()}else{if(aN.type=="dblclick"){M(aN)}else{if(aN.type=="click"&&((S-ah)<300)){z(aN)}}}}function z(aN){aN=aN?aN:window.event;var aL;if(aN.target){aL=aN.target}else{if(aN.srcElement){aL=aN.srcElement}}if(aL&&aL.nodeType==3){aL=aL.parentNode}if(deCarta.IdManager.checkTag(aL,"ignoreForMapEvents")){return false}at.mapDiv.style.cursor="pointer";at.mapDiv.unselectable="on";var aO=new PixelPoint(aN.clientX,aN.clientY);var aM=at.screenPixToPos(aO);if(F.rightclick&&(c&&aN.button==2)||(!c&&aN.which==3)){F.rightclick(aM);return}if(F.dblclick&&aN.type=="dblclick"){F.dblclick(aM);return}if(F.click&&aN.type=="click"){F.click(aM)}}function N(aN){if(!GLOBALS.ALLOWDOMEVENTS){return true}aN=aN?aN:window.event;if((!c&&aN.which==3)||(c&&aN.button==2)){if(F.rightclick){z(aN)}return true}if((!c&&aN.which==2)||(c&&aN.button==4)){return true}var aL;if(aN.target){aL=aN.target}else{if(aN.srcElement){aL=aN.srcElement}}if(aL&&aL.nodeType==3){aL=aL.parentNode}if(deCarta.IdManager.checkTag(aL,"ignoreForMapEvents")){return true}ah=new Date();if(F.mousedown){var aO=new PixelPoint(aN.clientX,aN.clientY);var aM=at.screenPixToPos(aO);F.mousedown(aM)}az=true;at.mapDiv.style.cursor="move";R=aN.clientX;O=aN.clientY;document.body.onmousemove=q;window.onmouseup=r;return false}function r(aL){az=false;at.mapDiv.style.cursor="default";document.body.onmousemove=null;window.onmouseup=null;if(aC&&F.moveend){F.moveend();aC=false}if(V){V.calculate()}for(var aM in j){if(j.hasOwnProperty(aM)){j[aM].showTilesInViewport()}}ad();return false}function M(aR){var aP;if(aR.target){aP=aR.target}else{if(aR.srcElement){aP=aR.srcElement}}if(aP&&aP.nodeType==3){aP=aP.parentNode}if(deCarta.IdManager.checkTag(aP,"ignoreForMapEvents")){return false}d=true;if(F.dblclick){z(aR)}if(!Z){return}var aS=aR.clientX;var aQ=aR.clientY;var aM=Utilities.getAbsoluteLeft(at.mapDiv)-Utilities.getScrollLeft();var aL=Utilities.getAbsoluteTop(at.mapDiv)-Utilities.getScrollTop();var aO=(parseInt(aS-aM)-Math.round(parseInt(at.mapDiv.style.width)/2))*-1;var aN=(parseInt(aQ-aL)-Math.round(parseInt(at.mapDiv.style.height)/2))*-1;t(aO,aN)}function q(aO){var aP;var aN;aO=aO?aO:window.event;if(!aC){if(F.movestart){F.movestart()}}if(F.move){aP=new PixelPoint(aO.clientX,aO.clientY);aN=at.screenPixToPos(aP);F.move(aN)}if(!T){if(aO.type=="mouseup"&&F.mouseup){aP=new PixelPoint(aO.clientX,aO.clientY);aN=at.screenPixToPos(aP);F.mouseup(aN);r(aO)}return false}aC=true;if(!az){return false}var aM=aO.clientX-R;var aL=aO.clientY-O;aa+=aM;Y+=aL;if(Math.abs(aa)>g||Math.abs(Y)>g){aG()}au+=aM;ar+=aL;aj(au,ar);R=aO.clientX;O=aO.clientY;return false}function A(aN){if(!GLOBALS.ALLOWDOMEVENTS){return true}if(!aN){aN=window.event}var aM=aN.target?aN.target:aN.srcElement;var aL=(aN.relatedTarget)?aN.relatedTarget:aN.toElement;try{if(aL&&aM&&(aL.id==aM.id)){return true}}catch(aN){}if(F.mouseout){F.mouseout()}}this.getMapDiv=function(){return at.mapDiv};this.getBubble=function(){return ak};this.getChooser=function(){return C};this.getCopyright=function(){return ax};this.getTileDiv=function(){return J};this.getZoomLck=function(){return D};this.loaded=function(){return(J?true:false)};this.hidePinsBeforeZoom=function(){L.operateOnData(function(aL){if(aL){aL.zoomHide()}})};this.showPinsAfterZoom=function(){L.operateOnData(function(aL){if(aL){aL.zoomShow()}})};function aB(){L.operateOnData(function(aL){if(!aL){return}aL.setPosition(aL.position);aL.hideInfoWindow()});at.showPinsAfterZoom()}function ad(){L.operateOnData(function(aM){if(!aM){return}var aN=aM.setPosition(aM.position);if(aN){var aL=aM.map.getInfoWindow();var aO=(aL)?aL.associatedPin:null;if(aL&&aO&&aO.equals(aM)){aM.hideInfoWindow();aM.showInfoWindow()}}});at.showPinsAfterZoom()}this.zoomMap=function(aM,aP){if(!j[GLOBALS.STREET]&&!j[GLOBALS.SATELLITE]&&!j[GLOBALS.HYBRID]){return false}if(D){return false}if(typeof aP=="function"){e.zoomMap=aP}else{e.zoomMap=null}var aO=v.selected;if(aO==aM){if(e.zoomMap){e.zoomMap();e.zoomMap=undefined}return false}var aN=at.getCenterPosition();var aQ=Utilities.getRequestId();v.setZoomLevel(aM);at.hidePinsBeforeZoom();D=true;if(G&&(Math.abs(aO-aM)<=2)){if(!av){n()}if((aH&&aH.mapType=="HYBRID")||(!aH.mapType&&Credentials.mapType=="HYBRID")){j[GLOBALS.HYBRID].hide()}for(var aR in j){if(j.hasOwnProperty(aR)){j[aR].zoom(aO-aM,av,aa,Y)}}}var aL=aH.createMapRequest(aN,x,aQ,aO,aM,null,Utilities.getRequestId());I();JSRequest.send(aL,o);return true};function aw(){return false}this.setCountryCode=function(aL){if(!aL){throw new Exception("error calling Map.setCountryCode()")}Credentials.ISOCountryCode=aL};this.getGXPixelPoint=function(aL){this.posToMercPix(aL)};this.posToMercPix=function(aO){var aM=Utilities.radsPerPixelAtZoom(x,v.getGXConvertedZoomLevel());var aN=Utilities.lat2pix(aO.lat,aM);var aL=Utilities.lon2pix(aO.lon,aM);return new PixelPoint(aL,aN)};this.mercPixToPos=function(aL){var aO=Utilities.radsPerPixelAtZoom(x,v.getGXConvertedZoomLevel());var aM=Utilities.pix2lat(aL.y,aO);var aN=Utilities.pix2lon(aL.x,aO);return new Position(aM,aN)};this.screenPixToPos=function(aO){var aP=aO.y-Utilities.getAbsoluteTop(at.mapDiv)+Utilities.getScrollTop();var aM=aO.x-Utilities.getAbsoluteLeft(at.mapDiv)+Utilities.getScrollLeft();var aR=at.posToMercPix(at.getCenterPosition());var aS=aR.x-(parseInt(at.mapDiv.style.width)/2);var aT=aR.y+(parseInt(at.mapDiv.style.height)/2);var aN=new PixelPoint(aS,aT);var aQ=new PixelPoint(aN.x+aM,aN.y-aP);var aL=at.mercPixToPos(aQ);return aL};function W(aN){var aS=aN.XLS.Response.requestID;var aX,aL;var aU=aN.XLS.Response.PortrayMapResponse.TileGrid[0].Pan;var aO;if(deCarta.JSONParser.parseErrors(aN)){aO=null}else{for(var aP=0;aP<aU.length;aP++){if(aU[aP].direction=="E"){al.x=parseFloat(aU[aP].numTiles)*x;aL=aU[aP].toLon}else{al.y=-parseFloat(aU[aP].numTiles)*x;aX=aU[aP].toLat}}var aV=aN.XLS.Response.PortrayMapResponse.TileGrid[0].CenterContext.CenterPoint.pos.content;var aR=aN.XLS.Response.PortrayMapResponse.TileGrid[1].CenterContext.CenterPoint.pos.content;if(!aX&&!aL){Q=new Position(aV)}else{Q=new Position(aX,aL)}var aM=aN.XLS.Response.PortrayMapResponse.TileGrid[0].CenterContext.Radius.content;v.setRadius((parseFloat((aM))/1000)*ab);var aQ=0;try{aQ=parseInt(aN.XLS.Response.PortrayMapResponse.TileGrid[0].GridLayer.maxImageHostAliases,10)}catch(aT){}var aW=[aN.XLS.Response.PortrayMapResponse.TileGrid[0].Tile.Map.Content.URL,aN.XLS.Response.PortrayMapResponse.TileGrid[1].Tile.Map.Content.URL];k(aW,aQ);aB();aO=at.getCenterPosition()}if((aS>=0)&&e[aS]){e[aS](aO);e[aS]=undefined}}function o(aL){W(aL);D=false;if(F.zoomend){F.zoomend()}if(e.zoomMap){e.zoomMap();e.zoomMap=undefined}}function k(aL,aP){if(V){V.calculate()}U();aP=aP||0;var aO=new deCarta.MapLayerReferenceUrl((aL[1]));aO.createGlobeXplorerUrl();var aM=new deCarta.MapLayerReferenceUrl((aL[0]),aP);aM.createDeCartaTransparentUrl();aM.setParameter("config",aH.transparentConfiguration);var aN=new deCarta.MapLayerReferenceUrl((aL[0]),aP);aN.createDeCartaUrl();aN.setParameter("config",aH.configuration);if(j[GLOBALS.SATELLITE]){j[GLOBALS.SATELLITE].populate(aO)}if(j[GLOBALS.HYBRID]){j[GLOBALS.HYBRID].populate(aM)}if(j[GLOBALS.STREET]){j[GLOBALS.STREET].populate(aN)}aa-=al.x;Y-=al.y;ag()}function I(){if(!J){aJ();return}}function aJ(){var aL="decarta-mapviewport";if(!at.mapDiv.className){at.mapDiv.className=aL}else{at.mapDiv.className+=" "+aL}Utilities.setUnselectable(at.mapDiv);at.mapDiv.oncontextmenu=aw;at.mapDiv.onmousedown=N;at.mapDiv.onmouseout=A;at.mapDiv.onmouseup=af;at.mapDiv.ondblclick=af;at.mapDiv.onclick=af;J=document.createElement("div");var aM="decarta-tiles";J.id=aM;J.className=aM;J.style.top=0+u;J.style.left=0+u;Utilities.setUnselectable(J);at.mapDiv.appendChild(J);if(!v){v=new ZoomController();at.addMapControl(v);v.hide()}if(!ak){m()}J.appendChild(ak.bubble);B()}function B(){if(j[GLOBALS.SATELLITE]||j[GLOBALS.HYBRID]||j[GLOBALS.STREET]){throw new Exception("buildDefaultTileGrid called on existing tile grid")}if(aH.mapType==GLOBALS.STREET){K(GLOBALS.STREET)}else{if(aH.mapType==GLOBALS.HYBRID){K(GLOBALS.HYBRID)}else{if(aH.mapType==GLOBALS.SATELLITE){K(GLOBALS.SATELLITE)}}}}function K(aM){if(aM!=GLOBALS.SATELLITE&&aM!=GLOBALS.HYBRID&&aM!=GLOBALS.STREET){throw new Exception("initDefaultMapLayer called with bad value: "+aM)}var aN=parseInt(at.mapDiv.style.height);var aL=parseInt(at.mapDiv.style.width);aE=Math.ceil(aN/x)+w;if(aE%2==0){aE++}ab=Math.ceil(aL/x)+w;if(ab%2==0){ab++}aq=-((ab*x)-aL)/2;an=-((aE*x)-aN)/2;if(aM==GLOBALS.SATELLITE){j[GLOBALS.SATELLITE]=new deCarta.MapLayer(ab,aE,aq,an,x,"decarta-satellite",1,at);j[GLOBALS.SATELLITE].show();j[GLOBALS.SATELLITE].appendTiles(J);return}else{if(aM==GLOBALS.HYBRID){if(!j[GLOBALS.SATELLITE]){j[GLOBALS.SATELLITE]=new deCarta.MapLayer(ab,aE,aq,an,x,"decarta-satellite",1,at);j[GLOBALS.SATELLITE].show();j[GLOBALS.SATELLITE].appendTiles(J)}j[GLOBALS.HYBRID]=new deCarta.MapLayer(ab,aE,aq,an,x,"decarta-transparent",2,at);j[GLOBALS.HYBRID].show();j[GLOBALS.HYBRID].appendTiles(J);return}else{if(aM==GLOBALS.STREET){j[GLOBALS.STREET]=new deCarta.MapLayer(ab,aE,aq,an,x,"decarta-street",3,at);j[GLOBALS.STREET].show();j[GLOBALS.STREET].appendTiles(J);return}}}}function n(){av=new deCarta.ZoomLayer(ab,aE,x);av.appendTiles(J)}function H(){if(!J){throw new Exception("resizeMap called without an existing map.")}for(var aL in j){if(j.hasOwnProperty(aL)){j[aL].hide();j[aL].destroy();j[aL]=undefined}}j={};J.style.top=0+u;J.style.left=0+u;B();au=0;ar=0;R=0;O=0;az=false;aa=0;Y=0}function U(){aI=au;ao=ar;var aN=parseInt(at.mapDiv.style.height);var aM=parseInt(at.mapDiv.style.width);aE=Math.ceil(aN/x)+w;if(aE%2==0){aE++}ab=Math.ceil(aM/x)+w;if(ab%2==0){ab++}aq=-((ab*x)-aM)/2;an=-((aE*x)-aN)/2;for(var aO in j){if(j.hasOwnProperty(aO)){j[aO].reset(-au-al.x,-ar-al.y,aq,an)}}var aL=[];if(aH.mapType==GLOBALS.STREET){aL.push(j[GLOBALS.STREET])}else{if(aH.mapType==GLOBALS.HYBRID){aL.push(j[GLOBALS.SATELLITE]);aL.push(j[GLOBALS.HYBRID])}else{if(aH.mapType==GLOBALS.SATELLITE){aL.push(j[GLOBALS.SATELLITE])}else{throw new Exception("Map.reset: encountered unexpected _xmlRecFac.mapType of "+aH.mapType)}}}y(aL);R=0;O=0;az=false;aa=0;Y=0}function y(aT){var aP=aT;var aN=aP.length;var aQ;if(!D||!G){for(aQ=0;aQ<aN;aQ++){aP[aQ].show()}return}for(aQ=0;aQ<aN;aQ++){aP[aQ].delayedLoading=true}var aL=250;var aR=ab*aE;var aS=aR*0.8;var aM=6;setTimeout(aO,aL);function aO(){if(aP[0].numTilesLoaded>=aS||aM<=0){for(aQ=0;aQ<aN;aQ++){aP[aQ].show();aP[aQ].delayedLoading=false}if(av){av.hide()}return}aM--;setTimeout(aO,aL)}}function aG(){var aL;if(aa<=-g){aa=aa+g;for(aL in j){if(j.hasOwnProperty(aL)){j[aL].rotateTiles(0,1)}}ag()}else{if(aa>=g){aa=aa-g;for(aL in j){if(j.hasOwnProperty(aL)){j[aL].rotateTiles(0,-1)}}ag()}}if(Y<=-g){Y=Y+g;for(aL in j){if(j.hasOwnProperty(aL)){j[aL].rotateTiles(-1,0)}}ag()}else{if(Y>=g){Y=Y-g;for(aL in j){if(j.hasOwnProperty(aL)){j[aL].rotateTiles(1,0)}}ag()}}}function aj(aL,aM){J.style.left=aL+u;J.style.top=aM+u}function t(aL,aM){if(ap){return}if(aL>1){J.style.left=parseInt(J.style.left)+1+u}else{if(aL<-1){J.style.left=parseInt(J.style.left)-1+u}}if(aM>1){J.style.top=parseInt(J.style.top)+1+u}else{if(aM<-1){J.style.top=parseInt(J.style.top)-1+u}}ap=true;i(aL,aM,true)}function i(aL,aQ,aP){if(aP){aF=aL;aD=aQ}var aN=Math.round(Math.abs(aF)*0.3);var aM=Math.round(Math.abs(aD)*0.3);if(aN>0||aM>0){if(aF<0){aF+=aN;aa-=aN;au-=aN}else{if(aF>0){aF-=aN;aa+=aN;au+=aN}}if(aD<0){aD+=aM;Y-=aM;ar-=aM}else{if(aD>0){aD-=aM;Y+=aM;ar+=aM}}aj(au,ar);if(Math.abs(aa)>g||Math.abs(Y)>g){aG()}setTimeout(i,f)}else{if(F.moveend){F.moveend()}if(e.panToPosition){e.panToPosition(at.getCenterPosition());e.panToPosition=undefined}if(V){V.calculate()}if(d&&ac){at.getZoomController().zoomInOneLevel()}ap=false;d=false;ag();for(var aO in j){if(j.hasOwnProperty(aO)){j[aO].showTilesInViewport()}}ad()}}function ai(){if(!at.getTileDiv()){return null}var aL=document.getElementById("canvas");if(aL){aL.style.position="relative";aL.style.zIndex=100;at.getTileDiv().appendChild(aL)}else{aL=document.getElementsByTagName("body")[0].appendChild(document.createElement("canvas"));aL.id="canvas";if(typeof G_vmlCanvasManager!="undefined"){aL=G_vmlCanvasManager.initElement(aL)}aL.style.position="relative";aL.style.zIndex=100;at.getTileDiv().appendChild(aL)}return aL}function ae(){if(aK=="server"){return}var aM=ai();var aL=aM.getContext("2d");aL.clearRect(0,0,aM.width,aM.height)}function ag(a3){a3=a3||false;if(aH.overlays.length==0&&!a3){return}if(ap||!at.getTileDiv()){return}var aN=ai();var be,bd;var bf=at.getGridSize().split(" ");var bg=parseInt(bf[1])*x;var a8=parseInt(bf[0])*x;aN.width=bg;aN.height=a8;var bk=at.mapDiv;var aM=-(bg-parseInt(bk.style.width))/2;var aL=-(a8-parseInt(bk.style.height))/2;var a7=J;aN.style.left=aM-parseInt(a7.style.left)+u;aN.style.top=aL-parseInt(a7.style.top)+u;var aS=aN.getContext("2d");aS.lineCap="round";aS.lineJoin="round";var a5=v.getZoomLevel();var aP=Utilities.radsPerPixelAtZoomLevel(x,a5);var aR=at.getBoundingBox();var aO=new Position(aR.maxPosition.lat+" "+aR.minPosition.lon);var aT=Math.round(Utilities.lat2pix(aO.lat,aP));var aU=Math.round(Utilities.lon2pix(aO.lon,aP));var bl=aH.overlays;for(var a2=0;a2<bl.length;a2++){var aQ=bl[a2];if(aQ.rendering=="server"||(aK=="server"&&aQ.rendering!="client")){continue}if(!aQ.isVisible){continue}aS.lineWidth=aQ.getBorderWidth();aS.fillStyle="rgba("+aQ.fillColorRed+","+aQ.fillColorGreen+","+aQ.fillColorBlue+","+aQ.fillOpacityFloat+")";aS.strokeStyle="rgba("+aQ.borderColorRed+","+aQ.borderColorGreen+","+aQ.borderColorBlue+","+aQ.strokeOpacityFloat+")";var aW=[];aS.beginPath();if(aQ.type=="polygon"||aQ.type=="line"){var bj=[];var bi=[];if(aQ.type=="line"){aS.lineWidth=aQ.getWidth();if(aQ.clip||ay){aW=aQ.getMercPixelsClipped(a5,x,aR)}else{aW[0]=aQ.getMercPixels(a5,x)}}else{if(aQ.type=="polygon"){aW[0]=aQ.getMercPixels(a5,x)}else{throw new Exception("Map inner function draw: fell through to unacceptable situation with line/polygon client side rendering.")}}var aV=aW.length;for(be=0;be<aV;be++){var a1=aW[be].length;bj[be]=[];bi[be]=[];for(bd=0;bd<a1;bd++){var bb=aW[be][bd];bj[be][bd]=parseInt(aU-bb.x);bi[be][bd]=parseInt(aT-bb.y);if(bd==0){aS.moveTo((bj[be][bd]*-1),(bi[be][bd]))}else{aS.lineTo((bj[be][bd]*-1),(bi[be][bd]))}}}aS.stroke();if(aQ.type=="line"){continue}if(!c){aS.fill()}else{aS.beginPath();var bh=bj.length;for(be=0;be<bh;be++){var ba=bj[be].length;for(bd=0;bd<ba;bd++){if(bd==0){aS.moveTo((bj[be][bd]*-1),(bi[be][bd]))}else{aS.lineTo((bj[be][bd]*-1),(bi[be][bd]))}}}aS.closePath();aS.fill()}}else{if(aQ.type=="circle"){var a0=aQ.getPosition();var aX=Math.round(Utilities.lat2pix(a0.lat,aP));var aZ=Math.round(Utilities.lon2pix(a0.lon,aP));var a6=parseInt(aU-aZ);var a4=parseInt(aT-aX);var a9=aQ.getRadius().getDegrees();var bc=Math.round(Utilities.lat2pix(a0.lat+a9,aP));var aY=parseInt(bc-aX);aS.arc((a6*-1),a4,Math.abs(aY),0,Math.PI*2,true);aS.fill();if(!c){aS.stroke()}else{aS.arc((a6*-1),a4,Math.abs(aY),0,Math.PI*2,true);aS.stroke()}}}}}}deCarta.MapLayer=function(b,i,e,g,f,d,c,a){this.init(b,i,e,g,f,d,c,a)};deCarta.MapLayer.prototype.owner=null;deCarta.MapLayer.prototype.onlyLoadTilesInViewport=false;deCarta.MapLayer.prototype.xTiles=null;deCarta.MapLayer.prototype.yTiles=null;deCarta.MapLayer.prototype.xOffset=0;deCarta.MapLayer.prototype.yOffset=0;deCarta.MapLayer.prototype.leftIndex=0;deCarta.MapLayer.prototype.topIndex=0;deCarta.MapLayer.prototype.tileSize=null;deCarta.MapLayer.prototype.layerName="mapLayer";deCarta.MapLayer.prototype.cssClass="decarta-maptile";deCarta.MapLayer.prototype.cssZIndex=0;deCarta.MapLayer.prototype.tileArray=null;deCarta.MapLayer.prototype.srcOnHidden=null;deCarta.MapLayer.prototype.srcOnError=null;deCarta.MapLayer.prototype.isVisible=false;deCarta.MapLayer.prototype.numTilesLoaded=0;deCarta.MapLayer.prototype.delayedLoading=false;deCarta.MapLayer.prototype.refUrl=null;deCarta.MapLayer.prototype.init=function(d,i,f,b,k,e,c,a){var j,g;this.xTiles=d;this.yTiles=i;this.xOffset=f;this.yOffset=b;this.tileSize=k;if(e){this.layerName=e}if(c){this.cssZIndex=c}this.owner=a;this.onlyLoadTilesInViewport=this.owner.getOnlyLoadTilesInViewport();this.tileArray=[];this.setDefaultSrc();for(j=0;j<this.xTiles;j++){this.tileArray[j]=[];for(g=0;g<this.yTiles;g++){this.tileArray[j][g]=this.mapTileFactory(j,g)}}};deCarta.MapLayer.prototype.setDefaultSrc=function(){if(!Utilities.ie6){this.srcOnHidden=Credentials.transparentPNG;this.srcOnError=Credentials.transparentPNG}else{this.srcOnHidden=Credentials.transparentGIF;this.srcOnError=Credentials.transparentGIF}};deCarta.MapLayer.prototype.mapTileOnError=function(b){var a;if(!b){a=window.event.srcElement}else{a=b.currentTarget}if(a&&a.src&&a.srcOnError){a.src=a.srcOnError}};deCarta.MapLayer.prototype.mapTileFactory=function(a,e){var d=Math.floor(this.xTiles/2);var b=Math.floor(this.yTiles/2);var c=document.createElement("IMG");c.ownerLayer=this;c.fromCenterX=a-d;c.fromCenterY=b-e;c.className=this.cssClass;if(this.srcOnHidden){c.altSrc=this.srcOnHidden;c.src=this.srcOnHidden}else{c.altSrc="";c.src=""}c.style.display="none";c.style.zIndex=this.cssZIndex;c.style.height=this.tileSize+"px";c.style.width=this.tileSize+"px";c.onerror=this.mapTileOnError;c.style.left=(a*this.tileSize)+this.xOffset+"px";c.style.top=(e*this.tileSize)+this.yOffset+"px";Utilities.setUnselectable(c);c.coords=new Object();c.coords.ul=null;c.coords.ur=null;c.coords.lr=null;c.coords.ll=null;c.tileViewed=false;c.setTileCoords=deCarta.MapLayer.setTileCoords;c.isTileInViewPort=deCarta.MapLayer.isTileInViewPort;c.setSrc=deCarta.MapLayer.setSrc;if(Utilities.ie6){c.loader=document.createElement("img");c.loader.owner=c;c.loader.loadTile=function(){this.owner.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')";this.owner.src=Credentials.transparentGIF;this.owner.ownerLayer.numTilesLoaded++;return true};c.loader.onload=c.loader.loadTile;c.onload=function(){c.style.display="block"}}else{c.loader=document.createElement("img");c.loader.owner=c;c.loader.loadTile=function(){this.owner.src=this.src;this.owner.ownerLayer.numTilesLoaded++;return true};c.loader.onload=c.loader.loadTile;c.onload=function(){this.style.display="block"}}return c};deCarta.MapLayer.prototype.showTilesInViewport=function(){if(this.onlyLoadTilesInViewport){for(var a=0;a<this.xTiles;a++){for(var c=0;c<this.yTiles;c++){var b=this.tileArray[a][c];if(!b.tileViewed){b.setSrc(b.altSrc)}}}}};deCarta.MapLayer.setSrc=function(a){this.altSrc=a;if(this.ownerLayer.isVisible||this.ownerLayer.delayedLoading){if(this.ownerLayer.onlyLoadTilesInViewport&&!this.isTileInViewPort()){this.tileViewed=false;if(this.ownerLayer.srcOnHidden){this.src=this.ownerLayer.srcOnHidden}else{this.style.display="none"}}else{this.tileViewed=true;if(this.ownerLayer.srcOnHidden){this.src=this.ownerLayer.srcOnHidden;this.loader.src=a}else{this.style.display="none";this.src=a}}}};deCarta.MapLayer.setTileCoords=function(a){if(!a){return}var d=a.dynamicProps;var v=d.llMin.split(",");var t=parseInt(d.northing,10);var w=parseInt(d.easting,10);var k=this.ownerLayer;var x=k.owner;var q=x.getZoomController().getZoomLevel();var m=x.getTileSize();var y=Utilities.radsPerPixelAtZoomLevel(m,q);var z=new Position(parseFloat(v[0]),parseFloat(v[1]));var f=Math.round(Utilities.lat2pix(z.lat,y));var c=Math.round(Utilities.lon2pix(z.lon,y));var p=f+(t*m)+(this.fromCenterY*m);var i=c+(w*m)+(this.fromCenterX*m);var j=p+k.tileSize;var b=i+k.tileSize;var u=Utilities.pix2lat(p,y);var g=Utilities.pix2lon(i,y);var o=Utilities.pix2lat(j,y);var r=Utilities.pix2lon(b,y);this.coords.ul=new Position(o,g);this.coords.ur=new Position(o,r);this.coords.lr=new Position(u,r);this.coords.ll=new Position(u,g)};deCarta.MapLayer.isTileInViewPort=function(){var c;var d=this.coords;var f=this.ownerLayer.owner.getBoundingBoxViewable();var b=false;for(c in d){if(d.hasOwnProperty(c)){if(f.contains(d[c])){b=true;break}}}if(!b){var a={};a.ul=new Position(f.maxPosition.lat,f.minPosition.lon);a.ur=new Position(f.maxPosition.lat,f.maxPosition.lon);a.lr=new Position(f.minPosition.lat,f.maxPosition.lon);a.ll=new Position(f.minPosition.lat,f.minPosition.lon);var e=new BoundingBox(d.ll,d.ur);for(c in a){if(a.hasOwnProperty(c)){if(e.contains(a[c])){b=true;break}}}}if(b){return true}else{return false}};deCarta.MapLayer.prototype.appendTiles=function(b){for(var a=0;a<this.xTiles;a++){for(var c=0;c<this.yTiles;c++){b.appendChild(this.tileArray[a][c])}}};deCarta.MapLayer.prototype.hide=function(){if(!this.isVisible){return}var a,b;this.isVisible=false;for(a=0;a<this.xTiles;a++){for(b=0;b<this.yTiles;b++){this.tileArray[a][b].style.display="none"}}};deCarta.MapLayer.prototype.show=function(){if(this.isVisible){return}var a,e;this.isVisible=true;for(a=0;a<this.xTiles;a++){for(e=0;e<this.yTiles;e++){var c=this.tileArray[a][e];var b=c.altSrc.replace(/\:80/,"");var d=c.src.replace(/\:80/,"");if(b!=d&&this.refUrl){c.setSrc(c.altSrc)}c.style.display="block"}}};deCarta.MapLayer.prototype.reset=function(c,a,g,b){this.refUrl=null;if(g){this.xOffset=g}if(b){this.yOffset=b}var j,i;var f,e,d;var k="px";c=c||0;a=a||0;this.numTilesLoaded=0;this.isVisible=false;this.leftIndex=0;this.topIndex=0;this.updateFromCenterVals();for(j=0;j<this.xTiles;j++){f=this.xOffset+c+(j*this.tileSize);for(i=0;i<this.yTiles;i++){d=this.tileArray[j][i];d.tileViewed=false;d.style.display="none";e=this.yOffset+a+(i*this.tileSize);d.style.left=f+k;d.style.top=e+k}}};deCarta.MapLayer.prototype.refresh=function(){var a,c;for(a=0;a<this.xTiles;a++){for(c=0;c<this.yTiles;c++){var b=this.tileArray[a][c];b.setSrc(this.refUrl.getRelSrc(b.fromCenterY,b.fromCenterX))}}};deCarta.MapLayer.prototype.rotateTiles=function(m,i){var o,j;var k=this.yTiles;var e=this.xTiles;var q=this.tileSize;var c;var g;var p=0;var a;var d;if(m){if(m>0){this.topIndex-=1;if(this.topIndex<0){this.topIndex=k-1}g=this.topIndex;p-=k*q;a=1}else{g=this.topIndex;this.topIndex+=1;if(this.topIndex>=k){this.topIndex=0}p+=k*q;a=-1}this.updateFromCenterVals();this.refUrl.pan(a,0);var f=[];for(o=0;o<e;o++){f.push(this.tileArray[o][g])}n(f);for(o=0;o<f.length;o++){c=f[o];d=parseInt(c.style.top)+p;c.style.top=(d)+"px";if(this.onlyLoadTilesInViewport){c.setTileCoords(this.refUrl)}c.setSrc(this.refUrl.getRelSrc(c.fromCenterY,c.fromCenterX))}return}if(i){if(i>0){g=this.leftIndex;this.leftIndex+=1;if(this.leftIndex>=e){this.leftIndex=0}p+=e*q;a=1}else{this.leftIndex-=1;if(this.leftIndex<0){this.leftIndex=e-1}g=this.leftIndex;p-=e*q;a=-1}this.updateFromCenterVals();this.refUrl.pan(0,a);f=[];for(j=0;j<k;j++){f.push(this.tileArray[g][j])}n(f);for(j=0;j<f.length;j++){c=f[j];d=parseInt(c.style.left)+p;c.style.left=(d)+"px";if(this.onlyLoadTilesInViewport){c.setTileCoords(this.refUrl)}c.setSrc(this.refUrl.getRelSrc(c.fromCenterY,c.fromCenterX))}}function n(u){for(var t=1;t<u.length;t++){for(var r=0;r<u.length-1;r++){if((Math.abs(u[r].fromCenterX)+Math.abs(u[r].fromCenterY))>(Math.abs(u[r+1].fromCenterX)+Math.abs(u[r+1].fromCenterY))){b(u,r,r+1)}}}}function b(t,v,r){var u;u=t[v];t[v]=t[r];t[r]=u}};deCarta.MapLayer.prototype.zoom=function(d,c,b,a){if(!this.isVisible){return}c.zoom(d,this,b,a)};deCarta.MapLayer.prototype.populate=function(e){this.refUrl=e;var j,f,b;var d=[];var c=0;var k;for(j=0;j<this.xTiles;j++){for(f=0;f<this.yTiles;f++){d[c]=this.tileArray[j][f];c++}}k=d.length;g(d);for(b=0;b<k;b++){if(this.onlyLoadTilesInViewport){d[b].setTileCoords(e)}d[b].setSrc(e.getRelSrc(d[b].fromCenterY,d[b].fromCenterX))}function g(n){for(var m=1;m<n.length;m++){for(var i=0;i<n.length-1;i++){if((Math.abs(n[i].fromCenterX)+Math.abs(n[i].fromCenterY))>(Math.abs(n[i+1].fromCenterX)+Math.abs(n[i+1].fromCenterY))){a(n,i,i+1)}}}}function a(m,o,i){var n;n=m[o];m[o]=m[i];m[i]=n}};deCarta.MapLayer.prototype.updateFromCenterVals=function(){var j=this.xTiles;var n=this.yTiles;var b=Math.floor(j/2);var f=-b;var a=Math.floor(n/2);var e=-a;var q=this.leftIndex;var c=this.topIndex;var i,g;if(q>b){i=q-b-1}else{i=q+b}if(c>a){g=c-a-1}else{g=c+a}var d=this.tileArray;var p,m;for(p=0;p<j;p++){for(m=0;m<n;m++){var k=d[p][m];var r=p-i;if(r>b){k.fromCenterX=r-j}else{if(r<f){k.fromCenterX=r+j}else{k.fromCenterX=r}}var o=g-m;if(o>a){k.fromCenterY=o-n}else{if(o<e){k.fromCenterY=o+n}else{k.fromCenterY=o}}}}};deCarta.MapLayer.prototype.resize=function(e,g){if(e==this.xTiles&&g==this.yTiles){return}var b=[];var i=parseInt(this.tileArray[this.leftIndex][this.topIndex].style.top);var a=parseInt(this.tileArray[this.leftIndex][this.topIndex].style.left);var d=Math.floor(this.xTiles/2);var c=Math.floor(this.yTiles/2);var k=0;var f=0;var m;var j;for(k=0;k<this.xTiles;k++){for(f=0;f<this.yTiles;f++){m=(k-this.leftIndex);if(m<0){m+=this.xTiles}j=(f-this.topIndex);if(j<0){j+=this.yTiles}if(m>=e||j>=g){this.owner.getTileDiv().removeChild(this.tileArray[k][f]);this.tileArray[k][f]=null}}}for(k=0;k<e;k++){b[k]=[];for(f=0;f<g;f++){if(k<this.xTiles&&f<this.yTiles){m=(this.leftIndex+k)%this.xTiles;j=(this.topIndex+f)%this.yTiles;b[k][f]=this.tileArray[m][j]}else{b[k][f]=this.mapTileFactory(k,f);b[k][f].style.top=(i+f*this.tileSize)+"px";b[k][f].style.left=(a+k*this.tileSize)+"px";if(this.onlyLoadTilesInViewport){b[k][f].setTileCoords(this.refUrl)}b[k][f].setSrc(this.refUrl.getRelSrc(c-f,k-d));this.owner.getTileDiv().appendChild(b[k][f])}}}this.refUrl.pan(-(g-this.yTiles)/2,(e-this.xTiles)/2);this.tileArray=b;this.xTiles=e;this.yTiles=g;this.leftIndex=0;this.topIndex=0;this.updateFromCenterVals()};deCarta.MapLayer.prototype.destroy=function(){var a,b;for(a=0;a<this.xTiles;a++){for(b=0;b<this.yTiles;b++){Utilities.purge(this.tileArray[a][b])}}};deCarta.ZoomLayer=function(a,c,b){this.init(a,c,b)};deCarta.ZoomLayer.prototype.framesTotal=3;deCarta.ZoomLayer.prototype.msPerFrame=100;deCarta.ZoomLayer.prototype.xTiles=null;deCarta.ZoomLayer.prototype.yTiles=null;deCarta.ZoomLayer.prototype.tileSize=null;deCarta.ZoomLayer.prototype.layerName="zoomLayer";deCarta.ZoomLayer.prototype.cssClass="decarta-maptile";deCarta.ZoomLayer.prototype.cssZIndex=0;deCarta.ZoomLayer.prototype.tileArray=null;deCarta.ZoomLayer.prototype.srcOnHidden=null;deCarta.ZoomLayer.prototype.srcOnError=null;deCarta.ZoomLayer.prototype.isVisible=false;deCarta.ZoomLayer.prototype.init=function(b,e,c){var a,d;this.xTiles=b;this.yTiles=e;this.tileSize=c;this.tileArray=[];this.setDefaultSrc();for(a=0;a<this.xTiles;a++){this.tileArray[a]=[];for(d=0;d<this.yTiles;d++){this.tileArray[a][d]=this.mapTileFactory(a,d)}}};deCarta.ZoomLayer.prototype.setDefaultSrc=function(){if(!Utilities.ie6){this.srcOnHidden=Credentials.transparentPNG;this.srcOnError=Credentials.transparentPNG}else{this.srcOnHidden=Credentials.transparentGIF;this.srcOnError=Credentials.transparentGIF}};deCarta.ZoomLayer.prototype.mapTileOnError=function(b){var a;if(!b){a=window.event.srcElement}else{a=b.currentTarget}if(a&&a.src&&a.srcOnError){a.src=a.srcOnError}};deCarta.ZoomLayer.prototype.mapTileFactory=function(a,f){var b="px";var e=Math.floor(this.xTiles/2);var c=Math.floor(this.yTiles/2);var d=document.createElement("IMG");d.fromCenterX=a-e;d.fromCenterY=c-f;d.className=this.cssClass;d.altSrc=this.srcOnHidden;d.src=this.srcOnHidden;d.style.zIndex=this.cssZIndex;d.style.height=this.tileSize+b;d.style.width=this.tileSize+b;d.onerror=this.mapTileOnError;Utilities.setUnselectable(d);d.setSrc=deCarta.ZoomLayer.setSrc;return d};deCarta.ZoomLayer.setSrc=function(a){this.src=a};deCarta.ZoomLayer.prototype.appendTiles=function(b){for(var a=0;a<this.xTiles;a++){for(var c=0;c<this.yTiles;c++){b.appendChild(this.tileArray[a][c])}}};deCarta.ZoomLayer.prototype.hide=function(){if(!this.isVisible){return}var a,b;this.isVisible=false;for(a=0;a<this.xTiles;a++){for(b=0;b<this.yTiles;b++){this.tileArray[a][b].setSrc(this.srcOnHidden);this.tileArray[a][b].style.display="none"}}};deCarta.ZoomLayer.prototype.show=function(){if(this.isVisible){return}var a,b;this.isVisible=true;for(a=0;a<this.xTiles;a++){for(b=0;b<this.yTiles;b++){this.tileArray[a][b].style.display="block"}}};deCarta.ZoomLayer.prototype.transferSrcFromMapLayer=function(c){var a,f,e,d;var b="px";for(a=0;a<c.xTiles;a++){e=a+c.leftIndex;if(e>=c.xTiles){e-=c.xTiles}for(f=0;f<c.yTiles;f++){d=f+c.topIndex;if(d>=c.yTiles){d-=c.yTiles}this.tileArray[a][f].setSrc(this.srcOnHidden);this.tileArray[a][f].style.top=c.tileArray[e][d].style.top;this.tileArray[a][f].style.left=c.tileArray[e][d].style.left;this.tileArray[a][f].style.height=c.tileSize+b;this.tileArray[a][f].style.width=c.tileSize+b;this.tileArray[a][f].setSrc(c.tileArray[e][d].src)}}};deCarta.ZoomLayer.prototype.zoom=function(m,c,u,t){var v=this;v.show();v.transferSrcFromMapLayer(c);c.hide();var f=u;var e=t;var g=Math.pow(2,m);var b=m>0?+1:-1;var p=this.framesTotal;var n=this.msPerFrame;var j=Math.floor((g*v.tileSize-v.tileSize)/(p));var d=-1*Math.floor(v.xTiles/2);var q=d;var i=-1*Math.floor(v.yTiles/2);var a=i;var k;var o;if(m>0){k=Math.floor(g*b*f/(2*p));o=Math.floor(g*b*e/(2*p))}else{k=Math.floor(g*b*f/(p));o=Math.floor(g*b*e/(p))}r();function r(){var w,B;var A="px";for(w=0;w<v.xTiles;w++){for(B=0;B<v.yTiles;B++){var z=v.tileArray[w][B];z.style.width=parseInt(z.style.width)+j+A;z.style.height=parseInt(z.style.height)+j+A;z.style.left=parseInt(z.style.left)-j/2+d*j+k+A;z.style.top=parseInt(z.style.top)-j/2+i*j+o+A;i+=1}d+=1;i=a}d=q;p-=1;if(p){setTimeout(r,n)}}};deCarta.ZoomLayer.prototype.destroy=function(){var a,b;for(a=0;a<this.xTiles;a++){for(b=0;b<this.yTiles;b++){Utilities.purge(this.tileArray[a][b])}}};deCarta.MapLayerReferenceUrl=function(a,b){this.init(a,b)};deCarta.MapLayerReferenceUrl.prototype.baseUrl=null;deCarta.MapLayerReferenceUrl.prototype.imageHosts=null;deCarta.MapLayerReferenceUrl.prototype.numImageHosts=null;deCarta.MapLayerReferenceUrl.prototype.nextImageHost=null;deCarta.MapLayerReferenceUrl.prototype.staticProps=null;deCarta.MapLayerReferenceUrl.prototype.dynamicProps=null;deCarta.MapLayerReferenceUrl.prototype.urlregx=new RegExp("\\amp;","g");deCarta.MapLayerReferenceUrl.prototype.init=function(a,b){this.baseUrl=a;this.dynamicProps={};this.dynamicProps.northing=0;this.dynamicProps.easting=0;this.llMax=null;this.llMin=null;this.dynamicProps.format="";this.dynamicProps.config="";this.imageHosts=[];this.nextImageHost=0;if(b){this.numImageHosts=b+1}else{this.numImageHosts=1}};deCarta.MapLayerReferenceUrl.prototype.getFullHostName=function(){var d=this.baseUrl.indexOf("?");var c=this.baseUrl.substr(0,d+1);var b=/^[\S]*\/\/([\S]+)/;var a=c.replace(b,"$1");var e=a.split("/")[0];return e};deCarta.MapLayerReferenceUrl.prototype.getProtocol=function(){var c=this.baseUrl.indexOf("?");var b=this.baseUrl.substr(0,c+1);var a=/^([a-zA-Z:]*\/\/)([\s\S]*)/;var d=b.replace(a,"$1");return d};deCarta.MapLayerReferenceUrl.prototype.generateHostAliases=function(){var d;this.imageHosts=[];var j=this.baseUrl.indexOf("?");var k=this.baseUrl.substr(0,j+1);if(this.numImageHosts==1){this.imageHosts[0]=k+this.staticProps;return}else{var f=k.split(".");if(f.length>1){var n=f[0];var e=f.slice(1).join(".");n=n.replace(/-[0-9]+$/,"");this.imageHosts[0]=n+"."+e+this.staticProps;for(d=1;d<this.numImageHosts;d++){if(d<10){this.imageHosts[d]=n+"-0"+d+"."+e+this.staticProps;continue}else{this.imageHosts[d]=n+"-"+d+"."+e+this.staticProps}}}else{var m=this.getProtocol();var a=this.getFullHostName();var b="";if(a.split(":").length>1){b=":"+a.split(":")[1];a=a.split(":")[0]}a=a.replace(/-[0-9]+$/,"");var c=this.baseUrl.indexOf("/",m.length);var g=this.baseUrl.substr(c,j+1-c);this.imageHosts[0]=m+a+b+g+this.staticProps;for(d=1;d<this.numImageHosts;d++){if(d<10){this.imageHosts[d]=m+a+"-0"+d+b+g+this.staticProps;continue}else{this.imageHosts[d]=m+a+"-"+d+b+g+this.staticProps}}}}};deCarta.MapLayerReferenceUrl.prototype.createGlobeXplorerUrl=function(){var c,d,g;var b=[];var e=this.baseUrl.indexOf("?")+1;var a=this.baseUrl.slice(e).split("&");var f=a.length;for(c=0;c<f;c++){d=a[c];if(d.indexOf("N=")==0){this.dynamicProps.northing=parseInt(d.split("=")[1],10);d=null}else{if(d.indexOf("E=")==0){this.dynamicProps.easting=parseInt(d.split("=")[1],10);d=null}else{if(d.indexOf("LLMIN=")==0||d.indexOf("LL=")==0){this.dynamicProps.llMin=d.split("=")[1]}else{if(d.indexOf("key=")==0){if(d.length>4&&!Credentials.dgkey){}else{g=Credentials.dgkey||"";d="key="+g}}}}}if(d!=null){b.push(d)}}this.staticProps=b.join("&");this.generateHostAliases()};deCarta.MapLayerReferenceUrl.prototype.createDeCartaTransparentUrl=function(){var c,d;var b=[];this.baseUrl=this.baseUrl.replace(this.urlregx,"");var e=this.baseUrl.indexOf("?")+1;var a=this.baseUrl.slice(e).split("&");var f=a.length;for(c=0;c<f;c++){d=a[c];if(d.indexOf("N=")==0){this.dynamicProps.northing=parseInt(d.split("=")[1],10);d=null}else{if(d.indexOf("E=")==0){this.dynamicProps.easting=parseInt(d.split("=")[1],10);d=null}else{if(d.indexOf("FORMAT=")==0){this.dynamicProps.format="PNG";d=null}else{if(d.indexOf("CONFIG=")==0){this.dynamicProps.config=d.split("=")[1];d=null}else{if(d.indexOf("LLMIN=")==0||d.indexOf("LL=")==0){this.dynamicProps.llMin=d.split("=")[1]}}}}}if(d!=null){b.push(d)}}this.staticProps=b.join("&");this.generateHostAliases()};deCarta.MapLayerReferenceUrl.prototype.createDeCartaUrl=function(){var c,d;var b=[];this.baseUrl=this.baseUrl.replace(this.urlregx,"");var e=this.baseUrl.indexOf("?")+1;var a=this.baseUrl.slice(e).split("&");var f=a.length;for(c=0;c<f;c++){d=a[c];if(d.indexOf("N=")==0){this.dynamicProps.northing=parseInt(d.split("=")[1],10);d=null}else{if(d.indexOf("E=")==0){this.dynamicProps.easting=parseInt(d.split("=")[1],10);d=null}else{if(d.indexOf("FORMAT=")==0){this.dynamicProps.format=d.split("=")[1];d=null}else{if(d.indexOf("CONFIG=")==0){this.dynamicProps.config=d.split("=")[1];d=null}else{if(d.indexOf("LLMIN=")==0||d.indexOf("LL=")==0){this.dynamicProps.llMin=d.split("=")[1]}}}}}if(d!=null){b.push(d)}}this.staticProps=b.join("&");this.generateHostAliases()};deCarta.MapLayerReferenceUrl.prototype.getNextImageHost=function(){if(this.numImageHosts==1){return this.imageHosts[0]}else{var a=this.imageHosts[this.nextImageHost++];if(this.nextImageHost>=this.numImageHosts){this.nextImageHost=0}return a}};deCarta.MapLayerReferenceUrl.prototype.pan=function(a,b){this.dynamicProps.northing+=a;this.dynamicProps.easting+=b};deCarta.MapLayerReferenceUrl.prototype.getRelSrc=function(f,b){var e=this.getNextImageHost();var d=this.dynamicProps.northing+f;var i=this.dynamicProps.easting+b;var a=this.dynamicProps.config||"";if(a){a="&CONFIG="+a}var c=this.dynamicProps.format||"";if(c){c="&FORMAT="+c}var g=e+c+a+"&N="+d+"&E="+i;return g};deCarta.MapLayerReferenceUrl.prototype.setParameter=function(j,g){var c;var f=this.dynamicProps;for(c in f){if(f.hasOwnProperty(c)){if(c==j){f[j]=g;return}}}var e=this.staticProps.split("&");var d=e.length;var b=j+"=";var a=false;for(c=0;c<d;c++){if(e[c].indexOf(b)==0){e[c]=b+g;a=true;break}}if(!a){e[d]=b+g}this.staticProps=e.join("&");this.generateHostAliases()};deCarta.MapLayerReferenceUrl.prototype.getParameter=function(g){var b;var f=null;var e=this.dynamicProps;for(b in e){if(e.hasOwnProperty(b)){if(b==g){f=e[g];return f}}}var d=this.staticProps.split("&");var c=d.length;var a=g+"=";for(b=0;b<c;b++){if(d[b].indexOf(a)==0){f=d[b].split("=")[1];return f}}return null};deCarta.MapLayerReferenceUrl.prototype.deleteParameter=function(c){var f;var d=this.dynamicProps;for(f in d){if(d.hasOwnProperty(f)){if(f==c){d[c]=null;return true}}}var g=this.staticProps.split("&");var k=[];var a;var b=false;var e=g.length;var j=c+"=";for(f=0;f<e;f++){a=g[f];if(a.indexOf(j)==0){a=null;b=true}if(a){k.push(a)}}if(b){this.staticProps=k.join("&");this.generateHostAliases();return true}else{return false}};function MapTypeController(){this.init()}MapTypeController.prototype.map=null;MapTypeController.prototype.type="MapTypeController";MapTypeController.prototype.frame=null;MapTypeController.prototype.cssClass="decarta-mapTypeController";MapTypeController.prototype.linkCssClass="decarta-mapTypeControllerLink";MapTypeController.prototype.streetLabel=GLOBALS.STREET;MapTypeController.prototype.hybridLabel=GLOBALS.HYBRID;MapTypeController.prototype.satelliteLabel=GLOBALS.SATELLITE;MapTypeController.prototype.init=function(){};MapTypeController.prototype.build=function(){this.frame=document.createElement("DIV");this.frame.id=this.cssClass;this.frame.className=this.cssClass;deCarta.IdManager.setTag(this.frame,"ignoreForMapEvents");var c=document.createElement("span");c.innerHTML=" | ";deCarta.IdManager.setTag(c,"ignoreForMapEvents");var a=document.createElement("span");a.innerHTML=" | ";deCarta.IdManager.setTag(a,"ignoreForMapEvents");var e=document.createElement("a");e.className=this.linkCssClass;e.innerHTML=this.streetLabel;e.href="#";e.mapType=GLOBALS.STREET;e.owner=this;e.onclick=this.handleClick;deCarta.IdManager.setTag(e,"ignoreForMapEvents");var b=document.createElement("a");b.className=this.linkCssClass;b.innerHTML=this.hybridLabel;b.href="#";b.mapType=GLOBALS.HYBRID;b.owner=this;b.onclick=this.handleClick;deCarta.IdManager.setTag(b,"ignoreForMapEvents");var d=document.createElement("a");d.className=this.linkCssClass;d.innerHTML=this.satelliteLabel;d.href="#";d.owner=this;d.mapType=GLOBALS.SATELLITE;d.onclick=this.handleClick;deCarta.IdManager.setTag(d,"ignoreForMapEvents");this.frame.appendChild(e);this.frame.appendChild(c);this.frame.appendChild(b);this.frame.appendChild(a);this.frame.appendChild(d)};MapTypeController.prototype.appendThis=function(){if(!this.frame){this.build()}return this.frame};MapTypeController.prototype.removeThis=function(){this.map=null;return this.frame};MapTypeController.prototype.position=function(a){this.frame.style.top="5px";this.frame.style.left=a.width-207+"px"};MapTypeController.prototype.handleClick=function(){if(!GLOBALS.ALLOWDOMEVENTS){return true}this.owner.map.setMapType(this.mapType);return false};deCarta.Math={};deCarta.Math.MercatorSpherical=function(){var d=null;var b=null;var g=null;var i=null;function a(k){return(k*Math.PI/180)}function j(k){return(k*180/Math.PI)}function e(m){var p=a(m);var n=Math.sin(p);var o=Math.log((1+n)/(1-n))/2;var k=j(o);return k}function c(m){var p=a(m);var n=Math.exp(2*p);var o=Math.asin((n-1)/(n+1));var k=j(o);return k}function f(){if(!d||(!b&&b!==0)||(!g&&g!==0)){return false}i=g/Math.abs(d.maxPosition.lon-d.minPosition.lon);return true}this.getBoundingBox=function(){return d};this.setBoundingBox=function(k){if(k.minPosition==undefined||k.maxPosition==undefined){throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid boundingBox of: "+k)}else{d=k}};this.getPixelHeight=function(){return b};this.setPixelHeight=function(k){var m=parseInt(k,10);if(isNaN(m)||(m<0)){throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid height of: "+k)}else{b=m}};this.getPixelWidth=function(){return g};this.setPixelWidth=function(m){var k=parseInt(m,10);if(isNaN(k)||(k<0)){throw new Exception("deCarta.Math.MercatorSpherical.setPixelWidth passed invalid width of: "+m)}else{g=k}};this.positionToPixels=function(o){if(!f()||!o||(!o.lat&&o.lat!=0)||(!o.lon&&o.lon!=0)){throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels")}var m=new PixelPoint(0,0);m.x=i*(d.minPosition.lon-o.lon)*-1;var n=e(d.maxPosition.lat)-e(o.lat);var k=e(d.maxPosition.lat)-e(d.minPosition.lat);m.y=b*n/k;return m};this.pixelsToPosition=function(m){if(!f()||!m||(!m.x&&m.x!=0)||(!m.y&&m.y!=0)){throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion")}var o=new Position(0,0);o.lon=d.minPosition.lon+(m.x/i);var k=e(d.maxPosition.lat)-e(d.minPosition.lat);var n=(m.y/b)*k;o.lat=c(e(d.maxPosition.lat)-n);return o}};deCarta.Math.MercatorEllipsoidal=function(){var d=null;var b=null;var g=null;var i=null;function a(k){return(k*Math.PI/180)}function j(k){return(k*180/Math.PI)}function e(o){var n=0.081819190842;var q=a(o);var k=n*Math.sin(q);var p=Math.log(Math.pow(((1-k)/(1+k)),n/2)*Math.tan((Math.PI/4)+(q/2)));var m=j(p);return m}function c(n){var q=a(n);var p=Math.pow(Math.E,-q);var m=r();for(var o=0;o<6;o++){m=t(m)}var k=j(m);return k;function r(){return Math.PI/2-2*Math.atan(p)}function t(z){var v=0.0818191908426216;var u=v*Math.sin(z);var x=p*Math.pow((1-u)/(1+u),v/2);var w=(Math.PI/2)-(2*Math.atan(x));return w}}function f(){if(!d||(!b&&b!==0)||(!g&&g!==0)){return false}i=g/Math.abs(d.maxPosition.lon-d.minPosition.lon);return true}this.getBoundingBox=function(){return d};this.setBoundingBox=function(k){if(k.minPosition==undefined||k.maxPosition==undefined){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid boundingBox of: "+k)}else{d=k}};this.getPixelHeight=function(){return b};this.setPixelHeight=function(k){var m=parseInt(k,10);if(isNaN(m)||(m<0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid height of: "+k)}else{b=m}};this.getPixelWidth=function(){return g};this.setPixelWidth=function(m){var k=parseInt(m,10);if(isNaN(k)||(k<0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelWidth passed invalid width of: "+m)}else{g=k}};this.positionToPixels=function(o){if(!f()||!o||(!o.lat&&o.lat!=0)||(!o.lon&&o.lon!=0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels")}var m=new PixelPoint(0,0);m.x=i*(d.minPosition.lon-o.lon)*-1;var n=e(d.maxPosition.lat)-e(o.lat);var k=e(d.maxPosition.lat)-e(d.minPosition.lat);m.y=b*n/k;return m};this.pixelsToPosition=function(m){if(!f()||!m||(!m.x&&m.x!=0)||(!m.y&&m.y!=0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion")}var o=new Position(0,0);o.lon=d.minPosition.lon+(m.x/i);var k=e(d.maxPosition.lat)-e(d.minPosition.lat);var n=(m.y/b)*k;o.lat=c(e(d.maxPosition.lat)-n);return o}};deCarta.Math.greatCircleDist=function(m,k,a){if(!m||!k){throw new Exception("Utilities.greatCircleDist: must have valid coords")}var d=Math.PI*m.lat/180;var g=Math.cos(d);var i=Math.PI*m.lon/180;var c=Math.PI*k.lat/180;var f=Math.cos(c);var e=Math.PI*k.lon/180;var j=Math.abs(Math.abs(i)-Math.abs(e));var o=6372795;var b;var n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(((c-d)/2)),2)+(g*f*Math.pow(Math.sin(j/2),2))));b=o*n;if(!a||a.value=="M"){return b}switch(a.value){case"KM":b/=1000;break;case"MI":b/=1609;break;case"FT":b*=3.28084;break;default:throw new Exception("Utilities.greatCircleDist: unexpected uom value of: "+a.value);break}return b};deCarta.Math.pointInPolygon=function(g,f){function o(r,u,t){if(u.lat<t.lat){if(r){return false}else{return true}}else{if(!r){return false}else{return true}}}function q(t,u,r){if(u.lon<r.lon){if(!t){return false}else{return true}}else{if(t){return false}else{return true}}}var b;var i;var a=0;var p=0;if(f.lat<g[0].lat){i=true}else{i=false}if(f.lon<g[0].lon){b=false}else{b=true}for(var m in g){var e=q(b,f,g[m]);var k=o(i,f,g[m]);if(e&&k){var c=g[m].lat-g[m-1].lat;var d=g[m].lon-g[m-1].lon;var j=c/d;c=f.lat-g[m-1].lat;d=f.lon-g[m-1].lon;var n=c/d;if((b&&!i)||(!b&&!i)){if(n>j){p++}else{a++}}if((!b&&i)||(b&&i)){if(n<j){p++}else{a++}}b=!b;i=!i}else{if(e){b=!b}if(k){i=!i;if(b){a++}else{p++}}}}if(a%2==0){return false}else{return true}};deCarta.Math.headingFromPositions=function(c,a){if(!c||(!c.lat&&c.lat!=0)||(!c.lon&&c.lon!=0)||!a||(!a.lat&&a.lat!=0)||(!a.lon&&a.lon!=0)){throw new Exception("deCarta.Math.headingFromPosition: bad arguments.")}var e=Math.PI/180;var g=c.lat*e;var d=c.lon*e;var f=a.lat*e;var b=a.lon*e;var i=Math.atan2(Math.sin(b-d)*Math.cos(f),Math.cos(g)*Math.sin(f)-Math.sin(g)*Math.cos(f)*Math.cos(b-d));return i/e};deCarta.ObjectToJSON=function(k,d,a){var e;var g="";var c="";if(typeof a==="number"){for(e=0;e<a;e+=1){c+=" "}}else{if(typeof a==="string"){c=a}}var j=d;if(d&&typeof d!=="function"&&(typeof d!=="object"||typeof d.length!=="number")){throw new Exception("Bad replacer in deCarta.ObjectToJSON")}return f("",{"":k});function b(i){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;n.lastIndex=0;return n.test(i)?'"'+i.replace(n,function(o){var p=m[o];return typeof p==="string"?p:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'}function f(u,q){var o,n,w,m,r=g,p,t=q[u];if(t&&typeof t==="object"&&typeof t.toJSON==="function"){t=t.toJSON(u)}if(typeof j==="function"){t=j.call(q,u,t)}switch(typeof t){case"string":return b(t);case"number":return isFinite(t)?String(t):"null";case"boolean":case"null":return String(t);case"object":if(!t){return"null"}g+=c;p=[];if(Object.prototype.toString.apply(t)==="[object Array]"){m=t.length;for(o=0;o<m;o+=1){p[o]=f(o,t)||"null"}w=p.length===0?"[]":g?"[\n"+g+p.join(",\n"+g)+"\n"+r+"]":"["+p.join(",")+"]";g=r;return w}if(j&&typeof j==="object"){m=j.length;for(o=0;o<m;o+=1){n=j[o];if(typeof n==="string"){w=f(n,t);if(w){p.push(b(n)+(g?": ":":")+w)}}}}else{for(n in t){if(Object.hasOwnProperty.call(t,n)){w=f(n,t);if(w){p.push(b(n)+(g?": ":":")+w)}}}}w=p.length===0?"{}":g?"{\n"+g+p.join(",\n"+g)+"\n"+r+"}":"{"+p.join(",")+"}";g=r;return w}}};function OpenSearchQuery(){this.url=null;this.callback=null;this.params=null}OpenSearchQuery.prototype.setCallback=function(a){this.callback=a};OpenSearchQuery.prototype.setURL=function(a){this.url=a};OpenSearchQuery.prototype.setParams=function(b){this.params="?";for(var a in b){if(b.hasOwnProperty(a)){this.params+=a+"="+b[a]+"&"}}};OpenSearchQuery.prototype.send=function(){var b=this;if(!Utilities.ie){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(c){}}var a=new XMLHttpRequest();a.open("POST",this.url+this.params,true);a.onreadystatechange=function(){if(a.readyState==4){b.callback(a.responseText)}};a.send(null)};function POI(d,a,b,c,e){this.name=d;this.position=a;this.address=b;this.phoneNumber=c;this.distance=null;this.properties=e||{};this.toString=function(){return this.name+" "+this.position+" "+this.address+" "+this.phoneNumber}}function POIQuery(){this.xmlRecFac=new deCarta.XMLStringBuilder();var b=[];var a=this;this.authenticate=function(d,c){if(!d||!c||d==""||c==""){throw new Exception("Error authenticating POIQuery, invalid parameters.");return false}Credentials.clientName=d;Credentials.clientPassword=c;this.xmlRecFac.clientName=d;this.xmlRecFac.clientPassword=c};this.query=function(e,g,c){var f=Utilities.getRequestId();if(typeof g=="function"){b[f]=g}else{throw new Exception("POIQuery.query: callBack must be a function, arg was: "+g)}var d=this.xmlRecFac.createPOIRequest(e,f);JSRequest.send(d,a.queryCallback,null,c)};this.fullDetailsQuery=function(g,f,c){var e=Utilities.getRequestId();if(typeof f=="function"){b[e]=f}else{throw new Exception("POIQuery.fullDetailsQuery: callBack must be a function, arg was: "+f)}var d=this.xmlRecFac.createFullDetailsPOIRequest(g,e);JSRequest.send(d,a.fullDetailsQueryCallback,null,c)};this.queryCallback=function(g){var j=false;var d;var e=[];var f;if(deCarta.JSONParser.parseErrors(g)){f=g.XLS.Response.requestID}else{if(deCarta.Array.isArray(g.XLS.Response)){f=g.XLS.Response[0].requestID;j=true;for(d=0;d<g.XLS.Response.length;d++){e.push([]);c(g.XLS.Response[d].DirectoryResponse.POIContext)}}else{f=g.XLS.Response.requestID;c(g.XLS.Response.DirectoryResponse.POIContext)}}if((f>=0)&&b[f]){b[f](e);b[f]=undefined}function c(n){var k;if(!n){return}else{if(n.length==undefined){k=[];k.push(n)}else{k=n}}for(var i=0;i<k.length;i++){var m=deCarta.JSONParser.parsePOI(k[i]);if(j){e[d].push(m)}else{e.push(m)}}}};this.fullDetailsQueryCallback=function(d){var c=d.XLS.Response.requestID;if((c>=0)&&b[c]){b[c]((d.XLS.Response.DirectoryResponse.POIContext.POI));b[c]=undefined}}}function PanController(){this.init()}PanController.prototype.map=null;PanController.prototype.type="PanController";PanController.prototype.frame=null;PanController.prototype.cssClass="decarta-panController";PanController.prototype.init=function(){};PanController.prototype.build=function(){this.frame=document.createElement("DIV");this.frame.id=this.cssClass;this.frame.className=this.cssClass;var i=document.createElement("img");i.className="decarta-panController-north";i.src=Credentials.imgPath+"z2t_pan_north.png";i.onclick=this.map.panNorth;var b=document.createElement("img");b.className="decarta-panController-south";b.src=Credentials.imgPath+"z2t_pan_south.png";b.onclick=this.map.panSouth;var d=document.createElement("img");d.className="decarta-panController-east";d.src=Credentials.imgPath+"z2t_pan_east.png";d.onclick=this.map.panEast;var a=document.createElement("img");a.className="decarta-panController-west";a.src=Credentials.imgPath+"z2t_pan_west.png";a.onclick=this.map.panWest;var g=document.createElement("img");g.className="decarta-panController-center";g.src=Credentials.imgPath+"z2t_pan_center_gray.png";var f=this;g.onclick=function(){if(g.src.indexOf("loading-ball.gif")>-1){return}g.src=Credentials.imgPath+"loading-ball.gif";var e=function(m){m=m.coords||m;var n=new Position(m.latitude+" "+m.longitude);return n};var c=function(m){g.src=Credentials.imgPath+"z2t_pan_center_gray.png";f.map.panToPosition(e(m))};var j=function(){g.src=Credentials.imgPath+"z2t_pan_center_gray.png";alert("unable to position")};if(navigator.geolocation){navigator.geolocation.getCurrentPosition(c,j)}else{if(window.google&&google.gears){var k=google.gears.factory.create("beta.geolocation");if((k)&&(k.getPermission())){k.getCurrentPosition(c,j)}}else{g.src=Credentials.imgPath+"z2t_pan_center_gray.png"}}};this.frame.appendChild(i);this.frame.appendChild(b);this.frame.appendChild(d);this.frame.appendChild(a);this.frame.appendChild(g)};PanController.prototype.appendThis=function(){if(!this.frame){this.build()}return this.frame};PanController.prototype.removeThis=function(){this.map=null;return this.frame};PanController.prototype.position=function(a){};function Pin(e,j,w,x){if(!e){throw new Exception("Error instantiating Pin, must at least provide a Position.");return false}var p=this;var k=new Array();var y=170;var C=null;var A=null;var v=false;var g=false;var m=null;var f=null;var i=null;this.type="pin";this.position=null;if(e&&e.clone){this.position=e.clone()}this.icon=x||new Icon(Credentials.pinIconPath,12,12,24,24);this.map=null;this.isVisible=true;this.id="";this.pinImg=null;this.pinImg=document.createElement("img");var d="decarta-pin";this.pinImg.className=d;this.pinImg.style.position="absolute";this.pinImg.id=e.toString();this.pinImg.src=this.icon.src;this.pinImg.style.width=parseInt(this.icon.width)+"px";this.pinImg.style.height=parseInt(this.icon.height)+"px";Pin.zIndexCounter++;this.pinImg.style.zIndex=Pin.zIndexCounter;this.pinImg.style.cursor="pointer";this.pinImg.style.display="block";this.pinImg.msg=j||"";if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(this.pinImg)}deCarta.IdManager.setTag(this.pinImg,"ignoreForMapEvents");this.poi=null;this.hoverIconOn=null;this.hoverIconOff=null;this.pinTxt=null;this.pinTxt=document.createElement("DIV");this.pinTxt.id="decarta-textoverlay";this.pinTxt.innerHTML=this.icon.overlay.text;this.pinTxt.className=this.icon.overlay.className;this.pinTxt.style.position="absolute";this.pinTxt.style.color=this.icon.overlay.color;this.pinTxt.style.fontSize=this.icon.overlay.size;this.pinTxt.style.fontFamily=this.icon.overlay.fontFamily;if(this.icon.overlay.text==""){this.pinTxt.style.display="none"}else{this.pinTxt.style.display="block"}Pin.zIndexCounter++;this.pinTxt.style.zIndex=Pin.zIndexCounter;this.pinTxt.style.cursor="pointer";deCarta.IdManager.setTag(this.pinTxt,"ignoreForMapEvents");this.animateDrop=false;this.dropSpeed=30;this.animate=function(D,E){if(D=="DROP"){this.animateDrop=true;if(E=="FAST"){this.dropSpeed=20}else{this.dropSpeed=35}}};this.animateDropPosition=300;function o(){if(p.animateDropPosition>0){p.pinImg.style.top=(parseInt(p.pinImg.style.top)+10)+"px";p.pinTxt.style.top=(parseInt(p.pinTxt.style.top)+10)+"px";p.animateDropPosition-=10;setTimeout(o,p.dropSpeed)}}this.getZIndex=function(){return(this.pinImg.style.zIndex)};this.setZIndex=function(E){var D=parseInt(E,10);if(!isNaN(D)){this.pinImg.style.zIndex=D;if(this.pinTxt){this.pinTxt.style.zIndex=D+1}}else{this.pinImg.style.zIndex=0;if(this.pinTxt){this.pinTxt.style.zIndex=1}}};this.setId=function(D){this.id=D};this.getId=function(){return this.id};this.setCursorStyle=function(D){this.pinImg.style.cursor=D;this.pinTxt.style.cursor=D};this.getCursorStyle=function(){return this.pinImg.style.cursor};this.setIcon=function(D){p.pinImg.src=D.src;if(p.icon.anchorY==D.anchorY&&p.icon.anchorX==D.anchorX&&D._previousY&&D._previousX){p.pinImg.style.top=(parseInt(p.pinImg.style.top)+D._previousY-D.anchorY)+"px";p.pinImg.style.left=(parseInt(p.pinImg.style.left)+D._previousX-D.anchorX)+"px"}else{p.pinImg.style.top=(parseInt(p.pinImg.style.top)+p.icon.anchorY-D.anchorY)+"px";p.pinImg.style.left=(parseInt(p.pinImg.style.left)+p.icon.anchorX-D.anchorX)+"px"}p.pinImg.style.width=D.width+"px";p.pinImg.style.height=D.height+"px";p.icon=D;if(D.overlay.text!=""){p.pinTxt.style.display="block";p.pinTxt.innerHTML=this.icon.overlay.text;p.pinTxt.style.position="absolute";if(D.overlay.className){p.pinTxt.style.className=D.overlay.className}if(D.overlay.color){p.pinTxt.style.color=D.overlay.color}if(D.overlay.size){p.pinTxt.style.fontSize=D.overlay.size}if(D.overlay.fontFamily){p.pinTxt.style.fontFamily=D.overlay.fontFamily}p.pinTxt.style.left=(parseInt(p.pinImg.style.left)+parseInt(p.icon.overlay.anchorX))+"px";p.pinTxt.style.top=(parseInt(p.pinImg.style.top)+parseInt(p.icon.overlay.anchorY))+"px"}else{p.pinTxt.innerHTML="";p.pinTxt.style.display="none"}if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){var E=this.pinImg.src;this.pinImg.src=Credentials.transparentGIF;this.pinImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E+"',sizingMethod='scale')"}};this.getIcon=function(){return p.icon};this.setX=function(D){var E=D-p.icon.anchorX;if(p.pinImg.offsetLeft==E){return false}p.pinImg.style.left=E+"px";if(p.pinTxt){p.pinTxt.style.left=(E+p.icon.overlay.anchorX)+"px"}return true};this.setY=function(E){if(p.animateDrop){p.pinImg.style.top=(E-p.icon.anchorY-p.animateDropPosition)+"px";if(p.pinTxt){p.pinTxt.style.top=(E-p.icon.anchorY+p.icon.overlay.anchorY-p.animateDropPosition)+"px"}}else{var D=E-p.icon.anchorY;if(p.pinImg.offsetTop==D){return false}p.pinImg.style.top=(D)+"px";if(p.pinTxt){p.pinTxt.style.top=(D+p.icon.overlay.anchorY)+"px"}}if(p.animateDrop){o()}return true};this.getPosition=function(){return p.position};this.setPosition=function(G){if(p.map!=null){var F=p.map.positionToMapLayerPixel(G);var E=p.setX(F.x);var D=p.setY(F.y)}p.position=G;return((E||D)?true:false)};this.setMessage=function(D){p.pinImg.msg=D;if(p.map&&p.pinImg&&p.map.getInfoWindow()&&(p==p.map.getInfoWindow().associatedPin)){p.map.getInfoWindow().setContent(D)}};this.getMessage=function(){return p.pinImg.msg};this.hide=function(){p.isVisible=false;p.pinImg.style.display="none";p.pinTxt.style.display="none"};this.show=function(){p.isVisible=true;p.pinImg.style.display="block";if(p.pinTxt.innerHTML!=""){p.pinTxt.style.display="block"}};this.zoomHide=function(){if(p.isVisible){p.pinImg.style.display="none";p.pinTxt.style.display="none"}};this.zoomShow=function(){if(p.isVisible){p.pinImg.style.display="block";if(p.pinTxt.innerHTML!=""){p.pinTxt.style.display="block"}}};this.showInfoWindow=function(){p.map.getInfoWindow().setPosition(parseInt(p.pinImg.style.left),parseInt(p.pinImg.style.top));p.map.getInfoWindow().setContent(p.pinImg.msg);p.map.getInfoWindow().show(p)};this.hideInfoWindow=function(){p.map.getInfoWindow().hide()};this.addEventListener=function(E,F){var G=false;for(var D=0;D<k.length;D++){if(k[D]==E){k[E]=F;G=true;break}}if(!G){k.push(E);k[E]=F;if(E=="click"||E=="dblclick"||E=="rightclick"){deCarta.Events.addEvent(p.pinImg,"mousedown",r);deCarta.Events.addEvent(p.pinImg,"mouseup",t);deCarta.Events.addEvent(p.pinTxt,"mousedown",r);deCarta.Events.addEvent(p.pinTxt,"mouseup",t)}else{if(E=="mouseover"){deCarta.Events.addEvent(p.pinImg,"mouseover",B);deCarta.Events.addEvent(p.pinTxt,"mouseover",B)}else{if(E=="mouseout"){deCarta.Events.addEvent(p.pinImg,"mouseout",z);deCarta.Events.addEvent(p.pinTxt,"mouseout",z)}}}}};this.clearInstanceListeners=function(){for(var D=0;D<k.length;D++){k[k[D]]=null;k[D]=null}};this.clearListeners=function(E){for(var D=0;D<k.length;D++){if(k[D]==E){k[k[D]]=null}}k[D]=null};function r(D){if(!GLOBALS.ALLOWDOMEVENTS){return true}if(D.button==2||D.which==3){v=true;return false}if(k.mousedown){k.mousedown(p)}return false}function t(D){if(!GLOBALS.ALLOWDOMEVENTS){return true}if(v){u();return false}if(k.mouseup){k.mouseup(p)}if(!C){A=setTimeout(q,y);C=new Date()}else{clearTimeout(A);n()}return false}function q(){c();if(k.click){k.click(p)}}function n(){c();if(k.dblclick){k.dblclick(p)}}function u(){c();if(k.rightclick){k.rightclick(p)}}this.pickup=function(){if(!g){deCarta.Events.addEvent(window.document,"mousemove",a)}};this.drop=function(){if(g){b()}};function a(T){var K=T.clientX;var J=T.clientY;var W=p.pinImg;var I=parseInt(W.style.top,10);var E=parseInt(W.style.left,10);var O=p.pinTxt;var L=parseInt(O.style.top,10);var H=parseInt(O.style.left,10);var U=p.map;var G=0;var F=0;var M=0;var D=0;if(!g){g=true;m=new PixelPoint(K,J);f=new PixelPoint(E,I);i=new PixelPoint(H,L)}var P=J-Utilities.getAbsoluteTop(U.mapDiv)+Utilities.getScrollTop();var Q=K-Utilities.getAbsoluteLeft(U.mapDiv)+Utilities.getScrollLeft();var N=I+parseInt(U.getTileDiv().style.top,10)+Utilities.getScrollTop();var R=N+W.clientHeight/2;var V=E+parseInt(U.getTileDiv().style.left,10)+Utilities.getScrollTop();var S=V+W.clientWidth/2;if(R!=P){F=P-R}M=I+F;W.style.top=M+"px";O.style.top=(L+F)+"px";if(S!=Q){G=Q-S}D=E+G;W.style.left=D+"px";O.style.left=(H+G)+"px";return false}function b(G){deCarta.Events.removeEvent(window.document,"mousemove",a);var L=parseInt(p.pinImg.style.left,10)-f.x;var K=-(parseInt(p.pinImg.style.top,10)-f.y);var M=p.map.getZoomController().getGXConvertedZoomLevel();var F=Utilities.radsPerPixelAtZoom(p.map.getTileSize(),M);var J=Utilities.lon2pix(p.position.lon,F);var I=Utilities.lat2pix(p.position.lat,F);var D=Utilities.pix2lon((J+L),F);var H=Utilities.pix2lat((I+K),F);var E=new Position(H,D);p.setPosition(E);g=false;m=null;f=null;i=null;return false}function B(){if(!GLOBALS.ALLOWDOMEVENTS){return}if(k.mouseover){k.mouseover(p)}}function z(){if(!GLOBALS.ALLOWDOMEVENTS){return}if(k.mouseout){k.mouseout(p)}}function c(){C=null;A=null;v=false}if(w&&(w=="onmouseover"||w=="mouseover")){p.addEventListener("mouseover",p.showInfoWindow);p.addEventListener("mouseout",p.hideInfoWindow)}else{if(w&&(w=="onclick"||w=="click")){p.addEventListener("click",p.showInfoWindow)}}this.destroy=function(){if(p&&p.map){if(p.pinImg){p.pinImg=p.map.getTileDiv().removeChild(p.pinImg);if(p.pinImg){Utilities.purge(p.pinImg)}p.pinImg=null}if(p.pinTxt){p.pinTxt=p.map.getTileDiv().removeChild(p.pinTxt);if(p.pinTxt){Utilities.purge(p.pinTxt)}p.pinTxt=null}}p=null};this.toString=function(){return p.position.toString()};this.equals=function(D){if(D&&D.toString()==this.toString()&&D.pinImg==this.pinImg){return true}else{return false}};this.getViewableBoundingBox=function(H){var L=Utilities.lat2pix(p.position.lat,H);var E=Utilities.lon2pix(p.position.lon,H);var K=L+p.icon.anchorY;var Q=E+parseInt(p.pinImg.style.width)-p.icon.anchorX;var P=L-parseInt(p.pinImg.style.height)+p.icon.anchorY;var I=E-p.icon.anchorX;var M=Utilities.pix2lat(K,H);var D=Utilities.pix2lon(Q,H);var N=Utilities.pix2lat(P,H);var F=Utilities.pix2lon(I,H);var J=new Position(M,D);var G=new Position(N,F);var O=new BoundingBox(G,J);return O}}Pin.zIndexCounter=100;function PixelPoint(a,c){try{this.x=parseFloat(a);this.y=parseFloat(c);if(isNaN(this.x)||isNaN(this.y)){throw new Exception("")}}catch(b){throw new Exception("PixelPoint: bad constructor values for x: "+a+" and y: "+c)}}PixelPoint.prototype.getX=function(){return this.x};PixelPoint.prototype.roundX=function(){return Math.round(this.x)};PixelPoint.prototype.setX=function(a){this.x=parseFloat(a);if(isNaN(this.x)){throw new Exception("PixelPoint: setX bad argument x: "+a)}};PixelPoint.prototype.getY=function(){return this.y};PixelPoint.prototype.roundY=function(){return Math.round(this.y)};PixelPoint.prototype.setY=function(a){this.y=parseFloat(a);if(isNaN(this.y)){throw new Exception("PixelPoint: setY bad argument y: "+a)}};PixelPoint.prototype.toString=function(){return this.x+" "+this.y};PixelPoint.prototype.equals=function(a){if(a&&a.toString()==this.toString()){return true}else{return false}};function Position(f,b){this.lat=0;this.lon=0;if(arguments.length==1){var d=f.split(" ");if(d.length!=2){throw new Exception("error initializing Position object")}try{this.lat=parseFloat(d[0]);this.lon=parseFloat(d[1]);if(isNaN(this.lat)||isNaN(this.lon)){throw new Exception()}}catch(c){throw new Exception("error initializing Position object")}}else{if(arguments.length==2){try{this.lat=parseFloat(f);this.lon=parseFloat(b);if(isNaN(this.lat)||isNaN(this.lon)){throw new Exception()}}catch(c){throw new Exception("error initializing Position object")}}else{throw new Exception("error initializing Position object")}}if(this.lat>90){this.lat=89.5}if(this.lat<-90){this.lat=-89.5}if(this.lon>180||this.lon<-180){var a=this.lon%360;if(a<=-180){a=(360+a)}else{if(a>=180){a=-(360-a)}}this.lon=a}}Position.prototype.clone=function(){return new Position(this.toString())};Position.prototype.getLat=function(){return this.lat};Position.prototype.getLon=function(){return this.lon};Position.prototype.setLat=function(a){this.lat=a};Position.prototype.setLon=function(a){this.lon=a};Position.prototype.getLatLon=function(){return this.lat+" "+this.lon};Position.prototype.getLatCommaLon=function(){return this.lat+", "+this.lon};Position.prototype.equals=function(a){if(a&&a.getLatLon()==this.getLatLon()){return true}else{return false}};Position.prototype.toString=function(){return this.lat+" "+this.lon};function Radius(c,b){this.distance=c;this.uom=b||new UOM("KM");var a;if(b=="KM"){a="K"}else{if(b=="M"){a="M"}else{if(b=="MI"){a="R"}else{if(b=="FT"){a="F"}}}}this.uomdds=a;this.toString=function(){return this.distance+" "+this.uom};this.getDegrees=function(){if(b=="KM"){return this.distance/111.111}else{if(b=="M"){return(this.distance/1000)/111.111}else{if(b=="MI"){return(this.distance*1.609)/111.111}else{if(b=="FT"){return((this.distance/3.28)/1000)/111.111}}}}}}function Route(){this.alternates=[];this.TotalTime="";this.TotalTimeObject={};this.TotalDistance="";this.viaPointSequence="";this.RouteInstructions=[];this.RouteGeometry=[];this.routeID="";this.boundingBox=null;this.centerPosition=null;this.uom=null}function RouteInstruction(){this.Instruction="";this.distance="";this.duration="";this.position=null;this.tour=""}function RoutePreference(b,c,a){this.routePreference=b||"Fastest";this.uom=c||new UOM("KM");this.routeQueryType=a||"RTXT";this.rules=null;this.optimized=false;this.expectedStartTime=null;this.alternateRoutes=0;this.avoidAreas=[];this.avoidList=[];this.generalizationFactor=0;this.generalizationBBox=null;this.logisticsPreference=null;this.returnRouteGeometry=true;this.returnRouteInstructions=true}RoutePreference.prototype.setOptimized=function(a){this.optimized=a};RoutePreference.prototype.getOptimized=function(){return this.optimized};RoutePreference.prototype.setRules=function(a){this.rules=a};RoutePreference.prototype.getRules=function(){return this.rules};RoutePreference.prototype.setExpectedStartTime=function(a){this.expectedStartTime=a};RoutePreference.prototype.getExpectedStartTime=function(){return this.expectedStartTime};RoutePreference.prototype.getAvoidAreas=function(){return this.avoidAreas};RoutePreference.prototype.addAvoidArea=function(a){if(!a){this.avoidAreas=[]}else{this.avoidAreas.push(a)}};RoutePreference.prototype.getAvoidList=function(){return this.avoidList};RoutePreference.prototype.setAvoidList=function(a){if(typeof a=="string"||a instanceof "String"){switch(a.toLowerCase()){case"ferry":this.avoidList.push("Ferry");return;case"toll":this.avoidList.push("Toll");return;case"tunnels":this.avoidList.push("Tunnels");return;case"bridges":this.avoidList.push("Bridges");return;default:break}}throw new Exception("RoutePreference.setAvoidList: invalid argument: feature: "+a)};RoutePreference.prototype.getGeneralizationFactor=function(){return this.generalizationFactor};RoutePreference.prototype.setGeneralizationFactor=function(a,c){try{this.generalizationBBox=Utilities.positionsToBoundingBox(a);this.generalizationFactor=Utilities.generalizationFactor(this.generalizationBBox,c)}catch(b){throw b}};RoutePreference.prototype.enableLogistics=function(){this.logisticsPreference={};this.logisticsPreference.preferredRoute="";this.logisticsPreference.hazmat="";this.logisticsPreference.vehicleParameters="";this.logisticsPreference.vehicleTypes="";this.logisticsPreference.preferredTurn=""};function RouteQuery(){this.xmlRecFac=new deCarta.XMLStringBuilder();var b=[];var a=this;this.authenticate=function(d,c){if(!d||!c||d==""||c==""){throw new Exception("Error authenticating RouteQuery, invalid parameters.");return false}Credentials.clientName=d;Credentials.clientPassword=c;this.xmlRecFac.clientName=d;this.xmlRecFac.clientPassword=c};this.query=function(c,f,i,d){var g=Utilities.getRequestId();if(typeof i=="function"){b[g]=i}else{throw new Exception("RouteQuery.query: callBack must be a function, arg was: "+i)}var e=this.xmlRecFac.createRouteGeometryRequest(c,g,f);JSRequest.send(e,a.queryCallback,null,d)};this.queryById=function(g,f,c){var e=Utilities.getRequestId();if(typeof f=="function"){b[e]=f}else{throw new Exception("RouteQuery.queryById: callBack must be a function, arg was: "+f)}var d=this.xmlRecFac.createRouteGeometryByIdRequest(g,e);JSRequest.send(d,a.queryCallback,null,c)};this.queryCallback=function(e){var d=e.XLS.Response.requestID;var c;if(deCarta.JSONParser.parseErrors(e)){c=null}else{c=deCarta.JSONParser.parseRoutes(e)}if((d>=0)&&b[d]){b[d](c);b[d]=undefined}}}function ScaleBar(){this.init()}ScaleBar.prototype.map=null;ScaleBar.prototype.type="ScaleBar";ScaleBar.prototype.frameHeight=40;ScaleBar.prototype.frameWidth=120;ScaleBar.prototype.frame=null;ScaleBar.prototype.cssClass="decarta-scaleBar";ScaleBar.prototype.measureImperial=null;ScaleBar.prototype.measureMetric=null;ScaleBar.prototype.measureCssClass="decarta-scaleBarMeasure";ScaleBar.prototype.scaleImperial=null;ScaleBar.prototype.scaleImperialCssClass="decarta-scaleBarImperialScale";ScaleBar.prototype.scaleMetric=null;ScaleBar.prototype.scaleMetricCssClass="decarta-scaleBarMetricScale";ScaleBar.prototype.init=function(){};ScaleBar.prototype.build=function(){this.measureImperial=document.createElement("div");this.measureImperial.className=this.measureCssClass;Utilities.setUnselectable(this.measureImperial);this.scaleImperial=document.createElement("div");this.scaleImperial.className=this.scaleImperialCssClass;if(Utilities.ie6){this.scaleImperial.innerHTML="&nbsp;"}Utilities.setUnselectable(this.scaleImperial);this.measureMetric=document.createElement("div");this.measureMetric.className=this.measureCssClass;Utilities.setUnselectable(this.measureMetric);this.scaleMetric=document.createElement("div");this.scaleMetric.className=this.scaleMetricCssClass;if(Utilities.ie6){this.scaleMetric.innerHTML="&nbsp;"}Utilities.setUnselectable(this.scaleMetric);this.frame=document.createElement("div");this.frame.id=this.cssClass;this.frame.className=this.cssClass;Utilities.setUnselectable(this.frame);this.frame.appendChild(this.measureImperial);this.frame.appendChild(this.scaleImperial);this.frame.appendChild(this.scaleMetric);this.frame.appendChild(this.measureMetric)};ScaleBar.prototype.appendThis=function(){if(!this.frame){this.build()}return this.frame};ScaleBar.prototype.removeThis=function(){this.map=null;return this.frame};ScaleBar.prototype.position=function(b){if(!this.map){return}var a="px";this.frame.style.top=b.height-this.frameHeight+a;this.frame.style.left=b.width-this.frameWidth+a};ScaleBar.prototype.calculate=function(){if(!this.map||!this.map.getZoomController()){return}try{this.map.getCenterPosition()}catch(n){return}var v=this.map.getZoomController().getGXConvertedZoomLevel();var f=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),v);var d=this.map.getCenterPosition();var a=Math.cos(((d.lat)*(Math.PI/180)));var b=Utilities.lon2pix(d.lon,f);var u=Utilities.pix2lon(b+1,f);var t=Utilities.pix2lon(b,f);var c=u-t;var m=parseFloat(a*111325);var g=(c*m);var q=g*3.28;var o=this.frameWidth-15;this.scaleMetric.style.width=r(g,o)+"px";this.scaleImperial.style.width=k(q,o)+"px";this.measureMetric.innerHTML=j(g,o);this.measureImperial.innerHTML=i(q,o);function k(z,e){var w=[25,50,100,200,500,1000,2000,5280,10560,26400,52800,132000,264000,396000,528000,1056000,1584000,2640000,3168000,3696000,4224000,4752000,5280000,10560000,15840000,21120000,26400000];var A=z*e;var x;var p=w.length;for(x=0;x<p;x++){if(A<=w[x]){break}}x=(x-1>0)?x-1:0;var y=w[x]/z;return y}function i(y,e){var w=[25,50,100,200,500,1000,2000,5280,10560,26400,52800,132000,264000,396000,528000,1056000,1584000,2640000,3168000,3696000,4224000,4752000,5280000,10560000,15840000,21120000,26400000];var A=["25 ft","50 ft","100 ft","200 ft","500 ft","1000 ft","2000 ft","1 mi","2 mi","5 mi","10 mi","25 mi","50 mi","75 mi","100 mi","200 mi","300 mi","500 mi","600 mi","700 mi","800 mi","900 mi","1000 mi","2000 mi","3000 mi","4000 mi","5000 mi"];var z=y*e;var x;var p=w.length;for(x=0;x<p;x++){if(z<=w[x]){break}}x=(x-1>0)?x-1:0;return A[x]}function r(p,e){var x=[10,25,50,100,200,500,1000,2000,5000,10000,25000,50000,75000,100000,200000,300000,500000,600000,700000,800000,900000,1000000,2000000,3000000,4000000,5000000];var A=p*e;var y;var w=x.length;for(y=0;y<w;y++){if(A<=x[y]){break}}y=(y-1>0)?y-1:0;var z=x[y]/p;return z}function j(p,e){var x=[10,25,50,100,200,500,1000,2000,5000,10000,25000,50000,75000,100000,200000,300000,500000,600000,700000,800000,900000,1000000,2000000,3000000,4000000,5000000];var A=["10 m","25 m","50 m","100 m","200 m","500 m","1 km","2 km","5 km","10 km","25 km","50 km","75 km","100 km","200 km","300 km","500 km","600 km","700 km","800 km","900 km","1000 km","2000 km","3000 km","4000 km","5000 km"];var z=p*e;var y;var w=x.length;for(y=0;y<w;y++){if(z<=x[y]){break}}y=(y-1>0)?y-1:0;return A[y]}};ScaleBar.prototype.getDiv=function(){return this.frame};function SearchCriteria(f,b,a,d,c,e){if(d>100){throw new Exception("SearchCriteria constructor: maximumResponses cannot exceed 100");return}this.queryString=f;this.position=null;if(b&&b.clone){this.position=b.clone()}else{throw new Exception("SearchCriteria constructor: position not valid")}this.radius=a||new Radius(0.5);this.maximumResponses=d||10;this.database=c||null;this.sortDirection="Ascending";this.sortCriteria="Distance";this.allowAggregates=false;this.retrieveAll=false;this.properties={};this.defaultUOM=e||null}function ServerMonitor(){var _callBackArray=[];var _xmlStringBuilder=new deCarta.XMLStringBuilder();this.query=function(callBack){if(!callBack||(typeof callBack!="function")){return false}var reqId=Utilities.getRequestId();_callBackArray[reqId]=callBack;var xmlRequestString=_xmlStringBuilder.createRUOKRequest(reqId);this.sendServerMonitorQueryRequest(xmlRequestString);return true};this.sendServerMonitorQueryRequest=function(xmlRequestString){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(e){}var url=Credentials.url;if(url.indexOf("/openls/openls")>-1){url=url.substring(0,url.indexOf("/openls/openls"));url=url+"/openls/JSON?responseFormat=ALL"}var xmlhttp=null;try{if(XMLHttpRequest){xmlhttp=new XMLHttpRequest()}else{xmlhttp=new ActiveXObject()}}catch(e){}if(!xmlhttp){throw new Exception("ServerMonitor: I can't believe your system cannot generate an XMLHttpRequest. Oh the shame.")}xmlhttp.open("POST",url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var rawResponse=eval(xmlhttp.responseText);var response={};response.status=xmlhttp.status;response.xml=rawResponse.xmlResponse;response.json=rawResponse.response;if(_callBackArray[response.json.XLS.Response.requestID]){_callBackArray[response.json.XLS.Response.requestID](response)}}};xmlhttp.send(xmlRequestString)}}deCarta.String={};deCarta.String.isString=function(a){if(typeof a==="string"||a instanceof String){return true}else{return false}};deCarta.String.trim=function(a){return a.replace(/^\s*/,"").replace(/\s*$/,"")};deCarta.String.rtrim=function(a){return a.replace(/\s*$/,"")};deCarta.String.ltrim=function(a){return a.replace(/^\s*/,"")};deCarta.String.cleanUTF8=function(b){var a=decodeURIComponent(encodeURIComponent(b));return a};deCarta.StyleManager={};deCarta.StyleManager.stylesCreated=false;deCarta.StyleManager.cssString=".decarta-close{position:absolute; width:20px; height:20px; top:2px; left:178px; display:block; cursor:pointer;}.decarta-bubbleContent{padding:16px;}.decarta-bubble{display:none; width:200px; background-color:#ffffff; opacity:50; filter:alpha(opacity=90); opacity:0.9; border: 1px solid #cccccc; position:absolute; z-index:10000; color:#000000; font-size:11px;}.decarta-copyright{background-color:#ffffff; opacity:50; filter:alpha(opacity=80); opacity:0.8; padding:1px; font-family:arial; color:#000000; font-size:11px; border:1px solid #cccccc; display:block; position:absolute; z-index:9999;}.decarta-mapTypeController{background-color:#ffffff; opacity:50; filter:alpha(opacity=80); opacity:0.8; padding:3px; font-family:Arial; color:#000000; font-size:11px; font-weight:bold; border:1px solid #cccccc; display:block; position:absolute; visibility:visible; z-index:9999;}.decarta-mapTypeControllerLink{text-decoration:none;}.decarta-zoomButton{padding:0; margin:0; display:block;}.decarta-zoom{cursor: pointer; width: 20px; height:278px;top: 10px; left: 10px; position: absolute; z-index: 9999;}.decarta-zoomTop{margin:0px;padding:0px;position:absolute;left:0px;width:20px;top:0px;height:20px;}.decarta-zoomPillar{margin:0px;padding:0px;position:absolute;left:0px;width:20px;top:20px;height:238px;}.decarta-zoomBottom{margin:0px;padding:0px;position:absolute;left:0px;width:20px;top:258px;height:20px;}.decarta-zoomSlider{maring:0px;padding:0px;position:absolute;left:0px;width:20px;height:14px;}.decarta-scaleBar{position:absolute; width:120px; text-align:left; z-index:9999;}.decarta-scaleBarMeasure{font-family:arial; font-size:8pt; padding:0px 0px 0px 3px; margin:0;}.decarta-scaleBarImperialScale{display:block; padding:0; margin:0; font-size:6px; height:6px; border-left:2px solid #000; border-right:2px solid #000; border-bottom:1px solid #000;}.decarta-scaleBarMetricScale{display:block; padding:0; margin:0; font-size:6px; height:6px; border-left:2px solid #000; border-right:2px solid #000; border-top:1px solid #000;}.decarta-mapviewport{position:relative; z-index:0; overflow:hidden;}.decarta-tiles{position:absolute; left:0px; top:0px; z-index:0;}.decarta-maptile{z-index:0; position:absolute; display:none;}.decarta-panController{z-index:100; position:absolute; top:1px; left:1px; height:60px; width:60px; padding:0px; margin:0px; }.decarta-panController-north{position:absolute; top:0px; left:20px; height:20px; width:20px; padding:0px; margin:0px; cursor: pointer;}.decarta-panController-south{position:absolute; top:40px; left:20px; height:20px; width:20px; padding:0px; margin:0px; cursor: pointer;}.decarta-panController-east{position:absolute; top:20px; left:40px; height:20px; width:20px; padding:0px; margin:0px; cursor: pointer;}.decarta-panController-west{position:absolute; top:20px; left:0px; height:20px; width:20px; padding:0px; margin:0px;cursor: pointer; }.decarta-panController-center{position:absolute; top:20px; left:20px; height:20px; width:20px; padding:0px; margin:0px;cursor: pointer; }";deCarta.StyleManager.init=function(){if(deCarta.StyleManager.stylesCreated){return}if(document.styleSheets[0]&&document.styleSheets[0].cssText){document.styleSheets[0].cssText+=deCarta.StyleManager.cssString}else{var a=document.createElement("style");a.appendChild(document.createTextNode(deCarta.StyleManager.cssString));document.getElementsByTagName("head")[0].appendChild(a)}deCarta.StyleManager.stylesCreated=true};deCarta.StyleManager.getCurrentStyle=function(b,a){var c=b.style[d(a)];if(!c){if(document.defaultView){c=document.defaultView.getComputedStyle(b,"").getPropertyValue(a)}else{if(b.currentStyle){c=b.currentStyle[d(a)]}}}return c;function d(e){for(var f=/-([a-z])/;f.test(e);e=e.replace(f,RegExp.$1.toUpperCase())){}return e}};function TextOverlay(f,b,g,c,d,a,e){this.text=f||"";this.anchorX=b||0;this.anchorY=g||0;this.color=c||null;this.size=d||null;this.fontFamily=a||null;this.className=e||null;this.toString=function(){return this.text+" "+this.anchorX+" "+this.anchorY+" "+this.size+" "+this.fontFamily+" "+this.className}}TextOverlay.prototype.getAnchorX=function(){return this.anchorX};TextOverlay.prototype.getAnchorY=function(){return this.anchorY};TextOverlay.prototype.getText=function(){return this.text};TextOverlay.prototype.getClassName=function(){return this.className};TextOverlay.prototype.getColor=function(){return this.color};TextOverlay.prototype.getSize=function(){return this.size};TextOverlay.prototype.getFontFamily=function(){return this.fontFamily};TextOverlay.prototype.setAnchorX=function(a){this.anchorX=a};TextOverlay.prototype.setAnchorY=function(a){this.anchorY=a};TextOverlay.prototype.setText=function(a){this.text=a};TextOverlay.prototype.setClassName=function(a){this.className=a};TextOverlay.prototype.setColor=function(a){this.color=a};TextOverlay.prototype.setSize=function(a){this.size=a};TextOverlay.prototype.setFontFamily=function(a){this.fontFamily=a};function TrafficIncident(a,c,b){this.position=a;this.description=c||"";this.severity=b||"";this.toString=function(){return this.position+"  "+this.description}}function TrafficIncidentQuery(){this.xmlRecFac=new deCarta.XMLStringBuilder();var c=null;var b=[];var a=this;this.authenticate=function(e,d){if(!e||!d){throw new Exception("Error authenticating TrafficIncidentQuery, invalid parameters.")}Credentials.clientName=e;Credentials.clientPassword=d;this.xmlRecFac.clientName=e;this.xmlRecFac.clientPassword=d};this.query=function(e,g,d){var f=Utilities.getRequestId();if(typeof g=="function"){b[f]=g}else{throw new Exception("TrafficIncidentQuery.query: callBack must be a function, arg was: "+g)}c=this.xmlRecFac.createTrafficIncidentRequest(e,f);JSRequest.send(c,a.queryCallback,null,d)};this.queryCallback=function(j){var d=[];var g=j.XLS.Response.requestID;if(deCarta.JSONParser.parseErrors(j)){}else{var f=j.XLS.Response.TrafficResponse.Incident;var m=f.length;if(!m){d.push(new TrafficIncident(new Position(f.Position),f.Description,f.severity))}else{for(var e=0;e<f.length;e++){var k=f[e];d.push(new TrafficIncident(new Position(k.Position),k.Description,k.severity))}}}if((g>=0)&&b[g]){b[g](d);b[g]=undefined}}}function TrafficIncidentSearchCriteria(b,a,c,d){if(c>100){throw new Exception("maximumResponses cannot exceed 100")}this.position=b.clone();this.radius=a;this.maximumResponses=c;this.minimumSeverity=d}function UOM(a){if(a!="KM"&&a!="M"&&a!="MI"&&a!="FT"){throw new Exception("invalid UOM type,  KM M MI FT")}this.value=a;this.toString=function(){return this.value}}function Utilities(){}Utilities.regx2=new RegExp("\\s","g");Utilities.parseRequestIDFromXLS=function(b){var a=/requestID=[\'\"]([0-9]+)/;var d=a.exec(b);var c=null;if(d&&d[1]){c=d[1]}return c};Utilities.isObjectEmpty=function(c){var a=true;for(var b in c){if(c.hasOwnProperty(b)){a=false;break}}return a};Utilities.getElementByTagName=function(j,g,a){var c=g+":"+a;var f;if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){f=j.getElementsByTagNameNS("*",a)[0];if(!f){var b=j.getElementsByTagName("*");var e=b.length;for(var d=0;d<e;d++){if(b[d].nodeName==c){f=b[d];break}}}}else{f=j.getElementsByTagName(c)[0]}return f};Utilities.px="px";Utilities.LL2VR7=function(b){var f=b[0];var g=10000000;var a=(b.length)+","+(b[0].lat*g)+","+(b[0].lon*g);for(var e=1;e<b.length;e++){var d=Math.round((b[e].lat-f.lat)*g);var c=Math.round((b[e].lon-f.lon)*g);f=b[e];a+=","+d+","+c}return a};Utilities.timer=function(){this.green=null;this.red=null;this.start=function(){this.green=new Date().getTime()};this.stop=function(){this.red=new Date().getTime();return this.red-this.green}};Utilities.ie="\v"=="v";Utilities.ie6=(document.all&&!window.opera&&(typeof document.documentElement.style.maxHeight=="undefined"))?true:false;Utilities.fixPng=function(a){var b=a.src;if(a.style.height&&a.style.width){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"',sizingMethod='scale')"}else{a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"')"}a.src=Credentials.transparentGIF};Utilities.getScrollTop=function(){var a=0;if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){a=document.body.scrollTop}}return parseInt(a)};Utilities.getScrollLeft=function(){var a=0;if(document.documentElement&&document.documentElement.scrollLeft){a=document.documentElement.scrollLeft}else{if(document.body&&document.body.scrollLeft){a=document.body.scrollLeft}}return parseInt(a)};Utilities.podParse=function(b){var e=parseInt(b.substring(b.indexOf("P")+1,b.indexOf("D")));var a=parseInt(b.substring(b.indexOf("T")+1,b.indexOf("H")));var c=parseInt(b.substring(b.indexOf("H")+1,b.indexOf("M")));var d=parseInt(b.substring(b.indexOf("M")+1,b.indexOf("S")));if(e>0){return((e*24)+a)+" hours "+c+" minutes "}else{if(a>0){return a+" hours "+c+" minutes "}else{if(c>0){return c+" minutes "+d+" seconds "}else{return d+" seconds"}}}};Utilities.podParseJSON=function(b){var f=parseInt(b.substring(b.indexOf("P")+1,b.indexOf("D")));var e=parseInt(b.substring(b.indexOf("T")+1,b.indexOf("H")));var a=parseInt(b.substring(b.indexOf("H")+1,b.indexOf("M")));var c=parseInt(b.substring(b.indexOf("M")+1,b.indexOf("S")));return{days:f,hours:e,minutes:a,seconds:c}};Utilities.p=function(a){};Utilities.c=function(){};Utilities.generalize=function(m,t,j,r){j=Math.round(j/2);var c=t.getZoomLevel?t.getZoomLevel():t;var d=Utilities.radsPerPixelAtZoomLevel(r,c);var k=m.length;var b=[];var q,g,o,n,a,p,f;for(var e=0;e<k;e++){if(e==0||!q.contains(m[e])){g=Utilities.lat2pix(m[e].lat,d)+j;o=Utilities.lon2pix(m[e].lon,d)+j;n=Utilities.lat2pix(m[e].lat,d)-j;a=Utilities.lon2pix(m[e].lon,d)-j;p=Utilities.pix2lat(g,d)+" "+Utilities.pix2lon(o,d);f=Utilities.pix2lat(n,d)+" "+Utilities.pix2lon(a,d);q=new BoundingBox(new Position(f),new Position(p));b.push(m[e]);continue}}return b};Utilities.grouper=function(x,b,g,k){if(!x||!b||g<=0){throw new Exception("Utilities.grouper: Invalid input posArray: "+x+" zoom: "+b+" radius: "+g)}var o=b.getZoomLevel?b.getZoomLevel():b;var v=Utilities.radsPerPixelAtZoomLevel(k,o);var m=x.length;var c,y,p,a,t,u,w;var n=[];var e=[];var d=0;var r,q;var f=[];for(r=0;r<m;r++){for(q=0;q<d;q++){if(n[q].contains(x[r])){f[q].push(x[r]);break}}if(q!=d){continue}else{y=Utilities.lat2pix(x[r].lat,v)+g;p=Utilities.lon2pix(x[r].lon,v)+g;a=Utilities.lat2pix(x[r].lat,v)-g;t=Utilities.lon2pix(x[r].lon,v)-g;u=Utilities.pix2lat(y,v)+" "+Utilities.pix2lon(p,v);w=Utilities.pix2lat(a,v)+" "+Utilities.pix2lon(t,v);c=new BoundingBox(new Position(w),new Position(u));n[d]=c;e[d]=x[r];f[d]=[];d++;continue}}for(r=0;r<d;r++){f[r].push(e[r])}return f};Utilities.groupObjByPosition=function(c,p,g,o){var f,d;var b,n;var m=[];var a="gTag";var k;var e;if(!c||!c[0].position||!p||g<=0||!o||Position.prototype[a]){throw new Exception("Utilities.groupObjByPosition: Invalid input objArray: "+c+" zoom: "+p+" radius: "+g+" tileSize: "+o)}b=c.length;for(f=0;f<b;f++){m[f]=c[f].position.clone();m[f][a]=c[f]}k=Utilities.grouper(m,p,g,o);e=[];b=k.length;for(f=0;f<b;f++){e[f]=[];n=k[f].length;for(d=0;d<n;d++){e[f][d]=k[f][d][a]}}return e};Utilities.getRequestId=function(){return Math.floor(Math.random()*10000000)};Utilities.getAbsoluteLeft=function(c){var b=c.offsetLeft;var a=c.offsetParent;while(a!=null){b+=a.offsetLeft;a=a.offsetParent}return b};Utilities.getAbsoluteTop=function(c){var b=c.offsetTop;var a=c.offsetParent;while(a!=null){b+=a.offsetTop;a=a.offsetParent}return b};Utilities.unloadMap=function(a){a.removeAllPins();Utilities.purge(a.mapDiv)};Utilities.purge=function(f){var c=f.attributes,e,b,g;if(c){b=c.length;for(e=0;e<b;e+=1){g=c[e].name;if(typeof f[g]==="function"){f[g]=null}}}c=f.childNodes;if(c){b=c.length;for(e=0;e<b;e+=1){Utilities.purge(f.childNodes[e])}}};Utilities.what=function(c){var b="";for(var a in c){b+="  "+a}alert(b)};Utilities.normalizePrefixes=function(j){var e=new RegExp("ns1:","g");var i=j.replace(e,"xls:");var d=new RegExp("ns\\d+:","g");var g=i.replace(d,"gml:");var b=new RegExp('\\sxmlns:ns\\d+="http://www.opengis.net/gml"',"g");var f=g.replace(b,"");var a=new RegExp('xmlns:ns1="http://www.opengis.net/xls"',"g");var c=f.replace(a,'xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml"');return c};Utilities.centerContextToBoundingBox=function(i,b){var g=b/111.111;var a=(i.lon-parseFloat(g));var f=(i.lon+parseFloat(g));var e=g*Math.cos(((i.lat*Math.PI)/180));var d=(i.lat-parseFloat(e));var c=(i.lat+parseFloat(e));return new BoundingBox(new Position(d,a),new Position(c,f))};Utilities.centerContextToBoundingBoxViewable=function(i,b,a){var d=b/111.111;var c=a/111.111;var j=(i.lon-parseFloat(d));var k=(i.lon+parseFloat(d));var g=c*Math.cos(((i.lat*Math.PI)/180));var e=(i.lat-parseFloat(g));var f=(i.lat+parseFloat(g));return new BoundingBox(new Position(e,j),new Position(f,k))};Utilities.latLonToPixels=function(c,e,d){var b=d*((e.lon-c.minPosition.lon)/(c.maxPosition.lon-c.minPosition.lon));var a=d*((c.maxPosition.lat-e.lat)/(c.maxPosition.lat-c.minPosition.lat));return new PixelPoint(Math.round(b),Math.round(a))};Utilities.formatRadiusToString=function(a){if(typeof a=="number"||typeof a!="string"){a=a.toString()}return a.replace(new RegExp(","),".")};Utilities.pixelsToLatLon=function(o,n,j,f,a,b,q,k){try{o=j-o;n=f-n;var p=q.getLat();var i=q.getLon();var g=(k*2)/111.111;var c=g/(a*b);var d=(g/Math.cos(((p*Math.PI)/180)))/(a*b);if(n!=0){p=""+(parseFloat(p)+parseFloat(n*c))}if(o!=0){i=""+(parseFloat(i)-parseFloat(o*d))}return new Position(p,i)}catch(m){throw new Exception(m.message)}};Utilities.positionsToBoundingBox=function(a){if(!a||a.length<2){throw new Exception("Utilities.positionsToBoundingBox requires at least two positions")}var b;for(var c=0;c<a.length;c++){if(c==0){b=new BoundingBox(new Position(a[c].toString()),new Position(a[c].toString()))}else{if(a[c].lat>b.getMaxPosition().lat){b.getMaxPosition().lat=a[c].lat}if(a[c].lon>b.getMaxPosition().lon){b.getMaxPosition().lon=a[c].lon}if(a[c].lat<b.getMinPosition().lat){b.getMinPosition().lat=a[c].lat}if(a[c].lon<b.getMinPosition().lon){b.getMinPosition().lon=a[c].lon}}}b.heightInDegrees=b.maxPosition.lat-b.minPosition.lat;b.widthInDegrees=b.maxPosition.lon-b.minPosition.lon;return b};Utilities.pinsToBoundingBox=function(d,g){if(!g){throw new Exception("Utilities.pinsToBoundingBox requires a scale argument")}if(!d||d.length<2){throw new Exception("Utilities.pinsToBoundingBox requires at least two pins")}var c=new Position(0,0);var b=new Position(0,0);for(var a=0;a<d.length;a++){var f=d[a].getViewableBoundingBox(g);if(a!=0){if(f.maxPosition.lat>c.lat){c.lat=f.maxPosition.lat}if(f.maxPosition.lon>c.lon){c.lon=f.maxPosition.lon}if(f.minPosition.lat<b.lat){b.lat=f.minPosition.lat}if(f.minPosition.lon<b.lon){b.lon=f.minPosition.lon}continue}else{c.lat=f.maxPosition.lat;c.lon=f.maxPosition.lon;b.lat=f.minPosition.lat;b.lon=f.minPosition.lon}}var e=new BoundingBox(b,c);return e};Utilities.pixYDist=function(i,f,c,d){if(!d){d=GLOBALS.DEFAULT_MAP_TILE_SIZE}var b=c.getGXConvertedZoomLevel();var a=Utilities.radsPerPixelAtZoom(d,b);var g=Math.round(Utilities.lat2pix(i,a));var e=Math.round(Utilities.lat2pix(f,a));return Math.abs(g-e)};Utilities.pixXDist=function(f,d,c,e){if(!e){e=GLOBALS.DEFAULT_MAP_TILE_SIZE}var b=c.getGXConvertedZoomLevel();var a=Utilities.radsPerPixelAtZoom(e,b);var i=Math.round(Utilities.lon2pix(f,a));var g=Math.round(Utilities.lon2pix(d,a));return Math.abs(i-g)};Utilities.lat2pix=function(d,f){var e=(parseFloat(d)*(2*Math.PI))/360;var b=0.08181919084262157;var a=Math.sin(e);var g=b*a;var c=Math.log(((1+a)/(1-a))*Math.pow((1-g)/(1+g),b))/2;return(c/f)};Utilities.lon2pix=function(b,a){return((b/180)*Math.PI)/a};Utilities.radsPerPixelAtZoom=function(b,a){return 2*Math.PI/(b<<a)};Utilities.radsPerPixelAtZoomLevel=function(b,c){var a=Math.abs(21-c);return 2*Math.PI/(b<<a)};Utilities.deCartaToGXZoomLevel=function(b){var a=Math.abs(21-parseInt(b,10));return a};Utilities.pix2lon=function(a,b){return(a*b)*180/Math.PI};Utilities.pix2lat=function(i,f){var g=1e-7;var e=12;var b=Math.pow(Math.E,-i*f);var d=Utilities.mercatorUnproject(b);var a=Utilities.findRadPhi(d,b);var c=0;while(c<e&&Math.abs(d-a)>g){d=a;a=Utilities.findRadPhi(d,b);c++}return a*180/Math.PI};Utilities.mercatorUnproject=function(a){return(Math.PI/2)-2*Math.atan(a)};Utilities.findRadPhi=function(c,b){var a=0.08181919084262157;var d=a*Math.sin(c);return(Math.PI/2)-(2*Math.atan(b*Math.pow((1-d)/(1+d),a/2)))};Utilities.generalizationFactor=function(e,d){if(!e||!d||!e.minPosition){throw new Exception("Utilities.generalizationFactor: bad input.bbox: "+e+"zoomLevel: "+d)}var c=[0.14916746,0.298780196,0.597003797,1.19445287,2.388571783,4.777143566,9.554287132,19.10857426,38.21725985,76.43440838,152.8688168,305.7376335,611.475267,1222.950534,2445.901068,4891.802136,9783.604272,19567.20854,39134.41709,78268.83418,156537.6684,313075.3367];var b=e.minPosition.lat*Math.PI/180;var a=c[d-1];return(a*Math.cos(b))};Utilities.setUnselectable=function(a){if(a){if(typeof a.onselectstart!="undefined"){a.onselectstart=function(c){c=c||event;var b=c.target||c.srcElement;if(b=="[object Text]"&&b.parentNode){b=b.parentNode}if(!deCarta.IdManager.checkTag(b,"txtSelectable")){return false}else{return true}}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="-moz-none"}else{}}}};Utilities.setSelectable=function(a){if(a){if(typeof a.onselectstart!="undefined"){deCarta.IdManager.setTag(a,"txtSelectable")}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="text"}else{}}}};Utilities.vrToPositions=function(d){if(!d){throw new Exception("vrToPositions: illegal argument: "+d)}var g=d.replace(/%[Vv][Rr]=/,"").split(",");var k=g[0]-1;var a=f(g[1]);var e=f(g[2]);var b=g.slice(3);var m=[];m.push(new Position(a,e));var c;for(c=0;c<k;c++){a+=f(b[0]);e+=f(b[1]);b=b.slice(2);var j=new Position(a,e);m.push(j)}return m;function f(t){var p;var n="";if(t.toString().charAt(0)=="-"){n="-";t=t.slice(1)}t=t.toString();var r=t.length;var q;if(r<=5&&r>0){q=["0","0","0","0","0"];var o=5;for(p=1;p<=r;p++){q[o-p]=t.charAt(r-p)}return(parseFloat(parseFloat(n+"0."+q.join("")).toFixed(5)))}else{if(r>5){q=[];for(p=0;p<r;p++){q.push(t.charAt(p));if(r-p-1==5){q.push(".")}}return(parseFloat(parseFloat(n+q.join("")).toFixed(5)))}else{throw new Exception("vrToPositions failed in vrOffsetToFloat with "+t)}}}};Utilities.vr7ToPositions=function(d){if(!d){throw new Exception("vr7ToPositions: illegal argument: "+d)}var f=d.replace(/%[Vv][Rr]7=/,"").split(",");var k=f[0]-1;var a=g(f[1]);var e=g(f[2]);var b=f.slice(3);var m=[];m.push(new Position(a,e));var c;for(c=0;c<k;c++){a+=g(b[0]);e+=g(b[1]);b=b.slice(2);var j=new Position(a,e);m.push(j)}return m;function g(t){var p;var n="";if(t.toString().charAt(0)=="-"){n="-";t=t.slice(1)}t=t.toString();var r=t.length;var q;if(r<=7&&r>0){q=["0","0","0","0","0","0","0"];var o=7;for(p=1;p<=r;p++){q[o-p]=t.charAt(r-p)}return parseFloat(parseFloat(n+"0."+q.join("")).toFixed(7))}else{if(r>7){q=[];for(p=0;p<r;p++){q.push(t.charAt(p));if(r-p-1==7){q.push(".")}}return parseFloat(parseFloat(n+q.join("")).toFixed(7))}else{throw new Exception("vrToPositions failed in vrOffsetToFloat with "+t)}}}};Utilities.positionsToVr=function(e){if(!e&&!e.length){throw new Exception("positionsToVr: cannot create empty VR string.")}var d;var c=e.length;var f=[];f.push("%VR="+c);f.push(k(e[0].lat));f.push(k(e[0].lon));var j=e[0].lat;var a=e[0].lon;for(d=1;d<c;d++){var b=e[d].lat-j;f.push(k(b));j+=b;var g=e[d].lon-a;f.push(k(g));a+=g}return f.join(",");function k(m){var i=parseFloat(parseFloat(m).toFixed(5).toString().replace(/\./,""));return i}};Utilities.positionsToVr7=function(f){if(!f&&!f.length){throw new Exception("positionsToVr7: cannot create empty VR string.")}var e;var d=f.length;var g=[];g.push("%VR7="+d);g.push(b(f[0].lat));g.push(b(f[0].lon));var k=f[0].lat;var a=f[0].lon;for(e=1;e<d;e++){var c=f[e].lat-k;g.push(b(c));k+=c;var j=f[e].lon-a;g.push(b(j));a+=j}return g.join(",");function b(m){var i=parseFloat(parseFloat(m).toFixed(7).toString().replace(/\./,""));return i}};function WSXMLTunnel(){var a=this;this.responseFormat="XML";var b=[];this.send=function(c,e){if(!deCarta.String.isString(c)){if(!window.Sarissa&&!window.Sarissa.serialize){throw new Exception("Sarissa is required to use the WSXMLTunnel with XMLDocument Objects.")}c=Sarissa.serialize(c)}var d=Utilities.parseRequestIDFromXLS(c);if(typeof e=="function"){b[d]=e}else{throw new Exception("WSXMLTunnel.send: callBack must be a function, arg was: "+e)}JSRequest.send(c,this._callBack,this.responseFormat)};this._callBack=function(c){var d,e;if(a.responseFormat=="XML"){d=Utilites.normalizePrefixes(c);e=Utilities.parseRequestIDFromXLS(c)}else{d=c;if(deCarta.Array.isArray(d.XLS.Response)){e=d.XLS.Response[0].requestID}else{e=d.XLS.Response.requestID}}b[e](d)}}deCarta.XMLStringBuilder=function(){this.overlays=[];this.routeIDOverlay=null;this.rendering="server";this.routeID=null;this.clientName=Credentials.clientName;this.clientPassword=Credentials.clientPassword;this.configuration=Credentials.configuration;this.transparentConfiguration=Credentials.transparentConfiguration;this.mapType=GLOBALS.STREET;this.streetImgFormat="PNG";this.hybridImgFormat="PNG"};deCarta.XMLStringBuilder.prototype.getRequestHeader=function(a,b){a=a||Utilities.getRequestId();var c="<xls:XLS version='1' xls:lang='en' xmlns:xls='http://www.opengis.net/xls'";if(Credentials.rel){c+=" rel='"+Credentials.rel+"' "}c+="xmlns:gml='http://www.opengis.net/gml'><xls:RequestHeader clientName='"+this.clientName+"' sessionID='"+a+"' clientPassword='"+this.clientPassword+"' configuration='";if(this.mapType=="STREET"){c+=this.configuration+"'"}else{c+=this.transparentConfiguration+"'"}if(b){c+=" defaultUOM='"+b+"' "}c+="/>";return c};deCarta.XMLStringBuilder.prototype.getRequestOpen=function(a,c,b){b=b||"10";c=c||Utilities.getRequestId();var d="<xls:Request maximumResponses='"+b+"' version='1.0' requestID='"+c+"' methodName='"+a+"'>";return d};deCarta.XMLStringBuilder.prototype.getHeader=function(a,c,b,d,e){var f=this.getRequestHeader(d,e);f+=this.getRequestOpen(a,c,b);return f};deCarta.XMLStringBuilder.prototype.getFooter=function(){return"</xls:Request></xls:XLS>"};deCarta.XMLStringBuilder.prototype.createRUOKRequest=function(b){var a=this.getHeader("RuokRequest",b,25,Utilities.getRequestId());a+="<xls:RUOKRequest />"+this.getFooter();return a};deCarta.XMLStringBuilder.prototype.createMapRequest=function(i,d,f,e,c,b,g){var a=this.getHeader("PortrayMapRequest",f,null,g);a+="<xls:PortrayMapRequest><xls:Output height='"+d+"' width='"+d+"' ";a+="format='"+(this.mapType=="STREET"?this.streetImgFormat:this.hybridImgFormat)+"' fixedgrid='true' useCache='true'><xls:CenterContext SRS='WGS-84'><xls:CenterPoint><gml:pos>"+i.toString()+"</gml:pos></xls:CenterPoint><xls:Radius unit='KM'>4</xls:Radius></xls:CenterContext><xls:TileGrid rows='1' columns='1'><xls:GridLayer name='deCarta'/><xls:GridLayer name='globexplorer' meta-inf='zoom=";if(!c){a+=Utilities.deCartaToGXZoomLevel(e)}else{a+=Utilities.deCartaToGXZoomLevel(c)+":"+Utilities.deCartaToGXZoomLevel(e)}a+="'/></xls:TileGrid></xls:Output>"+this.overlaysToXLSString();if(Credentials.trafficEnabled){if(b){a+="<xls:Overlay><xls:Traffic><xls:FlowReporting/></xls:Traffic></xls:Overlay>"}else{a+="<xls:Overlay><xls:Traffic><xls:FlowReporting"+(b?" time='"+b+"'":"")+"/></xls:Traffic></xls:Overlay>"}}a+="</xls:PortrayMapRequest>";a+=this.getFooter();return a};deCarta.XMLStringBuilder.prototype.createGeocodeRequest=function(a,e,d){var b=this.getHeader("GeocodeRequest",e);b+="<xls:GeocodeRequest";if(d){b+=" returnFreeForm='true'>"}else{b+=" returnFreeForm='false'>"}b+="<xls:Address countryCode='"+a.getLocale().getCountry()+"'";b+=" language='"+a.getLocale().getLanguage()+"'>";if(a.type=="FreeForm"){b+="<xls:freeFormAddress>"+a.toString()+"</xls:freeFormAddress>"}else{var c="";var f="";if(!(a.buildingNumber&&a.street)&&(a.streetNameAndNumber)){b+="<xls:StreetNameAndNumber>"+a.streetNameAndNumber+"</xls:StreetNameAndNumber>"}else{if(a.buildingNumber||a.buildingNumber==0){c="<xls:Building number='"+a.buildingNumber+"'/>"}if(a.street){f="<xls:Street>"+a.street+"</xls:Street>"}if(a.street){b+="<xls:StreetAddress>"+c+f+"</xls:StreetAddress>"}}if(a.countrySubdivision){b+="<xls:Place type='CountrySubdivision'>"+a.countrySubdivision+"</xls:Place>"}if(a.countrySecondarySubdivision){b+="<xls:Place type='CountrySecondarySubdivision'>"+a.countrySecondarySubdivision+"</xls:Place>"}if(a.countryTertiarySubdivision){b+="<xls:Place type='CountryTertiarySubdivision'>"+a.countryTertiarySubdivision+"</xls:Place>"}if(a.municipality){b+="<xls:Place type='Municipality'>"+a.municipality+"</xls:Place>"}if(a.municipalitySubdivision){b+="<xls:Place type='MunicipalitySubdivision'>"+a.municipalitySubdivision+"</xls:Place>"}if(a.postalCode){b+="<xls:PostalCode>"+a.postalCode+"</xls:PostalCode>"}}b+="</xls:Address></xls:GeocodeRequest>";b+=this.getFooter();return b};deCarta.XMLStringBuilder.prototype.createReverseGeocodeRequest=function(c,b){var a=this.getHeader("ReverseGeocodeRequest",b);a+="<xls:ReverseGeocodeRequest><xls:Position><gml:Point><gml:pos>"+c.toString()+"</gml:pos></gml:Point></xls:Position>";a+="<xls:ReverseGeocodePreference>StreetAddress</xls:ReverseGeocodePreference>";a+="</xls:ReverseGeocodeRequest>";a+=this.getFooter();return a};deCarta.XMLStringBuilder.prototype.createPOIRequest=function(c,e){var d=deCarta.Array.isArray(c);var b;var a="";if(d){a+=this.getRequestHeader(null,c.defaultUOM);for(b=0;b<c.length;b++){a+=this.getRequestOpen("DirectoryRequest",e,c[b].maximumResponses);a+=this.getDirectoryRequest(c[b]);a+="</xls:Request>"}a+="</xls:XLS>"}else{a+=this.getHeader("DirectoryRequest",e,c.maximumResponses,null,c.defaultUOM);a+=this.getDirectoryRequest(c);a+=this.getFooter()}return a};deCarta.XMLStringBuilder.prototype.createFullDetailsPOIRequest=function(c,b){var a=this.getHeader("DirectoryRequest",b,10);a+='<xls:DirectoryRequest paging="current"><xls:POI ID="'+c+'"/></xls:DirectoryRequest>';a+=this.getFooter();return a};deCarta.XMLStringBuilder.prototype.getDirectoryRequest=function(d){var c="";c+="<xls:DirectoryRequest";if(d.database!=null){c+=" database='"+d.database+"'"}if(d.sortDirection){c+=" sortDirection='"+d.sortDirection+"'"}if(d.sortCriteria){c+=" sortCriteria='"+d.sortCriteria+"'"}if(d.allowAggregates){c+=" allowAggregates='true'"}c+=">";c+="<xls:POILocation><xls:WithinDistance>";c+="<xls:POI ID='1'><gml:Point><gml:pos>"+d.position.toString()+"</gml:pos></gml:Point></xls:POI>";c+="<xls:MinimumDistance value='0' uom='KM'/><xls:MaximumDistance value='"+d.radius.distance+"' uom='"+d.radius.uom.value+"'/>";c+="</xls:WithinDistance></xls:POILocation>";c+="<xls:POIProperties>";if(!d.retrieveAll){var b=false;for(var a in d.properties){if(d.properties.hasOwnProperty(a)){b=true;c+="<xls:POIProperty value='"+d.properties[a]+"' name='"+a+"'/>"}}if(!b){c+="<xls:POIProperty value='"+d.queryString+"' name='Keyword'/>"}}c+="</xls:POIProperties></xls:DirectoryRequest>";return c};deCarta.XMLStringBuilder.prototype.createRouteGeometryRequest=function(a,f,e){var b=this.getHeader("DetermineRouteRequest",f);b+="<xls:DetermineRouteRequest distanceUnit='"+e.uom+"' routeQueryType='"+e.routeQueryType+"' provideRouteHandle='true'";if(e.alternateRoutes){b+=" numAltRoutes='"+e.alternateRoutes+"'"}b+=">";b+="<xls:RoutePlan";if(Credentials.trafficEnabled){b+=" useRealTimeTraffic='true'"}if(e.optimized){b+=" optimize='true'"}if(Credentials.trafficEnabled&&e.expectedStartTime){b+=" expectedStartTime='"+e.expectedStartTime+"'"}b+=">";b+="<xls:RoutePreference>"+e.routePreference+"</xls:RoutePreference>";b+="<xls:WayPointList>";for(var d=0;d<a.length;d++){if(d==0){b+="<xls:StartPoint><xls:Position><gml:Point><gml:pos>"+a[d].toString()+"</gml:pos></gml:Point></xls:Position></xls:StartPoint>"}else{if(d>0&&d<(a.length-1)){b+="<xls:ViaPoint><xls:Position><gml:Point><gml:pos>"+a[d].toString()+"</gml:pos></gml:Point></xls:Position></xls:ViaPoint>"}else{if(d==(a.length-1)){b+="<xls:EndPoint><xls:Position><gml:Point><gml:pos>"+a[d].toString()+"</gml:pos></gml:Point></xls:Position></xls:EndPoint>"}}}}b+="</xls:WayPointList>";if(e.avoidList.length>0||e.avoidAreas.length>0){b+="<xls:AvoidList>";for(d=0;d<e.avoidAreas.length;d++){b+=this.avoidAreasToXLSString(e.avoidAreas[d])}for(d=0;d<e.avoidList.length;d++){b+="<xls:AvoidFeature>"+e.avoidList[d].toString()+"</xls:AvoidFeature>"}b+="</xls:AvoidList>"}var c=e.logisticsPreference;if(c&&(c.preferredRoute||c.hazmat||c.vehicleParameters||c.vehicleTypes||c.preferredTurn)){b+="<xls:Logistics>";if(c.preferredRoute){b+="<xls:PreferredRoute>"+c.preferredRoute+"</xls:PreferredRoute>"}if(c.hazmat){b+="<xls:Hazmat>"+c.hazmat+"</xls:Hazmat>"}if(c.vehicleParameters){b+="<xls:VehicleParameters>"+c.vehicleParameters+"</xls:VehicleParameters>"}if(c.vehicleTypes){b+="<xls:VehicleTypes>"+c.vehicleTypes+"</xls:VehicleTypes>"}if(c.preferredTurn){b+="<xls:PreferredTurn>"+c.preferredTurn+"</xls:PreferredTurn>"}b+="</xls:Logistics>"}b+="</xls:RoutePlan>";if(e.returnRouteInstructions){b+="<xls:RouteInstructionsRequest providePoint='true'";if(e.rules){b+=" rules='"+e.rules+"'"}b+="/>"}b+="<xls:RouteGeometryRequest returnRouteIDOnly=";if(e.returnRouteGeometry){b+="'false'"}else{b+="'true'"}if(e.generalizationFactor&&e.generalizationFactor!==0&&e.generalizationBBox){b+=" resolution ='"+e.generalizationFactor+"'>";b+="<xls:BoundingBox><gml:pos>"+e.generalizationBBox.minPosition+"</gml:pos><gml:pos>"+e.generalizationBBox.maxPosition+"</gml:pos></xls:BoundingBox></xls:RouteGeometryRequest>"}else{b+="/>"}b+="</xls:DetermineRouteRequest>";b+=this.getFooter();return b};deCarta.XMLStringBuilder.prototype.createRouteGeometryByIdRequest=function(d,c,b){var a=this.getHeader("DetermineRouteRequest",c,null,b);a+="<xls:DetermineRouteRequest><xls:RouteHandle serviceID='DetermineRouteService' routeID='"+d+"'/><xls:RouteInstructionsRequest providePoint='true'/><xls:RouteGeometryRequest/>";a+="</xls:DetermineRouteRequest>";a+=this.getFooter();return a};deCarta.XMLStringBuilder.prototype.createTrafficIncidentRequest=function(b,c){var a=this.getHeader("TrafficRequest",c,b.maxiumResponses);a+="<xls:TrafficRequest><xls:IncidentReporting minimumSeverity='"+b.minimumSeverity+"'/>";a+="<xls:CenterContext SRS='WGS-84'><xls:CenterPoint><gml:pos>"+b.position+"</gml:pos></xls:CenterPoint>";a+="<xls:Radius unit='"+b.radius.uom.value+"'>"+b.radius.distance+"</xls:Radius></xls:CenterContext>";a+="</xls:TrafficRequest>";a+=this.getFooter();return a};deCarta.XMLStringBuilder.prototype.overlaysToXLSString=function(){var f=[];if(this.routeIDOverlay){f.push("<xls:Overlay><xls:RouteID>"+this.routeIDOverlay+"</xls:RouteID></xls:Overlay>")}for(var c=0;c<this.overlays.length;c++){if(this.overlays[c].rendering=="client"||(this.rendering!="server"&&this.overlays[c].rendering!="server")){continue}if(!this.overlays[c]||(this.overlays[c]&&!this.overlays[c].isVisible)){continue}var b="";var e=this.overlays[c];b+="<xls:Overlay>";if(e.type=="line"){b+="<xls:Shape color='"+e.fillColor+"_"+e.borderColor+"' style='"+e.borderStyle+"' width='"+e.width+"_"+e.borderWidth+"'";if(e.strokeOpacity){b+=" opacity='"+e.strokeOpacity+"'"}else{b+=" opacity='"+e.opacity+"'"}}else{b+="<xls:Shape type='"+e.type+"' color='"+e.fillColor+"_"+e.borderColor+"' style='"+e.borderStyle+"' width='"+e.borderWidth+"'";if(e.strokeOpacity||e.fillOpacity){var a=e.strokeOpacity||e.opacity;var d=e.fillOpacity||e.opacity;b+=" opacity='"+d+"_"+a+"'"}else{b+=" opacity='"+e.opacity+"'"}}if(e.type=="circle"){b+=" pointspec='LL' radius='"+e.radius.uomdds+e.radius.distance+"'>"+e.position.lat+","+e.position.lon}else{e.VR7=e.VR7||Utilities.LL2VR7(e.positions);if(e.type=="line"){b+=" pointspec='VR7'>"+e.VR7}else{b+=" pointspec='VR7PG'>"+e.VR7}}b+="</xls:Shape></xls:Overlay>";f.push(b)}var g=f.join("");return g};deCarta.XMLStringBuilder.prototype.avoidAreasToXLSString=function(b){var c;var a="<xls:AOI>";if(/Line/i.test(b.name)){a+="<gml:LineString>";for(c=0;c<b.pos.length;c++){a+="<gml:pos>"+b.pos[c]+"</gml:pos>"}a+="</gml:LineString>"}else{if(/Polygon/i.test(b.name)){a+="<gml:Polygon><gml:exterior><gml:LinearRing>";for(c=0;c<b.pos.length;c++){a+="<gml:pos>"+b.pos[c]+"</gml:pos>"}a+="</gml:LinearRing></gml:exterior></gml:Polygon>"}else{if(/Rectangle/i.test(b.name)){a+="<gml:Envelope>";a+="<gml:pos>"+b.pos[0]+"</gml:pos><gml:pos>"+b.pos[1]+"</gml:pos>";a+="</gml:Envelope>"}else{if(/Circle/i.test(b.name)){a+="<gml:CircleByCenterPoint numArc='1'>";a+="<gml:pos>"+b.pos[0]+"</gml:pos>";a+="<gml:radius uom='"+b.radius.uom+"'>"+b.radius.distance+"</gml:radius>";a+="</gml:CircleByCenterPoint>"}else{throw new Exception("deCarta.XMLStringBuilder.avoidAreasToXLSString: invalid type of avoid object: "+b.name)}}}}a+="</xls:AOI>";return a};function ZoomController(f,d,c,p,n,a){this.selected=f||5;if(isNaN(parseInt(this.selected))||this.selected<0||this.selected>17){throw new Exception("Error instantiating ZoomController, invalid initial value "+f+".  The value must be between 1 and 17");return false}this.domView=true;this.zoomLevels=17;this.lowerBound=1;this.upperBound=17;this.color=d||"";this.uncheckedSrc=p||Credentials.zoomUnselectedIconPath;this.checkedSrc=c||Credentials.zoomSelectedIconPath;this.bottomCapSrc=a||Credentials.zoomOutIconPath;this.topCapSrc=n||Credentials.zoomInIconPath;this.zoomer=null;this.map=null;this.type="ZoomController";this.frame=null;var o=this;var j=new Array();var e=null;var g=null;var k;var m;var b=true;this.setDomView=function(q){q=(q)?true:false;this.domView=q};this.initialize=function(){if(!this.domView){return false}var v;var q="decarta-zoomButton";for(v=o.lowerBound;v<=o.upperBound;v++){var u=document.createElement("img");deCarta.IdManager.setTag(u,"ignoreForMapEvents");u.id="decarta-z"+v;u.className=q;u.src=o.uncheckedSrc;u.onclick=function(){if(!GLOBALS.ALLOWDOMEVENTS){return true}o.map.zoomMap(this.id.substring(9));return true};if(Utilities.ie6){Utilities.fixPng(u)}j.push(u)}e=document.createElement("IMG");e.id="decarta-ztop";e.src=this.topCapSrc;e.className=q;if(Utilities.ie6){Utilities.fixPng(e)}e.onclick=function(w){if(!GLOBALS.ALLOWDOMEVENTS){return true}w=w||event;w.stoppropagation?w.stoppropagation():w.cancelBubble=true;o.zoomInOneLevel();return true};deCarta.IdManager.setTag(e,"ignoreForMapEvents");g=document.createElement("IMG");g.src=this.bottomCapSrc;g.className=q;if(Utilities.ie6){Utilities.fixPng(g)}g.id="decarta-zbottom";g.onclick=function(w){if(!GLOBALS.ALLOWDOMEVENTS){return true}w=w||event;w.stoppropagation?w.stoppropagation():w.cancelBubble=true;o.zoomOutOneLevel();return true};deCarta.IdManager.setTag(g,"ignoreForMapEvents");var t="decarta-zoom";var r=t;o.frame=document.createElement("DIV");o.frame.id=t;o.frame.className=r;o.frame.innerHTML="";if(o.color){o.frame.style.backgroundColor=o.color}deCarta.IdManager.setTag(o.frame,"ignoreForMapEvents");o.frame.appendChild(e);for(v=0;v<j.length;v++){o.frame.appendChild(j[v])}o.frame.appendChild(g);this.zoomer=this.frame;if(!b){this.frame.style.display="none"}this.setZoomLevel(o.selected);return true};this.setZoomRange=function(q,r){if(q<1||r>21||q>r){throw new Exception("illegal values setZoomRange: "+q+", "+r)}if(o.selected>r){o.selected=r}if(o.selected<q){o.selected=q}o.zoomLevels=r;o.lowerBound=q;o.upperBound=r};this.setZoomButtonImages=function(u,t,q,v){if(u){this.checkedSrc=u}if(t){this.uncheckedSrc=t}if(u||t){for(var r=0;r<j.length;r++){j[r].src=this.uncheckedSrc}if(o.selected){j[o.selected-1].src=this.checkedSrc}}if(q){this.topCapSrc=q;e.src=q}if(v){this.bottomCapSrc=v;g.src=v}};this.setColor=function(q){this.frame.style.backgroundColor=q};this.show=function(){b=true;if(this.frame){this.frame.style.display="block"}};this.hide=function(){b=false;if(this.frame){this.frame.style.display="none"}};this.getRadius=function(){return k};this.setRadius=function(u){m=u;var t=o.map.getGridSize().split(" ");var v=t[0];var q=t[1];if(v==q){k=u}else{k=(m/q)*v}};this.getRadiusX=function(){return m};this.setRadiusX=function(q){m=q};this.getMinViewableRadius=function(){var v=o.map.getGridSize().split(" ");var t=v[0]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var u=v[1]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var x=parseInt(o.map.mapDiv.style.width);var w=parseInt(o.map.mapDiv.style.height);var r=(x/u)*m;var q=(w/t)*k;return q<r?q:r};this.getMaxViewableRadius=function(){var v=o.map.getGridSize().split(" ");var t=v[0]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var u=v[1]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var x=parseInt(o.map.mapDiv.style.width);var w=parseInt(o.map.mapDiv.style.height);var r=(x/u)*m;var q=(w/t)*k;return q>r?q:r};this.getMaxRadius=function(){return m<k?k:m};this.getZoomLevel=function(){return o.selected};this.setZoomValue=function(q){this.setZoomLevel(q)};this.setZoomLevel=function(r){if(r&&r<o.lowerBound||r>o.upperBound){throw new Exception("Error calling setZoomLevel, out of range");return false}o.selected=r;i();for(var q=0;q<j.length;q++){if(j[q].id=="decarta-z"+r){j[q].src=o.checkedSrc}if(Utilities.ie6){Utilities.fixPng(j[q])}}};this.getGXConvertedZoomLevel=function(){return Math.abs(21-o.selected)};this.zoomToNewLevel=function(r){if(r&&r<o.lowerBound||r>o.upperBound){throw new Exception("Error calling zoomToNewLevel, out of range");return false}i();for(var q=0;q<j.length;q++){if(j[q].id=="decarta-z"+r){j[q].src=o.checkedSrc}if(Utilities.ie6){Utilities.fixPng(j[q])}}o.map.zoomMap(r)};this.zoomInOneLevel=function(){if(o.selected<=o.lowerBound){return false}i();for(var q=0;q<j.length;q++){if(j[q].id=="decarta-z"+o.selected){j[q].src=o.checkedSrc}}o.map.zoomMap(parseInt(o.selected)-1)};this.zoomOutOneLevel=function(){if(o.selected==o.zoomLevels){return false}i();for(var q=0;q<j.length;q++){if(j[q].id=="decarta-z"+o.selected){j[q].src=o.checkedSrc}}o.map.zoomMap(parseInt(o.selected)+1)};this.getZoomLevelToFitBoundingBox=function(u){var x=parseInt(o.map.mapDiv.style.height)/2;var y=parseInt(o.map.mapDiv.style.width)/2;for(var w=20;w>0;--w){var t=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),w);var A=Utilities.lat2pix(u.getCenterPosition().getLat(),t);var C=Utilities.lon2pix(u.getCenterPosition().getLon(),t);var v=Utilities.pix2lat(A+x,t);var B=Utilities.pix2lon(C+y,t);var r=Utilities.pix2lat(A-x,t);var z=Utilities.pix2lon(C-y,t);var q=new BoundingBox(new Position(r,z),new Position(v,B));if(q.contains(u.minPosition)&&q.contains(u.maxPosition)){return Math.abs(21-w);break}}};this.getZoomLevelToFitPositions=function(q){var r=Utilities.positionsToBoundingBox(q);return o.getZoomLevelToFitBoundingBox(r)};this.getZoomLevelToFitPins=function(u){var r=[];for(var t=0;t<u.length;t++){r[t]=u[t].position.clone()}var v=Utilities.positionsToBoundingBox(r);var w=o.getZoomLevelToFitBoundingBox(v);var q=Utilities.radsPerPixelAtZoom(o.map.getTileSize(),Math.abs(21-w));v=Utilities.pinsToBoundingBox(u,q);return o.getZoomLevelToFitBoundingBox(v)};this.appendThis=function(){if(!this.frame){this.initialize()}var q=this.frame||null;return q};this.removeThis=function(){this.map=null;return this.frame};this.position=function(q){if(!this.map){return}if(this.frame){this.frame.style.top="1px";this.frame.style.left="1px"}};function i(){for(var q=0;q<j.length;q++){j[q].src=o.uncheckedSrc}}}function ZoomController(q,t,a,e,b,d){this.selected=q||5;if(isNaN(parseInt(this.selected))||this.selected<0||this.selected>17){throw new Exception("Error instantiating ZoomController, invalid initial value "+q+".  The value must be between 1 and 17");return false}this.domView=true;this.zoomLevels=17;this.lowerBound=1;this.upperBound=17;this.color=t||"";this.uncheckedSrc=e||Credentials.zoomUnselectedIconPath;this.checkedSrc=a||Credentials.zoomSelectedIconPath;this.bottomCapSrc=d||Credentials.zoomOutIconPath;this.bottomCapSrc=Credentials.imgPath+"z2t_zoom_bottom_gray.png";this.topCapSrc=b||Credentials.zoomInIconPath;this.topCapSrc=Credentials.imgPath+"z2t_zoom_top_gray.png";this.pillarSrc=Credentials.imgPath+"z2t_zoom_rail_gray.png";this.sliderSrc=Credentials.imgPath+"z2t_zoom_selected_gray.png";this.zoomer=null;this.map=null;this.type="ZoomController";this.frame=null;var k=this;var c=null;var p=null;var v=null;var r=null;var j=false;var f=Utilities.ie;var g;var i;var m=true;this.setDomView=function(w){w=(w)?true:false;this.domView=w};this.initialize=function(){if(!this.domView){return false}c=document.createElement("IMG");c.id="decarta-ztop";c.src=this.topCapSrc;c.className="decarta-zoomTop";c.onclick=function(y){if(!GLOBALS.ALLOWDOMEVENTS){return true}y=y||event;y.stoppropagation?y.stoppropagation():y.cancelBubble=true;k.zoomInOneLevel();return true};deCarta.IdManager.setTag(c,"ignoreForMapEvents");v=document.createElement("DIV");v.style.backgroundImage="url("+this.pillarSrc+")";v.style.backgroundRepeat="repeat-y";v.style.backgroundPosition="center";v.id="decarta-zpillar";v.className="decarta-zoomPillar";v.onclick=function(A){if(!GLOBALS.ALLOWDOMEVENTS){return true}A=A||event;A.stoppropagation?A.stoppropagation():A.cancelBubble=true;var y=A.clientY-Utilities.getAbsoluteTop(v)+Utilities.getScrollTop();var z=parseInt(v.offsetHeight);var B=Math.round(y/z*16)+1;k.map.zoomMap(B);return true};deCarta.IdManager.setTag(v,"ignoreForMapEvents");r=document.createElement("IMG");r.src=this.sliderSrc;r.className="decarta-zoomSlider";r.id="decarta-zslider";deCarta.IdManager.setTag(r,"ignoreForMapEvents");r.onmousedown=function(y){if(!GLOBALS.ALLOWDOMEVENTS){return true}y=y?y:window.event;y.stoppropagation?y.stoppropagation():y.cancelBubble=true;if((!f&&y.which==3)||(f&&y.button==2)){if(_events.rightclick){click(y)}return true}if((!f&&y.which==2)||(f&&y.button==4)){return true}j=true;r.style.cursor="move";document.body.onmousemove=n;document.body.onmouseup=u;return false};v.appendChild(r);p=document.createElement("IMG");p.src=this.bottomCapSrc;p.id="decarta-zbottom";p.className="decarta-zoomBottom";p.onclick=function(y){if(!GLOBALS.ALLOWDOMEVENTS){return true}y=y||event;y.stoppropagation?y.stoppropagation():y.cancelBubble=true;k.zoomOutOneLevel();return true};deCarta.IdManager.setTag(p,"ignoreForMapEvents");var x="decarta-zoom";var w=x;k.frame=document.createElement("DIV");k.frame.id=x;k.frame.className=w;k.frame.innerHTML="";if(k.color){k.frame.style.backgroundColor=k.color}deCarta.IdManager.setTag(k.frame,"ignoreForMapEvents");k.frame.appendChild(c);k.frame.appendChild(v);k.frame.appendChild(p);this.zoomer=this.frame;if(!m){this.frame.style.display="none"}return true};function u(x){document.body.onmousemove=null;document.body.onmouseup=null;j=false;r.style.cursor="default";x=x?x:window.event;x.stoppropagation?x.stoppropagation():x.cancelBubble=true;var w=x.clientY-Utilities.getAbsoluteTop(v)+Utilities.getScrollTop();var y=Math.round(w/v.offsetHeight*16)+1;if(y<1){y=1}if(y>17){y=17}k.map.zoomMap(y);return false}function n(z){z=z?z:window.event;if(!j){return false}var y=r.offsetHeight/2;var x=v.offsetHeight-r.offsetHeight/2;var w=z.clientY-Utilities.getAbsoluteTop(v)+Utilities.getScrollTop();if(w<=x&&w>=y){r.style.top=w-r.offsetHeight/2+"px"}return false}this.setZoomRange=function(w,x){if(w<1||x>21||w>x){throw new Exception("illegal values setZoomRange: "+w+", "+x)}if(k.selected>x){k.selected=x}if(k.selected<w){k.selected=w}k.zoomLevels=x;k.lowerBound=w;k.upperBound=x};this.setZoomButtonImages=function(z,y,w,A){if(z){this.checkedSrc=z}if(y){this.uncheckedSrc=y}if(z||y){for(var x=0;x<_zoomButtons.length;x++){_zoomButtons[x].src=this.uncheckedSrc}if(k.selected){_zoomButtons[k.selected-1].src=this.checkedSrc}}if(w){this.topCapSrc=w;c.src=w}if(A){this.bottomCapSrc=A;p.src=A}};this.setColor=function(w){this.frame.style.backgroundColor=w};this.show=function(){m=true;if(this.frame){this.frame.style.display="block"}};this.hide=function(){m=false;if(this.frame){this.frame.style.display="none"}};this.getRadius=function(){return g};this.setRadius=function(A){i=A;var z=k.map.getGridSize().split(" ");var B=z[0];var w=z[1];if(B==w){g=A}else{g=(i/w)*B}};this.getRadiusX=function(){return i};this.setRadiusX=function(w){i=w};this.getMinViewableRadius=function(){var A=k.map.getGridSize().split(" ");var y=A[0]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var z=A[1]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var C=parseInt(k.map.mapDiv.style.width);var B=parseInt(k.map.mapDiv.style.height);var x=(C/z)*i;var w=(B/y)*g;return w<x?w:x};this.getMaxViewableRadius=function(){var A=k.map.getGridSize().split(" ");var y=A[0]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var z=A[1]*GLOBALS.DEFAULT_MAP_TILE_SIZE;var C=parseInt(k.map.mapDiv.style.width);var B=parseInt(k.map.mapDiv.style.height);var x=(C/z)*i;var w=(B/y)*g;return w>x?w:x};this.getMaxRadius=function(){return i<g?g:i};this.getZoomLevel=function(){return k.selected};this.setZoomValue=function(w){this.setZoomLevel(w)};this.setZoomLevel=function(y){if(y&&y<k.lowerBound||y>k.upperBound){throw new Exception("Error calling setZoomLevel, out of range");return false}k.selected=y;if(r&&r.style){var w=parseInt(v.offsetHeight);var x=parseInt(r.offsetHeight);r.style.top=(y-1/2)*w/17-1/2*x+"px";v.removeChild(r);v.appendChild(r)}};this.getGXConvertedZoomLevel=function(){return Math.abs(21-k.selected)};this.zoomToNewLevel=function(w){if(w&&w<k.lowerBound||w>k.upperBound){throw new Exception("Error calling zoomToNewLevel, out of range");return false}k.map.zoomMap(w)};this.zoomInOneLevel=function(){if(k.selected<=k.lowerBound){return false}k.map.zoomMap(parseInt(k.selected)-1)};this.zoomOutOneLevel=function(){if(k.selected==k.zoomLevels){return false}k.map.zoomMap(parseInt(k.selected)+1)};this.getZoomLevelToFitBoundingBox=function(z){var C=parseInt(k.map.mapDiv.style.height)/2;var D=parseInt(k.map.mapDiv.style.width)/2;for(var B=20;B>0;--B){var y=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),B);var F=Utilities.lat2pix(z.getCenterPosition().getLat(),y);var H=Utilities.lon2pix(z.getCenterPosition().getLon(),y);var A=Utilities.pix2lat(F+C,y);var G=Utilities.pix2lon(H+D,y);var x=Utilities.pix2lat(F-C,y);var E=Utilities.pix2lon(H-D,y);var w=new BoundingBox(new Position(x,E),new Position(A,G));if(w.contains(z.minPosition)&&w.contains(z.maxPosition)){return Math.abs(21-B);break}}};this.getZoomLevelToFitPositions=function(w){var x=Utilities.positionsToBoundingBox(w);return k.getZoomLevelToFitBoundingBox(x)};this.getZoomLevelToFitPins=function(z){var x=[];for(var y=0;y<z.length;y++){x[y]=z[y].position.clone()}var A=Utilities.positionsToBoundingBox(x);var B=k.getZoomLevelToFitBoundingBox(A);var w=Utilities.radsPerPixelAtZoom(k.map.getTileSize(),Math.abs(21-B));A=Utilities.pinsToBoundingBox(z,w);return k.getZoomLevelToFitBoundingBox(A)};this.appendThis=function(){if(!this.frame){this.initialize()}var w=this.frame||null;return w};this.removeThis=function(){this.map=null;return this.frame};this.position=function(w){if(!this.map){return}if(this.frame){if(this.map.getPanController()){this.frame.style.top="61px";this.frame.style.left="21px"}else{this.frame.style.top="10px";this.frame.style.left="10px"}this.setZoomLevel(k.selected)}};function o(){}};
