if(typeof (MQA)=="undefined"){MQA=new Object()}if(typeof (MQA.Common)=="undefined"){MQA.Common=new Object()}MQA.createXMLDoc=function(C){var A;if(document.implementation.createDocument){var B=new window.DOMParser();if(MQA.BrowserInfo.isSafari){C=C.replace(/&/g,"&amp;")}A=B.parseFromString(C,"text/xml")}else{if(window.ActiveXObject){A=new window.ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(C)}}return A};mqCreateXMLDoc=MQA.createXMLDoc;MQA.createXMLDocFromNode=function(C){var A;C=C.documentElement;if(document.implementation.createDocument){var A=document.implementation.createDocument("","",null);try{A.appendChild(A.importNode(C,true))}catch(B){}}else{if(window.ActiveXObject){A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(C.xml)}}return A};mqCreateXMLDocFromNode=MQA.createXMLDocFromNode;MQA.Browser=function(){this.name=null;this.version=null;this.os=null;this.appname=null;this.appVersion=null;this.vMajor=null;this.isNS=null;this.isNS4=null;this.isNS6=null;this.isIE=null;this.isIE4=null;this.isIE5=null;this.isDOM=null;this.isSafari=null;this.platform=null};MQBrowser=MQA.Browser;MQA.getBrowserInfo=function(){var L=new MQA.Browser();L.name=L.version=L.os="unknown";var O=window.navigator.userAgent.toLowerCase();var F=window.navigator.appName;var G=window.navigator.appVersion;var N=new Array("firefox","msie","netscape","opera","safari");var K=new Array("linux","mac","windows","x11");var M=N.length;var A="";for(var J=0,D=M;J<D;J++){A=O.indexOf(N[J])+1;if(A>0){L.name=N[J];var C=A+L.name.length;var B=((L.name=="safari")||(O.charAt(C+4)>0&&O.charAt(C+4)<9))?5:3;L.version=O.substring(C,C+B)}}var I=K.length;for(var H=0,E=I;H<E;H++){A=O.indexOf(K[H])+1;if(A>0){L.os=K[H]}}if(F=="Netscape"){L.appname="ns"}else{if(F=="Microsoft Internet Explorer"){L.appname="ie"}}L.appVersion=G;L.vMajor=parseInt(L.appVersion);L.isNS=(L.appname=="ns"&&L.vMajor>=4);L.isNS4=(L.appname=="ns"&&L.vMajor==4);L.isNS6=(L.appname=="ns"&&L.vMajor==5);L.isIE=(L.appname=="ie"&&L.vMajor>=4);L.isIE4=(L.appVersion.indexOf("MSIE 4")>0);L.isIE5=(L.appVersion.indexOf("MSIE 5")>0);L.isDOM=(document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;L.isSafari=(L.name=="safari");if(O.indexOf("win")>-1){L.platform="win"}else{if(O.indexOf("mac")>-1){L.platform="mac"}else{L.platform="other"}}return L};mqGetBrowserInfo=MQA.getBrowserInfo;MQA.BrowserInfo=MQA.getBrowserInfo();MQA.Object=function(){var A=null;this.getM_XmlDoc=function(){return A};this.setM_XmlDoc=function(C){A=C};var B=null;this.getM_Xpath=function(){return B};this.setM_Xpath=function(C){B=C}};MQA.Object.prototype.getClassName=function(){return"MQObject"};MQA.Object.prototype.getObjectVersion=function(){return 0};MQA.Object.prototype.setProperty=function(B,F){var A;if(B!==null){A="/"+this.getM_Xpath()+"/"+B}else{A="/"+this.getM_Xpath()}var D=mqSetNodeText(this.getM_XmlDoc(),A,F);if(D===null){var C=this.getM_XmlDoc().createElement(B);var E=this.getM_XmlDoc().documentElement.appendChild(C);D=mqSetNodeText(this.getM_XmlDoc(),A,F)}return D};MQA.Object.prototype.getProperty=function(B){var A;if(B!==null){A="/"+this.getM_Xpath()+"/"+B}else{A="/"+this.getM_Xpath()}return mqGetXPathNodeText(this.getM_XmlDoc(),A)};MQA.Object.prototype.copy=function(){var A=new this.constructor;A.loadXml(this.saveXml());return A};MQA.Object.prototype.internalCopy=function(F){var G="<"+F.getM_Xpath();if(this.getObjectVersion()>0){G=G+' Version="'+this.getObjectVersion()+'"'}G=G+">";var A=this.getM_XmlDoc().documentElement;var B=A.childNodes;var D=B.length;for(var C=0;C<D;C++){G=G+mqXmlToStr(B[C])}G=G+"</"+F.getM_Xpath()+">";var E=new this.constructor;E.loadXml(G);return E};MQObject=MQA.Object;MQA.Point=function(B,A){this.x=0;this.y=0;this.setM_Xpath("Point");if(arguments.length==1){this.setM_Xpath(B)}else{if(arguments.length==2){this.x=parseInt(B);this.y=parseInt(A);if(isNaN(this.x)||isNaN(this.y)){throw new Error("1MQPoint constructor called with invalid parameter")}}else{if(arguments.length>2){throw new Error("MQPoint constructor called with "+arguments.length+" arguments, but it expects 0, 1, or 2 arguments")
}}}};MQA.Point.prototype=new MQA.Object();MQA.Point.prototype.constructor=MQA.Point;MQA.Point.prototype.getClassName=function(){return"MQPoint"};MQA.Point.prototype.getObjectVersion=function(){return 0};MQA.Point.prototype.loadXml=function(A){if("undefined"!==typeof (mqutils)){this.setM_XmlDoc(MQA.createXMLDoc(A));this.x=this.getProperty("X");this.y=this.getProperty("Y")}};MQA.Point.prototype.saveXml=function(){return"<"+this.getM_Xpath()+"><X>"+this.x+"</X><Y>"+this.y+"</Y></"+this.getM_Xpath()+">"};MQA.Point.prototype.setX=function(A){this.x=parseInt(A);if(isNaN(this.x)){throw new Error("MQPoint.setX called with invalid parameter")}};MQA.Point.prototype.getX=function(){return this.x};MQA.Point.prototype.setY=function(A){this.y=parseInt(A);if(isNaN(this.y)){throw new Error("MQPoint.setY called with invalid parameter")}};MQA.Point.prototype.getY=function(){return this.y};MQA.Point.prototype.setXY=function(A,B){this.x=parseInt(A);this.y=parseInt(B);if(isNaN(this.x)||isNaN(this.y)){throw new Error("MQPoint.setXY called with invalid parameter")}};MQA.Point.prototype.valid=function(){if("undefined"!==typeof (mqutils)){return(Math.abs(this.x!=MQCONSTANT.MQPOINT_INVALID)&&Math.abs(this.y!=MQCONSTANT.MQPOINT_INVALID))}return false};MQA.Point.prototype.equals=function(A){if(A){return(this.x===A.x&&this.y===A.y)}return false};MQA.Point.prototype.toString=function(){return this.x+","+this.y};MQPoint=MQA.Point;MQA.LatLng=function(B,A){MQA.Object.call(this);this.lat=0;this.lng=0;this.setM_Xpath("LatLng");if(arguments.length==1){this.setM_Xpath(B)}else{if(arguments.length==2){this.lat=parseFloat(B);this.lng=parseFloat(A);if(isNaN(this.lat)||isNaN(this.lng)){throw new Error("MQA.LatLng constructor called with invalid parameter")}}else{if(arguments.length>2){throw new Error("MQA.LatLng constructor called with "+arguments.length+" arguments, but it expects 0, 1, or 2 arguments.")}}}};MQA.LatLng.prototype=new MQA.Object();MQA.LatLng.prototype.constructor=MQA.LatLng;MQA.LatLng.prototype.getClassName=function(){return"MQLatLng"};MQA.LatLng.prototype.getObjectVersion=function(){return 0};MQA.LatLng.prototype.loadXml=function(A){if("undefined"!==typeof (mqutils)){this.setM_XmlDoc(MQA.createXMLDoc(A));this.lat=this.getProperty("Lat");this.lng=this.getProperty("Lng")}};MQA.LatLng.prototype.saveXml=function(){return"<"+this.getM_Xpath()+"><Lat>"+this.lat+"</Lat><Lng>"+this.lng+"</Lng></"+this.getM_Xpath()+">"};MQA.LatLng.prototype.setLatitude=function(A){this.lat=parseFloat(A);if(isNaN(this.lat)){throw new Error("MQA.LatLng.setLatitude called with invalid parameter")}};MQA.LatLng.prototype.getLatitude=function(){return this.lat};MQA.LatLng.prototype.setLongitude=function(A){this.lng=parseFloat(A);if(isNaN(this.lng)){throw new Error("MQA.LatLng.setLongitude called with invalid parameter")}};MQA.LatLng.prototype.getLongitude=function(){return this.lng};MQA.LatLng.prototype.setLatLng=function(B,A){this.lat=parseFloat(B);this.lng=parseFloat(A);if(isNaN(this.lat)||isNaN(this.lng)){throw new Error("MQA.LatLng.setLatLng called with invalid parameter")}};MQA.LatLng.prototype.arcDistance=function(F,C){if("undefined"!==typeof (mqutils)){if(F){if(F.getClassName()!=="MQLatLng"){alert("failure in arcDistance");throw"failure in arcDistance"}}else{alert("failure in arcDistance");throw"failure in arcDistance"}if(C){mqIsClass("MQDistanceUnits",C,false)}else{C=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES)}if(this.getLatitude()==F.getLatitude()&&this.getLongitude()==F.getLongitude()){return 0}var D=F.getLongitude()-this.getLongitude();var B=MQCONSTANT.MQLATLNG_RADIANS*(90-this.getLatitude());var G=MQCONSTANT.MQLATLNG_RADIANS*(90-F.getLatitude());var E=(Math.cos(B)*Math.cos(G))+(Math.sin(B)*Math.sin(G)*Math.cos(MQCONSTANT.MQLATLNG_RADIANS*(D)));var A=(C.getValue()===MQCONSTANT.MQDISTANCEUNITS_MILES)?3963.205:6378.160187;if(E<-1){return MQCONSTANT.PI*A}else{if(E>=1){return 0}else{return Math.acos(E)*A}}}return -1};MQA.LatLng.prototype.valid=function(){if("undefined"!==typeof (mqutils)){return(Math.abs(this.getLatitude()-MQCONSTANT.MQLATLNG_INVALID)>MQCONSTANT.MQLATLNG_TOLERANCE&&Math.abs(this.getLongitude()-MQCONSTANT.MQLATLNG_INVALID)>MQCONSTANT.MQLATLNG_TOLERANCE)
}return false};MQA.LatLng.prototype.equals=function(A){if(A!==null){return(this.getLongitude()===A.getLongitude()&&this.getLatitude()===A.getLatitude())}return false};MQA.LatLng.prototype.toString=function(){return this.lat+","+this.lng};MQLatLng=MQA.LatLng;MQA.XMLDOC=function(){this.AUTOGEOCODECOVSWITCH=null;this.AUTOROUTECOVSWITCH=null;this.AUTOMAPCOVSWITCH=null;this.DBLAYERQUERY=null;this.LINEPRIMITIVE=null;this.POLYGONPRIMITIVE=null;this.RECTANGLEPRIMITIVE=null;this.ELLIPSEPRIMITIVE=null;this.TEXTPRIMITIVE=null;this.SYMBOLPRIMITIVE=null;this.LATLNG=null;this.POINT=null;this.POINTFEATURE=null;this.LINEFEATURE=null;this.POLYGONFEATURE=null;this.LOCATION=null;this.ADDRESS=null;this.SINGLELINEADDRESS=null;this.GEOADDRESS=null;this.GEOCODEOPTIONS=null;this.MANEUVER=null;this.ROUTEOPTIONS=null;this.ROUTERESULTS=null;this.ROUTEMATRIXRESULTS=null;this.RADIUSSEARCHCRITERIA=null;this.RECTSEARCHCRITERIA=null;this.POLYSEARCHCRITERIA=null;this.CORRIDORSEARCHCRITERIA=null;this.SIGN=null;this.TREKROUTE=null;this.INTCOLLECTION=null;this.DTCOLLECTION=null;this.LATLNGCOLLECTION=null;this.LOCATIONCOLLECTION=null;this.LOCATIONCOLLECTIONCOLLECTION=null;this.MANEUVERCOLLECTION=null;this.SIGNCOLLECTION=null;this.STRINGCOLLECTION=null;this.STRCOLCOLLECTION=null;this.FEATURECOLLECTION=null;this.PRIMITIVECOLLECTION=null;this.POINTCOLLECTION=null;this.TREKROUTECOLLECTION=null;this.FEATURESPECIFIERCOLLECTION=null;this.GEOCODEOPTIONSCOLLECTION=null;this.COVERAGESTYLE=null;this.RECORDSET=null;this.MAPSTATE=null;this.SESSION=null;this.SESSIONID=null;this.DTSTYLE=null;this.DTSTYLEEX=null;this.DTFEATURESTYLEEX=null;this.FEATURESPECIFIER=null;this.BESTFIT=null;this.BESTFITLL=null;this.CENTER=null;this.CENTERLATLNG=null;this.PAN=null;this.ZOOMIN=null;this.ZOOMOUT=null;this.ZOOMTO=null;this.ZOOMTORECT=null;this.ZOOMTORECTLATLNG=null;this.getAUTOGEOCODECOVSWITCH=function(){if(this.AUTOGEOCODECOVSWITCH===null){this.AUTOGEOCODECOVSWITCH=MQA.createXMLDoc("<AutoGeocodeCovSwitch/>")}return this.AUTOGEOCODECOVSWITCH};this.getAUTOROUTECOVSWITCH=function(){if(this.AUTOROUTECOVSWITCH===null){this.AUTOROUTECOVSWITCH=MQA.createXMLDoc('<AutoRouteCovSwitch><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count="0"/></AutoRouteCovSwitch>')}return this.AUTOROUTECOVSWITCH};this.getAUTOMAPCOVSWITCH=function(){if(this.AUTOMAPCOVSWITCH===null){this.AUTOMAPCOVSWITCH=MQA.createXMLDoc('<AutoMapCovSwitch><Name/><Style/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count="0"/><ZoomLevels Count="14"><Item>6000</Item><Item>12000</Item><Item>24000</Item><Item>48000</Item><Item>96000</Item><Item>192000</Item><Item>400000</Item><Item>800000</Item><Item>1600000</Item><Item>3000000</Item><Item>6000000</Item><Item>12000000</Item><Item>24000000</Item><Item>48000000</Item></ZoomLevels></AutoMapCovSwitch>')}return this.AUTOMAPCOVSWITCH};this.getDBLAYERQUERY=function(){if(this.DBLAYERQUERY===null){this.DBLAYERQUERY=MQA.createXMLDoc("<DBLayerQuery/>")}return this.DBLAYERQUERY};this.getLINEPRIMITIVE=function(){if(this.LINEPRIMITIVE===null){this.LINEPRIMITIVE=MQA.createXMLDoc('<LinePrimitive Version="2"/>')}return this.LINEPRIMITIVE};this.getPOLYGONPRIMITIVE=function(){if(this.POLYGONPRIMITIVE===null){this.POLYGONPRIMITIVE=MQA.createXMLDoc('<PolygonPrimitive Version="2"/>')}return this.POLYGONPRIMITIVE};this.getRECTANGLEPRIMITIVE=function(){if(this.RECTANGLEPRIMITIVE===null){this.RECTANGLEPRIMITIVE=MQA.createXMLDoc('<RectanglePrimitive Version="2"/>')}return this.RECTANGLEPRIMITIVE};this.getELLIPSEPRIMITIVE=function(){if(this.ELLIPSEPRIMITIVE===null){this.ELLIPSEPRIMITIVE=MQA.createXMLDoc('<EllipsePrimitive Version="2"/>')}return this.ELLIPSEPRIMITIVE};this.getTEXTPRIMITIVE=function(){if(this.TEXTPRIMITIVE===null){this.TEXTPRIMITIVE=MQA.createXMLDoc('<TextPrimitive Version="2"/>')}return this.TEXTPRIMITIVE};this.getSYMBOLPRIMITIVE=function(){if(this.SYMBOLPRIMITIVE===null){this.SYMBOLPRIMITIVE=MQA.createXMLDoc('<SymbolPrimitive Version="2"/>')}return this.SYMBOLPRIMITIVE
};this.getLATLNG=function(){if(this.LATLNG===null){this.LATLNG=MQA.createXMLDoc("<LatLng/>")}return this.LATLNG};this.getPOINT=function(){if(this.POINT===null){this.POINT=MQA.createXMLDoc("<Point/>")}return this.POINT};this.getPOINTFEATURE=function(){if(this.POINTFEATURE===null){this.POINTFEATURE=MQA.createXMLDoc("<PointFeature/>")}return this.POINTFEATURE};this.getLINEFEATURE=function(){if(this.LINEFEATURE===null){this.LINEFEATURE=MQA.createXMLDoc("<LineFeature/>")}return this.LINEFEATURE};this.getPOLYGONFEATURE=function(){if(this.POLYGONFEATURE===null){this.POLYGONFEATURE=MQA.createXMLDoc("<PolygonFeature/>")}return this.POLYGONFEATURE};this.getLOCATION=function(){if(this.LOCATION===null){this.LOCATION=MQA.createXMLDoc("<Location/>")}return this.LOCATION};this.getADDRESS=function(){if(this.ADDRESS===null){this.ADDRESS=MQA.createXMLDoc("<Address/>")}return this.ADDRESS};this.getSINGLELINEADDRESS=function(){if(this.SINGLELINEADDRESS===null){this.SINGLELINEADDRESS=MQA.createXMLDoc("<SingleLineAddress/>")}return this.SINGLELINEADDRESS};this.getGEOADDRESS=function(){if(this.GEOADDRESS===null){this.GEOADDRESS=MQA.createXMLDoc("<GeoAddress/>")}return this.GEOADDRESS};this.getGEOCODEOPTIONS=function(){if(this.GEOCODEOPTIONS===null){this.GEOCODEOPTIONS=MQA.createXMLDoc("<GeocodeOptions/>")}return this.GEOCODEOPTIONS};this.getMANEUVER=function(){if(this.MANEUVER===null){this.MANEUVER=MQA.createXMLDoc('<Maneuver Version="1"><Narrative/><Streets Count="0"/><TurnType>-1</TurnType><Distance>0.0</Distance><Time>-1</Time><Direction>0</Direction><ShapePoints Count="0"/><GEFIDs Count="0"/><Signs  Count="0"/></Maneuver>')}return this.MANEUVER};this.getROUTEOPTIONS=function(){if(this.ROUTEOPTIONS===null){this.ROUTEOPTIONS=MQA.createXMLDoc('<RouteOptions Version="3"><RouteType>0</RouteType><NarrativeType>1</NarrativeType><NarrativeDistanceUnitType>0</NarrativeDistanceUnitType><MaxShape>0</MaxShape><MaxGEFID>0</MaxGEFID><Language>English</Language><CoverageName></CoverageName><CovSwitcher><Name></Name><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count="0"/></CovSwitcher><AvoidAttributeList Count="0"/><AvoidGefIdList Count="0"/><AvoidAbsoluteGefIdList Count="0"/><StateBoundaryDisplay>1</StateBoundaryDisplay><CountryBoundaryDisplay>1</CountryBoundaryDisplay></RouteOptions>')}return this.ROUTEOPTIONS};this.getROUTERESULTS=function(){if(this.ROUTERESULTS===null){this.ROUTERESULTS=MQA.createXMLDoc('<RouteResults Version="1"><Locations Count="0"/><CoverageName/><ResultMessages Count="0"/><TrekRoutes Count="0"/></RouteResults>')}return this.ROUTERESULTS};this.getROUTEMATRIXRESULTS=function(){if(this.ROUTEMATRIXRESULTS===null){this.ROUTEMATRIXRESULTS=MQA.createXMLDoc("<RouteMatrixResults/>")}return this.ROUTEMATRIXRESULTS};this.getRADIUSSEARCHCRITERIA=function(){if(this.RADIUSSEARCHCRITERIA===null){this.RADIUSSEARCHCRITERIA=MQA.createXMLDoc("<RadiusSearchCriteria/>")}return this.RADIUSSEARCHCRITERIA};this.getRECTSEARCHCRITERIA=function(){if(this.RECTSEARCHCRITERIA===null){this.RECTSEARCHCRITERIA=MQA.createXMLDoc("<RectSearchCriteria/>")}return this.RECTSEARCHCRITERIA};this.getPOLYSEARCHCRITERIA=function(){if(this.POLYSEARCHCRITERIA===null){this.POLYSEARCHCRITERIA=MQA.createXMLDoc("<PolySearchCriteria/>")}return this.POLYSEARCHCRITERIA};this.getCORRIDORSEARCHCRITERIA=function(){if(this.CORRIDORSEARCHCRITERIA===null){this.CORRIDORSEARCHCRITERIA=MQA.createXMLDoc("<CorridorSearchCriteria/>")}return this.CORRIDORSEARCHCRITERIA};this.getSIGN=function(){if(this.SIGN===null){this.SIGN=MQA.createXMLDoc("<Sign><Type>0</Type><Text></Text><ExtraText></ExtraText><Direction>0</Direction></Sign>")}return this.SIGN};this.getTREKROUTE=function(){if(this.TREKROUTE===null){this.TREKROUTE=MQA.createXMLDoc('<TrekRoute><Maneuvers Count="0"/></TrekRoute>')}return this.TREKROUTE};this.getINTCOLLECTION=function(){if(this.INTCOLLECTION===null){this.INTCOLLECTION=MQA.createXMLDoc('<IntCollection Count="0"/>')}return this.INTCOLLECTION};this.getDTCOLLECTION=function(){if(this.DTCOLLECTION===null){this.DTCOLLECTION=MQA.createXMLDoc('<DTCollection Version="1" Count="0"/>')
}return this.DTCOLLECTION};this.getLATLNGCOLLECTION=function(){if(this.LATLNGCOLLECTION===null){this.LATLNGCOLLECTION=MQA.createXMLDoc('<LatLngCollection Version="1" Count="0"/>')}return this.LATLNGCOLLECTION};this.getLOCATIONCOLLECTION=function(){if(this.LOCATIONCOLLECTION===null){this.LOCATIONCOLLECTION=MQA.createXMLDoc('<LocationCollection Count="0"/>')}return this.LOCATIONCOLLECTION};this.getLOCATIONCOLLECTIONCOLLECTION=function(){if(this.LOCATIONCOLLECTIONCOLLECTION===null){this.LOCATIONCOLLECTIONCOLLECTION=MQA.createXMLDoc('<LocationCollectionCollection Count="0"/>')}return this.LOCATIONCOLLECTIONCOLLECTION};this.getMANEUVERCOLLECTION=function(){if(this.MANEUVERCOLLECTION===null){this.MANEUVERCOLLECTION=MQA.createXMLDoc('<ManeuverCollection Count="0"/>')}return this.MANEUVERCOLLECTION};this.getSIGNCOLLECTION=function(){if(this.SIGNCOLLECTION===null){this.SIGNCOLLECTION=MQA.createXMLDoc('<SignCollection Count="0"/>')}return this.SIGNCOLLECTION};this.getSTRINGCOLLECTION=function(){if(this.STRINGCOLLECTION===null){this.STRINGCOLLECTION=MQA.createXMLDoc('<StringCollection Count="0"/>')}return this.STRINGCOLLECTION};this.getSTRCOLCOLLECTION=function(){if(this.STRCOLCOLLECTION===null){this.STRCOLCOLLECTION=MQA.createXMLDoc("<StrColCollectin/>")}return this.STRCOLCOLLECTION};this.getFEATURECOLLECTION=function(){if(this.FEATURECOLLECTION===null){this.FEATURECOLLECTION=MQA.createXMLDoc('<FeatureCollection Count="0"/>')}return this.FEATURECOLLECTION};this.getPRIMITIVECOLLECTION=function(){if(this.PRIMITIVECOLLECTION===null){this.PRIMITIVECOLLECTION=MQA.createXMLDoc('<PrimitiveCollection Count="0"/>')}return this.PRIMITIVECOLLECTION};this.getPOINTCOLLECTION=function(){if(this.POINTCOLLECTION===null){this.POINTCOLLECTION=MQA.createXMLDoc('<PointCollection Count="0"/>')}return this.POINTCOLLECTION};this.getTREKROUTECOLLECTION=function(){if(this.TREKROUTECOLLECTION===null){this.TREKROUTECOLLECTION=MQA.createXMLDoc('<TrekRouteCollection Count="0"/>')}return this.TREKROUTECOLLECTION};this.getFEATURESPECIFIERCOLLECTION=function(){if(this.FEATURESPECIFIERCOLLECTION===null){this.FEATURESPECIFIERCOLLECTION=MQA.createXMLDoc('<FeatureSpecifierCollection Count="0"/>')}return this.FEATURESPECIFIERCOLLECTION};this.getGEOCODEOPTIONSCOLLECTION=function(){if(this.GEOCODEOPTIONSCOLLECTION===null){this.GEOCODEOPTIONSCOLLECTION=MQA.createXMLDoc('<GeocodeOptionsCollection Count="0"/>')}return this.GEOCODEOPTIONSCOLLECTION};this.getCOVERAGESTYLE=function(){if(this.COVERAGESTYLE===null){this.COVERAGESTYLE=MQA.createXMLDoc("<CoverageStyle/>")}return this.COVERAGESTYLE};this.getRECORDSET=function(){if(this.RECORDSET===null){this.RECORDSET=MQA.createXMLDoc("<RecordSet/>")}return this.RECORDSET};this.getMAPSTATE=function(){if(this.MAPSTATE===null){this.MAPSTATE=MQA.createXMLDoc("<MapState/>")}return this.MAPSTATE};this.getSESSION=function(){if(this.SESSION===null){this.SESSION=MQA.createXMLDoc('<Session Count="0"/>')}return this.SESSION};this.getSESSIONID=function(){if(this.SESSIONID===null){this.SESSIONID=MQA.createXMLDoc("<SessionID/>")}return this.SESSIONID};this.getDTSTYLE=function(){if(this.DTSTYLE===null){this.DTSTYLE=MQA.createXMLDoc("<DTStyle/>")}return this.DTSTYLE};this.getDTSTYLEEX=function(){if(this.DTSTYLEEX===null){this.DTSTYLEEX=MQA.createXMLDoc("<DTStyleEx/>")}return this.DTSTYLEEX};this.getDTFEATURESTYLEEX=function(){if(this.DTFEATURESTYLEEX===null){this.DTFEATURESTYLEEX=MQA.createXMLDoc("<DTFeatureStyleEx/>")}return this.DTFEATURESTYLEEX};this.getFEATURESPECIFIER=function(){if(this.FEATURESPECIFIER===null){this.FEATURESPECIFIER=MQA.createXMLDoc("<FeatureSpecifier/>")}return this.FEATURESPECIFIER};this.getBESTFIT=function(){if(this.BESTFIT===null){this.BESTFIT=MQA.createXMLDoc('<BestFit Version="2"/>')}return this.BESTFIT};this.getBESTFITLL=function(){if(this.BESTFITLL===null){this.BESTFITLL=MQA.createXMLDoc('<BestFitLL Version="2"/>')}return this.BESTFITLL};this.getCENTER=function(){if(this.CENTER===null){this.CENTER=MQA.createXMLDoc("<Center/>")
}return this.CENTER};this.getCENTERLATLNG=function(){if(this.CENTERLATLNG===null){this.CENTERLATLNG=MQA.createXMLDoc("<CenterLatLng/>")}return this.CENTERLATLNG};this.getPAN=function(){if(this.PAN===null){this.PAN=MQA.createXMLDoc("<Pan/>")}return this.PAN};this.getZOOMIN=function(){if(this.ZOOMIN===null){this.ZOOMIN=MQA.createXMLDoc("<ZoomIn/>")}return this.ZOOMIN};this.getZOOMOUT=function(){if(this.ZOOMOUT===null){this.ZOOMOUT=MQA.createXMLDoc("<ZoomOut/>")}return this.ZOOMOUT};this.getZOOMTO=function(){if(this.ZOOMTO===null){this.ZOOMTO=MQA.createXMLDoc("<ZoomTo/>")}return this.ZOOMTO};this.getZOOMTORECT=function(){if(this.ZOOMTORECT===null){this.ZOOMTORECT=MQA.createXMLDoc("<ZoomToRect/>")}return this.ZOOMTORECT};this.getZOOMTORECTLATLNG=function(){if(this.ZOOMTORECTLATLNG===null){this.ZOOMTORECTLATLNG=MQA.createXMLDoc("<ZoomToRectLatLng/>")}return this.ZOOMTORECTLATLNG}};MQXMLDOC=MQA.XMLDOC;MQA.MQXML=new MQA.XMLDOC();MQXML=MQA.MQXML;MQA.ObjectCollection=function(A){MQA.Object.call(this);var E=new Array();this.getM_Items=function(){return E};var C=(A!==null)?A:-1;var B="MQObject";this.getValidClassName=function(){return B};this.setValidClassName=function(F){B=F};this.add=function(F){if(this.isValidObject(F)){if(C!==-1&&E.length===A){return }E.push(F);return E.length}return };this.getSize=function(){return E.length};this.get=function(F){return E[F]};this.remove=function(F){return E.splice(F,1)};this.removeAll=function(){E=null;E=new Array()};this.contains=function(H){var F=this.getSize();for(var G=0;G<F;G++){if(E[G]===H){return true}}return false};this.append=function(F){if(this.getClassName()===F.getClassName()){E=E.concat(F.getM_Items())}else{alert("Invalid attempt to append "+this.getClassName()+" to "+F.getClassName()+"!");throw"Invalid attempt to append "+this.getClassName()+" to "+F.getClassName()+"!"}};this.set=function(G,H){var F=get(G);E[G]=H;return F};this.isValidObject=function(F){if(F!==null){if(B==="ALL"){return true}else{if(B==="MQObject"){return true}else{if(B==="String"){return true}else{if(B==="int"){if(isNaN(F)){return false}else{if(F===Math.floor(F)){return true}}}else{if(F.getClassName()===B){return true}}}}}}return false};var D="Item";this.getM_itemXpath=function(){return D};this.setM_itemXpath=function(F){D=F};this.getById=function(G){try{for(var F=0;F<this.getSize();F++){if(E[F].getId()==G){return E[F]}}}catch(H){}return null};this.removeItem=function(G){for(var F=0;F<E.length;F++){if(E[F]==G){this.remove(F);F=E.length}}}};MQA.ObjectCollection.prototype=new MQA.Object();MQA.ObjectCollection.prototype.constructor=MQA.ObjectCollection;MQA.ObjectCollection.prototype.getClassName=function(){return"MQObjectCollection"};MQA.ObjectCollection.prototype.getObjectVersion=function(){return 0};MQA.ObjectCollection.prototype.getAt=function(A){return this.get(A)};MQObjectCollection=MQA.ObjectCollection;MQA.LatLngCollection=function(){MQA.ObjectCollection.call(this,32678);this.setValidClassName("MQLatLng");this.setM_Xpath("LatLngCollection");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLATLNGCOLLECTION()))};MQA.LatLngCollection.prototype=new MQA.ObjectCollection(32678);MQA.LatLngCollection.prototype.constructor=MQA.LatLngCollection;MQA.LatLngCollection.prototype.getClassName=function(){return"MQLatLngCollection"};MQA.LatLngCollection.prototype.getObjectVersion=function(){return 1};MQA.LatLngCollection.prototype.loadXml=function(B){this.removeAll();var A=MQA.createXMLDoc(B);this.setM_XmlDoc(A);if(A!==null){this._loadCollection(A)}};MQA.LatLngCollection.prototype.loadXmlFromNode=function(A){this.removeAll();var B=mqCreateXMLDocImportNode(A);this.setM_XmlDoc(B);if(B!==null){this._loadCollection(B)}};MQA.LatLngCollection.prototype._loadCollection=function(J){var G=J.documentElement;var A=G.childNodes;var C=A.length;C=(C<32678)?C:32678;var H=0;var I=0;var E=0;var F=0;var B=null;if(this.getValidClassName()==="MQLatLng"){for(var D=0;D<C;D++){if(D==0){if(A[D].firstChild!==null){E=A[D].firstChild.nodeValue/1000000}D++;
if(A[D].firstChild!==null){F=A[D].firstChild.nodeValue/1000000}}else{if(A[D].firstChild!==null){E=H+(A[D].firstChild.nodeValue/1000000)}D++;if(A[D].firstChild!==null){F=I+(A[D].firstChild.nodeValue/1000000)}}H=E;I=F;B=new MQA.LatLng(E,F);this.add(B)}}};MQA.LatLngCollection.prototype.saveXml=function(){var E="<"+this.getM_Xpath()+' Version="'+this.getObjectVersion()+'" Count="'+this.getSize()+'">';var C=parseInt(this.getSize());if(C>=1){var B=nLng=nPrevLat=nPrevLng=nDeltaLat=nDeltaLng=0;var D=null;for(var A=0;A<C;A++){D=this.getAt(A);B=parseInt(D.getLatitude()*1000000);nLng=parseInt(D.getLongitude()*1000000);nDeltaLat=B-nPrevLat;nDeltaLng=nLng-nPrevLng;E+="<Lat>"+nDeltaLat+"</Lat>";E+="<Lng>"+nDeltaLng+"</Lng>";nPrevLat=B;nPrevLng=nLng}}E=E+"</"+this.getM_Xpath()+">";return E};MQA.LatLngCollection.prototype.generalize=function(L){var A=function(){this.pLL=null;this.dSegmentLength=0;this.dPriorLength=0};var K=function(){this.pLL=null;this.ulOriginalPoint=0};mqllAnchor=null;var D;var F;var G=0;var J=this.getSize();var I=new Array(J);var N=new Array(J);var E=0;if(J<2){return }for(F=0;F<J;F++){I[F]=new A();N[F]=new K();I[F].pLL=this.getAt(F)}for(F=0;F<J-1;F++){I[F].dSegmentLength=I[F].pLL.arcDistance(I[(F+1)].pLL);if(F==0){I[F].dPriorLength=0}else{I[F].dPriorLength=G}G+=I[F].dSegmentLength}mqllAnchor=I[0].pLL;D=0;N[0].pLL=mqllAnchor;N[0].ulOriginalPoint=0;E=1;for(F=2;F<J;F++){if(!this.isEverybodyWithinDeviation(I,D,F,L)){mqllAnchor=I[(F-1)].pLL;D=(F-1);N[E].pLL=mqllAnchor;N[E].ulOriginalPoint=(F-1);E++}}N[E].pLL=I[J-1].pLL;N[E].ulOriginalPoint=J-1;E++;var C=J;var B;for(B=(E-1);B>=0;B--){if((C-1)!=N[B].ulOriginalPoint){for(var M=(C-1);M>N[B].ulOriginalPoint;M--){try{this.remove(M)}catch(H){}}C=N[B].ulOriginalPoint}else{C--}}I=null;N=null};MQA.LatLngCollection.prototype.isEverybodyWithinDeviation=function(B,F,P,H){var S=0;var N=0;var A=null;var U=null;var R=0;var T=0;var E=0;var L;var I=null;var C=0;var J=0;var O=0;var M=0;var G=0;var Q=0;var D=0;var K=0;S=MQA.DistanceApproximation.getMilesPerLngDeg(B[F].pLL.getLatitude());N=H*H;A=B[F].pLL;U=B[P].pLL;R=(U.getLatitude()-A.getLatitude())*MQA.DistanceApproximation.MILES_PER_LATITUDE;T=(U.getLongitude()-A.getLongitude())*S;E=R*R+T*T;for(L=F+1;L<P;L++){I=B[L].pLL;C=(I.getLatitude()-A.getLatitude())*MQA.DistanceApproximation.MILES_PER_LATITUDE;J=(I.getLongitude()-A.getLongitude())*S;O=C*C+J*J;G=R*C+T*J;Q=R*R+T*T;if(Q==0){M=0}else{M=G/Q}D=M*M*E;K=O-D;if(K>N){return false}}return true};MQLatLngCollection=MQA.LatLngCollection;MQA.DistanceApproximation=new function(){this.m_testLat;this.m_testLng;this.m_mpd;this.m_milesPerLngDeg=new Array(69.170976,69.160441,69.128838,69.076177,69.002475,68.907753,68.792041,68.655373,68.497792,68.319345,68.120088,67.900079,67.659387,67.398085,67.116253,66.813976,66.491346,66.148462,65.785428,65.402355,64.999359,64.576564,64.134098,63.672096,63.190698,62.690052,62.17031,61.63163,61.074176,60.498118,59.903632,59.290899,58.660106,58.011443,57.345111,56.66131,55.96025,55.242144,54.507211,53.755675,52.987764,52.203713,51.403761,50.588151,49.757131,48.910956,48.049882,47.174172,46.284093,45.379915,44.461915,43.530372,42.58557,41.627796,40.657342,39.674504,38.679582,37.672877,36.654698,35.625354,34.585159,33.534429,32.473485,31.40265,30.322249,29.232613,28.134073,27.026963,25.911621,24.788387,23.657602,22.519612,21.374762,20.223401,19.065881,17.902554,16.733774,15.559897,14.38128,13.198283,12.011266,10.820591,9.626619,8.429716,7.230245,6.028572,4.825062,3.620083,2.414002,1.207185,1);this.MILES_PER_LATITUDE=69.170976;this.KILOMETERS_PER_MILE=1.609347;this.getMilesPerLngDeg=function(A){return(Math.abs(A)<=90)?this.m_milesPerLngDeg[parseInt(Math.abs(A)+0.5)]:69.170976}};DistanceApproximation=MQA.DistanceApproximation;