function Address(D,G,B,A,F,E,C){this.buildingNumber=D;this.street=G;this.countrySubdivision=B;this.countrySecondarySubdivision=A;this.municipality=F;this.postalCode=E;this.municipalitySubdivision=C;this.getBuildingNumber=function(){return this.buildingNumber};this.getStreet=function(){return this.street};this.getCountrySubdivision=function(){return this.countrySubdivision};this.getCountrySecondarySubdivision=function(){return this.countrySecondarySubdivision};this.getMunicipality=function(){return this.municipality};this.getPostalCode=function(){return this.postalCode};this.getMunicipalitySubdivision=function(){return this.municipalitySubdivision};this.toString=function(){if(this.buildingNumber+this.street+this.municipality+this.countrySubdivision+this.postalCode==""){return""}else{var H="";if(this.buildingNumber!=""){H+=this.buildingNumber+" "}if(this.street!=""){H+=this.street+" "}if(this.municipality!=""){H+=this.municipality+" "}if(this.countrySubdivision!=""){H+=this.countrySubdivision+" "}if(this.postalCode!=""){H+=this.postalCode}return H}}}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 Credentials(){}Credentials.url="Proxy.ashx";Credentials.clientName="U-S-R";Credentials.clientPassword="P-W-D";Credentials.configuration="us-carto";Credentials.transparentConfiguration="transparent-tile";Credentials.mapType="STREET";Credentials.ISOCountryCode="US";Credentials.trafficEnabled=false;Credentials.rel="";Credentials.dgkey=null;Credentials.imgPath="img/";Credentials.errorTile=Credentials.imgPath+"tile.png";function DDSShape(){this.borderColor="(0.0.0)";this.borderStyle="SOLID";this.borderWidth="2";this.fillColor="(255.0.0)";this.id=Math.floor(Math.random()*10000000);this.opacity="65";this.map=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.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;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};function DDSLine(A){this.id=Math.floor(Math.random()*10000000);this.type="line";this.generalize=false;this.generalized=[];this.positions=[];this.width=A;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(G){function L(O,Q,P){if(Q.lat<P.lat){if(O){return false}else{return true}}else{if(!O){return false}else{return true}}}function N(P,Q,O){if(Q.lon<O.lon){if(!P){return false}else{return true}}else{if(P){return false}else{return true}}}var B=this;var C;var H;var A=0;var M=0;if(G.lat<B.positions[0].lat){H=true}else{H=false}if(G.lon<B.positions[0].lon){C=false}else{C=true}for(x in B.positions){var F=N(C,G,B.positions[x]);var J=L(H,G,B.positions[x]);if(F&&J){var D=B.positions[x].lat-B.positions[x-1].lat;var E=B.positions[x].lon-B.positions[x-1].lon;var I=D/E;D=G.lat-B.positions[x-1].lat;E=G.lon-B.positions[x-1].lon;var K=D/E;if((C&&!H)||(!C&&!H)){if(K>I){M++}else{A++}}if((!C&&H)||(C&&H)){if(K<I){M++}else{A++}}C=!C;H=!H}else{if(F){C=!C}if(J){H=!H;if(C){A++}else{M++}}}}if(A%2==0){return false}else{return true}};function EventRegistry(){}EventRegistry.addListener=function(C,A,B){if(C.type=="map"&&(A=="rightclick"||A=="dblclick"||A=="click"||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()};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 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");var C=this;this.address=B;this.getLocale=function(){return C.locale};this.toString=function(){return this.address}}function GeocodedAddress(){this.position=[];this.freeFormAddress=[];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();var B=new Array();var A=this;this.authenticate=function(D,C){if(!D||!C||D==""||C==""){throw new Exception("Error authenticating Geocoder, invalid parameters.");return false}Credentials.clientName=D;Credentials.clientPassword=C};this.geocode=function(C,E){var D=Utilities.getRequestId();B[D]=E;_xmlRequestDOM=this.xmlRecFac.createGeocodeRequestDOM(C,D);JSRequest.send(_xmlRequestDOM,A.geocodeCallback)};this.reverseGeocode=function(C,E){var D=Utilities.getRequestId();B[D]=E;_xmlRequestDOM=this.xmlRecFac.createReverseGeocodeRequestDOM(C,D);JSRequest.send(_xmlRequestDOM,A.reverseGeocodeCallback)};this.reverseGeocodeCallback=function(E){var K=Sarissa.getDomDocument();K=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(E),"text/xml");if(document.all){K.setProperty("SelectionLanguage","XPath");K.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}if(K.selectNodes("//xls:Error").length>0){var G=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));if(G!=-1){B[G](new Address("","","","","","",""))}else{throw new Exception("Error looking up reverse geocode callback, server did not provide necessary information.");return false}return false}else{try{var F=Sarissa.getText(K.selectSingleNode("//xls:Building/@number"))}catch(H){var F=""}try{var J=Sarissa.getText(K.selectSingleNode("//xls:Street"))}catch(H){var J=""}try{var I=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='CountrySubdivision']"))}catch(H){var I=""}try{var L=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']"))}catch(H){var L=""}try{var M=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='Municipality']"))}catch(H){var M=""}try{var C=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='MunicipalitySubdivision']"))}catch(H){var C=""}try{var D=Sarissa.getText(K.selectSingleNode("//xls:PostalCode"))}catch(H){var D=""}var G=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));B[G](new Address(F,J,I,L,M,D,C))}};this.geocodeCallback=function(U){var N=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(U),"text/xml");if(document.all){N.setProperty("SelectionLanguage","XPath");N.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var K=[];var E=[];var T=[];if(N.selectNodes("//xls:Error").length>0){var O=Sarissa.getText(N.selectSingleNode("//xls:Response/@requestID"));B[O](K,E)}else{var M=new Array();try{var M=N.selectNodes("//xls:GeocodedAddress")}catch(S){var O=Sarissa.getText(N.selectSingleNode("//xls:Response/@requestID"));B[O](K,E);return false}for(var P=0;P<M.length;P++){var L=new GeocodedAddress();var Q=(Sarissa.serialize((M[P])));if(Q.indexOf("<gml:pos/>")>0){var I="0.0 0.0"}else{var I=Q.substring(Q.indexOf("<gml:pos>")+"<gml:pos>".length,Q.indexOf("</gml:pos>"))}L.position=new Position(I);if(Q.indexOf("<xls:freeFormAddress/>")>0){var C="NO ADDRESS FOUND"}else{var C=Q.substring(Q.indexOf("<xls:freeFormAddress>")+"<xls:freeFormAddress>".length,Q.indexOf("</xls:freeFormAddress>"))}L.freeFormAddress=new FreeFormAddress(C);if(Q.indexOf("<xls:BoundingBox>")<0){var H=null}else{var R=Q.substring(Q.indexOf("<xls:BoundingBox>")+"<xls:BoundingBox>".length,Q.indexOf("</xls:BoundingBox>"));var G=R.substring(R.indexOf('">')+'">'.length,R.indexOf("</gml"));var D=R.substring(R.indexOf("</gml")+5,R.length);var F=D.substring(D.indexOf('">')+'">'.length,D.indexOf("</gml"));var H=new BoundingBox(new Position(G),new Position(F))}L.boundingBox=H;if(Q.indexOf("matchType")<0){var J=null}else{var J=Q.substring(Q.indexOf("matchType="));J=J.substring(J.indexOf('"')+1);J=J.substring(0,J.indexOf('"'))}L.matchType=J;K.push(new Position(I));E.push(new FreeFormAddress(C));T.push(L)}var O=Sarissa.getText(N.selectSingleNode("//xls:Response/@requestID"));B[O](K,E,T)}}}function GLOBALS(){}GLOBALS.HYBRID="HYBRID";GLOBALS.STREET="STREET";GLOBALS.SATELLITE="SATELLITE";GLOBALS.PAN_PIXEL_DISTANCE=300;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=45000;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 }JSRequest.callbackFunctions[B.requestID](B.response);JSRequest.callbackFunctions[B.requestID]=null}else{}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;alert("request time out");JSRequest.callbackFunctions[A]=null;document.getElementsByTagName("head").item(0).removeChild(document.getElementById(B))}};JSRequest.send=function(U,G){if(JSRequest.xmlhttp){try{if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(Q){}}var V=new XMLHttpRequest();V.open("POST",Credentials.url,true)}catch(Q){alert(Q+"\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.")}V.onreadystatechange=function(){if(V.readyState==4){if(V.responseText==""){alert("Problem connecting to DDS Web Services: Please try again later or contact support");return }if(V.responseText&&V.responseText!=null&&V.responseText.indexOf("problem connecting to DDS")>0){alert("Problem connecting to DDS: Please try again later or contact support");return }G(V.responseText)}};V.send(U);return }if(JSRequest.host==null){JSRequest.holder.push(U);JSRequest.holder.push(G);if(JSRequest.hostInProgress){return }JSRequest.hostInProgress=true;var H=new XMLRequestFactory();var B=H.createRUOKRequestDOM(Utilities.getRequestId());U=B;G=JSRequest.getHost}try{if(typeof JSRequest.interceptorRequestFunction==="function"){if(!JSRequest.xmlhttp&&JSRequest.host==null){var D=Sarissa.serialize(U)}else{var D=Sarissa.serialize(JSRequest.interceptorRequestFunction(U))}}else{var D=Sarissa.serialize(U)}}catch(Q){alert("Application Error:\n\nAPI user application request interceptor function threw error:\n\n"+Q.message);return }var F=Credentials.url;max=1800;var R=F.length;var A=80;var P=(escape(D)).length;var J;var O=1;while(true){if(R+A+(P/O)<max){J=O;break}O++}var L="";var S=Math.ceil(D.length/J);var M=Utilities.getRequestId();var K=0;for(var O=1;O<=J;O++){JSRequest.callbackFunctions[M]=G;if(K==0){var E=Math.round(S*O-S)}else{var E=K}var C=Math.round(S*O);K=C;var I=D.substring(E,C);L=escape(I);var T=document.createElement("script");T.setAttribute("type","text/javascript");var N=F+"?reqID="+M+"&chunkNo="+O+"&numChunks="+J+"&callback=JSRequest.callbackRegistry&data="+L;N=N.replace(new RegExp("\\+","g"),"%2b");T.setAttribute("src",N);T.setAttribute("id",M+":"+O);document.getElementsByTagName("head").item(0).appendChild(T);setTimeout("JSRequest.checkTimeout('"+M+":"+O+"')",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.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}function Locale(C,B){this.language=C.toUpperCase();this.country=B.toUpperCase();var A=this;this.toString=function(){return A.country+"_"+A.language};this.getLanguage=function(){return A.language};this.getCountry=function(){return A.country};this.setLanguage=function(D){A.language=D};this.setCountry=function(D){A.country=D}}function Map(d){if(!d){alert("must supply the map div to construct the new Map");return false}this.mapDiv=d;this.type="map";this.routePreference=new RoutePreference("Fastest",new UOM("MI"));var AD=undefined;var A1="server";var L=false;var z=null;var H=null;var W=256;var n=Credentials.imgPath+"tile.png";var A0=new XMLRequestFactory();var AG=0;var AC=0;var Aw=0;var a=0;var l=null;var m=new Array();var AL=0;var Au=0;var Ao=false;var F=W;var c=0;var Ah=0;var Aa=0;var V=2;var Am="dashed";var A=document.all;var Ak=null;var E=null;var AX=0;var AW=0;var AF=0;var AE=0;var R=0;var Q=0;var u=0;var s=0;var Ag=0;var Ae=0;var AK=0;var AI=0;var AO=0;var AN=0;var At=0;var Ar=0;var t=null;var Af=this;var D=new Array();var B=new Array();var U=null;var Ab=false;var AA=true;var AJ=true;var f=new Array();var T="px";var AY=null;var Aj=null;var b=new RegExp("\\amp;","g");var o="STREET";var Y=new Array();var Al=new Array(0,0);var AT=new Date();var w=new Date();var Z=parseInt(d.style.height);var r=parseInt(d.style.width);var C=false;var AM=false;this.addCopyrightMessage=function(A3,A2,A4){Aj=document.createElement("DIV");Aj.id="copyright";if(A2&&A4){Aj.style.top=A4+T;Aj.style.left=A2+T}else{Aj.style.top=((parseInt(Af.mapDiv.style.height))-20)+T;Aj.style.left="1px"}Aj.style.backgroundColor="#ffffff";Aj.style.opacity="50";Aj.innerHTML=A3;Aj.style.filter="alpha(opacity=80)";Aj.style.opacity="0.8";Aj.style.borderWidth="1px";Aj.style.padding="1px";Aj.style.fontFamily="arial";Aj.style.fontColor="#000000";Aj.style.fontSize="11px";Aj.style.borderStyle="solid";Aj.style.borderColor="gray";Aj.style.display="block";Aj.style.position="absolute";Aj.style.zIndex=9999;Af.mapDiv.appendChild(Aj)};this.addCustomInfoWindow=function(y){if(!AY){AY=J()}if(l){l.removeChild(AY)}AY=y.html;AY.id="bubble";AY.type="custom";AY.offX=y.xOffset;AY.offY=y.yOffset;if(l){l.appendChild(AY)}_bubbleContent.style.position="absolute";_bubbleClose.style.zIndex="99999";AY.appendChild(_bubbleClose);AY.appendChild(_bubbleContent);if(y.icon){_bubbleClose.src=y.icon.src;_bubbleClose.style.top=y.icon.anchorY+T;_bubbleClose.style.left=y.icon.anchorX+T;if(y.icon.height){_bubbleClose.style.height=y.icon.height+T}if(y.icon.width){_bubbleClose.style.width=y.icon.width+T}if(Utilities.ie6&&_bubbleClose.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(_bubbleClose)}}};this.addAndCenterOnPin=function(y){this.addPin(y);this.panToPosition(y.position)};this.addEventListener=function(A3,A4){var A2=false;for(var y=0;y<f.length;y++){if(f[y]==A3){f[A3]=A4;A2=true;break}}if(!A2){f.push(A3);f[A3]=A4}};this.addOverlay=function(y){y.map=Af;A0.overlays.push(y);AS()};this.addScaleBar=function(A2){AD=A2;AD.map=Af;AD.calculate();var y=AD.getDiv();y.style.position="absolute";y.style.top=((parseInt(Af.mapDiv.style.height))-31)+T;y.style.left=((parseInt(Af.mapDiv.style.width))-122)+T;y.style.zIndex=9999;Af.mapDiv.appendChild(y)};this.removeOverlay=function(y){y.map=null;var A3=new Array();for(var A2=0;A2<A0.overlays.length;A2++){if(A0.overlays[A2]&&!A0.overlays[A2].equals(y)){A3.push(A0.overlays[A2])}}A0.overlays=A3;AS()};this.removeAllOverlays=function(){A0.overlays=[];AS(true)};this.removeOverlayById=function(A3){var A2=new Array();for(var y=0;y<A0.overlays.length;y++){if(A0.overlays[y]&&A0.overlays[y].id!=(A3)){A2.push(A0.overlays[y])}}A0.overlays=A2;if(A2.length==0){AS(true)}else{AS()}};this.setShapeRendering=function(y){if(!y||!y=="client"||!y=="server"){alert(" map.setShapeRendering() error:\n\n use 'client' or 'server'")}if(y=="server"){AQ()}else{AS()}A1=y;A0.rendering=y};this.getShapeRendering=function(){return A1};this.addPin=function(A3){if(t==null){throw new Exception("Error adding Pin, you can not add a pin until the center Position is set, in the case of geocoding with map.centerOnAddress(), add the pin in the callback from map.centerOnAddress()");return false}if(!AY){J()}var A6=U.getGXConvertedZoomLevel();var A7=Utilities.radsPerPixelAtZoom(256,A6);var A8=Utilities.lat2pix(t.lat,A7);var y=Utilities.lon2pix(t.lon,A7);var A2=Utilities.lat2pix(A3.position.lat,A7);var A5=Utilities.lon2pix(A3.position.lon,A7);var A4=new PixelPoint((W*AL)/2,(W*Au)/2);A3.setX(A4.x+At-Math.round(y-A5));A3.setY(A4.y+Ar+Math.round(A8-A2));A3.map=Af;B.push(A3);l.appendChild(A3.pinImg);if(A3.pinTxt){l.appendChild(A3.pinTxt)}};this.addMapTypeController=function(y){if(!y){alert("error adding mapTypeController to map");return false}_chooser=document.createElement("DIV");_chooser.id="mapTypeController";_chooser.style.top="5px";_chooser.style.left=((parseInt(Af.mapDiv.style.width))-207)+T;_chooser.style.backgroundColor="#ffffff";_chooser.style.opacity=50;mapReference=Af;_chooser.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>";_chooser.style.filter="alpha(opacity=80)";_chooser.style.opacity=0.8;_chooser.style.borderWidth="1px";_chooser.style.padding="4px";_chooser.style.fontFamily="Arial, sans-serif";_chooser.style.fontColor="black";_chooser.style.fontSize="11px";_chooser.style.fontWeight="bold";_chooser.style.borderStyle="solid";_chooser.style.borderColor="gray";_chooser.style.display="block";_chooser.style.position="absolute";_chooser.style.zIndex=9999;_chooser.onclick=function(A2){A2=A2||event;A2.stoppropagation?A2.stoppropagation():A2.cancelBubble=true};Af.mapDiv.appendChild(_chooser)};this.addZoomController=function(y){U=y;U.initialize(Af)};this.authenticate=function(A2,y){if(!A2||!y||A2==""||y==""){throw new Exception("Error calling Map.authenticate(), bad params");return false}Credentials.clientName=A2;Credentials.clientPassword=y};this.centerOnAddress=function(A4,A2,y){j();var A3=Utilities.getRequestId();if(A2){D[A3]=A2}Ak=A0.createMapAddressRequestDOM(A4,W,AL,Au,A3,U.getGXConvertedZoomLevel(),y);JSRequest.send(Ak,P)};this.centerOnPosition=function(y,A3,A2){t=y;j();var A4=Utilities.getRequestId();if(A3&&A3!=null){D[A4]=A3}Ak=A0.createMapRequestDOM(y,W,AL,Au,A4,U.getGXConvertedZoomLevel(),A2);JSRequest.send(Ak,AH)};this.changeCurrentMapStyle=function(y){setMapStyle(y)};this.clearInstanceListeners=function(){for(var y=0;y<f.length;y++){f[f[y]]=null;f[y]=null}};this.clearListeners=function(A2){for(var y=0;y<f.length;y++){if(f[y]==A2){f[f[y]]=null}}f[y]=null};this.getBoundingBox=function(){var BD=U.getGXConvertedZoomLevel();var A6=Utilities.radsPerPixelAtZoom(256,BD);var BA=Af.getCenterPosition();var A5=Utilities.lat2pix(BA.lat,A6);var y=A5+(Au*256/2);var A3=A5-(Au*256/2);var A9=Utilities.pix2lat(y,A6);var A8=Utilities.pix2lat(A3,A6);var A7=Utilities.lon2pix(BA.lon,A6);var A2=A7+(AL*256/2);var A4=A7-(AL*256/2);var BC=Utilities.pix2lon(A2,A6);var BB=Utilities.pix2lon(A4,A6);return new BoundingBox(new Position(A8,BB),new Position(A9,BC))};this.getGXPixelPoint=function(A5){var A3=Utilities.radsPerPixelAtZoom(W,U.getGXConvertedZoomLevel());var A4=Utilities.lat2pix(A5.lat,A3);var A2=Utilities.lon2pix(A5.lon,A3);return new PixelPointDP(A2,A4)};this.getGridSize=function(){return Au+" "+AL};this.getBoundingBoxViewable=function(){var A4=(parseInt(Af.mapDiv.style.height)/(W*Au));var y=(parseInt(Af.mapDiv.style.width)/(W*AL));var A3=U.getRadiusX()*y;var A2=U.getRadius()*A4;return Utilities.centerContextToBoundingBoxViewable(Af.getCenterPosition(),A3,A2)};this.getCenterPosition=function(){if(!t){throw new Exception("Center Position not set");return null}var A3=t.clone();var A5=U.getGXConvertedZoomLevel();var A2=Utilities.radsPerPixelAtZoom(256,A5);var A8=Utilities.lat2pix(A3.lat,A2);var A9=Utilities.lon2pix(A3.lon,A2);var A6=A9-AX;var A4=A8+AW;var A7=Utilities.pix2lat(A4,A2);var y=Utilities.pix2lon(A6,A2);return new Position(A7,y)};this.getPins=function(){return B};this.getZoomController=function(){return U};this.getZoomLck=function(){return Ab};this.hidePins=function(){for(var y=0;y<B.length;y++){if(B[y]&&B[y]!=null&&B[y].type=="pin"){B[y].pinImg.style.display="none";B[y].pinTxt.style.display="none"}}};this.hidePinsBeforeZoom=function(){for(var y=0;y<B.length;y++){if(B[y]&&B[y]!=null&&B[y].type=="pin"&&B[y].pinImg.style.display=="block"){B[y].zoomHide=true;B[y].pinImg.style.display="none";B[y].pinTxt.style.display="none"}}};this.panToPosition=function(A6){H=Af.getGXPixelPoint(A6);var A6=A6.clone();var A3=Utilities.radsPerPixelAtZoom(256,U.getGXConvertedZoomLevel());var A5=Af.getCenterPosition();var A9=Utilities.centerContextToBoundingBox(A5,U.getRadius());var A2=Utilities.lat2pix(A5.lat,A3);var A4=Utilities.lon2pix(A5.lon,A3);var y=Utilities.lat2pix(A6.lat,A3);var A8=Utilities.lon2pix(A6.lon,A3);var A7=new PixelPoint(Math.round(A4-A8),Math.round(A2-y));if(A9.extendedContains(A6)){S(A7.x,-1*A7.y)}else{this.centerOnPosition(A6)}};this.panWest=function(){S(GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panEast=function(){S(-GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panNorth=function(){S(0,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouth=function(){S(0,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthEast=function(){S(-GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthEast=function(){S(-GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthWest=function(){S(GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthWest=function(){S(GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.removeAllPins=function(){for(var y=0;y<B.length;y++){try{if(B[y]&&B[y]!=null){Utilities.purge(B[y].pinImg);l.removeChild(B[y].pinImg);B[y].pinImg=null;if(B[y].pinTxt){Utilities.purge(B[y].pinTxt);l.removeChild(B[y].pinTxt);B[y].pinTxt=null}}B[y]=null}catch(A2){throw new Exception("error removing all pins\n\n"+A2.message)}}B=new Array()};this.removePin=function(y,A3){if(y.pinTxt){Utilities.purge(y.pinTxt);l.removeChild(y.pinTxt);y.pinTxt=null}Utilities.purge(y.pinImg);l.removeChild(y.pinImg);var A2=0;if(A3){A2=parseInt(A3)}for(A2;A2<B.length;A2++){if(B[A2]&&B[A2].equals(y)){y=null;B.splice(A2,1);return }}};this.removePinById=function(A2){for(var y=0;y<B.length;y++){if(B[y]&&B[y].id==A2){Af.removePin(B[y],y);return }}};this.removePinsById=function(A3){var A2=[];for(var y=0;y<B.length;y++){if(B[y]&&B[y].id==A3){A2.push(B[y])}}for(var y=0;y<A2.length;y++){Af.removePin(A2[y])}};this.resize=function(y,A2){Af.mapDiv.style.height=parseInt(y)+T;Af.mapDiv.style.width=parseInt(A2)+T;L=true;if(l){Af.reDrawMap()}};this.routeMap=function(A3,A2){requestId=Utilities.getRequestId();D[requestId]=A2;E=A0.createRouteGeometryRequestDOM(A3,requestId,Af.routePreference);var y=Sarissa.serialize(E);JSRequest.send(E,Ax)};this.setConfiguration=function(y){if(!y){alert("error calling Map.setConfiguration()");return false}Credentials.configuration=y};this.setDragEnabled=function(y){if(!"boolean"==(typeof y)){throw new Exception("Map.setDragEnabled requires boolean")}AA=y};this.setDoubleClickRecenteringEnabled=function(y){if(!"boolean"==(typeof y)){throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean")}AJ=y};this.setDoubleClickRecenterAndZoom=function(y){if(!"boolean"==(typeof y)){alert("Map.setDoubleClickRecenterAndZoom requires boolean")}AM=y};this.setTransparentConfiguration=function(y){if(!y){alert("error calling Map.setTransparentConfiguration()");return false}Credentials.transparentConfiguration=y};this.setCountryCode=function(y){if(!y){alert("error calling Map.setCountryCode()");return false}Credentials.ISOCountryCode=y};this.setMapStyle=function(A4){Credentials.configuration=A4;if(Ak!=null){var A3=Ak.selectSingleNode("//xls:RequestHeader");A3.setAttribute("configuration",A4);for(var A5=0;A5<Au;++A5){for(var A2=0;A2<AL;++A2){m[A5][A2][1].src=n;An(m[A5][A2][1],A4);m[A5][A2][1].loader.src=m[A5][A2][1].altSrc}}}};function An(y,A4){var A2=y.altSrc;if(A2.indexOf("?CONFIG=")>0){var A3=A2.substring(A2.indexOf("?"),(A2.indexOf("&")+1));y.altSrc=(A2).replace(A3,"?CONFIG="+A4+"&")}else{y.altSrc=(A2).replace("?","?CONFIG="+A4+"&")}var A3=y.altSrc;if(o=="STREET"){y.altSrc=(A3).replace("FORMAT=PNG","FORMAT=GIF")}else{y.altSrc=(A3).replace("FORMAT=GIF","FORMAT=PNG")}y.src=y.altSrc}this.setMapType=function(A3){if(!(A3=="STREET"||A3=="HYBRID"||A3=="SATELLITE")){alert("unsupported mapType\n\nUse 'STREET' || 'HYBRID' || 'SATELLITE'");return false}o=A3;Credentials.mapType=o;if(m.length>0){if(A3=="STREET"){for(var A4=0;A4<Au;++A4){for(var A2=0;A2<AL;++A2){m[A4][A2][0].src=n;m[A4][A2][1].src=n;An(m[A4][A2][1],Credentials.configuration);m[A4][A2][1].loader.src=m[A4][A2][1].altSrc}}}else{if(A3=="HYBRID"){for(var A4=0;A4<Au;++A4){for(var A2=0;A2<AL;++A2){m[A4][A2][0].src=n;m[A4][A2][1].src=n;m[A4][A2][0].src=m[A4][A2][0].altSrc;An(m[A4][A2][1],Credentials.transparentConfiguration);m[A4][A2][1].loader.src=m[A4][A2][1].altSrc}}}else{if(A3=="SATELLITE"){for(var A4=0;A4<Au;++A4){for(var A2=0;A2<AL;++A2){m[A4][A2][1].loader.src=n;m[A4][A2][0].src=n;m[A4][A2][0].src=m[A4][A2][0].altSrc;m[A4][A2][1].src=n}}}}}}};this.getRoutePreference=function(){return Af.routePreference};this.setRoutePreference=function(y){Af.routePreference=y};this.setTileBorder=function(A3){if(A3){Aa=1}else{Aa=0}for(var A4=0;A4<Au;++A4){for(var A2=0;A2<AL;++A2){m[A4][A2][0].border=Aa;m[A4][A2][1].border=Aa}}};this.setTileBuffer=function(y){if(y){V=2}else{V=1}};this.setURL=function(y){Credentials.url=y};this.showPins=function(){for(var y=0;y<B.length;y++){if(B[y]&&B[y]!=null&&B[y].type=="pin"){B[y].pinImg.style.display="block";B[y].pinTxt.style.display="block"}}};this.showPinsAfterZoom=function(){for(var y=0;y<B.length;y++){if(B[y]&&B[y]!=null&&B[y].type=="pin"&&B[y].zoomHide){B[y].pinImg.style.display="block";B[y].pinTxt.style.display="block";B[y].zoomHide=false}}};this.zoomMap=function(y){if(Ak==null){alert("Map not yet initialized.\nMap must be initialized before zooming.");return false}if(Ab){return false}Ab=true;var A2=U.getGXConvertedZoomLevel();U.setZoomLevel(y);var y=U.getGXConvertedZoomLevel();if(z&&H&&z.x&&H.x&&z.y&&H.y){var A6=z.x-H.x;var A4=z.y-H.y;var A5=parseFloat((A4/256))*-1;var A3=parseFloat((A6/256))*-1;Ak=A0.zoomMapRequestDOM(Ak,A5,0,A3,0,y,A2)}else{var A5=parseFloat(AG+(AI/W));var A3=parseFloat(Aw-(AK/W));Ak=A0.zoomMapRequestDOM(Ak,A5,AC,A3,a,y,A2)}z=0;H=0;j();JSRequest.send(Ak,K)};this.clearRoute=function(){A0.routeID=null;if(Ak==null){return false}var y=Ak.selectSingleNode("//xls:PortrayMapRequest");try{y.removeChild(y.selectSingleNode("//xls:Overlay"))}catch(A2){}};this.reDrawMap=function(){if(Ak==null){return false}Ak=(new DOMParser()).parseFromString(Sarissa.serialize(Ak),"text/xml");Ak.setProperty("SelectionLanguage","XPath");Ak.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var A4=Ak.selectSingleNode("//gml:pos");for(var y=0;y<A4.childNodes.length;y++){A4.removeChild(A4.childNodes[y])}var A3=Ak.createTextNode(Af.getCenterPosition().toString());A4.appendChild(A3);j();var A2=Ak.selectSingleNode("//xls:TileGrid");A2.setAttribute("rows",Au);A2.setAttribute("columns",AL);JSRequest.send(Ak,i)};function i(A8){var BC=Sarissa.getDomDocument();BC=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A8),"text/xml");BC.setProperty("SelectionLanguage","XPath");BC.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BC.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(BC.selectNodes("//@message"))[0].value);return false}var A7=BC.selectSingleNode("//xls:Pan[@direction='N']");var BB=BC.selectSingleNode("//xls:Pan[@direction='E']");Al=new Array(parseFloat(BB.getAttribute("numTiles"))*W,parseFloat(A7.getAttribute("numTiles"))*W);var BF=BC.selectNodes("//xls:URL");I(BF);var A5=BC.selectSingleNode("//xls:Radius");U.setRadius((parseFloat(Sarissa.getText(A5))/1000));t=new Position(Sarissa.getText(BC.selectSingleNode("//gml:pos")));Aq();z=Af.getGXPixelPoint(t);try{var y=BC.selectSingleNode("//xls:CenterContext");Ak=(new DOMParser()).parseFromString(Sarissa.serialize(Ak),"text/xml");Ak.setProperty("SelectionLanguage","XPath");Ak.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var A3=Ak.selectSingleNode("//xls:CenterContext");var A6=Ak.selectSingleNode("//xls:Output");A6.removeChild(A3);var BG=Ak.selectSingleNode("//xls:TileGrid");var A4=y.cloneNode(true);A6.insertBefore(A4,BG)}catch(BA){alert("sendMapRequest updating CenterContext from response \n\n\n"+BA.message)}var BE=parseInt(d.style.height);var A2=parseInt(d.style.width);var A9=Z-BE;var BD=r-A2;if(document.getElementById("copyright")){document.getElementById("copyright").style.top=parseInt(document.getElementById("copyright").style.top)-A9}if(document.getElementById("mapTypeController")){document.getElementById("mapTypeController").style.left=parseInt(document.getElementById("mapTypeController").style.left)-BD}if(AD){Af.addScaleBar(AD)}Z=BE;r=A2;AS()}function Ax(A4){var A9=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A4),"text/xml");A9.setProperty("SelectionLanguage","XPath");A9.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(A9.selectNodes("//xls:Error").length>0){var A6=Sarissa.getText(A9.selectSingleNode("//xls:Response/@requestID"));if(D[A6]){D[A6](null);D[A6]=null;return }else{return }}j();var A2=A9.selectSingleNode("//xls:RouteID");var A3=(A9.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data;var A5=(A9.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data;var BB=new BoundingBox(new Position(A3),new Position(A5));var A7=BB.getRadius();U.setRadius(A7);t=BB.getCenterPosition();var A8=U.getZoomLevelToFitBoundingBox(BB);U.setZoomLevel(A8);var y=A0.createCenterContext(BB.getCenterPosition(),U.getRadius());Ak=A0.createRouteMapDOM(y,A2,Utilities.getRequestId(),W,AL,Au,U.getGXConvertedZoomLevel(),Af.routePreference);var BA=Utilities.parseRoute(A9);var A6=Sarissa.getText(A9.selectSingleNode("//xls:Response/@requestID"));if(D[A6]){D[A6](BA);D[A6]=null}JSRequest.send(Ak,AH)}function AZ(A3){var A2=Sarissa.getDomDocument();A2=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A3),"text/xml");A2.setProperty("SelectionLanguage","XPath");A2.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(A2.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(A2.selectNodes("//@message"))[0].value);return false}var y=A2.selectSingleNode("//xls:Pan[@direction='N']");var A5=A2.selectSingleNode("//xls:Pan[@direction='E']");Al=new Array(parseFloat(A5.getAttribute("numTiles"))*W,parseFloat(y.getAttribute("numTiles"))*W);urlList=A2.selectNodes("//xls:URL");I(urlList);var A4=A2.selectSingleNode("//xls:Radius");U.setRadius((parseFloat(Sarissa.getText(A4))/1000));Aq()}function P(A8){var BD=Sarissa.getDomDocument();BD=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A8),"text/xml");BD.setProperty("SelectionLanguage","XPath");BD.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BD.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(BD.selectNodes("//@message"))[0].value);return false}var A5=BD.selectSingleNode("//xls:Pan[@direction='N']");var BB=BD.selectSingleNode("//xls:Pan[@direction='E']");Al=new Array(parseFloat(BB.getAttribute("numTiles"))*W,parseFloat(A5.getAttribute("numTiles"))*W);urlList=BD.selectNodes("//xls:URL");I(urlList);try{var A3=BD.selectSingleNode("//xls:Radius");U.setRadius((parseFloat(Sarissa.getText(A3))/1000));t=new Position(Sarissa.getText(BD.selectSingleNode("//gml:pos")));z=Af.getGXPixelPoint(t);var A7=Sarissa.getText(BD.selectSingleNode("//xls:freeFormAddress"));if(A7==""){A7="NO ADDRESS FOUND"}var A6=new FreeFormAddress(A7);Aq();var A9=Sarissa.getText(BD.selectSingleNode("//xls:Response/@requestID"));if(D[A9]){D[A9](A6,t);D[A9]=null}var y=BD.selectSingleNode("//xls:CenterContext");Ak=(new DOMParser()).parseFromString(Sarissa.serialize(Ak),"text/xml");Ak.setProperty("SelectionLanguage","XPath");Ak.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var BC=Ak.selectSingleNode("//xls:CenterAddress");var A4=Ak.selectSingleNode("//xls:Output");A4.removeChild(BC);var BE=Ak.selectSingleNode("//xls:TileGrid");var A2=y.cloneNode(true);A4.insertBefore(A2,BE)}catch(BA){alert("Error updating the request center context from the response for subsequent requests.\n\n"+BA.name+"\n\n"+BA.message)}if(AD){AD.calculate()}}function AH(A7){var BB=Sarissa.getDomDocument();BB=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A7),"text/xml");BB.setProperty("SelectionLanguage","XPath");BB.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(BB.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(BB.selectNodes("//@message"))[0].value);return false}var A6=BB.selectSingleNode("//xls:Pan[@direction='N']");var BA=BB.selectSingleNode("//xls:Pan[@direction='E']");Al=new Array(parseFloat(BA.getAttribute("numTiles"))*W,parseFloat(A6.getAttribute("numTiles"))*W);var BC=BB.selectNodes("//xls:URL");I(BC);var A4=BB.selectSingleNode("//xls:Radius");U.setRadius((parseFloat(Sarissa.getText(A4))/1000));Aq();var A8=Sarissa.getText(BB.selectSingleNode("//xls:Response/@requestID"));if(D[A8]&&D[A8]!=null){D[A8](t);D[A8]=null}z=Af.getGXPixelPoint(t);try{var y=BB.selectSingleNode("//xls:CenterContext");Ak=(new DOMParser()).parseFromString(Sarissa.serialize(Ak),"text/xml");Ak.setProperty("SelectionLanguage","XPath");Ak.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var A2=Ak.selectSingleNode("//xls:CenterContext");var A5=Ak.selectSingleNode("//xls:Output");A5.removeChild(A2);var BD=Ak.selectSingleNode("//xls:TileGrid");var A3=y.cloneNode(true);A5.insertBefore(A3,BD)}catch(A9){alert("sendMapRequest updating CenterContext from response \n\n\n"+A9.message)}if(AD){AD.calculate()}}function K(A6){var A9=Sarissa.getDomDocument();A9=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A6),"text/xml");A9.setProperty("SelectionLanguage","XPath");A9.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");t=new Position(A9.selectSingleNode("//gml:pos/text()").data);z=Af.getGXPixelPoint(t);var A4=A9.selectSingleNode("//xls:Pan[@direction='N']");var A8=A9.selectSingleNode("//xls:Pan[@direction='E']");Al=new Array(parseFloat(A8.getAttribute("numTiles"))*W,parseFloat(A4.getAttribute("numTiles"))*W);var BA=A9.selectNodes("//xls:URL");I(BA);try{Ak=(new DOMParser()).parseFromString(Sarissa.serialize(Ak),"text/xml");Ak.setProperty("SelectionLanguage","XPath");Ak.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var A5=A9.selectSingleNode("//xls:CenterContext");var y=Ak.selectSingleNode("//xls:CenterContext");var A3=Ak.selectSingleNode("//xls:Output");A3.removeChild(y);var BB=Ak.selectSingleNode("//xls:TileGrid");var A2=A5.cloneNode(true);A3.insertBefore(A2,BB);if((Ak.selectSingleNode("//xls:Radius/@unit").value)=="M"){U.setRadius((parseFloat(A9.selectSingleNode("//xls:Radius/text()").data)/1000))}else{U.setRadius((parseFloat(A9.selectSingleNode("//xls:Radius/text()").data)))}Ab=false;Aq();if(f.zoomend){f.zoomend()}if(AD){AD.calculate()}}catch(A7){alert("Map.sendZoomRequest\n\n"+A7.message)}}function I(A3){if(AD){AD.calculate()}var A6=AL*Au;for(var A7=0;A7<A6;A7++){try{Y[A7]=new URL(Sarissa.getText(A3[A7+A6]),Sarissa.getText(A3[A7]))}catch(A8){alert("error making URL array\n\n"+A8.message)}}var A4=0;var A5=new Array(Au);for(var A7=0;A7<Au;++A7){A5[A7]=new Array(AL)}for(var A9=0;A9<Au;++A9){for(var A2=0;A2<AL;++A2){A5[A9][A2]=Y[A4];A4++}}for(var A9=0;A9<Au;++A9){for(var A2=0;A2<AL;++A2){Ad(A2,A9,A5[A9][A2])}}AS();return ;for(var A9=1;A9<Au-1;++A9){for(var A2=1;A2<AL-1;++A2){Ad(A2,A9,A5[A9][A2])}}for(var A9=0;A9<Au;++A9){Ad(0,A9,A5[A9][0])}for(var A9=0;A9<Au;++A9){Ad(Au-1,A9,A5[A9][Au-1])}for(var A9=1;A9<Au-1;++A9){Ad(A9,Au-1,A5[Au-1][A9])}for(var A9=1;A9<Au-1;++A9){Ad(A9,0,A5[0][A9])}}function k(A2){var y;if(document.all){y=window.event.srcElement}else{y=A2.currentTarget}y.src=Credentials.errorTile}function Ad(A2,A4,A3){if(o=="SATELLITE"){m[A4][A2][0].style.zIndex=50;m[A4][A2][1].style.zIndex=100;m[A4][A2][0].style.top=parseInt(m[A4][A2][1].style.top)+Al[1]+T;m[A4][A2][0].style.left=parseInt(m[A4][A2][1].style.left)-Al[0]+T;m[A4][A2][0].src=A3.getGlobeExplorerURL();m[A4][A2][0].altSrc=A3.getGlobeExplorerURL();if(Utilities.ie6){m[A4][A2][1].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Credentials.imgPath+"tile.png')"}m[A4][A2][1].altSrc=A3.getDeCartaURL()}else{if(o=="STREET"){m[A4][A2][0].style.zIndex=50;m[A4][A2][1].style.zIndex=100;m[A4][A2][0].style.top=parseInt(m[A4][A2][1].style.top)+Al[1]+T;m[A4][A2][0].style.left=parseInt(m[A4][A2][1].style.left)-Al[0]+T;m[A4][A2][0].altSrc=A3.getGlobeExplorerURL();m[A4][A2][1].src=A3.getDeCartaURL();m[A4][A2][1].altSrc=A3.getDeCartaURL()}else{if(o=="HYBRID"){m[A4][A2][0].style.zIndex=1;m[A4][A2][0].style.top=parseInt(m[A4][A2][1].style.top)+Al[1]+T;m[A4][A2][0].style.left=parseInt(m[A4][A2][1].style.left)-Al[0]+T;m[A4][A2][0].src=A3.getGlobeExplorerURL();m[A4][A2][0].altSrc=A3.getGlobeExplorerURL();m[A4][A2][1].zIndex=10;m[A4][A2][1].altSrc=A3.getDeCartaURL();m[A4][A2][1].loader.src=m[A4][A2][1].altSrc}}}}function Aq(){var A6=Utilities.radsPerPixelAtZoom(256,U.getGXConvertedZoomLevel());for(var A5=0;A5<B.length;A5++){if(B[A5]&&B[A5]!=null){var A7=Utilities.lat2pix(t.lat,A6);var y=Utilities.lon2pix(t.lon,A6);var A2=Utilities.lat2pix(B[A5].position.lat,A6);var A4=Utilities.lon2pix(B[A5].position.lon,A6);var A3=new PixelPoint((W*AL)/2,(W*Au)/2);B[A5].setX(A3.x+At-Math.round(y-A4));B[A5].setY(A3.y+Ar+Math.round(A7-A2));l.appendChild(B[A5].pinImg);B[A5].hideInfoWindow();if(B[A5].pinTxt){l.appendChild(B[A5].pinTxt)}}}Af.showPinsAfterZoom()}function J(){try{AY=document.createElement("div");AY.type="default";_bubbleClose=document.createElement("img");_bubbleClose.src=Credentials.imgPath+"close.png";_bubbleClose.id="close";_bubbleClose.style.zIndex=1002;_bubbleClose.style.position="absolute";_bubbleClose.style.width="20px";_bubbleClose.style.height="20px";_bubbleClose.style.top="2px";_bubbleClose.style.left="178px";_bubbleClose.style.display="block";_bubbleClose.style.cursor="pointer";_bubbleClose.onclick=function(A2){A2=A2||event;A2.stoppropagation?A2.stoppropagation():A2.cancelBubble=true;document.getElementById("bubble").style.display="none"};_bubbleContent=document.createElement("div");_bubbleContent.style.padding="16px";_bubbleContent.style.zIndex=10001;_bubbleContent.id="bubbleContent";AY.id="bubble";AY.style.display="none";AY.style.width="200px";AY.style.backgroundColor="#ffffff";AY.style.opacity=50;AY.style.filter="alpha(opacity=90)";AY.style.opacity=0.9;AY.style.borderWidth=1;AY.style.borderStyle="solid";AY.style.position="absolute";AY.style.zIndex=1111;AY.style.display="none";AY.style.fontColor="#000000";AY.style.fontSize="11px";AY.appendChild(_bubbleClose);AY.appendChild(_bubbleContent);if(l!=null){l.appendChild(AY)}}catch(y){alert("Map.initBubble\n\n"+y.message)}}function Ai(){return false}function j(){if(l){AB();if(!L){return }else{L=false}}var BE=Af.mapDiv;var BA=parseInt(BE.style.height);var A7=parseInt(BE.style.width);var A2=BA>A7?BA:A7;var A3=true;var A4=true;Au=Math.ceil(BA/W)+V;if(Au%2!=0){A3=false}AL=Math.ceil(A7/W)+V;if(AL%2!=0){A4=false}if(A3!=A4){AL++}if(!U){U=new ZoomController();Af.addZoomController(U);U.hide()}BE.style.overflow="hidden";BE.style.position="relative";BE.style.zIndex=0;BE.style.unselectable="on";BE.oncontextmenu=Ai;BE.onmousedown=q;window.onmouseup=N;BE.onmouseup=AR;BE.ondblclick=AR;BE.onclick=AR;BE.unselectable="on";for(var A6=BE.childNodes.length-1;A6>=0;A6--){if(BE.childNodes.item(A6).id!="copyright"&&BE.childNodes.item(A6).id!="zoom"&&BE.childNodes.item(A6).id!="deCartaScaleBar"&&BE.childNodes.item(A6).id!="mapTypeController"){BE.removeChild(BE.childNodes.item(A6))}}l=document.createElement("div");l.id="tiles";l.style.position="absolute";l.style.left=0+T;l.style.top=0+T;l.style.zIndex=0;if(typeof l.onselectstart!="undefined"){l.onselectstart=function(){return false}}else{if(typeof l.style.MozUserSelect!="undefined"){l.style.MozUserSelect="none"}}BE.appendChild(l);AE=Utilities.getAbsoluteTop(l)+(parseInt(BE.style.height)/2);AF=Utilities.getAbsoluteLeft(l)+(parseInt(BE.style.width)/2);if(!AY){J()}AY.style.display="none";l.appendChild(AY);R=(AL*W)/2;Q=(Au*W)/2;At=-((AL*W)-A7)/2;Ar=-((Au*W)-BA)/2;var BB=At;var A8=Ar;m=new Array(Au);for(var A6=0;A6<Au;++A6){m[A6]=new Array(AL)}for(var BC=0;BC<Au;++BC){for(var BD=0;BD<AL;++BD){if(BD==0){BB=At}var A9=new Array();m[BC][BD]=A9;var A5=document.createElement("IMG");A5.style.position="absolute";A5.style.visibility="visible";A5.id="SATTILE";A5.onerror=k;A5.style.zIndex=0;A5.unselectable="on";A5.style.width=W+T;A5.style.height=W+T;A5.style.left=BB+T;A5.style.top=A8+T;A5.src=Credentials.imgPath+"tile.png";l.appendChild(A5);var BF=Ap(BB,A8);l.appendChild(BF);A9[0]=A5;A9[1]=BF;BB+=W}A8+=W}}function Ap(y,A3){var A2=document.createElement("IMG");A2.style.position="absolute";A2.style.height="256px";A2.style.width="256px";A2.unselectable="on";A2.style.visibility="visible";A2.id="MAPTILE";A2.style.zIndex=30;A2.style.left=y+T;A2.style.top=A3+T;A2.src=Credentials.imgPath+"x.gif";A2.loader=document.createElement("img");A2.loader.style.visibility="hidden";A2.loader.onload=function(){if(!A2.cleared){if(Utilities.ie6){A2.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')";A2.src=Credentials.imgPath+"x.gif"}else{A2.src=this.src}}};return A2}function Ay(){var A2=0;var A4=0;if(AK<-F){Aw++;for(var y=0;y<Au;++y){A2=parseInt(m[y][Ah][1].style.left)+(AL*W);m[y][Ah][1].style.left=(A2)+T;var A3=O(m[y][Ah][1].altSrc);m[y][Ah][1].altSrc=A3;A4=parseInt(m[y][Ah][0].style.left)+(AL*W);m[y][Ah][0].style.left=(A4)+T;var A5=O(m[y][Ah][0].altSrc);m[y][Ah][0].altSrc=A5;if(o=="HYBRID"){m[y][Ah][1].src=n;m[y][Ah][0].src=n;m[y][Ah][1].loader.src=m[y][Ah][1].altSrc;m[y][Ah][0].src=m[y][Ah][0].altSrc}else{if(o=="SATELLITE"){m[y][Ah][0].src=n;m[y][Ah][0].src=m[y][Ah][0].altSrc}else{if(o=="STREET"){m[y][Ah][1].src=n;m[y][Ah][1].src=m[y][Ah][1].altSrc}}}}Ah=(Ah+1)%AL;AK=AK+F;AS()}else{if(AK>=F){a++;Ah=(Ah==0)?Ah=(AL-1):--Ah;for(var y=0;y<Au;++y){A2=parseInt(m[y][Ah][0].style.left)-(AL*W);m[y][Ah][0].style.left=(A2)+T;var A3=v(m[y][Ah][0].altSrc);m[y][Ah][0].altSrc=A3;A4=parseInt(m[y][Ah][1].style.left)-(AL*W);m[y][Ah][1].style.left=(A4)+T;var A5=v(m[y][Ah][1].altSrc);m[y][Ah][1].altSrc=A5;if(o=="HYBRID"){m[y][Ah][1].src=n;m[y][Ah][0].src=n;m[y][Ah][1].loader.src=m[y][Ah][1].altSrc;m[y][Ah][0].src=m[y][Ah][0].altSrc}else{if(o=="SATELLITE"){m[y][Ah][0].src=n;m[y][Ah][0].src=m[y][Ah][0].altSrc}else{if(o=="STREET"){m[y][Ah][1].src=n;m[y][Ah][1].src=m[y][Ah][1].altSrc}}}}AK=AK-F;AS()}else{if(AI<-F){AC++;for(var y=0;y<AL;++y){A2=parseInt(m[c][y][0].style.top)+(Au*W);m[c][y][0].style.top=(A2)+T;var A3=Av(m[c][y][0].altSrc);m[c][y][0].altSrc=A3;A4=parseInt(m[c][y][1].style.top)+(Au*W);m[c][y][1].style.top=(A4)+T;var A5=Av(m[c][y][1].altSrc);m[c][y][1].altSrc=A5;if(o=="HYBRID"){m[c][y][1].src=n;m[c][y][0].src=n;m[c][y][1].loader.src=m[c][y][1].altSrc;m[c][y][0].src=m[c][y][0].altSrc}else{if(o=="SATELLITE"){m[c][y][0].src=n;m[c][y][0].src=m[c][y][0].altSrc}else{if(o=="STREET"){m[c][y][1].src=n;m[c][y][1].src=m[c][y][1].altSrc}}}}c=(c+1)%Au;AI=AI+F;AS()}else{if(AI>=-F){AG++;c=(c==0)?c=(Au-1):--c;for(var y=0;y<AL;++y){A2=parseInt(m[c][y][0].style.top)-(Au*W);m[c][y][0].style.top=(A2)+T;var A3=Az(m[c][y][0].altSrc);m[c][y][0].altSrc=A3;A4=parseInt(m[c][y][1].style.top)-(Au*W);m[c][y][1].style.top=(A4)+T;var A5=Az(m[c][y][1].altSrc);m[c][y][1].altSrc=A5;if(o=="HYBRID"){m[c][y][1].src=n;m[c][y][0].src=n;m[c][y][1].loader.src=m[c][y][1].altSrc;m[c][y][0].src=m[c][y][0].altSrc}else{if(o=="SATELLITE"){m[c][y][0].src=n;m[c][y][0].src=m[c][y][0].altSrc}else{if(o=="STREET"){m[c][y][1].src=n;m[c][y][1].src=m[c][y][1].altSrc}}}}AS();AI=AI-F}}}}}function Az(A2){var A5=A2.substring(0,A2.indexOf("&N="));var A4=A2.substring(A2.indexOf("&N="));var y=parseInt((A4.split("="))[1])+Au;var A3=parseInt((A4.split("="))[2]);A5+="&N="+y+"&E="+A3;return A5}function Av(A2){var A5=A2.substring(0,A2.indexOf("&N="));var A4=A2.substring(A2.indexOf("&N="));var y=parseInt((A4.split("="))[1])-Au;var A3=parseInt((A4.split("="))[2]);A5+="&N="+y+"&E="+A3;return A5}function O(A2){var A5=A2.substring(0,A2.indexOf("&N="));var A4=A2.substring(A2.indexOf("&N="));var y=parseInt((A4.split("="))[1]);var A3=parseInt((A4.split("="))[2])+AL;A5+="&N="+y+"&E="+A3;return A5}function v(A2){var A5=A2.substring(0,A2.indexOf("&N="));var A4=A2.substring(A2.indexOf("&N="));var y=parseInt((A4.split("="))[1]);var A3=parseInt((A4.split("="))[2])-AL;A5+="&N="+y+"&E="+A3;return A5}function AR(y){y=y||event;y.stoppropagation?y.stoppropagation():y.cancelBubble=true;if(y.type=="mouseup"){N(y);w=new Date()}else{if(y.type=="click"&&((w-AT)<300)){X(y)}else{if(y.type=="dblclick"){p(y)}}}}function X(A6){Af.mapDiv.style.cursor="pointer";Af.mapDiv.unselectable="on";var A9=(A?event.clientY:A6.clientY)-Utilities.getAbsoluteTop(l)+Utilities.getScrollTop();var A2=(A?event.clientX:A6.clientX)-Utilities.getAbsoluteLeft(l)+Utilities.getScrollLeft();var BE=Af.getCenterPosition();var A4=1-((parseInt(A9)-Ar+AW)/(W*Au));var A5=((parseInt(A2)-At+AX)/(W*AL));var BC=Af.getBoundingBox();var BD=U.getGXConvertedZoomLevel();var A3=Utilities.radsPerPixelAtZoom(256,BD);var BB=Math.round(Utilities.lat2pix(BC.minPosition.lat,A3));var A7=BB+((W*Au)*A4);var A8=Utilities.pix2lat(A7,A3);var BA=(BC.widthInDegrees*A5)+BC.getMinPosition().getLon();if(f.rightclick&&(A&&event.button==2)||(!A&&A6.which==3)){f.rightclick(new Position(A8,BA));return false}if(f.click&&A6.type=="click"){f.click(new Position(A8,BA))}if(f.dblclick&&A6.type=="dblclick"){f.dblclick(new Position(A8,BA))}}function q(y){AT=new Date();if((A&&event.button==2)||(!A&&y.which==3)){if(f.rightclick){X(y)}}if(!AA){N();return false}Ao=true;Af.mapDiv.style.cursor="move";u=A?event.clientX:y.clientX;s=A?event.clientY:y.clientY;document.body.onmousemove=M;return false}var As=false;function N(y){Ao=false;Af.mapDiv.style.cursor="default";document.body.onmousemove=null;if(As&&f.moveend){f.moveend();As=false}if(AD){AD.calculate()}return false}function p(A6){H=null;C=true;if(f.dblclick){X(A6)}if(!AJ){return false}var A7=A?event.clientX:A6.clientX;var A5=A?event.clientY:A6.clientY;var A2=Utilities.getAbsoluteLeft(Af.mapDiv)-Utilities.getScrollLeft();var y=Utilities.getAbsoluteTop(Af.mapDiv)-Utilities.getScrollTop();var A4=(parseInt(A7-A2)-Math.round(parseInt(Af.mapDiv.style.width)/2))*-1;var A3=(parseInt(A5-y)-Math.round(parseInt(Af.mapDiv.style.height)/2))*-1;S(A4,A3)}function AV(A2,A3){AX=-A2;AW=-A3;l.style.left=-A2+T;l.style.top=-A3+T}function M(A3){As=true;H=null;if(!Ao){return false}var A2=(A?event.clientX:A3.clientX)-u;var y=(A?event.clientY:A3.clientY)-s;AK+=A2;AI+=y;if(Math.abs(AK)>F){Ay()}if(Math.abs(AI)>F){Ay()}Ag-=A2;Ae-=y;AV(Ag,Ae);u=A?event.clientX:A3.clientX;s=A?event.clientY:A3.clientY;return false}var Ac=false;function S(A2,A3){if(A2>0){l.style.left=parseInt(l.style.left)+1+T}else{l.style.left=parseInt(l.style.left)-1+T}if(A3>0){l.style.top=parseInt(l.style.top)+1+T}else{l.style.top=parseInt(l.style.top)-1+T}Ac=true;AX=AX+(A2);AW=AW+(A3);G(A2,A3,true)}var h=0;var g=0;function G(A4,A3,A5){if(A5){h=A4}if(A5){g=A3}var A2=Math.round(Math.abs(h)*0.3);var y=Math.round(Math.abs(g)*0.3);if(A2>0||y>0){if(h<0){l.style.left=parseInt(l.style.left)-A2+T;h+=A2;AK-=A2;Ag+=A2;AO+=A2}else{if(h>0){l.style.left=parseInt(l.style.left)+A2+T;h-=A2;AK+=A2;Ag-=A2;AO-=A2}}if(g<0){l.style.top=parseInt(l.style.top)-y+T;g+=y;AI-=y;Ae+=y;AN+=y}else{if(g>0){l.style.top=parseInt(l.style.top)+y+T;g-=y;AI+=y;Ae-=y;AN-=y}}if(Math.abs(AK)>F||Math.abs(AI)>F){Ay()}setTimeout(G,1)}else{if(f.moveend){f.moveend()}if(AD){AD.calculate()}if(C&&AM){Af.getZoomController().zoomInOneLevel()}AO=0;AN=0;Ac=false;C=false;AS()}}function AB(){l.style.left=0+T;l.style.top=0+T;var A3=At;var A5=Ar;Af.hidePinsBeforeZoom();for(var A4=0;A4<Au;++A4){for(var A2=0;A2<AL;++A2){if(A2==0){A3=At}m[A4][A2][0].style.left=A3+T;m[A4][A2][0].style.top=A5+T;m[A4][A2][0].src=Credentials.imgPath+"tile.png";m[A4][A2][1].style.left=A3+T;m[A4][A2][1].style.top=A5+T;m[A4][A2][1].src=Credentials.imgPath+"tile.png";A3+=W}A5+=W}AX=0;AW=0;Ag=0;Ae=0;u=0;s=0;Ao=false;AK=0;AI=0;c=0;Ah=0;AG=0;AC=0;Aw=0;a=0}this.redraw=function(){AS()};function AQ(){if(A1=="server"){return }var A2=AU();var y=A2.getContext("2d");y.clearRect(0,0,A2.width,A2.height)}var AP=0;function AS(BI){var BI=BI||false;if(A1=="server"||!document.getElementById("tiles")){return }if(A0.overlays.length==0&&!BI){return }if(Ac){return }var A7=AU();var BO=Af.getGridSize().split(" ");A7.width=parseInt(BO[1])*256;A7.height=parseInt(BO[0])*256;var BC=U.getGXConvertedZoomLevel();var BR=Utilities.radsPerPixelAtZoom(256,BC);var y=Af.getBoundingBox();var A5=new Position(y.maxPosition.lat+" "+y.minPosition.lon);var A2=Math.round(Utilities.lat2pix(A5.lat,BR));var A4=Math.round(Utilities.lon2pix(A5.lon,BR));var A3=Af.mapDiv;var BE=-(((parseInt(BO[1])*256))-parseInt(A3.style.width))/2;var BG=-(((parseInt(BO[0])*256))-parseInt(A3.style.height))/2;var BF=document.getElementById("tiles");A7.style.top=BG-parseInt(BF.style.top)+"px";A7.style.left=BE-parseInt(BF.style.left)+"px";var BJ=A7.getContext("2d");BJ.lineCap="round";BJ.lineJoin="round";shapeStore=A0.overlays;for(var BD=0;BD<shapeStore.length;BD++){BJ.beginPath();var BL=shapeStore[BD].getFillColor();var BK=shapeStore[BD].getBorderColor();var A6=shapeStore[BD].getOpacity();BJ.lineWidth=shapeStore[BD].getBorderWidth();var BQ=BL.replace(")","");BQ=BQ.replace("(","");BQ=BQ.split(".");var BT=BK.replace(")","");BT=BT.replace("(","");BT=BT.split(".");BJ.fillStyle="rgba("+BQ[0]+","+BQ[1]+","+BQ[2]+",."+A6+")";BJ.strokeStyle="rgba("+BT[0]+","+BT[1]+","+BT[2]+",."+A6+")";if(shapeStore[BD].type=="polygon"){var BU=shapeStore[BD].getPositions();if(shapeStore[BD].getGeneralize()&&!shapeStore[BD].generalized[U.getZoomLevel()]){BU=Utilities.generalize(BU,U,10);shapeStore[BD].generalized[U.getZoomLevel()]=BU}else{if(shapeStore[BD].generalized[U.getZoomLevel()]){BU=shapeStore[BD].generalized[U.getZoomLevel()]}}for(var BM=0;BM<BU.length;BM++){var BB=(BU[BM]);var A9=Math.round(Utilities.lat2pix(BB.lat,BR));var BA=Math.round(Utilities.lon2pix(BB.lon,BR));var BP=parseInt(A4-BA);var BN=parseInt(A2-A9);if(BM==0){BJ.moveTo((BP*-1),(BN))}else{BJ.lineTo((BP*-1),(BN))}}if(!document.all){BJ.stroke()}BJ.fill()}else{if(shapeStore[BD].type=="line"){BJ.lineWidth=shapeStore[BD].getWidth();BJ.strokeStyle=BJ.fillStyle;var BU=shapeStore[BD].getPositions();if(shapeStore[BD].getGeneralize()&&!shapeStore[BD].generalized[U.getZoomLevel()]){BU=Utilities.generalize(BU,U,10);shapeStore[BD].generalized[U.getZoomLevel()]=BU}else{if(shapeStore[BD].generalized[U.getZoomLevel()]){BU=shapeStore[BD].generalized[U.getZoomLevel()]}}for(var BM=0;BM<BU.length;BM++){var BB=(BU[BM]);var A9=Math.round(Utilities.lat2pix(BB.lat,BR));var BA=Math.round(Utilities.lon2pix(BB.lon,BR));var BP=parseInt(A4-BA);var BN=parseInt(A2-A9);if(BM==0){BJ.moveTo((BP*-1),(BN))}else{BJ.lineTo((BP*-1),(BN))}}BJ.stroke()}else{if(shapeStore[BD].type=="circle"){var BB=shapeStore[BD].getPosition();var A9=Math.round(Utilities.lat2pix(BB.lat,BR));var BA=Math.round(Utilities.lon2pix(BB.lon,BR));var BP=parseInt(A4-BA);var BN=parseInt(A2-A9);var BH=shapeStore[BD].getRadius().getDegrees();var BS=Math.round(Utilities.lat2pix(BB.lat+BH,BR));var A8=parseInt(BS-A9);BJ.arc((BP*-1),BN,Math.abs(A8),0,Math.PI*2,true);BJ.fill();if(!document.all){BJ.stroke()}}}}}AP=U.getZoomLevel()}function AU(){if(!document.getElementById("tiles")){return null}var y;if(document.getElementById("canvas")){y=document.getElementById("canvas");y.style.position="relative";y.style.zIndex=100;var A2=document.getElementById("tiles");A2.appendChild(y)}else{y=document.getElementsByTagName("body")[0].appendChild(document.createElement("canvas"));y.id="canvas";if(typeof G_vmlCanvasManager!="undefined"){y=G_vmlCanvasManager.initElement(y)}y.style.position="relative";y.style.zIndex=100;var A2=document.getElementById("tiles");A2.appendChild(y)}return y}}function MapTypeController(){}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(A){this.params="?";for(x in A){if(A.hasOwnProperty(x)){this.params+=x+"="+A[x]+"&"}}};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 Pin(C,I,J,D){if(!C){throw new Exception("Error instantiating Pin, must at least provide a Position.");return false}this.type="pin";var H=this;var A=new Array();this.position=C;this.icon=D||new Icon(Credentials.imgPath+"greenDot.png",12,12,24,24);this.pinImg=null;this.pinTxt=null;this.zoomHide=false;this.id="";this.map=null;this.pinImg=document.createElement("img");this.pinImg.style.position="absolute";this.pinImg.id=C.toString();Pin.zIndexCounter++;this.pinImg.style.zIndex=Pin.zIndexCounter;this.pinImg.src=this.icon.src;this.pinImg.style.width=parseInt(this.icon.width)+"px";this.pinImg.style.height=parseInt(this.icon.height)+"px";this.pinTxt=document.createElement("DIV");this.pinTxt.innerHTML=this.icon.overlay.text;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.onmousedown=function(K){if((document.all&&event.button==2)||(!document.all&&K.which==3)){E(K)}else{G(K)}};this.pinTxt.onmouseover=function(K){F(K)};this.pinImg.style.cursor="pointer";this.pinTxt.style.cursor="pointer";this.pinImg.style.display="block";this.pinImg.msg=I||"";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.setId=function(K){this.id=K};this.getId=function(){return this.id};this.setCursorStyle=function(K){this.pinImg.style.cursor=K;this.pinTxt.style.cursor=K};this.getCursorStyle=function(){return this.pinImg.style.cursor};this.setIcon=function(K){H.pinImg.src=K.src;if(H.icon.anchorY==K.anchorY&&H.icon.anchorX==K.anchorX&&K._previousY&&K._previousX){H.pinImg.style.top=(parseInt(H.pinImg.style.top)+K._previousY-K.anchorY)+"px";H.pinImg.style.left=(parseInt(H.pinImg.style.left)+K._previousX-K.anchorX)+"px"}else{H.pinImg.style.top=(parseInt(H.pinImg.style.top)+H.icon.anchorY-K.anchorY)+"px";H.pinImg.style.left=(parseInt(H.pinImg.style.left)+H.icon.anchorX-K.anchorX)+"px"}H.pinImg.style.width=K.width+"px";H.pinImg.style.height=K.height+"px";H.icon=K;if(K.overlay.text!=""){H.pinTxt.innerHTML=this.icon.overlay.text;H.pinTxt.style.position="absolute";if(K.overlay.color){H.pinTxt.style.color=K.overlay.color}if(K.overlay.size){H.pinTxt.style.fontSize=K.overlay.size}if(K.overlay.fontFamily){H.pinTxt.style.fontFamily=K.overlay.fontFamily}H.pinTxt.style.left=(parseInt(H.pinImg.style.left)+parseInt(H.icon.overlay.anchorX))+"px";H.pinTxt.style.top=(parseInt(H.pinImg.style.top)+parseInt(H.icon.overlay.anchorY))+"px";H.pinTxt.style.zIndex=200;H.pinTxt.onmousedown=function(M){if((document.all&&event.button==2)||(!document.all&&M.which==3)){E(M)}else{G(M)}};H.pinTxt.onmouseover=function(M){F(M)}}else{H.pinTxt.innerHTML=""}if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){var L=this.pinImg.src;this.pinImg.src=Credentials.imgPath+"x.gif";this.pinImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+L+"',sizingMethod='scale')"}};this.getIcon=function(){return H.icon};this.setX=function(K){H.pinImg.style.left=(K-H.icon.anchorX)+"px";if(H.pinTxt){H.pinTxt.style.left=(K-H.icon.anchorX+H.icon.overlay.anchorX)+"px"}if(document.all){for(var L=0;L<A.length;L++){H.reRegister(A[L],A[A[L]])}}};this.setY=function(K){H.pinImg.style.top=(K-H.icon.anchorY)+"px";if(H.pinTxt){H.pinTxt.style.top=(K-H.icon.anchorY+H.icon.overlay.anchorY)+"px"}};this.getPosition=function(){return H.position};this.setPosition=function(O){if(H.map!=null){var L=H.map.getGXPixelPoint(H.position);var K=H.map.getGXPixelPoint(O);var N=parseInt(L.x)-parseInt(K.x);var M=parseInt(L.y)-parseInt(K.y);H.setX(parseInt(H.pinImg.style.left)+H.icon.anchorX-N);H.setY(parseInt(H.pinImg.style.top)+H.icon.anchorY+M)}H.position=O};this.setMessage=function(K){H.pinImg.msg=K;if(H.pinImg.id==document.getElementById("bubble").whichPin){document.getElementById("bubbleContent").innerHTML=K}};this.getMessage=function(){return H.pinImg.msg};this.hide=function(){H.pinImg.style.display="none";H.pinTxt.style.display="none"};this.show=function(){H.pinImg.style.display="block";H.pinTxt.style.display="block"};this.showInfoWindow=function(){if(document.getElementById("bubble").type=="custom"){document.getElementById("bubble").style.left=(parseInt(H.pinImg.style.left)-parseInt(document.getElementById("bubble").offX))+"px";document.getElementById("bubble").style.top=(parseInt(H.pinImg.style.top)-parseInt(document.getElementById("bubble").offY))+"px"}else{document.getElementById("bubble").style.left=(parseInt(H.pinImg.style.left)+(H.icon.anchorX*2)+2)+"px";document.getElementById("bubble").style.top=parseInt(H.pinImg.style.top)+"px"}document.getElementById("bubbleContent").innerHTML=H.pinImg.msg;document.getElementById("bubble").style.display="block";document.getElementById("bubble").whichPin=H.pinImg.id;if(document.all){document.getElementById("close").onclick=function(K){K=K||event;K.stoppropagation?K.stoppropagation():K.cancelBubble=true;document.getElementById("bubble").style.display="none"}}};this.hideInfoWindow=function(){document.getElementById("bubble").style.display="none"};this.reRegister=function(K,L){if(!H.pinImg.onclick&&K=="click"){H.pinImg.onclick=G}else{if(K=="rightclick"){H.pinImg.onmousedown=E}else{if(!H.pinImg.onmouseover&&K=="mouseover"){H.pinImg.onmouseover=F}else{if(!H.pinImg.onmouseout&&K=="mouseout"){H.pinImg.onmouseout=B}}}}};this.addEventListener=function(L,M){var N=false;for(var K=0;K<A.length;K++){if(A[K]==L){A[L]=M;N=true;break}}if(!N){A.push(L);A[L]=M}if(!H.pinImg.onclick&&L=="click"){H.pinImg.onclick=G}else{if(L=="rightclick"){H.pinImg.onmousedown=E}else{if(!H.pinImg.onmouseover&&L=="mouseover"){H.pinImg.onmouseover=F}else{if(!H.pinImg.onmouseout&&L=="mouseout"){H.pinImg.onmouseout=B}}}}};this.clearInstanceListeners=function(){for(var K=0;K<A.length;K++){A[A[K]]=null;A[K]=null}};this.clearListeners=function(L){for(var K=0;K<A.length;K++){if(A[K]==L){A[A[K]]=null}}A[K]=null};function G(K){K=K||event;K.stoppropagation?K.stoppropagation():K.cancelBubble=true;if(A.click){A.click(H)}}function E(K){K=K||event;K.stoppropagation?K.stoppropagation():K.cancelBubble=true;if(A.rightclick){if((document.all&&event.button==2)||(!document.all&&K.which==3)){A.rightclick(H)}return false}}function F(){if(A.mouseover){A.mouseover(H)}}function B(){if(A.mouseout){A.mouseout(H)}}if(J&&(J=="onmouseover"||J=="mouseover")){H.addEventListener("mouseover",H.showInfoWindow);H.addEventListener("mouseout",H.hideInfoWindow)}else{if(J&&(J=="onclick"||J=="click")){H.addEventListener("click",H.showInfoWindow)}}this.toString=function(){return H.position};this.equals=function(K){if(K&&K.toString()==this.toString()&&K.pinImg==this.pinImg){return true}else{return false}}}Pin.zIndexCounter=100;function PixelPoint(D,C){try{this.x=parseInt(D);this.y=parseInt(C)}catch(B){throw new Exception("bad constructor values for x/y")}var A=this;this.getX=function(){return parseInt(A.x)};this.getY=function(){return parseInt(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 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 POI(D,A,B,C){this.name=D;this.position=A;this.address=B;this.phoneNumber=C;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(C,E){var D=Utilities.getRequestId();B[D]=E;_xmlRequestDOM=this.xmlRecFac.createPOIRequestDOM(C,D);JSRequest.send(_xmlRequestDOM,A.queryCallback)};this.queryCallback=function(U){var J=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(U),"text/xml");if(document.all){J.setProperty("SelectionLanguage","XPath");J.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var F=new Array();if(J.selectNodes("//xls:Error").length>0){var L=Sarissa.getText(J.selectSingleNode("//xls:Response/@requestID"));B[L](null)}else{if(J.selectNodes("//xls:POI").length==0){var L=Sarissa.getText(J.selectSingleNode("//xls:Response/@requestID"));B[L](F)}else{var Q=J.selectNodes("//xls:POIContext");for(var S=0;S<Q.length;S++){var P=Sarissa.serialize((Q[S]));var K=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(P),"text/xml");if(document.all){K.setProperty("SelectionLanguage","XPath");K.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var R="xls:";if(navigator.userAgent.toLowerCase().indexOf("safari")!=-1){R=""}try{var V=Sarissa.getText(K.selectSingleNode("//"+R+"POI/@POIName"));var H=Sarissa.getText(K.selectSingleNode("//"+R+"POI/@phoneNumber"))}catch(T){}var G=P.substring(P.indexOf("<gml:pos>")+"<gml:pos>".length,P.indexOf("</gml:pos>"));var I="";var O="";var N="";var D="";var C="";var M="";try{I=Sarissa.getText(K.selectSingleNode("//"+R+"Building/@number"))}catch(T){}try{O=Sarissa.getText(K.selectSingleNode("//"+R+"Street"))}catch(T){}try{N=Sarissa.getText(K.selectSingleNode("//"+R+"Place[@type='CountrySubdivision']"))}catch(T){}try{D=Sarissa.getText(K.selectSingleNode("//"+R+"Place[@type='CountrySecondarySubdivision']"))}catch(T){}try{C=Sarissa.getText(K.selectSingleNode("//"+R+"Place[@type='Municipality']"))}catch(T){}try{M=Sarissa.getText(K.selectSingleNode("//"+R+"PostalCode"))}catch(T){}var E=new Address(I,O,N,D,C,M);F.push(new POI(V,new Position(G),E,H))}var L=Sarissa.getText(J.selectSingleNode("//xls:Response/@requestID"));B[L](F)}}}}function Position(D,A){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.TotalTime="";this.TotalDistance="";this.viaPointSequence="";this.RouteInstructions=[];this.RouteGeometry=[]}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}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};function RouteQuery(){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 RouteQuery, invalid parameters.");return false}Credentials.clientName=D;Credentials.clientPassword=C};this.query=function(C,D,F){var E=Utilities.getRequestId();B[E]=F;_xmlRequestDOM=this.xmlRecFac.createRouteGeometryRequestDOM(C,E,D,true);JSRequest.send(_xmlRequestDOM,A.queryCallback)};this.queryCallback=function(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'")}var D=new Array();if(E.selectNodes("//xls:Error").length>0){var F=Sarissa.getText(E.selectSingleNode("//xls:Response/@requestID"));B[F](null)}else{var C=Utilities.parseRoute(E);var F=Sarissa.getText(E.selectSingleNode("//xls:Response/@requestID"));B[F](C)}}}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}};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="deCartaScaleBar";C.style.width="120px";C.style.textAlign="center";C.appendChild(A);C.appendChild(B);this.map=map;this.frame=C;this.measure=A}ScaleBar.prototype.getDiv=function(){this.frame.style.position="relative";this.frame.style.top="0px";this.frame.style.left="0px";return this.frame};ScaleBar.prototype.calculate=function(){if(!this.map||!this.map.getZoomController()){return }try{this.map.getCenterPosition()}catch(I){return }var N=this.map.getZoomController().getGXConvertedZoomLevel();var D=Utilities.radsPerPixelAtZoom(256,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}function ServerMonitor(){this.xmlRecFac=new XMLRequestFactory();this.query=function(){var A=Utilities.getRequestId();_xmlRequestDOM=this.xmlRecFac.createRUOKRequestDOM(A);this.sendServerMonitorQueryRequest()};this.sendServerMonitorQueryRequest=function(){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(B){}}var A=new XMLHttpRequest();A.open("POST",Credentials.url,true);A.onreadystatechange=function(){if(A.readyState==4){try{if(A.status!=200){alert(ServerMonitor.WS_ERR);return false}}catch(D){alert(ServerMonitor.WS_ERR);return false}var C=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(A.responseText),"text/xml");if(document.all){C.setProperty("SelectionLanguage","XPath");C.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}if(C.selectNodes("//xls:Error").length>0){if(((C.selectNodes("//@message"))[0].value).indexOf("internal problem connecting to DDS")>-1){alert(ServerMonitor.DDS_ERR)}else{if(((C.selectNodes("//@message"))[0].value).indexOf("'rel' attribute")>-1){alert(ServerMonitor.VER_ERR)}else{alert((C.selectNodes("//@message"))[0].value)}}return false}}};A.send(_xmlRequestDOM)}}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.";function TextOverlay(E,B,F,C,D,A){this.text=E;this.anchorX=B;this.anchorY=F;this.color=C||null;this.size=D||null;this.fontFamily=A||null;this.toString=function(){return this.text+" "+this.anchorX+" "+this.anchorY+" "+this.size+" "+A}}TextOverlay.prototype.getAnchorX=function(){return this.anchorX};TextOverlay.prototype.getAnchorY=function(){return this.anchorY};TextOverlay.prototype.getText=function(){return this.text};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.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 B=new Array();var A=this;this.authenticate=function(D,C){if(!D||!C||D==""||C==""){alert("Error authenticating TrafficIncidentQuery, invalid parameters.");return false}Credentials.clientName=D;Credentials.clientPassword=C};this.query=function(C,E){var D=Utilities.getRequestId();B[D]=E;_xmlRequestDOM=this.xmlRecFac.createTrafficIncidentRequestDOM(C,D);JSRequest.send(_xmlRequestDOM,A.queryCallback)};this.queryCallback=function(E){var K=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(E),"text/xml");if(document.all){K.setProperty("SelectionLanguage","XPath");K.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var C=new Array();if(K.selectNodes("//xls:Error").length>0){var H=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));B[H](null)}else{if(K.selectNodes("//xls:Incident").length==0){var H=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));B[H](C)}else{var D=K.selectNodes("//xls:Incident");for(var F=0;F<D.length;F++){var I=Sarissa.serialize((D[F]));var L=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(I),"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 M=Sarissa.getText(L.selectSingleNode("//@severity"));var G=Sarissa.getText(L.selectSingleNode("//xls:Description"));var J=Sarissa.getText(L.selectSingleNode("//xls:Position"));C.push(new TrafficIncident(new Position(J),G))}var H=Sarissa.getText(K.selectSingleNode("//xls:Response/@requestID"));B[H](C)}}}}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.parseKML=function(I){var B=new RegExp("&","g");I=I.replace(B," ");var 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="";description=""}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.regx2=new RegExp("\\s","g");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=function(A){if(document.getElementById("___decarta_console")){document.getElementById("___decarta_console").innerHTML+="<br/>"+A}else{var B=document.createElement("div");B.style.position="absolute";B.style.top="10px";B.style.left="600px";B.style.fontSize="8pt";B.style.border="1px inset #cccccc";B.style.backgroundColor="#eeeeee";B.id="___decarta_console";document.body.appendChild(B);B.innerHTML+="<br/>"+A}};Utilities.c=function(){if(document.getElementById("___decarta_console")){document.getElementById("___decarta_console").innerHTML=""}};Utilities.generalize=function(J,P,H){var H=Math.round(H/2);var O=P.getGXConvertedZoomLevel();var D=Utilities.radsPerPixelAtZoom(256,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.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(B){var A="";for(x in B){A+="  "+x}alert(A)};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.pixYDist=function(G,E,C){var B=C.getGXConvertedZoomLevel();var A=Utilities.radsPerPixelAtZoom(256,B);var F=Math.round(Utilities.lat2pix(G,A));var D=Math.round(Utilities.lat2pix(E,A));return F-D};Utilities.pixXDist=function(D,C,G){var B=zoom.getGXConvertedZoomLevel();var A=Utilities.radsPerPixelAtZoom(256,B);var F=Math.round(Utilities.lon2pix(D,A));var E=Math.round(Utilities.lon2pix(C,A));return -(F-E)};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.parseRoute=function(I){var Q=new Route();var J=null;try{J=I.selectSingleNode("//xls:DetermineRouteResponse/@viaPointSequence").value}catch(P){}var A=Utilities.podParse(Sarissa.getText(I.selectSingleNode("//xls:TotalTime")));var G=I.selectSingleNode("//xls:TotalDistance/@value").value;var B=I.selectNodes("//xls:Instruction");var N=I.selectNodes("//xls:Point");var L=I.selectNodes("//xls:distance/@value");var F=I.selectNodes("//xls:RouteInstruction/@duration");var C=null;try{C=I.selectNodes("//xls:RouteInstruction/@tour")}catch(P){}Q.TotalTime=A;Q.TotalDistance=G;Q.viaPointSequence=J;Q.RouteInstructions=[];Q.RouteGeometry=[];var H=new RegExp("'","g");for(var O=0;O<B.length;O++){var E=(Sarissa.getText((B[O]))).replace(H,"");var D=Sarissa.getText((N[O]));var K=new RouteInstruction();K.Instruction=E;K.distance=L[O].value;K.duration=Utilities.podParse(F[O].value);K.position=D;if(C&&C.length>0){K.tour=C[O].value}Q.RouteInstructions.push(K)}var R=I.selectSingleNode("//gml:LineString");if(R){var M=R.childNodes;for(var O=0;O<M.length;O++){Q.RouteGeometry.push(new Position(Sarissa.getText(M[O])))}}return Q};function WSXMLTunnel(){this._store=[];var A=this;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._store[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._store[B](D)}}function XMLRequestFactory(){this.overlays=[];this.rendering="server";this.routeID=null;var A=this;this.getHeader=function(B,I,F){var F=F||"10";try{var C=Sarissa.getDomDocument();var D=C.createElement("xls:XLS");D.setAttribute("xls:lang","en");D.setAttribute("version","1");if(Credentials.rel&&Credentials.rel!=null){D.setAttribute("rel",Credentials.rel)}D.setAttribute("xmlns:xls","http://www.opengis.net/xls");D.setAttribute("xmlns:gml","http://www.opengis.net/gml");C.appendChild(D);var H=C.createElement("xls:RequestHeader");H.setAttribute("clientName",Credentials.clientName);if(Credentials.mapType=="STREET"){H.setAttribute("configuration",Credentials.configuration)}else{H.setAttribute("configuration",Credentials.transparentConfiguration)}H.setAttribute("sessionID",Utilities.getRequestId());H.setAttribute("clientPassword",Credentials.clientPassword);D.appendChild(H);var E=C.createElement("xls:Request");E.setAttribute("maximumResponses",F);E.setAttribute("version","1.0");E.setAttribute("requestID",I);E.setAttribute("methodName",B);D.appendChild(E);return C}catch(G){alert("XMLRequestFactory.this.getHeader\n\n"+G.message)}}}XMLRequestFactory.prototype.createMapAddressRequestDOM=function(K,J,Q,C,P,N,S){try{var E=this.getHeader("PortrayMapRequest",P);var W=E.createElement("xls:PortrayMapRequest");Utilities.getElementByTagName(E,"xls","Request").appendChild(W);var I=E.createElement("xls:Output");I.setAttribute("width",J);I.setAttribute("height",J);if(Credentials.mapType=="STREET"){I.setAttribute("format","GIF")}else{I.setAttribute("format","PNG")}I.setAttribute("content","URL");W.appendChild(I);var F=E.createElement("xls:CenterAddress");var V=E.createElement("xls:TileGrid");V.setAttribute("rows",C);V.setAttribute("columns",Q);var L=E.createElement("xls:GridLayer");L.setAttribute("name","globexplorer");L.setAttribute("meta-inf","zoom="+N);var X=E.createElement("xls:GridLayer");X.setAttribute("name","deCarta");V.appendChild(X);V.appendChild(L);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 U=E.createElement("xls:Pan");U.setAttribute("direction","W");U.setAttribute("numTiles","0");V.appendChild(B);V.appendChild(A);V.appendChild(G);V.appendChild(U);I.appendChild(F);I.appendChild(V);var R=E.createElement("xls:Address");R.setAttribute("countryCode",K.getLocale().getCountry());R.setAttribute("language",K.getLocale().getLanguage());F.appendChild(R);var D=E.createElement("xls:freeFormAddress");freeFormAddressValue=E.createTextNode(K.toString());D.appendChild(freeFormAddressValue);R.appendChild(D);if(Credentials.trafficEnabled){var O=E.createElement("xls:Overlay");var M=E.createElement("xls:Traffic");var H=E.createElement("xls:FlowReporting");if(S){H.setAttribute("time",S)}M.appendChild(H);O.appendChild(M);W.appendChild(O)}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(T){alert("XMLRequestFactory.prototype.createMapAddressRequestDOM\n\n"+T.message)}};XMLRequestFactory.prototype.createMapRequestDOM=function(H,L,S,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 K=E.createElement("xls:Output");K.setAttribute("width",L);K.setAttribute("height",L);if(Credentials.mapType=="STREET"){K.setAttribute("format","GIF")}else{K.setAttribute("format","PNG")}K.setAttribute("content","URL");X.appendChild(K);this.addOverlays(X,E);var F=E.createElement("xls:CenterContext");F.setAttribute("SRS","WGS-84");var W=E.createElement("xls:TileGrid");W.setAttribute("rows",C);W.setAttribute("columns",S);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 I=E.createElement("xls:Pan");I.setAttribute("direction","E");I.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(I);W.appendChild(V);K.appendChild(F);K.appendChild(W);var D=E.createElement("xls:Radius");D.setAttribute("unit","KM");radiusValue=E.createTextNode("0");radiusValue=E.createTextNode("200");D.appendChild(radiusValue);var R=E.createElement("xls:CenterPoint");var G=E.createElement("gml:pos");posTxt=E.createTextNode(H.getLatLon());G.appendChild(posTxt);R.appendChild(G);F.appendChild(R);F.appendChild(D);if(Credentials.trafficEnabled){var P=E.createElement("xls:Overlay");var N=E.createElement("xls:Traffic");var J=E.createElement("xls:FlowReporting");if(T){J.setAttribute("time",T)}N.appendChild(J);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.createBasicMapRequestDOM\n\n"+U.message)}};XMLRequestFactory.prototype.zoomMapRequestDOM=function(F,B,P,I,M,C,G){try{var L=(new DOMParser()).parseFromString(Sarissa.serialize(F),"text/xml");L.setProperty("SelectionLanguage","XPath");L.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var J=L.selectSingleNode("//xls:PortrayMapRequest");var A=L.selectSingleNode("//xls:Pan[@direction='N']");A.setAttribute("numTiles",B);var N=L.selectSingleNode("//xls:Pan[@direction='S']");N.setAttribute("numTiles",P);var E=L.selectSingleNode("//xls:Pan[@direction='E']");E.setAttribute("numTiles",I);var K=L.selectSingleNode("//xls:Pan[@direction='W']");K.setAttribute("numTiles",M);if(Credentials.mapType!="STREET"){var H=(L.selectSingleNode("//xls:RequestHeader"));H.setAttribute("configuration",Credentials.transparentConfiguration)}else{var H=(L.selectSingleNode("//xls:RequestHeader"));H.setAttribute("configuration",Credentials.configuration)}var D=(L.selectSingleNode("//xls:Output"));if(Credentials.mapType=="STREET"){D.setAttribute("format","GIF")}else{D.setAttribute("format","PNG")}var O=L.selectSingleNode("//xls:GridLayer[@name='globexplorer']");O.setAttribute("meta-inf","zoom="+C+":"+G);return L}catch(I){alert("XMLRequestFactory.prototype.zoomMapRequestDOM\n\n"+I.message)}};XMLRequestFactory.prototype.changeMapStyleRequestDOM=function(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(A,F){try{var B=this.getHeader("GeocodeRequest",F);var E=B.createElement("xls:GeocodeRequest");E.setAttribute("returnFreeForm","true");Utilities.getElementByTagName(B,"xls","Request").appendChild(E);var C=B.createElement("xls:Address");C.setAttribute("countryCode",A.getLocale().getCountry());C.setAttribute("language",A.getLocale().getLanguage());E.appendChild(C);var G=B.createElement("xls:freeFormAddress");freeFormAddressValue=B.createTextNode(A.toString());G.appendChild(freeFormAddressValue);C.appendChild(G);return B}catch(D){alert("XMLRequestFactory.prototype.getGeocodeRequestDOM\n\n"+D.message)}};XMLRequestFactory.prototype.createReverseGeocodeRequestDOM=function(F,A){try{var E=this.getHeader("ReverseGeocodeRequest",A);var K=E.createElement("xls:ReverseGeocodeRequest");K.setAttribute("returnFreeForm","true");Utilities.getElementByTagName(E,"xls","Request").appendChild(K);var D=E.createElement("xls:Position");var I=E.createElement("gml:Point");var H=E.createElement("gml:pos");var B=E.createTextNode(F.getLatLon());H.appendChild(B);I.appendChild(H);D.appendChild(I);K.appendChild(D);var J=E.createElement("xls:ReverseGeocodePreference");var C=E.createTextNode("StreetAddress");J.appendChild(C);K.appendChild(J);return E}catch(G){alert("XMLRequestFactory.prototype.createReverseGeocodeRequestDOM\n\n"+G.message)}};XMLRequestFactory.prototype.createCenterContext=function(C,E){var D=Sarissa.getDomDocument();var B=D.createElement("xls:CenterContext");B.setAttribute("SRS","WGS-84");var A=D.createElement("xls:Radius");A.setAttribute("unit","KM");radiusValue=D.createTextNode(Utilities.formatRadiusToString(E));A.appendChild(radiusValue);var G=D.createElement("xls:CenterPoint");var F=D.createElement("gml:pos");posTxt=D.createTextNode(C);F.appendChild(posTxt);G.appendChild(F);B.appendChild(G);B.appendChild(A);return B};XMLRequestFactory.prototype.createRouteGeometryRequestDOM=function(O,L,A,D){try{var E=this.getHeader("DetermineRouteRequest",L);var M=E.createElement("xls:DetermineRouteRequest");M.setAttribute("distanceUnit",A.uom);M.setAttribute("routeQueryType",A.routeQueryType);Utilities.getElementByTagName(E,"xls","Request").appendChild(M);var J=E.createElement("xls:RoutePlan");if(Credentials.trafficEnabled){J.setAttribute("useRealTimeTraffic","true")}if(A.optimized){J.setAttribute("optimize","true")}if(Credentials.trafficEnabled&&A.expectedStartTime){J.setAttribute("expectedStartTime",A.expectedStartTime)}M.appendChild(J);var H=E.createElement("xls:RoutePreference");var F=E.createTextNode(A.routePreference);H.appendChild(F);J.appendChild(H);var S=E.createElement("xls:WayPointList");for(var Q=0;Q<O.length;Q++){if(Q==0){var K=E.createElement("xls:StartPoint");var T=E.createElement("xls:Position");var N=E.createElement("gml:Point");var G=E.createElement("gml:pos");var P=E.createTextNode(O[Q]);G.appendChild(P);N.appendChild(G);T.appendChild(N);K.appendChild(T);S.appendChild(K)}else{if(Q>0&&Q<(O.length-1)){var U=E.createElement("xls:ViaPoint");var T=E.createElement("xls:Position");var N=E.createElement("gml:Point");var G=E.createElement("gml:pos");var P=E.createTextNode(O[Q]);G.appendChild(P);N.appendChild(G);T.appendChild(N);U.appendChild(T);S.appendChild(U)}else{if(Q==(O.length-1)){var I=E.createElement("xls:EndPoint");var T=E.createElement("xls:Position");var N=E.createElement("gml:Point");var G=E.createElement("gml:pos");var P=E.createTextNode(O[Q]);G.appendChild(P);N.appendChild(G);T.appendChild(N);I.appendChild(T);S.appendChild(I)}}}}J.appendChild(S);var C=E.createElement("xls:RouteInstructionsRequest");C.setAttribute("providePoint","true");var B=E.createElement("xls:RouteGeometryRequest");if(A.rules!=null){C.setAttribute("rules",A.rules)}if(!D){B.setAttribute("returnRouteIDOnly","true")}M.appendChild(C);M.appendChild(B);return E}catch(R){alert("XMLRequestFactory.prototype.createRouteGeometryRequestDOM\n\n"+R.message)}};XMLRequestFactory.prototype.createRouteMapDOM=function(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);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(M,G){var E=this.getHeader("DirectoryRequest",G,M.maximumResponses);var A=E.createElement("xls:DirectoryRequest");if(M.database!=null){A.setAttribute("database",M.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 H=E.createElement("xls:WithinDistance");C.appendChild(H);var F=E.createElement("xls:MaximumDistance");F.setAttribute("value",M.radius.distance);F.setAttribute("uom",M.radius.uom.value);var L=E.createElement("xls:MinimumDistance");L.setAttribute("unit",M.radius.uom.value);L.setAttribute("value","0");var J=E.createElement("xls:POI");J.setAttribute("ID","1");var K=E.createElement("gml:Point");var I=E.createElement("gml:pos");var B=E.createTextNode(M.position.toString());I.appendChild(B);K.appendChild(I);J.appendChild(K);H.appendChild(J);H.appendChild(L);H.appendChild(F);var N=E.createElement("xls:POIProperties");var D=E.createElement("xls:POIProperty");N.appendChild(D);A.appendChild(N);D.setAttribute("name","POIName");D.setAttribute("value",M.queryString);return E};XMLRequestFactory.prototype.createRUOKRequestDOM=function(C){var B=this.getHeader("RuokRequest",C);var A=B.createElement("xls:RUOKRequest");Utilities.getElementByTagName(B,"xls","Request").appendChild(A);return B};XMLRequestFactory.prototype.addOverlays=function(I,F){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)}};XMLRequestFactory.prototype.createTrafficIncidentRequestDOM=function(H,D){var C=this.getHeader("TrafficRequest",D,H.maxiumResponses);var B=C.createElement("xls:TrafficRequest");Utilities.getElementByTagName(C,"xls","Request").appendChild(B);var I=C.createElement("xls:IncidentReporting");I.setAttribute("minimumSeverity",H.minimumSeverity);B.appendChild(I);var A=C.createElement("xls:CenterContext");A.setAttribute("SRS","WGS-84");var E=C.createElement("xls:Radius");E.setAttribute("unit",H.radius.uom.value);radiusValue=C.createTextNode(H.radius.distance);E.appendChild(radiusValue);var F=C.createElement("xls:CenterPoint");var G=C.createElement("gml:pos");posTxt=C.createTextNode(H.position);G.appendChild(posTxt);F.appendChild(G);A.appendChild(F);A.appendChild(E);B.appendChild(A);return C};function ZoomController(D,C,B,K,I,A){if(D&&D<1||D>17){throw new Exception("Error instantiating ZoomController, invalid initial value "+D+".  The value must be between 1 and 17");return false}this.uncheckedSrc=K||Credentials.imgPath+"zoom.png";this.checkedSrc=B||Credentials.imgPath+"zoomChecked.png";this.color=C||"";this.selected=D||5;this.zoomLevels=17;this.lowerBound=1;this.upperBound=17;this.topCap=document.createElement("IMG");this.topCap.src=I||Credentials.imgPath+"zoomTop.png";this.topCap.style.height="17px";this.topCap.style.width="17px";this.topCap.style.padding="0px";if(Utilities.ie6){Utilities.fixPng(this.topCap)}this.bottomCap=document.createElement("IMG");this.bottomCap.src=A||Credentials.imgPath+"zoomBottom.png";if(!A){this.bottomCap.style.height="17px"}if(!A){this.bottomCap.style.width="17px"}if(Utilities.ie6){Utilities.fixPng(this.bottomCap)}this.bottomCap.style.padding="0px";var F=new Array();var G;var H;var J=this;this.zoomer;this.map;this.initialize=function(N){J.map=N;J.upperBound=J.zoomLevels;for(var M=J.lowerBound;M<=J.upperBound;M++){var L=document.createElement("img");L.style.height="9px";L.style.width="17px";L.id=""+M;L.src=J.uncheckedSrc;L.checkedSrc=J.checkedSrc;L.onclick=function(O){O=O||event;O.stoppropagation?O.stoppropagation():O.cancelBubble=true;if(N.getZoomLck()){return false}E();this.src=this.checkedSrc;N.zoomMap(this.id)};F.push(L)}J.zoomer=document.createElement("DIV");J.zoomer.style.cursor="pointer";J.zoomer.id="zoom";J.zoomer.style.width="20px";J.zoomer.style.top="1px";J.zoomer.style.left="1px";J.zoomer.style.opacity=50;J.zoomer.innerHTML="";J.zoomer.style.filter="alpha(opacity=80)";J.zoomer.style.opacity=0.8;J.zoomer.style.display="block";J.zoomer.style.position="absolute";J.zoomer.style.zIndex=9999;J.zoomer.appendChild(J.topCap);for(var M=0;M<F.length;M++){J.zoomer.appendChild(F[M])}J.zoomer.appendChild(J.bottomCap);N.mapDiv.appendChild(J.zoomer);J.topCap.onclick=function(O){O=O||event;O.stoppropagation?O.stoppropagation():O.cancelBubble=true;J.zoomInOneLevel()};J.bottomCap.onclick=function(O){O=O||event;O.stoppropagation?O.stoppropagation():O.cancelBubble=true;J.zoomOutOneLevel()};this.setZoomLevel(J.selected)};this.setZoomRange=function(L,M){if(L<1||M>21||L>M){alert("illegal values setZoomRange")}if(J.selected>M){J.selected=M}if(J.selected<L){J.selected=L}J.zoomLevels=M;J.lowerBound=L;J.upperBound=M};this.setZoomButtonImages=function(N,M){this.checkedSrc=N;this.uncheckedSrc=M;for(var L=0;L<F.length;L++){F[L].src=M}if(J.selected){F[J.selected-1].src=N}};this.setColor=function(L){this.zoomer.style.backgroundColor=L};this.show=function(){this.zoomer.style.display="block"};this.hide=function(){this.zoomer.style.display="none"};this.getRadius=function(){return G};this.setRadius=function(N){G=N;var M=J.map.getGridSize().split(" ");var O=M[0];var L=M[1];if(O==L){H=N}else{H=(G/O)*L}};this.getRadiusX=function(){return H};this.setRadiusX=function(L){H=L};this.getZoomLevel=function(){return J.selected};this.setZoomLevel=function(M){if(M&&M<J.lowerBound||M>J.upperBound){throw new Exception("Error calling setZoomLevel, out of range");return false}J.selected=M;E();for(var L=0;L<F.length;L++){if(F[L].id==M){F[L].src=J.checkedSrc}if(Utilities.ie6){Utilities.fixPng(F[L])}}};this.getGXConvertedZoomLevel=function(){return Math.abs(21-J.selected)};this.zoomToNewLevel=function(M){if(M&&M<J.lowerBound||M>J.upperBound){throw new Exception("Error calling zoomToNewLevel, out of range");return false}E();for(var L=0;L<F.length;L++){if(F[L].id==M){F[L].src=J.checkedSrc}if(Utilities.ie6){Utilities.fixPng(F[L])}}J.map.zoomMap(M)};this.zoomInOneLevel=function(){if(J.selected<=J.lowerBound){return false}E();for(var L=0;L<F.length;L++){if(F[L].id==J.selected){F[L].src=J.checkedSrc}}J.map.zoomMap(parseInt(J.selected)-1)};this.zoomOutOneLevel=function(){if(J.selected==J.zoomLevels){return false}E();for(var L=0;L<F.length;L++){if(F[L].id==J.selected){F[L].src=J.checkedSrc}}J.map.zoomMap(parseInt(J.selected)+1)};this.getZoomLevelToFitBoundingBox=function(O){var R=parseInt(J.map.mapDiv.style.height)/2;var S=parseInt(J.map.mapDiv.style.width)/2;for(var Q=20;Q>0;--Q){var N=Utilities.radsPerPixelAtZoom(256,Q);var U=Utilities.lat2pix(O.getCenterPosition().getLat(),N);var W=Utilities.lon2pix(O.getCenterPosition().getLon(),N);var P=Utilities.pix2lat(U+R,N);var V=Utilities.pix2lon(W+S,N);var M=Utilities.pix2lat(U-R,N);var T=Utilities.pix2lon(W-S,N);var L=new BoundingBox(new Position(M,T),new Position(P,V));if(L.contains(O.minPosition)&&L.contains(O.maxPosition)){return Math.abs(21-Q);break}}};this.getZoomLevelToFitPositions=function(L){var M=Utilities.positionsToBoundingBox(L);return J.getZoomLevelToFitBoundingBox(M)};this.setZoomValue=function(L){J.setZoomLevel(L)};function E(){for(var L=0;L<F.length;L++){F[L].src=J.uncheckedSrc}}};