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{return this.buildingNumber+" "+this.street+" "+this.municipality+" "+this.countrySubdivision+" "+this.postalCode}}}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*136)/2}else{return(this.widthInDegrees*136)/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="http://192.168.1.12:9080/openls/openls";Credentials.clientName="";Credentials.clientPassword="";Credentials.configuration="old-english-tile";Credentials.transparentConfiguration="transparent-tile";Credentials.mapType="STREET";Credentials.ISOCountryCode="US";Credentials.trafficEnabled=false;Credentials.purgecount=0;Credentials.rel="4.2.3";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"}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};DDSCircle.prototype.getPosition=function(){return this.position};DDSCircle.prototype.setRadius=function(A){this.radius=A};DDSCircle.prototype.getRadius=function(){return this.radius};function DDSLine(A){this.id=Math.floor(Math.random()*10000000);this.type="line";this.positions;this.width=A;this.VR7}DDSLine.prototype=new DDSShape();DDSLine.prototype.setPositions=function(A){this.positions=A};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};function DDSPolygon(){this.id=Math.floor(Math.random()*10000000);this.type="polygon";this.positions;this.VR7}DDSPolygon.prototype=new DDSShape();DDSPolygon.prototype.setPositions=function(A){A.push(A[0].clone());this.positions=A};DDSPolygon.prototype.getPositions=function(){return this.positions};DDSPolygon.prototype.setVR7=function(A){this.VR7=A};DDSPolygon.prototype.getVR7=function(){return this.VR7};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()};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 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;c=this.xmlRecFac.createGeocodeRequestDOM(C,D);JSRequest.send(c,A.geocodeCallback)};this.reverseGeocode=function(C,E){var D=Utilities.getRequestId();B[D]=E;c=this.xmlRecFac.createReverseGeocodeRequestDOM(C,D);JSRequest.send(c,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(E){var M=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(E),"text/xml");if(document.all){M.setProperty("SelectionLanguage","XPath");M.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'")}var K=new Array();var I=new Array();if(M.selectNodes("//xls:Error").length>0){var H=Sarissa.getText(M.selectSingleNode("//xls:Response/@requestID"));B[H](K,I)}else{var C=new Array();try{var C=M.selectNodes("//xls:GeocodedAddress")}catch(J){var H=Sarissa.getText(M.selectSingleNode("//xls:Response/@requestID"));B[H](K,I);return false}for(var F=0;F<C.length;F++){var D=(Sarissa.serialize((C[F])));if(D.indexOf("<gml:pos/>")>0){var L="0.0 0.0"}else{var L=D.substring(D.indexOf("<gml:pos>")+"<gml:pos>".length,D.indexOf("</gml:pos>"))}if(D.indexOf("<xls:freeFormAddress/>")>0){var G="NO ADDRESS FOUND"}else{var G=D.substring(D.indexOf("<xls:freeFormAddress>")+"<xls:freeFormAddress>".length,D.indexOf("</xls:freeFormAddress>"))}K.push(new Position(L));I.push(new FreeFormAddress(G))}var H=Sarissa.getText(M.selectSingleNode("//xls:Response/@requestID"));B[H](K,I)}}}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||!C||!F||!A){alert("Error instantiating Icon, missing parameters.\n\n as of release 4.2.1 height and width are required parameters for Icon construction\n\n\t Icon(src,iconAnchorX,iconAnchorY,width,height) all required\n\n the overlay is still optional");return false}this.bo;this.bn;var B=this;this.src=G;this.anchorX=E;this.anchorY=C;this.height=null;this.width=null;if(F){this.width=F}if(A){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.bo=this.anchorX;this.anchorX=A};Icon.prototype.setAnchorY=function(A){this.bn=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.cf=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){alert("request time out");JSRequest.callbackFunctions[A]=null;document.getElementsByTagName("head").item(0).removeChild(document.getElementById(B))}};JSRequest.send=function(R,E){if(JSRequest.xmlhttp){try{if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead")}catch(N){}}var S=new XMLHttpRequest();S.open("POST",Credentials.url,true)}catch(N){alert(N+"\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.")}S.onreadystatechange=function(){if(S.readyState==4){if(S.responseText==""){alert("Problem connecting to DDS Web Services: Please try again later or contact support");return }if(S.responseText&&S.responseText!=null&&S.responseText.indexOf("problem connecting to DDS")>0){alert("Problem connecting to DDS: Please try again later or contact support");return }E(S.responseText)}};S.send(R);return }if(JSRequest.host==null){JSRequest.holder.push(R);JSRequest.holder.push(E);if(JSRequest.hostInProgress){return }JSRequest.hostInProgress=true;var F=new XMLRequestFactory();var B=F.createRUOKRequestDOM(Utilities.getRequestId());R=B;E=JSRequest.getHost}try{if(typeof JSRequest.interceptorRequestFunction==="function"){if(!JSRequest.xmlhttp&&JSRequest.host==null){var C=Sarissa.serialize(R)}else{var C=Sarissa.serialize(JSRequest.interceptorRequestFunction(R))}}else{var C=Sarissa.serialize(R)}}catch(N){alert("Application Error:\n\nAPI user application request interceptor function threw error:\n\n"+N.message);return }var D=Credentials.url;max=1800;var O=D.length;var A=80;var M=(escape(C)).length;var H;var L=1;while(true){if(O+A+(M/L)<max){H=L;break}L++}var I="";var P=C.length/H;var J=Utilities.getRequestId();for(var L=1;L<=H;L++){JSRequest.callbackFunctions[J]=E;var G=C.substring(P*L-P,P*L);I=escape(G);var Q=document.createElement("script");Q.setAttribute("type","text/javascript");var K=D+"?reqID="+J+"&chunkNo="+L+"&numChunks="+H+"&callback=JSRequest.callbackRegistry&data="+I;K=K.replace(new RegExp("\\+","g"),"%2b");Q.setAttribute("src",K);Q.setAttribute("id",J+":"+L);document.getElementsByTagName("head").item(0).appendChild(Q);setTimeout("JSRequest.checkTimeout('"+J+":"+L+"')",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 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(mapContainer){if(!mapContainer){alert("must supply the map div to construct the new Map");return false}this.mapDiv=mapContainer;this.type="map";this.routePreference=new RoutePreference("Fastest",new UOM("MI"));var bk=false;var ar=null;var ay=null;var o=256;var v="img/html/css/images/deCarta//tile.png";var ai=new XMLRequestFactory();var cl=0;var ck=0;var cq=0;var cp=0;var j=null;var b=new Array();var g=0;var d=0;var ci=false;var ag=o;var p=0;var m=0;var bd=0;var bj=2;var ct="dashed";var av=document.all;var c=null;var at=null;var an=0;var am=0;var cc=0;var cb=0;var ca=0;var bz=0;var bc=0;var bb=0;var bh=0;var bg=0;var al=0;var ak=0;var co=0;var cn=0;var aw=0;var az=0;var r=null;var self=this;var k=new Array();var h=new Array();var aa=null;var bm=false;var bf=true;var aq=true;var q=new Array();var af="px";var w=null;var y=null;var cv=new RegExp("\\amp;","g");var x="STREET";var cj=new Array();var ad=new Array(0,0);var bi=new Date();var bs=new Date();var bx=parseInt(mapContainer.style.height);var ce=parseInt(mapContainer.style.width);var by=false;var bv=false;this.addCopyrightMessage=function(message,ae,ab){y=document.createElement("DIV");y.id="copyright";if(ae&&ab){y.style.top=ab+af;y.style.left=ae+af}else{y.style.top=((parseInt(self.mapDiv.style.height))-20)+af;y.style.left="1px"}y.style.opacity=50;y.innerHTML=message;y.style.filter="alpha(opacity=70)";y.style.opacity=0.7;y.style.borderWidth="0px";y.style.padding="1px";y.style.fontFamily="arial, sans-serif";y.style.fontColor="black";y.style.fontSize="11px";y.style.fontWeight="normal";y.style.borderStyle="solid";y.style.borderColor="gray";y.style.display="block";y.style.position="absolute";y.style.zIndex=9999;self.mapDiv.appendChild(y)};this.addCustomInfoWindow=function(infoWindow){if(!w){w=initBubble()}if(j){j.removeChild(w)}w=infoWindow.html;w.id="bubble";w.type="custom";w.offX=infoWindow.cf;w.offY=infoWindow.yOffset;if(j){j.appendChild(w)}_bubbleContent.style.position="absolute";_bubbleContent.style.padding="0px";w.appendChild(_bubbleClose);w.appendChild(_bubbleContent);if(infoWindow.icon==""){_bubbleClose.style.display="none"}else{if(infoWindow.icon){_bubbleClose.src=infoWindow.icon.src;if(infoWindow.icon.anchorY==-1){_bubbleClose.style.top="0"+af}else{_bubbleClose.style.top=infoWindow.icon.anchorY+af}_bubbleClose.style.left=infoWindow.icon.anchorX+af;if(infoWindow.icon.height){_bubbleClose.style.height=infoWindow.icon.height+af}if(infoWindow.icon.width){_bubbleClose.style.width=infoWindow.icon.width+af}if(Utilities.ie6&&_bubbleClose.src.match(new RegExp("\\bpng\\b","g"))){Utilities.fixPng(_bubbleClose)}}}};this.addAndCenterOnPin=function(pin){this.addPin(pin);this.panToPosition(pin.position)};this.addEventListener=function(event,callBack){var alreadyRegistered=false;for(var i=0;i<q.length;i++){if(q[i]==event){q[event]=callBack;alreadyRegistered=true;break}}if(!alreadyRegistered){q.push(event);q[event]=callBack}};this.addOverlay=function(overlay){ai.overlays.push(overlay)};this.removeOverlay=function(overlay){var ovr=ai.overlays;for(var i=0;i<ovr.length;i++){if(ovr[i]&&ovr[i].equals(overlay)){ovr[i]=null}}};this.removeOverlayById=function(id){var ovr=ai.overlays;for(var i=0;i<ovr.length;i++){if(ovr[i]&&ovr[i].id==id){ovr[i]=null}}};this.addPin=function(pin){if(r==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(!w){initBubble()}var gxZoom=aa.getGXConvertedZoomLevel();var scale=Utilities.radsPerPixelAtZoom(256,gxZoom);var cy=Utilities.lat2pix(r.lat,scale);var cx=Utilities.lon2pix(r.lon,scale);var py=Utilities.lat2pix(pin.position.lat,scale);var px=Utilities.lon2pix(pin.position.lon,scale);var pix=new PixelPoint((o*g)/2,(o*g)/2);pin.setX(pix.ae+aw-Math.round(cx-px));pin.setY(pix.ab+az+Math.round(cy-py));pin.map=self;h.push(pin);j.appendChild(pin.pinImg);if(pin.pinTxt){j.appendChild(pin.pinTxt)}};this.addMapTypeController=function(mapTypeController){if(!mapTypeController){alert("error adding mapTypeController to map");return false}_chooser=document.createElement("DIV");_chooser.id="mapTypeController";_chooser.style.top="5px";_chooser.style.left=((parseInt(self.mapDiv.style.width))-207)+af;_chooser.style.backgroundColor="#ffffff";_chooser.style.opacity=50;mapReference=self;_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(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true};self.mapDiv.appendChild(_chooser)};this.addZoomController=function(zoomController){aa=zoomController;aa.initialize(self)};this.authenticate=function(clientName,clientPassword){if(!clientName||!clientPassword||clientName==""||clientPassword==""){throw new Exception("Error calling Map.authenticate(), bad params");return false}Credentials.clientName=clientName;Credentials.clientPassword=clientPassword};this.centerOnAddress=function(freeFormAddress,callBack,trafficTime){populateTiles();var requestId=Utilities.getRequestId();if(callBack){k[requestId]=callBack}c=ai.createMapAddressRequestDOM(freeFormAddress,o,g,d,requestId,aa.getGXConvertedZoomLevel(),trafficTime);JSRequest.send(c,centerOnAddressCallback)};this.centerOnPosition=function(position,callBack,trafficTime){r=position;populateTiles();var requestId=Utilities.getRequestId();if(callBack&&callBack!=null){k[requestId]=callBack}c=ai.createMapRequestDOM(position,o,g,d,requestId,aa.getGXConvertedZoomLevel(),trafficTime);JSRequest.send(c,centerOnPositionCallback)};this.changeCurrentMapStyle=function(newStyle){setMapStyle(newStyle)};this.clearInstanceListeners=function(){for(var i=0;i<q.length;i++){q[q[i]]=null;q[i]=null}};this.clearListeners=function(event){for(var i=0;i<q.length;i++){if(q[i]==event){q[q[i]]=null}}q[i]=null};this.getBoundingBox=function(){return Utilities.centerContextToBoundingBox(self.getCenterPosition(),aa.getRadius())};this.getBoundingBoxViewable=function(){var viewPctY=(parseInt(self.mapDiv.style.height)/(o*d));var viewPctX=(parseInt(self.mapDiv.style.width)/(o*g));var radX=aa.getRadius()*viewPctX;var radY=aa.getRadius()*viewPctY;return Utilities.centerContextToBoundingBoxViewable(self.getCenterPosition(),radX,radY)};this.getCenterPosition=function(){if(!r){throw new Exception("Center Position not set");return null}var tmp=r.clone();var gxZoom=aa.getGXConvertedZoomLevel();var scale=Utilities.radsPerPixelAtZoom(256,gxZoom);var originalCenterY=Utilities.lat2pix(tmp.lat,scale);var originalCenterX=Utilities.lon2pix(tmp.lon,scale);var newCenterX=originalCenterX-an;var newCenterY=originalCenterY+am;var newLat=Utilities.pix2lat(newCenterY,scale);var newLon=Utilities.pix2lon(newCenterX,scale);return new Position(newLat,newLon)};this.getPins=function(){var tmp=new Array();for(var i=0;i<h.length;i++){if(h[i]){tmp.push(h[i])}}h=tmp;return h};this.getZoomController=function(){return aa};this.getZoomLck=function(){return bm};this.hidePins=function(){for(var i=0;i<h.length;i++){if(h[i]&&h[i]!=null&&h[i].type=="pin"){h[i].pinImg.style.display="none";h[i].pinTxt.style.display="none"}}};this.hidePinsBeforeZoom=function(){for(var i=0;i<h.length;i++){if(h[i]&&h[i]!=null&&h[i].type=="pin"&&h[i].pinImg.style.display=="block"){h[i].zoomHide=true;h[i].pinImg.style.display="none";h[i].pinTxt.style.display="none"}}};this.panToPosition=function(position){ay=self.getGXPixelPoint(position);var position=position.clone();var scale=Utilities.radsPerPixelAtZoom(256,aa.getGXConvertedZoomLevel());var tmp=self.getCenterPosition();var bbox=Utilities.centerContextToBoundingBox(tmp,aa.getRadius());var cy=Utilities.lat2pix(tmp.lat,scale);var cx=Utilities.lon2pix(tmp.lon,scale);var cy2=Utilities.lat2pix(position.lat,scale);var cx2=Utilities.lon2pix(position.lon,scale);var pix=new PixelPoint(Math.round(cx-cx2),Math.round(cy-cy2));if(bbox.extendedContains(position)){slider(pix.ae,-1*pix.ab)}else{r=position;EventRegistry.addListener(map,"zoomend",function(){EventRegistry.clearListeners(map,"zoomend");if(q["moveend"]){q["moveend"]();EventRegistry.clearListeners(map,"moveend")}});this.zoomMap(aa.getZoomLevel())}};this.zoomAndPanToPosition=function(position,zoomLevel){ay=self.getGXPixelPoint(position);var position=position.clone();var scale=Utilities.radsPerPixelAtZoom(256,aa.getGXConvertedZoomLevel());var tmp=self.getCenterPosition();var bbox=Utilities.centerContextToBoundingBox(tmp,aa.getRadius());var cy=Utilities.lat2pix(tmp.lat,scale);var cx=Utilities.lon2pix(tmp.lon,scale);var cy2=Utilities.lat2pix(position.lat,scale);var cx2=Utilities.lon2pix(position.lon,scale);var pix=new PixelPoint(Math.round(cx-cx2),Math.round(cy-cy2));r=position;EventRegistry.addListener(map,"zoomend",function(){EventRegistry.clearListeners(map,"zoomend");mapSliderElement.setOppositeValue(zoomLevel)});this.zoomMap(zoomLevel)};this.panWest=function(){slider(GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panEast=function(){slider(-GLOBALS.PAN_PIXEL_DISTANCE,0)};this.panNorth=function(){slider(0,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouth=function(){slider(0,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthEast=function(){slider(-GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthEast=function(){slider(-GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.panSouthWest=function(){slider(GLOBALS.PAN_PIXEL_DISTANCE,-GLOBALS.PAN_PIXEL_DISTANCE)};this.panNorthWest=function(){slider(GLOBALS.PAN_PIXEL_DISTANCE,GLOBALS.PAN_PIXEL_DISTANCE)};this.removeAllPins=function(){for(var i=0;i<h.length;i++){try{if(h[i]&&h[i]!=null){Utilities.purge(h[i].pinImg);j.removeChild(h[i].pinImg);h[i].pinImg=null;if(h[i].pinTxt){Utilities.purge(h[i].pinTxt);j.removeChild(h[i].pinTxt);h[i].pinTxt=null}}h[i]=null}catch(e){throw new Exception("error removing all pins\n\n"+e.message)}}h=new Array()};this.removePin=function(pin){if(pin!=null){pin.hideInfoWindow()}for(var i=0;i<h.length;i++){if(h[i]&&h[i].equals(pin)){h[i]=null}}if(pin.pinTxt){Utilities.purge(pin.pinTxt);j.removeChild(pin.pinTxt);pin.pinTxt=null}Utilities.purge(pin.pinImg);j.removeChild(pin.pinImg);pin=null};this.removePinsById=function(id){var pins=map.getPins();for(var i=0;i<pins.length;i++){if(pins[i].id==id){this.removePin(pins[i])}}};this.resize=function(height,width){self.mapDiv.style.height=parseInt(height)+af;self.mapDiv.style.width=parseInt(width)+af;bk=true;if(j){self.reDrawMap()}};this.routeMap=function(posList,callBack,expectedStartTime){requestId=Utilities.getRequestId();k[requestId]=callBack;at=ai.createRouteGeometryRequestDOM(posList,requestId,self.routePreference,expectedStartTime);JSRequest.send(at,routeGeoCallback)};this.setConfiguration=function(configuration){if(!configuration){alert("error calling Map.setConfiguration()");return false}Credentials.configuration=configuration};this.setDragEnabled=function(enabled){if(!"boolean"==(typeof enabled)){throw new Exception("Map.setDragEnabled requires boolean")}bf=enabled};this.setDoubleClickRecenteringEnabled=function(enabled){if(!"boolean"==(typeof enabled)){throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean")}aq=enabled};this.setDoubleClickRecenterAndZoom=function(enabled){if(!"boolean"==(typeof enabled)){alert("Map.setDoubleClickRecenterAndZoom requires boolean")}bv=enabled};this.setTransparentConfiguration=function(transparentConfiguration){if(!transparentConfiguration){alert("error calling Map.setTransparentConfiguration()");return false}Credentials.transparentConfiguration=transparentConfiguration};this.setCountryCode=function(ISOCountryCode){if(!ISOCountryCode){alert("error calling Map.setCountryCode()");return false}Credentials.ISOCountryCode=ISOCountryCode};this.setMapStyle=function(newStyle){Credentials.configuration=newStyle;if(c!=null){var tmp=c.selectSingleNode("//xls:RequestHeader");tmp.setAttribute("configuration",newStyle);for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){b[ab][ae][1].src=v;changeURLConf(b[ab][ae][1],newStyle);b[ab][ae][1].loader.src=b[ab][ae][1].altSrc}}}};function changeURLConf(img,newStyle){var tmp=img.altSrc;if(tmp.indexOf("?CONFIG=")>0){var tmp2=tmp.substring(tmp.indexOf("?"),(tmp.indexOf("&")+1));img.altSrc=(tmp).replace(tmp2,"?CONFIG="+newStyle+"&")}else{img.altSrc=(tmp).replace("?","?CONFIG="+newStyle+"&")}var tmp2=img.altSrc;if(x=="STREET"){img.altSrc=(tmp2).replace("FORMAT=PNG","FORMAT=GIF")}else{img.altSrc=(tmp2).replace("FORMAT=GIF","FORMAT=PNG")}img.src=img.altSrc}this.setMapType=function(mapType){if(!(mapType=="STREET"||mapType=="HYBRID"||mapType=="SATELLITE")){alert("unsupported mapType\n\nUse 'STREET' || 'HYBRID' || 'SATELLITE'");return false}x=mapType;Credentials.mapType=x;if(b.length>0){if(mapType=="STREET"){for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){b[ab][ae][0].src=v;b[ab][ae][1].src=v;changeURLConf(b[ab][ae][1],Credentials.configuration);b[ab][ae][1].loader.src=b[ab][ae][1].altSrc}}}else{if(mapType=="HYBRID"){for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){b[ab][ae][0].src=v;b[ab][ae][1].src=v;b[ab][ae][0].src=b[ab][ae][0].altSrc;changeURLConf(b[ab][ae][1],Credentials.transparentConfiguration);b[ab][ae][1].loader.src=b[ab][ae][1].altSrc}}}else{if(mapType=="SATELLITE"){for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){b[ab][ae][1].loader.src=v;b[ab][ae][0].src=v;b[ab][ae][0].src=b[ab][ae][0].altSrc;b[ab][ae][1].src=v}}}}}}};this.setRoutePreference=function(preference){self.routePreference=preference};this.setTileBorder=function(border){if(border){bd=1}else{bd=0}for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){b[ab][ae][0].border=bd;b[ab][ae][1].border=bd}}};this.setTileBuffer=function(buffer){if(buffer){bj=2}else{bj=1}};this.setURL=function(url){Credentials.url=url};this.showPins=function(){for(var i=0;i<h.length;i++){if(h[i]&&h[i]!=null&&h[i].type=="pin"){h[i].pinImg.style.display="block";h[i].pinTxt.style.display="block"}}};this.showPinsAfterZoom=function(){for(var i=0;i<h.length;i++){if(h[i]&&h[i]!=null&&h[i].type=="pin"&&h[i].zoomHide){h[i].pinImg.style.display="block";h[i].pinTxt.style.display="block";h[i].zoomHide=false}}};this.zoomMap=function(newZoomLevel){if(c==null){alert("Map not yet initialized.\nMap must be initialized before zooming.");return false}if(bm){return false}bm=true;var oldZoomLevel=aa.getGXConvertedZoomLevel();aa.setZoomLevel(newZoomLevel);var newZoomLevel=aa.getGXConvertedZoomLevel();if(ar&&ay&&ar.ae&&ay.ae&&ar.ab&&ay.ab){var db=ar.ae-ay.ae;var da=ar.ab-ay.ab;var factionalNorth=parseFloat((da/256))*-1;var factionalEast=parseFloat((db/256))*-1;c=ai.zoomMapRequestDOM(c,factionalNorth,0,factionalEast,0,newZoomLevel,oldZoomLevel)}else{var factionalNorth=parseFloat(cl+(ak/o));var factionalEast=parseFloat(cq-(al/o));c=ai.zoomMapRequestDOM(c,factionalNorth,ck,factionalEast,cp,newZoomLevel,oldZoomLevel)}ar=0;ay=0;populateTiles();JSRequest.send(c,zoomMapCallback)};this.reDrawMap=function(){if(c==null){return false}var pos=c.selectSingleNode("//gml:pos");for(var i=0;i<pos.childNodes.length;i++){pos.removeChild(pos.childNodes[i])}var posTxt=c.createTextNode(self.getCenterPosition().toString());pos.appendChild(posTxt);populateTiles();var tg=c.selectSingleNode("//xls:TileGrid");tg.setAttribute("rows",g);tg.setAttribute("columns",d);JSRequest.send(c,redrawMapCallback)};function redrawMapCallback(data){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(data),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(oDomDoc.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(oDomDoc.selectNodes("//@message"))[0].value);return false}var panN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");var panE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");ad=new Array(parseFloat(panE.getAttribute("numTiles"))*o,parseFloat(panN.getAttribute("numTiles"))*o);var urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");aa.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));r=new Position(Sarissa.getText(oDomDoc.selectSingleNode("//gml:pos")));realignPushPins();ar=self.getGXPixelPoint(r);try{var centerContext=oDomDoc.selectSingleNode("//xls:CenterContext");c=(new DOMParser()).parseFromString(Sarissa.serialize(c),"text/xml");c.setProperty("SelectionLanguage","XPath");c.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var centerContext2=c.selectSingleNode("//xls:CenterContext");var output=c.selectSingleNode("//xls:Output");output.removeChild(centerContext2);var tileGrid=c.selectSingleNode("//xls:TileGrid");output.insertBefore(centerContext,tileGrid)}catch(e){alert("sendMapRequest updating CenterContext from response \n\n\n"+e.message)}var height=parseInt(mapContainer.style.height);var width=parseInt(mapContainer.style.width);var diffHeight=bx-height;var diffWidth=ce-width;if(document.getElementById("copyright")){document.getElementById("copyright").style.top=parseInt(document.getElementById("copyright").style.top)-diffHeight}if(document.getElementById("mapTypeController")){document.getElementById("mapTypeController").style.left=parseInt(document.getElementById("mapTypeController").style.left)-diffWidth}bx=height;ce=width}function routeGeoCallback(data){var oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(data),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(oDomDoc.selectNodes("//xls:Error").length>0){var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));if(k[reqId]){k[reqId](null);k[reqId]=null;return }else{return }}populateTiles();var routeID=oDomDoc.selectSingleNode("//xls:RouteID");var posArr=new Array();var pin=null;for(var loop=0;loop<selectedPins.length;loop++){pin=commonPins.get(selectedPins[loop]);posArr[posArr.length]=pin.getPosition()}var bbox=Utilities.positionsToBoundingBox(posArr);var routeMapRadius=bbox.getRadius();aa.setRadius(routeMapRadius);r=bbox.getCenterPosition();var fit=aa.getZoomLevelToFitBoundingBox(bbox);aa.setZoomLevel(fit);var centerContext=ai.createCenterContext(bbox.getCenterPosition(),aa.getRadius());var trafficTime;if(trafficTime){c=ai.createRouteMapDOM(centerContext,routeID,Utilities.getRequestId(),o,g,d,aa.getGXConvertedZoomLevel(),self.routePreference,trafficTime)}else{c=ai.createRouteMapDOM(centerContext,routeID,Utilities.getRequestId(),o,g,d,aa.getGXConvertedZoomLevel(),self.routePreference)}var tt=Utilities.podParse(Sarissa.getText(oDomDoc.selectSingleNode("//xls:TotalTime")));var td=oDomDoc.selectSingleNode("//xls:TotalDistance/@value").value;var routeInstructions=oDomDoc.selectNodes("//xls:Instruction");var points=oDomDoc.selectNodes("//xls:Point");var valu=oDomDoc.selectNodes("//xls:distance/@value");var dura=oDomDoc.selectNodes("//xls:RouteInstruction/@duration");var jsonRoute="{'TotalTime':'"+tt+"','TotalDistance':'"+td+"', \n\t 'RouteInstructions': [ ";var quoteRemover=new RegExp("'","g");for(var i=0;i<routeInstructions.length;i++){var tmpInstr=(Sarissa.getText((routeInstructions[i]))).replace(quoteRemover,"");var tmpPoint=Sarissa.getText((points[i]));jsonRoute+="\n\t\t{  'Instruction':'"+tmpInstr+"', 'distance':'"+valu[i].value+"','duration':'"+Utilities.podParse(dura[i].value)+"' ,'position':'"+tmpPoint+"' }";if(routeInstructions.length-1!=i){jsonRoute+=","}}jsonRoute+="\n\t]\n}";var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));if(k[reqId]){k[reqId](eval("("+jsonRoute+")"));k[reqId]=null}JSRequest.send(c,centerOnPositionCallback)}function routeMapCallback(data){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(data),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(oDomDoc.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(oDomDoc.selectNodes("//@message"))[0].value);return false}var panN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");var panE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");ad=new Array(parseFloat(panE.getAttribute("numTiles"))*o,parseFloat(panN.getAttribute("numTiles"))*o);urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");aa.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));realignPushPins()}function centerOnAddressCallback(data){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(data),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(oDomDoc.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(oDomDoc.selectNodes("//@message"))[0].value);return false}var panN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");var panE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");ad=new Array(parseFloat(panE.getAttribute("numTiles"))*o,parseFloat(panN.getAttribute("numTiles"))*o);urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);try{var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");aa.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));r=new Position(Sarissa.getText(oDomDoc.selectSingleNode("//gml:pos")));ar=self.getGXPixelPoint(r);var ffaTemp=Sarissa.getText(oDomDoc.selectSingleNode("//xls:freeFormAddress"));if(ffaTemp==""){ffaTemp="NO ADDRESS FOUND"}var freeFormAddress=new FreeFormAddress(ffaTemp);realignPushPins();var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));if(k[reqId]){k[reqId](freeFormAddress,r);k[reqId]=null}var centerContext=oDomDoc.selectSingleNode("//xls:CenterContext");c=(new DOMParser()).parseFromString(Sarissa.serialize(c),"text/xml");c.setProperty("SelectionLanguage","XPath");c.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var centerAddress=c.selectSingleNode("//xls:CenterAddress");var output=c.selectSingleNode("//xls:Output");output.removeChild(centerAddress);var tileGrid=c.selectSingleNode("//xls:TileGrid");output.insertBefore(centerContext,tileGrid)}catch(e){alert("Error updating the request center context from the response for subsequent requests.\n\n"+e.name+"\n\n"+e.message)}}function centerOnPositionCallback(data){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(data),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");if(oDomDoc.selectNodes("//xls:Error").length>0){alert("Error Message:\n\n\n"+(oDomDoc.selectNodes("//@message"))[0].value);return false}var panN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");var panE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");ad=new Array(parseFloat(panE.getAttribute("numTiles"))*o,parseFloat(panN.getAttribute("numTiles"))*o);var urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");aa.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));r=new Position(Sarissa.getText(oDomDoc.selectSingleNode("//gml:pos")));ar=self.getGXPixelPoint(r);realignPushPins();var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));if(k[reqId]&&k[reqId]!=null){k[reqId](r);k[reqId]=null}ar=self.getGXPixelPoint(r);try{var centerContext=oDomDoc.selectSingleNode("//xls:CenterContext");c=(new DOMParser()).parseFromString(Sarissa.serialize(c),"text/xml");c.setProperty("SelectionLanguage","XPath");c.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var centerContext2=c.selectSingleNode("//xls:CenterContext");var output=c.selectSingleNode("//xls:Output");output.removeChild(centerContext2);var tileGrid=c.selectSingleNode("//xls:TileGrid");output.insertBefore(centerContext,tileGrid)}catch(e){alert("sendMapRequest updating CenterContext from response \n\n\n"+e.message)}if(mapSliderElement){mapSliderElement.setOppositeValue(map.getZoomController().getZoomLevel())}}function zoomMapCallback(data){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(data),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");r=new Position(oDomDoc.selectSingleNode("//gml:pos/text()").data);ar=self.getGXPixelPoint(r);var panN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");var panE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");ad=new Array(parseFloat(panE.getAttribute("numTiles"))*o,parseFloat(panN.getAttribute("numTiles"))*o);var urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);try{c=(new DOMParser()).parseFromString(Sarissa.serialize(c),"text/xml");c.setProperty("SelectionLanguage","XPath");c.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var newCenterContext=oDomDoc.selectSingleNode("//xls:CenterContext");var oldCenterContext=c.selectSingleNode("//xls:CenterContext");var output=c.selectSingleNode("//xls:Output");output.removeChild(oldCenterContext);var tileGrid=c.selectSingleNode("//xls:TileGrid");output.insertBefore(newCenterContext,tileGrid);if((c.selectSingleNode("//xls:Radius/@unit").value)=="M"){aa.setRadius((parseFloat(oDomDoc.selectSingleNode("//xls:Radius/text()").data)/1000))}else{aa.setRadius((parseFloat(oDomDoc.selectSingleNode("//xls:Radius/text()").data)))}bm=false;realignPushPins();if(q["zoomend"]){q["zoomend"]()}}catch(e){alert("Map.sendZoomRequest\n\n"+e.message)}}function updateUrlList(urlList){var imgCount=g*d;for(var i=0;i<imgCount;i++){try{cj[i]=new URL(Sarissa.getText(urlList[i+imgCount]),Sarissa.getText(urlList[i]))}catch(e){alert("error making URL array\n\n"+e.message)}}var urlcount=0;var tmpArrayOfURLs=new Array(d);for(var i=0;i<d;++i){tmpArrayOfURLs[i]=new Array(g)}for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){tmpArrayOfURLs[ab][ae]=cj[urlcount];urlcount++}}for(var ab=1;ab<d-1;++ab){for(var ae=1;ae<g-1;++ae){updateURL(ae,ab,tmpArrayOfURLs[ab][ae])}}for(var ab=0;ab<d;++ab){updateURL(0,ab,tmpArrayOfURLs[ab][0])}for(var ab=0;ab<d;++ab){updateURL(d-1,ab,tmpArrayOfURLs[ab][d-1])}for(var ab=1;ab<d-1;++ab){updateURL(ab,d-1,tmpArrayOfURLs[d-1][ab])}for(var ab=1;ab<d-1;++ab){updateURL(ab,0,tmpArrayOfURLs[0][ab])}}function updateURL(ae,ab,url){if(x=="SATELLITE"){b[ab][ae][0].style.zIndex=50;b[ab][ae][1].style.zIndex=100;b[ab][ae][0].style.top=parseInt(b[ab][ae][1].style.top)+ad[1]+af;b[ab][ae][0].style.left=parseInt(b[ab][ae][1].style.left)-ad[0]+af;b[ab][ae][0].src=url.getGlobeExplorerURL();b[ab][ae][0].altSrc=url.getGlobeExplorerURL();if(Utilities.ie6){b[ab][ae][1].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/html/css/images/deCarta/tile.png')"}b[ab][ae][1].altSrc=url.getDeCartaURL()}else{if(x=="STREET"){b[ab][ae][0].style.zIndex=50;b[ab][ae][1].style.zIndex=100;b[ab][ae][0].style.top=parseInt(b[ab][ae][1].style.top)+ad[1]+af;b[ab][ae][0].style.left=parseInt(b[ab][ae][1].style.left)-ad[0]+af;b[ab][ae][0].altSrc=url.getGlobeExplorerURL();b[ab][ae][1].src=url.getDeCartaURL();b[ab][ae][1].altSrc=url.getDeCartaURL()}else{if(x=="HYBRID"){b[ab][ae][0].style.zIndex=1;b[ab][ae][0].style.top=parseInt(b[ab][ae][1].style.top)+ad[1]+af;b[ab][ae][0].style.left=parseInt(b[ab][ae][1].style.left)-ad[0]+af;b[ab][ae][0].src=url.getGlobeExplorerURL();b[ab][ae][0].altSrc=url.getGlobeExplorerURL();b[ab][ae][1].zIndex=10;b[ab][ae][1].altSrc=url.getDeCartaURL();b[ab][ae][1].loader.src=b[ab][ae][1].altSrc}}}}function realignPushPins(){var scale=Utilities.radsPerPixelAtZoom(256,aa.getGXConvertedZoomLevel());for(var i=0;i<h.length;i++){if(h[i]&&h[i]!=null){var cy=Utilities.lat2pix(r.lat,scale);var cx=Utilities.lon2pix(r.lon,scale);var py=Utilities.lat2pix(h[i].position.lat,scale);var px=Utilities.lon2pix(h[i].position.lon,scale);var pix=new PixelPoint((o*g)/2,(o*g)/2);h[i].setX(pix.ae+aw-Math.round(cx-px));h[i].setY(pix.ab+az+Math.round(cy-py));j.appendChild(h[i].pinImg);h[i].hideInfoWindow();if(h[i].pinTxt){j.appendChild(h[i].pinTxt)}}}self.showPinsAfterZoom()}function initBubble(){try{w=document.createElement("div");w.type="default";_bubbleClose=document.createElement("img");_bubbleClose.src="/html/css/images/deCarta/close.png";_bubbleClose.id="close";w.style.zIndex=1000;_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(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;document.getElementById("bubble").style.display="none"};_bubbleContent=document.createElement("div");_bubbleContent.style.padding="16px";_bubbleContent.style.zIndex=10001;_bubbleContent.id="bubbleContent";w.id="bubble";w.style.display="none";w.style.width="200px";w.style.backgroundColor="#ffffff";w.style.opacity=50;w.style.filter="alpha(opacity=90)";w.style.opacity=0.9;w.style.borderWidth=1;w.style.borderStyle="solid";w.style.position="absolute";w.style.zIndex=1111;w.style.display="none";w.style.fontColor="#000000";w.style.fontSize="11px";w.appendChild(_bubbleClose);w.appendChild(_bubbleContent);if(j!=null){j.appendChild(w)}}catch(e){alert("Map.initBubble\n\n"+e.message)}}function devnull(){return false}function populateTiles(){if(j){reset();if(!bk){return }else{bk=false}}var mapPaneDiv=self.mapDiv;var mapDivHeight=parseInt(mapPaneDiv.style.height);var mapDivWidth=parseInt(mapPaneDiv.style.width);var greaterSide=mapDivHeight>mapDivWidth?mapDivHeight:mapDivWidth;var numberOfTiles=Math.ceil(greaterSide/o)+bj;d=numberOfTiles;g=numberOfTiles;if(!aa){aa=new ZoomController();self.addZoomController(aa);aa.hide()}mapPaneDiv.style.overflow="hidden";if(is_ie){mapPaneDiv.style.position="static"}else{mapPaneDiv.style.position="relative"}mapPaneDiv.style.zIndex=0;mapPaneDiv.oncontextmenu=devnull;mapPaneDiv.onmousedown=startDrag;window.onmouseup=endDrag;mapPaneDiv.onmouseup=capture;mapPaneDiv.ondblclick=capture;mapPaneDiv.onclick=capture;mapPaneDiv.unselectable="on";for(var i=mapPaneDiv.childNodes.length-1;i>=0;i--){if(mapPaneDiv.childNodes.item(i).id!="copyright"&&mapPaneDiv.childNodes.item(i).id!="zoom"&&mapPaneDiv.childNodes.item(i).id!="mapTypeController"){mapPaneDiv.removeChild(mapPaneDiv.childNodes.item(i))}}j=document.createElement("div");j.id="tiles";j.style.position="absolute";j.style.left=0+af;j.style.top=0+af;j.style.zIndex=0;mapPaneDiv.appendChild(j);cb=Utilities.getAbsoluteTop(j)+(parseInt(mapPaneDiv.style.height)/2);cc=Utilities.getAbsoluteLeft(j)+(parseInt(mapPaneDiv.style.width)/2);if(!w){initBubble()}w.style.display="none";j.appendChild(w);ca=(numberOfTiles*o)/2;bz=(numberOfTiles*o)/2;aw=-((numberOfTiles*o)-mapDivWidth)/2;az=-((numberOfTiles*o)-mapDivHeight)/2;var tmpX=aw;var tmpY=az;b=new Array(d);for(var i=0;i<d;++i){b[i]=new Array(g)}for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){if(ae==0){tmpX=aw}var layerArray=new Array();b[ab][ae]=layerArray;var img=document.createElement("IMG");img.style.position="absolute";img.style.visibility="visible";img.id="SATTILE";img.style.zIndex=0;img.border=0;img.unselectable="on";img.style.borderStyle="solid";img.style.width=o+af;img.style.height=o+af;img.style.left=tmpX+af;img.style.top=tmpY+af;img.src="/html/css/images/deCarta/tile.png";j.appendChild(img);var imgMap=createImage(tmpX,tmpY);j.appendChild(imgMap);layerArray[0]=img;layerArray[1]=imgMap;tmpX+=o}tmpY+=o}}function createImage(tmpX,tmpY){var imgMap=document.createElement("IMG");imgMap.style.position="absolute";imgMap.style.height="256px";imgMap.style.width="256px";imgMap.border=0;imgMap.style.borderStyle="solid";imgMap.unselectable="on";imgMap.style.visibility="visible";imgMap.id="MAPTILE";imgMap.style.zIndex=30;imgMap.style.left=tmpX+af;imgMap.style.top=tmpY+af;imgMap.src="/html/css/images/deCarta/x.gif";imgMap.loader=document.createElement("img");imgMap.loader.style.visibility="hidden";imgMap.loader.onload=function(){if(!imgMap.cleared){if(Utilities.ie6){imgMap.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')";imgMap.src="/html/css/images/deCarta/x.gif"}else{imgMap.src=this.src}}};return imgMap}function rotateTiles(){var tmp=0;var tmp1=0;if(al<-ag){cq++;for(var i=0;i<d;++i){tmp=parseInt(b[i][m][1].style.left)+(g*o);b[i][m][1].style.left=(tmp)+af;var tmpUrl=updateUrlEast(b[i][m][1].altSrc);b[i][m][1].altSrc=tmpUrl;tmp1=parseInt(b[i][m][0].style.left)+(g*o);b[i][m][0].style.left=(tmp1)+af;var tmpUrl1=updateUrlEast(b[i][m][0].altSrc);b[i][m][0].altSrc=tmpUrl1;if(x=="HYBRID"){b[i][m][1].src=v;b[i][m][0].src=v;b[i][m][1].loader.src=b[i][m][1].altSrc;b[i][m][0].src=b[i][m][0].altSrc}else{if(x=="SATELLITE"){b[i][m][0].src=v;b[i][m][0].src=b[i][m][0].altSrc}else{if(x=="STREET"){b[i][m][1].src=v;b[i][m][1].src=b[i][m][1].altSrc}}}}m=(m+1)%g;al=al+ag}else{if(al>=ag){cp++;m=(m==0)?m=(g-1):--m;for(var i=0;i<d;++i){tmp=parseInt(b[i][m][0].style.left)-(g*o);b[i][m][0].style.left=(tmp)+af;var tmpUrl=updateUrlWest(b[i][m][0].altSrc);b[i][m][0].altSrc=tmpUrl;tmp1=parseInt(b[i][m][1].style.left)-(g*o);b[i][m][1].style.left=(tmp1)+af;var tmpUrl1=updateUrlWest(b[i][m][1].altSrc);b[i][m][1].altSrc=tmpUrl1;if(x=="HYBRID"){b[i][m][1].src=v;b[i][m][0].src=v;b[i][m][1].loader.src=b[i][m][1].altSrc;b[i][m][0].src=b[i][m][0].altSrc}else{if(x=="SATELLITE"){b[i][m][0].src=v;b[i][m][0].src=b[i][m][0].altSrc}else{if(x=="STREET"){b[i][m][1].src=v;b[i][m][1].src=b[i][m][1].altSrc}}}}al=al-ag}else{if(ak<-ag){ck++;for(var i=0;i<g;++i){tmp=parseInt(b[p][i][0].style.top)+(d*o);b[p][i][0].style.top=(tmp)+af;var tmpUrl=updateUrlSouth(b[p][i][0].altSrc);b[p][i][0].altSrc=tmpUrl;tmp1=parseInt(b[p][i][1].style.top)+(d*o);b[p][i][1].style.top=(tmp1)+af;var tmpUrl1=updateUrlSouth(b[p][i][1].altSrc);b[p][i][1].altSrc=tmpUrl1;if(x=="HYBRID"){b[p][i][1].src=v;b[p][i][0].src=v;b[p][i][1].loader.src=b[p][i][1].altSrc;b[p][i][0].src=b[p][i][0].altSrc}else{if(x=="SATELLITE"){b[p][i][0].src=v;b[p][i][0].src=b[p][i][0].altSrc}else{if(x=="STREET"){b[p][i][1].src=v;b[p][i][1].src=b[p][i][1].altSrc}}}}p=(p+1)%d;ak=ak+ag}else{if(ak>=-ag){cl++;p=(p==0)?p=(d-1):--p;for(var i=0;i<g;++i){tmp=parseInt(b[p][i][0].style.top)-(d*o);b[p][i][0].style.top=(tmp)+af;var tmpUrl=updateUrlNorth(b[p][i][0].altSrc);b[p][i][0].altSrc=tmpUrl;tmp1=parseInt(b[p][i][1].style.top)-(d*o);b[p][i][1].style.top=(tmp1)+af;var tmpUrl1=updateUrlNorth(b[p][i][1].altSrc);b[p][i][1].altSrc=tmpUrl1;if(x=="HYBRID"){b[p][i][1].src=v;b[p][i][0].src=v;b[p][i][1].loader.src=b[p][i][1].altSrc;b[p][i][0].src=b[p][i][0].altSrc}else{if(x=="SATELLITE"){b[p][i][0].src=v;b[p][i][0].src=b[p][i][0].altSrc}else{if(x=="STREET"){b[p][i][1].src=v;b[p][i][1].src=b[p][i][1].altSrc}}}}ak=ak-ag}}}}}function updateUrlNorth(urlIn){var tileUrl=urlIn.substring(0,urlIn.indexOf("&N="));var panParams=urlIn.substring(urlIn.indexOf("&N="));var northValue=parseInt((panParams.split("="))[1])+d;var eastValue=parseInt((panParams.split("="))[2]);tileUrl+="&N="+northValue+"&E="+eastValue;return tileUrl}function updateUrlSouth(urlIn){var tileUrl=urlIn.substring(0,urlIn.indexOf("&N="));var panParams=urlIn.substring(urlIn.indexOf("&N="));var northValue=parseInt((panParams.split("="))[1])-d;var eastValue=parseInt((panParams.split("="))[2]);tileUrl+="&N="+northValue+"&E="+eastValue;return tileUrl}function updateUrlEast(urlIn){var tileUrl=urlIn.substring(0,urlIn.indexOf("&N="));var panParams=urlIn.substring(urlIn.indexOf("&N="));var northValue=parseInt((panParams.split("="))[1]);var eastValue=parseInt((panParams.split("="))[2])+g;tileUrl+="&N="+northValue+"&E="+eastValue;return tileUrl}function updateUrlWest(urlIn){var tileUrl=urlIn.substring(0,urlIn.indexOf("&N="));var panParams=urlIn.substring(urlIn.indexOf("&N="));var northValue=parseInt((panParams.split("="))[1]);var eastValue=parseInt((panParams.split("="))[2])-g;tileUrl+="&N="+northValue+"&E="+eastValue;return tileUrl}function capture(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;if(e.type=="mouseup"){endDrag(e);bs=new Date()}else{if(e.type=="click"&&((bs-bi)<300)){click(e)}else{if(e.type=="dblclick"){doubleClick(e)}}}}function click(e){self.mapDiv.style.cursor="pointer";self.mapDiv.unselectable="on";var top=(av?event.clientY:e.clientY)-Utilities.getAbsoluteTop(j)+Utilities.getScrollTop();var left=(av?event.clientX:e.clientX)-Utilities.getAbsoluteLeft(j)+Utilities.getScrollLeft();var cPos=self.getCenterPosition();var pixelPercentY=1-((parseInt(top)-az+am)/(o*d));var pixelPercentX=((parseInt(left)-aw+an)/(o*d));var bbox=Utilities.centerContextToBoundingBox(cPos,aa.getRadius());var ab=(bbox.heightInDegrees*pixelPercentY)+bbox.getMinPosition().getLat();var ae=(bbox.widthInDegrees*pixelPercentX)+bbox.getMinPosition().getLon();if(q["rightclick"]&&(av&&event.button==2)||(!av&&e.which==3)){q["rightclick"](new Position(ab,ae));return false}if(q["click"]&&e.type=="click"){q["click"](new Position(ab,ae))}if(q["dblclick"]&&e.type=="dblclick"){q["dblclick"](new Position(ab,ae))}}function startDrag(e){bi=new Date();if((av&&event.button==2)||(!av&&e.which==3)){if(q["rightclick"]){click(e)}}if(!bf){endDrag();return false}ci=true;self.mapDiv.style.cursor="move";bc=av?event.clientX:e.clientX;bb=av?event.clientY:e.clientY;document.body.onmousemove=whileDragging;return false}var cd=false;function endDrag(e){ci=false;self.mapDiv.style.cursor="default";document.body.onmousemove=null;if(cd&&q["moveend"]){q["moveend"]();cd=false}return false}function doubleClick(e){ay=null;by=true;if(q["dblclick"]){click(e)}if(!aq){return false}var clickX=av?event.clientX:e.clientX;var clickY=av?event.clientY:e.clientY;var divPosX=Utilities.getAbsoluteLeft(self.mapDiv)-Utilities.getScrollLeft();var divPosY=Utilities.getAbsoluteTop(self.mapDiv)-Utilities.getScrollTop();var moveX=(parseInt(clickX-divPosX)-Math.round(parseInt(self.mapDiv.style.width)/2))*-1;var moveY=(parseInt(clickY-divPosY)-Math.round(parseInt(self.mapDiv.style.height)/2))*-1;slider(moveX,moveY)}function move(ae,ab){an=-ae;am=-ab;j.style.left=-ae+af;j.style.top=-ab+af}function whileDragging(e){cd=true;ay=null;if(!ci){return false}var draggingX=(av?event.clientX:e.clientX)-bc;var draggingY=(av?event.clientY:e.clientY)-bb;al+=draggingX;ak+=draggingY;if(Math.abs(al)>ag){rotateTiles()}if(Math.abs(ak)>ag){rotateTiles()}bh-=draggingX;bg-=draggingY;move(bh,bg);bc=av?event.clientX:e.clientX;bb=av?event.clientY:e.clientY;return false}function slider(ae,ab){an=an+(ae);am=am+(ab);slide(ae,ab,true)}infowindowSlide=function(x,y){an=an+(x);am=am+(y);slide(x,y,true)};var ae=0;var ab=0;slide=function(cz,cw,first){if(first){ae=cz}if(first){ab=cw}var percentX=Math.round(Math.abs(ae)*0.3);var percentY=Math.round(Math.abs(ab)*0.3);if(percentX>0||percentY>0){if(ae<0){j.style.left=parseInt(j.style.left)-percentX+af;ae+=percentX;al-=percentX;bh+=percentX;co+=percentX}else{if(ae>0){j.style.left=parseInt(j.style.left)+percentX+af;ae-=percentX;al+=percentX;bh-=percentX;co-=percentX}}if(ab<0){j.style.top=parseInt(j.style.top)-percentY+af;ab+=percentY;ak-=percentY;bg+=percentY;cn+=percentY}else{if(ab>0){j.style.top=parseInt(j.style.top)+percentY+af;ab-=percentY;ak+=percentY;bg-=percentY;cn-=percentY}}if(Math.abs(al)>ag||Math.abs(ak)>ag){rotateTiles()}setTimeout("slide("+ae+","+ab+", true)",1)}else{if(q["moveend"]){q["moveend"]()}if(by&&bv){if(mapSliderElement){mapSliderElement.setOppositeValue(self.getZoomController().getZoomLevel()-1)}}co=0;cn=0;by=false}};function reset(){j.style.left=0+af;j.style.top=0+af;var tmpX=aw;var tmpY=az;self.hidePinsBeforeZoom();for(var ab=0;ab<d;++ab){for(var ae=0;ae<g;++ae){if(ae==0){tmpX=aw}b[ab][ae][0].style.left=tmpX+af;b[ab][ae][0].style.top=tmpY+af;b[ab][ae][0].src="/html/css/images/deCarta/tile.png";b[ab][ae][1].style.left=tmpX+af;b[ab][ae][1].style.top=tmpY+af;b[ab][ae][1].src="/html/css/images/deCarta/tile.png";tmpX+=o}tmpY+=o}an=0;am=0;bh=0;bg=0;bc=0;bb=0;ci=false;al=0;ak=0;p=0;m=0;cl=0;ck=0;cq=0;cp=0}this.getGXPixelPoint=function(pos){var scale=Utilities.radsPerPixelAtZoom(o,aa.getGXConvertedZoomLevel());var ab=Utilities.lat2pix(pos.lat,scale);var ae=Utilities.lon2pix(pos.lon,scale);return new PixelPointDP(ae,ab)};this.getGridSize=function(){return d+" "+g}}function MapTypeController(){}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("/html/css/images/deCarta/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=150;this.pinImg.src=this.icon.src;if(this.icon.width&&this.icon.height){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=150;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(K){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.bn&&K.bo){H.pinImg.style.top=(parseInt(H.pinImg.style.top)+K.bn-K.anchorY)+"px";H.pinImg.style.left=(parseInt(H.pinImg.style.left)+K.bo-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"}if(K.width){H.pinImg.style.width=K.width+"px"}if(K.height){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=150;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="/html/css/images/deCarta/x.gif";this.pinImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+L+"',sizingMethod='scale')"}};this.getIcon=function(){return H.icon};this.setX=function(L){H.pinImg.style.left=(L-H.icon.anchorX)+"px";if(H.pinTxt){H.pinTxt.style.left=(L-H.icon.anchorX+H.icon.overlay.anchorX)+"px"}if(document.all){for(var K=0;K<A.length;K++){H.reRegister(A[K],A[A[K]])}}};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.ae)-parseInt(K.ae);var M=parseInt(L.ab)-parseInt(K.ab);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(H.pinImg.height)-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"}if(parseInt(document.getElementById("bubble").style.top)+parseInt(document.getElementById("tiles").style.top)<0){infowindowSlide(0,(-1*(parseInt(document.getElementById("bubble").style.top)+parseInt(document.getElementById("tiles").style.top))))}if((parseInt(document.getElementById("bubble").style.left)+parseInt(document.getElementById("bubble").style.width)+parseInt(document.getElementById("tiles").style.left))>parseInt(document.getElementById("map").style.width)+1){infowindowSlide((-1*((parseInt(document.getElementById("bubble").style.left)+parseInt(document.getElementById("bubble").style.width))-parseInt(document.getElementById("map").style.width)+parseInt(document.getElementById("tiles").style.left))),0)}if(parseInt(document.getElementById("bubble").style.left)+parseInt(document.getElementById("tiles").style.left)<1){infowindowSlide((-1*(parseInt(document.getElementById("bubble").style.left)+parseInt(document.getElementById("tiles").style.left))),0)}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.ae=parseInt(D);this.ab=parseInt(C)}catch(B){throw new Exception("bad constructor values for x/y")}var A=this;this.getX=function(){return parseInt(A.ae)};this.getY=function(){return parseInt(A.ab)};this.equals=function(E){if(E&&E.toString()==A.toString()){return true}else{return false}};this.toString=function(){return A.ae+" "+A.ab}}function PixelPointDP(D,C){try{this.ae=parseFloat(D);this.ab=parseFloat(C)}catch(B){throw new Exception("bad constructor values for x/y")}var A=this;this.getX=function(){return(A.ae)};this.getY=function(){return(A.ab)};this.equals=function(E){if(E&&E.toString()==A.toString()){return true}else{return false}};this.toString=function(){return A.ae+" "+A.ab}}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;c=this.xmlRecFac.createPOIRequestDOM(C,D);JSRequest.send(c,A.queryCallback)};this.queryCallback=function(T){var J=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(T),"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 R=0;R<Q.length;R++){var P=Sarissa.serialize((Q[R]));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'")}try{var U=Sarissa.getText(K.selectSingleNode("//xls:POI/@POIName"));var H=Sarissa.getText(K.selectSingleNode("//xls:POI/@phoneNumber"))}catch(S){alert(S.message)}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("//xls:Building/@number"))}catch(S){}try{O=Sarissa.getText(K.selectSingleNode("//xls:Street"))}catch(S){}try{N=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='CountrySubdivision']"))}catch(S){}try{D=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']"))}catch(S){}try{C=Sarissa.getText(K.selectSingleNode("//xls:Place[@type='Municipality']"))}catch(S){}try{M=Sarissa.getText(K.selectSingleNode("//xls:PostalCode"))}catch(S){}var E=new Address(I,O,N,D,C,M);F.push(new POI(U,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")}}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}}function RoutePreference(B,C,A){if(B!="Fastest"&&B!="Shortest"&&B!="Pedestrian"&&B!="AvoidFreeways"&&B!="NoFreeways"&&B!="IgnorePipes"&&B!="MoreFreeways"&&B!="Easy"){alert("invalid route preference type, please see documentation");return false}this.routePreference=B;this.uom=C||new UOM("KM");this.routeQueryType=A||"RTXT";this.rules=null;this.optimized=false}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};function Sarissa(){}Sarissa.PARSED_OK="Document contains no parsing errors";Sarissa.PARSED_EMPTY="Document is empty";Sarissa.PARSED_UNKNOWN_ERROR="Not well-formed or other error";var bu=0;var be="";var ap=document.implementation&&true;var ah=ap&&document.implementation.createDocument;var ao=ap&&document.implementation.hasFeature;var cu=ah&&ao;var bw=(navigator.userAgent&&navigator.vendor&&(navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1||navigator.vendor.indexOf("Apple")!=-1));var ba=document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&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(typeof XMLDocument=="undefined"&&typeof Document!="undefined"){XMLDocument=Document}if(ba){be="xsl:";var ac="";var aj="";var as="";Sarissa.pickRecentProgID=function(E){var D=false;for(var B=0;B<E.length&&!D;B++){try{var A=new ActiveXObject(E[B]);o2Store=E[B];D=true}catch(C){}}if(!D){throw"Could not retreive a valid progID of Class: "+E[E.length-1]+". (original exception: "+e+")"}E=null;return o2Store};ac=null;_SARISSA_THREADEDDOM_PROGID=null;_SARISSA_XSLTEMPLATE_PROGID=null;aj=null;if(!window.XMLHttpRequest){XMLHttpRequest=function(){if(!aj){aj=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"])}return new ActiveXObject(aj)}}Sarissa.getDomDocument=function(D,C){if(!ac){ac=Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"])}var A=new ActiveXObject(ac);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"+(bu++)}}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.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(C){if(!_SARISSA_THREADEDDOM_PROGID){_SARISSA_THREADEDDOM_PROGID=Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.3.0"])}C.setProperty("SelectionLanguage","XPath");C.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var B=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);if(C.url&&C.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']")!=null){B.async=false;if(_SARISSA_THREADEDDOM_PROGID=="MSXML2.FreeThreadedDOMDocument.6.0"){B.setProperty("AllowDocumentFunction",true);B.resolveExternals=true}B.load(C.url)}else{B.loadXML(C.xml)}B.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var A=B.selectSingleNode("//xsl:output");this.outputMethod=A?A.getAttribute("method"):"html";this.template.stylesheet=B;this.processor=this.template.createProcessor();this.paramsSet=new Array()};XSLTProcessor.prototype.transformToDocument=function(C){if(_SARISSA_THREADEDDOM_PROGID){this.processor.input=C;var B=new ActiveXObject(ac);this.processor.output=B;this.processor.transform();return B}else{if(!as){as=Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"])}this.processor.input=C;var B=new ActiveXObject(as);this.processor.output=B;this.processor.transform();var A=new ActiveXObject(ac);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(ac);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){if(C){this.processor.addParameter(A,B,C)}else{this.processor.addParameter(A,B)}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,null,B)}else{this.processor.addParameter(A,null)}}}this.paramsSet=new Array()}}else{if(ah){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(ao&&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(bw){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")&&ba){try{document.importNode=function(C,B){var A;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((!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,H,D){D=D?D:"";var F=D+"<"+H+">";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 G="";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+=(H.indexOf(" ")!=-1?"</array-item>\n":"</"+H+">\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 cg=new XMLSerializer();Sarissa.serialize=function(A){return cg.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(!ba){if(ah){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.ch=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.ch(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(ao&&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.au=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.au=false;XMLDocument.prototype._sarissa_xpathNamespaces=new Array();XMLDocument.prototype.selectNodes=function(C,G,A){var E=this;var B=this.au?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}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();c=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(c)}}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;c=this.xmlRecFac.createTrafficIncidentRequestDOM(C,D);JSRequest.send(c,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(A,B){this.globeExplorerURL=A.replace(URL.urlregx,"");this.deCartaURL=B.replace(URL.urlregx,"");this.getDeCartaURL=function(){return this.deCartaURL};this.getGlobeExplorerURL=function(){return this.globeExplorerURL}}URL.urlregx=new RegExp("\\amp;","g");function Utilities(){}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="/html/css/images/deCarta/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.clearConsole=function(){if(document.getElementById("stdout")){document.getElementById("stdout").innerHTML=""}};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.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.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(J,N,D,F,C,H,L,B){try{J=D-J;N=F-N;var K=L.getLat();var E=L.getLon();var I=(B*2)/111.111;var M=I/(C*H);var A=(I/Math.cos(((K*Math.PI)/180)))/(C*H);if(N!=0){K=""+(parseFloat(K)+parseFloat(N*M))}if(J!=0){E=""+(parseFloat(E)-parseFloat(J*A))}return new Position(K,E)}catch(G){alert(G.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.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(F,G){var H=1e-7;var E=12;var B=Math.pow(Math.E,-F*G);var D=Utilities.mercatorUnproject(B);var A=Utilities.findRadPhi(D,B);var C=0;while(C<E&&Math.abs(D-A)>H){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)))};function WSXMLTunnel(){this.cs=[];var A=this;this.send=function(D,C){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 B=(E.selectSingleNode("//xls:Request/@requestID").value);A.cs[B]=C;JSRequest.send(E,this.cr)};this.cr=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.cs[B](D)}}function XMLRequestFactory(){this.overlays=[];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");(E.getElementsByTagName("xls:Request"))[0].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",Q);V.setAttribute("columns",C);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");(E.getElementsByTagName("xls:Request"))[0].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",S);W.setAttribute("columns",C);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");(B.getElementsByTagName("xls:Request"))[0].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");(E.getElementsByTagName("xls:Request"))[0].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(N,K,A,P){try{var D=this.getHeader("DetermineRouteRequest",K);var L=D.createElement("xls:DetermineRouteRequest");L.setAttribute("distanceUnit",A.uom);L.setAttribute("routeQueryType",A.routeQueryType);(D.getElementsByTagName("xls:Request"))[0].appendChild(L);var I=D.createElement("xls:RoutePlan");if(Credentials.trafficEnabled){I.setAttribute("useRealTimeTraffic","true")}if(A.optimized){I.setAttribute("optimize","true")}if(Credentials.trafficEnabled&&P){I.setAttribute("expectedStartTime",(P.replace("-07:00","-06:00")))}L.appendChild(I);var G=D.createElement("xls:RoutePreference");var E=D.createTextNode(A.routePreference);G.appendChild(E);I.appendChild(G);var S=D.createElement("xls:WayPointList");for(var Q=0;Q<N.length;Q++){if(Q==0){var J=D.createElement("xls:StartPoint");var T=D.createElement("xls:Position");var M=D.createElement("gml:Point");var F=D.createElement("gml:pos");var O=D.createTextNode(N[Q]);F.appendChild(O);M.appendChild(F);T.appendChild(M);J.appendChild(T);S.appendChild(J)}else{if(Q>0&&Q<(N.length-1)){var U=D.createElement("xls:ViaPoint");var T=D.createElement("xls:Position");var M=D.createElement("gml:Point");var F=D.createElement("gml:pos");var O=D.createTextNode(N[Q]);F.appendChild(O);M.appendChild(F);T.appendChild(M);U.appendChild(T);S.appendChild(U)}else{if(Q==(N.length-1)){var H=D.createElement("xls:EndPoint");var T=D.createElement("xls:Position");var M=D.createElement("gml:Point");var F=D.createElement("gml:pos");var O=D.createTextNode(N[Q]);F.appendChild(O);M.appendChild(F);T.appendChild(M);H.appendChild(T);S.appendChild(H)}}}}I.appendChild(S);var C=D.createElement("xls:RouteInstructionsRequest");C.setAttribute("providePoint","true");var B=D.createElement("xls:RouteGeometryRequest");if(A.rules!=null){C.setAttribute("rules",A.rules)}B.setAttribute("returnRouteIDOnly","true");L.appendChild(C);L.appendChild(B);return D}catch(R){alert("XMLRequestFactory.prototype.createRouteGeometryRequestDOM\n\n"+R.message)}};XMLRequestFactory.prototype.createRouteMapDOM=function(G,L,Q,K,R,E,O,B,S){try{var F=this.getHeader("PortrayMapRequest",Q);var W=F.createElement("xls:PortrayMapRequest");W.setAttribute("fitOverlays","false");(F.getElementsByTagName("xls:Request"))[0].appendChild(W);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);W.appendChild(J);W.appendChild(C);var V=F.createElement("xls:TileGrid");V.setAttribute("rows",R);V.setAttribute("columns",E);var M=F.createElement("xls:GridLayer");M.setAttribute("name","globexplorer");M.setAttribute("meta-inf","zoom="+O);var X=F.createElement("xls:GridLayer");X.setAttribute("name","deCarta");V.appendChild(X);V.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 U=F.createElement("xls:Pan");U.setAttribute("direction","W");U.setAttribute("numTiles","0");V.appendChild(D);V.appendChild(A);V.appendChild(H);V.appendChild(U);J.appendChild(V);if(Credentials.trafficEnabled){var P=F.createElement("xls:Overlay");var N=F.createElement("xls:Traffic");var I=F.createElement("xls:FlowReporting");if(S){I.setAttribute("time",S)}N.appendChild(I);P.appendChild(N);W.appendChild(P)}return F}catch(T){alert("XMLRequestFactory.prototype.createRouteMapDOM \n\n"+T.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)}(E.getElementsByTagName("xls:Request"))[0].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");(B.getElementsByTagName("xls:Request"))[0].appendChild(A);return B};XMLRequestFactory.prototype.addOverlays=function(I,F){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=A.VR7||Utilities.LL2VR7(A.positions);A.VR7=J}catch(G){alert("problem adding "+A.type+"\n\nmust specify either positions or VR7");return }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");(C.getElementsByTagName("xls:Request"))[0].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(E,D,C,J,H,B){if(E&&E<1||E>18){throw new Exception("Error instantiating ZoomController, invalid initial value for ZoomController must be between 1 and 18");return false}this.uncheckedSrc=J||"/html/css/images/deCarta/zoom.png";this.checkedSrc=C||"/html/css/images/deCarta/zoomChecked.png";this.color=D||"";this.selected=E||5;this.zoomLevels=18;this.topCap=document.createElement("IMG");this.topCap.src=H||"/html/css/images/deCarta/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=B||"/html/css/images/deCarta/zoomBottom.png";if(!B){this.bottomCap.style.height="17px"}if(!B){this.bottomCap.style.width="17px"}if(Utilities.ie6){Utilities.fixPng(this.bottomCap)}this.bottomCap.style.padding="0px";var G=new Array();var A;var I=this;this.zoomer;this.map;this.initialize=function(M){I.map=M;for(var L=1;L<=I.zoomLevels;L++){var K=document.createElement("IMG");K.style.height="9px";K.style.width="17px";K.id=""+L;K.src=I.uncheckedSrc;K.checkedSrc=I.checkedSrc;K.onclick=function(N){N=N||event;N.stoppropagation?N.stoppropagation():N.cancelBubble=true;if(M.getZoomLck()){return false}F();this.src=this.checkedSrc;M.zoomMap(this.id)};G.push(K)}I.zoomer=document.createElement("DIV");I.zoomer.style.cursor="pointer";I.zoomer.id="zoom";I.zoomer.style.width="20px";I.zoomer.style.top="1px";I.zoomer.style.left="1px";I.zoomer.style.opacity=50;I.zoomer.innerHTML="";I.zoomer.style.filter="alpha(opacity=80)";I.zoomer.style.opacity=0.8;I.zoomer.style.display="block";I.zoomer.style.position="absolute";I.zoomer.style.zIndex=9999;I.zoomer.appendChild(I.topCap);for(var L=0;L<G.length;L++){I.zoomer.appendChild(G[L])}I.zoomer.appendChild(I.bottomCap);M.mapDiv.appendChild(I.zoomer);I.topCap.onclick=function(N){N=N||event;N.stoppropagation?N.stoppropagation():N.cancelBubble=true;I.zoomInOneLevel()};I.bottomCap.onclick=function(N){N=N||event;N.stoppropagation?N.stoppropagation():N.cancelBubble=true;I.zoomOutOneLevel()};this.setZoomLevel(I.selected)};this.setZoomButtonImages=function(M,L){this.checkedSrc=M;this.uncheckedSrc=L;for(var K=0;K<G.length;K++){G[K].src=L}if(I.selected){G[I.selected-1].src=M}};this.setColor=function(K){this.zoomer.style.backgroundColor=K};this.show=function(){this.zoomer.style.display="block"};this.hide=function(){this.zoomer.style.display="none"};this.getRadius=function(){return A};this.setRadius=function(K){A=K};this.getZoomLevel=function(){return I.selected};this.setZoomLevel=function(L){if(E&&E<1||E>18){throw new Exception("Error calling setZoomLevel, level must be between 1 and 18");return false}I.selected=L;F();for(var K=0;K<I.zoomLevels;K++){if(G[K].id==L){G[K].src=I.checkedSrc}if(Utilities.ie6){Utilities.fixPng(G[K])}}};this.getGXConvertedZoomLevel=function(){var K=Math.abs(21-I.selected);if(K<=3){Credentials.configuration="old-english-tile"}else{Credentials.configuration="old-english-citylabels"}return Math.abs(21-I.selected)};this.zoomToNewLevel=function(L){if(E&&E<1||E>18){throw new Exception("Error calling zoomToNewLevel, level must be between 1 and 18");return false}F();for(var K=0;K<I.zoomLevels;K++){if(G[K].id==L){G[K].src=I.checkedSrc}if(Utilities.ie6){Utilities.fixPng(G[K])}}I.map.zoomMap(L)};this.zoomInOneLevel=function(){if(I.selected==1){return false}F();for(var K=0;K<I.zoomLevels;K++){if(G[K].id==I.selected){G[K].src=I.checkedSrc}}I.map.zoomMap(parseInt(I.selected)-1)};this.zoomOutOneLevel=function(){if(I.selected==18){return false}F();for(var K=0;K<I.zoomLevels;K++){if(G[K].id==I.selected){G[K].src=I.checkedSrc}}I.map.zoomMap(parseInt(I.selected)+1)};this.getZoomLevelToFitBoundingBox=function(N){var Q=parseInt(I.map.mapDiv.style.height)/2;var R=parseInt(I.map.mapDiv.style.width)/2;Q=Q-22;R=R-22;for(var P=20;P>0;--P){var M=Utilities.radsPerPixelAtZoom(256,P);var T=Utilities.lat2pix(N.getCenterPosition().getLat(),M);var V=Utilities.lon2pix(N.getCenterPosition().getLon(),M);var O=Utilities.pix2lat(T+Q,M);var U=Utilities.pix2lon(V+R,M);var L=Utilities.pix2lat(T-Q,M);var S=Utilities.pix2lon(V-R,M);var K=new BoundingBox(new Position(L,S),new Position(O,U));if(K.contains(N.minPosition)&&K.contains(N.maxPosition)){return Math.abs(21-P);break}}};this.getZoomLevelToFitPositions=function(K){var L=Utilities.positionsToBoundingBox(K);return I.getZoomLevelToFitBoundingBox(L)};this.setZoomValue=function(K){I.setZoomLevel(K)};function F(){for(var K=0;K<G.length;K++){G[K].src=I.uncheckedSrc}}}