function MQBrowser(){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}function mqGetBrowserInfo(){var p=new MQBrowser();p.name=p.version=p.os="unknown";var s=window.navigator.userAgent.toLowerCase();var f=window.navigator.appName;var g=window.navigator.appVersion;var r=new Array("firefox","msie","netscape","opera","safari");var o=new Array("linux","mac","windows","x11");var q=r.length;var a="";for(var l=0,d=q;l<d;l++){a=s.indexOf(r[l])+1;if(a>0){p.name=r[l];var c=a+p.name.length;var b=((p.name=="safari")||(s.charAt(c+4)>0&&s.charAt(c+4)<9))?5:3;p.version=s.substring(c,c+b)}}var k=o.length;for(var h=0,e=k;h<e;h++){a=s.indexOf(o[h])+1;if(a>0){p.os=o[h]}}if(f=="Netscape"){p.appname="ns"}else{if(f=="Microsoft Internet Explorer"){p.appname="ie"}}p.appVersion=g;p.vMajor=parseInt(p.appVersion);p.isNS=(p.appname=="ns"&&p.vMajor>=4);p.isNS4=(p.appname=="ns"&&p.vMajor==4);p.isNS6=(p.appname=="ns"&&p.vMajor==5);p.isIE=(p.appname=="ie"&&p.vMajor>=4);p.isIE4=(p.appVersion.indexOf("MSIE 4")>0);p.isIE5=(p.appVersion.indexOf("MSIE 5")>0);p.isDOM=(document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;p.isSafari=(p.name=="safari");if(s.indexOf("win")>-1){p.platform="win"}else{if(s.indexOf("mac")>-1){p.platform="mac"}else{p.platform="other"}}return p}var mqBrowserInfo=mqGetBrowserInfo();function MQObject(){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}}MQObject.prototype.getClassName=function(){return"MQObject"};MQObject.prototype.getObjectVersion=function(){return 0};MQObject.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};MQObject.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)};MQObject.prototype.copy=function(){var a=new this.constructor;a.loadXml(this.saveXml());return a};MQObject.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};MQPoint.prototype=new MQObject();MQPoint.prototype.constructor=MQPoint;function MQPoint(b,a){MQObject.call(this);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("MQPoint 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")}}}}MQPoint.prototype.getClassName=function(){return"MQPoint"};MQPoint.prototype.getObjectVersion=function(){return 0};MQPoint.prototype.loadXml=function(a){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(mqCreateXMLDoc(a));this.x=this.getProperty("X");this.y=this.getProperty("Y")}};MQPoint.prototype.saveXml=function(){return"<"+this.getM_Xpath()+"><X>"+this.x+"</X><Y>"+this.y+"</Y></"+this.getM_Xpath()+">"};MQPoint.prototype.setX=function(a){this.x=parseInt(a);if(isNaN(this.x)){throw new Error("MQPoint.setX called with invalid parameter")}};MQPoint.prototype.getX=function(){return this.x};MQPoint.prototype.setY=function(a){this.y=parseInt(a);if(isNaN(this.y)){throw new Error("MQPoint.setY called with invalid parameter")}};MQPoint.prototype.getY=function(){return this.y};MQPoint.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")}};MQPoint.prototype.valid=function(){if("undefined"!==typeof(mqutils)){return(Math.abs(this.x!=MQCONSTANT.MQPOINT_INVALID)&&Math.abs(this.y!=MQCONSTANT.MQPOINT_INVALID))}return false};MQPoint.prototype.equals=function(a){if(a){return(this.x===a.x&&this.y===a.y)}return false};MQPoint.prototype.toString=function(){return this.x+","+this.y};MQLatLng.prototype=new MQObject();MQLatLng.prototype.constructor=MQLatLng;function MQLatLng(b,a){MQObject.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("MQLatLng constructor called with invalid parameter")}}else{if(arguments.length>2){throw new Error("MQLatLng constructor called with "+arguments.length+" arguments, but it expects 0, 1, or 2 arguments.")}}}}MQLatLng.prototype.getClassName=function(){return"MQLatLng"};MQLatLng.prototype.getObjectVersion=function(){return 0};MQLatLng.prototype.loadXml=function(a){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(mqCreateXMLDoc(a));this.lat=this.getProperty("Lat");this.lng=this.getProperty("Lng")}};MQLatLng.prototype.saveXml=function(){return"<"+this.getM_Xpath()+"><Lat>"+this.lat+"</Lat><Lng>"+this.lng+"</Lng></"+this.getM_Xpath()+">"};MQLatLng.prototype.setLatitude=function(a){this.lat=parseFloat(a);if(isNaN(this.lat)){throw new Error("MQLatLng.setLatitude called with invalid parameter")}};MQLatLng.prototype.getLatitude=function(){return this.lat};MQLatLng.prototype.setLongitude=function(a){this.lng=parseFloat(a);if(isNaN(this.lng)){throw new Error("MQLatLng.setLongitude called with invalid parameter")}};MQLatLng.prototype.getLongitude=function(){return this.lng};MQLatLng.prototype.setLatLng=function(b,a){this.lat=parseFloat(b);this.lng=parseFloat(a);if(isNaN(this.lat)||isNaN(this.lng)){throw new Error("MQLatLng.setLatLng called with invalid parameter")}};MQLatLng.prototype.arcDistance=function(h,e){if("undefined"!==typeof(mqutils)){if(h){if(h.getClassName()!=="MQLatLng"){alert("failure in arcDistance");throw"failure in arcDistance"}}else{alert("failure in arcDistance");throw"failure in arcDistance"}if(e){mqIsClass("MQDistanceUnits",e,false)}else{e=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES)}if(this.getLatitude()==h.getLatitude()&&this.getLongitude()==h.getLongitude()){return 0}var f=h.getLongitude()-this.getLongitude();var d=MQCONSTANT.MQLATLNG_RADIANS*(90-this.getLatitude());var i=MQCONSTANT.MQLATLNG_RADIANS*(90-h.getLatitude());var g=(Math.cos(d)*Math.cos(i))+(Math.sin(d)*Math.sin(i)*Math.cos(MQCONSTANT.MQLATLNG_RADIANS*(f)));var b=(e.getValue()===MQCONSTANT.MQDISTANCEUNITS_MILES)?3963.205:6378.160187;if(g<-1){return MQCONSTANT.PI*b}else{if(g>=1){return 0}else{return Math.acos(g)*b}}}return -1};MQLatLng.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};MQLatLng.prototype.equals=function(a){if(a!==null){return(this.getLongitude()===a.getLongitude()&&this.getLatitude()===a.getLatitude())}return false};MQLatLng.prototype.toString=function(){return this.lat+","+this.lng};