if(!window.CanvasRenderingContext2D){(function(){var f=Math,q=f.round,b=f.sin,a=f.cos,o=10,n=o/2,U={init:function(E){var A=E||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var F=this;A.attachEvent("onreadystatechange",function(){F.r(A)})}},r:function(E){if(E.readyState=="complete"){if(!E.namespaces.s){E.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var A=E.createStyleSheet();A.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";var G=E.getElementsByTagName("canvas");for(var F=0;F<G.length;F++){if(!G[F].getContext){this.initElement(G[F])}}}},q:function(E){var A=E.outerHTML,H=E.ownerDocument.createElement(A);if(A.slice(-2)!="/>"){var G="/"+E.tagName,F;while((F=E.nextSibling)&&F.tagName!=G){F.removeNode()}if(F){F.removeNode()}}E.parentNode.replaceChild(H,E);return H},initElement:function(E){E=this.q(E);E.getContext=function(){if(this.l){return this.l}return this.l=new c(this)};E.attachEvent("onpropertychange",C);E.attachEvent("onresize",B);var A=E.attributes;if(A.width&&A.width.specified){E.style.width=A.width.nodeValue+"px"}else{E.width=E.clientWidth}if(A.height&&A.height.specified){E.style.height=A.height.nodeValue+"px"}else{E.height=E.clientHeight}return E}};function C(E){var A=E.srcElement;switch(E.propertyName){case"width":A.style.width=A.attributes.width.nodeValue+"px";A.getContext().clearRect();break;case"height":A.style.height=A.attributes.height.nodeValue+"px";A.getContext().clearRect();break}}function B(E){var A=E.srcElement;if(A.firstChild){A.firstChild.style.width=A.clientWidth+"px";A.firstChild.style.height=A.clientHeight+"px"}}U.init();var T=[];for(var l=0;l<16;l++){for(var k=0;k<16;k++){T[l*16+k]=l.toString(16)+k.toString(16)}}function d(){return[[1,0,0],[0,1,0],[0,0,1]]}function h(E,A){var J=d();for(var I=0;I<3;I++){for(var H=0;H<3;H++){var G=0;for(var F=0;F<3;F++){G+=E[I][F]*A[F][H]}J[I][H]=G}}return J}function Z(E,A){A.fillStyle=E.fillStyle;A.lineCap=E.lineCap;A.lineJoin=E.lineJoin;A.lineWidth=E.lineWidth;A.miterLimit=E.miterLimit;A.shadowBlur=E.shadowBlur;A.shadowColor=E.shadowColor;A.shadowOffsetX=E.shadowOffsetX;A.shadowOffsetY=E.shadowOffsetY;A.strokeStyle=E.strokeStyle;A.d=E.d;A.e=E.e}function Y(E){var A,J=1;E=String(E);if(E.substring(0,3)=="rgb"){var I=E.indexOf("(",3),H=E.indexOf(")",I+1),G=E.substring(I+1,H).split(",");A="#";for(var F=0;F<3;F++){A+=T[Number(G[F])]}if(G.length==4&&E.substr(3,1)=="a"){J=G[3]}}else{A=E}return[A,J]}function D(A){switch(A){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function c(E){this.a=d();this.m=[];this.k=[];this.c=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=o*1;this.globalAlpha=1;this.canvas=E;var A=E.ownerDocument.createElement("div");A.style.width=E.clientWidth+"px";A.style.height=E.clientHeight+"px";A.style.overflow="hidden";A.style.position="absolute";E.appendChild(A);this.j=A;this.d=1;this.e=1}var p=c.prototype;p.clearRect=function(){this.j.innerHTML="";this.c=[]};p.beginPath=function(){this.c=[]};p.moveTo=function(E,A){this.c.push({type:"moveTo",x:E,y:A});this.f=E;this.g=A};p.lineTo=function(E,A){this.c.push({type:"lineTo",x:E,y:A});this.f=E;this.g=A};p.bezierCurveTo=function(E,A,I,H,G,F){this.c.push({type:"bezierCurveTo",cp1x:E,cp1y:A,cp2x:I,cp2y:H,x:G,y:F});this.f=G;this.g=F};p.quadraticCurveTo=function(F,A,K,J){var I=this.f+0.6666666666666666*(F-this.f),H=this.g+0.6666666666666666*(A-this.g),G=I+(K-this.f)/3,E=H+(J-this.g)/3;this.bezierCurveTo(I,H,G,E,K,J)};p.arc=function(N,M,L,K,J,H){L*=o;var G=H?"at":"wa",F=N+a(K)*L-n,E=M+b(K)*L-n,A=N+a(J)*L-n,I=M+b(J)*L-n;if(F==A&&!H){F+=0.125}this.c.push({type:G,x:N,y:M,radius:L,xStart:F,yStart:E,xEnd:A,yEnd:I})};p.rect=function(E,A,G,F){this.moveTo(E,A);this.lineTo(E+G,A);this.lineTo(E+G,A+F);this.lineTo(E,A+F);this.closePath()};p.strokeRect=function(E,A,G,F){this.beginPath();this.moveTo(E,A);this.lineTo(E+G,A);this.lineTo(E+G,A+F);this.lineTo(E,A+F);this.closePath();this.stroke()};p.fillRect=function(E,A,G,F){this.beginPath();this.moveTo(E,A);this.lineTo(E+G,A);this.lineTo(E+G,A+F);this.lineTo(E,A+F);this.closePath();this.fill()};p.createLinearGradient=function(E,A,H,G){var F=new g("gradient");return F};p.createRadialGradient=function(E,A,J,I,H,G){var F=new g("gradientradial");F.n=J;F.o=G;F.i.x=E;F.i.y=A;return F};p.drawImage=function(AA,u){var m,j,i,V,S,Q,P,O,W=AA.runtimeStyle.width,R=AA.runtimeStyle.height;AA.runtimeStyle.width="auto";AA.runtimeStyle.height="auto";var M=AA.width,K=AA.height;AA.runtimeStyle.width=W;AA.runtimeStyle.height=R;if(arguments.length==3){m=arguments[1];j=arguments[2];S=(Q=0);P=(i=M);O=(V=K)}else{if(arguments.length==5){m=arguments[1];j=arguments[2];i=arguments[3];V=arguments[4];S=(Q=0);P=M;O=K}else{if(arguments.length==9){S=arguments[1];Q=arguments[2];P=arguments[3];O=arguments[4];m=arguments[5];j=arguments[6];i=arguments[7];V=arguments[8]}else{throw"Invalid number of arguments"}}}var J=this.b(m,j),I=[],H=10,G=10;I.push(" <g_vml_:group",' coordsize="',o*H,",",o*G,'"',' coordorigin="0,0"',' style="width:',H,";height:",G,";position:absolute;");if(this.a[0][0]!=1||this.a[0][1]){var F=[];F.push("M11='",this.a[0][0],"',","M12='",this.a[1][0],"',","M21='",this.a[0][1],"',","M22='",this.a[1][1],"',","Dx='",q(J.x/o),"',","Dy='",q(J.y/o),"'");var N=J,E=this.b(m+i,j),A=this.b(m,j+V),L=this.b(m+i,j+V);N.x=Math.max(N.x,E.x,A.x,L.x);N.y=Math.max(N.y,E.y,A.y,L.y);I.push("padding:0 ",q(N.x/o),"px ",q(N.y/o),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",F.join(""),", sizingmethod='clip');")}else{I.push("top:",q(J.y/o),"px;left:",q(J.x/o),"px;")}I.push(' ">','<g_vml_:image src="',AA.src,'"',' style="width:',o*i,";"," height:",o*V,';"',' cropleft="',S/M,'"',' croptop="',Q/K,'"',' cropright="',(M-S-P)/M,'"',' cropbottom="',(K-Q-O)/K,'"'," />","</g_vml_:group>");this.j.insertAdjacentHTML("BeforeEnd",I.join(""))};p.stroke=function(AE){var AD=[],AC=Y(AE?this.fillStyle:this.strokeStyle),AB=AC[0],AA=AC[1]*this.globalAlpha,j=10,i=10;AD.push("<g_vml_:shape",' fillcolor="',AB,'"',' filled="',Boolean(AE),'"',' style="position:absolute;width:',j,";height:",i,';"',' coordorigin="0 0" coordsize="',o*j," ",o*i,'"',' stroked="',!AE,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',AB,'"',' path="');var V={x:null,y:null},S={x:null,y:null};for(var R=0;R<this.c.length;R++){var m=this.c[R];if(m.type=="moveTo"){AD.push(" m ");var W=this.b(m.x,m.y);AD.push(q(W.x),",",q(W.y))}else{if(m.type=="lineTo"){AD.push(" l ");var W=this.b(m.x,m.y);AD.push(q(W.x),",",q(W.y))}else{if(m.type=="close"){AD.push(" x ")}else{if(m.type=="bezierCurveTo"){AD.push(" c ");var W=this.b(m.x,m.y),P=this.b(m.cp1x,m.cp1y),N=this.b(m.cp2x,m.cp2y);AD.push(q(P.x),",",q(P.y),",",q(N.x),",",q(N.y),",",q(W.x),",",q(W.y))}else{if(m.type=="at"||m.type=="wa"){AD.push(" ",m.type," ");var W=this.b(m.x,m.y),L=this.b(m.xStart,m.yStart),J=this.b(m.xEnd,m.yEnd);AD.push(q(W.x-this.d*m.radius),",",q(W.y-this.e*m.radius)," ",q(W.x+this.d*m.radius),",",q(W.y+this.e*m.radius)," ",q(L.x),",",q(L.y)," ",q(J.x),",",q(J.y))}}}}}if(W){if(V.x==null||W.x<V.x){V.x=W.x}if(S.x==null||W.x>S.x){S.x=W.x}if(V.y==null||W.y<V.y){V.y=W.y}if(S.y==null||W.y>S.y){S.y=W.y}}}AD.push(' ">');if(typeof this.fillStyle=="object"){var H={x:"50%",y:"50%"},G=S.x-V.x,F=S.y-V.y,Q=G>F?G:F;H.x=q(this.fillStyle.i.x/G*100+50)+"%";H.y=q(this.fillStyle.i.y/F*100+50)+"%";var E=[];if(this.fillStyle.p=="gradientradial"){var A=this.fillStyle.n/Q*100,O=this.fillStyle.o/Q*100-A}else{var A=0,O=100}var M={offset:null,color:null},K={offset:null,color:null};this.fillStyle.h.sort(function(s,r){return s.offset-r.offset});for(var R=0;R<this.fillStyle.h.length;R++){var I=this.fillStyle.h[R];E.push(I.offset*O+A,"% ",I.color,",");if(I.offset>M.offset||M.offset==null){M.offset=I.offset;M.color=I.color}if(I.offset<K.offset||K.offset==null){K.offset=I.offset;K.color=I.color}}E.pop();AD.push("<g_vml_:fill",' color="',K.color,'"',' color2="',M.color,'"',' type="',this.fillStyle.p,'"',' focusposition="',H.x,", ",H.y,'"',' colors="',E.join(""),'"',' opacity="',AA,'" />')}else{if(AE){AD.push('<g_vml_:fill color="',AB,'" opacity="',AA,'" />')}else{AD.push("<g_vml_:stroke",' opacity="',AA,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',D(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',AB,'" />')}}AD.push("</g_vml_:shape>");this.j.insertAdjacentHTML("beforeEnd",AD.join(""));this.c=[]};p.fill=function(){this.stroke(true)};p.closePath=function(){this.c.push({type:"close"})};p.b=function(E,A){return{x:o*(E*this.a[0][0]+A*this.a[1][0]+this.a[2][0])-n,y:o*(E*this.a[0][1]+A*this.a[1][1]+this.a[2][1])-n}};p.save=function(){var A={};Z(this,A);this.k.push(A);this.m.push(this.a);this.a=h(d(),this.a)};p.restore=function(){Z(this.k.pop(),this);this.a=this.m.pop()};p.translate=function(E,A){var F=[[1,0,0],[0,1,0],[E,A,1]];this.a=h(F,this.a)};p.rotate=function(E){var A=a(E),G=b(E),F=[[A,G,0],[-G,A,0],[0,0,1]];this.a=h(F,this.a)};p.scale=function(E,A){this.d*=E;this.e*=A;var F=[[E,0,0],[0,A,0],[0,0,1]];this.a=h(F,this.a)};p.clip=function(){};p.arcTo=function(){};p.createPattern=function(){return new X};function g(A){this.p=A;this.n=0;this.o=0;this.h=[];this.i={x:0,y:0}}g.prototype.addColorStop=function(E,A){A=Y(A);this.h.push({offset:1-E,color:A})};function X(){}G_vmlCanvasManager=U;CanvasRenderingContext2D=c;CanvasGradient=g;CanvasPattern=X})()}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.Math={};deCarta.String={};deCarta.Test={};function GLOBALS(){}GLOBALS.HYBRID="HYBRID";GLOBALS.STREET="STREET";GLOBALS.SATELLITE="SATELLITE";GLOBALS.PAN_PIXEL_DISTANCE=300;GLOBALS.API_VERSION="4.3.4sp01";GLOBALS.API_BUILD="$LastChangedRevision: 43281 $";GLOBALS.API_RELEASECLASS="RELEASE";function Credentials(){}Credentials.url="http://ws.decarta.com/openls/openls";Credentials.clientName="";Credentials.clientPassword="";Credentials.configuration="us-carto-nt";Credentials.transparentConfiguration="transparent-tile";Credentials.mapType="STREET";Credentials.ISOCountryCode="US";Credentials.trafficEnabled=false;Credentials.rel="4.3.4sp01";Credentials.dgkey="yiU7ynDEKnXKeIp1RT2gf8Heco8NIzBD";Credentials.imgPath="img/";Credentials.errorTile=Credentials.imgPath+"tile.png";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 getBuildingNumber(){return this.buildingNumber};Address.prototype.setBuildingNumber=function setBuildingNumber(A){this.buildingNumber=A};Address.prototype.getStreet=function getStreet(){return this.street};Address.prototype.setStreet=function setStreet(A){this.street=A};Address.prototype.getCountrySubdivision=function getCountrySubdivision(){return this.countrySubdivision};Address.prototype.setCountrySubdivision=function setCountrySubdivision(A){this.countrySubdivision=A};Address.prototype.getCountrySecondarySubdivision=function getCountrySecondarySubdivision(){return this.countrySecondarySubdivision};Address.prototype.setCountrySecondarySubdivision=function setCountrySecondarySubdivision(A){this.countrySecondarySubdivision=A};Address.prototype.getMunicipality=function getMunicipality(){return this.municipality};Address.prototype.setMunicipality=function setMunicipality(A){this.municipality=A};Address.prototype.getMunicipalitySubdivision=function getMunicipalitySubdivision(){return this.municipalitySubdivision};Address.prototype.setMunicipalitySubdivision=function setMunicipalitySubdivision(A){this.municipalitySubdivision=A};Address.prototype.getPostalCode=function getPostalCode(){return this.postalCode};Address.prototype.setPostalCode=function setPostalCode(A){this.postalCode=A};Address.prototype.getLocale=function getLocale(){return this.locale};Address.prototype.setLocale=function setLocale(A){this.locale=A};Address.prototype.toString=function toString(){if(this.buildingNumber+this.street+this.municipality+this.countrySubdivision+this.postalCode==""){return""}else{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}};function BoundingBox(B,A){if(!B||!A){throw new Exception("Error instantiating BoundingBox, invalid parameters.")}this.minPosition=B;this.maxPosition=A;this.heightInDegrees=this.maxPosition.lat-this.minPosition.lat;this.widthInDegrees=this.maxPosition.lon-this.minPosition.lon;this.getMaxPosition=function(){return this.maxPosition};this.getMinPosition=function(){return this.minPosition};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==C.getMinPosition()&&this.maxPosition==C.getMaxPosition()){return true}else{return false}};this.toString=function(){return this.minPosition.toString()+" "+this.maxPosition.toString()}}function DDSShape(){this.borderColor="(0.0.0)";this.borderStyle="SOLID";this.borderWidth="2";this.fillColor="(255.0.0)";this.id=null;this.opacity="65";this.strokeOpacity="";this.fillOpacity="";this.map=null}DDSShape.prototype.inside=null;DDSShape.prototype.setBorderColor=function(A){if(!A.match(/\([0-9]+\.[0-9]+\.[0-9]+\)/)){alert("Error setting RGB value in DDSShape.setBorderColor\nPlease use format (255.255.255)");return false}this.borderColor=A};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{alert("Error setting border style value in DDSShape.setBorderStyle\nPlease use format SOLID, DASH, DOT, DASHDOTDOT, ALTBLACKDASH, RAIL, NONE");return false}};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(A){if(!A.match(/\([0-9]+\.[0-9]+\.[0-9]+\)/)){alert("Error setting RGB value in DDSShape.setColor\nPlease use format (255.255.255)");return false}this.fillColor=A};DDSShape.prototype.getFillColor=function(){return this.fillColor};DDSShape.prototype.getId=function(){return this.id};DDSShape.prototype.setOpacity=function(A){this.opacity=A};DDSShape.prototype.getOpacity=function(){return this.opacity};DDSShape.prototype.setStrokeOpacity=function setStrokeOpacity(A){this.strokeOpacity=A};DDSShape.prototype.getStrokeOpacity=function getStrokeOpacity(){return this.strokeOpacity};DDSShape.prototype.setFillOpacity=function setFillOpacity(A){this.fillOpacity=A};DDSShape.prototype.getFillOpacity=function getFillOpacity(){return this.fillOpacity};DDSShape.prototype.equals=function(A){if(A&&this.id==A.id){return true}else{return false}};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.setPosition=function(A){this.position=A;if(this.map!=null&&this.map.getShapeRendering()=="client"){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"){map.redraw()}};DDSCircle.prototype.getRadius=function(){return this.radius};DDSCircle.prototype.inside=function inside(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=false;this.generalized=[];this.positions=[];this.width=A||2;this.VR7=""}DDSLine.prototype=new DDSShape();DDSLine.prototype.setPositions=function(A){this.positions=A;if(this.map!=null&&this.map.getShapeRendering()=="client"){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};function DDSPolygon(){this.id=Math.floor(Math.random()*10000000);this.type="polygon";this.generalize=false;this.generalized=[];this.positions=[];this.VR7=""}DDSPolygon.prototype=new DDSShape();DDSPolygon.prototype.setPositions=function(A){this.positions=A;if(this.map!=null&&this.map.getShapeRendering()=="client"){map.redraw()}};DDSPolygon.prototype.getPositions=function(){return this.positions};DDSPolygon.prototype.setVR7=function(A){this.VR7=A;if(this.map!=null){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 inside(A){return deCarta.Math.pointInPolygon(this.positions,A)};function EventRegistry(){}EventRegistry.addListener=function(C,A,B){if(C.type=="map"&&(A=="rightclick"||A=="dblclick"||A=="click"||A=="mouseout"||A=="movestart"||A=="moveend"||A=="zoomend")){C.addEventListener(A,B)}else{if(C.type=="pin"&&(A=="rightclick"||A=="dblclick"||A=="click"||A=="mouseover"||A=="mouseout")){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()};function Exception(B){this.message=B||"an exception has occurred";var A=this;this.getMessage=function(){return A.message};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.returnFreeForm=true;var D=[];var B=this;this.authenticate=function A(I,H){if(!I||!H||I==""||H==""){throw new Exception("Error authenticating Geocoder, invalid parameters.");return false}Credentials.clientName=I;Credentials.clientPassword=H};this.geocode=function C(H,K){var J=Utilities.getRequestId();D[J]=K;var I=this.xmlRecFac.createGeocodeRequestDOM(H,J,this.returnFreeForm);JSRequest.send(I,B.geocodeCallback)};this.reverseGeocode=function G(H,K){var J=Utilities.getRequestId();D[J]=K;var I=this.xmlRecFac.createReverseGeocodeRequestDOM(H,J);JSRequest.send(I,B.reverseGeocodeCallback)};this.reverseGeocodeCallback=function E(J){var P=Sarissa.getDomDocument();P=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(J),"text/xml");if(document.all){P.setProperty("SelectionLanguage","XPath");P.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}if(P.selectNodes("//xls:Error").length>0){var L=Sarissa.getText(P.selectSingleNode("//xls:Response/@requestID"));if(L!=-1){D[L](new Address("","","","","","",""))}else{throw new Exception("Error looking up reverse geocode callback, server did not provide necessary information.");return false}return false}else{try{var K=Sarissa.getText(P.selectSingleNode("//xls:Building/@number"))}catch(M){var K=""}try{var O=Sarissa.getText(P.selectSingleNode("//xls:Street"))}catch(M){var O=""}try{var N=Sarissa.getText(P.selectSingleNode("//xls:Place[@type='CountrySubdivision']"))}catch(M){var N=""}try{var Q=Sarissa.getText(P.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']"))}catch(M){var Q=""}try{var R=Sarissa.getText(P.selectSingleNode("//xls:Place[@type='Municipality']"))}catch(M){var R=""}try{var H=Sarissa.getText(P.selectSingleNode("//xls:Place[@type='MunicipalitySubdivision']"))}catch(M){var H=""}try{var I=Sarissa.getText(P.selectSingleNode("//xls:PostalCode"))}catch(M){var I=""}var L=Sarissa.getText(P.selectSingleNode("//xls:Response/@requestID"));D[L](new Address(K,O,N,Q,R,I,H))}};this.geocodeCallback=function F(b){var S=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(b),"text/xml");if(document.all){S.setProperty("SelectionLanguage","XPath");S.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var P=[];var I=[];var a=[];var T;if(S.selectNodes("//xls:Error").length>0){T=Sarissa.getText(S.selectSingleNode("//xls:Response/@requestID"));D[T](P,I,a)}else{var R;try{R=S.selectNodes("//xls:GeocodedAddress")}catch(Z){T=Sarissa.getText(S.selectSingleNode("//xls:Response/@requestID"));D[T](P,I,a);return false}for(var W=0;W<R.length;W++){var Q=new GeocodedAddress();var X=(Sarissa.serialize((R[W])));var N;if(X.indexOf("<gml:pos/>")>0){N="0.0 0.0"}else{N=X.substring(X.indexOf("<gml:pos>")+"<gml:pos>".length,X.indexOf("</gml:pos>"))}Q.position=new Position(N);var L;if(X.indexOf("<xls:freeFormAddress>")>0){if(X.indexOf("<xls:freeFormAddress/>")>0){L="NO ADDRESS FOUND"}else{L=X.substring(X.indexOf("<xls:freeFormAddress>")+"<xls:freeFormAddress>".length,X.indexOf("</xls:freeFormAddress>"))}L=new FreeFormAddress(L);Q.freeFormAddress=L}else{L=new Address();var U;var V;if(X.indexOf('<xls:Building number="')>0){U=X.indexOf('<xls:Building number="')+'<xls:Building number="'.length;V=X.indexOf('"/>',U);L.buildingNumber=X.substring(U,V)}if(X.indexOf("<xls:Street>")>0){U=X.indexOf("<xls:Street>")+"<xls:Street>".length;V=X.indexOf("</xls:Street>",U);L.street=X.substring(U,V)}if(X.indexOf('<xls:Place type="CountrySubdivision">')>0){U=X.indexOf('<xls:Place type="CountrySubdivision">')+'<xls:Place type="CountrySubdivision">'.length;V=X.indexOf("</xls:Place>",U);L.countrySubdivision=X.substring(U,V)}if(X.indexOf('<xls:Place type="CountrySecondarySubdivision">')>0){U=X.indexOf('<xls:Place type="CountrySecondarySubdivision">')+'<xls:Place type="CountrySecondarySubdivision">'.length;V=X.indexOf("</xls:Place>",U);L.countrySecondarySubdivision=X.substring(U,V)}if(X.indexOf('<xls:Place type="Municipality">')>0){U=X.indexOf('<xls:Place type="Municipality">')+'<xls:Place type="Municipality">'.length;V=X.indexOf("</xls:Place>",U);L.municipality=X.substring(U,V)}if(X.indexOf('<xls:Place type="MunicipalitySubdivision">')>0){U=X.indexOf('<xls:Place type="MunicipalitySubdivision">')+'<xls:Place type="MunicipalitySubdivision">'.length;V=X.indexOf("</xls:Place>",U);L.MunicipalitySubdivision=X.substring(U,V)}if(X.indexOf("<xls:PostalCode>")>0){U=X.indexOf("<xls:PostalCode>")+"<xls:PostalCode>".length;V=X.indexOf("</xls:PostalCode>",U);L.postalCode=X.substring(U,V)}Q.structuredAddress=L}var M;if(X.indexOf("<xls:BoundingBox>")<0){M=null}else{var Y=X.substring(X.indexOf("<xls:BoundingBox>")+"<xls:BoundingBox>".length,X.indexOf("</xls:BoundingBox>"));var K=Y.substring(Y.indexOf('">')+'">'.length,Y.indexOf("</gml"));var H=Y.substring(Y.indexOf("</gml")+5,Y.length);var J=H.substring(H.indexOf('">')+'">'.length,H.indexOf("</gml"));M=new BoundingBox(new Position(K),new Position(J))}Q.boundingBox=M;var O;if(X.indexOf("matchType")<0){O=null}else{O=X.substring(X.indexOf("matchType="));O=O.substring(O.indexOf('"')+1);O=O.substring(0,O.indexOf('"'))}Q.matchType=O;P.push(new Position(N));I.push(L);a.push(Q)}T=Sarissa.getText(S.selectSingleNode("//xls:Response/@requestID"));D[T](P,I,a)}}}function Icon(G,E,C,F,A,D){if(!G||(E!=0&&!E)||(C!=0&&!C)||(F!=0&&!F)||(A!=0&&!A)){alert("Error instantiating Icon, missing parameters.\n\nIcon(src,iconAnchorX,iconAnchorY,width,height) all required\n\nThe last parameter overlay is optional.");return false}this._previousX;this._previousY;var B=this;this.src=G;this.anchorX=E;this.anchorY=C;this.width=F;this.height=A;this.overlay=D||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};function InfoWindow(A,C,D,B){this.html=A;this.xOffset=C;this.yOffset=D;this.icon=B}function JSRequest(){}JSRequest.host=null;JSRequest.interceptorRequestFunction=null;JSRequest.interceptorResponseFunction=null;JSRequest.TIMEOUT=60000;JSRequest.timeoutHandler=function(){alert("request timeout")};JSRequest.xmlhttp=true;JSRequest.hostInProgress=false;JSRequest.holder=[];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){alert("Problem connecting to DDS: Please try again later or contact support");return }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){alert("Application Error:\n\nAPI user application response interceptor function threw error:\n\n"+C.message);return }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){alert(C)}};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(V,G){if(JSRequest.xmlhttp){try{if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(R){}}var W=new XMLHttpRequest();W.open("POST",Credentials.url,true)}catch(R){alert(R+"\n\n 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.")}W.onreadystatechange=function(){if(W.readyState==4){if(W.responseText==""){alert("Problem connecting to DDS Web Services: Please try again later or contact support");return }if(W.responseText&&W.responseText!=null&&W.responseText.indexOf("problem connecting to DDS")>0){alert("Problem connecting to DDS: Please try again later or contact support");return }G(W.responseText)}};W.send(V);return }if(JSRequest.host==null){JSRequest.holder.push(V);JSRequest.holder.push(G);if(JSRequest.hostInProgress){return }JSRequest.hostInProgress=true;var H=new XMLRequestFactory();var B=H.createRUOKRequestDOM(Utilities.getRequestId());V=B;G=JSRequest.getHost}try{if(typeof JSRequest.interceptorRequestFunction==="function"){if(!JSRequest.xmlhttp&&JSRequest.host==null){var D=Sarissa.serialize(V)}else{var D=Sarissa.serialize(JSRequest.interceptorRequestFunction(V))}}else{var D=Sarissa.serialize(V)}}catch(R){alert("Application Error:\n\nAPI user application request interceptor function threw error:\n\n"+R.message);return }var F=Credentials.url;var O=1800;var S=F.length;var A=80;var Q=(encodeURIComponent(D)).length;var J;var P=1;while(true){if(S+A+(Q/P)<O){J=P;break}P++}var L="";var T=Math.ceil(D.length/J);var M=Utilities.getRequestId();var K=0;for(var P=1;P<=J;P++){JSRequest.callbackFunctions[M]=G;if(K==0){var E=Math.round(T*P-T)}else{var E=K}var C=Math.round(T*P);K=C;var I=D.substring(E,C);L=encodeURIComponent(I);var U=document.createElement("script");U.setAttribute("type","text/javascript");var N=F+"?reqID="+M+"&chunkNo="+P+"&numChunks="+J+"&callback=JSRequest.callbackRegistry&data="+L;N=N.replace(new RegExp("\\+","g"),"%2b");U.setAttribute("src",N);U.setAttribute("id",M+":"+P);document.getElementsByTagName("head").item(0).appendChild(U);setTimeout("JSRequest.checkTimeout('"+M+":"+P+"')",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){alert("Error Message:\n\n\n"+(E.selectNodes("//@message"))[0].value);return false}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"}};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 LinkedList(){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 genIndex(){return(deCarta.LinkedList.Config.itemBackPointer+deCarta.LinkedList.Config.itemBackPointerIndex++)};deCarta.LinkedList.prototype.add=function add(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 remove(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 operateOnData(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 LinkedListItem(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};deCarta.LogEntry=function(){};deCarta.LogEntry.prototype.messageId=null;deCarta.LogEntry.prototype.messageNum=null;deCarta.LogEntry.prototype.time=null;deCarta.LogEntry.prototype.flags=[];deCarta.LogEntry.prototype.caller=null;deCarta.LogEntry.prototype.message=null;deCarta.LogEntry.prototype.htmlString=null;deCarta.LogEntry.prototype.toHtmlString=function htmlString(){if(!this.htmlString){var A=[];A.push(this.messageNum);A.push(this.time);A.push(this.flags);A.push(this.caller);A.push(this.message);this.htmlString=this.makeHtmlFriendly(A.join(" "))+"<br/>"}return this.htmlString};deCarta.LogEntry.prototype.makeHtmlFriendly=function makeHtmlFriendly(A){return A.replace(/&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;")};deCarta.Log=function Log(){};deCarta.Log.prototype.messageNum=0;deCarta.Log.prototype.console=null;deCarta.Log.prototype.consoleClassName="decarta-log";deCarta.Log.prototype.consoleId="___decarta_console";deCarta.Log.prototype.history=[];deCarta.Log.prototype.filterFlags=[];deCarta.Log.prototype.filterFuncName=[];deCarta.Log.prototype.initialize=function(){if(!this.console){deCarta.styles.addDefaultClass(this.consoleClassName);this.console=document.createElement("div");this.console.className=this.consoleClassName;this.console.id=this.consoleId;document.body.appendChild(this.console)}else{throw new Exception("deCarta.Log.initialize: attempting to inialize log more than once.")}};deCarta.Log.prototype.add=function add(D,B){if(this.messageNum==0){this.initialize()}var F=new deCarta.LogEntry();var A,C,E;if(arguments.length==1){E=D;A="_"}else{if(arguments.length==2){E=D;A=B}else{throw new Exception("deCarta.log.add: passed incorrect arguments in: "+arguments.toString())}}C=this.getFunctionName(arguments.callee.caller.toString());F.messageNum=this.getNextMessageNum();F.messageId=this.consoleId+F.messageNum;F.time=this.createLogTimeString();F.flags=A;F.caller=C;F.message=E;this.addLogEntry(F)};deCarta.Log.prototype.addFunctionEntry=function addFunctionEntry(){if(this.messageNum==0){this.initialize()}var F=new deCarta.LogEntry();var B=["debug"];if(arguments&&arguments.callee&&arguments.callee.caller){var C=this.getFunctionName(arguments.callee.caller.toString());var A=arguments.callee.caller.arguments;var E=[];E.push("entering function");E.push("# of args: "+A.length);for(var D=0;D<A.length;D++){if(D>0){E.push(A[D]);continue}else{E.push("the args are: "+A[D])}}}else{F.caller="unknown";F.message="arguments unknown"}F.messageNum=this.getNextMessageNum();F.time=this.createLogTimeString();F.flags=B;F.caller=C;F.message=E.join(", ");this.addLogEntry(F)};deCarta.Log.prototype.addLogEntry=function addLogEntry(A){this.history.push(A);if(this.isFilterFlagOn(A.flags)){this.console.innerHTML+=A.toHtmlString()}};deCarta.Log.prototype.setFilterFlags=function setFilterFlags(B,A){var D,C;var E=this.filterFlags.length;if(!A||A=="off"){for(D=0;D<E;D++){for(C=0;C<B.length;C++){if(this.filterFlags[D]==B[C]){this.filterFlags=this.filterFlags.slice(0,D).concat(this.filterFlags.slice(D,E-1));return true}}}return false}else{for(D=0;D<B.length;D++){for(C=0;C<E;C++){if(B[D]==this.filterFlags[C]){break}}if(C==E||E==0){this.filterFlags.push(B[D])}}return true}};deCarta.Log.prototype.isFilterFlagOn=function isFilterFlagOn(A){var D,C;var B=this.filterFlags.length;if(!B){return true}for(D=0;D<B;D++){for(C=0;C<A.length;C++){if(this.filterFlags[D]==A[C]){return true}}}return false};deCarta.Log.prototype.clearFilterFlags=function clearFilterFlags(){this.filterFlags=[]};deCarta.Log.prototype.logControl=function logControl(A){var C=true;var B;if(!A){return false}for(B=0;B<A.length;B++){switch(A[B].toLowerCase()){case"clear":this.console.innerHTML="";break;case"hide":this.console.style.visibility="hidden";break;case"show":this.console.style.visibility="visible";break;default:this.console.innerHTML+="Bad command received in logger: "+A[B]+"<br/>";C=false;break}}return C};deCarta.Log.prototype.getNextMessageNum=function(){return ++this.messageNum};deCarta.Log.prototype.getFunctionName=function getFunctionName(C){if(C.name){return C.name}var B=C.toString();var A=B.substring(B.indexOf("function")+8,B.indexOf("("));if(A){return A}return"anon"};deCarta.Log.prototype.createLogTimeString=function createLogTimeString(){var E=0;var G=":";var A=new Date();var D=[];D[E++]=A.getFullYear();D[E++]=G;var H=parseInt(A.getMonth(),10)+1;if(H.toString().length<2){D[E++]="0";D[E++]=H}else{D[E++]=H}D[E++]=G;var C=parseInt(A.getDate(),10);if(C.toString().length>1){D[E++]=C}else{D[E++]="0";D[E++]=C}D[E++]=G;var F=parseInt(A.getHours(),10);if(F.toString().length>1){D[E++]=F}else{D[E++]="0";D[E++]=F}D[E++]=G;var I=parseInt(A.getMinutes(),10);if(I.toString().length>1){D[E++]=I}else{D[E++]="0";D[E++]=I}D[E++]=G;var B=parseInt(A.getSeconds(),10);if(B.toString().length>1){D[E++]=B}else{D[E++]="0";D[E++]=B}return D.join("")};deCarta.log=function log(){};deCarta.Log.setupDefault=function setUpDefault(){deCarta.log=new deCarta.Log();deCarta.log.setFilterFlags(["debug"],"on")};function Map(p){if(!p){alert("must supply the map div to construct the new Map");return false}this.mapDiv=p;this.type="map";this.routePreference=new RoutePreference("Fastest",new UOM("MI"));var At=this;var AQ=undefined;var Ay=null;var Z=null;var h=null;var Ah,A,A4;var BJ=new XMLRequestFactory();var Az=null;var J=null;var AA=new Array();var I=new Array();var r=new Array();var z=new deCarta.LinkedList();var y=null;var k=0;var Av=0;var D=document.all;var Y="px";var AB=Credentials.imgPath+"tile.png";var AD=GLOBALS.STREET;var BL="server";var Aj=0;var AM=true;var A1=false;var AJ=0;var AH=0;var Ak=false;var An=false;var BC=0;var A9=0;var S=false;var AU=true;var Ac=new Date();var AL=new Date();var H=false;var AY=false;var A6=false;var AI=null;var n=null;var b=256;var K=b;var AW=0;var BA=0;var a=2;var AS=0;var AO=0;var BF=0;var i=0;var Ai=new PixelPoint(0,0);var A7=0;var A5=0;var Au=0;var As=0;var AV=0;var AT=0;var g=parseInt(p.style.height);var AG=parseInt(p.style.width);this.setMapStyle=function Ap(BO){Credentials.configuration=BO;if(Az!=null){Az=(new DOMParser()).parseFromString(Sarissa.serialize(Az),"text/xml");Az.setProperty("SelectionLanguage","XPath");Az.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var BN=Az.selectSingleNode("/xls:XLS/xls:RequestHeader");BN.setAttribute("configuration",BO);for(var BP=0;BP<BA;++BP){for(var BM=0;BM<AW;++BM){AA[BP][BM][1].src=AB;A0(AA[BP][BM][1],BO);AA[BP][BM][1].loader.src=AA[BP][BM][1].altSrc}}}};this.changeCurrentMapStyle=function(BM){Ap(BM)};this.reDrawMap=function o(){if(Az==null){return false}AI=At.getCenterPosition();var BM=Utilities.getRequestId();Az=BJ.createMapRequestDOM(AI,b,1,1,BM,Z.getGXConvertedZoomLevel(),null);u();JSRequest.send(Az,t);return true};this.addCopyrightMessage=function AP(BO,BN,BQ){var BM="decarta-copyright";var BP=BM;deCarta.styles.addDefaultClass(BM);Ay=document.createElement("DIV");Ay.id=BP;Ay.className=BM;if(BN&&BQ){Ay.style.top=BQ+Y;Ay.style.left=BN+Y}else{Ay.style.top=((parseInt(At.mapDiv.style.height))-20)+Y;Ay.style.left="1px"}Ay.innerHTML=BO;Utilities.setUnselectable(Ay);At.mapDiv.appendChild(Ay)};this.centerOnAddress=function(BP,BN,BM){u();var BO=Utilities.getRequestId();if(BN){I[BO]=BN}Az=BJ.createMapAddressRequestDOM(BP,b,1,1,BO,Z.getGXConvertedZoomLevel(),BM);JSRequest.send(Az,W)};this.centerOnPosition=function BK(BM,BO,BN){AI=BM;u();var BP=Utilities.getRequestId();if(BO&&BO!=null){I[BP]=BO}Az=BJ.createMapRequestDOM(BM,b,1,1,BP,Z.getGXConvertedZoomLevel(),BN);JSRequest.send(Az,AR)};this.panToPosition=function f(BS){var BM=BS.clone();var BP=At.getCenterPosition();var BR=this.getGXPixelPoint(BP);var BO=this.getGXPixelPoint(BM);var BN=new PixelPoint(Math.round(BR.x-BO.x),Math.round(BR.y-BO.y));if(BN.x==0&&BN.y==0){return }var BQ=Utilities.centerContextToBoundingBox(BP,Z.getRadius());if(BQ.extendedContains(BM)){X(BN.x,-1*BN.y)}else{this.centerOnPosition(BM)}};this.getCenterPosition=function E(){if(!AI){throw new Exception("Center Position not set");return null}var BO=Au+Ai.x;var BN=As+Ai.y;if(BO==0&&BN==0){return AI}var BR=AI.clone();var BS=Z.getGXConvertedZoomLevel();var BP=Utilities.radsPerPixelAtZoom(b,BS);var BV=Utilities.lat2pix(BR.lat,BP);var BW=Utilities.lon2pix(BR.lon,BP);var BT=BW-BO;var BQ=BV+BN;var BU=Utilities.pix2lat(BQ,BP);var BM=Utilities.pix2lon(BT,BP);return new Position(BU,BM)};this.addCustomInfoWindow=function j(BM){if(!Ah){Ah=O()}if(y){y.removeChild(Ah)}Ah=BM.html;Ah.id="decarta-bubble";Ah.type="custom";Ah.offX=BM.xOffset;Ah.offY=BM.yOffset;if(y){y.appendChild(Ah)}A.style.position="absolute";A4.style.zIndex=99999;Ah.appendChild(A4);Ah.appendChild(A);if(BM.icon){A4.src=BM.icon.src;A4.style.top=BM.icon.anchorY+Y;A4.style.left=BM.icon.anchorX+Y;if(BM.icon.height){A4.style.height=BM.icon.height+Y}if(BM.icon.width){A4.style.width=BM.icon.width+Y}if(Utilities.ie6&&A4.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(A4)}}};this.addAndCenterOnPin=function(BM){this.addPin(BM);this.panToPosition(BM.position)};this.addPin=function Aq(BM){if(AI==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().");return false}BM.map=At;z.add(BM);BM.setPosition(BM.position);y.appendChild(BM.pinImg);if(BM.pinTxt){y.appendChild(BM.pinTxt)}};this.getPins=function(){return z.returnAsArray()};this.hidePins=function(){z.operateOnData(function(BM){if(!BM){return }BM.pinImg.style.display="none";BM.pinTxt.style.display="none"})};this.showPins=function(){z.operateOnData(function(BM){BM.pinImg.style.display="block";BM.pinTxt.style.display="block"})};this.removeAllPins=function(){var BM;while(z.length>0){BM=z.remove();if(D){Utilities.purge(BM.pinImg)}y.removeChild(BM.pinImg);BM.pinImg=null;if(BM.pinTxt){if(D){Utilities.purge(BM.pinTxt)}y.removeChild(BM.pinTxt);BM.pinTxt=null}}};this.removePin=function Af(BN){var BM=null;try{BM=z.remove(BN)}catch(BO){return }if(!BM){return }if(BM.pinTxt){Utilities.purge(BM.pinTxt);y.removeChild(BM.pinTxt);BM.pinTxt=null}Utilities.purge(BM.pinImg);y.removeChild(BM.pinImg)};this.removePinById=function(BO){try{var BM=z.removeById("id",BO)}catch(BN){return }if(!BM){return }if(BM.pinTxt){Utilities.purge(BM.pinTxt);y.removeChild(BM.pinTxt);BM.pinTxt=null}Utilities.purge(BM.pinImg);y.removeChild(BM.pinImg)};this.removePinsById=function(BQ){var BM=null;var BO=null;var BN;try{BM=z.removeByKey("id",BQ)}catch(BP){return }if(!BM){return }for(BN=0,BO=BM.length;BN<BO;BN++){if(BM[BN].pinTxt){Utilities.purge(BM[BN].pinTxt);y.removeChild(BM[BN].pinTxt);BM[BN].pinTxt=null}Utilities.purge(BM[BN].pinImg);y.removeChild(BM[BN].pinImg)}};this.setDragEnabled=function(BM){if(!"boolean"==(typeof BM)){throw new Exception("Map.setDragEnabled requires boolean")}AM=BM};this.setDoubleClickRecenteringEnabled=function Ax(BM){if(!"boolean"==(typeof BM)){throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean")}AU=BM};this.setDoubleClickRecenterAndZoom=function(BM){if(!"boolean"==(typeof BM)){alert("Map.setDoubleClickRecenterAndZoom requires boolean")}AY=BM};this.addOverlay=function m(BM){BM.map=At;BJ.overlays.push(BM);Ab()};this.redraw=function v(){Ab()};this.removeOverlay=function A8(BM){BM.map=null;var BO=new Array();for(var BN=0;BN<BJ.overlays.length;BN++){if(BJ.overlays[BN]&&!BJ.overlays[BN].equals(BM)){BO.push(BJ.overlays[BN])}}BJ.overlays=BO;if(BO.length==0){Ab(true)}else{Ab()}};this.removeOverlayById=function Q(BO){var BN=new Array();for(var BM=0;BM<BJ.overlays.length;BM++){if(BJ.overlays[BM]&&BJ.overlays[BM].id!=(BO)){BN.push(BJ.overlays[BM])}else{BJ.overlays[BM].map=null}}BJ.overlays=BN;if(BN.length==0){Ab(true)}else{Ab()}};this.removeAllOverlays=function s(){if(BJ&&BJ.overlays&&(BJ.overlays.length<=0)){return }BJ.overlays=[];Ab(true)};this.setShapeRendering=function(BM){if(!BM||!BM=="client"||!BM=="server"){alert(" map.setShapeRendering() error:\n\n use 'client' or 'server'")}if(BM=="server"){AZ()}else{Ab()}BL=BM;BJ.rendering=BM};this.getShapeRendering=function(){return BL};this.panWest=function(){X(GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panEast=function(){X(-GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panNorth=function(){X(0,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouth=function(){X(0,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthEast=function(){X(-GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthEast=function(){X(-GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthWest=function(){X(GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthWest=function(){X(GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.addScaleBar=function L(BN){AQ=BN;AQ.map=At;AQ.calculate();var BM=AQ.getDiv();BM.style.position="absolute";BM.style.top=((parseInt(At.mapDiv.style.height))-31)+Y;BM.style.left=((parseInt(At.mapDiv.style.width))-122)+Y;BM.style.zIndex=9999;At.mapDiv.appendChild(BM)};this.addMapTypeController=function Al(BO){var BN="decarta-mapTypeController";var BM=BN;deCarta.styles.addDefaultClass(BN);if(!BO){alert("error adding mapTypeController to map");return false}h=document.createElement("DIV");h.id=BM;h.className=BN;h.style.top="5px";h.style.left=((parseInt(At.mapDiv.style.width))-207)+Y;mapReference=At;h.innerHTML="<A HREF=# onclick='mapReference.setMapType(GLOBALS.STREET); return false;'>STREET</A> | <A HREF=# onclick='mapReference.setMapType(GLOBALS.HYBRID); return false;'>HYBRID</A> | <A HREF=# onclick='mapReference.setMapType(GLOBALS.SATELLITE); return false;'>SATELLITE</A>";h.onclick=function(BP){BP=BP||event;BP.stoppropagation?BP.stoppropagation():BP.cancelBubble=true};At.mapDiv.appendChild(h)};this.setMapType=function(BN){if(!(BN=="STREET"||BN=="HYBRID"||BN=="SATELLITE")){alert("unsupported mapType\n\nUse 'STREET' || 'HYBRID' || 'SATELLITE'");return false}AD=BN;Credentials.mapType=AD;if(AA.length>0){if(BN=="STREET"){for(var BO=0;BO<BA;++BO){for(var BM=0;BM<AW;++BM){AA[BO][BM][0].src=AB;AA[BO][BM][1].src=AB;A0(AA[BO][BM][1],Credentials.configuration);AA[BO][BM][1].loader.src=AA[BO][BM][1].altSrc}}}else{if(BN=="HYBRID"){for(var BO=0;BO<BA;++BO){for(var BM=0;BM<AW;++BM){AA[BO][BM][0].src=AB;AA[BO][BM][1].src=AB;AA[BO][BM][0].src=AA[BO][BM][0].altSrc;A0(AA[BO][BM][1],Credentials.transparentConfiguration);AA[BO][BM][1].loader.src=AA[BO][BM][1].altSrc}}}else{if(BN=="SATELLITE"){for(var BO=0;BO<BA;++BO){for(var BM=0;BM<AW;++BM){AA[BO][BM][1].loader.src=AB;AA[BO][BM][0].src=AB;AA[BO][BM][0].src=AA[BO][BM][0].altSrc;AA[BO][BM][1].src=AB}}}}}}};this.setRoutePreference=function(BM){At.routePreference=BM};this.getRoutePreference=function(){return At.routePreference};this.routeMap=function AX(BO,BM){var BN=Utilities.getRequestId();I[BN]=BM;if(At.routePreference.alternateRoutes>0){alert("4.3.4 release note:\n\n alternate routes is only available through RouteQuery for use with client side shape rendering.");return }J=BJ.createRouteGeometryRequestDOM(BO,BN,At.routePreference);JSRequest.send(J,BE)};this.routeMapById=function(BO,BM){var BN=Utilities.getRequestId();I[BN]=BM;if(At.routePreference.alternateRoutes>0){alert("4.3.4 release note:\n\n alternate routes is only available through RouteQuery for use with client side shape rendering.");return }J=BJ.createRouteGeometryByIdRequestDOM(BO,BN,null,false);JSRequest.send(J,BE)};this.clearRoute=function C(){if(Az==null){return false}BJ.routeID=null;var BN=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(Sarissa.serialize(Az)),"text/xml");BN.setProperty("SelectionLanguage","XPath");BN.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var BM=BN.selectSingleNode("//xls:PortrayMapRequest");try{BM.removeChild(BM.selectSingleNode("//xls:Overlay"))}catch(BO){}return true};this.addZoomController=function(BM){Z=BM;Z.initialize(At)};this.getZoomController=function(){return Z};this.resize=function P(BM,BN){At.mapDiv.style.height=parseInt(BM)+Y;At.mapDiv.style.width=parseInt(BN)+Y;S=true;if(y){At.reDrawMap()}};this.getBoundingBox=function BG(){var BY=Z.getGXConvertedZoomLevel();var BR=Utilities.radsPerPixelAtZoom(b,BY);var BV=At.getCenterPosition();var BQ=Utilities.lat2pix(BV.lat,BR);var BM=BQ+(BA*b/2);var BO=BQ-(BA*b/2);var BU=Utilities.pix2lat(BM,BR);var BT=Utilities.pix2lat(BO,BR);var BS=Utilities.lon2pix(BV.lon,BR);var BN=BS+(AW*b/2);var BP=BS-(AW*b/2);var BX=Utilities.pix2lon(BN,BR);var BW=Utilities.pix2lon(BP,BR);return new BoundingBox(new Position(BT,BW),new Position(BU,BX))};this.getBoundingBoxViewable=function l(){var BU=At.getGXPixelPoint(At.getCenterPosition());var BS=parseInt(At.mapDiv.style.height)/2;var BP=parseInt(At.mapDiv.style.width)/2;var BM=new PixelPoint(BU.x+BP,BU.y+BS);var BT=new PixelPoint(BU.x-BP,BU.y-BS);var BN=Utilities.radsPerPixelAtZoom(b,Z.getGXConvertedZoomLevel());var BO=new Position(Utilities.pix2lat(BM.y,BN),Utilities.pix2lon(BM.x,BN));var BQ=new Position(Utilities.pix2lat(BT.y,BN),Utilities.pix2lon(BT.x,BN));var BR=new BoundingBox(BQ,BO);return BR};this.getGridSize=function(){return BA+" "+AW};this.positionToMapLayerPixel=function B(BT){if(!BT||!AI){throw new Exception("Map.positionToMapLayerPixel: bad input: "+BT)}var BP=new PixelPoint(Au,As);var BQ=new Position(this.getBoundingBoxViewable().maxPosition.lat,this.getBoundingBoxViewable().minPosition.lon);var BO=this.getGXPixelPoint(BQ);var BR=this.getGXPixelPoint(BT);var BN=BO.x-BR.x;var BM=BO.y-BR.y;var BS=new PixelPoint(-BP.x-Math.round(BN),-BP.y+Math.round(BM));return BS};this.setTileBuffer=function(BM){if(BM){a=2}else{a=1}};this.setTileBorder=function(BN){if(BN){Aj=1}else{Aj=0}for(var BO=0;BO<BA;++BO){for(var BM=0;BM<AW;++BM){AA[BO][BM][0].border=Aj;AA[BO][BM][1].border=Aj}}};this.getTileSize=function(){return b};this.setTileSize=function G(BM){b=parseInt(BM,10);K=b;S=true};this.setCompatibility=function(BN,BM){switch(BN){case"restrictDragToDiv":if(BM){this.addEventListener("mouseout",U)}else{this.clearListeners("mouseout")}break;default:throw new Exception("Map.setCompatibility: illegal flag: "+BN.toString()+" passed in as argument.")}};function O(){try{var BO="decarta-bubble";var BN=BO;var BS="decarta-bubbleContent";var BQ=BS;var BM="decarta-close";var BP=BM;deCarta.styles.addDefaultClass(BO);deCarta.styles.addDefaultClass(BS);deCarta.styles.addDefaultClass(BM);Ah=document.createElement("div");Ah.type="default";Ah.id=BN;Ah.className=BO;A4=document.createElement("img");A4.src=Credentials.imgPath+"close.png";A4.id=BP;A4.className=BM;A4.onclick=function(BT){BT=BT||event;BT.stoppropagation?BT.stoppropagation():BT.cancelBubble=true;At.getBubble().style.display="none"};Ah.appendChild(A4);A=document.createElement("div");A.id=BQ;A.className=BS;Ah.appendChild(A);if(y!=null){y.appendChild(Ah)}}catch(BR){alert("Map.initBubble\n\n"+BR.message)}}this.addEventListener=function(BO,BP){var BN=false;for(var BM=0;BM<r.length;BM++){if(r[BM]==BO){r[BO]=BP;BN=true;break}}if(!BN){r.push(BO);r[BO]=BP}};this.clearInstanceListeners=function(){for(var BM=0;BM<r.length;BM++){r[r[BM]]=null;r[BM]=null}};this.clearListeners=function(BN){for(var BM=0;BM<r.length;BM++){if(r[BM]==BN){r[r[BM]]=null}}r[BM]=null};function Aa(BO){var BN;var BM=BO?BO:window.event;if(BM.target){BN=BM.target}else{if(BM.srcElement){BN=BM.srcElement}}if(BN.nodeType==3){BN=BN.parentNode}if(BN&&BN.id&&(BN.id.substring(0,9)=="decarta-z")){return }BO=BO||event;BO.stoppropagation?BO.stoppropagation():BO.cancelBubble=true;if(BO.type=="mouseup"){U(BO);AL=new Date()}else{if(BO.type=="click"&&((AL-Ac)<300)){c(BO)}else{if(BO.type=="dblclick"){AE(BO)}}}}function c(BR){At.mapDiv.style.cursor="pointer";At.mapDiv.unselectable="on";var BT=(D?event.clientY:BR.clientY)-Utilities.getAbsoluteTop(y)+Utilities.getScrollTop();var BO=(D?event.clientX:BR.clientX)-Utilities.getAbsoluteLeft(y)+Utilities.getScrollLeft();var BV=At.getGXPixelPoint(n);var BW=BV.x-(parseInt(At.mapDiv.style.width)/2);var BX=BV.y+(parseInt(At.mapDiv.style.height)/2);var BQ=new PixelPoint(BW,BX);var BU=new PixelPoint(BQ.x+BO,BQ.y-BT);var BP=Utilities.radsPerPixelAtZoom(b,Z.getGXConvertedZoomLevel());var BS=Utilities.pix2lat(BU.y,BP);var BM=Utilities.pix2lon(BU.x,BP);var BN=new Position(BS,BM);if(r.rightclick&&(D&&event.button==2)||(!D&&BR.which==3)){r.rightclick(BN);return false}if(r.click&&BR.type=="click"){r.click(BN)}if(r.dblclick&&BR.type=="dblclick"){r.dblclick(BN)}}function AF(BM){Ac=new Date();if((D&&event.button==2)||(!D&&BM.which==3)){if(r.rightclick){c(BM)}}if(!AM){U();return false}A1=true;At.mapDiv.style.cursor="move";AJ=D?event.clientX:BM.clientX;AH=D?event.clientY:BM.clientY;document.body.onmousemove=T;return false}function U(BM){A1=false;At.mapDiv.style.cursor="default";document.body.onmousemove=null;if(A6&&r.moveend){r.moveend();A6=false}if(AQ){AQ.calculate()}return false}function AE(BR){H=true;if(r.dblclick){c(BR)}if(!AU){return false}var BS=D?event.clientX:BR.clientX;var BQ=D?event.clientY:BR.clientY;var BN=Utilities.getAbsoluteLeft(At.mapDiv)-Utilities.getScrollLeft();var BM=Utilities.getAbsoluteTop(At.mapDiv)-Utilities.getScrollTop();var BP=(parseInt(BS-BN)-Math.round(parseInt(At.mapDiv.style.width)/2))*-1;var BO=(parseInt(BQ-BM)-Math.round(parseInt(At.mapDiv.style.height)/2))*-1;X(BP,BO)}function T(BO){if(!A6){if(r.movestart){r.movestart()}}A6=true;if(!A1){return false}var BN=(D?event.clientX:BO.clientX)-AJ;var BM=(D?event.clientY:BO.clientY)-AH;AV+=BN;AT+=BM;if(Math.abs(AV)>K||Math.abs(AT)>K){BH()}Au+=BN;As+=BM;Ae(Au,As);AJ=D?event.clientX:BO.clientX;AH=D?event.clientY:BO.clientY;return false}function d(BO){if(!BO){BO=window.event}var BN=(window.event)?BO.srcElement:BO.target;var BM=(BO.relatedTarget)?BO.relatedTarget:BO.toElement;if(!BM||(BM.id==BN.id)){return }if(r.mouseout){r.mouseout()}}this.getBubble=function(){return Ah};this.getBubbleContent=function(){return A};this.getBubbleClose=function(){return A4};this.getChooser=function(){return h};this.getCopyright=function(){return Ay};this.getTileDiv=function(){return y};this.getZoomLck=function(){return Ak};this.hidePinsBeforeZoom=function AC(){z.operateOnData(function(BM){if(BM){BM.zoomHide()}})};this.showPinsAfterZoom=function Ao(){z.operateOnData(function(BM){if(BM){BM.zoomShow()}})};function A3(){z.operateOnData(function(BM){if(!BM){return }BM.setPosition(BM.position);BM.hideInfoWindow()});At.showPinsAfterZoom()}this.zoomMap=function Ar(BM){if(Az==null){alert("Map not yet initialized.\nMap must be initialized before zooming.");return false}if(Ak){return false}Ak=true;var BO=At.getCenterPosition();var BN=Z.getGXConvertedZoomLevel();Z.setZoomLevel(BM);var BM=Z.getGXConvertedZoomLevel();Az=BJ.zoomMapRequestDOM(Az,0,0,0,0,BM,BN,BO,(Z.getRadiusX()*1000/AW));u();JSRequest.send(Az,R)};function Aw(){return false}this.getGXPixelPoint=function(BP){var BN=Utilities.radsPerPixelAtZoom(b,Z.getGXConvertedZoomLevel());var BO=Utilities.lat2pix(BP.lat,BN);var BM=Utilities.lon2pix(BP.lon,BN);return new PixelPointDP(BM,BO)};this.setCountryCode=function(BM){if(!BM){alert("error calling Map.setCountryCode()");return false}Credentials.ISOCountryCode=BM};function A0(BS,BO){var BR=BS.altSrc;var BT="CONFIG=";if(BR.indexOf(BT)>0){var BM=BR.indexOf(BT);var BP=BR.indexOf("&",BM);var BU=BR.substring(BM,BP);BS.altSrc=BR.replace(BU,BT+BO)}else{var BQ="&N=";BS.altSrc=BR.replace(BQ,"&"+BT+BO+BQ)}var BN=BS.altSrc;if(AD=="STREET"){BS.altSrc=(BN).replace("FORMAT=PNG","FORMAT=GIF")}else{BS.altSrc=(BN).replace("FORMAT=GIF","FORMAT=PNG")}BS.src=BS.altSrc}function t(BP){var BS=Sarissa.getDomDocument();BS=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(BP),"text/xml");BS.setProperty("SelectionLanguage","XPath");BS.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BS.selectNodes("//xls:Error").length>0){throw new Exception("redrawMapcallback error Message:\n\n\n"+(BS.selectNodes("//@message"))[0].value);return false}AI=new Position(BS.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);n=new Position(BS.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var BO=BS.selectSingleNode("//xls:Pan[@direction='N']");var BR=BS.selectSingleNode("//xls:Pan[@direction='E']");Ai.x=parseFloat(BR.getAttribute("numTiles"))*b;Ai.y=-(parseFloat(BO.getAttribute("numTiles"))*b);var BN=BS.selectSingleNode("//xls:Radius");Z.setRadius((parseFloat(Sarissa.getText(BN))/1000)*AW);var BU=BS.selectNodes("//xls:URL");N(BU);var BV=parseInt(At.mapDiv.style.height);var BM=parseInt(At.mapDiv.style.width);var BQ=g-BV;var BT=AG-BM;if(At.getCopyright()){At.getCopyright().style.top=parseInt(At.getCopyright().style.top)-BQ+Y}if(At.getChooser()){At.getChooser().style.left=parseInt(At.getChooser().style.left)-BT+Y}g=BV;AG=BM;A3();Ab()}function BE(BP){var BU=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(BP),"text/xml");BU.setProperty("SelectionLanguage","XPath");BU.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BU.selectNodes("//xls:Error").length>0){var BR=Sarissa.getText(BU.selectSingleNode("//xls:Response/@requestID"));if(I[BR]){I[BR](null);I[BR]=null;return }else{return }}u();var BN=BU.selectSingleNode("//xls:RouteID");var BO=(BU.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data;var BQ=(BU.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data;var BW=new BoundingBox(new Position(BO),new Position(BQ));var BS=BW.getRadius();Z.setRadius(BS);AI=BW.getCenterPosition();var BT=Z.getZoomLevelToFitBoundingBox(BW);Z.setZoomLevel(BT);var BM=BJ.createCenterContext(BW.getCenterPosition(),Z.getRadius());Az=BJ.createRouteMapDOM(BM,BN,Utilities.getRequestId(),b,1,1,Z.getGXConvertedZoomLevel(),At.routePreference);var BV=Utilities.parseRoutes(BU);var BR=Sarissa.getText(BU.selectSingleNode("//xls:Response/@requestID"));if(I[BR]){I[BR](BV);I[BR]=null}JSRequest.send(Az,AR)}function Ag(BP){var BO=Sarissa.getDomDocument();BO=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(BP),"text/xml");BO.setProperty("SelectionLanguage","XPath");BO.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BO.selectNodes("//xls:Error").length>0){throw new Exception("routeMapCallback error Message:\n\n\n"+(BO.selectNodes("//@message"))[0].value);return false}AI=new Position(BO.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);n=new Position(BO.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var BM=BO.selectSingleNode("//xls:Pan[@direction='N']");var BR=BO.selectSingleNode("//xls:Pan[@direction='E']");Ai.x=parseFloat(BR.getAttribute("numTiles"))*b;Ai.y=-(parseFloat(BM.getAttribute("numTiles"))*b);var BQ=BO.selectSingleNode("//xls:Radius");Z.setRadius((parseFloat(Sarissa.getText(BQ))/1000)*AW);var BN=BO.selectNodes("//xls:URL");N(BN);A3()}function W(BT){var BY=Sarissa.getDomDocument();BY=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(BT),"text/xml");BY.setProperty("SelectionLanguage","XPath");BY.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BY.selectNodes("//xls:Error").length>0){throw new Exception("centerOnAddressCallback error Message:\n\n\n"+(BY.selectNodes("//@message"))[0].value);return false}AI=new Position(BY.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);n=new Position(BY.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var BR=BY.selectSingleNode("//xls:Pan[@direction='N']");var BW=BY.selectSingleNode("//xls:Pan[@direction='E']");Ai.x=parseFloat(BW.getAttribute("numTiles"))*b;Ai.y=-(parseFloat(BR.getAttribute("numTiles"))*b);var BO=BY.selectSingleNode("//xls:Radius");Z.setRadius((parseFloat(Sarissa.getText(BO))/1000)*AW);var BZ=BY.selectNodes("//xls:URL");N(BZ);try{var BP=Sarissa.getText(BY.selectSingleNode("//xls:freeFormAddress"));if(BP==""){BP="NO ADDRESS FOUND"}var BS=new FreeFormAddress(BP);A3();var BU=Sarissa.getText(BY.selectSingleNode("//xls:Response/@requestID"));if(I[BU]){I[BU](BS,At.getCenterPosition());I[BU]=null}var BM=BY.selectSingleNode("//xls:CenterContext");Az=(new DOMParser()).parseFromString(Sarissa.serialize(Az),"text/xml");Az.setProperty("SelectionLanguage","XPath");Az.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var BX=Az.selectSingleNode("//xls:CenterAddress");var BQ=Az.selectSingleNode("//xls:Output");BQ.removeChild(BX);var Ba=Az.selectSingleNode("//xls:TileGrid");var BN=BM.cloneNode(true);BQ.insertBefore(BN,Ba)}catch(BV){alert("Error updating the request center context from the response for subsequent requests.\n\n"+BV.name+"\n\n"+BV.message)}}function AR(BQ){var BO=Sarissa.getDomDocument();BO=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(BQ),"text/xml");BO.setProperty("SelectionLanguage","XPath");BO.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BO.selectNodes("//xls:Error").length>0){throw new Exception("centerOnPositionCallback error Message:\n\n\n"+(BO.selectNodes("//@message"))[0].value);return false}AI=new Position(BO.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);n=new Position(BO.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var BM=BO.selectSingleNode("//xls:Pan[@direction='N']");var BS=BO.selectSingleNode("//xls:Pan[@direction='E']");Ai.x=parseFloat(BS.getAttribute("numTiles"))*b;Ai.y=-(parseFloat(BM.getAttribute("numTiles"))*b);var BR=BO.selectSingleNode("//xls:Radius");Z.setRadius((parseFloat(Sarissa.getText(BR))/1000)*AW);var BN=BO.selectNodes("//xls:URL");N(BN);A3();var BP=Sarissa.getText(BO.selectSingleNode("//xls:Response/@requestID"));if(I[BP]&&I[BP]!=null){I[BP](At.getCenterPosition());I[BP]=null}}function R(BP){var BO=Sarissa.getDomDocument();BO=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(BP),"text/xml");BO.setProperty("SelectionLanguage","XPath");BO.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BO.selectNodes("//xls:Error").length>0){throw new Exception("zoomMapCallback error Message:\n\n\n"+(BO.selectNodes("//@message"))[0].value);return false}AI=new Position(BO.selectSingleNode("//xls:GridLayer[@name='globexplorer']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);n=new Position(BO.selectSingleNode("//xls:GridLayer[@name='deCarta']/../xls:CenterContext/xls:CenterPoint/gml:pos/text()").data);var BM=BO.selectSingleNode("//xls:Pan[@direction='N']");var BR=BO.selectSingleNode("//xls:Pan[@direction='E']");Ai.x=parseFloat(BR.getAttribute("numTiles"))*b;Ai.y=-(parseFloat(BM.getAttribute("numTiles"))*b);var BQ=BO.selectSingleNode("//xls:Radius");Z.setRadius((parseFloat(Sarissa.getText(BQ))/1000)*AW);var BN=BO.selectNodes("//xls:URL");N(BN);Ak=false;A3();if(r.zoomend){r.zoomend()}}function w(BN){var BM;if(D){BM=window.event.srcElement}else{BM=BN.currentTarget}BM.src=Credentials.errorTile}function N(BW){if(AQ){AQ.calculate()}var BR=new URL(Sarissa.getText(BW[1]),Sarissa.getText(BW[0]));var BO=Math.floor(AW/2);var BM=Math.floor(BA/2);var BY=[];var BT=0;for(var BU=0;BU<BA;BU++){for(var BV=0;BV<AW;BV++){var BP=(Math.abs((BU-BM))+Math.abs(BV-BO));var BQ=q(BR.deCartaURL,(BU-BM)*-1,BV-BO);var BX=q(BR.globeExplorerURL,(BU-BM)*-1,BV-BO);var BN=new URL(BX,BQ);BN.x=BV;BN.y=BU;BN.distanceFromCenter=BP;BY[BT]=BN;BT++}}F(BY);for(var BS=0;BS<BY.length;BS++){Am(BY[BS].x,BY[BS].y,BY[BS])}AV-=Ai.x;AT-=Ai.y;Au-=Ai.x;As-=Ai.y;Ae(Au,As);Ab()}function q(BN,BS,BR){var BO=BN.substring(0,BN.indexOf("&N="));var BQ=BN.substring(BN.indexOf("&N="));var BM=parseInt(BQ.substring(BQ.indexOf("=")+1,BQ.indexOf("&E=")));var BP=parseInt(BQ.substring(BQ.indexOf("&E=")+3));BO+="&N="+(BM+BS)+"&E="+(BP+BR);return BO}function F(BO){for(var BN=1;BN<BO.length;BN++){for(var BM=0;BM<BO.length-1;BM++){if(BO[BM].distanceFromCenter>BO[BM+1].distanceFromCenter){BB(BO,BM,BM+1)}}}}function BB(BN,BP,BM){var BO;BO=BN[BP];BN[BP]=BN[BM];BN[BM]=BO}function Am(BM,BO,BN){if(AD=="SATELLITE"){AA[BO][BM][0].style.zIndex=50;AA[BO][BM][1].style.zIndex=100;AA[BO][BM][0].style.top=parseInt(AA[BO][BM][1].style.top)+Y;AA[BO][BM][0].style.left=parseInt(AA[BO][BM][1].style.left)+Y;AA[BO][BM][0].src=BN.getGlobeExplorerURL();AA[BO][BM][0].altSrc=BN.getGlobeExplorerURL();if(Utilities.ie6){AA[BO][BM][1].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+AB+"')"}AA[BO][BM][1].altSrc=BN.getDeCartaURL()}else{if(AD=="STREET"){AA[BO][BM][0].style.zIndex=50;AA[BO][BM][1].style.zIndex=100;AA[BO][BM][0].style.top=parseInt(AA[BO][BM][1].style.top)+Y;AA[BO][BM][0].style.left=parseInt(AA[BO][BM][1].style.left)+Y;AA[BO][BM][0].altSrc=BN.getGlobeExplorerURL();AA[BO][BM][1].src=BN.getDeCartaURL();AA[BO][BM][1].altSrc=BN.getDeCartaURL()}else{if(AD=="HYBRID"){AA[BO][BM][0].style.zIndex=1;AA[BO][BM][0].style.top=parseInt(AA[BO][BM][1].style.top)+Y;AA[BO][BM][0].style.left=parseInt(AA[BO][BM][1].style.left)+Y;AA[BO][BM][0].src=BN.getGlobeExplorerURL();AA[BO][BM][0].altSrc=BN.getGlobeExplorerURL();AA[BO][BM][1].zIndex=10;AA[BO][BM][1].altSrc=BN.getDeCartaURL();AA[BO][BM][1].loader.src=AA[BO][BM][1].altSrc}}}}function u(){var BO;if(y){AN();if(!S){return }else{S=false}}var BY=At.mapDiv;var BS=parseInt(BY.style.height);var BP=parseInt(BY.style.width);if(AQ){var BM=AQ.getDiv();BM.style.position="absolute";BM.style.top=((parseInt(At.mapDiv.style.height))-31)+Y;BM.style.left=((parseInt(At.mapDiv.style.width))-122)+Y}BA=Math.ceil(BS/b)+a;if(BA%2==0){BA++}AW=Math.ceil(BP/b)+a;if(AW%2==0){AW++}if(!Z){Z=new ZoomController();At.addZoomController(Z);Z.hide()}BY.style.overflow="hidden";BY.style.position="relative";BY.style.zIndex=0;BY.style.unselectable="on";BY.oncontextmenu=Aw;BY.onmousedown=AF;BY.onmouseout=d;window.onmouseup=U;BY.onmouseup=Aa;BY.ondblclick=Aa;BY.onclick=Aa;BY.unselectable="on";for(BO=BY.childNodes.length-1;BO>=0;BO--){if(BY.childNodes.item(BO).id!="decarta-copyright"&&BY.childNodes.item(BO).id!="decarta-zoom"&&BY.childNodes.item(BO).id!="decarta-scaleBar"&&BY.childNodes.item(BO).id!="decarta-mapTypeController"){BY.removeChild(BY.childNodes.item(BO))}}y=document.createElement("div");y.id="decarta-tiles";y.style.position="absolute";y.style.left=0+Y;y.style.top=0+Y;y.style.zIndex=0;Utilities.setUnselectable(y);BY.appendChild(y);if(!Ah){O()}Ah.style.display="none";y.appendChild(Ah);if(z&&z.length>0){var BX=z.returnAsArray();var BW=BX.length;for(BO=0;BO<BW;BO++){y.appendChild(BX[BO].pinImg);if(BX[BO].pinTxt){y.appendChild(BX[BO].pinTxt)}}}A7=-((AW*b)-BP)/2;A5=-((BA*b)-BS)/2;var BT=A7;var BQ=A5;AA=new Array(BA);for(var BO=0;BO<BA;++BO){AA[BO]=new Array(AW)}for(var BU=0;BU<BA;++BU){for(var BV=0;BV<AW;++BV){if(BV==0){BT=A7}var BR=new Array();AA[BU][BV]=BR;var BN=document.createElement("IMG");BN.style.position="absolute";BN.style.visibility="visible";BN.id="decarta-SATTILE";BN.onerror=w;BN.style.zIndex=0;BN.unselectable="on";BN.style.width=b+Y;BN.style.height=b+Y;BN.style.left=BT+Y;BN.style.top=BQ+Y;BN.src=AB;y.appendChild(BN);var BZ=A2(BT,BQ);y.appendChild(BZ);BR[0]=BN;BR[1]=BZ;BT+=b}BQ+=b}}function AN(){y.style.left=0+Y;y.style.top=0+Y;var BN=A7;var BP=A5;At.hidePinsBeforeZoom();for(var BO=0;BO<BA;++BO){for(var BM=0;BM<AW;++BM){if(BM==0){BN=A7}AA[BO][BM][0].style.left=BN+Y;AA[BO][BM][0].style.top=BP+Y;AA[BO][BM][0].src=AB;AA[BO][BM][1].style.left=BN+Y;AA[BO][BM][1].style.top=BP+Y;AA[BO][BM][1].src=AB;BN+=b}BP+=b}Au=0;As=0;AJ=0;AH=0;A1=false;AV=0;AT=0;k=0;Av=0;AS=0;AO=0;BF=0;i=0}function A2(BM,BO){var BN=document.createElement("IMG");BN.style.position="absolute";BN.style.height=b+Y;BN.style.width=b+Y;BN.unselectable="on";BN.style.visibility="visible";BN.id="decarta-MAPTILE";BN.style.zIndex=30;BN.style.left=BM+Y;BN.style.top=BO+Y;BN.src=Credentials.imgPath+"x.gif";BN.loader=document.createElement("img");BN.loader.style.visibility="hidden";BN.loader.onload=function(){if(!BN.cleared){if(Utilities.ie6){BN.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')";BN.src=Credentials.imgPath+"x.gif"}else{BN.src=this.src}}};return BN}function BH(){var BN=0;var BP=0;if(AV<-K){BF++;for(var BM=0;BM<BA;++BM){BN=parseInt(AA[BM][Av][1].style.left)+(AW*b);AA[BM][Av][1].style.left=(BN)+Y;var BO=V(AA[BM][Av][1].altSrc);AA[BM][Av][1].altSrc=BO;BP=parseInt(AA[BM][Av][0].style.left)+(AW*b);AA[BM][Av][0].style.left=(BP)+Y;var BQ=V(AA[BM][Av][0].altSrc);AA[BM][Av][0].altSrc=BQ;if(AD=="HYBRID"){AA[BM][Av][1].src=AB;AA[BM][Av][0].src=AB;AA[BM][Av][1].loader.src=AA[BM][Av][1].altSrc;AA[BM][Av][0].src=AA[BM][Av][0].altSrc}else{if(AD=="SATELLITE"){AA[BM][Av][0].src=AB;AA[BM][Av][0].src=AA[BM][Av][0].altSrc}else{if(AD=="STREET"){AA[BM][Av][1].src=AB;AA[BM][Av][1].src=AA[BM][Av][1].altSrc}}}}Av=(Av+1)%AW;AV=AV+K;Ab()}else{if(AV>=K){i++;Av=(Av==0)?Av=(AW-1):--Av;for(var BM=0;BM<BA;++BM){BN=parseInt(AA[BM][Av][0].style.left)-(AW*b);AA[BM][Av][0].style.left=(BN)+Y;var BO=AK(AA[BM][Av][0].altSrc);AA[BM][Av][0].altSrc=BO;BP=parseInt(AA[BM][Av][1].style.left)-(AW*b);AA[BM][Av][1].style.left=(BP)+Y;var BQ=AK(AA[BM][Av][1].altSrc);AA[BM][Av][1].altSrc=BQ;if(AD=="HYBRID"){AA[BM][Av][1].src=AB;AA[BM][Av][0].src=AB;AA[BM][Av][1].loader.src=AA[BM][Av][1].altSrc;AA[BM][Av][0].src=AA[BM][Av][0].altSrc}else{if(AD=="SATELLITE"){AA[BM][Av][0].src=AB;AA[BM][Av][0].src=AA[BM][Av][0].altSrc}else{if(AD=="STREET"){AA[BM][Av][1].src=AB;AA[BM][Av][1].src=AA[BM][Av][1].altSrc}}}}AV=AV-K;Ab()}else{if(AT<-K){AO++;for(var BM=0;BM<AW;++BM){BN=parseInt(AA[k][BM][0].style.top)+(BA*b);AA[k][BM][0].style.top=(BN)+Y;var BO=BD(AA[k][BM][0].altSrc);AA[k][BM][0].altSrc=BO;BP=parseInt(AA[k][BM][1].style.top)+(BA*b);AA[k][BM][1].style.top=(BP)+Y;var BQ=BD(AA[k][BM][1].altSrc);AA[k][BM][1].altSrc=BQ;if(AD=="HYBRID"){AA[k][BM][1].src=AB;AA[k][BM][0].src=AB;AA[k][BM][1].loader.src=AA[k][BM][1].altSrc;AA[k][BM][0].src=AA[k][BM][0].altSrc}else{if(AD=="SATELLITE"){AA[k][BM][0].src=AB;AA[k][BM][0].src=AA[k][BM][0].altSrc}else{if(AD=="STREET"){AA[k][BM][1].src=AB;AA[k][BM][1].src=AA[k][BM][1].altSrc}}}}k=(k+1)%BA;AT=AT+K;Ab()}else{if(AT>=-K){AS++;k=(k==0)?k=(BA-1):--k;for(var BM=0;BM<AW;++BM){BN=parseInt(AA[k][BM][0].style.top)-(BA*b);AA[k][BM][0].style.top=(BN)+Y;var BO=BI(AA[k][BM][0].altSrc);AA[k][BM][0].altSrc=BO;BP=parseInt(AA[k][BM][1].style.top)-(BA*b);AA[k][BM][1].style.top=(BP)+Y;var BQ=BI(AA[k][BM][1].altSrc);AA[k][BM][1].altSrc=BQ;if(AD=="HYBRID"){AA[k][BM][1].src=AB;AA[k][BM][0].src=AB;AA[k][BM][1].loader.src=AA[k][BM][1].altSrc;AA[k][BM][0].src=AA[k][BM][0].altSrc}else{if(AD=="SATELLITE"){AA[k][BM][0].src=AB;AA[k][BM][0].src=AA[k][BM][0].altSrc}else{if(AD=="STREET"){AA[k][BM][1].src=AB;AA[k][BM][1].src=AA[k][BM][1].altSrc}}}}Ab();AT=AT-K}}}}}function BI(BN){var BQ=BN.substring(0,BN.indexOf("&N="));var BP=BN.substring(BN.indexOf("&N="));var BM=parseInt((BP.split("="))[1])+BA;var BO=parseInt((BP.split("="))[2]);BQ+="&N="+BM+"&E="+BO;return BQ}function BD(BN){var BQ=BN.substring(0,BN.indexOf("&N="));var BP=BN.substring(BN.indexOf("&N="));var BM=parseInt((BP.split("="))[1])-BA;var BO=parseInt((BP.split("="))[2]);BQ+="&N="+BM+"&E="+BO;return BQ}function V(BN){var BQ=BN.substring(0,BN.indexOf("&N="));var BP=BN.substring(BN.indexOf("&N="));var BM=parseInt((BP.split("="))[1]);var BO=parseInt((BP.split("="))[2])+AW;BQ+="&N="+BM+"&E="+BO;return BQ}function AK(BN){var BQ=BN.substring(0,BN.indexOf("&N="));var BP=BN.substring(BN.indexOf("&N="));var BM=parseInt((BP.split("="))[1]);var BO=parseInt((BP.split("="))[2])-AW;BQ+="&N="+BM+"&E="+BO;return BQ}function Ae(BM,BN){y.style.left=BM+Y;y.style.top=BN+Y}function X(BM,BN){if(An){return }if(BM>1){y.style.left=parseInt(y.style.left)+1+Y}else{if(BM<-1){y.style.left=parseInt(y.style.left)-1+Y}}if(BN>1){y.style.top=parseInt(y.style.top)+1+Y}else{if(BN<-1){y.style.top=parseInt(y.style.top)-1+Y}}An=true;M(BM,BN,true)}function M(BM,BQ,BP){if(BP){BC=BM;A9=BQ}var BO=Math.round(Math.abs(BC)*0.3);var BN=Math.round(Math.abs(A9)*0.3);if(BO>0||BN>0){if(BC<0){BC+=BO;AV-=BO;Au-=BO}else{if(BC>0){BC-=BO;AV+=BO;Au+=BO}}if(A9<0){A9+=BN;AT-=BN;As-=BN}else{if(A9>0){A9-=BN;AT+=BN;As+=BN}}Ae(Au,As);if(Math.abs(AV)>K||Math.abs(AT)>K){BH()}setTimeout(M,1)}else{if(r.moveend){r.moveend()}if(AQ){AQ.calculate()}if(H&&AY){At.getZoomController().zoomInOneLevel()}An=false;H=false;Ab()}}function Ad(){if(!At.getTileDiv()){return null}var BM;if(document.getElementById("canvas")){BM=document.getElementById("canvas");BM.style.position="relative";BM.style.zIndex=100;var BN=At.getTileDiv();BN.appendChild(BM)}else{BM=document.getElementsByTagName("body")[0].appendChild(document.createElement("canvas"));BM.id="canvas";if(typeof G_vmlCanvasManager!="undefined"){BM=G_vmlCanvasManager.initElement(BM)}BM.style.position="relative";BM.style.zIndex=100;var BN=At.getTileDiv();BN.appendChild(BM)}return BM}function AZ(){if(BL=="server"){return }var BN=Ad();var BM=BN.getContext("2d");BM.clearRect(0,0,BN.width,BN.height)}function Ab(Bh){var Bh=Bh||false;if(BL=="server"||!At.getTileDiv()){return }if(BJ.overlays.length==0&&!Bh){return }if(An){return }var BS=Ad();var Bo=At.getGridSize().split(" ");BS.width=parseInt(Bo[1])*b;BS.height=parseInt(Bo[0])*b;var Bb=Z.getGXConvertedZoomLevel();var Br=Utilities.radsPerPixelAtZoom(b,Bb);var BM=At.getBoundingBox();var BQ=new Position(BM.maxPosition.lat+" "+BM.minPosition.lon);var BN=Math.round(Utilities.lat2pix(BQ.lat,Br));var BP=Math.round(Utilities.lon2pix(BQ.lon,Br));var BO=At.mapDiv;var Bd=-(((parseInt(Bo[1])*b))-parseInt(BO.style.width))/2;var Bf=-(((parseInt(Bo[0])*b))-parseInt(BO.style.height))/2;var Be=At.getTileDiv();BS.style.top=Bf-parseInt(Be.style.top)+Y;BS.style.left=Bd-parseInt(Be.style.left)+Y;var Bj=BS.getContext("2d");Bj.lineCap="round";Bj.lineJoin="round";var BR=BJ.overlays;for(var Bc=0;Bc<BR.length;Bc++){Bj.beginPath();var Bk=BR[Bc].getFillColor();var Bi=BR[Bc].getBorderColor();var BT=BR[Bc].getStrokeOpacity();if(!BT){BT=BR[Bc].getOpacity()}var Bl=BR[Bc].getFillOpacity();if(!Bl){Bl=BR[Bc].getOpacity()}Bj.lineWidth=BR[Bc].getBorderWidth();var Bq=Bk.replace(")","");Bq=Bq.replace("(","");Bq=Bq.split(".");var Bt=Bi.replace(")","");Bt=Bt.replace("(","");Bt=Bt.split(".");Bj.fillStyle="rgba("+Bq[0]+","+Bq[1]+","+Bq[2]+",."+Bl+")";Bj.strokeStyle="rgba("+Bt[0]+","+Bt[1]+","+Bt[2]+",."+BT+")";if(BR[Bc].type=="polygon"){var Bu=BR[Bc].getPositions();var BZ=[];var BX=[];if(BR[Bc].getGeneralize()&&!BR[Bc].generalized[Z.getZoomLevel()]){Bu=Utilities.generalize(Bu,Z,10,b);BR[Bc].generalized[Z.getZoomLevel()]=Bu}else{if(BR[Bc].generalized[Z.getZoomLevel()]){Bu=BR[Bc].generalized[Z.getZoomLevel()]}}for(var Bm=0;Bm<Bu.length;Bm++){var Ba=(Bu[Bm]);var BW=Math.round(Utilities.lat2pix(Ba.lat,Br));var BY=Math.round(Utilities.lon2pix(Ba.lon,Br));BZ[Bm]=parseInt(BP-BY);BX[Bm]=parseInt(BN-BW);if(Bm==0){Bj.moveTo((BZ[Bm]*-1),(BX[Bm]))}else{Bj.lineTo((BZ[Bm]*-1),(BX[Bm]))}}Bj.fill();if(!D){Bj.stroke()}else{var BU=BZ.length;for(var Bm=0;Bm<BU;Bm++){if(Bm==0){Bj.moveTo((BZ[Bm]*-1),(BX[Bm]))}else{Bj.lineTo((BZ[Bm]*-1),(BX[Bm]))}}Bj.stroke()}}else{if(BR[Bc].type=="line"){Bj.lineWidth=BR[Bc].getWidth();Bj.strokeStyle=Bj.fillStyle;var Bu=BR[Bc].getPositions();if(BR[Bc].getGeneralize()&&!BR[Bc].generalized[Z.getZoomLevel()]){Bu=Utilities.generalize(Bu,Z,10,b);BR[Bc].generalized[Z.getZoomLevel()]=Bu}else{if(BR[Bc].generalized[Z.getZoomLevel()]){Bu=BR[Bc].generalized[Z.getZoomLevel()]}}for(var Bm=0;Bm<Bu.length;Bm++){var Ba=(Bu[Bm]);var BW=Math.round(Utilities.lat2pix(Ba.lat,Br));var BY=Math.round(Utilities.lon2pix(Ba.lon,Br));var Bp=parseInt(BP-BY);var Bn=parseInt(BN-BW);if(Bm==0){Bj.moveTo((Bp*-1),(Bn))}else{Bj.lineTo((Bp*-1),(Bn))}}Bj.stroke()}else{if(BR[Bc].type=="circle"){var Ba=BR[Bc].getPosition();var BW=Math.round(Utilities.lat2pix(Ba.lat,Br));var BY=Math.round(Utilities.lon2pix(Ba.lon,Br));var Bp=parseInt(BP-BY);var Bn=parseInt(BN-BW);var Bg=BR[Bc].getRadius().getDegrees();var Bs=Math.round(Utilities.lat2pix(Ba.lat+Bg,Br));var BV=parseInt(Bs-BW);Bj.arc((Bp*-1),Bn,Math.abs(BV),0,Math.PI*2,true);Bj.fill();if(!D){Bj.stroke()}else{Bj.arc((Bp*-1),Bn,Math.abs(BV),0,Math.PI*2,true);Bj.stroke()}}}}}}}Map.prototype.authenticate=function(B,A){if(!B||!A||B==""||A==""){throw new Exception("Error calling Map.authenticate(), bad params");return false}Credentials.clientName=B;Credentials.clientPassword=A};Map.prototype.setURL=function(A){Credentials.url=A};Map.prototype.setConfiguration=function(A){if(!A){alert("error calling Map.setConfiguration()");return false}Credentials.configuration=A};Map.prototype.setTransparentConfiguration=function(A){if(!A){alert("error calling Map.setTransparentConfiguration()");return false}Credentials.transparentConfiguration=A};function MapTypeController(){}deCarta.Math.MercatorSpherical=function MercatorSpherical(){var I=null;var F=null;var O=null;var P=null;function B(R){return(R*Math.PI/180)}function Q(R){return(R*180/Math.PI)}function L(S){var V=B(S);var T=Math.sin(V);var U=Math.log((1+T)/(1-T))/2;var R=Q(U);return R}function G(S){var V=B(S);var T=Math.exp(2*V);var U=Math.asin((T-1)/(T+1));var R=Q(U);return R}function N(){if(!I||(!F&&F!==0)||(!O&&O!==0)){return false}P=O/Math.abs(I.maxPosition.lon-I.minPosition.lon);return true}this.getBoundingBox=function H(){return I};this.setBoundingBox=function D(R){if(R.minPosition==undefined||R.maxPosition==undefined){throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid boundingBox of: "+R)}else{I=R}};this.getPixelHeight=function E(){return F};this.setPixelHeight=function A(R){var S=parseInt(R,10);if(isNaN(S)||(S<0)){throw new Exception("deCarta.Math.MercatorSpherical.setPixelHeight passed invalid height of: "+R)}else{F=S}};this.getPixelWidth=function C(){return O};this.setPixelWidth=function K(S){var R=parseInt(S,10);if(isNaN(R)||(R<0)){throw new Exception("deCarta.Math.MercatorSpherical.setPixelWidth passed invalid width of: "+S)}else{O=R}};this.positionToPixels=function M(U){if(!N()||!U||(!U.lat&&U.lat!=0)||(!U.lon&&U.lon!=0)){throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels")}var S=new PixelPoint(0,0);S.x=P*(I.minPosition.lon-U.lon)*-1;var T=L(I.maxPosition.lat)-L(U.lat);var R=L(I.maxPosition.lat)-L(I.minPosition.lat);S.y=F*T/R;return S};this.pixelsToPosition=function J(S){if(!N()||!S||(!S.x&&S.x!=0)||(!S.y&&S.y!=0)){throw new Exception("deCarta.Math.MercatorSpherical.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion")}var U=new Position(0,0);U.lon=I.minPosition.lon+(S.x/P);var R=L(I.maxPosition.lat)-L(I.minPosition.lat);var T=(S.y/F)*R;U.lat=G(L(I.maxPosition.lat)-T);return U}};deCarta.Math.MercatorEllipsoidal=function MercatorEllipsoidal(){var I=null;var F=null;var O=null;var P=null;function B(R){return(R*Math.PI/180)}function Q(R){return(R*180/Math.PI)}function L(U){var T=0.081819190842;var W=B(U);var R=T*Math.sin(W);var V=Math.log(Math.pow(((1-R)/(1+R)),T/2)*Math.tan((Math.PI/4)+(W/2)));var S=Q(V);return S}function G(T){var W=B(T);var V=Math.pow(Math.E,-W);var S=X();for(var U=0;U<6;U++){S=Y(S)}var R=Q(S);return R;function X(){return Math.PI/2-2*Math.atan(V)}function Y(d){var a=0.0818191908426216;var Z=a*Math.sin(d);var c=V*Math.pow((1-Z)/(1+Z),a/2);var b=(Math.PI/2)-(2*Math.atan(c));return b}}function N(){if(!I||(!F&&F!==0)||(!O&&O!==0)){return false}P=O/Math.abs(I.maxPosition.lon-I.minPosition.lon);return true}this.getBoundingBox=function H(){return I};this.setBoundingBox=function D(R){if(R.minPosition==undefined||R.maxPosition==undefined){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid boundingBox of: "+R)}else{I=R}};this.getPixelHeight=function E(){return F};this.setPixelHeight=function A(R){var S=parseInt(R,10);if(isNaN(S)||(S<0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelHeight passed invalid height of: "+R)}else{F=S}};this.getPixelWidth=function C(){return O};this.setPixelWidth=function K(S){var R=parseInt(S,10);if(isNaN(R)||(R<0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.setPixelWidth passed invalid width of: "+S)}else{O=R}};this.positionToPixels=function M(U){if(!N()||!U||(!U.lat&&U.lat!=0)||(!U.lon&&U.lon!=0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating positionToPixels")}var S=new PixelPoint(0,0);S.x=P*(I.minPosition.lon-U.lon)*-1;var T=L(I.maxPosition.lat)-L(U.lat);var R=L(I.maxPosition.lat)-L(I.minPosition.lat);S.y=F*T/R;return S};this.pixelsToPosition=function J(S){if(!N()||!S||(!S.x&&S.x!=0)||(!S.y&&S.y!=0)){throw new Exception("deCarta.Math.MercatorEllipsoidal.positionToPixels: need to setBoundingBox, setPixelHeight and setPixelWidth prior to calculating pixelsToPositiion")}var U=new Position(0,0);U.lon=I.minPosition.lon+(S.x/P);var R=L(I.maxPosition.lat)-L(I.minPosition.lat);var T=(S.y/F)*R;U.lat=G(L(I.maxPosition.lat)-T);return U}};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 pointInPolygon(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 headingFromPositions(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;this.callback;this.params}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=new Array();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.query=function(D,F){var E=Utilities.getRequestId();B[E]=F;var C=this.xmlRecFac.createPOIRequestDOM(D,E);JSRequest.send(C,A.queryCallback)};this.queryCallback=function(G){var P=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(G),"text/xml");if(document.all){P.setProperty("SelectionLanguage","XPath");P.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var K=new Array();if(P.selectNodes("//xls:Error").length>0){var J=Sarissa.getText(P.selectSingleNode("//xls:Response/@requestID"));B[J](null)}else{if(P.selectNodes("//xls:POI").length==0){var J=Sarissa.getText(P.selectSingleNode("//xls:Response/@requestID"));B[J](K)}else{var F=P.selectNodes("//xls:POIContext");for(var H=0;H<F.length;H++){var N=Sarissa.serialize((F[H]));var R=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(N),"text/xml");if(document.all){R.setProperty("SelectionLanguage","XPath");R.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var I="xls:";if(navigator.userAgent.toLowerCase().indexOf("safari")!=-1&&navigator.userAgent.toLowerCase().indexOf("3.1")==-1){I=""}try{var D=Sarissa.getText(R.selectSingleNode("//"+I+"POI/@POIName"));var S=Sarissa.getText(R.selectSingleNode("//"+I+"POI/@phoneNumber"))}catch(L){}var O=N.substring(N.indexOf("<gml:pos>")+"<gml:pos>".length,N.indexOf("</gml:pos>"));var M={};var Q;if(R.selectSingleNode("//"+I+"freeFormAddress")){Q=new FreeFormAddress(Sarissa.getText(R.selectSingleNode("//"+I+"freeFormAddress")))}else{Q=new Address();try{Q.buildingNumber=Sarissa.getText(R.selectSingleNode("//"+I+"Building/@number"))}catch(L){}try{Q.street=Sarissa.getText(R.selectSingleNode("//"+I+"Street"))}catch(L){}try{Q.countrySubdivision=Sarissa.getText(R.selectSingleNode("//"+I+"Place[@type='CountrySubdivision']"))}catch(L){}try{Q.countrySecondarySubdivision=Sarissa.getText(R.selectSingleNode("//"+I+"Place[@type='CountrySecondarySubdivision']"))}catch(L){}try{Q.municipality=Sarissa.getText(R.selectSingleNode("//"+I+"Place[@type='Municipality']"))}catch(L){}try{Q.postalCode=Sarissa.getText(R.selectSingleNode("//"+I+"PostalCode"))}catch(L){}}try{var C=R.selectNodes("//"+I+"POIInfo");for(var E=0;E<C.length;E++){M[C[E].getAttribute("name")]=C[E].getAttribute("value")}}catch(L){}K.push(new POI(D,new Position(O),Q,S,M))}var J=Sarissa.getText(P.selectSingleNode("//xls:Response/@requestID"));B[J](K)}}}}function Pin(D,E,O,Q){if(!D){throw new Exception("Error instantiating Pin, must at least provide a Position.");return false}var I=this;var G=new Array();this.type="pin";this.position=D;this.icon=Q||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");this.pinImg.style.position="absolute";this.pinImg.id=D.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=E||"";this.pinImg.xOff=(this.icon.anchorX*2)+2;if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(this.pinImg)}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";this.pinTxt.onmousedown=function(U){if((document.all&&event.button==2)||(!document.all&&U.which==3)){M(U)}else{L(U)}};this.pinTxt.onmouseover=function(U){T(U)};this.getZIndex=function H(){return(this.pinImg.style.zIndex)};this.setZIndex=function B(V){var U=parseInt(V,10);if(!isNaN(U)){this.pinImg.style.zIndex=U}else{this.pinImg.style.zIndex=0}};this.setId=function(U){this.id=U};this.getId=function(){return this.id};this.setCursorStyle=function(U){this.pinImg.style.cursor=U;this.pinTxt.style.cursor=U};this.getCursorStyle=function(){return this.pinImg.style.cursor};this.setIcon=function(U){I.pinImg.src=U.src;if(I.icon.anchorY==U.anchorY&&I.icon.anchorX==U.anchorX&&U._previousY&&U._previousX){I.pinImg.style.top=(parseInt(I.pinImg.style.top)+U._previousY-U.anchorY)+"px";I.pinImg.style.left=(parseInt(I.pinImg.style.left)+U._previousX-U.anchorX)+"px"}else{I.pinImg.style.top=(parseInt(I.pinImg.style.top)+I.icon.anchorY-U.anchorY)+"px";I.pinImg.style.left=(parseInt(I.pinImg.style.left)+I.icon.anchorX-U.anchorX)+"px"}I.pinImg.style.width=U.width+"px";I.pinImg.style.height=U.height+"px";I.icon=U;if(U.overlay.text!=""){I.pinTxt.innerHTML=this.icon.overlay.text;I.pinTxt.style.position="absolute";if(U.overlay.className){I.pinTxt.style.className=U.overlay.className}if(U.overlay.color){I.pinTxt.style.color=U.overlay.color}if(U.overlay.size){I.pinTxt.style.fontSize=U.overlay.size}if(U.overlay.fontFamily){I.pinTxt.style.fontFamily=U.overlay.fontFamily}I.pinTxt.style.left=(parseInt(I.pinImg.style.left)+parseInt(I.icon.overlay.anchorX))+"px";I.pinTxt.style.top=(parseInt(I.pinImg.style.top)+parseInt(I.icon.overlay.anchorY))+"px";Pin.zIndexCounter++;I.pinTxt.style.zIndex=Pin.zIndexCounter;I.pinTxt.onmousedown=function(W){if((document.all&&event.button==2)||(!document.all&&W.which==3)){M(W)}else{L(W)}};I.pinTxt.onmouseover=function(W){T(W)}}else{I.pinTxt.innerHTML=""}if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){var V=this.pinImg.src;this.pinImg.src=Credentials.imgPath+"x.gif";this.pinImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+V+"',sizingMethod='scale')"}};this.getIcon=function(){return I.icon};this.setX=function K(U){I.pinImg.style.left=(U-I.icon.anchorX)+"px";if(I.pinTxt){I.pinTxt.style.left=(U-I.icon.anchorX+I.icon.overlay.anchorX)+"px"}if(document.all){for(var V=0;V<G.length;V++){I.reRegister(G[V],G[G[V]])}}};this.setY=function J(U){I.pinImg.style.top=(U-I.icon.anchorY)+"px";if(I.pinTxt){I.pinTxt.style.top=(U-I.icon.anchorY+I.icon.overlay.anchorY)+"px"}};this.getPosition=function(){return I.position};this.setPosition=function A(V){if(I.map!=null){var U=I.map.positionToMapLayerPixel(V);I.setX(U.x);I.setY(U.y)}I.position=V};this.setMessage=function(U){I.pinImg.msg=U;if(I.pinImg.id==I.map.getBubble().whichPin){I.map.getBubbleContent().innerHTML=U}};this.getMessage=function(){return I.pinImg.msg};this.hide=function F(){I.isVisible=false;I.pinImg.style.display="none";I.pinTxt.style.display="none"};this.show=function R(){I.isVisible=true;I.pinImg.style.display="block";I.pinTxt.style.display="block"};this.zoomHide=function P(){if(!I.isVisible){return }I.pinImg.style.display="none";I.pinTxt.style.display="none"};this.zoomShow=function C(){if(!I.isVisible){return }I.pinImg.style.display="block";I.pinTxt.style.display="block"};this.showInfoWindow=function(){if(I.map.getBubble().type=="custom"){I.map.getBubble().style.left=(parseInt(I.pinImg.style.left)-parseInt(I.map.getBubble().offX))+"px";I.map.getBubble().style.top=(parseInt(I.pinImg.style.top)-parseInt(I.map.getBubble().offY))+"px"}else{I.map.getBubble().style.left=(parseInt(I.pinImg.style.left)+(I.icon.anchorX*2)+2)+"px";I.map.getBubble().style.top=parseInt(I.pinImg.style.top)+"px"}I.map.getBubbleContent().innerHTML=I.pinImg.msg;I.map.getBubble().style.display="block";I.map.getBubble().style.zIndex=Pin.zIndexCounter+10000;I.map.getBubble().whichPin=I.pinImg.id;if(document.all){I.map.getBubbleClose().onclick=function(U){U=U||event;U.stoppropagation?U.stoppropagation():U.cancelBubble=true;I.map.getBubble().style.display="none"}}};this.hideInfoWindow=function(){I.map.getBubble().style.display="none"};this.reRegister=function(U,V){if(!I.pinImg.onclick&&U=="click"){I.pinImg.onclick=L}else{if(U=="rightclick"){I.pinImg.onmousedown=M}else{if(!I.pinImg.onmouseover&&U=="mouseover"){I.pinImg.onmouseover=T}else{if(!I.pinImg.onmouseout&&U=="mouseout"){I.pinImg.onmouseout=S}}}}};this.addEventListener=function(V,W){var X=false;for(var U=0;U<G.length;U++){if(G[U]==V){G[V]=W;X=true;break}}if(!X){G.push(V);G[V]=W}if(!I.pinImg.onclick&&V=="click"){I.pinImg.onclick=L}else{if(V=="rightclick"){I.pinImg.onmousedown=M}else{if(!I.pinImg.onmouseover&&V=="mouseover"){I.pinImg.onmouseover=T}else{if(!I.pinImg.onmouseout&&V=="mouseout"){I.pinImg.onmouseout=S}}}}};this.clearInstanceListeners=function(){for(var U=0;U<G.length;U++){G[G[U]]=null;G[U]=null}};this.clearListeners=function(V){for(var U=0;U<G.length;U++){if(G[U]==V){G[G[U]]=null}}G[U]=null};function L(U){U=U||event;if(G.click){U.stoppropagation?U.stoppropagation():U.cancelBubble=true;G.click(I)}}function M(U){U=U||event;if(G.rightclick){if((document.all&&event.button==2)||(!document.all&&U.which==3)){U.stoppropagation?U.stoppropagation():U.cancelBubble=true;G.rightclick(I)}return false}}function T(){if(G.mouseover){G.mouseover(I)}}function S(){if(G.mouseout){G.mouseout(I)}}if(O&&(O=="onmouseover"||O=="mouseover")){I.addEventListener("mouseover",I.showInfoWindow);I.addEventListener("mouseout",I.hideInfoWindow)}else{if(O&&(O=="onclick"||O=="click")){I.addEventListener("click",I.showInfoWindow)}}this.toString=function(){return I.position};this.equals=function(U){if(U&&U.toString()==this.toString()&&U.pinImg==this.pinImg){return true}else{return false}};this.getViewableBoundingBox=function N(Y){var c=Utilities.lat2pix(I.position.lat,Y);var V=Utilities.lon2pix(I.position.lon,Y);var b=c+I.icon.anchorY;var i=V+parseInt(I.pinImg.style.width)-I.icon.anchorX;var h=c-parseInt(I.pinImg.style.height)+I.icon.anchorY;var Z=V-I.icon.anchorX;var d=Utilities.pix2lat(b,Y);var U=Utilities.pix2lon(i,Y);var f=Utilities.pix2lat(h,Y);var W=Utilities.pix2lon(Z,Y);var a=new Position(d,U);var X=new Position(f,W);var g=new BoundingBox(X,a);return g}}Pin.zIndexCounter=100;function PixelPoint(A,C){try{this.x=parseInt(A,10);this.y=parseInt(C,10);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 parseInt(this.x)};PixelPoint.prototype.setX=function(A){this.x=parseInt(A,10);if(isNaN(this.x)){throw new Exception("PixelPoint: setX bad argument x: "+A)}};PixelPoint.prototype.getY=function(){return parseInt(this.y)};PixelPoint.prototype.setY=function(A){this.y=parseInt(A,10);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 PixelPointDP(D,C){try{this.x=parseFloat(D);this.y=parseFloat(C)}catch(B){throw new Exception("bad constructor values for x/y")}var A=this;this.getX=function(){return(A.x)};this.getY=function(){return(A.y)};this.equals=function(E){if(E&&E.toString()==A.toString()){return true}else{return false}};this.toString=function(){return A.x+" "+A.y}}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])}catch(B){throw new Exception("error initializing Position object")}}else{if(arguments.length==2){try{this.lat=parseFloat(D);this.lon=parseFloat(A)}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}this.clone=function(){return new Position(this.toString())};this.getLat=function(){return this.lat};this.getLon=function(){return this.lon};this.setLat=function(E){this.lat=E};this.setLon=function(E){this.lon=E};this.getLatLon=function(){return this.lat+" "+this.lon};this.getLatCommaLon=function(){return this.lat+", "+this.lon};this.equals=function(E){if(E&&E.getLatLon()==this.getLatLon()){return true}else{return false}};this.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}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 getAvoidList(){return this.avoidList};RoutePreference.prototype.setAvoidList=function setAvoidList(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 getGeneralizationFactor(){return this.generalizationFactor};RoutePreference.prototype.setGeneralizationFactor=function setGeneralizationFactor(A,C){try{this.generalizationBBox=Utilities.positionsToBoundingBox(A);this.generalizationFactor=Utilities.generalizationFactor(this.generalizationBBox,C)}catch(B){throw B}};function RouteQuery(){this.xmlRecFac=new XMLRequestFactory();var C=new Array();C[-1]=function(){alert("Opps!\n\nunable to find route, please reset and try again...")};var A=this;this.authenticate=function(E,D){if(!E||!D||E==""||D==""){throw new Exception("Error authenticating RouteQuery, invalid parameters.");return false}Credentials.clientName=E;Credentials.clientPassword=D};this.query=function(D,F,H){var G=Utilities.getRequestId();C[G]=H;var E=this.xmlRecFac.createRouteGeometryRequestDOM(D,G,F,true);JSRequest.send(E,A.queryCallback)};this.queryById=function(G,F){var E=Utilities.getRequestId();C[E]=F;var D=this.xmlRecFac.createRouteGeometryByIdRequestDOM(G,E,null,true);JSRequest.send(D,A.queryCallback)};this.queryCallback=function B(G){var E=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(G),"text/xml");if(document.all){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){var F=Sarissa.getText(E.selectSingleNode("//xls:Response/@requestID"));C[F](null)}else{var D=Utilities.parseRoutes(E);var F=Sarissa.getText(E.selectSingleNode("//xls:Response/@requestID"));if(F&&F>0){C[F](D)}}}}function ScaleBar(){var C=document.createElement("div");var A=document.createElement("div");var B=document.createElement("img");B.src=Credentials.imgPath+"scale.png";A.style.fontFamily="arial";A.style.fontSize="8pt";C.style.border="1px solid #cccccc";C.id="decarta-scaleBar";C.style.width="120px";C.style.textAlign="center";C.appendChild(A);C.appendChild(B);this.map=null;this.frame=C;this.measure=A}ScaleBar.prototype.getDiv=function getDiv(){this.frame.style.position="relative";this.frame.style.top="0px";this.frame.style.left="0px";return this.frame};ScaleBar.prototype.calculate=function calculate(){if(!this.map||!this.map.getZoomController()){return }try{this.map.getCenterPosition()}catch(I){return }var N=this.map.getZoomController().getGXConvertedZoomLevel();var D=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),N);var B=this.map.getCenterPosition();var A=Utilities.lon2pix(B.lon,D);var M=Utilities.pix2lon(A+100,D);var K=Utilities.pix2lon(A,D);var G=Math.cos(((B.lat)*(Math.PI/180)));var H=parseFloat(G*111.325);var J=(((M-K)*H)*1000);var C=J*3.28;var L;if(C>5280){var F=(C/5280)+"";if(F.indexOf(".")>0){F=F.substring(0,F.indexOf(".")+2)}L=F+"&nbsp;miles&nbsp;|&nbsp;"}else{L=Math.round(C)+"&nbsp;feet&nbsp;|&nbsp;"}if(J>1000){var E=(J/1000)+"";if(E.indexOf(".")>0){E=E.substring(0,E.indexOf(".")+2)}L+=E+" km"}else{L+=Math.round(J)+"&nbsp;meters"}this.measure.innerHTML=L};function SearchCriteria(E,B,A,D,C){if(D>100){alert("maximumResponses cannot exceed 100");return false}this.queryString=E;this.position=B;this.radius=A;this.maximumResponses=D;this.database=C||null;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){alert(ServerMonitor.WS_ERR);return false}}catch(E){alert(ServerMonitor.WS_ERR);return false}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){alert(ServerMonitor.DDS_ERR)}else{if(((D.selectNodes("//@message"))[0].value).indexOf("'rel' attribute")>-1){alert(ServerMonitor.VER_ERR)}else{alert((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.trim=function trim(A){return A.replace(/^\s*/,"").replace(/\s*$/,"")};deCarta.String.rtrim=function rtrim(A){return A.replace(/\s*$/,"")};deCarta.String.ltrim=function ltrim(A){return A.replace(/^\s*/,"")};deCarta.StyleManager=function Styles(){var A=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(A);if(!window.createPopup){A.appendChild(document.createTextNode(""))}this.sheet=document.styleSheets[document.styleSheets.length-1]};deCarta.StyleManager.prototype.sheet=null;deCarta.StyleManager.prototype.defaultRules=[];deCarta.StyleManager.prototype.addDefaultRule=function addDefaultRule(A){if(!A){throw new Exception("deCarta.Styles.addDefaultRule: bad argument: "+A)}var C;var B=null;for(C=0;C<this.defaultRules.length;C++){if(this.defaultRules[C].selector==A){B=this.defaultRules[C];this.defaultRules=this.defaultRules.slice(0,C).concat(this.defaultRules.slice(C+1));break}}if(!B){return false}else{return(this.addRule(B))}};deCarta.StyleManager.prototype.addDefaultClass=function addDefaultClass(A){var C="."+A;var B=this.addDefaultRule(C);return B};deCarta.StyleManager.prototype.addRule=function addRule(A){if(!A){return false}if(!A.selector||!A.rule){throw new Exception("deCarta.StyleManager.addRule: Bad style passed in. newRule.selector: "+A.selector+"newRule.rule: "+A.rule)}if(this.sheet.insertRule){try{this.sheet.insertRule(A.toString(),this.sheet.cssRules.length)}catch(B){}}else{try{this.sheet.addRule(A.selector,A.rule)}catch(B){}}return true};deCarta.StyleManager.Rule=function Rule(A,B){if(!A||!B){throw new Exception("deCarta.StyleManager.Rule: called with invalid arguments.selector: "+A+"rule: "+B)}this.selector=A;this.rule=B};deCarta.StyleManager.Rule.prototype.toString=function toString(){return(this.selector+this.rule)};deCarta.styles=new deCarta.StyleManager();deCarta.styles.defaultRules=[new deCarta.StyleManager.Rule(".decarta-log","{position:absolute; width: 800px; height: 400px; top:10px; left:800px; font-family: monospace; font-size: 8pt; border: 1px inset #cccccc; background-color: #eeeeee; overflow: scroll; white-space: nowrap;}"),new deCarta.StyleManager.Rule(".decarta-close","{position:absolute; z-index:99999; width:20px; height:20px; top:2px; left:178px; display:block; cursor:pointer;}"),new deCarta.StyleManager.Rule(".decarta-bubbleContent","{padding:16px; z-index:10001;}"),new deCarta.StyleManager.Rule(".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;}"),new deCarta.StyleManager.Rule(".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;}"),new deCarta.StyleManager.Rule(".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; z-index:9999;}")];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=new Array();var A=this;this.authenticate=function(E,D){if(!E||!D||E==""||D==""){alert("Error authenticating TrafficIncidentQuery, invalid parameters.");return false}Credentials.clientName=E;Credentials.clientPassword=D};this.query=function(D,F){var E=Utilities.getRequestId();B[E]=F;C=this.xmlRecFac.createTrafficIncidentRequestDOM(D,E);JSRequest.send(C,A.queryCallback)};this.queryCallback=function(F){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=new Array();if(L.selectNodes("//xls:Error").length>0){var I=Sarissa.getText(L.selectSingleNode("//xls:Response/@requestID"));B[I](null)}else{if(L.selectNodes("//xls:Incident").length==0){var I=Sarissa.getText(L.selectSingleNode("//xls:Response/@requestID"));B[I](D)}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 N=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))}var I=Sarissa.getText(L.selectSingleNode("//xls:Response/@requestID"));B[I](D)}}}}function TrafficIncidentSearchCriteria(B,A,C,D){if(C>100){alert("maximumResponses cannot exceed 100");return false}this.position=B;this.radius=A;this.maximumResponses=C;this.minimumSeverity=D}function UOM(A){if(A!="KM"&&A!="M"&&A!="MI"&&A!="FT"){alert("invalid UOM type,  KM M MI FT");return false}this.value=A;this.toString=function(){return this.value}}function URL(B,C){if(Credentials.dgkey!=null){B=B.replace(/key.+?&/,"key="+Credentials.dgkey+"&")}if(URL.dgAliases.length>0){var A=B.indexOf("/",7);B=B.replace(B.substring(0,A),"http://"+URL.dgAliases[URL.dgAliasesCount]);if(URL.dgAliasesCount>URL.dgAliases.length-2){URL.dgAliasesCount=0}else{URL.dgAliasesCount++}}this.globeExplorerURL=B.replace(URL.urlregx,"");this.deCartaURL=C.replace(URL.urlregx,"");this.getDeCartaURL=function(){return this.deCartaURL};this.getGlobeExplorerURL=function(){return this.globeExplorerURL}}URL.urlregx=new RegExp("\\amp;","g");URL.dgAliases=[];URL.dgAliasesCount=0;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(C,B,A){if(navigator.userAgent.toLowerCase().indexOf("safari")!=-1){return(C.getElementsByTagName(A))[0]}else{return(C.getElementsByTagName(B+":"+A))[0]}};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;this.red;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.imgPath+"x.gif";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=deCarta.log.add;Utilities.c=function(){deCarta.log.logControl(["clear"])};Utilities.generalize=function(J,Q,H,P){var H=Math.round(H/2);var O=Q.getGXConvertedZoomLevel();var D=Utilities.radsPerPixelAtZoom(P,O);var I=J.length;var C=[];var B=true;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));C.push(J[E]);continue}}return C};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){alert(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 pinsToBoundingBox(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=256}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=256}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.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 generalizationFactor(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 parseRoute(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 parseRoutes(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 setUnselectable(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 vrToPositions(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 vr7ToPositions(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 positionsToVr(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 positionsToVr7(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(D,B){var E=Sarissa.getDomDocument();E=(new DOMParser()).parseFromString(Sarissa.serialize(D),"text/xml");E.setProperty("SelectionLanguage","XPath");E.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var C=(E.selectSingleNode("//xls:Request/@requestID").value);A[C]=B;JSRequest.send(E,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;var A=this;this.getHeader=function B(J,E,D,I){D=D||"10";I=I||Utilities.getRequestId();E=E||Utilities.getRequestId();try{var H=Sarissa.getDomDocument();var F=H.createElement("xls:XLS");F.setAttribute("xls:lang","en");F.setAttribute("version","1");if(Credentials.rel&&Credentials.rel!=null){F.setAttribute("rel",Credentials.rel)}F.setAttribute("xmlns:xls","http://www.opengis.net/xls");F.setAttribute("xmlns:gml","http://www.opengis.net/gml");H.appendChild(F);var K=H.createElement("xls:RequestHeader");K.setAttribute("clientName",Credentials.clientName);if(Credentials.mapType=="STREET"){K.setAttribute("configuration",Credentials.configuration)}else{K.setAttribute("configuration",Credentials.transparentConfiguration)}K.setAttribute("sessionID",I);K.setAttribute("clientPassword",Credentials.clientPassword);F.appendChild(K);var C=H.createElement("xls:Request");C.setAttribute("maximumResponses",D);C.setAttribute("version","1.0");C.setAttribute("requestID",E);C.setAttribute("methodName",J);F.appendChild(C);return H}catch(G){alert("XMLRequestFactory.this.getHeader\n\n"+G.message)}}}XMLRequestFactory.prototype.createMapAddressRequestDOM=function createMapAddressRequestDOM(L,K,R,C,Q,O,T){try{var E=this.getHeader("PortrayMapRequest",Q);var X=E.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(E,"xls","Request").appendChild(X);var I=E.createElement("xls:Output");I.setAttribute("width",K);I.setAttribute("height",K);I.setAttribute("fixedgrid","true");I.setAttribute("useCache","true");if(Credentials.mapType=="STREET"){I.setAttribute("format","GIF")}else{I.setAttribute("format","PNG")}I.setAttribute("content","URL");X.appendChild(I);var F=E.createElement("xls:CenterAddress");var W=E.createElement("xls:TileGrid");W.setAttribute("rows",C);W.setAttribute("columns",R);var M=E.createElement("xls:GridLayer");M.setAttribute("name","globexplorer");M.setAttribute("meta-inf","zoom="+O);var Y=E.createElement("xls:GridLayer");Y.setAttribute("name","deCarta");W.appendChild(Y);W.appendChild(M);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 G=E.createElement("xls:Pan");G.setAttribute("direction","E");G.setAttribute("numTiles","0");var V=E.createElement("xls:Pan");V.setAttribute("direction","W");V.setAttribute("numTiles","0");W.appendChild(B);W.appendChild(A);W.appendChild(G);W.appendChild(V);I.appendChild(F);I.appendChild(W);var S=E.createElement("xls:Address");S.setAttribute("countryCode",L.getLocale().getCountry());S.setAttribute("language",L.getLocale().getLanguage());F.appendChild(S);var D=E.createElement("xls:freeFormAddress");var J=E.createTextNode(L.toString());D.appendChild(J);S.appendChild(D);if(Credentials.trafficEnabled){var P=E.createElement("xls:Overlay");var N=E.createElement("xls:Traffic");var H=E.createElement("xls:FlowReporting");if(T){H.setAttribute("time",T)}N.appendChild(H);P.appendChild(N);X.appendChild(P)}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){alert("XMLRequestFactory.prototype.createMapAddressRequestDOM\n\n"+U.message)}};XMLRequestFactory.prototype.createMapRequestDOM=function createMapRequestDOM(I,M,U,C,S,Q,V){try{var F=this.getHeader("PortrayMapRequest",S);var Z=F.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(F,"xls","Request").appendChild(Z);var L=F.createElement("xls:Output");L.setAttribute("width",M);L.setAttribute("height",M);L.setAttribute("fixedgrid","true");L.setAttribute("useCache","true");if(Credentials.mapType=="STREET"){L.setAttribute("format","GIF")}else{L.setAttribute("format","PNG")}L.setAttribute("content","URL");Z.appendChild(L);this.addOverlays(Z,F);var G=F.createElement("xls:CenterContext");G.setAttribute("SRS","WGS-84");var Y=F.createElement("xls:TileGrid");Y.setAttribute("rows",C);Y.setAttribute("columns",U);var O=F.createElement("xls:GridLayer");O.setAttribute("name","globexplorer");O.setAttribute("meta-inf","zoom="+Q);var a=F.createElement("xls:GridLayer");a.setAttribute("name","deCarta");Y.appendChild(a);Y.appendChild(O);var B=F.createElement("xls:Pan");B.setAttribute("direction","N");B.setAttribute("numTiles","0");var A=F.createElement("xls:Pan");A.setAttribute("direction","S");A.setAttribute("numTiles","0");var J=F.createElement("xls:Pan");J.setAttribute("direction","E");J.setAttribute("numTiles","0");var X=F.createElement("xls:Pan");X.setAttribute("direction","W");X.setAttribute("numTiles","0");Y.appendChild(B);Y.appendChild(A);Y.appendChild(J);Y.appendChild(X);L.appendChild(G);L.appendChild(Y);var E=F.createElement("xls:Radius");E.setAttribute("unit","KM");var N=F.createTextNode("0");N=F.createTextNode("200");E.appendChild(N);var T=F.createElement("xls:CenterPoint");var H=F.createElement("gml:pos");var D=F.createTextNode(I.getLatLon());H.appendChild(D);T.appendChild(H);G.appendChild(T);G.appendChild(E);if(Credentials.trafficEnabled){var R=F.createElement("xls:Overlay");var P=F.createElement("xls:Traffic");var K=F.createElement("xls:FlowReporting");if(V){K.setAttribute("time",V)}P.appendChild(K);R.appendChild(P);Z.appendChild(R)}if(document.all){F.setProperty("SelectionLanguage","XPath");F.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}return F}catch(W){alert("XMLRequestFactory.prototype.createBasicMapRequestDOM\n\n"+W.message)}};XMLRequestFactory.prototype.zoomMapRequestDOM=function zoomMapRequestDOM(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);if(Credentials.mapType!="STREET"){var P=(N.selectSingleNode("//xls:RequestHeader"));P.setAttribute("configuration",Credentials.transparentConfiguration)}else{var P=(N.selectSingleNode("//xls:RequestHeader"));P.setAttribute("configuration",Credentials.configuration)}var R=(N.selectSingleNode("//xls:Output"));if(Credentials.mapType=="STREET"){R.setAttribute("format","GIF")}else{R.setAttribute("format","PNG")}var M=N.selectSingleNode("//xls:GridLayer[@name='globexplorer']");M.setAttribute("meta-inf","zoom="+F+":"+K);return N}catch(U){alert("XMLRequestFactory.prototype.zoomMapRequestDOM\n\n"+U.message)}};XMLRequestFactory.prototype.changeMapStyleRequestDOM=function changeMapStyleRequestDOM(F,C,D,M,G,J){try{Credentials.configuration=C;var I=(new DOMParser()).parseFromString(Sarissa.serialize(F),"text/xml");I.setProperty("SelectionLanguage","XPath");I.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var A=I.selectSingleNode("//xls:RequestHeader/@configuration");A.value=C;var L=I.selectSingleNode("//xls:RequestHeader/@sessionID");L.value=Utilities.getRequestId();var B=I.selectSingleNode("//xls:Pan[@direction='N']");B.setAttribute("numTiles",D);var K=I.selectSingleNode("//xls:Pan[@direction='S']");K.setAttribute("numTiles",M);var E=I.selectSingleNode("//xls:Pan[@direction='E']");E.setAttribute("numTiles",G);var H=I.selectSingleNode("//xls:Pan[@direction='W']");H.setAttribute("numTiles",J);return I}catch(G){alert("XMLRequestFactory.prototype.zoomMapRequestDOM\n\n"+G.message)}};XMLRequestFactory.prototype.createGeocodeRequestDOM=function createGeocodeRequestDOM(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){alert("XMLRequestFactory.prototype.getGeocodeRequestDOM\n\n"+V.message)}};XMLRequestFactory.prototype.createCorridorSearchRequestDOM=function createCorridorSearchRequestDOM(L,C){try{var I=this.getHeader("CorridorSearchRequest",C);var F=I.createElement("xls:CorridorSearchRequest");Utilities.getElementByTagName(I,"xls","Request").appendChild(F);var A;switch(L.distanceType){case"euclideanDistance":A=I.createElement("xls:euclideanDistance");A.setAttribute("value",L.distance);A.setAttribute("uom",L.distanceUOM.value);break;case"driveDistance":A=I.createElement("xls:distance");A.setAttribute("value",L.distance);A.setAttribute("uom",L.distanceUOM.value);break;case"driveTime":A=I.createElement("xls:drivetime");var M=I.createTextNode(L.distance);A.appendChild(M);break}F.appendChild(A);var G=I.createElement("xls:LineString");for(var H=0;H<L.routeGeometry.length;H++){var K=I.createElement("gml:pos");var E=I.createTextNode(L.routeGeometry[H]);K.appendChild(E);G.appendChild(K)}F.appendChild(G);var D=I.createElement("xls:filters");var B=I.createElement("xls:filter");B.setAttribute("value",L.category);B.setAttribute("key","PTS");D.appendChild(B);F.appendChild(D);return I}catch(J){alert("XMLRequestFactory.prototype.createCorridorSearchRequestDOM\n\n"+J.message)}};XMLRequestFactory.prototype.createReverseGeocodeRequestDOM=function createReverseGeocodeRequestDOM(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){alert("XMLRequestFactory.prototype.createReverseGeocodeRequestDOM\n\n"+G.message)}};XMLRequestFactory.prototype.createCenterContext=function createCenterContext(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){alert("XMLRequestFactory.prototype.createCenterContext\n\n"+F.message)}};XMLRequestFactory.prototype.createRouteGeometryRequestDOM=function createRouteGeometryRequestDOM(V,R,A,G){try{var H=this.getHeader("DetermineRouteRequest",R);var S=H.createElement("xls:DetermineRouteRequest");S.setAttribute("distanceUnit",A.uom);S.setAttribute("routeQueryType",A.routeQueryType);S.setAttribute("provideRouteHandle","true");if(A.alternateRoutes){S.setAttribute("numAltRoutes",A.alternateRoutes)}Utilities.getElementByTagName(H,"xls","Request").appendChild(S);var P=H.createElement("xls:RoutePlan");if(Credentials.trafficEnabled){P.setAttribute("useRealTimeTraffic","true")}if(A.optimized){P.setAttribute("optimize","true")}if(Credentials.trafficEnabled&&A.expectedStartTime){P.setAttribute("expectedStartTime",A.expectedStartTime)}S.appendChild(P);var M=H.createElement("xls:RoutePreference");var I=H.createTextNode(A.routePreference);M.appendChild(I);P.appendChild(M);var Z=H.createElement("xls:WayPointList");for(var X=0;X<V.length;X++){if(X==0){var Q=H.createElement("xls:StartPoint");var b=H.createElement("xls:Position");var T=H.createElement("gml:Point");var J=H.createElement("gml:pos");var W=H.createTextNode(V[X]);J.appendChild(W);T.appendChild(J);b.appendChild(T);Q.appendChild(b);Z.appendChild(Q)}else{if(X>0&&X<(V.length-1)){var c=H.createElement("xls:ViaPoint");var b=H.createElement("xls:Position");var T=H.createElement("gml:Point");var J=H.createElement("gml:pos");var W=H.createTextNode(V[X]);J.appendChild(W);T.appendChild(J);b.appendChild(T);c.appendChild(b);Z.appendChild(c)}else{if(X==(V.length-1)){var N=H.createElement("xls:EndPoint");var b=H.createElement("xls:Position");var T=H.createElement("gml:Point");var J=H.createElement("gml:pos");var W=H.createTextNode(V[X]);J.appendChild(W);T.appendChild(J);b.appendChild(T);N.appendChild(b);Z.appendChild(N)}}}}P.appendChild(Z);if(A.avoidList.length>0){var O=H.createElement("xls:AvoidList");for(X=0;X<A.avoidList.length;X++){var L=H.createTextNode(A.avoidList[X]);var a=H.createElement("xls:AvoidFeature");a.appendChild(L);O.appendChild(a)}P.appendChild(O)}var F=H.createElement("xls:RouteInstructionsRequest");F.setAttribute("providePoint","true");if(A.rules!=null){F.setAttribute("rules",A.rules)}S.appendChild(F);var E=H.createElement("xls:RouteGeometryRequest");if(!G){E.setAttribute("returnRouteIDOnly","true")}if(A.generalizationFactor&&A.generalizationFactor!==0&&A.generalizationBBox){E.setAttribute("resolution",A.generalizationFactor);var B=H.createElement("xls:BoundingBox");var D=H.createElement("gml:pos");var U=H.createTextNode(A.generalizationBBox.minPosition);var C=H.createElement("gml:pos");var K=H.createTextNode(A.generalizationBBox.maxPosition);D.appendChild(U);B.appendChild(D);C.appendChild(K);B.appendChild(C);E.appendChild(B)}S.appendChild(E);return H}catch(Y){alert("XMLRequestFactory.prototype.createRouteGeometryRequestDOM\n\n"+Y.message)}};XMLRequestFactory.prototype.createRouteGeometryByIdRequestDOM=function createRouteGeometryByIdRequestDOM(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){alert("XMLRequestFactory.prototype.createRouteGeometryByIdRequestDOM\n\n"+F.message)}};XMLRequestFactory.prototype.createRouteMapDOM=function createRouteMapDOM(G,L,Q,K,R,E,O,B){try{var F=this.getHeader("PortrayMapRequest",Q);var V=F.createElement("xls:PortrayMapRequest");V.setAttribute("fitOverlays","false");Utilities.getElementByTagName(F,"xls","Request").appendChild(V);var J=F.createElement("xls:Output");J.setAttribute("width",K);J.setAttribute("height",K);J.setAttribute("fixedgrid","true");J.setAttribute("useCache","true");if(Credentials.mapType=="STREET"){J.setAttribute("format","GIF")}else{J.setAttribute("format","PNG")}J.setAttribute("content","URL");J.appendChild(G);var C=F.createElement("xls:Overlay");L.setAttribute("preference",B.routePreference);this.routeID=L;C.appendChild(L.cloneNode(true));V.appendChild(J);V.appendChild(C);var U=F.createElement("xls:TileGrid");U.setAttribute("rows",E);U.setAttribute("columns",R);var M=F.createElement("xls:GridLayer");M.setAttribute("name","globexplorer");M.setAttribute("meta-inf","zoom="+O);var W=F.createElement("xls:GridLayer");W.setAttribute("name","deCarta");U.appendChild(W);U.appendChild(M);var D=F.createElement("xls:Pan");D.setAttribute("direction","N");D.setAttribute("numTiles","0");var A=F.createElement("xls:Pan");A.setAttribute("direction","S");A.setAttribute("numTiles","0");var H=F.createElement("xls:Pan");H.setAttribute("direction","E");H.setAttribute("numTiles","0");var T=F.createElement("xls:Pan");T.setAttribute("direction","W");T.setAttribute("numTiles","0");U.appendChild(D);U.appendChild(A);U.appendChild(H);U.appendChild(T);J.appendChild(U);if(Credentials.trafficEnabled){var P=F.createElement("xls:Overlay");var N=F.createElement("xls:Traffic");var I=F.createElement("xls:FlowReporting");if(B.expectedStartTime){I.setAttribute("time",B.expectedStartTime)}N.appendChild(I);P.appendChild(N);V.appendChild(P)}return F}catch(S){alert("XMLRequestFactory.prototype.createRouteMapDOM \n\n"+S.message)}};XMLRequestFactory.prototype.createPOIRequestDOM=function createPOIRequestDOM(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","Ascending");A.setAttribute("sortCriteria","Distance");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){alert("XMLRequestFactory.prototype.createPOIRequestDOM\n\n"+H.message)}};XMLRequestFactory.prototype.createRUOKRequestDOM=function createRUOKRequestDOM(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){alert("XMLRequestFactory.prototype.createRUOKRequestDOM\n\n"+D.message)}};XMLRequestFactory.prototype.addOverlays=function addOverlays(I,F){try{if(this.rendering!="server"){return }if(this.routeID!=null){var D=F.createElement("xls:Overlay");D.appendChild(this.routeID);I.appendChild(D)}for(var E=0;E<this.overlays.length;E++){if(!this.overlays[E]){continue}var A=this.overlays[E];var C=F.createElement("xls:Overlay");var H=F.createElement("xls:Shape");C.appendChild(H);H.setAttribute("type",A.type);H.setAttribute("opacity",A.opacity);H.setAttribute("color",A.fillColor+"_"+A.borderColor);H.setAttribute("style",A.borderStyle);if(A.type=="line"){H.setAttribute("width",A.width+"_"+A.borderWidth)}else{H.setAttribute("width",A.borderWidth)}if(A.type=="circle"){H.setAttribute("pointspec","LL");H.setAttribute("radius",A.radius.uomdds+A.radius.distance);var B=F.createTextNode(A.position.lat+","+A.position.lon)}else{try{var J=Utilities.LL2VR7(A.positions);A.VR7=J}catch(G){continue}if(A.type=="line"){H.setAttribute("pointspec","VR7")}else{H.setAttribute("pointspec","VR7PG")}var B=F.createTextNode(J)}H.appendChild(B);I.appendChild(C)}}catch(G){alert("XMLRequestFactory.prototype.addOverlays\n\n"+G.message)}};XMLRequestFactory.prototype.createTrafficIncidentRequestDOM=function createTrafficIncidentRequestDOM(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){alert("XMLRequestFactory.prototype.createTrafficIncidentRequestDOM\n\n"+G.message)}};function ZoomController(E,D,C,P,M,A){if(E&&E<1||E>17){throw new Exception("Error instantiating ZoomController, invalid initial value "+E+".  The value must be between 1 and 17");return false}var O=this;var G=new Array();var H;var I;this.zoomLevels=17;this.lowerBound=1;this.upperBound=17;this.color=D||"";this.uncheckedSrc=P||Credentials.imgPath+"zoom.png";this.checkedSrc=C||Credentials.imgPath+"zoomChecked.png";this.selected=E||5;this.topCap=document.createElement("IMG");if(!M){this.topCap.src=Credentials.imgPath+"zoomTop.png";this.topCap.style.height="17px";this.topCap.style.width="17px"}else{this.topCap.src=M}this.topCap.style.padding="0";this.topCap.style.margin="0";this.topCap.style.display="block";if(Utilities.ie6){Utilities.fixPng(this.topCap)}this.bottomCap=document.createElement("IMG");if(!A){this.bottomCap.src=Credentials.imgPath+"zoomBottom.png";this.bottomCap.style.height="17px";this.bottomCap.style.width="17px"}else{this.bottomCap.src=A}this.bottomCap.style.padding="0";this.bottomCap.style.margin="0";this.bottomCap.style.display="block";if(Utilities.ie6){Utilities.fixPng(this.bottomCap)}this.zoomer=null;this.map=null;this.initialize=function(S){O.map=S;O.upperBound=O.zoomLevels;for(var R=O.lowerBound;R<=O.upperBound;R++){var Q=document.createElement("img");Q.style.height="9px";Q.style.width="17px";Q.style.padding="0";Q.style.margin="0";Q.style.display="block";Q.id="decarta-z"+R;Q.src=O.uncheckedSrc;Q.checkedSrc=O.checkedSrc;Q.onclick=function(T){T=T||event;T.stoppropagation?T.stoppropagation():T.cancelBubble=true;if(S.getZoomLck()){return false}F();this.src=this.checkedSrc;S.zoomMap(this.id.substring(9))};G.push(Q)}O.zoomer=document.createElement("DIV");O.zoomer.style.cursor="pointer";O.zoomer.id="decarta-zoom";O.zoomer.style.width="20px";O.zoomer.style.top="1px";O.zoomer.style.left="1px";O.zoomer.style.opacity=50;O.zoomer.innerHTML="";O.zoomer.style.filter="alpha(opacity=80)";O.zoomer.style.opacity=0.8;O.zoomer.style.position="absolute";O.zoomer.style.zIndex=9999;O.zoomer.appendChild(O.topCap);for(var R=0;R<G.length;R++){O.zoomer.appendChild(G[R])}O.zoomer.appendChild(O.bottomCap);S.mapDiv.appendChild(O.zoomer);O.topCap.id="decarta-ztop";O.topCap.onclick=function(T){T=T||event;T.stoppropagation?T.stoppropagation():T.cancelBubble=true;O.zoomInOneLevel()};O.bottomCap.id="decarta-zbottom";O.bottomCap.onclick=function(T){T=T||event;T.stoppropagation?T.stoppropagation():T.cancelBubble=true;O.zoomOutOneLevel()};this.setZoomLevel(O.selected)};this.setZoomRange=function(Q,R){if(Q<1||R>21||Q>R){alert("illegal values setZoomRange")}if(O.selected>R){O.selected=R}if(O.selected<Q){O.selected=Q}O.zoomLevels=R;O.lowerBound=Q;O.upperBound=R};this.setZoomButtonImages=function(S,R){this.checkedSrc=S;this.uncheckedSrc=R;for(var Q=0;Q<G.length;Q++){G[Q].src=R}if(O.selected){G[O.selected-1].src=S}};this.setColor=function(Q){this.zoomer.style.backgroundColor=Q};this.show=function(){this.zoomer.style.display="block"};this.hide=function(){this.zoomer.style.display="none"};this.getRadius=function(){return H};this.setRadius=function(S){I=S;var R=O.map.getGridSize().split(" ");var T=R[0];var Q=R[1];if(T==Q){H=S}else{H=(I/Q)*T}};this.getRadiusX=function(){return I};this.setRadiusX=function(Q){I=Q};this.getZoomLevel=function(){return O.selected};this.setZoomLevel=function(R){if(R&&R<O.lowerBound||R>O.upperBound){throw new Exception("Error calling setZoomLevel, out of range");return false}O.selected=R;F();for(var Q=0;Q<G.length;Q++){if(G[Q].id=="decarta-z"+R){G[Q].src=O.checkedSrc}if(Utilities.ie6){Utilities.fixPng(G[Q])}}};this.getGXConvertedZoomLevel=function J(){return Math.abs(21-O.selected)};this.zoomToNewLevel=function K(R){if(R&&R<O.lowerBound||R>O.upperBound){throw new Exception("Error calling zoomToNewLevel, out of range");return false}F();for(var Q=0;Q<G.length;Q++){if(G[Q].id=="decarta-z"+R){G[Q].src=O.checkedSrc}if(Utilities.ie6){Utilities.fixPng(G[Q])}}O.map.zoomMap(R)};this.zoomInOneLevel=function N(){if(O.selected<=O.lowerBound){return false}F();for(var Q=0;Q<G.length;Q++){if(G[Q].id=="decarta-z"+O.selected){G[Q].src=O.checkedSrc}}O.map.zoomMap(parseInt(O.selected)-1)};this.zoomOutOneLevel=function B(){if(O.selected==O.zoomLevels){return false}F();for(var Q=0;Q<G.length;Q++){if(G[Q].id=="decarta-z"+O.selected){G[Q].src=O.checkedSrc}}O.map.zoomMap(parseInt(O.selected)+1)};this.getZoomLevelToFitBoundingBox=function(T){var W=parseInt(O.map.mapDiv.style.height)/2;var X=parseInt(O.map.mapDiv.style.width)/2;for(var V=20;V>0;--V){var S=Utilities.radsPerPixelAtZoom(this.map.getTileSize(),V);var Z=Utilities.lat2pix(T.getCenterPosition().getLat(),S);var b=Utilities.lon2pix(T.getCenterPosition().getLon(),S);var U=Utilities.pix2lat(Z+W,S);var a=Utilities.pix2lon(b+X,S);var R=Utilities.pix2lat(Z-W,S);var Y=Utilities.pix2lon(b-X,S);var Q=new BoundingBox(new Position(R,Y),new Position(U,a));if(Q.contains(T.minPosition)&&Q.contains(T.maxPosition)){return Math.abs(21-V);break}}};this.getZoomLevelToFitPositions=function(Q){var R=Utilities.positionsToBoundingBox(Q);return O.getZoomLevelToFitBoundingBox(R)};this.getZoomLevelToFitPins=function L(T){var R=[];for(var S=0;S<T.length;S++){R[S]=T[S].position.clone()}var U=Utilities.positionsToBoundingBox(R);var V=O.getZoomLevelToFitBoundingBox(U);var Q=Utilities.radsPerPixelAtZoom(O.map.getTileSize(),Math.abs(21-V));U=Utilities.pinsToBoundingBox(T,Q);return O.getZoomLevelToFitBoundingBox(U)};this.setZoomValue=function(Q){O.setZoomLevel(Q)};function F(){for(var Q=0;Q<G.length;Q++){G[Q].src=O.uncheckedSrc}}};