//dds web services 4.2.1 -- deCarta confidential and proprietary. Copyright deCarta. All rights reserved.
function Address(buildingNumber,street,countrySubdivision,countrySecondarySubdivision,municipality,postalCode,municipalitySubdivision){this.buildingNumber=buildingNumber;this.street=street;this.countrySubdivision=countrySubdivision;this.countrySecondarySubdivision=countrySecondarySubdivision;this.municipality=municipality;this.postalCode=postalCode;this.municipalitySubdivision=municipalitySubdivision;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(minPos,maxPos){if(!minPos||!maxPos){throw new Exception("Error instantiating BoundingBox, invalid parameters.");};this.minPosition=minPos;this.maxPosition=maxPos;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 centerLat=parseFloat(this.maxPosition.lat-((this.maxPosition.lat-this.minPosition.lat)/2));var centerLng=parseFloat(this.maxPosition.lon-((this.maxPosition.lon-this.minPosition.lon)/2));return new Position(centerLat,centerLng);};this.getRadius=function(){if(this.heightInDegrees>this.widthInDegrees)
return(this.heightInDegrees*136)/2;else return(this.widthInDegrees*136)/2;};this.contains=function(pos){if(pos.lat>this.minPosition.lat&&pos.lon>this.minPosition.lon&&pos.lat<this.maxPosition.lat&&pos.lon<this.maxPosition.lon)
return true;else return false;};this.extendedContains=function(pos){if(pos.lat>this.minPosition.lat-this.heightInDegrees&&pos.lon>this.minPosition.lon-this.widthInDegrees&&pos.lat<this.maxPosition.lat+this.heightInDegrees&&pos.lon<this.maxPosition.lon+this.widthInDegrees)
return true;else return false;};this.equals=function(bbox){if(bbox&&this.minPosition==bbox.getMinPosition()&&this.maxPosition==bbox.getMaxPosition())
return true;else return false;};this.toString=function(){return this.minPosition.toString()+" "+this.maxPosition.toString();};};function Credentials(){};Credentials.preference="Fastest";Credentials.url="http://www.classifiedconcepts.com/CCDL/AppOH2/Proxy.aspx";Credentials.clientName="";Credentials.clientPassword="";Credentials.configuration="glossy-tile";Credentials.transparentConfiguration="transparent-tile";Credentials.mapType="STREET";Credentials.ISOCountryCode="US";Credentials.trafficEnabled=false;Credentials.purgecount=0;Credentials.rel="4.2.1";function EventRegistry(){};EventRegistry.addListener=function(source,event,callBack){if(source.type=="map"&&(event=="rightclick"||event=="dblclick"||
event=="click"||event=="moveend"||event=="zoomend")){source.addEventListener(event,callBack);}else if(source.type=="pin"&&(event=="rightclick"||
event=="dblclick"||event=="click"||event=="mouseover"||
event=="mouseout")){source.addEventListener(event,callBack);}else{throw new Exception(event+" is unsupported event type for "+source.type);};};EventRegistry.clearListeners=function(source,event){source.clearListeners(event);};EventRegistry.clearInstanceListeners=function(source){source.clearInstanceListeners();};function Exception(message){this.message=message||"an exception has occurred";var self=this;this.getMessage=function(){return self.message;};this.toString=function(){return self.message;};};function FreeFormAddress(address,locale){if(!address||address.toString()==""){throw new Exception("Error instantiating FreeFormAddress, invalid parameters.");return false;};this.locale=locale||new Locale("en","US");var self=this;this.address=address;this.getLocale=function(){return self.locale;};this.toString=function(){return this.address;};};function Geocoder(){this.xmlRecFac=new XMLRequestFactory();var o=new Array();var self=this;this.authenticate=function(clientName,clientPassword){if(!clientName||!clientPassword||clientName==""||clientPassword==""){throw new Exception("Error authenticating Geocoder, invalid parameters.");return false;};Credentials.clientName=clientName;Credentials.clientPassword=clientPassword;};this.geocode=function(address,callBack){var reqId=Utilities.getRequestId();o[reqId]=callBack;c=this.xmlRecFac.createGeocodeRequestDOM(address,reqId);this.sendGeocodeRequest();};this.reverseGeocode=function(position,callBack){var reqId=Utilities.getRequestId();o[reqId]=callBack;c=this.xmlRecFac.createReverseGeocodeRequestDOM(position,reqId);this.sendReverseGeocodeRequest();};this.sendReverseGeocodeRequest=function(){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){}};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"text/xml");if(document.all){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(reqId!=-1){o[reqId](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 num=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Building/@number"));}catch(e){var num="";};try{var str=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Street"));}catch(e){var str="";};try{var stt=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Place[@type='CountrySubdivision']"));}catch(e){var stt="";};try{var cou=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']"));}catch(e){var cou="";};try{var cit=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Place[@type='Municipality']"));}catch(e){var cit="";};try{var citsub=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Place[@type='MunicipalitySubdivision']"));}catch(e){var citsub="";};try{var pst=Sarissa.getText(oDomDoc.selectSingleNode("//xls:PostalCode"));}catch(e){var pst="";};var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));o[reqId](new Address(num,str,stt,cou,cit,pst,citsub));};};};xmlhttp.send(c);};this.sendGeocodeRequest=function(){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){}};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"text/xml");if(document.all){oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");};var posList=new Array();var addrList=new Array();if(oDomDoc.selectNodes("//xls:Error").length>0){var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));o[reqId](posList,addrList);}else{var geocodedAddresses=new Array();try{var	geocodedAddresses=oDomDoc.selectNodes("//xls:GeocodedAddress");}catch(e){var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));o[reqId](posList,addrList);return false;};for(var i=0;i<geocodedAddresses.length;i++){var txtTmp=(Sarissa.serialize((geocodedAddresses[i])));if(txtTmp.indexOf("<gml:pos/>")>0){var pos="0.0 0.0";}else{var pos=txtTmp.substring(txtTmp.indexOf("<gml:pos>")+"<gml:pos>".length,txtTmp.indexOf("</gml:pos>"));};if(txtTmp.indexOf("<xls:freeFormAddress/>")>0){var ffa="NO ADDRESS FOUND";}else{var ffa=txtTmp.substring(txtTmp.indexOf("<xls:freeFormAddress>")+"<xls:freeFormAddress>".length,txtTmp.indexOf("</xls:freeFormAddress>"));};posList.push(new Position(pos));addrList.push(new FreeFormAddress(ffa));};var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"))
o[reqId](posList,addrList);};};};xmlhttp.send(c);};};function GLOBALS(){};GLOBALS.HYBRID="HYBRID";GLOBALS.STREET="STREET";GLOBALS.SATELLITE="SATELLITE";GLOBALS.PAN_PIXEL_DISTANCE=300;function Icon(src,iconAnchorX,iconAnchorY,width,height,overlay){if(!src||!iconAnchorX||!iconAnchorY||!width||!height){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.bf;this.be;var self=this;this.src=src;this.anchorX=iconAnchorX;this.anchorY=iconAnchorY;this.height=null;this.width=null;if(width)
this.width=width;if(height)
this.height=height;this.overlay=overlay||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(anchorX){this.bf=this.anchorX;this.anchorX=anchorX;};Icon.prototype.setAnchorY=function(anchorY){this.be=this.anchorY;this.anchorY=anchorY;};Icon.prototype.setHeight=function(height){this.height=height;};Icon.prototype.setOverlay=function(overlay){this.overlay=overlay;};Icon.prototype.setSrc=function(src){this.src=src;};Icon.prototype.setWidth=function(width){this.width=width;};function InfoWindow(html,xOffset,yOffset,icon){this.html=html;this.xOffset=xOffset;this.yOffset=yOffset;this.icon=icon;};function JSCOM(url,data){this.url=url;this.data=data;this.noCacheIE='&noCacheIE='+(new Date()).getTime();this.headLoc=document.getElementsByTagName("head").item(0);this.scriptId=JSCOM.scriptCounter++;};JSCOM.scriptCounter=1;JSCOM.prototype.buildScriptTag=function(){this.scriptObj=document.createElement("script");this.scriptObj.setAttribute("type","text/javascript");this.scriptObj.setAttribute("src",this.url+this.noCacheIE);this.scriptObj.setAttribute("id",this.scriptId);};JSCOM.prototype.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj);};JSCOM.prototype.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj);};function Locale(language,country){this.language=language.toUpperCase();this.country=country.toUpperCase();var self=this;this.toString=function(){return self.country+"_"+self.language;};this.getLanguage=function(){return self.language;};this.getCountry=function(){return self.country;};this.setLanguage=function(language){self.language=language;};this.setCountry=function(country){self.country=country;};};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 ap=null;var as=null;var m=256;var r="img/tile.png";var xmlRecFac=new XMLRequestFactory();var by=0;var bx=0;var cc=0;var cb=0;var h=null;var b=new Array();var g=0;var d=0;var bv=false;var ag=m;var k=0;var j=0;var ax=0;var cd="dashed";var ah=document.all;var c=null;var ao=null;var am=0;var al=0;var bq=0;var bp=0;var bo=0;var bn=0;var aw=0;var av=0;var ba=0;var az=0;var ak=0;var aj=0;var ca=0;var bz=0;var aq=0;var at=0;var aa=null;var self=this;var o=new Array();var q=new Array();var ad=null;var bd=false;var ay=true;var an=true;var p=new Array();var ae="px";var w=null;var z=null;var ce=new RegExp("\\amp;","g");var v="STREET";var bw=new Array();var af=new Array(0,0);var bb=new Date();var bi=new Date();var bm=false;var bl=false;this.addCopyrightMessage=function(message,x,y){z=document.createElement("DIV");z.id="copyright";if(x&&y){z.style.top=y+ae;z.style.left=x+ae;}else{z.style.top=((parseInt(self.mapDiv.style.height))-20)+ae;z.style.left="1px";};z.style.backgroundColor="#ffffff";z.style.opacity=50;z.innerHTML=message;z.style.filter='alpha(opacity=80)';z.style.opacity=0.8;z.style.borderWidth="1px";z.style.padding="1px";z.style.fontFamily="Arial, sans-serif";z.style.fontColor="black";z.style.fontSize="11px";z.style.fontWeight="normal";z.style.borderStyle="solid";z.style.borderColor="gray";z.style.display="block";z.style.position="absolute";z.style.zIndex=9999;self.mapDiv.appendChild(z);};this.addCustomInfoWindow=function(infoWindow){if(!w)
w=initBubble();if(h)
h.removeChild(w);w=infoWindow.html;w.id="bubble";w.type="custom";w.offX=infoWindow.xOffset;w.offY=infoWindow.yOffset;if(h)
h.appendChild(w);ai.style.position="absolute";w.appendChild(u);w.appendChild(ai);if(infoWindow.icon){u.src=infoWindow.icon.src;u.style.top=infoWindow.icon.anchorY+ae;u.style.left=infoWindow.icon.anchorX+ae;if(infoWindow.icon.height)
u.style.height=infoWindow.icon.height+ae;if(infoWindow.icon.width)
u.style.width=infoWindow.icon.width+ae;if(Utilities.ie6&&u.src.match(new RegExp("\\bpng\\b","g")))
Utilities.fixPng(u);};};this.addAndCenterOnPin=function(pin){this.addPin(pin);this.panToPosition(pin.position);};this.addEventListener=function(event,callBack){var alreadyRegistered=false;for(var i=0;i<p.length;i++)
if(p[i]==event){p[event]=callBack;alreadyRegistered=true;break;};if(!alreadyRegistered){p.push(event);p[event]=callBack;};};this.addPin=function(pin){if(aa==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=ad.getGXConvertedZoomLevel();var scale=Utilities.radsPerPixelAtZoom(256,gxZoom);var cy=Utilities.lat2pix(aa.lat,scale)
var cx=Utilities.lon2pix(aa.lon,scale)
var py=Utilities.lat2pix(pin.position.lat,scale)
var px=Utilities.lon2pix(pin.position.lon,scale)
var pix=new PixelPoint((m*g)/2,(m*g)/2);pin.setX(pix.x+aq-Math.round(cx-px));pin.setY(pix.y+at+Math.round(cy-py));q.push(pin);h.appendChild(pin.pinImg);if(pin.pinTxt)
h.appendChild(pin.pinTxt);};this.addMapTypeController=function(mapTypeController){if(!mapTypeController){alert("error adding mapTypeController to map");return false;};ac=document.createElement("DIV");ac.id="mapTypeController";ac.style.top="5px";ac.style.left=((parseInt(self.mapDiv.style.width))-207)+ae;ac.style.backgroundColor="#ffffff";ac.style.opacity=50;mapReference=self;ac.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>";ac.style.filter='alpha(opacity=80)';ac.style.opacity=0.8;ac.style.borderWidth="1px";ac.style.padding="4px";ac.style.fontFamily="Arial, sans-serif";ac.style.fontColor="black";ac.style.fontSize="11px";ac.style.fontWeight="bold";ac.style.borderStyle="solid";ac.style.borderColor="gray";ac.style.display="block";ac.style.position="absolute";ac.style.zIndex=9999;ac.onclick=function(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;};self.mapDiv.appendChild(ac);};this.addZoomController=function(zoomController){ad=zoomController;ad.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)
o[requestId]=callBack;c=xmlRecFac.createMapAddressRequestDOM(freeFormAddress,m,g,d,requestId,ad.getGXConvertedZoomLevel(),trafficTime);bc();};this.centerOnPosition=function(position,callBack,trafficTime){aa=position;populateTiles();var requestId=Utilities.getRequestId();if(callBack&&callBack!=null)
o[requestId]=callBack;c=xmlRecFac.createMapRequestDOM(position,m,g,d,requestId,ad.getGXConvertedZoomLevel(),trafficTime);bt();};this.changeCurrentMapStyle=function(newStyle){setMapStyle(newStyle);};this.clearInstanceListeners=function(){for(var i=0;i<p.length;i++){p[p[i]]=null;p[i]=null;};};this.clearListeners=function(event){for(var i=0;i<p.length;i++)
if(p[i]==event)
p[p[i]]=null;p[i]=null;};this.getBoundingBox=function(){return Utilities.centerContextToBoundingBox(self.getCenterPosition(),ad.getRadius());};this.getBoundingBoxViewable=function(){var viewPctY=(parseInt(self.mapDiv.style.height)/(m*d));var viewPctX=(parseInt(self.mapDiv.style.width)/(m*g));var radX=ad.getRadius()*viewPctX;var radY=ad.getRadius()*viewPctY;return Utilities.centerContextToBoundingBoxViewable(self.getCenterPosition(),radX,radY);};this.getCenterPosition=function(){var tmp=aa.clone();var gxZoom=ad.getGXConvertedZoomLevel();var scale=Utilities.radsPerPixelAtZoom(256,gxZoom);var originalCenterY=Utilities.lat2pix(tmp.lat,scale);var originalCenterX=Utilities.lon2pix(tmp.lon,scale);var newCenterX=originalCenterX-am;var newCenterY=originalCenterY+al;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<q.length;i++)
if(q[i])
tmp.push(q[i])
q=tmp;return q;};this.getZoomController=function(){return ad;};this.getZoomLck=function(){return bd;};this.hidePins=function(){for(var i=0;i<q.length;i++)
if(q[i]&&q[i]!=null&&q[i].type=="pin")
q[i].pinImg.style.display="none";};this.panToPosition=function(position){as=self.getGXPixelPoint(position);var position=position.clone();var scale=Utilities.radsPerPixelAtZoom(256,ad.getGXConvertedZoomLevel());var tmp=self.getCenterPosition();var bbox=Utilities.centerContextToBoundingBox(tmp,ad.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.x,-1*pix.y);else this.centerOnPosition(position);};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<q.length;i++){try{if(q[i]&&q[i]!=null){Utilities.purge(q[i].pinImg);h.removeChild(q[i].pinImg);q[i].pinImg=null;if(q[i].pinTxt){Utilities.purge(q[i].pinTxt);h.removeChild(q[i].pinTxt);q[i].pinTxt=null;};};q[i]=null;}catch(e){throw new Exception("error removing all pins\n\n"+e.message);};};q=new Array();};this.removePin=function(pin){for(var i=0;i<q.length;i++)
if(q[i]&&q[i].equals(pin))
q[i]=null;if(pin.pinTxt){Utilities.purge(pin.pinTxt);h.removeChild(pin.pinTxt);pin.pinTxt=null;};Utilities.purge(pin.pinImg);h.removeChild(pin.pinImg);pin=null;};this.resize=function(height,width){self.mapDiv.style.height=parseInt(height)+ae;self.mapDiv.style.width=parseInt(width)+ae;};this.routeMap=function(posList,callBack,expectedStartTime){requestId=Utilities.getRequestId();o[requestId]=callBack;ao=xmlRecFac.createRouteGeometryRequestDOM(posList,requestId,this.routePreference,expectedStartTime);au(expectedStartTime);};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");};ay=enabled;};this.setDoubleClickRecenteringEnabled=function(enabled){if(!'boolean'==(typeof enabled)){throw new Exception("Map.setDoubleClickRecenteringEnabled requires boolean");};an=enabled;};this.setDoubleClickRecenterAndZoom=function(enabled){if(!'boolean'==(typeof enabled))
alert("Map.setDoubleClickRecenterAndZoom requires boolean");bl=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 y=0;y<d;++y){for(var x=0;x<g;++x){b[y][x][1].src=r;changeURLConf(b[y][x][1],newStyle);b[y][x][1].loader.src=b[y][x][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(v=="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){Utilities.clearConsole();if(!(mapType=="STREET"||mapType=="HYBRID"||mapType=="SATELLITE")){alert("unsupported mapType\n\nUse 'STREET' || 'HYBRID' || 'SATELLITE'");return false;};v=mapType;Credentials.mapType=v;if(b.length>0){if(mapType=="STREET"){for(var y=0;y<d;++y)
for(var x=0;x<g;++x){b[y][x][0].src=r;b[y][x][1].src=r;changeURLConf(b[y][x][1],Credentials.configuration);b[y][x][1].loader.src=b[y][x][1].altSrc;};}else if(mapType=="HYBRID"){for(var y=0;y<d;++y)
for(var x=0;x<g;++x){b[y][x][0].src=r;b[y][x][1].src=r;b[y][x][0].src=b[y][x][0].altSrc;changeURLConf(b[y][x][1],Credentials.transparentConfiguration);b[y][x][1].loader.src=b[y][x][1].altSrc;};}else if(mapType=="SATELLITE"){for(var y=0;y<d;++y)
for(var x=0;x<g;++x){b[y][x][1].loader.src=r;b[y][x][0].src=r;b[y][x][0].src=b[y][x][0].altSrc;b[y][x][1].src=r;};};};};this.setRoutePreference=function(preference){self.routePreference=preference;Credentials.preference=preference.routePreference;};this.setTileBorder=function(border){if(border)
ax=1;else ax=0;for(var y=0;y<d;++y)
for(var x=0;x<g;++x){b[y][x][0].border=ax;b[y][x][1].border=ax;};};this.setURL=function(url){Credentials.url=url;};this.showPins=function(){for(var i=0;i<q.length;i++){if(q[i]&&q[i]!=null&&q[i].type=="pin")
q[i].pinImg.style.display="block";};};this.zoomMap=function(newZoomLevel){if(c==null){alert("Map not yet initialized.\nMap must be initialized before zooming.");return false;};if(bd)
return false;bd=true;var oldZoomLevel=ad.getGXConvertedZoomLevel();ad.setZoomLevel(newZoomLevel);var newZoomLevel=ad.getGXConvertedZoomLevel();if(ap&&as&&ap.x&&as.x&&ap.y&&as.y){var XXX=ap.x-as.x;var YYY=ap.y-as.y;var factionalNorth=parseFloat((YYY/256))*-1;var factionalEast=parseFloat((XXX/256))*-1;c=xmlRecFac.zoomMapRequestDOM(c,factionalNorth,0,factionalEast,0,newZoomLevel,oldZoomLevel);}else{var factionalNorth=parseFloat(by+(aj/m));var factionalEast=parseFloat(cc-(ak/m));c=xmlRecFac.zoomMapRequestDOM(c,factionalNorth,bx,factionalEast,cb,newZoomLevel,oldZoomLevel);};ap=0;as=0;populateTiles();bs();};function au(trafficTime){if(!ah){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){};};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"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(o[reqId]){o[reqId](null);o[reqId]=null;return;}else{return;};};populateTiles();var routeID=oDomDoc.selectSingleNode("//xls:RouteID");var minPos=(oDomDoc.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[0].data;var maxPos=(oDomDoc.selectNodes("//xls:RouteSummary/xls:BoundingBox/gml:pos/text()"))[1].data;var bbox=new BoundingBox(new Position(minPos),new Position(maxPos));var routeMapRadius=bbox.getRadius();ad.setRadius(routeMapRadius);aa=bbox.getCenterPosition();var fit=ad.getZoomLevelToFitBoundingBox(bbox);ad.setZoomLevel(fit);var centerContext=xmlRecFac.createCenterContext(bbox.getCenterPosition(),ad.getRadius());if(trafficTime)
c=xmlRecFac.createRouteMapDOM(centerContext,routeID,Utilities.getRequestId(),m,g,d,ad.getGXConvertedZoomLevel(),trafficTime);else c=xmlRecFac.createRouteMapDOM(centerContext,routeID,Utilities.getRequestId(),m,g,d,ad.getGXConvertedZoomLevel());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(o[reqId]){o[reqId](eval("("+jsonRoute+")"));o[reqId]=null;};bk();};};xmlhttp.send(ao);};function bk(){if(!ah){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){};};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"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']");af=new Array(parseFloat(panE.getAttribute("numTiles"))*m,parseFloat(panN.getAttribute("numTiles"))*m);urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");ad.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));if(Credentials.trafficEnabled){try{var traffic=oDomDoc.selectNodes("//xls:Position");var desc=oDomDoc.selectNodes("//xls:Description");for(var i=0;i<traffic.length;i++){var t1=Sarissa.getText(traffic[i]);var t2=Sarissa.getText(desc[i]);var pos=new Position(t1);var icon=new Icon("img/incident.png",10,10,21,21);var pin=new Pin(pos,"<FONT SIZE='1' FACE='ARIAL'><B>"+t2+"</B></FONT>","mouseover",icon);self.addPin(pin);};}catch(e){alert("Map.sendRouteMapRequest\n\n"+e.message);};};realignPushPins();};};xmlhttp.send(c);};function bc(){if(!ah){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){};};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"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']");af=new Array(parseFloat(panE.getAttribute("numTiles"))*m,parseFloat(panN.getAttribute("numTiles"))*m);urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);try{var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");ad.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));aa=new Position(Sarissa.getText(oDomDoc.selectSingleNode("//gml:pos")));ap=self.getGXPixelPoint(aa);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(o[reqId]){o[reqId](freeFormAddress,aa);o[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);if(Credentials.trafficEnabled){try{var traffic=oDomDoc.selectNodes("//xls:Position");var desc=oDomDoc.selectNodes("//xls:Description");for(var i=0;i<traffic.length;i++){var t1=Sarissa.getText(traffic[i]);var t2=Sarissa.getText(desc[i]);var pos=new Position(t1);var icon=new Icon("img/incident.png",10,10,21,21);var pin=new Pin(pos,"<FONT SIZE='1' FACE='ARIAL'><B>"+t2+"</B></FONT>","mouseover",icon);self.addPin(pin);};}catch(e){alert("Map.sendMapAddressRequest\n\n"+e.message);};};}catch(e){alert("Error updating the request center context from the response for subsequent requests.\n\n"+e.name+"\n\n"+e.message);};};};xmlhttp.send(c);};function bt(){if(!ah){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){};};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"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']");af=new Array(parseFloat(panE.getAttribute("numTiles"))*m,parseFloat(panN.getAttribute("numTiles"))*m);var urlList=oDomDoc.selectNodes("//xls:URL");updateUrlList(urlList);var tmpRadius=oDomDoc.selectSingleNode("//xls:Radius");ad.setRadius((parseFloat(Sarissa.getText(tmpRadius))/1000));realignPushPins();var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"))
if(o[reqId]&&o[reqId]!=null){o[reqId](aa);o[reqId]=null;};ap=self.getGXPixelPoint(aa);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(Credentials.trafficEnabled){try{var traffic=oDomDoc.selectNodes("//xls:Position");var desc=oDomDoc.selectNodes("//xls:Description");for(var i=0;i<traffic.length;i++){var t1=Sarissa.getText(traffic[i]);var t2=Sarissa.getText(desc[i]);var pos=new Position(t1);var icon=new Icon("img/incident.png",10,10,21,21);var pin=new Pin(pos,"<FONT SIZE='1' FACE='ARIAL'><B>"+t2+"</B></FONT>","mouseover",icon);self.addPin(pin);};}catch(e){alert("Map.sendMapRequest updating traffic info\n\n"+e.message);};};};};xmlhttp.send(c);};function bs(){if(!ah){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){}};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");aa=new Position(oDomDoc.selectSingleNode("//gml:pos/text()").data);ap=self.getGXPixelPoint(aa);var panN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");var panE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");af=new Array(parseFloat(panE.getAttribute("numTiles"))*m,parseFloat(panN.getAttribute("numTiles"))*m);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")
ad.setRadius((parseFloat(oDomDoc.selectSingleNode("//xls:Radius/text()").data)/1000));else ad.setRadius((parseFloat(oDomDoc.selectSingleNode("//xls:Radius/text()").data)));bd=false;realignPushPins();if(p["zoomend"])
p["zoomend"]();}catch(e){alert("Map.sendZoomRequest\n\n"+e.message);};};};xmlhttp.send(c);};function updateUrlList(urlList){var imgCount=g*d;for(var i=0;i<imgCount;i++){try{bw[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 y=0;y<d;++y)
for(var x=0;x<g;++x){tmpArrayOfURLs[y][x]=bw[urlcount];urlcount++;};for(var y=1;y<d-1;++y){for(var x=1;x<g-1;++x){updateURL(x,y,tmpArrayOfURLs[y][x]);};};for(var y=0;y<d;++y){updateURL(0,y,tmpArrayOfURLs[y][0]);};for(var y=0;y<d;++y){updateURL(d-1,y,tmpArrayOfURLs[y][d-1]);};for(var y=1;y<d-1;++y){updateURL(y,d-1,tmpArrayOfURLs[d-1][y]);};for(var y=1;y<d-1;++y){updateURL(y,0,tmpArrayOfURLs[0][y]);};};function updateURL(x,y,url){if(v=="SATELLITE"){b[y][x][0].style.zIndex=50;b[y][x][1].style.zIndex=100;b[y][x][0].style.top=parseInt(b[y][x][1].style.top)+af[1]+ae;b[y][x][0].style.left=parseInt(b[y][x][1].style.left)-af[0]+ae;b[y][x][0].src=url.getGlobeExplorerURL();b[y][x][0].altSrc=url.getGlobeExplorerURL();if(Utilities.ie6)
b[y][x][1].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/tile.png')";b[y][x][1].altSrc=url.getDeCartaURL();}else if(v=="STREET"){b[y][x][0].style.zIndex=50;b[y][x][1].style.zIndex=100;b[y][x][0].style.top=parseInt(b[y][x][1].style.top)+af[1]+ae;b[y][x][0].style.left=parseInt(b[y][x][1].style.left)-af[0]+ae;b[y][x][0].altSrc=url.getGlobeExplorerURL();b[y][x][1].src=url.getDeCartaURL();b[y][x][1].altSrc=url.getDeCartaURL();}else if(v=="HYBRID"){b[y][x][0].style.zIndex=1;b[y][x][0].style.top=parseInt(b[y][x][1].style.top)+af[1]+ae;b[y][x][0].style.left=parseInt(b[y][x][1].style.left)-af[0]+ae;b[y][x][0].src=url.getGlobeExplorerURL();b[y][x][0].altSrc=url.getGlobeExplorerURL();b[y][x][1].zIndex=10;b[y][x][1].altSrc=url.getDeCartaURL();b[y][x][1].loader.src=b[y][x][1].altSrc;};};function realignPushPins(){var scale=Utilities.radsPerPixelAtZoom(256,ad.getGXConvertedZoomLevel());for(var i=0;i<q.length;i++){if(q[i]!=null){var cy=Utilities.lat2pix(aa.lat,scale);var cx=Utilities.lon2pix(aa.lon,scale);var py=Utilities.lat2pix(q[i].position.lat,scale);var px=Utilities.lon2pix(q[i].position.lon,scale);var pix=new PixelPoint((m*g)/2,(m*g)/2);q[i].setX(pix.x+aq-Math.round(cx-px));q[i].setY(pix.y+at+Math.round(cy-py));h.appendChild(q[i].pinImg);q[i].hideInfoWindow();if(q[i].pinTxt)
h.appendChild(q[i].pinTxt);};};self.showPins();};function initBubble(){try{w=document.createElement("DIV");w.type="default";u=document.createElement("IMG");u.src="img/close.png";u.id="close";u.style.zIndex=99999;u.style.position="absolute";u.style.width="20px";u.style.height="20px";u.style.top="2px";u.style.left="178px";u.style.display="block";u.style.cursor="pointer";u.onclick=function(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;document.getElementById("bubble").style.display="none";};ai=document.createElement("DIV");ai.style.padding="16px";ai.style.zIndex=99998;ai.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(u);w.appendChild(ai);if(h!=null)
h.appendChild(w);}catch(e){alert("Map.initBubble\n\n"+e.message);};};function devnull(){return false;};function populateTiles(){if(h){reset();return;};if(!ad){ad=new ZoomController();self.addZoomController(ad);ad.hide();};var mapPaneDiv=self.mapDiv;mapPaneDiv.style.overflow="hidden";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));};h=document.createElement("DIV");h.id="tiles";h.style.position="absolute";h.style.left=0+ae;h.style.top=0+ae;h.style.zIndex=0;mapPaneDiv.appendChild(h);bp=Utilities.getAbsoluteTop(h)+(parseInt(mapPaneDiv.style.height)/2);bq=Utilities.getAbsoluteLeft(h)+(parseInt(mapPaneDiv.style.width)/2);if(!w)
initBubble();w.style.display="none";h.appendChild(w);var mapDivHeight=parseInt(mapPaneDiv.style.height);var mapDivWidth=parseInt(mapPaneDiv.style.width);var greaterSide=mapDivHeight>mapDivWidth?mapDivHeight:mapDivWidth;var numberOfTiles=Math.ceil(greaterSide/m)+2;d=numberOfTiles;g=numberOfTiles;bo=(numberOfTiles*m)/2;bn=(numberOfTiles*m)/2;aq=-((numberOfTiles*m)-mapDivWidth)/2;at=-((numberOfTiles*m)-mapDivHeight)/2;var tmpX=aq;var tmpY=at;b=new Array(d);for(var i=0;i<d;++i)
b[i]=new Array(g);for(var y=0;y<d;++y){for(var x=0;x<g;++x){if(x==0)
tmpX=aq;var layerArray=new Array();b[y][x]=layerArray;var img=document.createElement("IMG");img.style.position="absolute";img.style.visibility="visible";img.id="SATELLITE";img.style.zIndex=0;img.border=0;img.unselectable="on";img.style.borderStyle="solid";img.style.width=m+ae;img.style.height=m+ae;img.style.left=tmpX+ae;img.style.top=tmpY+ae;img.src="img/tile.png";h.appendChild(img);var imgMap=createimage(tmpX,tmpY);h.appendChild(imgMap);layerArray[0]=img;layerArray[1]=imgMap;tmpX+=m;};tmpY+=m;};};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="MAP ";imgMap.style.zIndex=30;imgMap.style.left=tmpX+ae;imgMap.style.top=tmpY+ae;imgMap.src="img/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="img/x.gif";}else{imgMap.src=this.src;};};};return imgMap;};function rotateTiles(){var tmp=0;var tmp1=0;if(ak<-ag){cc++;for(var i=0;i<d;++i){tmp=parseInt(b[i][j][1].style.left)+(g*m);b[i][j][1].style.left=(tmp)+ae;var tmpUrl=updateUrlEast(b[i][j][1].altSrc);b[i][j][1].altSrc=tmpUrl;tmp1=parseInt(b[i][j][0].style.left)+(g*m);b[i][j][0].style.left=(tmp1)+ae;var tmpUrl1=updateUrlEast(b[i][j][0].altSrc);b[i][j][0].altSrc=tmpUrl1;if(v=="HYBRID"){b[i][j][1].src=r;b[i][j][0].src=r;b[i][j][1].loader.src=b[i][j][1].altSrc;b[i][j][0].src=b[i][j][0].altSrc;}else if(v=="SATELLITE"){b[i][j][0].src=r;b[i][j][0].src=b[i][j][0].altSrc;}else if(v=="STREET"){b[i][j][1].src=r;b[i][j][1].src=b[i][j][1].altSrc;};};j=(j+1)%g;ak=ak+ag;}else if(ak>=ag){cb++;j=(j==0)?j=(g-1):--j;for(var i=0;i<d;++i){tmp=parseInt(b[i][j][0].style.left)-(g*m);b[i][j][0].style.left=(tmp)+ae;var tmpUrl=updateUrlWest(b[i][j][0].altSrc);b[i][j][0].altSrc=tmpUrl;tmp1=parseInt(b[i][j][1].style.left)-(g*m);b[i][j][1].style.left=(tmp1)+ae;var tmpUrl1=updateUrlWest(b[i][j][1].altSrc);b[i][j][1].altSrc=tmpUrl1;if(v=="HYBRID"){b[i][j][1].src=r;b[i][j][0].src=r;b[i][j][1].loader.src=b[i][j][1].altSrc;b[i][j][0].src=b[i][j][0].altSrc;}else if(v=="SATELLITE"){b[i][j][0].src=r;b[i][j][0].src=b[i][j][0].altSrc;}else if(v=="STREET"){b[i][j][1].src=r;b[i][j][1].src=b[i][j][1].altSrc;};};ak=ak-ag;}else if(aj<-ag){bx++;for(var i=0;i<g;++i){tmp=parseInt(b[k][i][0].style.top)+(d*m);b[k][i][0].style.top=(tmp)+ae;var tmpUrl=updateUrlSouth(b[k][i][0].altSrc);b[k][i][0].altSrc=tmpUrl;tmp1=parseInt(b[k][i][1].style.top)+(d*m);b[k][i][1].style.top=(tmp1)+ae;var tmpUrl1=updateUrlSouth(b[k][i][1].altSrc);b[k][i][1].altSrc=tmpUrl1;if(v=="HYBRID"){b[k][i][1].src=r;b[k][i][0].src=r;b[k][i][1].loader.src=b[k][i][1].altSrc;b[k][i][0].src=b[k][i][0].altSrc;}else if(v=="SATELLITE"){b[k][i][0].src=r;b[k][i][0].src=b[k][i][0].altSrc;}else if(v=="STREET"){b[k][i][1].src=r;b[k][i][1].src=b[k][i][1].altSrc;};};k=(k+1)%d;aj=aj+ag;}else if(aj>=-ag){by++;k=(k==0)?k=(d-1):--k;for(var i=0;i<g;++i){tmp=parseInt(b[k][i][0].style.top)-(d*m);b[k][i][0].style.top=(tmp)+ae;var tmpUrl=updateUrlNorth(b[k][i][0].altSrc);b[k][i][0].altSrc=tmpUrl;tmp1=parseInt(b[k][i][1].style.top)-(d*m);b[k][i][1].style.top=(tmp1)+ae;var tmpUrl1=updateUrlNorth(b[k][i][1].altSrc);b[k][i][1].altSrc=tmpUrl1;if(v=="HYBRID"){b[k][i][1].src=r;b[k][i][0].src=r;b[k][i][1].loader.src=b[k][i][1].altSrc;b[k][i][0].src=b[k][i][0].altSrc;}else if(v=="SATELLITE"){b[k][i][0].src=r;b[k][i][0].src=b[k][i][0].altSrc;}else if(v=="STREET"){b[k][i][1].src=r;b[k][i][1].src=b[k][i][1].altSrc;};};aj=aj-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);bi=new Date();}else if(e.type=="click"&&((bi-bb)<300)){click(e);}else if(e.type=="dblclick"){doubleClick(e);};};function click(e){self.mapDiv.style.cursor="pointer";self.mapDiv.UNSELECTABLE="on"
var top=(ah?event.clientY:e.clientY)-Utilities.getAbsoluteTop(h)+document.body.scrollTop;var left=(ah?event.clientX:e.clientX)-Utilities.getAbsoluteLeft(h)+document.body.scrollLeft;var cPos=self.getCenterPosition();var pixelPercentY=1-((parseInt(top)-at+al)/(m*d));var pixelPercentX=((parseInt(left)-aq+am)/(m*d));var bbox=Utilities.centerContextToBoundingBox(cPos,ad.getRadius());var YYY=(bbox.heightInDegrees*pixelPercentY)+bbox.getMinPosition().getLat();var XXX=(bbox.widthInDegrees*pixelPercentX)+bbox.getMinPosition().getLon();if(p["rightclick"]&&(ah&&event.button==2)||(!ah&&e.which==3)){p["rightclick"](new Position(YYY,XXX));return false;};if(p["click"]&&e.type=="click"){p["click"](new Position(YYY,XXX));};if(p["dblclick"]&&e.type=="dblclick"){p["dblclick"](new Position(YYY,XXX));};};function startDrag(e){bb=new Date();if((ah&&event.button==2)||(!ah&&e.which==3)){if(p["rightclick"])
click(e);};if(!ay){endDrag();return false;};bv=true;document.getElementById("map").style.cursor="move";aw=ah?event.clientX:e.clientX;av=ah?event.clientY:e.clientY;document.body.onmousemove=whileDragging;return false;};var br=false;function endDrag(e){bv=false;document.getElementById("map").style.cursor="default";document.body.onmousemove=null;if(br&&p["moveend"]){p["moveend"]();br=false;};return false;};function doubleClick(e){as=null;bm=true;if(p["dblclick"])
click(e);if(!an)
return false;var clickX=ah?event.clientX:e.clientX;var clickY=ah?event.clientY:e.clientY;var divPosX=Utilities.getAbsoluteLeft(self.mapDiv)-document.body.scrollLeft;var divPosY=Utilities.getAbsoluteTop(self.mapDiv)-document.body.scrollTop;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(x,y){am=-x;al=-y;h.style.left=-x+ae;h.style.top=-y+ae;};function whileDragging(e){br=true;as=null;if(!bv)
return false;var draggingX=(ah?event.clientX:e.clientX)-aw;var draggingY=(ah?event.clientY:e.clientY)-av;ak+=draggingX;aj+=draggingY;if(Math.abs(ak)>ag)
rotateTiles();if(Math.abs(aj)>ag)
rotateTiles();ba-=draggingX;az-=draggingY;move(ba,az);aw=ah?event.clientX:e.clientX;av=ah?event.clientY:e.clientY;return false;};function slider(x,y){am=am+(x);al=al+(y);slide(x,y);};slide=function(x,y){var percentX=Math.round(Math.abs(x)*.3);var percentY=Math.round(Math.abs(y)*.3);if(percentX>0||percentY>0){if(x<0){h.style.left=parseInt(h.style.left)-percentX+ae;x+=percentX;ak-=percentX;ba+=percentX;ca+=percentX;}else if(x>0){h.style.left=parseInt(h.style.left)+percentX+ae;x-=percentX;ak+=percentX;ba-=percentX;ca-=percentX;};if(y<0){h.style.top=parseInt(h.style.top)-percentY+ae;y+=percentY;aj-=percentY;az+=percentY;bz+=percentY;}else if(y>0){h.style.top=parseInt(h.style.top)+percentY+ae;y-=percentY;aj+=percentY;az-=percentY;bz-=percentY;};if(Math.abs(ak)>ag||Math.abs(aj)>ag)
rotateTiles();setTimeout("slide("+x+","+y+")",1);}else{if(p["moveend"])
p["moveend"]();if(bm&&bl)
self.getZoomController().zoomInOneLevel();ca=0;bz=0;bm=false;};};function reset(){h.style.left=0+ae;h.style.top=0+ae;var tmpX=aq;var tmpY=at;self.hidePins();for(var y=0;y<d;++y){for(var x=0;x<g;++x){if(x==0)
tmpX=aq;b[y][x][0].style.left=tmpX+ae;b[y][x][0].style.top=tmpY+ae;b[y][x][0].src="img/tile.png";b[y][x][1].style.left=tmpX+ae;b[y][x][1].style.top=tmpY+ae;b[y][x][1].src="img/tile.png";tmpX+=m;};tmpY+=m;};am=0;al=0;ba=0;az=0;aw=0;av=0;bv=false;ak=0;aj=0;k=0;j=0;by=0;bx=0;cc=0;cb=0;};this.getGXPixelPoint=function(pos){var scale=Utilities.radsPerPixelAtZoom(m,ad.getGXConvertedZoomLevel());var y=Utilities.lat2pix(pos.lat,scale);var x=Utilities.lon2pix(pos.lon,scale);return new PixelPointDP(x,y);};};function MapTypeController(){};function Pin(pos,message,bubbleEventType,icon){if(!pos){throw new Exception("Error instantiating Pin, must at least provide a Position.");return false;};this.type="pin";var self=this;var p=new Array();this.position=pos;this.icon=icon||new Icon("img/greenDot.png",12,12,24,24);this.pinImg=null;this.pinTxt=null;this.id="";this.pinImg=document.createElement("img");this.pinImg.style.position="absolute";this.pinImg.id=pos.toString();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;this.pinTxt.style.zIndex=200;this.pinTxt.onmousedown=function(e){if((document.all&&event.button==2)||(!document.all&&e.which==3))
rightclick(e);else click(e);};this.pinTxt.onmouseover=function(e){mouseover(e);};this.pinImg.msg=message||"";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(id){this.id=id;};this.getId=function(){return this.id;};this.setIcon=function(icon){self.pinImg.src=icon.src;if(self.icon.anchorY==icon.anchorY&&self.icon.anchorX==icon.anchorX&&icon.be&&icon.bf){self.pinImg.style.top=(parseInt(self.pinImg.style.top)+icon.be-icon.anchorY)+"px";self.pinImg.style.left=(parseInt(self.pinImg.style.left)+icon.bf-icon.anchorX)+"px";}else{self.pinImg.style.top=(parseInt(self.pinImg.style.top)+self.icon.anchorY-icon.anchorY)+"px";self.pinImg.style.left=(parseInt(self.pinImg.style.left)+self.icon.anchorX-icon.anchorX)+"px";};if(icon.width)
self.pinImg.style.width=icon.width+"px";if(icon.height)
self.pinImg.style.height=icon.height+"px";self.icon=icon;if(icon.overlay.text!=""){self.pinTxt.innerHTML=this.icon.overlay.text;self.pinTxt.style.position="absolute";if(icon.overlay.color)
self.pinTxt.style.color=icon.overlay.color;if(icon.overlay.size)
self.pinTxt.style.fontSize=icon.overlay.size;if(icon.overlay.fontFamily)
self.pinTxt.style.fontFamily=icon.overlay.fontFamily;self.pinTxt.style.left=(parseInt(self.pinImg.style.left)+
parseInt(self.icon.overlay.anchorX))+"px";self.pinTxt.style.top=(parseInt(self.pinImg.style.top)+
parseInt(self.icon.overlay.anchorY))+"px";self.pinTxt.style.zIndex=200;self.pinTxt.onmousedown=function(e){if((document.all&&event.button==2)||(!document.all&&e.which==3))
rightclick(e);else click(e);};self.pinTxt.onmouseover=function(e){mouseover(e);};}else{self.pinTxt.innerHTML="";};if(Utilities.ie6&&this.pinImg.src.match(new RegExp("\\bpng\\b","g"))){var src=this.pinImg.src;this.pinImg.src="img/x.gif";this.pinImg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";};};this.getIcon=function(){return self.icon;};this.setX=function(x){self.pinImg.style.left=(x-self.icon.anchorX)+"px";if(self.pinTxt)
self.pinTxt.style.left=(x-self.icon.anchorX+self.icon.overlay.anchorX)+"px";if(document.all){for(var i=0;i<p.length;i++)
self.reRegister(p[i],p[p[i]]);};};this.setY=function(y){self.pinImg.style.top=(y-self.icon.anchorY)+"px";if(self.pinTxt)
self.pinTxt.style.top=(y-self.icon.anchorY+self.icon.overlay.anchorY)+"px";};this.getPosition=function(){return self.position;};this.setMessage=function(message){self.pinImg.msg=message;if(self.pinImg.id==document.getElementById("bubble").whichPin)
document.getElementById("bubbleContent").innerHTML=message;};this.getMessage=function(){return self.pinImg.msg;};this.hide=function(){self.pinImg.style.display="none";};this.show=function(){self.pinImg.style.display="block";};this.showInfoWindow=function(){if(document.getElementById("bubble").type=="custom"){document.getElementById("bubble").style.left=(parseInt(self.pinImg.style.left)-parseInt(document.getElementById("bubble").offX))+"px";document.getElementById("bubble").style.top=(parseInt(self.pinImg.style.top)-parseInt(document.getElementById("bubble").offY))+"px";}else{document.getElementById("bubble").style.left=(parseInt(self.pinImg.style.left)+(self.icon.anchorX*2)+2)+"px";document.getElementById("bubble").style.top=parseInt(self.pinImg.style.top)+"px";};document.getElementById("bubbleContent").innerHTML=self.pinImg.msg;document.getElementById("bubble").style.display="block";document.getElementById("bubble").whichPin=self.pinImg.id;if(document.all){document.getElementById("close").onclick=function(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;document.getElementById("bubble").style.display="none";};};};this.hideInfoWindow=function(){document.getElementById("bubble").style.display="none";};this.reRegister=function(event,callBack){if(!self.pinImg.onclick&&event=="click"){self.pinImg.onclick=click;}else if(event=="rightclick"){self.pinImg.onmousedown=rightclick;}else if(!self.pinImg.onmouseover&&event=="mouseover"){self.pinImg.onmouseover=mouseover;}else if(!self.pinImg.onmouseout&&event=="mouseout"){self.pinImg.onmouseout=mouseout;};};this.addEventListener=function(event,callBack){var already=false;for(var i=0;i<p.length;i++)
if(p[i]==event){p[event]=callBack;already=true;break;};if(!already){p.push(event);p[event]=callBack;};if(!self.pinImg.onclick&&event=="click"){self.pinImg.onclick=click;}else if(event=="rightclick"){self.pinImg.onmousedown=rightclick;}else if(!self.pinImg.onmouseover&&event=="mouseover"){self.pinImg.onmouseover=mouseover;}else if(!self.pinImg.onmouseout&&event=="mouseout"){self.pinImg.onmouseout=mouseout;};};this.clearInstanceListeners=function(){for(var i=0;i<p.length;i++){p[p[i]]=null;p[i]=null;};};this.clearListeners=function(event){for(var i=0;i<p.length;i++)
if(p[i]==event)
p[p[i]]=null;p[i]=null;};function click(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;if(p["click"]){p["click"](self);};};function rightclick(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;if(p["rightclick"]){if((document.all&&event.button==2)||(!document.all&&e.which==3))
p["rightclick"](self);return false;};};function mouseover(){if(p["mouseover"]){p["mouseover"](self);};};function mouseout(){if(p["mouseout"]){p["mouseout"](self);};};if(bubbleEventType&&(bubbleEventType=="onmouseover"||bubbleEventType=="mouseover")){self.addEventListener("mouseover",self.showInfoWindow);self.addEventListener("mouseout",self.hideInfoWindow);}else if(bubbleEventType&&(bubbleEventType=="onclick"||bubbleEventType=="click")){self.addEventListener("click",self.showInfoWindow);};this.toString=function(){return self.position;};this.equals=function(pin){if(pin&&pin.toString()==this.toString()&&pin.pinImg==this.pinImg)
return true;else return false;};};function PixelPoint(v1,v2){try{this.x=parseInt(v1);this.y=parseInt(v2);}catch(e){throw new Exception("bad constructor values for x/y");};var self=this;this.getX=function(){return parseInt(self.x);};this.getY=function(){return parseInt(self.y);};this.equals=function(pd){if(pd&&pd.toString()==self.toString())
return true;else return false;};this.toString=function(){return self.x+" "+self.y;};};function PixelPointDP(v1,v2){try{this.x=parseFloat(v1);this.y=parseFloat(v2);}catch(e){throw new Exception("bad constructor values for x/y");};var self=this;this.getX=function(){return(self.x);};this.getY=function(){return(self.y);};this.equals=function(pd){if(pd&&pd.toString()==self.toString())
return true;else return false;};this.toString=function(){return self.x+" "+self.y;};};function POI(name,position,address,phoneNumber){this.name=name;this.position=position;this.address=address;this.phoneNumber=phoneNumber;this.toString=function(){return this.name+" "+this.position+" "+this.address+" "+this.phoneNumber;};};function POIQuery(){this.xmlRecFac=new XMLRequestFactory();var o=new Array();var self=this;this.authenticate=function(clientName,clientPassword){if(!clientName||!clientPassword||clientName==""||clientPassword==""){throw new Exception("Error authenticating POIQuery, invalid parameters.");return false;};Credentials.clientName=clientName;Credentials.clientPassword=clientPassword;};this.query=function(searchCriteria,callBack){var reqId=Utilities.getRequestId();o[reqId]=callBack;c=this.xmlRecFac.createPOIRequestDOM(searchCriteria,reqId);this.sendPOIQueryRequest();};this.sendPOIQueryRequest=function(){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){}};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"text/xml");if(document.all){oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");};var poiList=new Array();if(oDomDoc.selectNodes("//xls:Error").length>0){var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));o[reqId](null);}else if(oDomDoc.selectNodes("//xls:POI").length==0){var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"));o[reqId](poiList);}else{var POIS=oDomDoc.selectNodes("//xls:POIContext");for(var i=0;i<POIS.length;i++){var tmpDomTxt=Sarissa.serialize((POIS[i]))
var domParser=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(tmpDomTxt),"text/xml");var name=Sarissa.getText(domParser.selectSingleNode("//xls:POI/@POIName"));var phoneNumber=Sarissa.getText(domParser.selectSingleNode("//xls:POI/@phoneNumber"));var pos=tmpDomTxt.substring(tmpDomTxt.indexOf("<gml:pos>")+"<gml:pos>".length,tmpDomTxt.indexOf("</gml:pos>"));var num="";var str="";var stt="";var cou="";var cit="";var pst="";try{num=Sarissa.getText(domParser.selectSingleNode("//xls:Building/@number"));}catch(e){};try{str=Sarissa.getText(domParser.selectSingleNode("//xls:Street"));}catch(e){};try{stt=Sarissa.getText(domParser.selectSingleNode("//xls:Place[@type='CountrySubdivision']"));}catch(e){};try{cou=Sarissa.getText(domParser.selectSingleNode("//xls:Place[@type='CountrySecondarySubdivision']"));}catch(e){};try{cit=Sarissa.getText(domParser.selectSingleNode("//xls:Place[@type='Municipality']"));}catch(e){};try{pst=Sarissa.getText(domParser.selectSingleNode("//xls:PostalCode"));}catch(e){};var adr=new Address(num,str,stt,cou,cit,pst);poiList.push(new POI(name,new Position(pos),adr,phoneNumber));};var reqId=Sarissa.getText(oDomDoc.selectSingleNode("//xls:Response/@requestID"))
o[reqId](poiList);};};};xmlhttp.send(c);};};function Position(latitude,longitude){if(arguments.length==1){var stringSplit=latitude.split(" ");if(stringSplit.length!=2){throw new Exception("error initializing Position object");};try{this.lat=parseFloat(stringSplit[0]);this.lon=parseFloat(stringSplit[1]);}catch(e){throw new Exception("error initializing Position object");};}else if(arguments.length==2){try{this.lat=parseFloat(latitude);this.lon=parseFloat(longitude);}catch(e){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(lt){this.lat=lt;};this.setLon=function(ln){this.lon=ln;};this.getLatLon=function(){return this.lat+" "+this.lon;};this.getLatCommaLon=function(){return this.lat+", "+this.lon;};this.equals=function(position){if(position&&position.getLatLon()==this.getLatLon())
return true;else return false;};this.toString=function(){return this.lat+" "+this.lon;};};function Radius(distance,uom){this.distance=distance;this.uom=uom||new UOM("KM");this.toString=function(){return this.distance+" "+this.uom;};};function RoutePreference(routePreference,uom,routeQueryType){if(routePreference!="Fastest"&&routePreference!="Shortest"&&routePreference!="Pedestrian"&&routePreference!="AvoidFreeways"&&routePreference!="NoFreeways"&&routePreference!="IgnorePipes"&&routePreference!="MoreFreeways"&&routePreference!="Easy"){alert("invalid route preference type, please see documentation");return false;};this.routePreference=routePreference;this.uom=uom||new UOM("KM");this.routeQueryType=routeQueryType||"RTXT";};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 _sarissa_iNsCounter=0;var _SARISSA_IEPREFIX4XSLPARAM="";var _SARISSA_HAS_DOM_IMPLEMENTATION=document.implementation&&true;var _SARISSA_HAS_DOM_CREATE_DOCUMENT=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.createDocument;var _SARISSA_HAS_DOM_FEATURE=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.hasFeature;var _SARISSA_IS_MOZ=_SARISSA_HAS_DOM_CREATE_DOCUMENT&&_SARISSA_HAS_DOM_FEATURE;var _SARISSA_IS_SAFARI=(navigator.userAgent&&navigator.vendor&&(navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1||navigator.vendor.indexOf("Apple")!=-1));var _SARISSA_IS_IE=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(_SARISSA_IS_IE){_SARISSA_IEPREFIX4XSLPARAM="xsl:";var _SARISSA_DOM_PROGID="";var _SARISSA_XMLHTTP_PROGID="";var _SARISSA_DOM_XMLWRITER="";Sarissa.pickRecentProgID=function(idList){var bFound=false;for(var i=0;i<idList.length&&!bFound;i++){try{var oDoc=new ActiveXObject(idList[i]);o2Store=idList[i];bFound=true;}catch(objException){};};if(!bFound){throw"Could not retreive a valid progID of Class: "+idList[idList.length-1]+". (original exception: "+e+")";};idList=null;return o2Store;};_SARISSA_DOM_PROGID=null;_SARISSA_THREADEDDOM_PROGID=null;_SARISSA_XSLTEMPLATE_PROGID=null;_SARISSA_XMLHTTP_PROGID=null;if(!window.XMLHttpRequest){XMLHttpRequest=function(){if(!_SARISSA_XMLHTTP_PROGID){_SARISSA_XMLHTTP_PROGID=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]);};return new ActiveXObject(_SARISSA_XMLHTTP_PROGID);};};Sarissa.getDomDocument=function(sUri,sName){if(!_SARISSA_DOM_PROGID){_SARISSA_DOM_PROGID=Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]);};var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);if(sName){var prefix="";if(sUri){if(sName.indexOf(":")>1){prefix=sName.substring(0,sName.indexOf(":"));sName=sName.substring(sName.indexOf(":")+1);}else{prefix="a"+(_sarissa_iNsCounter++);};};if(sUri){oDoc.loadXML('<'+prefix+':'+sName+" xmlns:"+prefix+"=\""+sUri+"\""+" />");}else{oDoc.loadXML('<'+sName+" />");};};return oDoc;};Sarissa.getParseErrorText=function(oDoc){var parseErrorText=Sarissa.PARSED_OK;if(oDoc.parseError.errorCode!=0){parseErrorText="XML Parsing Error: "+oDoc.parseError.reason+
"\nLocation: "+oDoc.parseError.url+
"\nLine Number "+oDoc.parseError.line+", Column "+
oDoc.parseError.linepos+
":\n"+oDoc.parseError.srcText+
"\n";for(var i=0;i<oDoc.parseError.linepos;i++){parseErrorText+="-";};parseErrorText+="^\n";}else if(oDoc.documentElement==null){parseErrorText=Sarissa.PARSED_EMPTY;};return parseErrorText;};Sarissa.setXpathNamespaces=function(oDoc,sNsSet){oDoc.setProperty("SelectionLanguage","XPath");oDoc.setProperty("SelectionNamespaces",sNsSet);};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(xslDoc){if(!_SARISSA_THREADEDDOM_PROGID){_SARISSA_THREADEDDOM_PROGID=Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.3.0"]);};xslDoc.setProperty("SelectionLanguage","XPath");xslDoc.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var converted=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);if(xslDoc.url&&xslDoc.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']")!=null){converted.async=false;if(_SARISSA_THREADEDDOM_PROGID=="MSXML2.FreeThreadedDOMDocument.6.0"){converted.setProperty("AllowDocumentFunction",true);converted.resolveExternals=true;};converted.load(xslDoc.url);}else{converted.loadXML(xslDoc.xml);};converted.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var output=converted.selectSingleNode("//xsl:output");this.outputMethod=output?output.getAttribute("method"):"html";this.template.stylesheet=converted;this.processor=this.template.createProcessor();this.paramsSet=new Array();};XSLTProcessor.prototype.transformToDocument=function(sourceDoc){if(_SARISSA_THREADEDDOM_PROGID){this.processor.input=sourceDoc;var outDoc=new ActiveXObject(_SARISSA_DOM_PROGID);this.processor.output=outDoc;this.processor.transform();return outDoc;}else{if(!_SARISSA_DOM_XMLWRITER){_SARISSA_DOM_XMLWRITER=Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"]);};this.processor.input=sourceDoc;var outDoc=new ActiveXObject(_SARISSA_DOM_XMLWRITER);this.processor.output=outDoc;this.processor.transform();var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);oDoc.loadXML(outDoc.output+"");return oDoc;};};XSLTProcessor.prototype.transformToFragment=function(sourceDoc,ownerDoc){this.processor.input=sourceDoc;this.processor.transform();var s=this.processor.output;var f=ownerDoc.createDocumentFragment();if(this.outputMethod=='text'){f.appendChild(ownerDoc.createTextNode(s));}else if(ownerDoc.body&&ownerDoc.body.innerHTML){var container=ownerDoc.createElement('div');container.innerHTML=s;while(container.hasChildNodes()){f.appendChild(container.firstChild);};}else{var oDoc=new ActiveXObject(_SARISSA_DOM_PROGID);if(s.substring(0,5)=='<?xml'){s=s.substring(s.indexOf('?>')+2);};var xml=''.concat('<my>',s,'</my>');oDoc.loadXML(xml);var container=oDoc.documentElement;while(container.hasChildNodes()){f.appendChild(container.firstChild);};};return f;};XSLTProcessor.prototype.setParameter=function(nsURI,name,value){if(nsURI){this.processor.addParameter(name,value,nsURI);}else{this.processor.addParameter(name,value);};if(!this.paramsSet[""+nsURI]){this.paramsSet[""+nsURI]=new Array();};this.paramsSet[""+nsURI][name]=value;};XSLTProcessor.prototype.getParameter=function(nsURI,name){nsURI=nsURI||"";if(this.paramsSet[nsURI]&&this.paramsSet[nsURI][name]){return this.paramsSet[nsURI][name];}else{return null;};};XSLTProcessor.prototype.clearParameters=function(){for(var nsURI in this.paramsSet){for(var name in this.paramsSet[nsURI]){if(nsURI){this.processor.addParameter(name,null,nsURI);}else{this.processor.addParameter(name,null);};};};this.paramsSet=new Array();};}else{if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(oDoc){Sarissa.__setReadyState__(oDoc,4);};_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this);};Sarissa.__setReadyState__=function(oDoc,iReadyState){oDoc.readyState=iReadyState;oDoc.readystate=iReadyState;if(oDoc.onreadystatechange!=null&&typeof oDoc.onreadystatechange=="function")
oDoc.onreadystatechange();};Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(!oDoc.onreadystatechange){oDoc.onreadystatechange=null;};if(!oDoc.readyState){oDoc.readyState=0;};oDoc.addEventListener("load",_sarissa_XMLDocument_onload,false);return oDoc;};if(window.XMLDocument){}else if(_SARISSA_HAS_DOM_FEATURE&&window.Document&&!Document.prototype.load&&document.implementation.hasFeature('LS','3.0')){Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);return oDoc;};}else{Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(oDoc&&(sUri||sName)&&!oDoc.documentElement){oDoc.appendChild(oDoc.createElementNS(sUri,sName));};return oDoc;};};};};if(!window.DOMParser){if(_SARISSA_IS_SAFARI){DOMParser=function(){};DOMParser.prototype.parseFromString=function(sXml,contentType){var xmlhttp=new XMLHttpRequest();xmlhttp.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(sXml),false);xmlhttp.send(null);return xmlhttp.responseXML;};}else if(Sarissa.getDomDocument&&Sarissa.getDomDocument()&&Sarissa.getDomDocument(null,"bar").xml){DOMParser=function(){};DOMParser.prototype.parseFromString=function(sXml,contentType){var doc=Sarissa.getDomDocument();doc.loadXML(sXml);return doc;};};};if((typeof(document.importNode)=="undefined")&&_SARISSA_IS_IE){try{document.importNode=function(oNode,bChildren){var tmp;if(oNode.nodeName=="tbody"||oNode.nodeName=="tr"){tmp=document.createElement("table");}else if(oNode.nodeName=="td"){tmp=document.createElement("tr");}else if(oNode.nodeName=="option"){tmp=document.createElement("select");}else{tmp=document.createElement("div");};if(bChildren){tmp.innerHTML=oNode.xml?oNode.xml:oNode.outerHTML;}else{tmp.innerHTML=oNode.xml?oNode.cloneNode(false).xml:oNode.cloneNode(false).outerHTML;};return tmp.getElementsByTagName("*")[0];};}catch(e){};};if(!Sarissa.getParseErrorText){Sarissa.getParseErrorText=function(oDoc){var parseErrorText=Sarissa.PARSED_OK;if(!oDoc.documentElement){parseErrorText=Sarissa.PARSED_EMPTY;}else if(oDoc.documentElement.tagName=="parsererror"){parseErrorText=oDoc.documentElement.firstChild.data;parseErrorText+="\n"+oDoc.documentElement.firstChild.nextSibling.firstChild.data;}else if(oDoc.getElementsByTagName("parsererror").length>0){var parsererror=oDoc.getElementsByTagName("parsererror")[0];parseErrorText=Sarissa.getText(parsererror,true)+"\n";}else if(oDoc.parseError&&oDoc.parseError.errorCode!=0){parseErrorText=Sarissa.PARSED_UNKNOWN_ERROR;};return parseErrorText;};};Sarissa.getText=function(oNode,deep){var s="";var nodes=oNode.childNodes;for(var i=0;i<nodes.length;i++){var node=nodes[i];var nodeType=node.nodeType;if(nodeType==Node.TEXT_NODE||nodeType==Node.CDATA_SECTION_NODE){s+=node.data;}else if(deep==true
&&(nodeType==Node.ELEMENT_NODE
||nodeType==Node.DOCUMENT_NODE
||nodeType==Node.DOCUMENT_FRAGMENT_NODE)){s+=Sarissa.getText(node,true);};};return s;};if(!window.XMLSerializer&&Sarissa.getDomDocument&&Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){};XMLSerializer.prototype.serializeToString=function(oNode){return oNode.xml;};};Sarissa.stripTags=function(s){return s.replace(/<[^>]+>/g,"");};Sarissa.clearChildNodes=function(oNode){while(oNode.firstChild){oNode.removeChild(oNode.firstChild);};};Sarissa.copyChildNodes=function(nodeFrom,nodeTo,bPreserveExisting){if((!nodeFrom)||(!nodeTo)){throw"Both source and destination nodes must be provided";};if(!bPreserveExisting){Sarissa.clearChildNodes(nodeTo);};var ownerDoc=nodeTo.nodeType==Node.DOCUMENT_NODE?nodeTo:nodeTo.ownerDocument;var nodes=nodeFrom.childNodes;if(typeof(ownerDoc.importNode)!="undefined"){for(var i=0;i<nodes.length;i++){nodeTo.appendChild(ownerDoc.importNode(nodes[i],true));};}else{for(var i=0;i<nodes.length;i++){nodeTo.appendChild(nodes[i].cloneNode(true));};};};Sarissa.moveChildNodes=function(nodeFrom,nodeTo,bPreserveExisting){if((!nodeFrom)||(!nodeTo)){throw"Both source and destination nodes must be provided";};if(!bPreserveExisting){Sarissa.clearChildNodes(nodeTo);};var nodes=nodeFrom.childNodes;if(nodeFrom.ownerDocument==nodeTo.ownerDocument){while(nodeFrom.firstChild){nodeTo.appendChild(nodeFrom.firstChild);};}else{var ownerDoc=nodeTo.nodeType==Node.DOCUMENT_NODE?nodeTo:nodeTo.ownerDocument;if(typeof(ownerDoc.importNode)!="undefined"){for(var i=0;i<nodes.length;i++){nodeTo.appendChild(ownerDoc.importNode(nodes[i],true));};}else{for(var i=0;i<nodes.length;i++){nodeTo.appendChild(nodes[i].cloneNode(true));};};Sarissa.clearChildNodes(nodeFrom);};};Sarissa.xmlize=function(anyObject,objectName,indentSpace){indentSpace=indentSpace?indentSpace:'';var s=indentSpace+'<'+objectName+'>';var isLeaf=false;if(!(anyObject instanceof Object)||anyObject instanceof Number||anyObject instanceof String
||anyObject instanceof Boolean||anyObject instanceof Date){s+=Sarissa.escape(""+anyObject);isLeaf=true;}else{s+="\n";var itemKey='';var isArrayItem=anyObject instanceof Array;for(var name in anyObject){s+=Sarissa.xmlize(anyObject[name],(isArrayItem?"array-item key=\""+name+"\"":name),indentSpace+"   ");};s+=indentSpace;};return s+=(objectName.indexOf(' ')!=-1?"</array-item>\n":"</"+objectName+">\n");};Sarissa.escape=function(sXml){return sXml.replace(/&/g,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;")
.replace(/"/g,"&quot;")
.replace(/'/g,"&apos;");};Sarissa.unescape=function(sXml){return sXml.replace(/&apos;/g,"'")
.replace(/&quot;/g,"\"")
.replace(/&gt;/g,">")
.replace(/&lt;/g,"<")
.replace(/&amp;/g,"&");};var bu=new XMLSerializer();Sarissa.serialize=function(x){return bu.serializeToString(x)
};Sarissa.updateCursor=function(oTargetElement,sValue){if(oTargetElement&&oTargetElement.style&&oTargetElement.style.cursor!=undefined){oTargetElement.style.cursor=sValue;};};Sarissa.updateContentFromURI=function(sFromUrl,oTargetElement,xsltproc,callback,skipCache){try{Sarissa.updateCursor(oTargetElement,"wait");var xmlhttp=new XMLHttpRequest();xmlhttp.open("GET",sFromUrl);function sarissa_dhtml_loadHandler(){if(xmlhttp.readyState==4){Sarissa.updateContentFromNode(xmlhttp.responseXML,oTargetElement,xsltproc,callback);};};xmlhttp.onreadystatechange=sarissa_dhtml_loadHandler;if(skipCache){var oldage="Sat, 1 Jan 2000 00:00:00 GMT";xmlhttp.setRequestHeader("If-Modified-Since",oldage);};xmlhttp.send("");}catch(e){Sarissa.updateCursor(oTargetElement,"auto");throw e;};};Sarissa.updateContentFromNode=function(oNode,oTargetElement,xsltproc,callback){try{Sarissa.updateCursor(oTargetElement,"wait");Sarissa.clearChildNodes(oTargetElement);var ownerDoc=oNode.nodeType==Node.DOCUMENT_NODE?oNode:oNode.ownerDocument;if(ownerDoc.parseError&&ownerDoc.parseError!=0){var pre=document.createElement("pre");pre.appendChild(document.createTextNode(Sarissa.getParseErrorText(ownerDoc)));oTargetElement.appendChild(pre);}else{if(xsltproc){oNode=xsltproc.transformToDocument(oNode);};if(oTargetElement.tagName.toLowerCase()=="textarea"||oTargetElement.tagName.toLowerCase()=="input"){oTargetElement.value=new XMLSerializer().serializeToString(oNode);}else{if(oNode.nodeType==Node.DOCUMENT_NODE||oNode.ownerDocument.documentElement==oNode){oTargetElement.innerHTML=new XMLSerializer().serializeToString(oNode);}else{oTargetElement.appendChild(oTargetElement.ownerDocument.importNode(oNode,true));};};};if(callback){callback(oNode,oTargetElement);};}catch(e){throw e;}finally{Sarissa.updateCursor(oTargetElement,"auto");};};if(!_SARISSA_IS_IE){if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(oDoc){Sarissa.__setReadyState__(oDoc,4);};function SarissaParseError(){this.errorCode=0;};_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this);};Sarissa.__setReadyState__=function(oDoc,iReadyState){oDoc.readyState=iReadyState;oDoc.readystate=iReadyState;if(oDoc.onreadystatechange!=null&&typeof oDoc.onreadystatechange=="function")
oDoc.onreadystatechange();};Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(!oDoc.onreadystatechange){oDoc.onreadystatechange=null;};if(!oDoc.readyState){oDoc.readyState=0;};if(!oDoc.parseError){oDoc.parseError=new SarissaParseError();};oDoc.addEventListener("load",_sarissa_XMLDocument_onload,false);return oDoc;};if(window.XMLDocument){XMLDocument.prototype._sarissa_load=XMLDocument.prototype.load;XMLDocument.prototype.load=function(sURI){var oDoc=Sarissa.getDomDocument();Sarissa.copyChildNodes(this,oDoc);this.parseError.errorCode=0;Sarissa.__setReadyState__(this,1);try{if(this.async==false&&_SARISSA_SYNC_NON_IMPLEMENTED){var tmp=new XMLHttpRequest();tmp.open("GET",sURI,false);tmp.send(null);Sarissa.__setReadyState__(this,2);Sarissa.copyChildNodes(tmp.responseXML,this);Sarissa.__setReadyState__(this,3);}else{this._sarissa_load(sURI);};}catch(objException){oDoc.parseError.errorCode=-1;}finally{if(!oDoc.documentElement||oDoc.documentElement.tagName=="parsererror"){oDoc.parseError.errorCode=-1;};if(this.async==false){Sarissa.__handleLoad__(this);};};return oDoc;};}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(sURI){var oldDoc=Sarissa.getDomDocument();Sarissa.copyChildNodes(this,oldDoc,false);var parser=document.implementation.createLSParser(this.async?document.implementation.MODE_ASYNCHRONOUS:document.implementation.MODE_SYNCHRONOUS,null);if(this.async){var self=this;parser.addEventListener("load",function(e){self.readyState=4;Sarissa.copyChildNodes(e.newDocument,self,false);self.onreadystatechange.call();},false);};try{var oDoc=parser.parseURI(sURI);if(!this.async){Sarissa.copyChildNodes(oDoc,this,false);};}catch(e){this.parseError.errorCode=-1;};return oldDoc;};Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(!oDoc.parseError){oDoc.parseError={errorCode:0};};return oDoc;};}else{Sarissa.getDomDocument=function(sUri,sName){var oDoc=document.implementation.createDocument(sUri?sUri:null,sName?sName:null,null);if(oDoc&&(sUri||sName)&&!oDoc.documentElement){oDoc.appendChild(oDoc.createElementNS(sUri,sName));};if(!oDoc.load){oDoc.load=function(sUrl){var oldDoc=document.implementation.createDocument();Sarissa.copyChildNodes(this,oldDoc);this.parseError={errorCode:0};Sarissa.__setReadyState__(this,1);if(this.async==false){var tmp=new XMLHttpRequest();tmp.open("GET",sUrl,false);tmp.send(null);Sarissa.__setReadyState__(this,2);Sarissa.copyChildNodes(tmp.responseXML,oDoc);if(!oDoc.documentElement||oDoc.getElementsByTagName("parsererror").length>0){oDoc.parseError.errorCode=-1;};Sarissa.__setReadyState__(this,3);Sarissa.__setReadyState__(this,4);}else{var xmlhttp=new XMLHttpRequest();xmlhttp.open('GET',sUrl,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){Sarissa.copyChildNodes(xmlhttp.responseXML,oDoc);if(!oDoc.documentElement||oDoc.getElementsByTagName("parsererror").length>0){oDoc.parseError.errorCode=-1;};};Sarissa.__setReadyState__(oDoc,xmlhttp.readyState);};xmlhttp.send(null);};return oldDoc;};};return oDoc;};};};};if(_SARISSA_HAS_DOM_FEATURE&&document.implementation.hasFeature("XPath","3.0")){function SarissaNodeList(i){this.length=i;};SarissaNodeList.prototype=new Array(0);SarissaNodeList.prototype.constructor=Array;SarissaNodeList.prototype.item=function(i){return(i<0||i>=this.length)?null:this[i];};SarissaNodeList.prototype.expr="";if(window.XMLDocument&&(!XMLDocument.prototype.setProperty)){XMLDocument.prototype.setProperty=function(x,y){};};Sarissa.setXpathNamespaces=function(oDoc,sNsSet){oDoc._sarissa_useCustomResolver=true;var namespaces=sNsSet.indexOf(" ")>-1?sNsSet.split(" "):new Array(sNsSet);oDoc._sarissa_xpathNamespaces=new Array(namespaces.length);for(var i=0;i<namespaces.length;i++){var ns=namespaces[i];var colonPos=ns.indexOf(":");var assignPos=ns.indexOf("=");if(colonPos>0&&assignPos>colonPos+1){var prefix=ns.substring(colonPos+1,assignPos);var uri=ns.substring(assignPos+2,ns.length-1);oDoc._sarissa_xpathNamespaces[prefix]=uri;}else{throw"Bad format on namespace declaration(s) given";};};};XMLDocument.prototype._sarissa_useCustomResolver=false;XMLDocument.prototype._sarissa_xpathNamespaces=new Array();XMLDocument.prototype.selectNodes=function(sExpr,contextNode,returnSingle){var nsDoc=this;var nsresolver=this._sarissa_useCustomResolver?function(prefix){var s=nsDoc._sarissa_xpathNamespaces[prefix];if(s)return s;else throw"No namespace URI found for prefix: '"+prefix+"'";}:this.createNSResolver(this.documentElement);var result=null;if(!returnSingle){var oResult=this.evaluate(sExpr,(contextNode?contextNode:this),nsresolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var nodeList=new SarissaNodeList(oResult.snapshotLength);nodeList.expr=sExpr;for(var i=0;i<nodeList.length;i++)
nodeList[i]=oResult.snapshotItem(i);result=nodeList;}else{result=oResult=this.evaluate(sExpr,(contextNode?contextNode:this),nsresolver,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;};return result;};Element.prototype.selectNodes=function(sExpr){var doc=this.ownerDocument;if(doc.selectNodes)
return doc.selectNodes(sExpr,this);else throw"Method selectNodes is only supported by XML Elements";};XMLDocument.prototype.selectSingleNode=function(sExpr,contextNode){var ctx=contextNode?contextNode:null;return this.selectNodes(sExpr,ctx,true);};Element.prototype.selectSingleNode=function(sExpr){var doc=this.ownerDocument;if(doc.selectSingleNode)
return doc.selectSingleNode(sExpr,this);else throw"Method selectNodes is only supported by XML Elements";};Sarissa.IS_ENABLED_SELECT_NODES=true;};function SearchCriteria(queryString,position,radius,maximumResponses){if(maximumResponses>100){alert("maximumResponses cannot exceed 100");return false;};this.queryString=queryString;this.position=position;this.radius=radius;this.maximumResponses=maximumResponses;};function ServerMonitor(){this.xmlRecFac=new XMLRequestFactory();this.query=function(){var reqId=Utilities.getRequestId();c=this.xmlRecFac.createRUOKRequestDOM(reqId);this.sendServerMonitorQueryRequest();};this.sendServerMonitorQueryRequest=function(){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){};};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){try{if(xmlhttp.status!=200){alert(ServerMonitor.WS_ERR);return false;};}catch(e){alert(ServerMonitor.WS_ERR);return false;};var oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"text/xml");if(document.all){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){if(((oDomDoc.selectNodes("//@message"))[0].value).indexOf("internal problem connecting to DDS")>-1){alert(ServerMonitor.DDS_ERR);}else if(((oDomDoc.selectNodes("//@message"))[0].value).indexOf("'rel' attribute")>-1){alert(ServerMonitor.VER_ERR);}else{alert((oDomDoc.selectNodes("//@message"))[0].value);};return false;};};};xmlhttp.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(text,anchorX,anchorY,color,size,fontFamily){this.text=text;this.anchorX=anchorX;this.anchorY=anchorY;this.color=color||null;this.size=size||null;this.fontFamily=fontFamily||null;this.toString=function(){return this.text+" "+this.anchorX+" "+this.anchorY+" "+this.size+" "+fontFamily;};};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(anchorX){this.anchorX=anchorX;};TextOverlay.prototype.setAnchorY=function(anchorY){this.anchorY=anchorY;};TextOverlay.prototype.setText=function(text){this.text=text;};TextOverlay.prototype.setColor=function(color){this.color=color;};TextOverlay.prototype.setSize=function(size){this.size=size;};TextOverlay.prototype.setFontFamily=function(fontFamily){this.fontFamily=fontFamily;};function UOM(value){if(value!="KM"&&value!="M"&&value!="MI"&&value!="FT"){alert("invalid UOM type,  KM M MI FT");return false;};this.value=value;this.toString=function(){return this.value;};};function URL(globeExplorerURL,deCartaURL){this.globeExplorerURL=globeExplorerURL.replace(URL.urlregx,"");;this.deCartaURL=deCartaURL.replace(URL.urlregx,"");;this.getDeCartaURL=function(){return this.deCartaURL;};this.getGlobeExplorerURL=function(){return this.globeExplorerURL;};};URL.urlregx=new RegExp("\\amp;","g");function Utilities(){};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.px="px";Utilities.fixPng=function(img){var src=img.src;img.src="img/x.gif";if(img.style.height&&img.style.width){img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";}else{img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"')";};};Utilities.podParse=function(pod){var days=pod.substring(pod.indexOf('P')+1,pod.indexOf('D'));var hours=pod.substring(pod.indexOf('T')+1,pod.indexOf('H'));var minutes=pod.substring(pod.indexOf('H')+1,pod.indexOf('M'));var seconds=pod.substring(pod.indexOf('M')+1,pod.indexOf('S'));if(days>0)
return((days*24)+hours)+' hours '+minutes+' minutes ';else if(hours>0)
return hours+' hours '+minutes+' minutes ';else if(minutes>0)
return minutes+' minutes '+seconds+' seconds ';else return seconds+' seconds';};Utilities.htmlizeXMLDom=function(oDomDoc){var regx1=new RegExp("\\>","g");var regx2=new RegExp("\\<","g");var xmlS=(Sarissa.serialize(oDomDoc));xmlS=xmlS.replace(regx1,"&gt;");xmlS=xmlS.replace(regx2,"&lt;");return"<PRE>"+xmlS+"</PRE>";};Utilities.debug=function(txt){try{document.getElementById("stdout").innerHTML+="<BR><FONT SIZE=2>"+txt;}catch(e){};};Utilities.println=function(txt){try{document.getElementById("stdout").innerHTML+="<BR><FONT SIZE=2>"+txt;}catch(e){alert("to use Utilities.debug() make a div with an id=stdout and a high z-index");};};Utilities.clearConsole=function(){if(document.getElementById("stdout"))
document.getElementById("stdout").innerHTML="";};Utilities.getRequestId=function(){return Math.floor(Math.random()*10000000);};Utilities.getAbsoluteLeft=function(obj){var left=obj.offsetLeft;var parent=obj.offsetParent;while(parent!=null){left+=parent.offsetLeft;parent=parent.offsetParent;};return left;};Utilities.getAbsoluteTop=function(obj){var top=obj.offsetTop;var parent=obj.offsetParent;while(parent!=null){top+=parent.offsetTop;parent=parent.offsetParent;};return top;};Utilities.purge=function(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]==='function'){d[n]=null;};};};a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){Utilities.purge(d.childNodes[i]);};};};Utilities.normalizePrefixes=function(XMLText){var reg1=new RegExp("ns1:","g");var tmp1=XMLText.replace(reg1,"xls:");var reg2=new RegExp("ns\\d+:","g");var tmp2=tmp1.replace(reg2,"gml:");var reg3=new RegExp("\\sxmlns:ns\\d+=\"http://www.opengis.net/gml\"","g");var tmp3=tmp2.replace(reg3,"");var reg4=new RegExp("xmlns:ns1=\"http://www.opengis.net/xls\"","g");var tmp4=tmp3.replace(reg4,"xmlns:xls=\"http://www.opengis.net/xls\" xmlns:gml=\"http://www.opengis.net/gml\"");return tmp4;};Utilities.centerContextToBoundingBox=function(pos,radius){var degreesofRadius=radius/111.111;var minLon=(pos.lon-parseFloat(degreesofRadius));var maxLon=(pos.lon+parseFloat(degreesofRadius));var degreesofLat=degreesofRadius*Math.cos(((pos.lat*Math.PI)/180));var minLat=(pos.lat-parseFloat(degreesofLat));var maxLat=(pos.lat+parseFloat(degreesofLat));return new BoundingBox(new Position(minLat,minLon),new Position(maxLat,maxLon));};Utilities.centerContextToBoundingBoxViewable=function(pos,radiusX,radiusY){var degreesofRadiusX=radiusX/111.111;var degreesofRadiusY=radiusY/111.111;var minLon=(pos.lon-parseFloat(degreesofRadiusX));var maxLon=(pos.lon+parseFloat(degreesofRadiusX));var degreesofLatY=degreesofRadiusY*Math.cos(((pos.lat*Math.PI)/180));var minLat=(pos.lat-parseFloat(degreesofLatY));var maxLat=(pos.lat+parseFloat(degreesofLatY));return new BoundingBox(new Position(minLat,minLon),new Position(maxLat,maxLon));};Utilities.latLonToPixels=function(bb,pos,pixels){var pixelX=pixels*((pos.lon-bb.minPosition.lon)/(bb.maxPosition.lon-bb.minPosition.lon));var pixelY=pixels*((bb.maxPosition.lat-pos.lat)/(bb.maxPosition.lat-bb.minPosition.lat));return new PixelPoint(Math.round(pixelX),Math.round(pixelY));};Utilities.formatRadiusToString=function(radius){if(typeof radius=='number'||typeof radius!='string')
radius=radius.toString();return radius.replace(new RegExp("\,"),"\.");};Utilities.pixelsToLatLon=function(x,y,bq,bp,m,d,cPos,ar){try{x=bq-x;y=bp-y;var cLat=cPos.getLat();var cLon=cPos.getLon();var bj=(ar*2)/111.111;var bh=bj/(m*d);var bg=(bj/Math.cos(((cLat*Math.PI)/180)))/(m*d);if(y!=0)
cLat=""+(parseFloat(cLat)+parseFloat(y*bh));if(x!=0)
cLon=""+(parseFloat(cLon)-parseFloat(x*bg));return new Position(cLat,cLon);}catch(e){alert(e.message);};};Utilities.positionsToBoundingBox=function(positions){if(!positions||positions.length<2)
throw new Exception("Utilities.positionsToBoundingBox requires at least two positions");var bboxTmp;for(var i=0;i<positions.length;i++){if(i==0){bboxTmp=new BoundingBox(new Position(positions[i].toString()),new Position(positions[i].toString()));}else{if(positions[i].lat>bboxTmp.getMaxPosition().lat)
bboxTmp.getMaxPosition().lat=positions[i].lat;if(positions[i].lon>bboxTmp.getMaxPosition().lon)
bboxTmp.getMaxPosition().lon=positions[i].lon;if(positions[i].lat<bboxTmp.getMinPosition().lat)
bboxTmp.getMinPosition().lat=positions[i].lat;if(positions[i].lon<bboxTmp.getMinPosition().lon)
bboxTmp.getMinPosition().lon=positions[i].lon;};};bboxTmp.heightInDegrees=bboxTmp.maxPosition.lat-bboxTmp.minPosition.lat;bboxTmp.widthInDegrees=bboxTmp.maxPosition.lon-bboxTmp.minPosition.lon;return bboxTmp;};Utilities.lat2pix=function(lat,scale){var radLat=(parseFloat(lat)*(2*Math.PI))/360;var ecc=0.08181919084262157;var sinPhi=Math.sin(radLat);var eSinPhi=ecc*sinPhi;var retVal=Math.log(((1.0+sinPhi)/(1.0-sinPhi))*
Math.pow((1.0-eSinPhi)/(1.0+eSinPhi),ecc))/2.0;return(retVal/scale);};Utilities.lon2pix=function(lon,scale){return((lon/180)*Math.PI)/scale;};Utilities.radsPerPixelAtZoom=function(tileSize,gxZoom){return 2*Math.PI/(tileSize<<gxZoom);};Utilities.pix2lon=function(x,scale){return(x*scale)*180/Math.PI;};Utilities.pix2lat=function(y,scale){var phiEpsilon=1E-7;var phiMaxIter=12;var t=Math.pow(Math.E,-y*scale);var prevPhi=Utilities.mercatorUnproject(t);var newPhi=Utilities.findRadPhi(prevPhi,t);var iterCount=0;while(iterCount<phiMaxIter&&Math.abs(prevPhi-newPhi)>phiEpsilon){prevPhi=newPhi;newPhi=Utilities.findRadPhi(prevPhi,t);iterCount++;};return newPhi*180/Math.PI;};Utilities.mercatorUnproject=function(t){return(Math.PI/2)-2*Math.atan(t);};Utilities.findRadPhi=function(phi,t){var ecc=0.08181919084262157;var eSinPhi=ecc*Math.sin(phi);return(Math.PI/2)-
(2*Math.atan(t*Math.pow((1-eSinPhi)/(1+eSinPhi),ecc/2)));};function WSXMLTunnel(){var self=this;this.send=function(xml,callBack){if(!document.all){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");}catch(e){};};var xmlhttp=new XMLHttpRequest();xmlhttp.open("POST",Credentials.url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var oDomDoc=Sarissa.getDomDocument();oDomDoc=(new DOMParser()).parseFromString(Utilities.normalizePrefixes(xmlhttp.responseText),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");callBack(oDomDoc);};};xmlhttp.send(xml);};};function XMLRequestFactory(){var self=this;this.getHeader=function(methodName,requestId,maximumResponses){var maximumResponses=maximumResponses||"10";try{var head=Sarissa.getDomDocument();var xls=head.createElement("xls:XLS");xls.setAttribute("xls:lang","en");xls.setAttribute("version","1");if(Credentials.rel&&Credentials.rel!=null){xls.setAttribute("rel",Credentials.rel);};xls.setAttribute("xmlns:xls","http://www.opengis.net/xls");xls.setAttribute("xmlns:gml","http://www.opengis.net/gml");head.appendChild(xls);var requestHeader=head.createElement("xls:RequestHeader");requestHeader.setAttribute("clientName",Credentials.clientName);if(Credentials.mapType=="STREET")
requestHeader.setAttribute("configuration",Credentials.configuration);else requestHeader.setAttribute("configuration",Credentials.transparentConfiguration);requestHeader.setAttribute("sessionID",Utilities.getRequestId());requestHeader.setAttribute("clientPassword",Credentials.clientPassword);xls.appendChild(requestHeader);var request=head.createElement("xls:Request");request.setAttribute("maximumResponses",maximumResponses);request.setAttribute("version","1.0");request.setAttribute("requestID",requestId);request.setAttribute("methodName",methodName);xls.appendChild(request);return head;}catch(e){alert("XMLRequestFactory.this.getHeader\n\n"+e.message);};};};XMLRequestFactory.prototype.createMapAddressRequestDOM=function(freeFormAddressIn,tileSize,horizontalTiles,verticalTiles,requestId,zoomLevel,trafficTime){try{var xmlRequestDOM=this.getHeader("PortrayMapRequest",requestId);var mapRequest=xmlRequestDOM.createElement("xls:PortrayMapRequest");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(mapRequest);var output=xmlRequestDOM.createElement("xls:Output");output.setAttribute("width",tileSize);output.setAttribute("height",tileSize);if(Credentials.mapType=="STREET")
output.setAttribute("format","GIF");else output.setAttribute("format","PNG");output.setAttribute("content","URL");mapRequest.appendChild(output);var centerAddress=xmlRequestDOM.createElement("xls:CenterAddress");var tileGrid=xmlRequestDOM.createElement("xls:TileGrid");tileGrid.setAttribute("rows",horizontalTiles);tileGrid.setAttribute("columns",verticalTiles);var tileGridLayerGX=xmlRequestDOM.createElement("xls:GridLayer");tileGridLayerGX.setAttribute("name","globexplorer");tileGridLayerGX.setAttribute("meta-inf","zoom="+zoomLevel);var tileGridLayerDC=xmlRequestDOM.createElement("xls:GridLayer");tileGridLayerDC.setAttribute("name","deCarta");tileGrid.appendChild(tileGridLayerDC);tileGrid.appendChild(tileGridLayerGX);var panN=xmlRequestDOM.createElement("xls:Pan");panN.setAttribute("direction","N");panN.setAttribute("numTiles","0");var panS=xmlRequestDOM.createElement("xls:Pan");panS.setAttribute("direction","S");panS.setAttribute("numTiles","0");var panE=xmlRequestDOM.createElement("xls:Pan");panE.setAttribute("direction","E");panE.setAttribute("numTiles","0");var panW=xmlRequestDOM.createElement("xls:Pan");panW.setAttribute("direction","W");panW.setAttribute("numTiles","0");tileGrid.appendChild(panN);tileGrid.appendChild(panS);tileGrid.appendChild(panE);tileGrid.appendChild(panW);output.appendChild(centerAddress);output.appendChild(tileGrid);var address2=xmlRequestDOM.createElement("xls:Address");address2.setAttribute("countryCode",freeFormAddressIn.getLocale().getCountry());address2.setAttribute("language",freeFormAddressIn.getLocale().getLanguage());centerAddress.appendChild(address2);var freeFormAddress=xmlRequestDOM.createElement("xls:freeFormAddress");freeFormAddressValue=xmlRequestDOM.createTextNode(freeFormAddressIn.toString());freeFormAddress.appendChild(freeFormAddressValue);address2.appendChild(freeFormAddress);if(Credentials.trafficEnabled){var trafficOverLay=xmlRequestDOM.createElement("xls:Overlay");var traffic=xmlRequestDOM.createElement("xls:Traffic");var flowReporting=xmlRequestDOM.createElement("xls:FlowReporting");if(trafficTime){flowReporting.setAttribute("time",trafficTime);traffic.appendChild(flowReporting);trafficOverLay.appendChild(traffic);}else{var incidentReporting=xmlRequestDOM.createElement("xls:IncidentReporting");incidentReporting.setAttribute("minimumSeverity","1");traffic.appendChild(flowReporting);traffic.appendChild(incidentReporting);trafficOverLay.appendChild(traffic);var centerAddress22=xmlRequestDOM.createElement("xls:CenterAddress");var radius22=xmlRequestDOM.createElement("xls:Radius");radius22.setAttribute("unit","KM");radiusValue22=xmlRequestDOM.createTextNode(200);radius22.appendChild(radiusValue22);var address33=xmlRequestDOM.createElement("xls:Address");address33.setAttribute("countryCode",freeFormAddressIn.getLocale().getCountry());address33.setAttribute("language",freeFormAddressIn.getLocale().getLanguage());centerAddress22.appendChild(radius22);centerAddress22.appendChild(address33);var freeFormAddress22=xmlRequestDOM.createElement("xls:freeFormAddress");freeFormAddressValue22=xmlRequestDOM.createTextNode(freeFormAddressIn);freeFormAddress22.appendChild(freeFormAddressValue22);address33.appendChild(freeFormAddress22);traffic.appendChild(centerAddress22);};mapRequest.appendChild(trafficOverLay);};if(document.all){xmlRequestDOM.setProperty("SelectionLanguage","XPath");xmlRequestDOM.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");};return xmlRequestDOM;}catch(e){alert("XMLRequestFactory.prototype.createMapAddressRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.createMapRequestDOM=function(positionIn,tileSize,horizontalTiles,verticalTiles,requestId,zoomLevel,trafficTime){try{var xmlRequestDOM=this.getHeader("PortrayMapRequest",requestId);var mapRequest=xmlRequestDOM.createElement("xls:PortrayMapRequest");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(mapRequest);var output=xmlRequestDOM.createElement("xls:Output");output.setAttribute("width",tileSize);output.setAttribute("height",tileSize);if(Credentials.mapType=="STREET")
output.setAttribute("format","GIF");else output.setAttribute("format","PNG");output.setAttribute("content","URL");mapRequest.appendChild(output);var centerContext=xmlRequestDOM.createElement("xls:CenterContext");centerContext.setAttribute("SRS","WGS-84");var tileGrid=xmlRequestDOM.createElement("xls:TileGrid");tileGrid.setAttribute("rows",horizontalTiles);tileGrid.setAttribute("columns",verticalTiles);var tileGridLayerGX=xmlRequestDOM.createElement("xls:GridLayer");tileGridLayerGX.setAttribute("name","globexplorer");tileGridLayerGX.setAttribute("meta-inf","zoom="+zoomLevel);var tileGridLayerDC=xmlRequestDOM.createElement("xls:GridLayer");tileGridLayerDC.setAttribute("name","deCarta");tileGrid.appendChild(tileGridLayerDC);tileGrid.appendChild(tileGridLayerGX);var panN=xmlRequestDOM.createElement("xls:Pan");panN.setAttribute("direction","N");panN.setAttribute("numTiles","0");var panS=xmlRequestDOM.createElement("xls:Pan");panS.setAttribute("direction","S");panS.setAttribute("numTiles","0");var panE=xmlRequestDOM.createElement("xls:Pan");panE.setAttribute("direction","E");panE.setAttribute("numTiles","0");var panW=xmlRequestDOM.createElement("xls:Pan");panW.setAttribute("direction","W");panW.setAttribute("numTiles","0");tileGrid.appendChild(panN);tileGrid.appendChild(panS);tileGrid.appendChild(panE);tileGrid.appendChild(panW);output.appendChild(centerContext);output.appendChild(tileGrid);var radius=xmlRequestDOM.createElement("xls:Radius");radius.setAttribute("unit","KM");radiusValue=xmlRequestDOM.createTextNode('0');radiusValue=xmlRequestDOM.createTextNode("200");radius.appendChild(radiusValue);var centerPoint=xmlRequestDOM.createElement("xls:CenterPoint");var pos=xmlRequestDOM.createElement("gml:pos");posTxt=xmlRequestDOM.createTextNode(positionIn.getLatLon());pos.appendChild(posTxt);centerPoint.appendChild(pos);centerContext.appendChild(centerPoint);centerContext.appendChild(radius);if(Credentials.trafficEnabled){var trafficOverLay=xmlRequestDOM.createElement("xls:Overlay");var traffic=xmlRequestDOM.createElement("xls:Traffic");var flowReporting=xmlRequestDOM.createElement("xls:FlowReporting");var incidentReporting=xmlRequestDOM.createElement("xls:IncidentReporting");incidentReporting.setAttribute("minimumSeverity","1");traffic.appendChild(flowReporting);traffic.appendChild(incidentReporting);trafficOverLay.appendChild(traffic);var centerContext2=xmlRequestDOM.createElement("xls:CenterContext");centerContext2.setAttribute("SRS","WGS-84");var radius2=xmlRequestDOM.createElement("xls:Radius");radius2.setAttribute("unit","KM");radiusValue2=xmlRequestDOM.createTextNode("200");radius2.appendChild(radiusValue2);var centerPoint2=xmlRequestDOM.createElement("xls:CenterPoint");var pos2=xmlRequestDOM.createElement("gml:pos");posTxt2=xmlRequestDOM.createTextNode(positionIn.getLatLon());pos2.appendChild(posTxt2);centerPoint2.appendChild(pos2);centerContext2.appendChild(centerPoint2);centerContext2.appendChild(radius2);traffic.appendChild(centerContext2);mapRequest.appendChild(trafficOverLay);};if(document.all){xmlRequestDOM.setProperty("SelectionLanguage","XPath");xmlRequestDOM.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");};return xmlRequestDOM;}catch(e){alert("XMLRequestFactory.prototype.createBasicMapRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.zoomMapRequestDOM=function(xmlRequestDOM,n,s,e,w,newZoomLevel,oldZoomLevel){try{var oDomDoc=(new DOMParser()).parseFromString(Sarissa.serialize(xmlRequestDOM),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var mapRequest=oDomDoc.selectSingleNode("//xls:PortrayMapRequest");var tmpN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");tmpN.setAttribute("numTiles",n);var tmpS=oDomDoc.selectSingleNode("//xls:Pan[@direction='S']");tmpS.setAttribute("numTiles",s);var tmpE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");tmpE.setAttribute("numTiles",e);var tmpW=oDomDoc.selectSingleNode("//xls:Pan[@direction='W']");tmpW.setAttribute("numTiles",w);if(Credentials.mapType!="STREET"){var tmpConf=(oDomDoc.selectSingleNode("//xls:RequestHeader"));tmpConf.setAttribute("configuration",Credentials.transparentConfiguration);}else{var tmpConf=(oDomDoc.selectSingleNode("//xls:RequestHeader"));tmpConf.setAttribute("configuration",Credentials.configuration);};var tmpFormat=(oDomDoc.selectSingleNode("//xls:Output"));if(Credentials.mapType=="STREET")
tmpFormat.setAttribute("format","GIF");else tmpFormat.setAttribute("format","PNG");var metaInf=oDomDoc.selectSingleNode("//xls:GridLayer[@name='globexplorer']");metaInf.setAttribute("meta-inf","zoom="+newZoomLevel+":"+oldZoomLevel);return oDomDoc;}catch(e){alert("XMLRequestFactory.prototype.zoomMapRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.changeMapStyleRequestDOM=function(xmlRequestDOM,configuration,n,s,e,w){try{Credentials.configuration=configuration;var oDomDoc=(new DOMParser()).parseFromString(Sarissa.serialize(xmlRequestDOM),"text/xml");oDomDoc.setProperty("SelectionLanguage","XPath");oDomDoc.setProperty("SelectionNamespaces","xmlns:xls='http://www.opengis.net/xls' xmlns:gml='http://www.opengis.net/gml'");var imgSettings=oDomDoc.selectSingleNode("//xls:RequestHeader/@configuration");imgSettings.value=configuration;var requestHeader=oDomDoc.selectSingleNode("//xls:RequestHeader/@sessionID");requestHeader.value=Utilities.getRequestId();var tmpN=oDomDoc.selectSingleNode("//xls:Pan[@direction='N']");tmpN.setAttribute("numTiles",n);var tmpS=oDomDoc.selectSingleNode("//xls:Pan[@direction='S']");tmpS.setAttribute("numTiles",s);var tmpE=oDomDoc.selectSingleNode("//xls:Pan[@direction='E']");tmpE.setAttribute("numTiles",e);var tmpW=oDomDoc.selectSingleNode("//xls:Pan[@direction='W']");tmpW.setAttribute("numTiles",w);return oDomDoc;}catch(e){alert("XMLRequestFactory.prototype.zoomMapRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.createGeocodeRequestDOM=function(address,requestId){try{var xmlRequestDOM=this.getHeader("GeocodeRequest",requestId);var geocodeRequest=xmlRequestDOM.createElement("xls:GeocodeRequest");geocodeRequest.setAttribute("returnFreeForm","true");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(geocodeRequest);var address2=xmlRequestDOM.createElement("xls:Address");address2.setAttribute("countryCode",address.getLocale().getCountry());address2.setAttribute("language",address.getLocale().getLanguage());geocodeRequest.appendChild(address2);var freeFormAddress=xmlRequestDOM.createElement("xls:freeFormAddress");freeFormAddressValue=xmlRequestDOM.createTextNode(address.toString());freeFormAddress.appendChild(freeFormAddressValue);address2.appendChild(freeFormAddress);return xmlRequestDOM;}catch(e){alert("XMLRequestFactory.prototype.getGeocodeRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.createReverseGeocodeRequestDOM=function(positionIn,requestId){try{var xmlRequestDOM=this.getHeader("ReverseGeocodeRequest",requestId);var revGeoRequest=xmlRequestDOM.createElement("xls:ReverseGeocodeRequest");revGeoRequest.setAttribute("returnFreeForm","true");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(revGeoRequest);var position=xmlRequestDOM.createElement("xls:Position");var point=xmlRequestDOM.createElement("gml:Point");var pos=xmlRequestDOM.createElement("gml:pos");var positionTxt=xmlRequestDOM.createTextNode(positionIn.getLatLon());pos.appendChild(positionTxt);point.appendChild(pos);position.appendChild(point);revGeoRequest.appendChild(position);var reverseGeocodePreference=xmlRequestDOM.createElement("xls:ReverseGeocodePreference");var reverseGeocodePreferenceTxt=xmlRequestDOM.createTextNode("StreetAddress");reverseGeocodePreference.appendChild(reverseGeocodePreferenceTxt);revGeoRequest.appendChild(reverseGeocodePreference);return xmlRequestDOM;}catch(e){alert("XMLRequestFactory.prototype.createReverseGeocodeRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.createCenterContext=function(centerPosition,radiusIn){var xmlRequestDOM=Sarissa.getDomDocument();var centerContext=xmlRequestDOM.createElement("xls:CenterContext");centerContext.setAttribute("SRS","WGS-84");var radius=xmlRequestDOM.createElement("xls:Radius");radius.setAttribute("unit","KM");radiusValue=xmlRequestDOM.createTextNode(Utilities.formatRadiusToString(radiusIn));radius.appendChild(radiusValue);var centerPoint=xmlRequestDOM.createElement("xls:CenterPoint");var pos=xmlRequestDOM.createElement("gml:pos");posTxt=xmlRequestDOM.createTextNode(centerPosition);pos.appendChild(posTxt);centerPoint.appendChild(pos);centerContext.appendChild(centerPoint);centerContext.appendChild(radius);return centerContext;};XMLRequestFactory.prototype.createRouteGeometryRequestDOM=function(positionList,requestId,routePreference,expectedStartTime){try{var xmlRequestDOM=this.getHeader("DetermineRouteRequest",requestId);var routeRequest=xmlRequestDOM.createElement("xls:DetermineRouteRequest");routeRequest.setAttribute("distanceUnit",routePreference.uom);routeRequest.setAttribute("routeQueryType",routePreference.routeQueryType);(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(routeRequest);var routePlan=xmlRequestDOM.createElement("xls:RoutePlan");if(Credentials.trafficEnabled)
routePlan.setAttribute("useRealTimeTraffic","true");if(Credentials.trafficEnabled&&expectedStartTime)
routePlan.setAttribute("expectedStartTime",(expectedStartTime.replace("-07:00","-06:00")));routeRequest.appendChild(routePlan);var routePref=xmlRequestDOM.createElement("xls:RoutePreference");var routePreferenceText=xmlRequestDOM.createTextNode(routePreference.routePreference);routePref.appendChild(routePreferenceText);routePlan.appendChild(routePref);var wayPointList=xmlRequestDOM.createElement("xls:WayPointList");for(var i=0;i<positionList.length;i++){if(i==0){var startPoint=xmlRequestDOM.createElement("xls:StartPoint");var position=xmlRequestDOM.createElement("xls:Position");var point=xmlRequestDOM.createElement("gml:Point");var pos=xmlRequestDOM.createElement("gml:pos");var positionTxt=xmlRequestDOM.createTextNode(positionList[i]);pos.appendChild(positionTxt);point.appendChild(pos);position.appendChild(point);startPoint.appendChild(position);wayPointList.appendChild(startPoint);}else if(i>0&&i<(positionList.length-1)){var wayPoint=xmlRequestDOM.createElement("xls:ViaPoint");var position=xmlRequestDOM.createElement("xls:Position");var point=xmlRequestDOM.createElement("gml:Point");var pos=xmlRequestDOM.createElement("gml:pos");var positionTxt=xmlRequestDOM.createTextNode(positionList[i]);pos.appendChild(positionTxt);point.appendChild(pos);position.appendChild(point);wayPoint.appendChild(position);wayPointList.appendChild(wayPoint);}else if(i==(positionList.length-1)){var endPoint=xmlRequestDOM.createElement("xls:EndPoint");var position=xmlRequestDOM.createElement("xls:Position");var point=xmlRequestDOM.createElement("gml:Point");var pos=xmlRequestDOM.createElement("gml:pos");var positionTxt=xmlRequestDOM.createTextNode(positionList[i]);pos.appendChild(positionTxt);point.appendChild(pos);position.appendChild(point);endPoint.appendChild(position);wayPointList.appendChild(endPoint);};};routePlan.appendChild(wayPointList);var routeInstructionsRequest=xmlRequestDOM.createElement("xls:RouteInstructionsRequest");routeInstructionsRequest.setAttribute("providePoint","true");var routeGeometryRequest=xmlRequestDOM.createElement("xls:RouteGeometryRequest");routeGeometryRequest.setAttribute("returnRouteIDOnly","true");routeRequest.appendChild(routeInstructionsRequest);routeRequest.appendChild(routeGeometryRequest);return xmlRequestDOM;}catch(e){alert("XMLRequestFactory.prototype.createRouteGeometryRequestDOM\n\n"+e.message);};};XMLRequestFactory.prototype.createRouteMapDOM=function(centerContext,routeID,requestId,tileSize,horizontalTiles,verticalTiles,zoomLevel,trafficTime){try{var xmlRequestDOM=this.getHeader("PortrayMapRequest",requestId);var mapRequest=xmlRequestDOM.createElement("xls:PortrayMapRequest");mapRequest.setAttribute("fitOverlays","false");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(mapRequest);var output=xmlRequestDOM.createElement("xls:Output");output.setAttribute("width",tileSize);output.setAttribute("height",tileSize);if(Credentials.mapType=="STREET")
output.setAttribute("format","GIF");else output.setAttribute("format","PNG");output.setAttribute("content","URL");output.appendChild(centerContext);var overLay=xmlRequestDOM.createElement("xls:Overlay");routeID.setAttribute("preference",Credentials.preference);overLay.appendChild(routeID);mapRequest.appendChild(output);mapRequest.appendChild(overLay);var tileGrid=xmlRequestDOM.createElement("xls:TileGrid");tileGrid.setAttribute("rows",horizontalTiles);tileGrid.setAttribute("columns",verticalTiles);var tileGridLayerGX=xmlRequestDOM.createElement("xls:GridLayer");tileGridLayerGX.setAttribute("name","globexplorer");tileGridLayerGX.setAttribute("meta-inf","zoom="+zoomLevel);var tileGridLayerDC=xmlRequestDOM.createElement("xls:GridLayer");tileGridLayerDC.setAttribute("name","deCarta");tileGrid.appendChild(tileGridLayerDC);tileGrid.appendChild(tileGridLayerGX);var panN=xmlRequestDOM.createElement("xls:Pan");panN.setAttribute("direction","N");panN.setAttribute("numTiles","0");var panS=xmlRequestDOM.createElement("xls:Pan");panS.setAttribute("direction","S");panS.setAttribute("numTiles","0");var panE=xmlRequestDOM.createElement("xls:Pan");panE.setAttribute("direction","E");panE.setAttribute("numTiles","0");var panW=xmlRequestDOM.createElement("xls:Pan");panW.setAttribute("direction","W");panW.setAttribute("numTiles","0");tileGrid.appendChild(panN);tileGrid.appendChild(panS);tileGrid.appendChild(panE);tileGrid.appendChild(panW);output.appendChild(tileGrid);if(Credentials.trafficEnabled){var trafficOverLay=xmlRequestDOM.createElement("xls:Overlay");var traffic=xmlRequestDOM.createElement("xls:Traffic");var flowReporting=xmlRequestDOM.createElement("xls:FlowReporting");if(trafficTime!=null)
flowReporting.setAttribute("time",trafficTime);var incidentReporting=xmlRequestDOM.createElement("xls:IncidentReporting");incidentReporting.setAttribute("minimumSeverity","1");traffic.appendChild(flowReporting);traffic.appendChild(incidentReporting);trafficOverLay.appendChild(traffic);mapRequest.appendChild(trafficOverLay);};return xmlRequestDOM;}catch(e){alert("XMLRequestFactory.prototype.createRouteMapDOM \n\n"+e.message);};};XMLRequestFactory.prototype.createPOIRequestDOM=function(searchCriteria,reqId){var xmlRequestDOM=this.getHeader("DirectoryRequest",reqId,searchCriteria.maximumResponses);var poiRequest=xmlRequestDOM.createElement("xls:DirectoryRequest");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(poiRequest);poiRequest.setAttribute("sortDirection","Ascending");poiRequest.setAttribute("sortCriteria","Distance");var poiLocation=xmlRequestDOM.createElement("xls:POILocation");poiRequest.appendChild(poiLocation);var withinDist=xmlRequestDOM.createElement("xls:WithinDistance");poiLocation.appendChild(withinDist);var maxDist=xmlRequestDOM.createElement("xls:MaximumDistance");maxDist.setAttribute("value",searchCriteria.radius.distance);maxDist.setAttribute("uom",searchCriteria.radius.uom.value);var minDist=xmlRequestDOM.createElement("xls:MinimumDistance");minDist.setAttribute("unit",searchCriteria.radius.uom.value);minDist.setAttribute("value","0");var POI=xmlRequestDOM.createElement("xls:POI");POI.setAttribute("ID","1");var point=xmlRequestDOM.createElement("gml:Point");var pos=xmlRequestDOM.createElement("gml:pos");var posTxt=xmlRequestDOM.createTextNode(searchCriteria.position.toString());pos.appendChild(posTxt)
point.appendChild(pos)
POI.appendChild(point);withinDist.appendChild(POI);withinDist.appendChild(minDist);withinDist.appendChild(maxDist);var poiProperties=xmlRequestDOM.createElement("xls:POIProperties");var poiProperty=xmlRequestDOM.createElement("xls:POIProperty");poiProperties.appendChild(poiProperty);poiRequest.appendChild(poiProperties);poiProperty.setAttribute("name","POIName");poiProperty.setAttribute("value",searchCriteria.queryString);return xmlRequestDOM;};XMLRequestFactory.prototype.createRUOKRequestDOM=function(reqId){var xmlRequestDOM=this.getHeader("RuokRequest",reqId);var RUOKRequest=xmlRequestDOM.createElement("xls:RUOKRequest");(xmlRequestDOM.getElementsByTagName("xls:Request"))[0].appendChild(RUOKRequest);return xmlRequestDOM;};function ZoomController(selected,color,checkedSrc,uncheckedSrc,topSrc,bottomSrc){if(selected&&selected<1||selected>17){throw new Exception("Error instantiating ZoomController, invalid initial"+
" value for ZoomController must be between 1 and 17");return false;};this.uncheckedSrc=uncheckedSrc||"img/zoom.png";this.checkedSrc=checkedSrc||"img/zoomChecked.png";this.color=color||"";this.selected=selected||5;this.zoomLevels=17;this.topCap=document.createElement("IMG");this.topCap.src=topSrc||"img/zoomTop.png";this.topCap.style.height="17px";this.topCap.style.width="17px";if(Utilities.ie6)
Utilities.fixPng(this.topCap);this.bottomCap=document.createElement("IMG");this.bottomCap.src=bottomSrc||"img/zoomBottom.png";if(!bottomSrc)
this.bottomCap.style.height="17px";if(!bottomSrc)
this.bottomCap.style.width="17px";if(Utilities.ie6)
Utilities.fixPng(this.bottomCap);var ab=new Array();var ar;var self=this;this.zoomer;this.map;this.initialize=function(map1){self.map=map1;for(var i=1;i<=self.zoomLevels;i++){var tmp=document.createElement("IMG");tmp.style.height="9px";tmp.style.width="17px";tmp.id=""+i;tmp.src=self.uncheckedSrc;tmp.checkedSrc=self.checkedSrc;tmp.onclick=function(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;if(map1.getZoomLck())
return false;clear();this.src=this.checkedSrc;map1.zoomMap(this.id);};ab.push(tmp);};self.zoomer=document.createElement("DIV");self.zoomer.style.cursor="pointer";self.zoomer.id="zoom";self.zoomer.style.width="20px";self.zoomer.style.top="1px";self.zoomer.style.left="1px";self.zoomer.style.backgroundColor=color;self.zoomer.style.opacity=50;self.zoomer.innerHTML="";self.zoomer.style.filter='alpha(opacity=80)';self.zoomer.style.opacity=0.8;self.zoomer.style.borderWidth="1px";self.zoomer.style.padding="4px";self.zoomer.style.borderStyle="solid";self.zoomer.style.display="block";self.zoomer.style.position="absolute";self.zoomer.style.zIndex=9999;self.zoomer.appendChild(self.topCap);for(var i=0;i<ab.length;i++){self.zoomer.appendChild(ab[i]);};self.zoomer.appendChild(self.bottomCap);map1.mapDiv.appendChild(self.zoomer);self.topCap.onclick=function(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;self.zoomInOneLevel();};self.bottomCap.onclick=function(e){e=e||event;e.stoppropagation?e.stoppropagation():e.cancelBubble=true;self.zoomOutOneLevel();};this.setZoomLevel(self.selected);};this.setZoomButtonImages=function(checked,unchecked){this.checkedSrc=checked;this.uncheckedSrc=unchecked;for(var i=0;i<ab.length;i++){ab[i].src=unchecked;};if(self.selected)
ab[self.selected-1].src=checked;};this.setColor=function(newColor){this.zoomer.style.backgroundColor=newColor;};this.show=function(){this.zoomer.style.display="block";};this.hide=function(){this.zoomer.style.display="none";};this.getRadius=function(){return ar;};this.setRadius=function(radius){ar=radius;};this.getZoomLevel=function(){return self.selected;};this.setZoomLevel=function(level){if(selected&&selected<1||selected>17){throw new Exception("Error calling setZoomLevel, level must be between 1 and 17");return false;};self.selected=level;clear();for(var i=0;i<self.zoomLevels;i++){if(ab[i].id==level)
ab[i].src=self.checkedSrc;if(Utilities.ie6)
Utilities.fixPng(ab[i]);};};this.getGXConvertedZoomLevel=function(){return Math.abs(21-self.selected);};this.zoomToNewLevel=function(level){if(selected&&selected<1||selected>17){throw new Exception("Error calling zoomToNewLevel, level must be between 1 and 17");return false;};clear();for(var i=0;i<self.zoomLevels;i++){if(ab[i].id==level)
ab[i].src=self.checkedSrc;if(Utilities.ie6)
Utilities.fixPng(ab[i]);};self.map.zoomMap(level);};this.zoomInOneLevel=function(){if(self.selected==1)
return false;clear();for(var i=0;i<self.zoomLevels;i++){if(ab[i].id==self.selected)
ab[i].src=self.checkedSrc;};self.map.zoomMap(parseInt(self.selected)-1);};this.zoomOutOneLevel=function(){if(self.selected==17)
return false;clear();for(var i=0;i<self.zoomLevels;i++){if(ab[i].id==self.selected)
ab[i].src=self.checkedSrc;};self.map.zoomMap(parseInt(self.selected)+1);};this.getZoomLevelToFitBoundingBox=function(boundingBox){var tmpY=parseInt(self.map.mapDiv.style.height)/2;var tmpX=parseInt(self.map.mapDiv.style.width)/2;for(var gxZoom=20;gxZoom>0;--gxZoom){var scale=Utilities.radsPerPixelAtZoom(256,gxZoom);var pixelsY=Utilities.lat2pix(boundingBox.getCenterPosition().getLat(),scale);var pixelsX=Utilities.lon2pix(boundingBox.getCenterPosition().getLon(),scale);var maxlat=Utilities.pix2lat(pixelsY+tmpY,scale);var maxlon=Utilities.pix2lon(pixelsX+tmpX,scale);var minlat=Utilities.pix2lat(pixelsY-tmpY,scale);var minlon=Utilities.pix2lon(pixelsX-tmpX,scale);var gxbbox=new BoundingBox(new Position(minlat,minlon),new Position(maxlat,maxlon));if(gxbbox.contains(boundingBox.minPosition)&&gxbbox.contains(boundingBox.maxPosition)){return Math.abs(21-gxZoom);break;};};};this.getZoomLevelToFitPositions=function(positions){var bbox=Utilities.positionsToBoundingBox(positions);return self.getZoomLevelToFitBoundingBox(bbox);};this.setZoomValue=function(level){self.setZoomLevel(level);};function clear(){for(var i=0;i<ab.length;i++)
ab[i].src=self.uncheckedSrc;};}
