/*
 * deCarta JavaScript Mapping API
 * Copyright 2006-2009 deCarta. All rights reserved.
 * version DDS 4.4.1sp05
 *
 * Bundles:
 *   ExplorerCanvas
 *   Project: http://excanvas.sourceforge.net/
 *   License: Apache 2.0
 *   License Location: http://excanvas.sourceforge.net/COPYING
 *
 *   Sarissa
 *   Project: http://dev.abiss.gr/sarissa/
 *   License: Apache 2.0
 *   License Location: http://dev.abiss.gr/sarissa/licenses/asl.txt
 */
if(!document.createElement("canvas").getContext){(function(){var S=Math;var T=S.round;var P=S.sin;var c=S.cos;var K=S.abs;var b=S.sqrt;var A=10;var L=A/2;function H(){return this.context_||(this.context_=new N(this))}var R=Array.prototype.slice;function d(g,h,i){var Z=R.call(arguments,2);return function(){return g.apply(h,Z.concat(R.call(arguments)))}}var I={init:function(Z){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var f=Z||document;f.createElement("canvas");f.attachEvent("onreadystatechange",d(this.init_,this,f))}},init_:function(h){if(!h.namespaces.g_vml_){h.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!h.namespaces.g_o_){h.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!h.styleSheets.ex_canvas_){var g=h.createStyleSheet();g.owningElement.id="ex_canvas_";g.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var f=h.getElementsByTagName("canvas");for(var Z=0;Z<f.length;Z++){this.initElement(f[Z])}},initElement:function(f){if(!f.getContext){f.getContext=H;f.innerHTML="";f.attachEvent("onpropertychange",a);f.attachEvent("onresize",B);var Z=f.attributes;if(Z.width&&Z.width.specified){f.style.width=Z.width.nodeValue+"px"}else{f.width=f.clientWidth}if(Z.height&&Z.height.specified){f.style.height=Z.height.nodeValue+"px"}else{f.height=f.clientHeight}}return f}};function a(f){var Z=f.srcElement;switch(f.propertyName){case"width":Z.style.width=Z.attributes.width.nodeValue+"px";Z.getContext().clearRect();break;case"height":Z.style.height=Z.attributes.height.nodeValue+"px";Z.getContext().clearRect();break}}function B(f){var Z=f.srcElement;if(Z.firstChild){Z.firstChild.style.width=Z.clientWidth+"px";Z.firstChild.style.height=Z.clientHeight+"px"}}I.init();var E=[];for(var W=0;W<16;W++){for(var V=0;V<16;V++){E[W*16+V]=W.toString(16)+V.toString(16)}}function O(){return[[1,0,0],[0,1,0],[0,0,1]]}function D(h,g){var f=O();for(var Z=0;Z<3;Z++){for(var k=0;k<3;k++){var i=0;for(var j=0;j<3;j++){i+=h[Z][j]*g[j][k]}f[Z][k]=i}}return f}function U(f,Z){Z.fillStyle=f.fillStyle;Z.lineCap=f.lineCap;Z.lineJoin=f.lineJoin;Z.lineWidth=f.lineWidth;Z.miterLimit=f.miterLimit;Z.shadowBlur=f.shadowBlur;Z.shadowColor=f.shadowColor;Z.shadowOffsetX=f.shadowOffsetX;Z.shadowOffsetY=f.shadowOffsetY;Z.strokeStyle=f.strokeStyle;Z.globalAlpha=f.globalAlpha;Z.arcScaleX_=f.arcScaleX_;Z.arcScaleY_=f.arcScaleY_;Z.lineScale_=f.lineScale_}function C(f){var j,h=1;f=String(f);if(f.substring(0,3)=="rgb"){var l=f.indexOf("(",3);var Z=f.indexOf(")",l+1);var k=f.substring(l+1,Z).split(",");j="#";for(var g=0;g<3;g++){j+=E[Number(k[g])]}if(k.length==4&&f.substr(3,1)=="a"){h=k[3]}}else{j=f}return{color:j,alpha:h}}function Q(Z){switch(Z){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function N(f){this.m_=O();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=A*1;this.globalAlpha=1;this.canvas=f;var Z=f.ownerDocument.createElement("div");Z.style.width=f.clientWidth+"px";Z.style.height=f.clientHeight+"px";Z.style.overflow="hidden";Z.style.position="absolute";f.appendChild(Z);this.element_=Z;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var J=N.prototype;J.clearRect=function(){this.element_.innerHTML=""};J.beginPath=function(){this.currentPath_=[]};J.moveTo=function(f,Z){var g=this.getCoords_(f,Z);this.currentPath_.push({type:"moveTo",x:g.x,y:g.y});this.currentX_=g.x;this.currentY_=g.y};J.lineTo=function(f,Z){var g=this.getCoords_(f,Z);this.currentPath_.push({type:"lineTo",x:g.x,y:g.y});this.currentX_=g.x;this.currentY_=g.y};J.bezierCurveTo=function(g,f,m,l,k,i){var Z=this.getCoords_(k,i);var j=this.getCoords_(g,f);var h=this.getCoords_(m,l);M(this,j,h,Z)};function M(Z,h,g,f){Z.currentPath_.push({type:"bezierCurveTo",cp1x:h.x,cp1y:h.y,cp2x:g.x,cp2y:g.y,x:f.x,y:f.y});Z.currentX_=f.x;Z.currentY_=f.y}J.quadraticCurveTo=function(k,g,f,Z){var j=this.getCoords_(k,g);var i=this.getCoords_(f,Z);var l={x:this.currentX_+2/3*(j.x-this.currentX_),y:this.currentY_+2/3*(j.y-this.currentY_)};var h={x:l.x+(i.x-this.currentX_)/3,y:l.y+(i.y-this.currentY_)/3};M(this,l,h,i)};J.arc=function(n,l,m,i,f,g){m*=A;var s=g?"at":"wa";var o=n+c(i)*m-L;var r=l+P(i)*m-L;var Z=n+c(f)*m-L;var q=l+P(f)*m-L;if(o==Z&&!g){o+=0.125}var h=this.getCoords_(n,l);var k=this.getCoords_(o,r);var j=this.getCoords_(Z,q);this.currentPath_.push({type:s,x:h.x,y:h.y,radius:m,xStart:k.x,yStart:k.y,xEnd:j.x,yEnd:j.y})};J.rect=function(g,f,Z,h){this.moveTo(g,f);this.lineTo(g+Z,f);this.lineTo(g+Z,f+h);this.lineTo(g,f+h);this.closePath()};J.strokeRect=function(g,f,Z,h){var i=this.currentPath_;this.beginPath();this.moveTo(g,f);this.lineTo(g+Z,f);this.lineTo(g+Z,f+h);this.lineTo(g,f+h);this.closePath();this.stroke();this.currentPath_=i};J.fillRect=function(g,f,Z,h){var i=this.currentPath_;this.beginPath();this.moveTo(g,f);this.lineTo(g+Z,f);this.lineTo(g+Z,f+h);this.lineTo(g,f+h);this.closePath();this.fill();this.currentPath_=i};J.createLinearGradient=function(f,h,Z,g){var i=new X("gradient");i.x0_=f;i.y0_=h;i.x1_=Z;i.y1_=g;return i};J.createRadialGradient=function(h,j,g,f,i,Z){var k=new X("gradientradial");k.x0_=h;k.y0_=j;k.r0_=g;k.x1_=f;k.y1_=i;k.r1_=Z;return k};J.drawImage=function(u,g){var n,l,p,AD,s,q,y,AF;var o=u.runtimeStyle.width;var t=u.runtimeStyle.height;u.runtimeStyle.width="auto";u.runtimeStyle.height="auto";var m=u.width;var AB=u.height;u.runtimeStyle.width=o;u.runtimeStyle.height=t;if(arguments.length==3){n=arguments[1];l=arguments[2];s=q=0;y=p=m;AF=AD=AB}else{if(arguments.length==5){n=arguments[1];l=arguments[2];p=arguments[3];AD=arguments[4];s=q=0;y=m;AF=AB}else{if(arguments.length==9){s=arguments[1];q=arguments[2];y=arguments[3];AF=arguments[4];n=arguments[5];l=arguments[6];p=arguments[7];AD=arguments[8]}else{throw Error("Invalid number of arguments")}}}var AE=this.getCoords_(n,l);var i=y/2;var f=AF/2;var AC=[];var Z=10;var k=10;AC.push(" <g_vml_:group",' coordsize="',A*Z,",",A*k,'"',' coordorigin="0,0"',' style="width:',Z,"px;height:",k,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var j=[];j.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",T(AE.x/A),",","Dy=",T(AE.y/A),"");var AA=AE;var z=this.getCoords_(n+p,l);var v=this.getCoords_(n,l+AD);var r=this.getCoords_(n+p,l+AD);AA.x=S.max(AA.x,z.x,v.x,r.x);AA.y=S.max(AA.y,z.y,v.y,r.y);AC.push("padding:0 ",T(AA.x/A),"px ",T(AA.y/A),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",j.join(""),", sizingmethod='clip');")}else{AC.push("top:",T(AE.y/A),"px;left:",T(AE.x/A),"px;")}AC.push(' ">','<g_vml_:image src="',u.src,'"',' style="width:',A*p,"px;"," height:",A*AD,'px;"',' cropleft="',s/m,'"',' croptop="',q/AB,'"',' cropright="',(m-s-y)/m,'"',' cropbottom="',(AB-q-AF)/AB,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",AC.join(""))};J.stroke=function(AH){var l=[];var m=false;var AS=C(AH?this.fillStyle:this.strokeStyle);var AD=AS.color;var AN=AS.alpha*this.globalAlpha;var h=10;var o=10;l.push("<g_vml_:shape",' filled="',!!AH,'"',' style="position:absolute;width:',h,"px;height:",o,'px;"',' coordorigin="0 0" coordsize="',A*h," ",A*o,'"',' stroked="',!AH,'"',' path="');var n=false;var AR={x:null,y:null};var z={x:null,y:null};for(var AM=0;AM<this.currentPath_.length;AM++){var AL=this.currentPath_[AM];var AQ;switch(AL.type){case"moveTo":AQ=AL;l.push(" m ",T(AL.x),",",T(AL.y));break;case"lineTo":l.push(" l ",T(AL.x),",",T(AL.y));break;case"close":l.push(" x ");AL=null;break;case"bezierCurveTo":l.push(" c ",T(AL.cp1x),",",T(AL.cp1y),",",T(AL.cp2x),",",T(AL.cp2y),",",T(AL.x),",",T(AL.y));break;case"at":case"wa":l.push(" ",AL.type," ",T(AL.x-this.arcScaleX_*AL.radius),",",T(AL.y-this.arcScaleY_*AL.radius)," ",T(AL.x+this.arcScaleX_*AL.radius),",",T(AL.y+this.arcScaleY_*AL.radius)," ",T(AL.xStart),",",T(AL.yStart)," ",T(AL.xEnd),",",T(AL.yEnd));break}if(AL){if(AR.x==null||AL.x<AR.x){AR.x=AL.x}if(z.x==null||AL.x>z.x){z.x=AL.x}if(AR.y==null||AL.y<AR.y){AR.y=AL.y}if(z.y==null||AL.y>z.y){z.y=AL.y}}}l.push(' ">');if(!AH){var y=this.lineScale_*this.lineWidth;if(y<1){AN*=y}l.push("<g_vml_:stroke",' opacity="',AN,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',Q(this.lineCap),'"',' weight="',y,'px"',' color="',AD,'" />')}else{if(typeof this.fillStyle=="object"){var q=this.fillStyle;var v=0;var AK={x:0,y:0};var AE=0;var t=1;if(q.type_=="gradient"){var s=q.x0_/this.arcScaleX_;var f=q.y0_/this.arcScaleY_;var r=q.x1_/this.arcScaleX_;var AT=q.y1_/this.arcScaleY_;var AP=this.getCoords_(s,f);var AO=this.getCoords_(r,AT);var k=AO.x-AP.x;var j=AO.y-AP.y;v=Math.atan2(k,j)*180/Math.PI;if(v<0){v+=360}if(v<0.000001){v=0}}else{var AP=this.getCoords_(q.x0_,q.y0_);var Z=z.x-AR.x;var g=z.y-AR.y;AK={x:(AP.x-AR.x)/Z,y:(AP.y-AR.y)/g};Z/=this.arcScaleX_*A;g/=this.arcScaleY_*A;var AJ=S.max(Z,g);AE=2*q.r0_/AJ;t=2*q.r1_/AJ-AE}var AC=q.colors_;AC.sort(function(p,i){return p.offset-i.offset});var w=AC.length;var AB=AC[0].color;var AA=AC[w-1].color;var AG=AC[0].alpha*this.globalAlpha;var AF=AC[w-1].alpha*this.globalAlpha;var AI=[];for(var AM=0;AM<w;AM++){var u=AC[AM];AI.push(u.offset*t+AE+" "+u.color)}l.push('<g_vml_:fill type="',q.type_,'"',' method="none" focus="100%"',' color="',AB,'"',' color2="',AA,'"',' colors="',AI.join(","),'"',' opacity="',AF,'"',' g_o_:opacity2="',AG,'"',' angle="',v,'"',' focusposition="',AK.x,",",AK.y,'" />')}else{l.push('<g_vml_:fill color="',AD,'" opacity="',AN,'" />')}}l.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",l.join(""))};J.fill=function(){this.stroke(true)};J.closePath=function(){this.currentPath_.push({type:"close"})};J.getCoords_=function(g,f){var Z=this.m_;return{x:A*(g*Z[0][0]+f*Z[1][0]+Z[2][0])-L,y:A*(g*Z[0][1]+f*Z[1][1]+Z[2][1])-L}};J.save=function(){var Z={};U(this,Z);this.aStack_.push(Z);this.mStack_.push(this.m_);this.m_=D(O(),this.m_)};J.restore=function(){U(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};function G(Z){for(var g=0;g<3;g++){for(var f=0;f<2;f++){if(!isFinite(Z[g][f])||isNaN(Z[g][f])){return false}}}return true}function Y(f,Z,g){if(!G(Z)){return }f.m_=Z;if(g){var h=Z[0][0]*Z[1][1]-Z[0][1]*Z[1][0];f.lineScale_=b(K(h))}}J.translate=function(g,f){var Z=[[1,0,0],[0,1,0],[g,f,1]];Y(this,D(Z,this.m_),false)};J.rotate=function(f){var h=c(f);var g=P(f);var Z=[[h,g,0],[-g,h,0],[0,0,1]];Y(this,D(Z,this.m_),false)};J.scale=function(g,f){this.arcScaleX_*=g;this.arcScaleY_*=f;var Z=[[g,0,0],[0,f,0],[0,0,1]];Y(this,D(Z,this.m_),true)};J.transform=function(i,h,k,j,f,Z){var g=[[i,h,0],[k,j,0],[f,Z,1]];Y(this,D(g,this.m_),true)};J.setTransform=function(i,h,k,j,g,f){var Z=[[i,h,0],[k,j,0],[g,f,1]];Y(this,Z,true)};J.clip=function(){};J.arcTo=function(){};J.createPattern=function(){return new F};function X(Z){this.type_=Z;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}X.prototype.addColorStop=function(f,Z){Z=C(Z);this.colors_.push({offset:f,color:Z.color,alpha:Z.alpha})};function F(){}G_vmlCanvasManager=I;CanvasRenderingContext2D=N;CanvasGradient=X;CanvasPattern=F})()}function Sarissa(){}Sarissa.VERSION="${project.version}";Sarissa.PARSED_OK="Document contains no parsing errors";Sarissa.PARSED_EMPTY="Document is empty";Sarissa.PARSED_UNKNOWN_ERROR="Not well-formed or other error";Sarissa.IS_ENABLED_TRANSFORM_NODE=false;var _sarissa_iNsCounter=0;var _SARISSA_IEPREFIX4XSLPARAM="";var _SARISSA_HAS_DOM_IMPLEMENTATION=document.implementation&&true;var _SARISSA_HAS_DOM_CREATE_DOCUMENT=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.createDocument;var _SARISSA_HAS_DOM_FEATURE=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.hasFeature;var _SARISSA_IS_MOZ=_SARISSA_HAS_DOM_CREATE_DOCUMENT&&_SARISSA_HAS_DOM_FEATURE;var _SARISSA_IS_SAFARI=navigator.userAgent.toLowerCase().indexOf("safari")!=-1||navigator.userAgent.toLowerCase().indexOf("konqueror")!=-1;var _SARISSA_IS_SAFARI_OLD=_SARISSA_IS_SAFARI&&parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/)||{})[1])<420;var _SARISSA_IS_IE=document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1;var _SARISSA_IS_OPERA=navigator.userAgent.toLowerCase().indexOf("opera")!=-1;if(!window.Node||!Node.ELEMENT_NODE){Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}}if(_SARISSA_IS_SAFARI_OLD){HTMLHtmlElement=document.createElement("html").constructor;Node=HTMLElement={};HTMLElement.prototype=HTMLHtmlElement.__proto__.__proto__;HTMLDocument=Document=document.constructor;var x=new DOMParser();XMLDocument=x.constructor;Element=x.parseFromString("<Single />","text/xml").documentElement.constructor;x=null}if(typeof XMLDocument=="undefined"&&typeof Document!="undefined"){XMLDocument=Document}if(_SARISSA_IS_IE){_SARISSA_IEPREFIX4XSLPARAM="xsl:";var _SARISSA_DOM_PROGID="";var _SARISSA_XMLHTTP_PROGID="";var _SARISSA_DOM_XMLWRITER="";Sarissa.pickRecentProgID=function(E){var D=false,G;for(var B=0;B<E.length&&!D;B++){try{var A=new ActiveXObject(E[B]);var F=E[B];D=true}catch(C){G=C}}if(!D){throw"Could not retrieve a valid progID of Class: "+E[E.length-1]+". (original exception: "+G+")"}E=null;return F};_SARISSA_DOM_PROGID=null;_SARISSA_THREADEDDOM_PROGID=null;_SARISSA_XSLTEMPLATE_PROGID=null;_SARISSA_XMLHTTP_PROGID=null;if(!window.XMLHttpRequest){XMLHttpRequest=function(){if(!_SARISSA_XMLHTTP_PROGID){_SARISSA_XMLHTTP_PROGID=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"])}return new ActiveXObject(_SARISSA_XMLHTTP_PROGID)}}Sarissa.getDomDocument=function(D,C){if(!_SARISSA_DOM_PROGID){_SARISSA_DOM_PROGID=Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"])}var A=new ActiveXObject(_SARISSA_DOM_PROGID);if(C){var B="";if(D){if(C.indexOf(":")>1){B=C.substring(0,C.indexOf(":"));C=C.substring(C.indexOf(":")+1)}else{B="a"+(_sarissa_iNsCounter++)}}if(D){A.loadXML("<"+B+":"+C+" xmlns:"+B+'="'+D+'" />')}else{A.loadXML("<"+C+" />")}}return A};Sarissa.getParseErrorText=function(A){var C=Sarissa.PARSED_OK;if(A&&A.parseError&&A.parseError.errorCode&&A.parseError.errorCode!=0){C="XML Parsing Error: "+A.parseError.reason+"\nLocation: "+A.parseError.url+"\nLine Number "+A.parseError.line+", Column "+A.parseError.linepos+":\n"+A.parseError.srcText+"\n";for(var B=0;B<A.parseError.linepos;B++){C+="-"}C+="^\n"}else{if(A.documentElement==null){C=Sarissa.PARSED_EMPTY}}return C};Sarissa.setXpathNamespaces=function(A,B){A.setProperty("SelectionLanguage","XPath");A.setProperty("SelectionNamespaces",B)};XSLTProcessor=function(){if(!_SARISSA_XSLTEMPLATE_PROGID){_SARISSA_XSLTEMPLATE_PROGID=Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0","MSXML2.XSLTemplate.3.0"])}this.template=new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID);this.processor=null};XSLTProcessor.prototype.importStylesheet=function(D){if(!_SARISSA_THREADEDDOM_PROGID){_SARISSA_THREADEDDOM_PROGID=Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.3.0"])}D.setProperty("SelectionLanguage","XPath");D.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var C=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);try{C.resolveExternals=true;C.setProperty("AllowDocumentFunction",true)}catch(B){}if(D.url&&D.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']")!=null){C.async=false;C.load(D.url)}else{C.loadXML(D.xml)}C.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var A=C.selectSingleNode("//xsl:output");this.outputMethod=A?A.getAttribute("method"):"html";this.template.stylesheet=C;this.processor=this.template.createProcessor();this.paramsSet=[]};XSLTProcessor.prototype.transformToDocument=function(C){if(_SARISSA_THREADEDDOM_PROGID){this.processor.input=C;var B=new ActiveXObject(_SARISSA_DOM_PROGID);this.processor.output=B;this.processor.transform();return B}else{if(!_SARISSA_DOM_XMLWRITER){_SARISSA_DOM_XMLWRITER=Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"])}this.processor.input=C;var B=new ActiveXObject(_SARISSA_DOM_XMLWRITER);this.processor.output=B;this.processor.transform();var A=new ActiveXObject(_SARISSA_DOM_PROGID);A.loadXML(B.output+"");return A}};XSLTProcessor.prototype.transformToFragment=function(G,D){this.processor.input=G;this.processor.transform();var E=this.processor.output;var F=D.createDocumentFragment();if(this.outputMethod=="text"){F.appendChild(D.createTextNode(E))}else{if(D.body&&D.body.innerHTML){var B=D.createElement("div");B.innerHTML=E;while(B.hasChildNodes()){F.appendChild(B.firstChild)}}else{var A=new ActiveXObject(_SARISSA_DOM_PROGID);if(E.substring(0,5)=="<?xml"){E=E.substring(E.indexOf("?>")+2)}var C="".concat("<my>",E,"</my>");A.loadXML(C);var B=A.documentElement;while(B.hasChildNodes()){F.appendChild(B.firstChild)}}}return F};XSLTProcessor.prototype.setParameter=function(C,A,B){B=B?B:"";if(C){this.processor.addParameter(A,B,C)}else{this.processor.addParameter(A,B)}C=""+(C||"");if(!this.paramsSet[C]){this.paramsSet[C]=new Array()}this.paramsSet[C][A]=B};XSLTProcessor.prototype.getParameter=function(B,A){B=""+(B||"");if(this.paramsSet[B]&&this.paramsSet[B][A]){return this.paramsSet[B][A]}else{return null}};XSLTProcessor.prototype.clearParameters=function(){for(var B in this.paramsSet){for(var A in this.paramsSet[B]){if(B!=""){this.processor.addParameter(A,"",B)}else{this.processor.addParameter(A,"")}}}this.paramsSet=new Array()}}else{if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(A){Sarissa.__setReadyState__(A,4)};_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this)};Sarissa.__setReadyState__=function(A,B){A.readyState=B;A.readystate=B;if(A.onreadystatechange!=null&&typeof A.onreadystatechange=="function"){A.onreadystatechange()}};Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(!A.onreadystatechange){A.onreadystatechange=null}if(!A.readyState){A.readyState=0}A.addEventListener("load",_sarissa_XMLDocument_onload,false);return A};if(window.XMLDocument){}else{if(_SARISSA_HAS_DOM_FEATURE&&window.Document&&!Document.prototype.load&&document.implementation.hasFeature("LS","3.0")){Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);return A}}else{Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(A&&(C||B)&&!A.documentElement){A.appendChild(A.createElementNS(C,B))}return A}}}}}if(!window.DOMParser){if(_SARISSA_IS_SAFARI){DOMParser=function(){};DOMParser.prototype.parseFromString=function(B,C){var A=new XMLHttpRequest();A.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(B),false);A.send(null);return A.responseXML}}else{if(Sarissa.getDomDocument&&Sarissa.getDomDocument()&&Sarissa.getDomDocument(null,"bar").xml){DOMParser=function(){};DOMParser.prototype.parseFromString=function(A,C){var B=Sarissa.getDomDocument();B.loadXML(A);return B}}}}if((typeof (document.importNode)=="undefined")&&_SARISSA_IS_IE){try{document.importNode=function(C,B){var A;if(C.nodeName=="#text"){return document.createTextElement(C.data)}else{if(C.nodeName=="tbody"||C.nodeName=="tr"){A=document.createElement("table")}else{if(C.nodeName=="td"){A=document.createElement("tr")}else{if(C.nodeName=="option"){A=document.createElement("select")}else{A=document.createElement("div")}}}if(B){A.innerHTML=C.xml?C.xml:C.outerHTML}else{A.innerHTML=C.xml?C.cloneNode(false).xml:C.cloneNode(false).outerHTML}return A.getElementsByTagName("*")[0]}}}catch(e){}}if(!Sarissa.getParseErrorText){Sarissa.getParseErrorText=function(A){var C=Sarissa.PARSED_OK;if(!A.documentElement){C=Sarissa.PARSED_EMPTY}else{if(A.documentElement.tagName=="parsererror"){C=A.documentElement.firstChild.data;C+="\n"+A.documentElement.firstChild.nextSibling.firstChild.data}else{if(A.getElementsByTagName("parsererror").length>0){var B=A.getElementsByTagName("parsererror")[0];C=Sarissa.getText(B,true)+"\n"}else{if(A.parseError&&A.parseError.errorCode!=0){C=Sarissa.PARSED_UNKNOWN_ERROR}}}}return C}}Sarissa.getText=function(G,B){var E="";var C=G.childNodes;for(var D=0;D<C.length;D++){var F=C[D];var A=F.nodeType;if(A==Node.TEXT_NODE||A==Node.CDATA_SECTION_NODE){E+=F.data}else{if(B==true&&(A==Node.ELEMENT_NODE||A==Node.DOCUMENT_NODE||A==Node.DOCUMENT_FRAGMENT_NODE)){E+=Sarissa.getText(F,true)}}}return E};if(!window.XMLSerializer&&Sarissa.getDomDocument&&Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){};XMLSerializer.prototype.serializeToString=function(A){return A.xml}}Sarissa.stripTags=function(A){return A.replace(/<[^>]+>/g,"")};Sarissa.clearChildNodes=function(A){while(A.firstChild){A.removeChild(A.firstChild)}};Sarissa.copyChildNodes=function(D,E,F){if(_SARISSA_IS_SAFARI&&E.nodeType==Node.DOCUMENT_NODE){E=E.documentElement}if((!D)||(!E)){throw"Both source and destination nodes must be provided"}if(!F){Sarissa.clearChildNodes(E)}var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument;var A=D.childNodes;if(typeof (B.importNode)!="undefined"){for(var C=0;C<A.length;C++){E.appendChild(B.importNode(A[C],true))}}else{for(var C=0;C<A.length;C++){E.appendChild(A[C].cloneNode(true))}}};Sarissa.moveChildNodes=function(D,E,F){if((!D)||(!E)){throw"Both source and destination nodes must be provided"}if(!F){Sarissa.clearChildNodes(E)}var A=D.childNodes;if(D.ownerDocument==E.ownerDocument){while(D.firstChild){E.appendChild(D.firstChild)}}else{var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument;if(typeof (B.importNode)!="undefined"){for(var C=0;C<A.length;C++){E.appendChild(B.importNode(A[C],true))}}else{for(var C=0;C<A.length;C++){E.appendChild(A[C].cloneNode(true))}}Sarissa.clearChildNodes(D)}};Sarissa.xmlize=function(E,G,D){D=D?D:"";var F=D+"<"+G+">";var B=false;if(!(E instanceof Object)||E instanceof Number||E instanceof String||E instanceof Boolean||E instanceof Date){F+=Sarissa.escape(""+E);B=true}else{F+="\n";var A=E instanceof Array;for(var C in E){F+=Sarissa.xmlize(E[C],(A?'array-item key="'+C+'"':C),D+"   ")}F+=D}return(F+=(G.indexOf(" ")!=-1?"</array-item>\n":"</"+G+">\n"))};Sarissa.escape=function(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};Sarissa.unescape=function(A){return A.replace(/&apos;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")};var _XMLSerializer=new XMLSerializer();Sarissa.serialize=function(A){return _XMLSerializer.serializeToString(A)};Sarissa.updateCursor=function(B,A){if(B&&B.style&&B.style.cursor!=undefined){B.style.cursor=A}};Sarissa.updateContentFromURI=function(B,C,F,I,E){try{Sarissa.updateCursor(C,"wait");var A=new XMLHttpRequest();A.open("GET",B);function H(){if(A.readyState==4){Sarissa.updateContentFromNode(A.responseXML,C,F,I)}}A.onreadystatechange=H;if(E){var D="Sat, 1 Jan 2000 00:00:00 GMT";A.setRequestHeader("If-Modified-Since",D)}A.send("")}catch(G){Sarissa.updateCursor(C,"auto");throw G}};Sarissa.updateContentFromNode=function(E,G,A,F){try{Sarissa.updateCursor(G,"wait");Sarissa.clearChildNodes(G);var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument;if(B.parseError&&B.parseError!=0){var D=document.createElement("pre");D.appendChild(document.createTextNode(Sarissa.getParseErrorText(B)));G.appendChild(D)}else{if(A){E=A.transformToDocument(E)}if(G.tagName.toLowerCase()=="textarea"||G.tagName.toLowerCase()=="input"){G.value=new XMLSerializer().serializeToString(E)}else{if(E.nodeType==Node.DOCUMENT_NODE||E.ownerDocument.documentElement==E){G.innerHTML=new XMLSerializer().serializeToString(E)}else{G.appendChild(G.ownerDocument.importNode(E,true))}}}if(F){F(E,G)}}catch(C){throw C}finally{Sarissa.updateCursor(G,"auto")}};if(!_SARISSA_IS_IE){if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(A){Sarissa.__setReadyState__(A,4)};function SarissaParseError(){this.errorCode=0}_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this)};Sarissa.__setReadyState__=function(A,B){A.readyState=B;A.readystate=B;if(A.onreadystatechange!=null&&typeof A.onreadystatechange=="function"){A.onreadystatechange()}};Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(!A.onreadystatechange){A.onreadystatechange=null}if(!A.readyState){A.readyState=0}if(!A.parseError){A.parseError=new SarissaParseError()}A.addEventListener("load",_sarissa_XMLDocument_onload,false);return A};if(window.XMLDocument){XMLDocument.prototype._sarissa_load=XMLDocument.prototype.load;XMLDocument.prototype.load=function(D){var A=Sarissa.getDomDocument();Sarissa.copyChildNodes(this,A);this.parseError.errorCode=0;Sarissa.__setReadyState__(this,1);try{if(this.async==false&&_SARISSA_SYNC_NON_IMPLEMENTED){var B=new XMLHttpRequest();B.open("GET",D,false);B.send(null);Sarissa.__setReadyState__(this,2);Sarissa.copyChildNodes(B.responseXML,this);Sarissa.__setReadyState__(this,3)}else{this._sarissa_load(D)}}catch(C){A.parseError.errorCode=-1}finally{if(!A.documentElement||A.documentElement.tagName=="parsererror"){A.parseError.errorCode=-1}if(this.async==false){Sarissa.__handleLoad__(this)}}return A}}else{if(document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("LS","3.0")){Document.prototype.async=true;Document.prototype.onreadystatechange=null;Document.prototype.load=function(F){var B=Sarissa.getDomDocument();Sarissa.copyChildNodes(this,B,false);var E=document.implementation.createLSParser(this.async?document.implementation.MODE_ASYNCHRONOUS:document.implementation.MODE_SYNCHRONOUS,null);if(this.async){var C=this;E.addEventListener("load",function(G){C.readyState=4;Sarissa.copyChildNodes(G.newDocument,C,false);C.onreadystatechange.call()},false)}try{var A=E.parseURI(F);if(!this.async){Sarissa.copyChildNodes(A,this,false)}}catch(D){this.parseError.errorCode=-1}return B};Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(!A.parseError){A.parseError={errorCode:0}}return A}}else{Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(A&&(C||B)&&!A.documentElement){A.appendChild(A.createElementNS(C,B))}if(!A.load){A.load=function(G){var D=document.implementation.createDocument();Sarissa.copyChildNodes(this,D);this.parseError={errorCode:0};Sarissa.__setReadyState__(this,1);if(this.async==false){var F=new XMLHttpRequest();F.open("GET",G,false);F.send(null);Sarissa.__setReadyState__(this,2);Sarissa.copyChildNodes(F.responseXML,A);if(!A.documentElement||A.getElementsByTagName("parsererror").length>0){A.parseError.errorCode=-1}Sarissa.__setReadyState__(this,3);Sarissa.__setReadyState__(this,4)}else{var E=new XMLHttpRequest();E.open("GET",G,true);E.onreadystatechange=function(){if(E.readyState==4){Sarissa.copyChildNodes(E.responseXML,A);if(!A.documentElement||A.getElementsByTagName("parsererror").length>0){A.parseError.errorCode=-1}}Sarissa.__setReadyState__(A,E.readyState)};E.send(null)}return D}}return A}}}}}if(_SARISSA_HAS_DOM_FEATURE&&document.implementation.hasFeature("XPath","3.0")){function SarissaNodeList(A){this.length=A}SarissaNodeList.prototype=new Array(0);SarissaNodeList.prototype.constructor=Array;SarissaNodeList.prototype.item=function(A){return(A<0||A>=this.length)?null:this[A]};SarissaNodeList.prototype.expr="";if(window.XMLDocument&&(!XMLDocument.prototype.setProperty)){XMLDocument.prototype.setProperty=function(A,B){}}Sarissa.setXpathNamespaces=function(G,C){G._sarissa_useCustomResolver=true;var A=C.indexOf(" ")>-1?C.split(" "):new Array(C);G._sarissa_xpathNamespaces=new Array(A.length);for(var D=0;D<A.length;D++){var F=A[D];var H=F.indexOf(":");var I=F.indexOf("=");if(H>0&&I>H+1){var E=F.substring(H+1,I);var B=F.substring(I+2,F.length-1);G._sarissa_xpathNamespaces[E]=B}else{throw"Bad format on namespace declaration(s) given"}}};XMLDocument.prototype._sarissa_useCustomResolver=false;XMLDocument.prototype._sarissa_xpathNamespaces=new Array();XMLDocument.prototype.selectNodes=function(C,G,A){var E=this;var B=this._sarissa_useCustomResolver?function(K){var J=E._sarissa_xpathNamespaces[K];if(J){return J}else{throw"No namespace URI found for prefix: '"+K+"'"}}:this.createNSResolver(this.documentElement);var I=null;if(!A){var H=this.evaluate(C,(G?G:this),B,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var D=new SarissaNodeList(H.snapshotLength);D.expr=C;for(var F=0;F<D.length;F++){D[F]=H.snapshotItem(F)}I=D}else{I=H=this.evaluate(C,(G?G:this),B,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}return I};Element.prototype.selectNodes=function(A){var B=this.ownerDocument;if(B.selectNodes){return B.selectNodes(A,this)}else{throw"Method selectNodes is only supported by XML Elements"}};XMLDocument.prototype.selectSingleNode=function(C,B){var A=B?B:null;return this.selectNodes(C,A,true)};Element.prototype.selectSingleNode=function(A){var B=this.ownerDocument;if(B.selectSingleNode){return B.selectSingleNode(A,this)}else{throw"Method selectNodes is only supported by XML Elements"}};Sarissa.IS_ENABLED_SELECT_NODES=true}if(!Sarissa.IS_ENABLED_TRANSFORM_NODE&&window.XSLTProcessor&&self.XMLElement){XMLElement.prototype.transformNodeToObject=function(C,B){var A=document.implementation.createDocument("","",null);Sarissa.copyChildNodes(this,A);A.transformNodeToObject(C,B)};Document.prototype.transformNodeToObject=function(E,B){var A=null;try{A=new XSLTProcessor();if(A.reset){A.importStylesheet(E);var C=A.transformToFragment(this,B);Sarissa.copyChildNodes(C,B)}else{A.transformDocument(this,E,B,null)}}catch(D){if(E&&B){throw"Failed to transform document. (original exception: "+D+")"}else{if(!E){throw"No Stylesheet Document was provided. (original exception: "+D+")"}else{if(!B){throw"No Result Document was provided. (original exception: "+D+")"}else{if(A==null){throw"Could not instantiate an XSLTProcessor object. (original exception: "+D+")"}else{throw D}}}}}};XMLElement.prototype.transformNode=function(B){var A=document.implementation.createDocument("","",null);Sarissa.copyChildNodes(this,A);return A.transformNode(B)};Document.prototype.transformNode=function(E){var A=document.implementation.createDocument("","",null);this.transformNodeToObject(E,A);var D=null;try{var B=new XMLSerializer();D=B.serializeToString(A)}catch(C){throw"Failed to serialize result document. (original exception: "+C+")"}return D};Sarissa.IS_ENABLED_TRANSFORM_NODE=true}Sarissa.setXslParameter=function(J,G,H){try{var C=J.getElementsByTagName(_SARISSA_IEPREFIX4XSLPARAM+"param");var B=C.length;var I=false;var A;if(H){for(var E=0;E<B&&!I;E++){if(C[E].getAttribute("name")==G){A=C[E];while(A.firstChild){A.removeChild(A.firstChild)}if(!H||H==null){}else{if(typeof H=="string"){A.setAttribute("select",H);I=true}else{if(H.nodeName){A.removeAttribute("select");A.appendChild(H.cloneNode(true));I=true}else{if(H.item(0)&&H.item(0).nodeType){for(var D=0;D<H.length;D++){if(H.item(D).nodeType){A.appendChild(H.item(D).cloneNode(true))}}I=true}else{throw"Failed to set xsl:param "+G+" (original exception: "+F+")"}}}}}}}return I}catch(F){throw F;return false}};var deCarta={};deCarta.Array={};deCarta.Encoding={};deCarta.Events={};deCarta.IdManager={};deCarta.Math={};deCarta.String={};deCarta.Test={};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.1sp05";GLOBALS.API_BUILD="$LastChangedRevision: 49731 $";GLOBALS.API_RELEASECLASS="RELEASE";function Credentials(){}if(document.URL.indexOf("https://")>-1){Credentials.url=DeCartaConfig.urlDDSWebServicesSSL}else{Credentials.url=DeCartaConfig.urlDDSWebServices}Credentials.clientName="howie";Credentials.clientPassword="showme";Credentials.configuration="nwf-tile";Credentials.transparentConfiguration="nwft-tile";Credentials.mapType="STREET";Credentials.ISOCountryCode="US";Credentials.trafficEnabled=false;Credentials.rel="4.4.1sp05";Credentials.dgkey="UgUKOfwyvL3gZeBBZqTcZZyCafrNhOlR";Credentials.imgPath="/decarta/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.requestUrlOverride={};function Address(E,H,C,B,G,F,D,A){if(E||E==0){this.buildingNumber=E}else{this.buildingNumber=""}this.street=H||"";this.countrySubdivision=C||"";this.countrySecondarySubdivision=B||"";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.Array.isArray=function(A){return Object.prototype.toString.call(A)==="[object Array]"};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.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}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,J){if(this.mercPixels[E]){return(this.mercPixels[E])}var A=this.positions;if(this.generalize){A=Utilities.generalize(A,E,10,J);this.generalized[E]=A}var F=Utilities.radsPerPixelAtZoomLevel(J,E);var I=A.length;var C=[];for(var G=0;G<I;G++){var H=(A[G]);var B=Math.round(Utilities.lat2pix(H.lat,F));var D=Math.round(Utilities.lon2pix(H.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.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(S,O,B){var Z,Y;var I=this.getMercPixels(S,O);var E=I.length;if(E<2){return I}var P=[];for(Z=0;Z<E-1;Z++){P[Z]=[];P[Z][0]=I[Z];P[Z][1]=I[Z+1]}var X=P.length;var b=Utilities.radsPerPixelAtZoomLevel(O,S);var F=Math.round(Utilities.lat2pix(B.maxPosition.lat,b));var T=Math.round(Utilities.lat2pix(B.minPosition.lat,b));var R=Math.round(Utilities.lon2pix(B.maxPosition.lon,b));var C=Math.round(Utilities.lon2pix(B.minPosition.lon,b));for(Z=0;Z<X;Z++){A(P[Z])}var c=[];var G=0;var a="oc";var K="oc0";var H="oc1";var U=1;var J=2;var N=4;var Q=8;Z=0;while(Z<X){var D=P[Z];if(!(D[K]|D[H])){c[G++]=D;Z++;continue}else{if(D[K]&D[H]){Z++;continue}else{for(Y=0;Y<2;Y++){var V=D[a+Y];var M,L;if(!V){continue}if(V&U){M=D[0].x+(D[1].x-D[0].x)*(F-D[0].y)/(D[1].y-D[0].y);L=F}else{if(V&J){M=D[0].x+(D[1].x-D[0].x)*(T-D[0].y)/(D[1].y-D[0].y);L=T}}if(V&N){M=R;L=D[0].y+(D[1].y-D[0].y)*(R-D[0].x)/(D[1].x-D[0].x)}else{if(V&Q){M=C;L=D[0].y+(D[1].y-D[0].y)*(C-D[0].x)/(D[1].x-D[0].x)}}if(isNaN(M)||!isFinite(M)||isNaN(L)||!isFinite(L)){Z++;break}var W=new PixelPoint(M,L);D[Y]=W}A(D)}}}return c;function A(d){var m="oc";var j=1;var l=2;var i=4;var g=8;for(var f=0;f<2;f++){var h=d[f];d[m+f]=0;if(h.x>R){d[m+f]+=i}else{if(h.x<C){d[m+f]+=g}}if(h.y>F){d[m+f]=j}else{if(h.y<T){d[m+f]=l}}}}};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.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 XMLRequestFactory();this.xmlRecFac.mapType="STREET";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,F){var E=Utilities.getRequestId();if(typeof F=="function"){B[E]=F}else{throw new Exception("Geocode.geocode: callBack must be a function, arg was: "+F)}var D=this.xmlRecFac.createGeocodeRequestDOM(C,E,this.returnFreeForm);JSRequest.send(D,A.geocodeCallback)};this.reverseGeocode=function(C,F){var E=Utilities.getRequestId();if(typeof F=="function"){B[E]=F}else{throw new Exception("Geocode.reverseGeocode: callBack must be a function, arg was: "+F)}var D=this.xmlRecFac.createReverseGeocodeRequestDOM(C,E);JSRequest.send(D,A.reverseGeocodeCallback)};this.reverseGeocodeCallback=function(E){var K=Sarissa.getDomDocument();K=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(E),"text/xml");if(document.all){K.setProperty("SelectionLanguage","XPath");K.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var G;if(K.selectNodes("//xls:Error").length>0){G=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));if(G!=-1){B[G](new Address("","","","","","",""))}else{throw new Exception("Error looking up reverse geocode callback, server did not provide necessary information.");return false}return }else{var F,J,I,L,M,C,D;try{F=Sarissa.getText(K.selectSingleNode("//xls:Building/@number"))}catch(H){F=""}try{J=Sarissa.getText(K.selectSingleNode("//xls:Street"))}catch(H){J=""}try{I=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='CountrySubdivision']"))}catch(H){I=""}try{L=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']"))}catch(H){L=""}try{M=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='Municipality']"))}catch(H){M=""}try{C=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='MunicipalitySubdivision']"))}catch(H){C=""}try{D=Sarissa.getText(K.selectSingleNode("//xls:PostalCode"))}catch(H){D=""}G=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));B[G](new Address(F,J,I,L,M,D,C))}};this.geocodeCallback=function(X){var O=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(X),"text/xml");if(document.all){O.setProperty("SelectionLanguage","XPath");O.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var L=[];var D=[];var W=[];var P;var K=O.selectNodes("//xls:Error");if(K.length>0){P=Sarissa.getText(O.selectSingleNode("//xls:Response/@requestID"));if(typeof B[P]=="function"){B[P](null);B[P]=undefined}}else{var N;try{N=O.selectNodes("//xls:GeocodedAddress")}catch(V){P=Sarissa.getText(O.selectSingleNode("//xls:Response/@requestID"));B[P](L,D,W);B[P]=undefined;return }for(var S=0;S<N.length;S++){var M=new GeocodedAddress();var T=(Sarissa.serialize((N[S])));var I;if(T.indexOf("<gml:pos/>")>0){I="0.0 0.0"}else{I=T.substring(T.indexOf("<gml:pos>")+"<gml:pos>".length,T.indexOf("</gml:pos>"))}M.position=new Position(I);var G;if(T.indexOf("<xls:freeFormAddress>")>0){if(T.indexOf("<xls:freeFormAddress/>")>0){G="NO ADDRESS FOUND"}else{G=T.substring(T.indexOf("<xls:freeFormAddress>")+"<xls:freeFormAddress>".length,T.indexOf("</xls:freeFormAddress>"))}G=new FreeFormAddress(G);M.freeFormAddress=G}else{G=new Address();var Q;var R;if(T.indexOf('<xls:Building number="')>0){Q=T.indexOf('<xls:Building number="')+'<xls:Building number="'.length;R=T.indexOf('"/>',Q);G.buildingNumber=T.substring(Q,R)}if(T.indexOf("<xls:Street>")>0){Q=T.indexOf("<xls:Street>")+"<xls:Street>".length;R=T.indexOf("</xls:Street>",Q);G.street=T.substring(Q,R)}if(T.indexOf('<xls:Place type="CountrySubdivision">')>0){Q=T.indexOf('<xls:Place type="CountrySubdivision">')+'<xls:Place type="CountrySubdivision">'.length;R=T.indexOf("</xls:Place>",Q);G.countrySubdivision=T.substring(Q,R)}if(T.indexOf('<xls:Place type="CountrySecondarySubdivision">')>0){Q=T.indexOf('<xls:Place type="CountrySecondarySubdivision">')+'<xls:Place type="CountrySecondarySubdivision">'.length;R=T.indexOf("</xls:Place>",Q);G.countrySecondarySubdivision=T.substring(Q,R)}if(T.indexOf('<xls:Place type="Municipality">')>0){Q=T.indexOf('<xls:Place type="Municipality">')+'<xls:Place type="Municipality">'.length;R=T.indexOf("</xls:Place>",Q);G.municipality=T.substring(Q,R)}if(T.indexOf('<xls:Place type="MunicipalitySubdivision">')>0){Q=T.indexOf('<xls:Place type="MunicipalitySubdivision">')+'<xls:Place type="MunicipalitySubdivision">'.length;R=T.indexOf("</xls:Place>",Q);G.MunicipalitySubdivision=T.substring(Q,R)}if(T.indexOf("<xls:PostalCode>")>0){Q=T.indexOf("<xls:PostalCode>")+"<xls:PostalCode>".length;R=T.indexOf("</xls:PostalCode>",Q);G.postalCode=T.substring(Q,R)}M.structuredAddress=G}var H;if(T.indexOf("<xls:BoundingBox>")<0){H=null}else{var U=T.substring(T.indexOf("<xls:BoundingBox>")+"<xls:BoundingBox>".length,T.indexOf("</xls:BoundingBox>"));var F=U.substring(U.indexOf('">')+'">'.length,U.indexOf("</gml"));var C=U.substring(U.indexOf("</gml")+5,U.length);var E=C.substring(C.indexOf('">')+'">'.length,C.indexOf("</gml"));H=new BoundingBox(new Position(F),new Position(E))}M.boundingBox=H;var J;if(T.indexOf("matchType")<0){J=null}else{J=T.substring(T.indexOf("matchType="));J=J.substring(J.indexOf('"')+1);J=J.substring(0,J.indexOf('"'))}M.matchType=J;L.push(new Position(I));D.push(G);W.push(M)}P=Sarissa.getText(O.selectSingleNode("//xls:Response/@requestID"));B[P](L,D,W);B[P]=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.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;if(!C[B]){C[B]={}}if(D){C[B][A]=D}else{C[B][A]=true}};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(A,C,D,B){this.init(A,C,D,B)}InfoWindow.prototype.xOffset=-30;InfoWindow.prototype.yOffset=0;InfoWindow.prototype.bubble=null;InfoWindow.prototype.bubbleClassName="decarta-bubble";InfoWindow.prototype.bubbleContent=null;InfoWindow.prototype.bubbleContentClassName="decarta-bubbleContent";InfoWindow.prototype.bubbleClose=null;InfoWindow.prototype.bubbleCloseClassName="decarta-close";InfoWindow.prototype.associatedPin=null;InfoWindow.prototype.init=function(A,C,D,B){this.initBubble();if(A){this.bubble=A;this.bubble.id="decarta-bubble";this.bubbleContent.style.position="absolute";this.bubble.appendChild(this.bubbleContent);this.bubble.appendChild(this.bubbleClose)}if(B){this.bubbleClose.src=B.src;this.bubbleClose.style.top=B.anchorY+"px";this.bubbleClose.style.left=B.anchorX+"px";if(B.height){this.bubbleClose.style.height=B.height+"px"}if(B.width){this.bubbleClose.style.width=B.width+"px"}if(Utilities.ie6&&this.bubbleClose.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(this.bubbleClose)}this.bubbleClose.style.position="absolute"}if(C){this.xOffset=C}if(D){this.yOffset=D}};InfoWindow.prototype.initBubble=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;this.bubbleClose=document.createElement("img");this.bubbleClose.src=Credentials.infoWindowCloseButton;this.bubbleClose.id=this.bubbleCloseClassName;this.bubbleClose.className=this.bubbleCloseClassName;this.bubbleClose.owner=this;this.bubbleClose.onclick=function(B){B=B||event;B.stoppropagation?B.stoppropagation():B.cancelBubble=true;this.owner.hide()};this.bubble.appendChild(this.bubbleContent);this.bubble.appendChild(this.bubbleClose)}catch(A){throw new Exception("initBubble error:"+A.message)}};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=""}};InfoWindow.prototype.show=function(A){this.bubble.style.zIndex=Pin.zIndexCounter+10000;this.bubbleContent.style.zIndex=Pin.zIndexCounter+10000;this.bubbleClose.style.zIndex=Pin.zIndexCounter+10000;this.bubble.style.display="block";if(A){this.associatedPin=A}else{this.associatedPin=null}};InfoWindow.prototype.hide=function(){this.bubble.style.display="none"};function JSRequest(){}JSRequest.host=null;JSRequest.interceptorRequestFunction=null;JSRequest.interceptorResponseFunction=null;JSRequest.TIMEOUT=60000;JSRequest.timeoutHandler=function(){throw new Exception("JSRequest timeout")};JSRequest.xmlhttp=true;JSRequest.hostInProgress=false;JSRequest.holder=[];JSRequest.xmlHTTPRequestIntercepter=null;JSRequest.registerXMLHTTPRequestInterceptor=function(A){JSRequest.xmlHTTPRequestIntercepter=A};JSRequest.registerXMLRequestInterceptor=function(A){JSRequest.interceptorRequestFunction=A};JSRequest.registerXMLResponseInterceptor=function(A){JSRequest.interceptorResponseFunction=A};JSRequest.callbackFunctions=new Array();JSRequest.callbackRegistry=function(D){var B=D;try{if(B&&B.response!=null&&B.response.indexOf("problem connecting to DDS")>0){throw new Exception("Problem connecting to DDS: Please try again later or contact support")}if(B.response!=null){try{if(typeof JSRequest.interceptorResponseFunction==="function"){var A=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(B.response),"text/xml");if(B.response.indexOf("RUOK")==-1){B.response=Sarissa.serialize(JSRequest.interceptorResponseFunction(A))}}}catch(C){throw new Exception("Application Error: API user application response interceptor function threw error: "+C.message)}if(JSRequest.callbackFunctions[B.requestID]){JSRequest.callbackFunctions[B.requestID](B.response)}JSRequest.callbackFunctions[B.requestID]=null}else{}if(document.getElementById(B.requestID+":"+B.chunkNo)){document.getElementsByTagName("head").item(0).removeChild(document.getElementById(B.requestID+":"+B.chunkNo))}}catch(C){throw new Exception(C.message)}};JSRequest.checkTimeout=function(B){var A=(B.split(":"))[0];if(JSRequest.callbackFunctions[A]!=null){JSRequest.host=null;JSRequest.timeoutHandler(A);JSRequest.callbackFunctions[A]=null;document.getElementsByTagName("head").item(0).removeChild(document.getElementById(B))}};JSRequest.timeoutHandler=function(B,A){JSRequest.timeoutHandler=B;JSRequest.TIMEOUT=A||60000};JSRequest.send=function(W,G){if(!W){return }if(JSRequest.xmlhttp){try{if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(S){}}var X=new XMLHttpRequest();var L=JSRequest.getRequestOverrideUrl(W);if(!L){X.open("POST",Credentials.url,true)}else{X.open("POST",L,true)}}catch(S){throw new Exception(S.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 4.2.2 feature of using dynamic script tags (JSON/GET) to bypass this security issue.")}X.onreadystatechange=function(){if(X.readyState==4){if(X.responseText==""){throw new Exception("Problem connecting to DDS Web Services: Please try again later or contact support")}if(X.responseText&&X.responseText!=null&&X.responseText.indexOf("problem connecting to DDS")>0){throw new Exception("Problem connecting to DDS: Please try again later or contact support")}G(X.responseText)}};if(JSRequest.xmlHTTPRequestIntercepter){JSRequest.xmlHTTPRequestIntercepter(X)}X.send(W);return }if(JSRequest.host==null){JSRequest.holder.push(W);JSRequest.holder.push(G);if(JSRequest.hostInProgress){return }JSRequest.hostInProgress=true;var H=new XMLRequestFactory();var B=H.createRUOKRequestDOM(Utilities.getRequestId());W=B;G=JSRequest.getHost}try{if(typeof JSRequest.interceptorRequestFunction==="function"){if(!JSRequest.xmlhttp&&JSRequest.host==null){var D=Sarissa.serialize(W)}else{var D=Sarissa.serialize(JSRequest.interceptorRequestFunction(W))}}else{var D=Sarissa.serialize(W)}}catch(S){throw new Exception("Application Error: API user application request interceptor function threw error: "+S.message)}var F=Credentials.url;var P=1800;var T=F.length;var A=80;var R=(encodeURIComponent(D)).length;var J;var Q=1;while(true){if(T+A+(R/Q)<P){J=Q;break}Q++}var M="";var U=Math.ceil(D.length/J);var N=Utilities.getRequestId();var K=0;for(var Q=1;Q<=J;Q++){JSRequest.callbackFunctions[N]=G;if(K==0){var E=Math.round(U*Q-U)}else{var E=K}var C=Math.round(U*Q);K=C;var I=D.substring(E,C);M=encodeURIComponent(I);var V=document.createElement("script");V.setAttribute("type","text/javascript");var O=F+"?reqID="+N+"&chunkNo="+Q+"&numChunks="+J+"&callback=JSRequest.callbackRegistry&data="+M;O=O.replace(new RegExp("\\+","g"),"%2b");V.setAttribute("src",O);V.setAttribute("id",N+":"+Q);document.getElementsByTagName("head").item(0).appendChild(V);setTimeout("JSRequest.checkTimeout('"+N+":"+Q+"')",JSRequest.TIMEOUT)}};JSRequest.getHost=function(G){var E=Sarissa.getDomDocument();E=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(G),"text/xml");E.setProperty("SelectionLanguage","XPath");E.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(E.selectNodes("//xls:Error").length>0){throw new Exception("Error Message: "+(E.selectNodes("//@message"))[0].value)}var D=E.selectSingleNode("//xls:RUOKResponse/@hostName").value;var A=Credentials.url;var F,H;if(A.indexOf("https://")>-1){F="https://"}else{F="http://"}var C=A.substring(F.length);if(C.indexOf(":")>-1){H=C.substring(C.indexOf(":"))}else{H=C.substring(C.indexOf("/"))}JSRequest.host=F+D+H;Credentials.url=JSRequest.host;for(var B=0;B<JSRequest.holder.length;B++){JSRequest.send(JSRequest.holder[B],JSRequest.holder[B+1]);B=B+1}JSRequest.holder=[];JSRequest.hostInProgress=false};JSRequest.setXMLHTTPMode=function(){JSRequest.xmlhttp=true;if(Credentials.url.indexOf("JSON")>-1){var A=Credentials.url.substring(0,Credentials.url.indexOf("/JSON"));Credentials.url=A+"/openls"}};JSRequest.setDynamicScriptTagMode=function(){JSRequest.xmlhttp=false;if(Credentials.url.indexOf("/openls/openls")>-1){var A=Credentials.url.substring(0,Credentials.url.indexOf("/openls/openls"));Credentials.url=A+"/openls/JSON"}};JSRequest.getRequestOverrideUrl=function(B){var A="";var C=B.selectSingleNode("//xls:XLS/xls:Request").getAttribute("methodName");if(Credentials.requestUrlOverride[C]){A=Credentials.requestUrlOverride[C]}return A};function KML(C,A,B){if(!C){throw new Exception("Error constructing a KML object, geometry is required")}this.geometry=C;this.name=A||null;this.description=B||null}function KMLGeometry(A,B){this.type=A;this.coordinates=B}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(a){deCarta.StyleManager.init();if(!(a&&a.style)){throw new Exception("Must supply a div element to construct the map.")}this.mapDiv=a;if(!(this.mapDiv.style.height)){this.mapDiv.style.height=GLOBALS.DEFAULT_MAP_HEIGHT}if(!(this.mapDiv.style.width)){this.mapDiv.style.width=GLOBALS.DEFAULT_MAP_WIDTH}this.type="map";this.routePreference=new RoutePreference("Fastest",new UOM("MI"));var AL=this;var A={};var r=undefined;var AP=null;var Q=null;var X=null;var AF=null;var Ac=new XMLRequestFactory();Ac.mapType=GLOBALS.STREET;var Af="server";var AR=false;var AQ=null;var E=null;var D=[];var b=new Array();var h=new deCarta.LinkedList();var i=[];var AN=null;var g=null;var B=document.all;var P="px";var AH=0;var p=true;var AS=false;var n=0;var l=0;var Y=false;var AJ=false;var AZ=0;var AX=0;var K=false;var c=true;var u=true;var AC=new Date();var o=new Date();var C=false;var y=false;var AV=false;var m=null;var Z=null;var S=GLOBALS.DEFAULT_MAP_TILE_SIZE;var F=S;var w=0;var AY=0;var R=2;var AG=new PixelPoint(0,0);var AW=0;var AU=0;var AM=0;var AK=0;var Ad=0;var AI=0;var v=0;var t=0;this.authenticate=function(Ah,Ag){if(!Ah||!Ag||Ah==""||Ag==""){throw new Exception("Error calling Map.authenticate(), bad params")}Credentials.clientName=Ah;Credentials.clientPassword=Ag;Ac.clientName=Ah;Ac.clientPassword=Ag};this.setURL=function(Ag){Credentials.url=Ag};this.setConfiguration=function(Ag){if(!Ag){throw new Exception("error calling Map.setConfiguration() with argument: "+Ag)}Credentials.configuration=Ag;Ac.configuration=Ag};this.setTransparentConfiguration=function(Ag){if(!Ag){throw new Exception("error calling Map.setTransparentConfiguration() with arg: "+Ag)}Credentials.transparentConfiguration=Ag;Ac.transparentConfiguration=Ag};this.setMapStyle=function(Ah){Credentials.configuration=Ah;Ac.configuration=Ah;if(AQ){AQ=(new DOMParser()).parseFromString(Sarissa.serialize(AQ),"text/xml");AQ.setProperty("SelectionLanguage","XPath");AQ.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var Ag=AQ.selectSingleNode("/xls:XLS/xls:RequestHeader");Ag.setAttribute("configuration",Ah);i[2].refUrl.setParameter("config",Ah);i[2].refresh()}};this.setMapFormat=function(Ah){Ac.streetImgFormat=Ah;if(AQ){AQ=(new DOMParser()).parseFromString(Sarissa.serialize(AQ),"text/xml");AQ.setProperty("SelectionLanguage","XPath");AQ.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var Ag=AQ.selectSingleNode("/xls:XLS/xls:Request/xls:PortrayMapRequest/xls:Output");Ag.setAttribute("format",Ah);i[2].refUrl.setParameter("format",Ah);i[2].refresh()}};this.changeCurrentMapStyle=function(Ag){setMapStyle(Ag)};this.reDrawMap=function(Ag){if(AQ==null){return false}AL.centerOnPosition(AL.getCenterPosition(),Ag);return true};this.addCopyrightMessage=function(Ah,Ag,Ai){if(deCarta.String.isString(Ah)){AP=new deCarta.CopyrightMessage(Ah)}else{AP=Ah}AL.addMapControl(AP);if(Ag&&Ai){AP.position=function(){};AP.frame.style.top=Ai+P;AP.frame.style.left=Ag+P}};this.centerOnAddress=function(Aj,Ah,Ag){f();var Ai=Utilities.getRequestId();if(typeof Ah=="function"){D[Ai]=Ah}else{D[Ai]=null}AL.hidePinsBeforeZoom();AQ=Ac.createMapAddressRequestDOM(Aj,S,Ai,Q.getGXConvertedZoomLevel(),Ag);JSRequest.send(AQ,N)};this.centerOnPosition=function(Ag,Ai,Ah){m=Ag.clone();f();var Aj=Utilities.getRequestId();if(typeof Ai=="function"){D[Aj]=Ai}else{D[Aj]=null}AL.hidePinsBeforeZoom();AQ=Ac.createMapRequestDOM(Ag,S,Aj,Q.getGXConvertedZoomLevel(),Ah);JSRequest.send(AQ,s)};this.panToPosition=function(An,Ak){var Ag=An.clone();var Aj=AL.getCenterPosition();var Am=this.posToMercPix(Aj);var Ai=this.posToMercPix(Ag);var Ah=new PixelPoint(Math.round(Am.x-Ai.x),Math.round(Am.y-Ai.y));if(Ah.x==0&&Ah.y==0){return }var Al=Utilities.centerContextToBoundingBox(Aj,Q.getRadius());if(Al.extendedContains(Ag)){if(typeof Ak=="function"){D.panToPosition=Ak}else{D.panToPosition=null}O(Ah.x,-1*Ah.y)}else{this.centerOnPosition(Ag,Ak)}};this.getCenterPosition=function(){if(!m){throw new Exception("Center Position not set")}var Ai=AM-Ad;var Ah=AK-AI;if(Ai==0&&Ah==0){return m}var Ag=AL.posToMercPix(m);Ag.x-=Ai;Ag.y+=Ah;var Aj=AL.mercPixToPos(Ag);return Aj};this.addCustomInfoWindow=function(Ag){if(g&&AF){g.removeChild(AF.bubble)}AF=Ag;if(g){g.appendChild(AF.bubble)}};this.addAndCenterOnPin=function(Ag){this.addPin(Ag);this.panToPosition(Ag.position)};this.addPin=function(Ag){if(m==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{h.add(Ag)}catch(Ah){return }Ag.map=AL;Ag.setPosition(Ag.position);g.appendChild(Ag.pinImg);if(Ag.pinTxt){g.appendChild(Ag.pinTxt)}};this.getPins=function(){return h.returnAsArray()};this.hidePins=function(){h.operateOnData(function(Ag){if(!Ag){return }Ag.pinImg.style.display="none";Ag.pinTxt.style.display="none"})};this.showPins=function(){h.operateOnData(function(Ag){Ag.pinImg.style.display="block";Ag.pinTxt.style.display="block"})};this.removeAllPins=function(){var Ag;while(h.length>0){Ag=h.remove();if(B){Utilities.purge(Ag.pinImg)}g.removeChild(Ag.pinImg);Ag.pinImg=null;if(Ag.pinTxt){if(B){Utilities.purge(Ag.pinTxt)}g.removeChild(Ag.pinTxt);Ag.pinTxt=null}}};this.removePin=function(Ah){var Ag=null;try{Ag=h.remove(Ah)}catch(Ai){return }if(!Ag){return }Ag.destroy()};this.removePinById=function(Ai){try{var Ag=h.removeById("id",Ai)}catch(Ah){return }if(!Ag){return }if(Ag.pinTxt){Utilities.purge(Ag.pinTxt);g.removeChild(Ag.pinTxt);Ag.pinTxt=null}Utilities.purge(Ag.pinImg);g.removeChild(Ag.pinImg)};this.removePinsById=function(Ak){var Ag=null;var Ai=null;var Ah;try{Ag=h.removeByKey("id",Ak)}catch(Aj){return }if(!Ag){return }for(Ah=0,Ai=Ag.length;Ah<Ai;Ah++){if(Ag[Ah].pinTxt){Utilities.purge(Ag[Ah].pinTxt);g.removeChild(Ag[Ah].pinTxt);Ag[Ah].pinTxt=null}Utilities.purge(Ag[Ah].pinImg);g.removeChild(Ag[Ah].pinImg)}};this.setDragEnabled=function(Ag){if(!"boolean"==(typeof Ag)){throw new Exception("Map.setDragEnabled requires boolean")}p=Ag};this.setShapeClippingEnabled=function(Ag){if(!"boolean"==(typeof Ag)){throw new Exception("Map.setShapeClippingEnabled requires boolean")}AR=Ag};this.setDoubleClickRecenteringEnabled=function(Ag){if(!"boolean"==(typeof Ag)){throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean")}u=Ag};this.setDoubleClickRecenterAndZoom=function(Ag){if(Ag){y=true}else{y=false}};this.setDigitalZoomEnabled=function(Ag){if(Ag){c=true}else{c=false}};this.addOverlay=function(Ag){if(deCarta.Array.isArray(Ag)){var Ai=Ag.length;for(var Ah=0;Ah<Ai;Ah++){Ag[Ah].map=AL;Ac.overlays.push(Ag[Ah])}}else{Ag.map=AL;Ac.overlays.push(Ag)}AB()};this.getOverlays=function(){var Ah=[];var Ai=Ac.overlays.length;for(var Ag=0;Ag<Ai;Ag++){Ah[Ag]=Ac.overlays[Ag]}return Ah};this.removeOverlay=function(Ag){Ag.map=null;var Ai=new Array();for(var Ah=0;Ah<Ac.overlays.length;Ah++){if(Ac.overlays[Ah]&&!Ac.overlays[Ah].equals(Ag)){Ai.push(Ac.overlays[Ah])}}Ac.overlays=Ai;if(Ai.length==0){AB(true)}else{AB()}};this.removeOverlayById=function(Ai){var Ah=new Array();for(var Ag=0;Ag<Ac.overlays.length;Ag++){if(Ac.overlays[Ag]&&Ac.overlays[Ag].id!=(Ai)){Ah.push(Ac.overlays[Ag])}else{Ac.overlays[Ag].map=null}}Ac.overlays=Ah;if(Ah.length==0){AB(true)}else{AB()}};this.removeAllOverlays=function(){if(Ac&&Ac.overlays&&(Ac.overlays.length<=0)){return }Ac.overlays=[];AB(true)};this.setShapeRendering=function(Ag){if(!Ag||!Ag=="client"||!Ag=="server"){throw new Exception("map.setShapeRendering() error: use 'client' or 'server'")}if(Ag=="server"){z()}else{AB()}Af=Ag;Ac.rendering=Ag};this.getShapeRendering=function(){return Af};this.redraw=function(){AB()};this.panWest=function(){O(GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panEast=function(){O(-GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panNorth=function(){O(0,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouth=function(){O(0,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthEast=function(){O(-GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthEast=function(){O(-GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthWest=function(){O(GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthWest=function(){O(GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.addScaleBar=function(Ag){r=Ag;AL.addMapControl(r)};this.addMapTypeController=function(Ag){if(!Ag){throw new Exception("error adding mapTypeController to map")}X=Ag;AL.addMapControl(X)};this.setMapType=function(Ag){if(!(Ag==GLOBALS.STREET||Ag==GLOBALS.HYBRID||Ag==GLOBALS.SATELLITE)){throw new Exception("unsupported mapType. Use '"+GLOBALS.STREET+"' || '"+GLOBALS.HYBRID+"' || '"+GLOBALS.SATELLITE+"'")}Ac.mapType=Ag;if(i.length>0){if(Ag==GLOBALS.STREET){i[0].hide();i[1].hide();i[2].show()}else{if(Ag==GLOBALS.HYBRID){i[0].show();i[1].show();i[2].hide()}else{if(Ag==GLOBALS.SATELLITE){i[0].show();i[1].hide();i[2].hide()}}}}};this.setRoutePreference=function(Ag){AL.routePreference=Ag};this.getRoutePreference=function(){return AL.routePreference};this.routeMap=function(Ai,Ag){var Ah=Utilities.getRequestId();if(typeof Ag=="function"){D[Ah]=Ag}else{D[Ah]=null}if(AL.routePreference.alternateRoutes>0){throw new Exception("Alternate routes only available through RouteQuery for use with client side shape rendering.")}AL.hidePinsBeforeZoom();E=Ac.createRouteGeometryRequestDOM(Ai,Ah,AL.routePreference);JSRequest.send(E,Aa)};this.routeMapById=function(Ai,Ag){var Ah=Utilities.getRequestId();if(typeof Ag=="function"){D[Ah]=Ag}else{D[Ah]=null}if(AL.routePreference.alternateRoutes>0){throw new Exception("Alternate routes only available through RouteQuery for use with client side shape rendering.")}E=Ac.createRouteGeometryByIdRequestDOM(Ai,Ah,null,false);JSRequest.send(E,Aa)};this.clearRoute=function(){if(AQ==null){return false}Ac.routeID=null;var Ah=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(Sarissa.serialize(AQ)),"text/xml");Ah.setProperty("SelectionLanguage","XPath");Ah.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var Ag=Ah.selectSingleNode("//xls:PortrayMapRequest");try{Ag.removeChild(Ag.selectSingleNode("//xls:Overlay"))}catch(Ai){}return true};this.addZoomController=function(Ag){Q=Ag;AL.addMapControl(Q)};this.getZoomController=function(){return Q};this.resize=function(Ag,Ah,Ai){AL.mapDiv.style.height=parseInt(Ag)+P;AL.mapDiv.style.width=parseInt(Ah)+P;AL.positionMapControls();K=true;if(g){AL.reDrawMap(Ai)}};this.getBoundingBox=function(){var Aj=AL.posToMercPix(AL.getCenterPosition());var Ah=(AY*S/2);var An=(w*S/2);var Ak=new PixelPoint(Aj.x+An,Aj.y+Ah);var Al=new PixelPoint(Aj.x-An,Aj.y-Ah);var Ag=AL.mercPixToPos(Ak);var Ai=AL.mercPixToPos(Al);var Am=new BoundingBox(Ai,Ag);return Am};this.getBoundingBoxViewable=function(){var Ai=AL.posToMercPix(AL.getCenterPosition());var Ah=parseInt(AL.mapDiv.style.height)/2;var An=parseInt(AL.mapDiv.style.width)/2;var Al=new PixelPoint(Ai.x+An,Ai.y+Ah);var Ak=new PixelPoint(Ai.x-An,Ai.y-Ah);var Am=AL.mercPixToPos(Al);var Ag=AL.mercPixToPos(Ak);var Aj=new BoundingBox(Ag,Am);return Aj};this.getGridSize=function(){return AY+" "+w};this.setTileBuffer=function(Ag){if(Ag){R=2}else{R=1}};this.setTileBorder=function(Ah){if(Ah){AH=1}else{AH=0}for(var Ai=0;Ai<AY;++Ai){for(var Ag=0;Ag<w;++Ag){i[0].tileArray[Ag][Ai].border=AH;i[1].tileArray[Ag][Ai].border=AH;i[2].tileArray[Ag][Ai].border=AH}}};this.getTileSize=function(){return S};this.setTileSize=function(Ag){S=parseInt(Ag,10);F=S;K=true};this.getMapLayers=function(){return i};this.positionToMapLayerPixel=function(Am){if(!Am||!m){throw new Exception("Map.positionToMapLayerPixel: bad input: "+Am)}var Ai=AL.posToMercPix(AL.getCenterPosition());var Ag=parseInt(AL.mapDiv.style.height)/2;var Al=parseInt(AL.mapDiv.style.width)/2;var Aj=new PixelPoint(Ai.x-Al+AM,Ai.y+Ag-AK);var Ah=this.posToMercPix(Am);var Ak=new PixelPoint(-(Aj.roundX()-Ah.roundX()),(Aj.roundY()-Ah.roundY()));return Ak};this.addMapControl=function(Ai){if(!Ai){throw new Exception("adding invalid control to map.")}else{if(!Ai.type||Ai.map){throw new Exception("adding invalid control to map, with properties type:"+Ai.type+" map:"+Ai.map)}}var Ag=Ai.type;if(this.existsMapControl(Ag)){this.removeMapControl(Ag)}A[Ag]=Ai;this.getMapDiv().appendChild(Ai.appendThis());Ai.map=this;var Ah=new deCarta.DOMDimensions(this.getMapDiv());Ai.position(Ah)};this.existsMapControl=function(Ag){if(A[Ag]){return true}else{return false}};this.removeMapControl=function(Ag){if(!Ag||!(Ag&&A[Ag])){return }var Ah=A[Ag];A[Ag]=undefined;this.getMapDiv().removeChild(Ah.removeThis());Utilities.purge(Ah)};this.positionMapControls=function(){var Ag;var Ah=new deCarta.DOMDimensions(this.getMapDiv());for(Ag in A){if(A.hasOwnProperty(Ag)&&A[Ag].position){A[Ag].position(Ah)}}};this.getMapLayers=function(){return i};this.hide=function(){this.getMapDiv().style.display="none"};this.show=function(){this.getMapDiv().style.display="block";this.positionMapControls()};this.setCompatibility=function(Ah,Ag){switch(Ah){case"restrictDragToDiv":if(Ag){this.addEventListener("mouseout",M)}else{this.clearListeners("mouseout")}break;default:throw new Exception("Map.setCompatibility: illegal flag: "+Ah.toString()+" passed in as argument.");break}};function I(){AF=new InfoWindow()}this.addEventListener=function(Ai,Aj){var Ah=false;for(var Ag=0;Ag<b.length;Ag++){if(b[Ag]==Ai){b[Ai]=Aj;Ah=true;break}}if(!Ah){b.push(Ai);b[Ai]=Aj}};this.clearInstanceListeners=function(){for(var Ag=0;Ag<b.length;Ag++){b[b[Ag]]=null;b[Ag]=null}};this.clearListeners=function(Ah){for(var Ag=0;Ag<b.length;Ag++){if(b[Ag]==Ah){b[b[Ag]]=null;b[Ag]=null}}};function AA(Ai){Ai=Ai?Ai:window.event;var Ag;if(Ai.target){Ag=Ai.target}else{if(Ai.srcElement){Ag=Ai.srcElement}}if(Ag&&Ag.nodeType==3){Ag=Ag.parentNode}if(deCarta.IdManager.checkTag(Ag,"ingoreForMapEvents")){return false}if(Ai.type=="mouseup"){if(b.mouseup){var Aj=new PixelPoint(Ai.clientX,Ai.clientY);var Ah=AL.screenPixToPos(Aj);b.mouseup(Ah)}M(Ai);o=new Date()}else{if(Ai.type=="dblclick"){j(Ai)}else{if(Ai.type=="click"&&((o-AC)<300)){U(Ai)}}}}function U(Ai){Ai=Ai?Ai:window.event;var Ag;if(Ai.target){Ag=Ai.target}else{if(Ai.srcElement){Ag=Ai.srcElement}}if(Ag&&Ag.nodeType==3){Ag=Ag.parentNode}if(deCarta.IdManager.checkTag(Ag,"ingoreForMapEvents")){return false}AL.mapDiv.style.cursor="pointer";AL.mapDiv.unselectable="on";var Aj=new PixelPoint(Ai.clientX,Ai.clientY);var Ah=AL.screenPixToPos(Aj);if(b.rightclick&&(B&&Ai.button==2)||(!B&&Ai.which==3)){b.rightclick(Ah);return }if(b.dblclick&&Ai.type=="dblclick"){b.dblclick(Ah);return }if(b.click&&Ai.type=="click"){b.click(Ah)}}function k(Ai){Ai=Ai?Ai:window.event;if((!B&&Ai.which==3)||(B&&Ai.button==2)){if(b.rightclick){U(Ai)}return true}if((!B&&Ai.which==2)||(B&&Ai.button==4)){return true}var Ag;if(Ai.target){Ag=Ai.target}else{if(Ai.srcElement){Ag=Ai.srcElement}}if(Ag&&Ag.nodeType==3){Ag=Ag.parentNode}if(deCarta.IdManager.checkTag(Ag,"ingoreForMapEvents")){return false}AC=new Date();if(b.mousedown){var Aj=new PixelPoint(Ai.clientX,Ai.clientY);var Ah=AL.screenPixToPos(Aj);b.mousedown(Ah)}AS=true;AL.mapDiv.style.cursor="move";n=Ai.clientX;l=Ai.clientY;document.body.onmousemove=L;return false}function M(Ag){AS=false;AL.mapDiv.style.cursor="default";document.body.onmousemove=null;if(AV&&b.moveend){b.moveend();AV=false}if(r){r.calculate()}return false}function j(Am){var Ak;if(Am.target){Ak=Am.target}else{if(Am.srcElement){Ak=Am.srcElement}}if(Ak&&Ak.nodeType==3){Ak=Ak.parentNode}if(deCarta.IdManager.checkTag(Ak,"ingoreForMapEvents")){return false}C=true;if(b.dblclick){U(Am)}if(!u){return }var An=Am.clientX;var Al=Am.clientY;var Ah=Utilities.getAbsoluteLeft(AL.mapDiv)-Utilities.getScrollLeft();var Ag=Utilities.getAbsoluteTop(AL.mapDiv)-Utilities.getScrollTop();var Aj=(parseInt(An-Ah)-Math.round(parseInt(AL.mapDiv.style.width)/2))*-1;var Ai=(parseInt(Al-Ag)-Math.round(parseInt(AL.mapDiv.style.height)/2))*-1;O(Aj,Ai)}function L(Aj){var Ak;var Ai;Aj=Aj?Aj:window.event;if(!AV){if(b.movestart){b.movestart()}}if(b.move){Ak=new PixelPoint(Aj.clientX,Aj.clientY);Ai=AL.screenPixToPos(Ak);b.move(Ai)}if(!p){if(Aj.type=="mouseup"&&b.mouseup){Ak=new PixelPoint(Aj.clientX,Aj.clientY);Ai=AL.screenPixToPos(Ak);b.mouseup(Ai);M(Aj)}return false}AV=true;if(!AS){return false}var Ah=Aj.clientX-n;var Ag=Aj.clientY-l;v+=Ah;t+=Ag;if(Math.abs(v)>F||Math.abs(t)>F){Ab()}AM+=Ah;AK+=Ag;AE(AM,AK);n=Aj.clientX;l=Aj.clientY;return false}function V(Ai){if(!Ai){Ai=window.event}var Ah=Ai.target?Ai.target:Ai.srcElement;var Ag=(Ai.relatedTarget)?Ai.relatedTarget:Ai.toElement;try{if(Ag&&Ah&&(Ag.id==Ah.id)){return }}catch(Ai){}if(b.mouseout){b.mouseout()}}this.getMapDiv=function(){return AL.mapDiv};this.getBubble=function(){return AF};this.getChooser=function(){return X};this.getCopyright=function(){return AP};this.getTileDiv=function(){return g};this.getZoomLck=function(){return Y};this.hidePinsBeforeZoom=function(){h.operateOnData(function(Ag){if(Ag){Ag.zoomHide()}})};this.showPinsAfterZoom=function(){h.operateOnData(function(Ag){if(Ag){Ag.zoomShow()}})};function AT(){h.operateOnData(function(Ag){if(!Ag){return }Ag.setPosition(Ag.position);Ag.hideInfoWindow()});AL.showPinsAfterZoom()}this.zoomMap=function(Ag){if(AQ==null){throw new Exception("Map not yet initialized. Map must be initialized before zooming.")}if(Y){return false}var Ai=Q.selected;if(Ai==Ag){return false}AL.hidePinsBeforeZoom();Y=true;var Ah=AL.getCenterPosition();Ai=Q.getGXConvertedZoomLevel();Q.setZoomLevel(Ag);Ag=Q.getGXConvertedZoomLevel();if(c&&(Math.abs(Ai-Ag)<=2)){if((Ac&&Ac.mapType=="HYBRID")||(!Ac.mapType&&Credentials.mapType=="HYBRID")){i[1].hide()}for(var Aj=0;Aj<i.length;Aj++){i[Aj].zoom(Ag-Ai,AN,v,t)}}AQ=Ac.zoomMapRequestDOM(AQ,0,0,0,0,Ag,Ai,Ah,(Q.getRadiusX()*1000/w));f();JSRequest.send(AQ,J);return true};function AO(){return false}this.setCountryCode=function(Ag){if(!Ag){throw new Exception("error calling Map.setCountryCode()")}Credentials.ISOCountryCode=Ag};this.getGXPixelPoint=function(Ag){this.posToMercPix(Ag)};this.posToMercPix=function(Aj){var Ah=Utilities.radsPerPixelAtZoom(S,Q.getGXConvertedZoomLevel());var Ai=Utilities.lat2pix(Aj.lat,Ah);var Ag=Utilities.lon2pix(Aj.lon,Ah);return new PixelPoint(Ag,Ai)};this.mercPixToPos=function(Ag){var Aj=Utilities.radsPerPixelAtZoom(S,Q.getGXConvertedZoomLevel());var Ah=Utilities.pix2lat(Ag.y,Aj);var Ai=Utilities.pix2lon(Ag.x,Aj);return new Position(Ah,Ai)};this.screenPixToPos=function(Aj){var Ak=Aj.y-Utilities.getAbsoluteTop(AL.mapDiv)+Utilities.getScrollTop();var Ah=Aj.x-Utilities.getAbsoluteLeft(AL.mapDiv)+Utilities.getScrollLeft();var Am=AL.posToMercPix(AL.getCenterPosition());var An=Am.x-(parseInt(AL.mapDiv.style.width)/2);var Ao=Am.y+(parseInt(AL.mapDiv.style.height)/2);var Ai=new PixelPoint(An,Ao);var Al=new PixelPoint(Ai.x+Ah,Ai.y-Ak);var Ag=AL.mercPixToPos(Al);return Ag};function Aa(Aj){var Ao=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(Aj),"text/xml");Ao.setProperty("SelectionLanguage","XPath");Ao.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var Am;var Aq=Ao.selectNodes("//xls:Error");if(Aq.length>0){Am=Sarissa.getText(Ao.selectSingleNode("//xls:Response/@requestID"));if(typeof D[Am]=="function"){D[Am](null);D[Am]=undefined}return }f();var Ah=Ao.selectSingleNode("//xls:RouteID");var Ai=(Ao.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data;var Ak=(Ao.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data;var Ar=new BoundingBox(new Position(Ai),new Position(Ak));var Al=Ar.getRadius();Q.setRadius(Al);m=Ar.getCenterPosition();var An=Q.getZoomLevelToFitBoundingBox(Ar);Q.setZoomLevel(An);var Ag=Ac.createCenterContext(Ar.getCenterPosition(),Q.getRadius());AQ=Ac.createRouteMapDOM(Ag,Ah,Utilities.getRequestId(),S,Q.getGXConvertedZoomLevel(),AL.routePreference);var Ap=Utilities.parseRoutes(Ao);Am=Sarissa.getText(Ao.selectSingleNode("//xls:Response/@requestID"));if(D[Am]){D[Am](Ap);D[Am]=undefined}JSRequest.send(AQ,s)}function N(An){var At=Sarissa.getDomDocument();At=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(An),"text/xml");At.setProperty("SelectionLanguage","XPath");At.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var Au=At.selectNodes("//xls:Error");var Ap;if(Au.length>0){Ap=Sarissa.getText(At.selectSingleNode("//xls:Response/@requestID"));if(typeof D[Ap]=="function"){D[Ap](null);D[Ap]=undefined}return }try{m.lat=parseFloat(At.selectSingleNode("//xls:Pan[@direction='N']").getAttribute("toLat"));m.lon=parseFloat(At.selectSingleNode("//xls:Pan[@direction='E']").getAttribute("toLon"));if(isNaN(m.lat)||isNaN(m.lon)){throw new Exception("Exception: likely no toLon or toLat attributes in Pan")}}catch(Ar){m=new Position(At.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data)}Z=new Position(At.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var Al=At.selectSingleNode("//xls:Pan[@direction='N']");var Aq=At.selectSingleNode("//xls:Pan[@direction='E']");AG.x=parseFloat(Aq.getAttribute("numTiles"))*S;AG.y=-(parseFloat(Al.getAttribute("numTiles"))*S);var Aj=At.selectSingleNode("//xls:Radius");Q.setRadius((parseFloat(Sarissa.getText(Aj))/1000)*w);var Ao;try{Ao=parseInt(At.selectSingleNode("//xls:GridLayer[@name='deCarta']").getAttribute("maxImageHostAliases"),10)}catch(Ar){Ao=0}var Av=At.selectNodes("//xls:URL");H(Av,Ao);try{var Ai=Sarissa.getText(At.selectSingleNode("//xls:freeFormAddress"));if(Ai==""){Ai="NO ADDRESS FOUND"}var Am=new FreeFormAddress(Ai);AT();Ap=Sarissa.getText(At.selectSingleNode("//xls:Response/@requestID"));if(D[Ap]){D[Ap](Am,AL.getCenterPosition());D[Ap]=undefined}var Ag=At.selectSingleNode("//xls:CenterContext");AQ=(new DOMParser()).parseFromString(Sarissa.serialize(AQ),"text/xml");AQ.setProperty("SelectionLanguage","XPath");AQ.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var As=AQ.selectSingleNode("//xls:CenterAddress");var Ak=AQ.selectSingleNode("//xls:Output");Ak.removeChild(As);var Aw=AQ.selectSingleNode("//xls:TileGrid");var Ah=Ag.cloneNode(true);Ak.insertBefore(Ah,Aw)}catch(Ar){throw new Exception("Error updating the request center context from the response for subsequent requests: "+Ar.name+", "+Ar.message)}}function s(Ai){var An=Sarissa.getDomDocument();An=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(Ai),"text/xml");An.setProperty("SelectionLanguage","XPath");An.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var Ak;var Ao=An.selectNodes("//xls:Error");if(Ao.length>0){Ak=Sarissa.getText(An.selectSingleNode("//xls:Response/@requestID"));if(typeof D[Ak]=="function"){D[Ak](null);D[Ak]=undefined}return }try{m.lat=parseFloat(An.selectSingleNode("//xls:Pan[@direction='N']").getAttribute("toLat"));m.lon=parseFloat(An.selectSingleNode("//xls:Pan[@direction='E']").getAttribute("toLon"));if(isNaN(m.lat)||isNaN(m.lon)){throw new Exception("Exception: likely no toLon or toLat attributes in Pan")}}catch(Am){m=new Position(An.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data)}Z=new Position(An.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var Ah=An.selectSingleNode("//xls:Pan[@direction='N']");var Al=An.selectSingleNode("//xls:Pan[@direction='E']");AG.x=parseFloat(Al.getAttribute("numTiles"))*S;AG.y=-(parseFloat(Ah.getAttribute("numTiles"))*S);var Ag=An.selectSingleNode("//xls:Radius");Q.setRadius((parseFloat(Sarissa.getText(Ag))/1000)*w);var Aj;try{Aj=parseInt(An.selectSingleNode("//xls:GridLayer[@name='deCarta']").getAttribute("maxImageHostAliases"),10)}catch(Am){Aj=0}var Ap=An.selectNodes("//xls:URL");H(Ap,Aj);AT();Ak=Sarissa.getText(An.selectSingleNode("//xls:Response/@requestID"));if(D[Ak]){D[Ak](AL.getCenterPosition());D[Ak]=undefined}}function J(Ai){var Am=Sarissa.getDomDocument();Am=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(Ai),"text/xml");Am.setProperty("SelectionLanguage","XPath");Am.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var An=Am.selectNodes("//xls:Error");if(An.length>0){return }try{m.lat=parseFloat(Am.selectSingleNode("//xls:Pan[@direction='N']").getAttribute("toLat"));m.lon=parseFloat(Am.selectSingleNode("//xls:Pan[@direction='E']").getAttribute("toLon"));if(isNaN(m.lat)||isNaN(m.lon)){throw new Exception("Exception: likely no toLon or toLat attributes in Pan")}}catch(Al){m=new Position(Am.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data)}Z=new Position(Am.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var Ah=Am.selectSingleNode("//xls:Pan[@direction='N']");var Ak=Am.selectSingleNode("//xls:Pan[@direction='E']");AG.x=parseFloat(Ak.getAttribute("numTiles"))*S;AG.y=-(parseFloat(Ah.getAttribute("numTiles"))*S);var Ag=Am.selectSingleNode("//xls:Radius");Q.setRadius((parseFloat(Sarissa.getText(Ag))/1000)*w);var Aj;try{Aj=parseInt(Am.selectSingleNode("//xls:GridLayer[@name='deCarta']").getAttribute("maxImageHostAliases"),10)}catch(Al){Aj=0}var Ao=Am.selectNodes("//xls:URL");H(Ao,Aj);Y=false;AT();if(b.zoomend){b.zoomend()}}function H(Ag,Ak){if(r){r.calculate()}q();Ak=Ak||0;var Aj=new deCarta.MapLayerReferenceUrl(Sarissa.getText(Ag[1]));Aj.createGlobeXplorerUrl();var Ah=new deCarta.MapLayerReferenceUrl(Sarissa.getText(Ag[0]),Ak);Ah.createDeCartaTransparentUrl();Ah.setParameter("config",Ac.transparentConfiguration);var Ai=new deCarta.MapLayerReferenceUrl(Sarissa.getText(Ag[0]),Ak);Ai.createDeCartaUrl();Ai.setParameter("config",Ac.configuration);i[0].populate(Aj);i[1].populate(Ah);i[2].populate(Ai);v-=AG.x;t-=AG.y;AB()}function f(){if(!g){Ae();return }else{if(g&&K){K=false;d();return }else{if(g&&!K){return }else{throw new Exception("populateTiles fell through to default.")}}}}function Ae(){var Ag="decarta-mapviewport";if(!AL.mapDiv.className){AL.mapDiv.className=Ag}else{AL.mapDiv.className+=" "+Ag}Utilities.setUnselectable(AL.mapDiv);window.onmouseup=M;AL.mapDiv.oncontextmenu=AO;AL.mapDiv.onmousedown=k;AL.mapDiv.onmouseout=V;AL.mapDiv.onmouseup=AA;AL.mapDiv.ondblclick=AA;AL.mapDiv.onclick=AA;g=document.createElement("div");var Ah="decarta-tiles";g.id=Ah;g.className=Ah;g.style.top=0+P;g.style.left=0+P;Utilities.setUnselectable(g);AL.mapDiv.appendChild(g);if(!Q){Q=new ZoomController();AL.addMapControl(Q);Q.hide()}if(!AF){I()}g.appendChild(AF.bubble);W()}function W(){if(i[0]||i[1]||i[2]){throw new Exception("buildDefaultTileGrid called on existing tile grid")}var Ah;var Ai=parseInt(AL.mapDiv.style.height);var Ag=parseInt(AL.mapDiv.style.width);AY=Math.ceil(Ai/S)+R;if(AY%2==0){AY++}w=Math.ceil(Ag/S)+R;if(w%2==0){w++}AW=-((w*S)-Ag)/2;AU=-((AY*S)-Ai)/2;i[0]=new deCarta.MapLayer(w,AY,AW,AU,S,"decarta-satellite",1);i[1]=new deCarta.MapLayer(w,AY,AW,AU,S,"decarta-transparent",2);i[2]=new deCarta.MapLayer(w,AY,AW,AU,S,"decarta-street",3);i[2].show();for(Ah=0;Ah<i.length;Ah++){i[Ah].appendTiles(g)}AN=new deCarta.ZoomLayer(w,AY,S);AN.appendTiles(g)}function d(){if(!g){throw new Exception("resizeMap called without an existing map.")}var Ag;for(Ag=0;Ag<i.length;Ag++){i[Ag].hide();i[Ag].destroy();i[Ag]=null}i=[];g.style.top=0+P;g.style.left=0+P;W();AM=0;AK=0;n=0;l=0;AS=false;v=0;t=0}function q(){Ad=AM;AI=AK;for(var Ah=0;Ah<i.length;Ah++){i[Ah].reset(-AM-AG.x,-AK-AG.y)}var Ag=[];if(Ac.mapType==GLOBALS.STREET){Ag.push(i[2])}else{if(Ac.mapType==GLOBALS.HYBRID){Ag.push(i[0]);Ag.push(i[1])}else{if(Ac.mapType==GLOBALS.SATELLITE){Ag.push(i[0])}else{throw new Exception("Map.reset: encountered unexpected _xmlRecFac.mapType of "+Ac.mapType)}}}T(Ag);n=0;l=0;AS=false;v=0;t=0}function T(Ao){var Ak=Ao;var Ai=Ak.length;var Al;if(!Y||!c){for(Al=0;Al<Ai;Al++){Ak[Al].show()}return }for(Al=0;Al<Ai;Al++){Ak[Al].delayedLoading=true}var Ag=250;var Am=w*AY;var An=Am*0.8;var Ah=6;setTimeout(Aj,Ag);function Aj(){if(Ak[0].numTilesLoaded>=An||Ah<=0){for(Al=0;Al<Ai;Al++){Ak[Al].show();Ak[Al].delayedLoading=false}AN.hide();return }Ah--;setTimeout(Aj,Ag)}}function Ab(){var Ag;var Ah=i.length;if(v<=-F){v=v+F;for(Ag=0;Ag<Ah;Ag++){i[Ag].rotateTiles(0,1)}AB()}else{if(v>=F){v=v-F;for(Ag=0;Ag<Ah;Ag++){i[Ag].rotateTiles(0,-1)}AB()}}if(t<=-F){t=t+F;for(Ag=0;Ag<Ah;Ag++){i[Ag].rotateTiles(-1,0)}AB()}else{if(t>=F){t=t-F;for(Ag=0;Ag<Ah;Ag++){i[Ag].rotateTiles(1,0)}AB()}}}function AE(Ag,Ah){g.style.left=Ag+P;g.style.top=Ah+P}function O(Ag,Ah){if(AJ){return }if(Ag>1){g.style.left=parseInt(g.style.left)+1+P}else{if(Ag<-1){g.style.left=parseInt(g.style.left)-1+P}}if(Ah>1){g.style.top=parseInt(g.style.top)+1+P}else{if(Ah<-1){g.style.top=parseInt(g.style.top)-1+P}}AJ=true;G(Ag,Ah,true)}function G(Ag,Ak,Aj){if(Aj){AZ=Ag;AX=Ak}var Ai=Math.round(Math.abs(AZ)*0.3);var Ah=Math.round(Math.abs(AX)*0.3);if(Ai>0||Ah>0){if(AZ<0){AZ+=Ai;v-=Ai;AM-=Ai}else{if(AZ>0){AZ-=Ai;v+=Ai;AM+=Ai}}if(AX<0){AX+=Ah;t-=Ah;AK-=Ah}else{if(AX>0){AX-=Ah;t+=Ah;AK+=Ah}}AE(AM,AK);if(Math.abs(v)>F||Math.abs(t)>F){Ab()}setTimeout(G,1)}else{if(b.moveend){b.moveend()}if(D.panToPosition){D.panToPosition(AL.getCenterPosition());D.panToPosition=undefined}if(r){r.calculate()}if(C&&y){AL.getZoomController().zoomInOneLevel()}AJ=false;C=false;AB()}}function AD(){if(!AL.getTileDiv()){return null}var Ag=document.getElementById("canvas");if(Ag){Ag.style.position="relative";Ag.style.zIndex=100;AL.getTileDiv().appendChild(Ag)}else{Ag=document.getElementsByTagName("body")[0].appendChild(document.createElement("canvas"));Ag.id="canvas";if(typeof G_vmlCanvasManager!="undefined"){Ag=G_vmlCanvasManager.initElement(Ag)}Ag.style.position="relative";Ag.style.zIndex=100;AL.getTileDiv().appendChild(Ag)}return Ag}function z(){if(Af=="server"){return }var Ah=AD();var Ag=Ah.getContext("2d");Ag.clearRect(0,0,Ah.width,Ah.height)}function AB(Ay){Ay=Ay||false;if(Af=="server"||!AL.getTileDiv()){return }if(Ac.overlays.length==0&&!Ay){return }if(AJ){return }var Ai=AD();var A9,A8;var BA=AL.getGridSize().split(" ");var BB=parseInt(BA[1])*S;var A3=parseInt(BA[0])*S;Ai.width=BB;Ai.height=A3;var BF=AL.mapDiv;var Ah=-(BB-parseInt(BF.style.width))/2;var Ag=-(A3-parseInt(BF.style.height))/2;var A2=g;Ai.style.left=Ah-parseInt(A2.style.left)+P;Ai.style.top=Ag-parseInt(A2.style.top)+P;var An=Ai.getContext("2d");An.lineCap="round";An.lineJoin="round";var A0=Q.getZoomLevel();var Ak=Utilities.radsPerPixelAtZoomLevel(S,A0);var Am=AL.getBoundingBox();var Aj=new Position(Am.maxPosition.lat+" "+Am.minPosition.lon);var Ao=Math.round(Utilities.lat2pix(Aj.lat,Ak));var Ap=Math.round(Utilities.lon2pix(Aj.lon,Ak));var BG=Ac.overlays;for(var Ax=0;Ax<BG.length;Ax++){var Al=BG[Ax];if(!Al.isVisible){continue}An.lineWidth=Al.getBorderWidth();An.fillStyle="rgba("+Al.fillColorRed+","+Al.fillColorGreen+","+Al.fillColorBlue+","+Al.fillOpacityFloat+")";An.strokeStyle="rgba("+Al.borderColorRed+","+Al.borderColorGreen+","+Al.borderColorBlue+","+Al.strokeOpacityFloat+")";var Ar=[];An.beginPath();if(Al.type=="polygon"||Al.type=="line"){var BE=[];var BD=[];if(Al.type=="line"){An.lineWidth=Al.getWidth();if(Al.clip||AR){Ar=Al.getMercPixelsClipped(A0,S,Am)}else{Ar[0]=Al.getMercPixels(A0,S)}}else{if(Al.type=="polygon"){Ar[0]=Al.getMercPixels(A0,S)}else{throw new Exception("Map inner function draw: fell through to unacceptable situation with line/polygon client side rendering.")}}var Aq=Ar.length;for(A9=0;A9<Aq;A9++){var Aw=Ar[A9].length;BE[A9]=[];BD[A9]=[];for(A8=0;A8<Aw;A8++){var A6=Ar[A9][A8];BE[A9][A8]=parseInt(Ap-A6.x);BD[A9][A8]=parseInt(Ao-A6.y);if(A8==0){An.moveTo((BE[A9][A8]*-1),(BD[A9][A8]))}else{An.lineTo((BE[A9][A8]*-1),(BD[A9][A8]))}}}An.stroke();if(Al.type=="line"){continue}if(!B){An.fill()}else{An.beginPath();var BC=BE.length;for(A9=0;A9<BC;A9++){var A5=BE[A9].length;for(A8=0;A8<A5;A8++){if(A8==0){An.moveTo((BE[A9][A8]*-1),(BD[A9][A8]))}else{An.lineTo((BE[A9][A8]*-1),(BD[A9][A8]))}}}An.closePath();An.fill()}}else{if(Al.type=="circle"){var Av=Al.getPosition();var As=Math.round(Utilities.lat2pix(Av.lat,Ak));var Au=Math.round(Utilities.lon2pix(Av.lon,Ak));var A1=parseInt(Ap-Au);var Az=parseInt(Ao-As);var A4=Al.getRadius().getDegrees();var A7=Math.round(Utilities.lat2pix(Av.lat+A4,Ak));var At=parseInt(A7-As);An.arc((A1*-1),Az,Math.abs(At),0,Math.PI*2,true);An.fill();if(!B){An.stroke()}else{An.arc((A1*-1),Az,Math.abs(At),0,Math.PI*2,true);An.stroke()}}}}}}deCarta.MapLayer=function(A,G,D,F,E,C,B){this.init(A,G,D,F,E,C,B)};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(C,G,E,A,I,D,B){var H,F;this.xTiles=C;this.yTiles=G;this.xOffset=E;this.yOffset=A;this.tileSize=I;if(D){this.layerName=D}if(B){this.cssZIndex=B}this.tileArray=[];this.setDefaultSrc();for(H=0;H<this.xTiles;H++){this.tileArray[H]=[];for(F=0;F<this.yTiles;F++){this.tileArray[H][F]=this.mapTileFactory(H,F)}}};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;C.altSrc=this.srcOnHidden;C.src=this.srcOnHidden;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.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}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}return C};deCarta.MapLayer.setSrc=function(A){if(document.URL.indexOf("https://")>-1&&A.indexOf("globexplorer")==-1){A=A.replace(/http/,"https")}this.altSrc=A;if(this.ownerLayer.isVisible||this.ownerLayer.delayedLoading){this.src=this.ownerLayer.srcOnHidden;this.loader.src=A}};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.visibility="hidden"}}};deCarta.MapLayer.prototype.show=function(){if(this.isVisible){return }var A,C;this.isVisible=true;for(A=0;A<this.xTiles;A++){for(C=0;C<this.yTiles;C++){var B=this.tileArray[A][C];B.loader.src=B.altSrc;B.style.visibility="visible"}}};deCarta.MapLayer.prototype.reset=function(F,D){var A,G;var C,B;var E="px";F=F||0;D=D||0;this.numTilesLoaded=0;this.isVisible=false;this.leftIndex=0;this.topIndex=0;this.updateFromCenterVals();for(A=0;A<this.xTiles;A++){C=this.xOffset+F+(A*this.tileSize);for(G=0;G<this.yTiles;G++){this.tileArray[A][G].src=this.srcOnHidden;this.tileArray[A][G].style.visibility="hidden";B=this.yOffset+D+(G*this.tileSize);this.tileArray[A][G].style.left=C+E;this.tileArray[A][G].style.top=B+E}}};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(I,F){var J,G;var H=this.yTiles;var D=this.xTiles;var L=this.tileSize;var B;var E;var K=0;var A;var C;if(I){if(I>0){this.topIndex-=1;if(this.topIndex<0){this.topIndex=H-1}E=this.topIndex;K-=H*L;A=1}else{E=this.topIndex;this.topIndex+=1;if(this.topIndex>=H){this.topIndex=0}K+=H*L;A=-1}this.updateFromCenterVals();this.refUrl.pan(A,0);for(J=0;J<D;J++){B=this.tileArray[J][E];C=parseInt(B.style.top)+K;B.style.top=(C)+"px";B.setSrc(this.refUrl.getRelSrc(B.fromCenterY,B.fromCenterX))}return }if(F){if(F>0){E=this.leftIndex;this.leftIndex+=1;if(this.leftIndex>=D){this.leftIndex=0}K+=D*L;A=1}else{this.leftIndex-=1;if(this.leftIndex<0){this.leftIndex=D-1}E=this.leftIndex;K-=D*L;A=-1}this.updateFromCenterVals();this.refUrl.pan(0,A);for(G=0;G<H;G++){B=this.tileArray[E][G];C=parseInt(B.style.left)+K;B.style.left=(C)+"px";B.setSrc(this.refUrl.getRelSrc(B.fromCenterY,B.fromCenterX))}}};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 H,F,B;var D=[];var C=0;var I;for(H=0;H<this.xTiles;H++){for(F=0;F<this.yTiles;F++){D[C]=this.tileArray[H][F];C++}}I=D.length;G(D);for(B=0;B<I;B++){D[B].setSrc(E.getRelSrc(D[B].fromCenterY,D[B].fromCenterX))}function G(L){for(var K=1;K<L.length;K++){for(var J=0;J<L.length-1;J++){if((Math.abs(L[J].fromCenterX)+Math.abs(L[J].fromCenterY))>(Math.abs(L[J+1].fromCenterX)+Math.abs(L[J+1].fromCenterY))){A(L,J,J+1)}}}}function A(K,M,J){var L;L=K[M];K[M]=K[J];K[J]=L}};deCarta.MapLayer.prototype.updateFromCenterVals=function(){var I=this.xTiles;var L=this.yTiles;var B=Math.floor(I/2);var F=-B;var A=Math.floor(L/2);var E=-A;var O=this.leftIndex;var C=this.topIndex;var H,G;if(O>B){H=O-B-1}else{H=O+B}if(C>A){G=C-A-1}else{G=C+A}var D=this.tileArray;var N,K;for(N=0;N<I;N++){for(K=0;K<L;K++){var J=D[N][K];var P=N-H;if(P>B){J.fromCenterX=P-I}else{if(P<F){J.fromCenterX=P+I}else{J.fromCenterX=P}}var M=G-K;if(M>A){J.fromCenterY=M-L}else{if(M<E){J.fromCenterY=M+L}else{J.fromCenterY=M}}}}};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){if(document.URL.indexOf("https://")>-1&&A.indexOf("globexplorer")==-1){A=A.replace(/http/,"https")}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.visibility="hidden"}}};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.visibility="visible"}}};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(K,C,R,Q){var S=this;S.show();S.transferSrcFromMapLayer(C);C.hide();var F=R;var E=Q;var G=Math.pow(2,K);var B=K>0?+1:-1;var N=this.framesTotal;var L=this.msPerFrame;var I=Math.floor((G*S.tileSize-S.tileSize)/(N));var D=-1*Math.floor(S.xTiles/2);var O=D;var H=-1*Math.floor(S.yTiles/2);var A=H;var J;var M;if(K>0){J=Math.floor(G*B*F/(2*N));M=Math.floor(G*B*E/(2*N))}else{J=Math.floor(G*B*F/(N));M=Math.floor(G*B*E/(N))}P();function P(){var T,W;var V="px";for(T=0;T<S.xTiles;T++){for(W=0;W<S.yTiles;W++){var U=S.tileArray[T][W];U.style.width=parseInt(U.style.width)+I+V;U.style.height=parseInt(U.style.height)+I+V;U.style.left=parseInt(U.style.left)-I/2+D*I+J+V;U.style.top=parseInt(U.style.top)-I/2+H*I+M+V;H+=1}D+=1;H=A}D=O;N-=1;if(N){setTimeout(P,L)}}};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.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 H=this.baseUrl.indexOf("?");var I=this.baseUrl.substr(0,H+1);if(this.numImageHosts==1){this.imageHosts[0]=I+this.staticProps;return }else{var F=I.split(".");if(F.length>1){var K=F[0];var E=F.slice(1).join(".");K=K.replace(/-[0-9]+$/,"");this.imageHosts[0]=K+"."+E+this.staticProps;for(D=1;D<this.numImageHosts;D++){if(D<10){this.imageHosts[D]=K+"-0"+D+"."+E+this.staticProps;continue}else{this.imageHosts[D]=K+"-"+D+"."+E+this.staticProps}}}else{var J=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("/",J.length);var G=this.baseUrl.substr(C,H+1-C);this.imageHosts[0]=J+A+B+G+this.staticProps;for(D=1;D<this.numImageHosts;D++){if(D<10){this.imageHosts[D]=J+A+"-0"+D+B+G+this.staticProps;continue}else{this.imageHosts[D]=J+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("key=")==0){if(D.length>4){}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}}}}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="PNG";D=null}else{if(D.indexOf("CONFIG=")==0){this.dynamicProps.config=D.split("=")[1];D=null}}}}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 H=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="+H;return G};deCarta.MapLayerReferenceUrl.prototype.setParameter=function(H,G){var C;var F=this.dynamicProps;for(C in F){if(F.hasOwnProperty(C)){if(C==H){F[H]=G;return }}}var E=this.staticProps.split("&");var D=E.length;var B=H+"=";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 I=[];var A;var B=false;var E=G.length;var H=C+"=";for(F=0;F<E;F++){A=G[F];if(A.indexOf(H)==0){A=null;B=true}if(A){I.push(A)}}if(B){this.staticProps=I.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,"ingoreForMapEvents");var C=document.createElement("span");C.innerHTML=" | ";deCarta.IdManager.setTag(C,"ingoreForMapEvents");var A=document.createElement("span");A.innerHTML=" | ";deCarta.IdManager.setTag(A,"ingoreForMapEvents");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,"ingoreForMapEvents");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,"ingoreForMapEvents");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,"ingoreForMapEvents");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(){this.owner.map.setMapType(this.mapType);return false};deCarta.Math.MercatorSpherical=function(){var D=null;var B=null;var G=null;var H=null;function A(J){return(J*Math.PI/180)}function I(J){return(J*180/Math.PI)}function E(K){var N=A(K);var L=Math.sin(N);var M=Math.log((1+L)/(1-L))/2;var J=I(M);return J}function C(K){var N=A(K);var L=Math.exp(2*N);var M=Math.asin((L-1)/(L+1));var J=I(M);return J}function F(){if(!D||(!B&&B!==0)||(!G&&G!==0)){return false}H=G/Math.abs(D.maxPosition.lon-D.minPosition.lon);return true}this.getBoundingBox=function(){return D};this.setBoundingBox=function(J){if(J.minPosition==undefined||J.maxPosition==undefined){throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid boundingBox of: "+J)}else{D=J}};this.getPixelHeight=function(){return B};this.setPixelHeight=function(J){var K=parseInt(J,10);if(isNaN(K)||(K<0)){throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid height of: "+J)}else{B=K}};this.getPixelWidth=function(){return G};this.setPixelWidth=function(K){var J=parseInt(K,10);if(isNaN(J)||(J<0)){throw new Exception("deCarta.Math.MercatorSpherical.setPixelWidth passed invalid width of: "+K)}else{G=J}};this.positionToPixels=function(M){if(!F()||!M||(!M.lat&&M.lat!=0)||(!M.lon&&M.lon!=0)){throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels")}var K=new PixelPoint(0,0);K.x=H*(D.minPosition.lon-M.lon)*-1;var L=E(D.maxPosition.lat)-E(M.lat);var J=E(D.maxPosition.lat)-E(D.minPosition.lat);K.y=B*L/J;return K};this.pixelsToPosition=function(K){if(!F()||!K||(!K.x&&K.x!=0)||(!K.y&&K.y!=0)){throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion")}var M=new Position(0,0);M.lon=D.minPosition.lon+(K.x/H);var J=E(D.maxPosition.lat)-E(D.minPosition.lat);var L=(K.y/B)*J;M.lat=C(E(D.maxPosition.lat)-L);return M}};deCarta.Math.MercatorEllipsoidal=function(){var D=null;var B=null;var G=null;var H=null;function A(J){return(J*Math.PI/180)}function I(J){return(J*180/Math.PI)}function E(M){var L=0.081819190842;var O=A(M);var J=L*Math.sin(O);var N=Math.log(Math.pow(((1-J)/(1+J)),L/2)*Math.tan((Math.PI/4)+(O/2)));var K=I(N);return K}function C(L){var O=A(L);var N=Math.pow(Math.E,-O);var K=P();for(var M=0;M<6;M++){K=Q(K)}var J=I(K);return J;function P(){return Math.PI/2-2*Math.atan(N)}function Q(V){var S=0.0818191908426216;var R=S*Math.sin(V);var U=N*Math.pow((1-R)/(1+R),S/2);var T=(Math.PI/2)-(2*Math.atan(U));return T}}function F(){if(!D||(!B&&B!==0)||(!G&&G!==0)){return false}H=G/Math.abs(D.maxPosition.lon-D.minPosition.lon);return true}this.getBoundingBox=function(){return D};this.setBoundingBox=function(J){if(J.minPosition==undefined||J.maxPosition==undefined){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid boundingBox of: "+J)}else{D=J}};this.getPixelHeight=function(){return B};this.setPixelHeight=function(J){var K=parseInt(J,10);if(isNaN(K)||(K<0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid height of: "+J)}else{B=K}};this.getPixelWidth=function(){return G};this.setPixelWidth=function(K){var J=parseInt(K,10);if(isNaN(J)||(J<0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelWidth passed invalid width of: "+K)}else{G=J}};this.positionToPixels=function(M){if(!F()||!M||(!M.lat&&M.lat!=0)||(!M.lon&&M.lon!=0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels")}var K=new PixelPoint(0,0);K.x=H*(D.minPosition.lon-M.lon)*-1;var L=E(D.maxPosition.lat)-E(M.lat);var J=E(D.maxPosition.lat)-E(D.minPosition.lat);K.y=B*L/J;return K};this.pixelsToPosition=function(K){if(!F()||!K||(!K.x&&K.x!=0)||(!K.y&&K.y!=0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion")}var M=new Position(0,0);M.lon=D.minPosition.lon+(K.x/H);var J=E(D.maxPosition.lat)-E(D.minPosition.lat);var L=(K.y/B)*J;M.lat=C(E(D.maxPosition.lat)-L);return M}};deCarta.Math.greatCircleDist=function(K,J,A){if(!K||!J){throw new Exception("Utilities.greatCircleDist: must have valid coords")}var D=Math.PI*K.lat/180;var G=Math.cos(D);var H=Math.PI*K.lon/180;var C=Math.PI*J.lat/180;var F=Math.cos(C);var E=Math.PI*J.lon/180;var I=Math.abs(Math.abs(H)-Math.abs(E));var M=6372795;var B;var L=2*Math.asin(Math.sqrt(Math.pow(Math.sin(((C-D)/2)),2)+(G*F*Math.pow(Math.sin(I/2),2))));B=M*L;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 M(P,R,Q){if(R.lat<Q.lat){if(P){return false}else{return true}}else{if(!P){return false}else{return true}}}function O(Q,R,P){if(R.lon<P.lon){if(!Q){return false}else{return true}}else{if(Q){return false}else{return true}}}var B;var H;var A=0;var N=0;if(F.lat<G[0].lat){H=true}else{H=false}if(F.lon<G[0].lon){B=false}else{B=true}for(var K in G){var E=O(B,F,G[K]);var J=M(H,F,G[K]);if(E&&J){var C=G[K].lat-G[K-1].lat;var D=G[K].lon-G[K-1].lon;var I=C/D;C=F.lat-G[K-1].lat;D=F.lon-G[K-1].lon;var L=C/D;if((B&&!H)||(!B&&!H)){if(L>I){N++}else{A++}}if((!B&&H)||(B&&H)){if(L<I){N++}else{A++}}B=!B;H=!H}else{if(E){B=!B}if(J){H=!H;if(B){A++}else{N++}}}}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 H=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 H/E};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(!document.all){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.properties=E||{};this.toString=function(){return this.name+" "+this.position+" "+this.address+" "+this.phoneNumber}}function POIQuery(){this.xmlRecFac=new XMLRequestFactory();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(D,F){var E=Utilities.getRequestId();if(typeof F=="function"){B[E]=F}else{throw new Exception("POIQuery.query: callBack must be a function, arg was: "+F)}var C=this.xmlRecFac.createPOIRequestDOM(D,E);JSRequest.send(C,A.queryCallback)};this.queryCallback=function(S){var I=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(S),"text/xml");if(document.all){I.setProperty("SelectionLanguage","XPath");I.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var E=[];var L;var H=I.selectNodes("//xls:Error");if(H.length>0){L=Sarissa.getText(I.selectSingleNode("//xls:Response/@requestID"));if(typeof B[L]=="function"){B[L](null);B[L]=undefined}}else{if(I.selectNodes("//xls:POI").length==0){L=Sarissa.getText(I.selectSingleNode("//xls:Response/@requestID"));B[L](E);B[L]=undefined}else{var O=I.selectNodes("//xls:POIContext");for(var Q=0;Q<O.length;Q++){var N=Sarissa.serialize((O[Q]));var J=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(N),"text/xml");if(document.all){J.setProperty("SelectionLanguage","XPath");J.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var P="xls:";if(navigator.userAgent.toLowerCase().indexOf("safari")!=-1&&navigator.userAgent.toLowerCase().indexOf("3.1")==-1){P=""}try{var T=Sarissa.getText(J.selectSingleNode("//"+P+"POI/@POIName"));var G=Sarissa.getText(J.selectSingleNode("//"+P+"POI/@phoneNumber"))}catch(R){}var F=N.substring(N.indexOf("<gml:pos>")+"<gml:pos>".length,N.indexOf("</gml:pos>"));var C={};var D;if(J.selectSingleNode("//"+P+"freeFormAddress")){D=new FreeFormAddress(Sarissa.getText(J.selectSingleNode("//"+P+"freeFormAddress")))}else{D=new Address();try{D.buildingNumber=Sarissa.getText(J.selectSingleNode("//"+P+"Building/@number"))}catch(R){}try{D.street=Sarissa.getText(J.selectSingleNode("//"+P+"Street"))}catch(R){}try{D.countrySubdivision=Sarissa.getText(J.selectSingleNode("//"+P+"Place[@type='CountrySubdivision']"))}catch(R){}try{D.countrySecondarySubdivision=Sarissa.getText(J.selectSingleNode("//"+P+"Place[@type='CountrySecondarySubdivision']"))}catch(R){}try{D.municipality=Sarissa.getText(J.selectSingleNode("//"+P+"Place[@type='Municipality']"))}catch(R){}try{D.postalCode=Sarissa.getText(J.selectSingleNode("//"+P+"PostalCode"))}catch(R){}}try{var M=J.selectNodes("//"+P+"POIInfo");for(var K=0;K<M.length;K++){C[M[K].getAttribute("name")]=M[K].getAttribute("value")}}catch(R){}E.push(new POI(T,new Position(F),D,G,C))}L=Sarissa.getText(I.selectSingleNode("//xls:Response/@requestID"));B[L](E);B[L]=undefined}}}}function Pin(E,I,S,T){if(!E){throw new Exception("Error instantiating Pin, must at least provide a Position.");return false}var M=this;var J=new Array();var U=170;var Y=null;var W=null;var R=false;var G=false;var K=null;var F=null;var H=null;this.type="pin";this.position=null;if(E&&E.clone){this.position=E.clone()}this.icon=T||new Icon(Credentials.imgPath+"greenDot.png",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=I||"";if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(this.pinImg)}deCarta.IdManager.setTag(this.pinImg,"ingoreForMapEvents");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;Pin.zIndexCounter++;this.pinTxt.style.zIndex=Pin.zIndexCounter;this.pinTxt.style.cursor="pointer";deCarta.IdManager.setTag(this.pinTxt,"ingoreForMapEvents");this.getZIndex=function(){return(this.pinImg.style.zIndex)};this.setZIndex=function(a){var Z=parseInt(a,10);if(!isNaN(Z)){this.pinImg.style.zIndex=Z}else{this.pinImg.style.zIndex=0}};this.setId=function(Z){this.id=Z};this.getId=function(){return this.id};this.setCursorStyle=function(Z){this.pinImg.style.cursor=Z;this.pinTxt.style.cursor=Z};this.getCursorStyle=function(){return this.pinImg.style.cursor};this.setIcon=function(Z){M.pinImg.src=Z.src;if(M.icon.anchorY==Z.anchorY&&M.icon.anchorX==Z.anchorX&&Z._previousY&&Z._previousX){M.pinImg.style.top=(parseInt(M.pinImg.style.top)+Z._previousY-Z.anchorY)+"px";M.pinImg.style.left=(parseInt(M.pinImg.style.left)+Z._previousX-Z.anchorX)+"px"}else{M.pinImg.style.top=(parseInt(M.pinImg.style.top)+M.icon.anchorY-Z.anchorY)+"px";M.pinImg.style.left=(parseInt(M.pinImg.style.left)+M.icon.anchorX-Z.anchorX)+"px"}M.pinImg.style.width=Z.width+"px";M.pinImg.style.height=Z.height+"px";M.icon=Z;if(Z.overlay.text!=""){M.pinTxt.innerHTML=this.icon.overlay.text;M.pinTxt.style.position="absolute";if(Z.overlay.className){M.pinTxt.style.className=Z.overlay.className}if(Z.overlay.color){M.pinTxt.style.color=Z.overlay.color}if(Z.overlay.size){M.pinTxt.style.fontSize=Z.overlay.size}if(Z.overlay.fontFamily){M.pinTxt.style.fontFamily=Z.overlay.fontFamily}M.pinTxt.style.left=(parseInt(M.pinImg.style.left)+parseInt(M.icon.overlay.anchorX))+"px";M.pinTxt.style.top=(parseInt(M.pinImg.style.top)+parseInt(M.icon.overlay.anchorY))+"px"}else{M.pinTxt.innerHTML=""}if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){var a=this.pinImg.src;this.pinImg.src=Credentials.transparentGIF;this.pinImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a+"',sizingMethod='scale')"}};this.getIcon=function(){return M.icon};this.setX=function(Z){M.pinImg.style.left=(Z-M.icon.anchorX)+"px";if(M.pinTxt){M.pinTxt.style.left=(Z-M.icon.anchorX+M.icon.overlay.anchorX)+"px"}};this.setY=function(Z){M.pinImg.style.top=(Z-M.icon.anchorY)+"px";if(M.pinTxt){M.pinTxt.style.top=(Z-M.icon.anchorY+M.icon.overlay.anchorY)+"px"}};this.getPosition=function(){return M.position};this.setPosition=function(a){if(M.map!=null){var Z=M.map.positionToMapLayerPixel(a);M.setX(Z.x);M.setY(Z.y)}M.position=a};this.setMessage=function(Z){M.pinImg.msg=Z;if(M.map&&M.pinImg&&M.map.getBubble()&&(M==M.map.getBubble().associatedPin)){M.map.getBubble().setContent(Z)}};this.getMessage=function(){return M.pinImg.msg};this.hide=function(){M.isVisible=false;M.pinImg.style.display="none";M.pinTxt.style.display="none"};this.show=function(){M.isVisible=true;M.pinImg.style.display="block";M.pinTxt.style.display="block"};this.zoomHide=function(){if(!M.isVisible){return }M.pinImg.style.display="none";M.pinTxt.style.display="none"};this.zoomShow=function(){if(!M.isVisible){return }M.pinImg.style.display="block";M.pinTxt.style.display="block"};this.showInfoWindow=function(){M.map.getBubble().setPosition(parseInt(M.pinImg.style.left),parseInt(M.pinImg.style.top));M.map.getBubble().setContent(M.pinImg.msg);M.map.getBubble().show(M)};this.hideInfoWindow=function(){M.map.getBubble().hide()};this.addEventListener=function(a,b){var c=false;for(var Z=0;Z<J.length;Z++){if(J[Z]==a){J[a]=b;c=true;break}}if(!c){J.push(a);J[a]=b;if(a=="click"||a=="dblclick"||a=="rightclick"){deCarta.Events.addEvent(M.pinImg,"mousedown",O);deCarta.Events.addEvent(M.pinImg,"mouseup",P);deCarta.Events.addEvent(M.pinTxt,"mousedown",O);deCarta.Events.addEvent(M.pinTxt,"mouseup",P)}else{if(a=="mouseover"){deCarta.Events.addEvent(M.pinImg,"mouseover",X)}else{if(a=="mouseout"){deCarta.Events.addEvent(M.pinImg,"mouseout",V)}}}}};this.clearInstanceListeners=function(){for(var Z=0;Z<J.length;Z++){J[J[Z]]=null;J[Z]=null}};this.clearListeners=function(a){for(var Z=0;Z<J.length;Z++){if(J[Z]==a){J[J[Z]]=null}}J[Z]=null};function O(Z){if(Z.button==2||Z.which==3){R=true;return false}if(J.mousedown){J.mousedown(M)}return false}function P(Z){if(R){Q();return false}if(J.mouseup){J.mouseup(M)}if(!Y){W=setTimeout(N,U);Y=new Date()}else{clearTimeout(W);L()}return false}function N(){C();if(J.click){J.click(M)}}function L(){C();if(J.dblclick){J.dblclick(M)}}function Q(){C();if(J.rightclick){J.rightclick(M)}}this.pickup=function(){if(G){return }deCarta.Events.addEvent(window.document,"mousemove",A)};this.drop=function(){if(!G){return }B()};function A(c){var b=c.clientX;var a=c.clientY;if(!G){G=true;K=new PixelPoint(b,a);var f=parseInt(M.pinImg.style.left,10);var d=parseInt(M.pinImg.style.top,10);F=new PixelPoint(f,d);var Z=parseInt(M.pinTxt.style.left,10);var i=parseInt(M.pinTxt.style.top,10);H=new PixelPoint(Z,i);return false}var h=b-K.x;var g=a-K.y;M.pinImg.style.left=F.x+h+"px";M.pinImg.style.top=F.y+g+"px";M.pinTxt.style.left=H.x+h+"px";M.pinTxt.style.top=H.y+g+"px";return false}function B(c){deCarta.Events.removeEvent(window.document,"mousemove",A);var i=parseInt(M.pinImg.style.left,10)-F.x;var h=-(parseInt(M.pinImg.style.top,10)-F.y);var j=M.map.getZoomController().getGXConvertedZoomLevel();var b=Utilities.radsPerPixelAtZoom(M.map.getTileSize(),j);var g=Utilities.lon2pix(M.position.lon,b);var f=Utilities.lat2pix(M.position.lat,b);var Z=Utilities.pix2lon((g+i),b);var d=Utilities.pix2lat((f+h),b);var a=new Position(d,Z);M.setPosition(a);G=false;K=null;F=null;H=null;return false}function X(){if(J.mouseover){J.mouseover(M)}}function V(){if(J.mouseout){J.mouseout(M)}}function C(){Y=null;W=null;R=false}if(S&&(S=="onmouseover"||S=="mouseover")){M.addEventListener("mouseover",M.showInfoWindow);M.addEventListener("mouseout",M.hideInfoWindow)}else{if(S&&(S=="onclick"||S=="click")){M.addEventListener("click",M.showInfoWindow)}}this.destroy=function(){if(M&&M.map){if(M.pinImg){M.pinImg=M.map.getTileDiv().removeChild(M.pinImg);if(M.pinImg){Utilities.purge(M.pinImg)}M.pinImg=null}if(M.pinTxt){M.pinTxt=M.map.getTileDiv().removeChild(M.pinTxt);if(M.pinTxt){Utilities.purge(M.pinTxt)}M.pinTxt=null}}M=null};this.toString=function(){return M.position.toString()};this.equals=function(Z){if(Z&&Z.toString()==this.toString()&&Z.pinImg==this.pinImg){return true}else{return false}};this.getViewableBoundingBox=function(d){var i=Utilities.lat2pix(M.position.lat,d);var a=Utilities.lon2pix(M.position.lon,d);var h=i+M.icon.anchorY;var n=a+parseInt(M.pinImg.style.width)-M.icon.anchorX;var m=i-parseInt(M.pinImg.style.height)+M.icon.anchorY;var f=a-M.icon.anchorX;var j=Utilities.pix2lat(h,d);var Z=Utilities.pix2lon(n,d);var k=Utilities.pix2lat(m,d);var b=Utilities.pix2lon(f,d);var g=new Position(j,Z);var c=new Position(k,b);var l=new BoundingBox(c,g);return l}}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(D,A){this.lat=0;this.lon=0;if(arguments.length==1){var C=D.split(" ");if(C.length!=2){throw new Exception("error initializing Position object")}try{this.lat=parseFloat(C[0]);this.lon=parseFloat(C[1]);if(isNaN(this.lat)||isNaN(this.lon)){throw new Exception()}}catch(B){throw new Exception("error initializing Position object")}}else{if(arguments.length==2){try{this.lat=parseFloat(D);this.lon=parseFloat(A);if(isNaN(this.lat)||isNaN(this.lon)){throw new Exception()}}catch(B){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}}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.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.avoidList=[];this.generalizationFactor=0;this.generalizationBBox=null;this.logisticsPreference=null}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.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 XMLRequestFactory();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,E,G){var F=Utilities.getRequestId();if(typeof G=="function"){B[F]=G}else{throw new Exception("RouteQuery.query: callBack must be a function, arg was: "+G)}var D=this.xmlRecFac.createRouteGeometryRequestDOM(C,F,E,true);JSRequest.send(D,A.queryCallback)};this.queryById=function(F,E){var D=Utilities.getRequestId();if(typeof E=="function"){B[D]=E}else{throw new Exception("RouteQuery.queryById: callBack must be a function, arg was: "+E)}var C=this.xmlRecFac.createRouteGeometryByIdRequestDOM(F,D,null,true);JSRequest.send(C,A.queryCallback)};this.queryCallback=function(F){var E=null;var D=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(F),"text/xml");if(document.all){D.setProperty("SelectionLanguage","XPath");D.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var G=D.selectNodes("//xls:Error");if(G.length>0){E=Sarissa.getText(D.selectSingleNode("//xls:Response/@requestID"));if(typeof B[E]=="function"){B[E](null);B[E]=undefined}}else{var C=Utilities.parseRoutes(D);E=Sarissa.getText(D.selectSingleNode("//xls:Response/@requestID"));if(E&&E>0){B[E](C);B[E]=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(K){return }var Q=this.map.getZoomController().getGXConvertedZoomLevel();var E=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),Q);var D=this.map.getCenterPosition();var A=Math.cos(((D.lat)*(Math.PI/180)));var B=Utilities.lon2pix(D.lon,E);var P=Utilities.pix2lon(B+1,E);var O=Utilities.pix2lon(B,E);var C=P-O;var J=parseFloat(A*111325);var F=(C*J);var M=F*3.28;var L=this.frameWidth-15;this.scaleMetric.style.width=N(F,L)+"px";this.scaleImperial.style.width=I(M,L)+"px";this.measureMetric.innerHTML=H(F,L);this.measureImperial.innerHTML=G(M,L);function I(W,R){var T=[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 X=W*R;var U;var S=T.length;for(U=0;U<S;U++){if(X<=T[U]){break}}U=(U-1>0)?U-1:0;var V=T[U]/W;return V}function G(V,R){var T=[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 X=["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 W=V*R;var U;var S=T.length;for(U=0;U<S;U++){if(W<=T[U]){break}}U=(U-1>0)?U-1:0;return X[U]}function N(S,R){var U=[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 X=S*R;var V;var T=U.length;for(V=0;V<T;V++){if(X<=U[V]){break}}V=(V-1>0)?V-1:0;var W=U[V]/S;return W}function H(S,R){var U=[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 X=["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 W=S*R;var V;var T=U.length;for(V=0;V<T;V++){if(W<=U[V]){break}}V=(V-1>0)?V-1:0;return X[V]}};ScaleBar.prototype.getDiv=function(){return this.frame};function SearchCriteria(E,B,A,D,C){if(D>100){throw new Exception("maximumResponses cannot exceed 100");return }this.queryString=E;this.position=B.clone();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.properties={}}function ServerMonitor(){this.xmlRecFac=new XMLRequestFactory();var A=null;this.query=function(){var B=Utilities.getRequestId();A=this.xmlRecFac.createRUOKRequestDOM(B);this.sendServerMonitorQueryRequest()};this.sendServerMonitorQueryRequest=function(){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(C){}}var B=new XMLHttpRequest();B.open("POST",Credentials.url,true);B.onreadystatechange=function(){if(B.readyState==4){try{if(B.status!=200){throw new Exception(ServerMonitor.WS_ERR)}}catch(E){throw new Exception(ServerMonitor.WS_ERR)}var D=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(B.responseText),"text/xml");if(document.all){D.setProperty("SelectionLanguage","XPath");D.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}if(D.selectNodes("//xls:Error").length>0){if(((D.selectNodes("//@message"))[0].value).indexOf("internal problem connecting to DDS")>-1){throw new Exception(ServerMonitor.DDS_ERR)}else{if(((D.selectNodes("//@message"))[0].value).indexOf("'rel' attribute")>-1){throw new Exception(ServerMonitor.VER_ERR)}else{throw new Exception((D.selectNodes("//@message"))[0].value)}}return false}}};B.send(A)}}ServerMonitor.WS_ERR="ERROR\n\nThere was an error connecting to the server.  Please verify that the server is running before you continue.";ServerMonitor.DDS_ERR="ERROR\n\ndeCarta Web Services is running, but it is unable to connect to the Drill Down Server.\n\nPlease check Drill Down Server or contact the administrator.";ServerMonitor.VER_ERR="ERROR\n\nThere is a version incompatibility between this version of the deCarta JavaScript API and deCarta DDS Web Services.";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.StyleManager={};deCarta.StyleManager.stylesCreated=false;deCarta.StyleManager.cssString=".decarta-log{position:absolute; top:4em; left:50em; width:60em; height:30em; font-family:monospace; font-size: 0.9em; border: 1px inset #cccccc; background-color:#eeeeee;}.decarta-logControlPanel{width:100%;}.deCarta-logButton{float:left; width:2em; height:1.3em; border: 1px solid #cccccc; background-color:#FdFdFd; text-align:center}.deCarta-logFilter{float:left; width:9em; height:1.3em; padding:0; margin:0; border:1px solid #cccccc; font-family:monospace; background-color:#FdFdFd;}.decarta-logConsole{width:100%; height:100%; overflow:scroll;}.decarta-logentryTable{width:100%;}.decarta-logentryOdd{width:100%; padding:0; margin:0; background-color:#eeeeee;}.decarta-logentryEven{width:100%; padding:0; margin:0; background-color:#e4e4e4;}.decarta-logentryNumber{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryTime{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryFlags{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryCaller{width:10%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.decarta-logentryMessage{width:60%; padding:2px 2px 2px 2px; margin:0; margin-right:1em;}.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; top: 1px; left: 1px; opacity: 50; filter: alpha(opacity=80); opacity: 0.8; position: absolute; z-index: 9999;}.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; visibility:hidden;}.decarta-json-type{color:#b84ab8}.decarta-json-relation{color:#bbb}.decarta-json-string{color:#ce7b00}.decarta-json-number{color:#0000e6}";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,B){this.position=A;this.description=B;this.toString=function(){return this.position+"  "+this.description}}function TrafficIncidentQuery(){this.xmlRecFac=new XMLRequestFactory();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(D,F){var E=Utilities.getRequestId();if(typeof F=="function"){B[E]=F}else{throw new Exception("TrafficIncidentQuery.query: callBack must be a function, arg was: "+F)}C=this.xmlRecFac.createTrafficIncidentRequestDOM(D,E);JSRequest.send(C,A.queryCallback)};this.queryCallback=function(F){var I=null;var L=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(F),"text/xml");if(document.all){L.setProperty("SelectionLanguage","XPath");L.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var D=[];var N=L.selectNodes("//xls:Error");if(N.length>0){I=Sarissa.getText(L.selectSingleNode("//xls:Response/@requestID"));if(typeof B[I]=="function"){B[I](null);B[I]=undefined}}else{if(L.selectNodes("//xls:Incident").length==0){I=Sarissa.getText(L.selectSingleNode("//xls:Response/@requestID"));B[I](D);B[I]=undefined}else{var E=L.selectNodes("//xls:Incident");for(var G=0;G<E.length;G++){var J=Sarissa.serialize((E[G]));var M=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(J),"text/xml");if(document.all){M.setProperty("SelectionLanguage","XPath");M.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var O=Sarissa.getText(M.selectSingleNode("//@severity"));var H=Sarissa.getText(M.selectSingleNode("//xls:Description"));var K=Sarissa.getText(M.selectSingleNode("//xls:Position"));D.push(new TrafficIncident(new Position(K),H))}I=Sarissa.getText(L.selectSingleNode("//xls:Response/@requestID"));B[I](D);B[I]=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.parseKML=function(I){var B=new RegExp("&","g");I=I.replace(B," ");B=new RegExp("<kml xmlns=");I=I.replace(B,"<kml xmlns:goog=");var C=[];var K=(new DOMParser()).parseFromString(I,"text/xml");K.setProperty("SelectionLanguage","XPath");K.setProperty("SelectionNamespaces","xmlns:goog='http://earth.google.com/kml/2.2' xmlns:atom='http://www.w3.org/2005/Atom'");var E=K.selectNodes("//Placemark");for(var D=0;D<E.length;D++){var A;var G;var J;for(var N=0;N<E[D].childNodes.length;N++){try{if(E[D].childNodes[N].nodeName=="name"){A=Sarissa.getText(E[D].childNodes[N])||""}if(E[D].childNodes[N].nodeName=="description"){G=Sarissa.getText(E[D].childNodes[N])||""}if(E[D].childNodes[N].nodeName=="Point"){var M=Utilities.parseKMLCoords(E[D].childNodes[N].childNodes);J=new KMLGeometry("Point",M[0])}if(E[D].childNodes[N].nodeName=="Polygon"){var L=Utilities.parseKMLCoords(E[D].childNodes[N].childNodes);J=new KMLGeometry("Polygon",L)}if(E[D].childNodes[N].nodeName=="LineString"){var O=Utilities.parseKMLCoords(E[D].childNodes[N].childNodes);J=new KMLGeometry("LineString",O)}if(E[D].childNodes[N].nodeName=="MultiGeometry"){var F=Utilities.parseKMLMultiGeometry(E[D].childNodes[N].childNodes);J=new KMLGeometry("MultiGeometry",F)}}catch(H){continue}}if(J){C.push(new KML(J,A,G));J=undefined;A="";G=""}else{}}return C};Utilities.parseKMLMultiGeometry=function(E){var A=[];for(var B=0;B<E.length;B++){var C=E[B].nodeName;var D=Utilities.parseKMLCoords(E[B].childNodes);A.push(new KMLGeometry(C,D))}return A};Utilities.parseKMLCoords=function(D){var B=[];var A;C(D);function C(K){for(var G=0;G<K.length;G++){if(K[G].nodeName=="coordinates"){var F=Sarissa.getText(K[G]);var F=F.replace(Utilities.regx2,",");var H=F.split(",");var E=0;var I,J;for(var G=0;G<H.length;G++){if(E==0){J=H[G];E++;continue}else{if(E==1){I=H[G];B.push(new Position(I,J));E++;continue}else{if(E==2){E=0;continue}}}}A=B;break}else{if(K[G].childNodes.length){C(K[G].childNodes)}}}}return A};Utilities.getElementByTagName=function(H,G,A){var C=G+":"+A;var F;if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){F=H.getElementsByTagNameNS("*",A)[0];if(!F){var B=H.getElementsByTagName("*");var E=B.length;for(var D=0;D<E;D++){if(B[D].nodeName==C){F=B[D];break}}}}else{F=H.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.ie6=(document.all&&!window.opera&&(typeof document.documentElement.style.maxHeight=="undefined"))?true:false;Utilities.ie7=(document.all&&!window.opera&&(typeof document.documentElement.style.maxHeight!="undefined"))?true:false;Utilities.fixPng=function(A){var B=A.src;A.src=Credentials.transparentGIF;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+"')"}};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.htmlizeXMLDom=function(C){var B=new RegExp("\\>","g");var A=new RegExp("\\<","g");var D=(Sarissa.serialize(C));D=D.replace(B,"&gt;");D=D.replace(A,"&lt;");return"<PRE>"+D+"</PRE>"};Utilities.p=function(A){deCarta.log.add(A)};Utilities.c=function(){deCarta.log.clear()};Utilities.generalize=function(J,P,H,O){H=Math.round(H/2);var C=P.getZoomLevel?P.getZoomLevel():P;var D=Utilities.radsPerPixelAtZoomLevel(O,C);var I=J.length;var B=[];var N,G,L,K,A,M,F;for(var E=0;E<I;E++){if(E==0||!N.contains(J[E])){G=Utilities.lat2pix(J[E].lat,D)+H;L=Utilities.lon2pix(J[E].lon,D)+H;K=Utilities.lat2pix(J[E].lat,D)-H;A=Utilities.lon2pix(J[E].lon,D)-H;M=Utilities.pix2lat(G,D)+" "+Utilities.pix2lon(L,D);F=Utilities.pix2lat(K,D)+" "+Utilities.pix2lon(A,D);N=new BoundingBox(new Position(F),new Position(M));B.push(J[E]);continue}}return B};Utilities.grouper=function(S,B,G,H){if(!S||!B||G<=0){throw new Exception("Utilities.grouper: Invalid input posArray: "+S+" zoom: "+B+" radius: "+G)}var I=B.getGXConvertedZoomLevel();var Q=Utilities.radsPerPixelAtZoom(H,I);var J=S.length;var C,T,L,A,O,P,R;var K=[];var E=[];var D=0;var N,M;var F=[];for(N=0;N<J;N++){for(M=0;M<D;M++){if(K[M].contains(S[N])){F[M].push(S[N]);break}}if(M!=D){continue}else{T=Utilities.lat2pix(S[N].lat,Q)+G;L=Utilities.lon2pix(S[N].lon,Q)+G;A=Utilities.lat2pix(S[N].lat,Q)-G;O=Utilities.lon2pix(S[N].lon,Q)-G;P=Utilities.pix2lat(T,Q)+" "+Utilities.pix2lon(L,Q);R=Utilities.pix2lat(A,Q)+" "+Utilities.pix2lon(O,Q);C=new BoundingBox(new Position(R),new Position(P));K[D]=C;E[D]=S[N];F[D]=[];D++;continue}}for(N=0;N<D;N++){F[N].push(E[N])}return F};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(D){var B=D.attributes,C,A,E;if(B){A=B.length;for(C=0;C<A;C+=1){E=B[C].name;if(typeof D[E]==="function"){D[E]=null}}}B=D.childNodes;if(B){A=B.length;for(C=0;C<A;C+=1){Utilities.purge(D.childNodes[C])}}};Utilities.what=function(C){var B="";for(var A in C){B+="  "+A}alert(B)};Utilities.normalizePrefixes=function(I){var E=new RegExp("ns1:","g");var H=I.replace(E,"xls:");var D=new RegExp("ns\\d+:","g");var G=H.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(H,B){var G=B/111.111;var A=(H.lon-parseFloat(G));var F=(H.lon+parseFloat(G));var E=G*Math.cos(((H.lat*Math.PI)/180));var D=(H.lat-parseFloat(E));var C=(H.lat+parseFloat(E));return new BoundingBox(new Position(D,A),new Position(C,F))};Utilities.centerContextToBoundingBoxViewable=function(H,B,A){var D=B/111.111;var C=A/111.111;var I=(H.lon-parseFloat(D));var J=(H.lon+parseFloat(D));var G=C*Math.cos(((H.lat*Math.PI)/180));var E=(H.lat-parseFloat(G));var F=(H.lat+parseFloat(G));return new BoundingBox(new Position(E,I),new Position(F,J))};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(L,K,H,E,A,B,N,I){try{L=H-L;K=E-K;var M=N.getLat();var G=N.getLon();var F=(I*2)/111.111;var C=F/(A*B);var D=(F/Math.cos(((M*Math.PI)/180)))/(A*B);if(K!=0){M=""+(parseFloat(M)+parseFloat(K*C))}if(L!=0){G=""+(parseFloat(G)-parseFloat(L*D))}return new Position(M,G)}catch(J){throw new Exception(J.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(H,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(H,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 H=Math.round(Utilities.lon2pix(F,A));var G=Math.round(Utilities.lon2pix(D,A));return Math.abs(H-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.pix2lon=function(A,B){return(A*B)*180/Math.PI};Utilities.pix2lat=function(H,F){var G=1e-7;var E=12;var B=Math.pow(Math.E,-H*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.parseRoute=function(M,R){var W=new Route();var L="";try{L=M.selectSingleNode("//xls:"+R+"xls:RouteHandle/@routeID").value}catch(V){}W.routeID=L||"";var A=Utilities.podParse(Sarissa.getText(M.selectSingleNode("//xls:TotalTime")));W.TotalTime=A;var J=M.selectSingleNode("//xls:TotalDistance/@value").value;W.TotalDistance=J;var G=M.selectSingleNode("//xls:TotalDistance/@uom").value;W.uom=new UOM(G);var F=(M.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data;var S=(M.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data;var B=new BoundingBox(new Position(F),new Position(S));W.boundingBox=B;W.centerPosition=B.getCenterPosition();var N=null;try{N=M.selectSingleNode("//xls:"+R+"/@viaPointSequence").value}catch(V){}W.viaPointSequence=N;var C=M.selectNodes("//xls:"+R+"/xls:RouteInstructionsList/xls:RouteInstruction/xls:Instruction");var U=M.selectNodes("//xls:"+R+"/xls:RouteInstructionsList/xls:RouteInstruction/xls:Point");var P=M.selectNodes("//xls:"+R+"/xls:RouteInstructionsList/xls:RouteInstruction/xls:distance/@value");var I=M.selectNodes("//xls:"+R+"/xls:RouteInstructionsList/xls:RouteInstruction/@duration");var D=null;try{D=M.selectNodes("//xls:RouteInstruction/@tour")}catch(V){}var K=new RegExp("'","g");for(var T=0;T<C.length;T++){var H=(Sarissa.getText((C[T]))).replace(K,"");var E=Sarissa.getText((U[T]));var O=new RouteInstruction();O.Instruction=H;O.distance=P[T].value;O.duration=Utilities.podParse(I[T].value);O.position=E;if(D&&D.length>0){O.tour=D[T].value}W.RouteInstructions.push(O)}M.setProperty("SelectionLanguage","XPath");M.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var X=M.selectSingleNode("//gml:LineString");if(X){var Q=X.childNodes;for(var T=0;T<Q.length;T++){W.RouteGeometry.push(new Position(Sarissa.getText(Q[T])))}}return W};Utilities.parseRoutes=function(F){var C=new RegExp(' xmlns:gml="http://www.opengis.net/gml"',"g");var B=new RegExp(' xmlns:xls="http://www.opengis.net/xls"',"g");var A=' xmlns:xls="http://www.opengis.net/xls" xmlns:gml="http://www.opengis.net/gml"';var G;if(document.all){F.setProperty("SelectionLanguage","XPath");F.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var J=F.selectSingleNode("//xls:DetermineRouteResponse");var E=Sarissa.serialize((J));E=E.replace(C,"");E=E.replace(B,A);var I=(new DOMParser()).parseFromString((E),"text/xml");if(document.all){I.setProperty("SelectionLanguage","XPath");I.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}G=(Utilities.parseRoute(I,"DetermineRouteResponse"));var H=F.selectNodes("//xls:AlternateRoute");for(var D=0;D<H.length;D++){var E=Sarissa.serialize(H[D]);E=E.replace(C,"");E=E.replace(B,A);var I=(new DOMParser()).parseFromString((E),"text/xml");if(document.all){I.setProperty("SelectionLanguage","XPath");I.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}G.alternates.push(Utilities.parseRoute(I,"AlternateRoute"))}return G};Utilities.setUnselectable=function(A){if(A){if(typeof A.onselectstart!="undefined"){A.onselectstart=function(){return false}}else{if(typeof A.style.MozUserSelect!="undefined"){A.style.MozUserSelect="none"}else{}}}};Utilities.vrToPositions=function(D){if(!D){throw new Exception("vrToPositions: illegal argument: "+D)}var G=D.replace(/%[Vv][Rr]=/,"").split(",");var I=G[0]-1;var A=F(G[1]);var E=F(G[2]);var B=G.slice(3);var J=[];J.push(new Position(A,E));var C;for(C=0;C<I;C++){A+=F(B[0]);E+=F(B[1]);B=B.slice(2);var H=new Position(A,E);J.push(H)}return J;function F(P){var M;var K="";if(P.toString().charAt(0)=="-"){K="-";P=P.slice(1)}P=P.toString();var O=P.length;var N;if(O<=5&&O>0){N=["0","0","0","0","0"];var L=5;for(M=1;M<=O;M++){N[L-M]=P.charAt(O-M)}return(parseFloat(parseFloat(K+"0."+N.join("")).toFixed(5)))}else{if(O>5){N=[];for(M=0;M<O;M++){N.push(P.charAt(M));if(O-M-1==5){N.push(".")}}return(parseFloat(parseFloat(K+N.join("")).toFixed(5)))}else{throw new Exception("vrToPositions failed in vrOffsetToFloat with "+P)}}}};Utilities.vr7ToPositions=function(D){if(!D){throw new Exception("vr7ToPositions: illegal argument: "+D)}var F=D.replace(/%[Vv][Rr]7=/,"").split(",");var I=F[0]-1;var A=G(F[1]);var E=G(F[2]);var B=F.slice(3);var J=[];J.push(new Position(A,E));var C;for(C=0;C<I;C++){A+=G(B[0]);E+=G(B[1]);B=B.slice(2);var H=new Position(A,E);J.push(H)}return J;function G(P){var M;var K="";if(P.toString().charAt(0)=="-"){K="-";P=P.slice(1)}P=P.toString();var O=P.length;var N;if(O<=7&&O>0){N=["0","0","0","0","0","0","0"];var L=7;for(M=1;M<=O;M++){N[L-M]=P.charAt(O-M)}return parseFloat(parseFloat(K+"0."+N.join("")).toFixed(7))}else{if(O>7){N=[];for(M=0;M<O;M++){N.push(P.charAt(M));if(O-M-1==7){N.push(".")}}return parseFloat(parseFloat(K+N.join("")).toFixed(7))}else{throw new Exception("vrToPositions failed in vrOffsetToFloat with "+P)}}}};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(I(E[0].lat));F.push(I(E[0].lon));var H=E[0].lat;var A=E[0].lon;for(D=1;D<C;D++){var B=E[D].lat-H;F.push(I(B));H+=B;var G=E[D].lon-A;F.push(I(G));A+=G}return F.join(",");function I(K){var J=parseFloat(parseFloat(K).toFixed(5).toString().replace(/\./,""));return J}};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 I=F[0].lat;var A=F[0].lon;for(E=1;E<D;E++){var C=F[E].lat-I;G.push(B(C));I+=C;var H=F[E].lon-A;G.push(B(H));A+=H}return G.join(",");function B(K){var J=parseFloat(parseFloat(K).toFixed(7).toString().replace(/\./,""));return J}};function WSXMLTunnel(){var A=[];this.send=function(B,E){var C=Sarissa.getDomDocument();C=(new DOMParser()).parseFromString(Sarissa.serialize(B),"text/xml");C.setProperty("SelectionLanguage","XPath");C.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var D=(C.selectSingleNode("//xls:Request/@requestID").value);if(typeof E=="function"){A[D]=E}else{throw new Exception("WSXMLTunnel.send: callBack must be a function, arg was: "+E)}JSRequest.send(C,this._callBack)};this._callBack=function(C){var D=Sarissa.getDomDocument();D=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(C),"text/xml");D.setProperty("SelectionLanguage","XPath");D.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var B=(D.selectSingleNode("//xls:Response/@requestID").value);A[B](D)}}function XMLRequestFactory(){this.overlays=[];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="GIF";this.hybridImgFormat="PNG"}XMLRequestFactory.prototype.getHeader=function(H,C,B,G){B=B||"10";G=G||Utilities.getRequestId();C=C||Utilities.getRequestId();try{var F=Sarissa.getDomDocument();var D=F.createElement("xls:XLS");D.setAttribute("xls:lang","en");D.setAttribute("version","1");if(Credentials.rel&&Credentials.rel!=null){D.setAttribute("rel",Credentials.rel)}D.setAttribute("xmlns:xls","http://www.opengis.net/xls");D.setAttribute("xmlns:gml","http://www.opengis.net/gml");F.appendChild(D);var I=F.createElement("xls:RequestHeader");I.setAttribute("clientName",this.clientName);I.setAttribute("clientPassword",this.clientPassword);if(this.mapType=="STREET"){I.setAttribute("configuration",this.configuration)}else{I.setAttribute("configuration",this.transparentConfiguration)}I.setAttribute("sessionID",G);D.appendChild(I);var A=F.createElement("xls:Request");A.setAttribute("maximumResponses",B);A.setAttribute("version","1.0");A.setAttribute("requestID",C);A.setAttribute("methodName",H);D.appendChild(A);return F}catch(E){throw new Exception("XMLRequestFactory.this.getHeader: "+E.message)}};XMLRequestFactory.prototype.createMapAddressRequestDOM=function(K,J,P,N,R){try{var D=this.getHeader("PortrayMapRequest",P);var V=D.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(D,"xls","Request").appendChild(V);var H=D.createElement("xls:Output");H.setAttribute("width",J);H.setAttribute("height",J);H.setAttribute("fixedgrid","true");H.setAttribute("useCache","true");if(this.mapType=="STREET"){H.setAttribute("format",this.streetImgFormat)}else{H.setAttribute("format",this.hybridImgFormat)}H.setAttribute("content","URL");V.appendChild(H);var E=D.createElement("xls:CenterAddress");var T=D.createElement("xls:TileGrid");T.setAttribute("rows","1");T.setAttribute("columns","1");var L=D.createElement("xls:GridLayer");L.setAttribute("name","globexplorer");L.setAttribute("meta-inf","zoom="+N);var W=D.createElement("xls:GridLayer");W.setAttribute("name","deCarta");W.setAttribute("returnMaxImageHostAliases","true");T.appendChild(W);T.appendChild(L);var B=D.createElement("xls:Pan");B.setAttribute("direction","N");B.setAttribute("numTiles","0");var A=D.createElement("xls:Pan");A.setAttribute("direction","S");A.setAttribute("numTiles","0");var F=D.createElement("xls:Pan");F.setAttribute("direction","E");F.setAttribute("numTiles","0");var U=D.createElement("xls:Pan");U.setAttribute("direction","W");U.setAttribute("numTiles","0");T.appendChild(B);T.appendChild(A);T.appendChild(F);T.appendChild(U);H.appendChild(E);H.appendChild(T);var Q=D.createElement("xls:Address");Q.setAttribute("countryCode",K.getLocale().getCountry());Q.setAttribute("language",K.getLocale().getLanguage());E.appendChild(Q);var C=D.createElement("xls:freeFormAddress");var I=D.createTextNode(K.toString());C.appendChild(I);Q.appendChild(C);if(Credentials.trafficEnabled){var O=D.createElement("xls:Overlay");var M=D.createElement("xls:Traffic");var G=D.createElement("xls:FlowReporting");if(R){G.setAttribute("time",R)}M.appendChild(G);O.appendChild(M);V.appendChild(O)}if(document.all){D.setProperty("SelectionLanguage","XPath");D.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}return D}catch(S){throw new Exception("XMLRequestFactory.prototype.createMapAddressRequestDOM: "+S.message)}};XMLRequestFactory.prototype.createMapRequestDOM=function(H,L,R,P,T){try{var E=this.getHeader("PortrayMapRequest",R);E=(new DOMParser()).parseFromString(Sarissa.serialize(E),"text/xml");E.setProperty("SelectionLanguage","XPath");E.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var X=E.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(E,"xls","Request").appendChild(X);var K=E.createElement("xls:Output");K.setAttribute("width",L);K.setAttribute("height",L);K.setAttribute("fixedgrid","true");K.setAttribute("useCache","true");if(this.mapType=="STREET"){K.setAttribute("format",this.streetImgFormat)}else{K.setAttribute("format",this.hybridImgFormat)}K.setAttribute("content","URL");X.appendChild(K);this.addOverlaysToXML(X,E);var F=E.createElement("xls:CenterContext");F.setAttribute("SRS","WGS-84");var V=E.createElement("xls:TileGrid");V.setAttribute("rows","1");V.setAttribute("columns","1");var N=E.createElement("xls:GridLayer");N.setAttribute("name","globexplorer");N.setAttribute("meta-inf","zoom="+P);var Y=E.createElement("xls:GridLayer");Y.setAttribute("name","deCarta");Y.setAttribute("returnMaxImageHostAliases","true");V.appendChild(Y);V.appendChild(N);var B=E.createElement("xls:Pan");B.setAttribute("direction","N");B.setAttribute("numTiles","0");var A=E.createElement("xls:Pan");A.setAttribute("direction","S");A.setAttribute("numTiles","0");var I=E.createElement("xls:Pan");I.setAttribute("direction","E");I.setAttribute("numTiles","0");var W=E.createElement("xls:Pan");W.setAttribute("direction","W");W.setAttribute("numTiles","0");V.appendChild(B);V.appendChild(A);V.appendChild(I);V.appendChild(W);K.appendChild(F);K.appendChild(V);var D=E.createElement("xls:Radius");D.setAttribute("unit","KM");var M=E.createTextNode("0");M=E.createTextNode("200");D.appendChild(M);var S=E.createElement("xls:CenterPoint");var G=E.createElement("gml:pos");var C;if(H&&H.getLatLon){C=E.createTextNode(H.getLatLon())}else{C=E.createTextNode("0 0")}G.appendChild(C);S.appendChild(G);F.appendChild(S);F.appendChild(D);if(Credentials.trafficEnabled){var Q=E.createElement("xls:Overlay");var O=E.createElement("xls:Traffic");var J=E.createElement("xls:FlowReporting");if(T){J.setAttribute("time",T)}O.appendChild(J);Q.appendChild(O);X.appendChild(Q)}if(document.all){E.setProperty("SelectionLanguage","XPath");E.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}return E}catch(U){throw new Exception("XMLRequestFactory.prototype.createBasicMapRequestDOM: "+U.message)}};XMLRequestFactory.prototype.zoomMapRequestDOM=function(C,Q,O,U,L,F,K,B,J){var S;try{var N=(new DOMParser()).parseFromString(Sarissa.serialize(C),"text/xml");N.setProperty("SelectionLanguage","XPath");N.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(B){var G=N.selectSingleNode("//gml:pos");for(S=0;S<G.childNodes.length;S++){G.removeChild(G.childNodes[S])}var I=N.createTextNode(B.toString());G.appendChild(I)}if(J){var E=N.selectSingleNode("//xls:Radius");for(S=0;S<E.childNodes.length;S++){E.removeChild(E.childNodes[S])}E.setAttribute("unit","M");var H=N.createTextNode(J.toString());E.appendChild(H)}var A=N.selectSingleNode("//xls:Pan[@direction='N']");A.setAttribute("numTiles",Q);var V=N.selectSingleNode("//xls:Pan[@direction='S']");V.setAttribute("numTiles",O);var D=N.selectSingleNode("//xls:Pan[@direction='E']");D.setAttribute("numTiles",U);var T=N.selectSingleNode("//xls:Pan[@direction='W']");T.setAttribute("numTiles",L);var P=(N.selectSingleNode("//xls:RequestHeader"));if(this.mapType=="STREET"){P.setAttribute("configuration",this.configuration)}else{P.setAttribute("configuration",this.transparentConfiguration)}var R=(N.selectSingleNode("//xls:Output"));if(this.mapType=="STREET"){R.setAttribute("format",this.streetImgFormat)}else{R.setAttribute("format",this.hybridImgFormat)}var M=N.selectSingleNode("//xls:GridLayer[@name='globexplorer']");M.setAttribute("meta-inf","zoom="+F+":"+K);return N}catch(U){throw new Exception("XMLRequestFactory.prototype.zoomMapRequestDOM: "+U.message)}};XMLRequestFactory.prototype.createGeocodeRequestDOM=function(H,S,D){try{var I=this.getHeader("GeocodeRequest",S);var N=I.createElement("xls:GeocodeRequest");if(D){N.setAttribute("returnFreeForm","true")}else{N.setAttribute("returnFreeForm","false")}Utilities.getElementByTagName(I,"xls","Request").appendChild(N);var U=I.createElement("xls:Address");U.setAttribute("countryCode",H.getLocale().getCountry());U.setAttribute("language",H.getLocale().getLanguage());N.appendChild(U);if(H.type=="FreeForm"){var G=I.createElement("xls:freeFormAddress");var P=I.createTextNode(H.toString());G.appendChild(P);U.appendChild(G)}else{var T=I.createElement("xls:StreetAddress");var M=false;if(H.buildingNumber||H.buildingNumber==0){var F=I.createElement("xls:Building");F.setAttribute("number",H.buildingNumber);T.appendChild(F);M=true}if(H.street){var X=I.createTextNode(H.street);var L=I.createElement("xls:Street");L.appendChild(X);T.appendChild(L);M=true}if(!M){T=null}else{U.appendChild(T)}if(H.countrySubdivision){var E=I.createTextNode(H.countrySubdivision);var C=I.createElement("xls:Place");C.setAttribute("type","CountrySubdivision");C.appendChild(E);U.appendChild(C)}if(H.countrySecondarySubdivision){var B=I.createTextNode(H.countrySecondarySubdivision);var A=I.createElement("xls:Place");A.setAttribute("type","CountrySecondarySubdivision");A.appendChild(B);U.appendChild(A)}if(H.municipality){var R=I.createTextNode(H.municipality);var W=I.createElement("xls:Place");W.setAttribute("type","Municipality");W.appendChild(R);U.appendChild(W)}if(H.municipalitySubdivision){var J=I.createTextNode(H.municipalitySubdivision);var O=I.createElement("xls:Place");O.setAttribute("type","MunicipalitySubdivision");O.appendChild(J);U.appendChild(O)}if(H.postalCode){var Q=I.createTextNode(H.postalCode);var K=I.createElement("xls:PostalCode");K.appendChild(Q);U.appendChild(K)}}return I}catch(V){throw new Exception("XMLRequestFactory.prototype.getGeocodeRequestDOM: "+V.message)}};XMLRequestFactory.prototype.createReverseGeocodeRequestDOM=function(F,A){try{var E=this.getHeader("ReverseGeocodeRequest",A);var K=E.createElement("xls:ReverseGeocodeRequest");K.setAttribute("returnFreeForm","true");Utilities.getElementByTagName(E,"xls","Request").appendChild(K);var D=E.createElement("xls:Position");var I=E.createElement("gml:Point");var H=E.createElement("gml:pos");var B=E.createTextNode(F.getLatLon());H.appendChild(B);I.appendChild(H);D.appendChild(I);K.appendChild(D);var J=E.createElement("xls:ReverseGeocodePreference");var C=E.createTextNode("StreetAddress");J.appendChild(C);K.appendChild(J);return E}catch(G){throw new Exception("XMLRequestFactory.prototype.createReverseGeocodeRequestDOM: "+G.message)}};XMLRequestFactory.prototype.createCenterContext=function(B,J){try{var D=Sarissa.getDomDocument();var A=D.createElement("xls:CenterContext");A.setAttribute("SRS","WGS-84");var E=D.createElement("xls:Radius");E.setAttribute("unit","KM");var I=D.createTextNode(Utilities.formatRadiusToString(J));E.appendChild(I);var G=D.createElement("xls:CenterPoint");var H=D.createElement("gml:pos");var C=D.createTextNode(B);H.appendChild(C);G.appendChild(H);A.appendChild(G);A.appendChild(E);return A}catch(F){throw new Exception("XMLRequestFactory.prototype.createCenterContext: "+F.message)}};XMLRequestFactory.prototype.createRouteGeometryRequestDOM=function(F,L,j,g){try{var r=this.getHeader("DetermineRouteRequest",L);var P=r.createElement("xls:DetermineRouteRequest");P.setAttribute("distanceUnit",j.uom);P.setAttribute("routeQueryType",j.routeQueryType);P.setAttribute("provideRouteHandle","true");if(j.alternateRoutes){P.setAttribute("numAltRoutes",j.alternateRoutes)}Utilities.getElementByTagName(r,"xls","Request").appendChild(P);var H=r.createElement("xls:RoutePlan");if(Credentials.trafficEnabled){H.setAttribute("useRealTimeTraffic","true")}if(j.optimized){H.setAttribute("optimize","true")}if(Credentials.trafficEnabled&&j.expectedStartTime){H.setAttribute("expectedStartTime",j.expectedStartTime)}P.appendChild(H);var J=r.createElement("xls:RoutePreference");var X=r.createTextNode(j.routePreference);J.appendChild(X);H.appendChild(J);var m=r.createElement("xls:WayPointList");for(var f=0;f<F.length;f++){var Z;var V;var T;var G;if(f==0){var N=r.createElement("xls:StartPoint");Z=r.createElement("xls:Position");V=r.createElement("gml:Point");T=r.createElement("gml:pos");G=r.createTextNode(F[f]);T.appendChild(G);V.appendChild(T);Z.appendChild(V);N.appendChild(Z);m.appendChild(N)}else{if(f>0&&f<(F.length-1)){var K=r.createElement("xls:ViaPoint");Z=r.createElement("xls:Position");V=r.createElement("gml:Point");T=r.createElement("gml:pos");G=r.createTextNode(F[f]);T.appendChild(G);V.appendChild(T);Z.appendChild(V);K.appendChild(Z);m.appendChild(K)}else{if(f==(F.length-1)){var B=r.createElement("xls:EndPoint");Z=r.createElement("xls:Position");V=r.createElement("gml:Point");T=r.createElement("gml:pos");G=r.createTextNode(F[f]);T.appendChild(G);V.appendChild(T);Z.appendChild(V);B.appendChild(Z);m.appendChild(B)}}}}H.appendChild(m);if(j.avoidList.length>0){var n=r.createElement("xls:AvoidList");for(f=0;f<j.avoidList.length;f++){var M=r.createTextNode(j.avoidList[f]);var p=r.createElement("xls:AvoidFeature");p.appendChild(M);n.appendChild(p)}H.appendChild(n)}if(j.logisticsPreference){var S=j.logisticsPreference;var O=false;var d=r.createElement("xls:Logistics");if(S.preferredRoute){O=true;var c=r.createTextNode(S.preferredRoute);var q=r.createElement("xls:PreferredRoute");q.appendChild(c);d.appendChild(q)}if(S.hazmat){O=true;var b=r.createTextNode(S.hazmat);var W=r.createElement("xls:Hazmat");W.appendChild(b);d.appendChild(W)}if(S.vehicleParameters){O=true;var A=r.createTextNode(S.vehicleParameters);var U=r.createElement("xls:VehicleParameters");U.appendChild(A);d.appendChild(U)}if(S.vehicleTypes){O=true;var Q=r.createTextNode(S.vehicleTypes);var D=r.createElement("xls:VehicleTypes");D.appendChild(Q);d.appendChild(D)}if(S.preferredTurn){O=true;var C=r.createTextNode(S.preferredTurn);var E=r.createElement("xls:PreferredTurn");E.appendChild(C);d.appendChild(E)}if(O==true){H.appendChild(d)}else{d=null}}var Y=r.createElement("xls:RouteInstructionsRequest");Y.setAttribute("providePoint","true");if(j.rules!=null){Y.setAttribute("rules",j.rules)}P.appendChild(Y);var o=r.createElement("xls:RouteGeometryRequest");if(!g){o.setAttribute("returnRouteIDOnly","true")}if(j.generalizationFactor&&j.generalizationFactor!==0&&j.generalizationBBox){o.setAttribute("resolution",j.generalizationFactor);var I=r.createElement("xls:BoundingBox");var l=r.createElement("gml:pos");var a=r.createTextNode(j.generalizationBBox.minPosition);var h=r.createElement("gml:pos");var R=r.createTextNode(j.generalizationBBox.maxPosition);l.appendChild(a);I.appendChild(l);h.appendChild(R);I.appendChild(h);o.appendChild(I)}P.appendChild(o);return r}catch(k){throw new Exception("XMLRequestFactory.prototype.createRouteGeometryRequestDOM: "+k.message)}};XMLRequestFactory.prototype.createRouteGeometryByIdRequestDOM=function(A,D,H,B){try{var E=this.getHeader("DetermineRouteRequest",D,null,H);var I=E.createElement("xls:DetermineRouteRequest");Utilities.getElementByTagName(E,"xls","Request").appendChild(I);var C=E.createElement("xls:RouteInstructionsRequest");C.setAttribute("providePoint","true");var G=E.createElement("xls:RouteGeometryRequest");var J=E.createElement("xls:RouteHandle");J.setAttribute("serviceID","DetermineRouteService");J.setAttribute("routeID",A);if(!B){G.setAttribute("returnRouteIDOnly","true")}I.appendChild(J);I.appendChild(C);I.appendChild(G);return E}catch(F){throw new Exception("XMLRequestFactory.prototype.createRouteGeometryByIdRequestDOM: "+F.message)}};XMLRequestFactory.prototype.createRouteMapDOM=function(F,K,P,J,N,B){try{var E=this.getHeader("PortrayMapRequest",P);var T=E.createElement("xls:PortrayMapRequest");T.setAttribute("fitOverlays","false");Utilities.getElementByTagName(E,"xls","Request").appendChild(T);var I=E.createElement("xls:Output");I.setAttribute("width",J);I.setAttribute("height",J);I.setAttribute("fixedgrid","true");I.setAttribute("useCache","true");if(this.mapType=="STREET"){I.setAttribute("format",this.streetImgFormat)}else{I.setAttribute("format",this.hybridImgFormat)}I.setAttribute("content","URL");I.appendChild(F);var C=E.createElement("xls:Overlay");K.setAttribute("preference",B.routePreference);this.routeID=K;C.appendChild(K.cloneNode(true));T.appendChild(I);T.appendChild(C);var R=E.createElement("xls:TileGrid");R.setAttribute("rows","1");R.setAttribute("columns","1");var L=E.createElement("xls:GridLayer");L.setAttribute("name","globexplorer");L.setAttribute("meta-inf","zoom="+N);var U=E.createElement("xls:GridLayer");U.setAttribute("name","deCarta");U.setAttribute("returnMaxImageHostAliases","true");R.appendChild(U);R.appendChild(L);var D=E.createElement("xls:Pan");D.setAttribute("direction","N");D.setAttribute("numTiles","0");var A=E.createElement("xls:Pan");A.setAttribute("direction","S");A.setAttribute("numTiles","0");var G=E.createElement("xls:Pan");G.setAttribute("direction","E");G.setAttribute("numTiles","0");var S=E.createElement("xls:Pan");S.setAttribute("direction","W");S.setAttribute("numTiles","0");R.appendChild(D);R.appendChild(A);R.appendChild(G);R.appendChild(S);I.appendChild(R);if(Credentials.trafficEnabled){var O=E.createElement("xls:Overlay");var M=E.createElement("xls:Traffic");var H=E.createElement("xls:FlowReporting");if(B.expectedStartTime){H.setAttribute("time",B.expectedStartTime)}M.appendChild(H);O.appendChild(M);T.appendChild(O)}return E}catch(Q){throw new Exception("XMLRequestFactory.prototype.createRouteMapDOM: "+Q.message)}};XMLRequestFactory.prototype.createPOIRequestDOM=function(P,G){try{var E=this.getHeader("DirectoryRequest",G,P.maximumResponses);var A=E.createElement("xls:DirectoryRequest");if(P.database!=null){A.setAttribute("database",P.database)}Utilities.getElementByTagName(E,"xls","Request").appendChild(A);A.setAttribute("sortDirection",P.sortDirection);A.setAttribute("sortCriteria",P.sortCriteria);if(P.allowAggregates){A.setAttribute("allowAggregates","true")}var C=E.createElement("xls:POILocation");A.appendChild(C);var I=E.createElement("xls:WithinDistance");C.appendChild(I);var F=E.createElement("xls:MaximumDistance");F.setAttribute("value",P.radius.distance);F.setAttribute("uom",P.radius.uom.value);var O=E.createElement("xls:MinimumDistance");O.setAttribute("unit",P.radius.uom.value);O.setAttribute("value","0");var K=E.createElement("xls:POI");K.setAttribute("ID","1");var N=E.createElement("gml:Point");var J=E.createElement("gml:pos");var B=E.createTextNode(P.position.toString());J.appendChild(B);N.appendChild(J);K.appendChild(N);I.appendChild(K);I.appendChild(O);I.appendChild(F);var Q=E.createElement("xls:POIProperties");var D=E.createElement("xls:POIProperty");Q.appendChild(D);A.appendChild(Q);D.setAttribute("name","Keyword");D.setAttribute("value",P.queryString);for(var M in P.properties){var L=E.createElement("xls:POIProperty");L.setAttribute("name",M);L.setAttribute("value",P.properties[M]);Q.appendChild(L)}return E}catch(H){throw new Exception("XMLRequestFactory.prototype.createPOIRequestDOM: "+H.message)}};XMLRequestFactory.prototype.createRUOKRequestDOM=function(C){try{var B=this.getHeader("RuokRequest",C);var A=B.createElement("xls:RUOKRequest");Utilities.getElementByTagName(B,"xls","Request").appendChild(A);return B}catch(D){throw new Exception("XMLRequestFactory.prototype.createRUOKRequestDOM: "+D.message)}};XMLRequestFactory.prototype.addOverlaysToXML=function(J,F){try{if(this.rendering!="server"){return }if(this.routeID!=null){var D=F.createElement("xls:Overlay");D.appendChild(this.routeID);J.appendChild(D)}for(var E=0;E<this.overlays.length;E++){if(!this.overlays[E]||(this.overlays[E]&&!this.overlays[E].isVisible)){continue}var A=this.overlays[E];var C=F.createElement("xls:Overlay");var I=F.createElement("xls:Shape");C.appendChild(I);I.setAttribute("type",A.type);I.setAttribute("color",A.fillColor+"_"+A.borderColor);I.setAttribute("style",A.borderStyle);if(A.type=="line"){I.setAttribute("width",A.width+"_"+A.borderWidth);if(A.strokeOpacity){I.setAttribute("opacity",A.strokeOpacity)}else{I.setAttribute("opacity",A.opacity)}}else{I.setAttribute("width",A.borderWidth);if(A.strokeOpacity||A.fillOpacity){var G=A.strokeOpacity||A.opacity;var K=A.fillOpacity||A.opacity;I.setAttribute("opacity",K+"_"+G)}else{I.setAttribute("opacity",A.opacity)}}var B;if(A.type=="circle"){I.setAttribute("pointspec","LL");I.setAttribute("radius",A.radius.uomdds+A.radius.distance);B=F.createTextNode(A.position.lat+","+A.position.lon)}else{try{var L=Utilities.LL2VR7(A.positions);A.VR7=L}catch(H){continue}if(A.type=="line"){I.setAttribute("pointspec","VR7")}else{I.setAttribute("pointspec","VR7PG")}B=F.createTextNode(L)}I.appendChild(B);J.appendChild(C)}}catch(H){throw new Exception("XMLRequestFactory.prototype.addOverlaysToXML: "+H.message)}};XMLRequestFactory.prototype.createTrafficIncidentRequestDOM=function(K,E){try{var D=this.getHeader("TrafficRequest",E,K.maxiumResponses);var C=D.createElement("xls:TrafficRequest");Utilities.getElementByTagName(D,"xls","Request").appendChild(C);var L=D.createElement("xls:IncidentReporting");L.setAttribute("minimumSeverity",K.minimumSeverity);C.appendChild(L);var A=D.createElement("xls:CenterContext");A.setAttribute("SRS","WGS-84");var F=D.createElement("xls:Radius");F.setAttribute("unit",K.radius.uom.value);var J=D.createTextNode(K.radius.distance);F.appendChild(J);var H=D.createElement("xls:CenterPoint");var I=D.createElement("gml:pos");var B=D.createTextNode(K.position);I.appendChild(B);H.appendChild(I);A.appendChild(H);A.appendChild(F);C.appendChild(A);return D}catch(G){throw new Exception("XMLRequestFactory.prototype.createTrafficIncidentRequestDOM: "+G.message)}};function ZoomController(E,C,B,M,K,A){this.selected=E||5;if(isNaN(parseInt(this.selected))||this.selected<0||this.selected>17){throw new Exception("Error instantiating ZoomController, invalid initial value "+E+".  The value must be between 1 and 17");return false}this.zoomLevels=17;this.lowerBound=1;this.upperBound=17;this.color=C||"";this.uncheckedSrc=M||Credentials.imgPath+"zoom.png";this.checkedSrc=B||Credentials.imgPath+"zoomChecked.png";this.bottomCapSrc=A||Credentials.imgPath+"zoomBottom.png";this.topCapSrc=K||Credentials.imgPath+"zoomTop.png";this.zoomer=null;this.map=null;this.type="ZoomController";this.frame=null;var L=this;var H=new Array();var D=null;var F=null;var I;var J;this.initialize=function(){var R;var N="decarta-zoomButton";for(R=L.lowerBound;R<=L.upperBound;R++){var Q=document.createElement("img");deCarta.IdManager.setTag(Q,"ingoreForMapEvents");Q.id="decarta-z"+R;Q.className=N;Q.src=L.uncheckedSrc;Q.onclick=function(){L.map.zoomMap(this.id.substring(9))};if(Utilities.ie6){Utilities.fixPng(Q)}H.push(Q)}D=document.createElement("IMG");D.id="decarta-ztop";D.src=this.topCapSrc;D.className=N;if(Utilities.ie6){Utilities.fixPng(D)}D.onclick=function(S){S=S||event;S.stoppropagation?S.stoppropagation():S.cancelBubble=true;L.zoomInOneLevel()};deCarta.IdManager.setTag(D,"ingoreForMapEvents");F=document.createElement("IMG");F.src=this.bottomCapSrc;F.className=N;if(Utilities.ie6){Utilities.fixPng(F)}F.id="decarta-zbottom";F.onclick=function(S){S=S||event;S.stoppropagation?S.stoppropagation():S.cancelBubble=true;L.zoomOutOneLevel()};deCarta.IdManager.setTag(F,"ingoreForMapEvents");var P="decarta-zoom";var O=P;L.frame=document.createElement("DIV");L.frame.id=P;L.frame.className=O;L.frame.innerHTML="";if(L.color){L.frame.style.backgroundColor=L.color}deCarta.IdManager.setTag(L.frame,"ingoreForMapEvents");L.frame.appendChild(D);for(R=0;R<H.length;R++){L.frame.appendChild(H[R])}L.frame.appendChild(F);this.zoomer=this.frame;this.setZoomLevel(L.selected)};this.setZoomRange=function(N,O){if(N<1||O>21||N>O){throw new Exception("illegal values setZoomRange: "+N+", "+O)}if(L.selected>O){L.selected=O}if(L.selected<N){L.selected=N}L.zoomLevels=O;L.lowerBound=N;L.upperBound=O};this.setZoomButtonImages=function(Q,P,N,R){if(Q){this.checkedSrc=Q}if(P){this.uncheckedSrc=P}if(Q||P){for(var O=0;O<H.length;O++){H[O].src=this.uncheckedSrc}if(L.selected){H[L.selected-1].src=this.checkedSrc}}if(N){this.topCapSrc=N;D.src=N}if(R){this.bottomCapSrc=R;F.src=R}};this.setColor=function(N){this.frame.style.backgroundColor=N};this.show=function(){this.frame.style.display="block"};this.hide=function(){this.frame.style.display="none"};this.getRadius=function(){return I};this.setRadius=function(P){J=P;var O=L.map.getGridSize().split(" ");var Q=O[0];var N=O[1];if(Q==N){I=P}else{I=(J/N)*Q}};this.getRadiusX=function(){return J};this.setRadiusX=function(N){J=N};this.getZoomLevel=function(){return L.selected};this.setZoomValue=function(N){this.setZoomLevel(N)};this.setZoomLevel=function(O){if(O&&O<L.lowerBound||O>L.upperBound){throw new Exception("Error calling setZoomLevel, out of range");return false}L.selected=O;G();for(var N=0;N<H.length;N++){if(H[N].id=="decarta-z"+O){H[N].src=L.checkedSrc}if(Utilities.ie6){Utilities.fixPng(H[N])}}};this.getGXConvertedZoomLevel=function(){return Math.abs(21-L.selected)};this.zoomToNewLevel=function(O){if(O&&O<L.lowerBound||O>L.upperBound){throw new Exception("Error calling zoomToNewLevel, out of range");return false}G();for(var N=0;N<H.length;N++){if(H[N].id=="decarta-z"+O){H[N].src=L.checkedSrc}if(Utilities.ie6){Utilities.fixPng(H[N])}}L.map.zoomMap(O)};this.zoomInOneLevel=function(){if(L.selected<=L.lowerBound){return false}G();for(var N=0;N<H.length;N++){if(H[N].id=="decarta-z"+L.selected){H[N].src=L.checkedSrc}}L.map.zoomMap(parseInt(L.selected)-1)};this.zoomOutOneLevel=function(){if(L.selected==L.zoomLevels){return false}G();for(var N=0;N<H.length;N++){if(H[N].id=="decarta-z"+L.selected){H[N].src=L.checkedSrc}}L.map.zoomMap(parseInt(L.selected)+1)};this.getZoomLevelToFitBoundingBox=function(Q){var T=parseInt(L.map.mapDiv.style.height)/2;var U=parseInt(L.map.mapDiv.style.width)/2;for(var S=20;S>0;--S){var P=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),S);var W=Utilities.lat2pix(Q.getCenterPosition().getLat(),P);var Y=Utilities.lon2pix(Q.getCenterPosition().getLon(),P);var R=Utilities.pix2lat(W+T,P);var X=Utilities.pix2lon(Y+U,P);var O=Utilities.pix2lat(W-T,P);var V=Utilities.pix2lon(Y-U,P);var N=new BoundingBox(new Position(O,V),new Position(R,X));if(N.contains(Q.minPosition)&&N.contains(Q.maxPosition)){return Math.abs(21-S);break}}};this.getZoomLevelToFitPositions=function(N){var O=Utilities.positionsToBoundingBox(N);return L.getZoomLevelToFitBoundingBox(O)};this.getZoomLevelToFitPins=function(Q){var O=[];for(var P=0;P<Q.length;P++){O[P]=Q[P].position.clone()}var R=Utilities.positionsToBoundingBox(O);var S=L.getZoomLevelToFitBoundingBox(R);var N=Utilities.radsPerPixelAtZoom(L.map.getTileSize(),Math.abs(21-S));R=Utilities.pinsToBoundingBox(Q,N);return L.getZoomLevelToFitBoundingBox(R)};this.appendThis=function(){if(!this.frame){this.initialize()}return this.frame};this.removeThis=function(){this.map=null;return this.frame};this.position=function(N){if(!this.map){return }this.frame.style.top="1px";this.frame.style.left="1px"};function G(){for(var N=0;N<H.length;N++){H[N].src=L.uncheckedSrc}}};