
var Citysearch=window.Citysearch||{};Citysearch.Map={type:{street:'map',satellite:'sat',hybrid:'hyb'},zoom:{state:4,county:7,neighborhood:9,street:13,rooftop:16},declutter:{none:0,stack:1,line:2},defaults:{lat:0,lon:-1,type:'map',zoom:10,declutter:0,iconWidth:23,iconHeight:30,mapDrag:true,scaleBar:true,copyright:true,bpp:false},pointOptions:{titleBackgroundColor:'titleBackgroundColor',popupTitle:'infoWindowTitleText',popupContent:'infoContentHTML',label:'labelText',icon:'icon',hoverIcon:'altIcon',shadow:'shadow',poiDrag:'draggable'},init:function(){if(Citysearch.logging>=3){console.info("INFO: Citysearch.Map.init");}
var pxyServerName="";var pxyServerPort="";var pxyServerPath="/map/directions";var mapServerName="map.access.mapquest.com";var geoServerName="geocode.access.mapquest.com";var routeServerName="route.access.mapquest.com";var serverPort="80";var serverPath="mq";this.geoExec=new MQExec(geoServerName,serverPath,serverPort,pxyServerName,pxyServerPath,pxyServerPort);this.routeExec=new MQExec(routeServerName,serverPath,serverPort,pxyServerName,pxyServerPath,pxyServerPort);},draw:function(targetDiv,options){targetDiv.empty();options=$merge(this.defaults,options);if(options.data){var collection=new MQA.ShapeCollection();for(var i=0;i<options.data.length;i++){var target=options.data[i];collection.add(new MQA.Poi(new MQA.LatLng(target.lat,target.lon)));}
var mapInit=new MQA.MapInit();mapInit.setBestFitRect(collection.getBoundingRect());var map=new MQA.TileMap(targetDiv,options.zoom,null,options.type,mapInit);}
else{var latLongObj=new MQA.LatLng(options.lat,options.lon);var map=new MQA.TileMap(targetDiv,options.zoom,latLongObj,options.type);}
map.enableDragging(options.mapDrag);map.getDeclutter().setDeclutterMode(options.declutter);if(!options.scaleBar){map.setLogoPlacement(MQA.MapLogo.SCALES,new MQA.MapCornerPlacement(MQA.CORNER_BOTTOMRIGHT,new MQA.Size(2000,2000)));}
if(!options.copyright){map.setLogoPlacement(MQA.MapLogo.MAPQUEST,new MQA.MapCornerPlacement(MQA.CORNER_BOTTOMRIGHT,new MQA.Size(2000,2000)));map.setLogoPlacement(MQA.MapLogo.MAPQUEST_COPYRIGHT,new MQA.MapCornerPlacement(MQA.CORNER_BOTTOMRIGHT,new MQA.Size(2000,2000)));map.setLogoPlacement(MQA.MapLogo.NAVTEQ_COPYRIGHT,new MQA.MapCornerPlacement(MQA.CORNER_BOTTOMRIGHT,new MQA.Size(2000,2000)));map.setLogoPlacement(MQA.MapLogo.ICUBED_COPYRIGHT,new MQA.MapCornerPlacement(MQA.CORNER_BOTTOMRIGHT,new MQA.Size(2000,2000)));}
if(options.addControl){if(options.addControl.zoom){map.addControl(new MQA.LargeZoomControl());if(options.addControl.hideCompass){if(map.parent2.getElement('.map-controls-bg')){var backgroundDivs=map.parent2.getElement('div.map-controls-bg').getElements('div');backgroundDivs[1].setStyle('height',186);}}}
if(options.addControl.compassRose){map.addControl(new MQA.PanControl());}
if(options.addControl.typeSwitcher){map.addControl(new MQA.ViewControl());}
if(options.addControl.simpleZoom){map.addControl(new MQA.ZoomControl());}}
MQA.EventManager.addListener(map,'dblclick',function(e){map.setCenter(e.ll,map.getZoomLevel()+1);});return map;},generateStaticMapUrl:function(lat,lon,height,width){var url=[];url.push("http://map.access.mapquest.com:80/mq/mqserver.dll?e=0&GetMapDirect.1=Session:1,MapState:,navt");url.push(lat);url.push(lon);url.push(height/72);url.push(width/72);url.push("48000,DisplayState.1:0,72,1,Authentication.3:db1akQh%29K%21T%289427,34387,,JAVA_5.3.0,-79088546,");url=url.join(",");return url;},icon:function(url,width,height){width=width||this.defaults.iconWidth;height=height||this.defaults.iconHeight;var mapIcon=new MQA.Icon(url,width,height);return mapIcon;},addControl:{zoom:function(targetMap){targetMap.addControl(new MQA.LargeZoomControl());},compassRose:function(targetMap){targetMap.addControl(new MQA.PanControl());},typeSwitcher:function(targetMap){targetMap.addControl(new MQA.ViewControl());},simpleZoom:function(targetMap){targetMap.addControl(new MQA.ZoomControl());}},point:function(lat,lon,options){options=options||{};var properties={'shadow':null,'titleBackgroundColor':'#FFFFFF','iconOffset':new MQA.Point(-11,-28),'altIconOffset':new MQA.Point(-11,-28)};for(var param in options)if(options.hasOwnProperty(param)){if(this.pointOptions[param]){properties[this.pointOptions[param]]=options[param];}}
var latLong=new MQA.LatLng(lat,lon);var newPoint=new MQA.Poi(latLong);newPoint.setValues(properties);if(options.addListener&&options.map){this.addListener(newPoint,'mouseover',function(poi){this.hoverOn(poi);poi.showInfoWindow();}.bind(this,newPoint));this.addListener(newPoint,'mouseout',function(poi,map){this.hoverOff(poi);map.getInfoWindow().hide();}.bind(this,[newPoint,options.map]));}
return newPoint;},populate:function(targetMap,points){var collection=new MQA.ShapeCollection();for(var p=0;p<points.length;p++){collection.add(points[p]);}
targetMap.replaceShapes(collection);},addPois:function(targetMap,data,replaceAll){var collection=new MQA.ShapeCollection();for(var i=data.length-1;i>=0;i--){var target=data[i];target.poi=this.point(target.lat,target.lon,{icon:this.icon(target.iconPath),hoverIcon:this.icon(target.hoverIconPath),popupTitle:target.popupTitle,popupContent:target.popupContent,addListener:true,map:targetMap});collection.add(target.poi);}
if(replaceAll){targetMap.replaceShapes(collection);}
else{targetMap.addShapes(collection);}},cleanLatLon:function(lat,lon,address){var result={lat:lat,lon:lon};if(!lat||!lon||lat===1||lon===1){if(address){result.geoAddr=this.geocode(address);result=this.getLatLng(result.geoAddr);}}
return result;},geocode:function(address){address=this.formatAddress(address);var locColl=new MQLocationCollection("MQGeoAddress");var inputAddr=new MQSingleLineAddress();inputAddr.setAddress(address);this.geoExec.geocode(inputAddr,locColl);var geoAddr=locColl.get(0);return geoAddr;},getLatLng:function(geoAddr){var mqLatLng=geoAddr.getMQLatLng();var mqLat=mqLatLng.getLatitude();var mqLng=mqLatLng.getLongitude();if(mqLat===39.527596){mqLat=0;}
if(mqLng===-99.141968){mqLng=0;}
var myAddress={lat:mqLat,lon:mqLng,street:geoAddr.getStreet(),city:geoAddr.getCity(),state:geoAddr.getState(),postalCode:geoAddr.getPostalCode()};return myAddress;},route:function(map,from,to){var fromGeoAddr=this.geocode(from.address);var toGeoAddr=this.geocode(to.address);var locColl=new MQLocationCollection("MQGeoAddress");var routeOptions=new MQRouteOptions();var routeResults=new MQRouteResults();locColl.add(fromGeoAddr);locColl.add(toGeoAddr);var sessId=this.routeExec.createSessionEx(new MQSession());var boundBox=new MQA.RectLL(new MQLatLng(),new MQLatLng());routeOptions.setDistanceUnits(new MQDistanceUnits(0));routeOptions.setMaxShapePointsPerManeuver(400);this.routeExec.doRoute(locColl,routeOptions,routeResults,sessId,boundBox);if(map.routeOverlay){map.removeShape(map.routeOverlay);}
map.routeOverlay=new MQA.LineOverlay();map.routeOverlay.setValues({'color':'#0e7bd1','colorAlpha':0.75,'borderWidth':6,'shapePoints':routeResults.getShapePoints()});map.addShape(map.routeOverlay);map.zoomToRect(boundBox);return[fromGeoAddr,toGeoAddr,routeResults];},formatAddress:function(street,city,state,postalCode){var address="";if(street&&!city&&!state&&!postalCode){address=street.replace('<br/>',', ');address=address.replace('<br />',', ');address=address.replace('&nbsp;',' ');}
else{if(street!==''){address+=street+", ";}
if(city!==''){address+=city+", ";}
address+=state+" "+postalCode;}
return address;},timeConvert:function(time){var minutes=Math.round(time/60);var totalTime;if(minutes>60){totalTime=Math.round((minutes/60)*100)/100+'hours';}
else if(minutes==60){totalTime='1 hour';}
else{totalTime=minutes+' minutes';}
return totalTime;},distanceConvert:function(distance){var totalDist=Math.round(distance*100)/100+' mi';return totalDist;},setCenter:function(map,lat,lon){var latLng=new MQA.LatLng(lat,lon);map.setCenter(latLng);},setSize:function(map,width,height){var sizeObj=new MQA.Size(width,height);map.setSize(sizeObj);},getSize:function(map){return map.getSize();},setZoom:function(map,level){map.setZoomLevel(level);},getZoom:function(map){return map.getZoomLevel();},resize:function(map,mapWindow,parentDiv,height){var availableWidth=Citysearch.Utils.getDimensions(parentDiv).x;if(Citysearch.Map.getSize(map).getWidth()===availableWidth){return;}
height=height||410;mapWindow.setStyles({width:availableWidth,height:height});Citysearch.Map.setSize(map,availableWidth,height);},recenter:function(map){map.bestFit();},changeIcon:function(point,url,width,height){width=width||this.defaults.iconWidth;height=height||this.defaults.iconHeight;point.setValue('icon',new MQA.Icon(url,width,height));},setPoiProperties:function(point,config){var properties={};for(var param in config)if(config.hasOwnProperty(param)){if(this.pointOptions[param]){properties[this.pointOptions[param]]=config[param];}}
point.setValues(properties);},hoverOn:function(poi){poi.setValue('altStateFlag',true);},hoverOff:function(poi){poi.setValue('altStateFlag',false);},addListener:function(poi,event,fn){MQA.EventManager.addListener(poi,event,fn);},removeListener:function(poi,event){MQA.EventManager.clearListeners(poi,event);},getImage:function(num,isPrimaryIcon){if(num>100){if(isPrimaryIcon){return'map/icon_dot.png';}
else{return'map/icon_dot_hover.png';}}
else if(num<0){if(isPrimaryIcon){return'map/icon_sponsor_pin.png';}
else{return'map/icon_sponsor_pin_hover.png';}}
var result=num+'';while(result.length<3){result="0"+result;}
if(isPrimaryIcon){return'map/icon_number'+result+'.png';}
else{return'map/icon_number'+result+'_hover.png';}}};window.addEvent('domready',function(){Citysearch.Map.init();});try{var testCommons=new MQObject();testCommons=null;}catch(error){throw"You must include mqcommon.js or toolkit api script prior to mqutils.js.";}
var mqutils=1;if(!Array.prototype.push)Array.prototype.push=function(){var length=Array.push.arguments.length;for(var i=0;i<length;i++)
this[this.length]=Array.push.arguments[i];return this.length;};function mq_ParamExists(varname){var undef;return(varname!==undef);}
function mqGetElementById(fId)
{if(document.getElementById(fId))
{return document.getElementById(fId);}
return null;}
function mqCreateXMLDocImportNode(ndNewRoot){var newDoc;if(document.implementation.createDocument){var newDoc=document.implementation.createDocument("","",null);try{newDoc.appendChild(newDoc.importNode(ndNewRoot,true))}catch(error){alert(error);alert(ndNewRoot.nodeName);};}else if(window.ActiveXObject){newDoc=new ActiveXObject("Microsoft.XMLDOM");newDoc.async="false";newDoc.loadXML(ndNewRoot.xml);}
return newDoc;}
function mqXmlToStr(xmlDoc){var strXml=new String;var serializer=null;if(xmlDoc==null)return"";if(MQA.BrowserInfo.isNS){serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);}else if(MQA.BrowserInfo.isIE){strXml=xmlDoc.xml;}
if(MQA.BrowserInfo.isSafari)
{serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);strXml=strXml||"";strXml=strXml.replace(/#38;/g,'&');}
return strXml;}
function mqGetNode(xmlDoc,strPath){var node;if(MQA.BrowserInfo.isSafari)
{if(!xmlDoc.evaluate)
{var names=new Array();names=strPath.split('/');if(names[names.length-1].indexOf('@')!=-1)
{names.splice(names.length-1,1);}
var tree=xmlDoc.documentElement;var isfound=false;if(names.length==2&&tree.tagName==names[1])
isfound=true;else
{var length=names.length-1;for(var i=1;i<length;i++)
{isfound=false;if(tree.tagName==names[i]&&tree.hasChildNodes())
{var nodes=(tree.hasChildNodes())?tree.childNodes.length:0;for(var j=0;j<nodes;j++)
{if(tree.childNodes[j].tagName==names[i+1])
{tree=tree.childNodes[j];isfound=true;break;}}}
if(names[i+1]&&names[i+1].indexOf('text()')!=-1)
{isfound=true;}
if(names[i+1].indexOf('[')!=-1)
{var index=parseInt(names[i+1].substr(names[i+1].indexOf('[')+1,names[i+1].indexOf(']')-1));names[i+1]=names[i+1].substr(0,names[i+1].indexOf('['));tree=xmlDoc.getElementsByTagName(names[i+1]).item(index-1);isfound=true;}}}
node=(isfound==true)?tree:null;return node;}
else
{node=xmlDoc.evaluate(strPath,xmlDoc,null,9,null);return node.singleNodeValue;}}
else if(MQA.BrowserInfo.isIE){node=xmlDoc.selectSingleNode(strPath);return node;}else if(MQA.BrowserInfo.isNS){node=xmlDoc.evaluate(strPath,xmlDoc,null,9,null);return node.singleNodeValue;}
return null;}
function mqGetNodeText(domNode){var elemText="";if(MQA.BrowserInfo.isIE){elemText=domNode.text;}else if(MQA.BrowserInfo.isNS&&domNode.firstChild){elemText=domNode.firstChild.nodeValue;}
if(MQA.BrowserInfo.isSafari&&domNode.firstChild){elemText=domNode.firstChild.nodeValue;elemText=(elemText?elemText:"");elemText=elemText.replace(/#38;/g,'&');}
return elemText;}
function mqGetXPathNodeText(xmlDoc,strPath){var node;if(MQA.BrowserInfo.isSafari)
{node=mqGetNode(xmlDoc,strPath);var nodeText="";var attribute="";if(strPath.indexOf('@')!=-1)
{attribute=strPath.substr(strPath.indexOf('@')+1,strPath.length);nodeText=node.attributes.getNamedItem(attribute).nodeValue;}
else if(node)
{nodeText=mqGetNodeText(node);}
return nodeText;}
if(MQA.BrowserInfo.isIE){node=xmlDoc.selectSingleNode(strPath);return(node==null?"":node.text);}else if(MQA.BrowserInfo.isNS){try{node=xmlDoc.evaluate(strPath,xmlDoc,null,2,null);}catch(error){alert(strPath);alert(error);}
return node.stringValue;}
return"";}
function mqReplaceNode(xmlDoc,node,strTxt){var ndNewText=xmlDoc.createTextNode(strTxt);if(node.firstChild){return node.replaceChild(ndNewText,node.firstChild);}else{return node.appendChild(ndNewText);}}
function mqReplaceElementNode(xmlDoc,nodeDoc,xpath){var root=xmlDoc.documentElement;var newnode=nodeDoc.documentElement;var oldnode=xmlDoc.getElementsByTagName(xpath).item(0);if(MQA.BrowserInfo.isIE)
node=newnode
else
node=xmlDoc.importNode(newnode,true);if(oldnode){root.replaceChild(node,oldnode);}else{root.appendChild(node);}
return xmlDoc;}
function mqSetNodeText(xmlDoc,strXPath,strTxt){var ndParent=mqGetNode(xmlDoc,strXPath);if(ndParent==null){return null;}
return mqReplaceNode(xmlDoc,ndParent,strTxt);}
function mqXMLHttpRequest()
{var request=null;if(window.XMLHttpRequest)
{try
{request=new XMLHttpRequest();}
catch(e)
{request=null;}}
else if(window.ActiveXObject)
{try
{request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{request=null;}}}
return request;}
var _mqLogStartTime=null;var _mqLogCurTime=null;var _mqLogprevTime=null;function mqLogTime(str)
{if(mqGetElementById("mqTimeLogs"))
{var logtext=mqGetElementById("mqTimeLogs");var mqTimeLogger=new Date();if(_mqLogStartTime==null){logtext.value="Time(ms) Difference\t Message\n";_mqLogStartTime=mqTimeLogger.getTime();_mqLogprevTime=_mqLogStartTime;}
_mqLogCurTime=mqTimeLogger.getTime();var diff=_mqLogCurTime-_mqLogStartTime;var del=_mqLogCurTime-_mqLogprevTime;logtext.value=logtext.value+diff+"\t "+del+"\t\t "+str+"\n";_mqLogprevTime=_mqLogCurTime;}}
function display(pid,name,value,id,sClass){if(mqGetElementById(pid)){var div=mqGetElementById(pid);var label=div.appendChild(document.createElement('label'));var bb=label.appendChild(document.createElement('b'));bb.appendChild(document.createTextNode(name));div.appendChild(document.createElement('br'));var span=div.appendChild(document.createElement('textarea'));span.className=sClass;span.style.overflow="auto";if(id!=null)span.id=id;span.appendChild(document.createTextNode(value));div.appendChild(document.createElement('br'));div.appendChild(document.createElement('br'));}}
try{var testCommons=new MQObject();testCommons=null;}catch(error){throw"You must include mqcommon.js or toolkit api script prior to mqobjects.js.";}
function mqIsClass(strClassName,newObj,allowNull){if(newObj!==null){try{newObj.getClassName();}catch(error){throw"InvalidClassException";}
if(newObj.getClassName()===strClassName){return true;}else{throw"InvalidClassException";}}else if(allowNull){return true;}
throw"NullPointerException";};function MQConstants(){this.MQDISTANCEUNITS_MILES=0;this.MQDISTANCEUNITS_KILOMETERS=1;this.MQLATLNG_RADIANS=0.01745329251994;this.MQLATLNG_INVALID=314159.265358;this.MQLATLNG_TOLERANCE=0.000001;this.MQPOINT_INVALID=32767;this.PI=3.14159265358979323846;this.MQSEARCHCRITERIA_MILES_PER_DEGREE_LAT=68.9;this.MQSEARCHCRITERIA_DEGREES_LAT_PER_MILE=(1/this.MQSEARCHCRITERIA_MILES_PER_DEGREE_LAT);this.DISTANCEAPPROX_MILES_PER_LATITUDE=69.170976;this.DISTANCEAPPROX_KILOMETERS_PER_MILE=1.609347;this.MQROUTETYPE_FASTEST=0;this.MQROUTETYPE_SHORTEST=1;this.MQROUTETYPE_PEDESTRIAN=2;this.MQROUTETYPE_OPTIMIZED=3;this.MQROUTETYPE_SELECT_DATASET_ONLY=4;this.MQNARRATIVETYPE_DEFAULT=0;this.MQNARRATIVETYPE_HTML=1;this.MQNARRATIVETYPE_NONE=-1;this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_LIMITED_ACCESS="Limited Access";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_TOLL_ROAD="Toll Road";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_FERRY="Ferry";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_UNPAVED_ROAD="Unpaved";this.MQROUTEOPTIONS_AVOID_ATTRIBUTE_SEASONAL="Approximate seasonal closure";this.MQROUTEOPTIONS_LANGUAGE_ENGLISH="English";this.MQROUTEOPTIONS_LANGUAGE_FRENCH="French";this.MQROUTEOPTIONS_LANGUAGE_GERMAN="German";this.MQROUTEOPTIONS_LANGUAGE_ITALIAN="Italian";this.MQROUTEOPTIONS_LANGUAGE_SPANISH="Spanish";this.MQROUTEOPTIONS_LANGUAGE_DANISH="Danish";this.MQROUTEOPTIONS_LANGUAGE_DUTCH="Dutch";this.MQROUTEOPTIONS_LANGUAGE_NORWEGIAN="Norwegian";this.MQROUTEOPTIONS_LANGUAGE_SWEDISH="Swedish";this.MQROUTEOPTIONS_LANGUAGE_IBERIAN_SPANISH="Iberian Spanish";this.MQROUTEOPTIONS_LANGUAGE_BRITISH_ENGLISH="British English";this.MQROUTEOPTIONS_LANGUAGE_IBERIAN_PORTUGUESE="Iberian Portuguese";this.MQROUTERESULTSCODE_NOT_SPECIFIED=-1;this.MQROUTERESULTSCODE_SUCCESS=0;this.MQROUTERESULTSCODE_INVALID_LOCATION=1;this.MQROUTERESULTSCODE_ROUTE_FAILURE=2;this.MQROUTERESULTSCODE_NO_DATASET_FOUND=3;this.MQROUTEMATRIXRESULTSCODE_NOT_SPECIFIED=-1;this.MQROUTEMATRIXRESULTSCODE_SUCCESS=0;this.MQROUTEMATRIXRESULTSCODE_INVALID_LOCATION=1;this.MQROUTEMATRIXRESULTSCODE_ROUTE_FAILURE=2;this.MQROUTEMATRIXRESULTSCODE_NO_DATASET_FOUND=3;this.MQROUTEMATRIXRESULTSCODE_INVALID_OPTION=4;this.MQROUTEMATRIXRESULTSCODE_PARTIAL_SUCCESS=5;this.MQROUTEMATRIXRESULTSCODE_EXCEEDED_MAX_LOCATIONS=6;this.MQMANEUVER_HEADING_NULL=0;this.MQMANEUVER_HEADING_NORTH=1;this.MQMANEUVER_HEADING_NORTH_WEST=2;this.MQMANEUVER_HEADING_NORTH_EAST=3;this.MQMANEUVER_HEADING_SOUTH=4;this.MQMANEUVER_HEADING_SOUTH_EAST=5;this.MQMANEUVER_HEADING_SOUTH_WEST=6;this.MQMANEUVER_HEADING_WEST=7;this.MQMANEUVER_HEADING_EAST=8;this.MQMANEUVER_TURN_TYPE_STRAIGHT=0;this.MQMANEUVER_TURN_TYPE_SLIGHT_RIGHT=1;this.MQMANEUVER_TURN_TYPE_RIGHT=2;this.MQMANEUVER_TURN_TYPE_SHARP_RIGHT=3;this.MQMANEUVER_TURN_TYPE_REVERSE=4;this.MQMANEUVER_TURN_TYPE_SHARP_LEFT=5;this.MQMANEUVER_TURN_TYPE_LEFT=6;this.MQMANEUVER_TURN_TYPE_SLIGHT_LEFT=7;this.MQMANEUVER_TURN_TYPE_RIGHT_UTURN=8;this.MQMANEUVER_TURN_TYPE_LEFT_UTURN=9;this.MQMANEUVER_TURN_TYPE_RIGHT_MERGE=10;this.MQMANEUVER_TURN_TYPE_LEFT_MERGE=11;this.MQMANEUVER_TURN_TYPE_RIGHT_ON_RAMP=12;this.MQMANEUVER_TURN_TYPE_LEFT_ON_RAMP=13;this.MQMANEUVER_TURN_TYPE_RIGHT_OFF_RAMP=14;this.MQMANEUVER_TURN_TYPE_LEFT_OFF_RAMP=15;this.MQMANEUVER_TURN_TYPE_RIGHT_FORK=16;this.MQMANEUVER_TURN_TYPE_LEFT_FORK=17;this.MQMANEUVER_TURN_TYPE_STRAIGHT_FORK=18;this.MQMANEUVER_ATTRIBUTE_PORTIONS_TOLL=1;this.MQMANEUVER_ATTRIBUTE_PORTIONS_UNPAVED=2;this.MQMANEUVER_ATTRIBUTE_POSSIBLE_SEASONAL_ROAD_CLOSURE=4;this.MQMANEUVER_ATTRIBUTE_GATE=8;this.MQMANEUVER_ATTRIBUTE_FERRY=16;this.MQCOORDINATETYPE_GEOGRAPHIC=1;this.MQCOORDINATETYPE_DISPLAY=2;this.MQDRAWTRIGGER_BEFORE_POLYGONS=3585;this.MQDRAWTRIGGER_AFTER_POLYGONS=3586;this.MQDRAWTRIGGER_BEFORE_TEXT=3588;this.MQDRAWTRIGGER_AFTER_TEXT=3618;this.MQDRAWTRIGGER_BEFORE_ROUTE_HIGHLIGHT=3616;this.MQDRAWTRIGGER_AFTER_ROUTE_HIGHLIGHT=3617;this.MQPENSTYLE_SOLID=0;this.MQPENSTYLE_DASH=1;this.MQPENSTYLE_DOT=2;this.MQPENSTYLE_DASH_DOT=3;this.MQPENSTYLE_DASH_DOT_DOT=4;this.MQPENSTYLE_NONE=5;this.MQCOLORSTYLE_INVALID=0xffffffff;this.MQCOLORSTYLE_BLACK=0;this.MQCOLORSTYLE_BLUE=16711680;this.MQCOLORSTYLE_CYAN=16776960;this.MQCOLORSTYLE_DARK_GRAY=4210752;this.MQCOLORSTYLE_GRAY=8421504;this.MQCOLORSTYLE_GREEN=65280;this.MQCOLORSTYLE_LIGHT_GRAY=12632256;this.MQCOLORSTYLE_MAGENTA=16711935;this.MQCOLORSTYLE_ORANGE=51455;this.MQCOLORSTYLE_PINK=11513855;this.MQCOLORSTYLE_RED=255;this.MQCOLORSTYLE_WHITE=16777215;this.MQCOLORSTYLE_YELLOW=65535;this.MQFILLSTYLE_SOLID=0;this.MQFILLSTYLE_BDIAGONAL=1;this.MQFILLSTYLE_CROSS=2;this.MQFILLSTYLE_DIAG_CROSS=3;this.MQFILLSTYLE_FDIAGONAL=4;this.MQFILLSTYLE_HORIZONTAL=5;this.MQFILLSTYLE_VERTICAL=6;this.MQFILLSTYLE_NONE=7;this.MQSYMBOLTYPE_RASTER=0;this.MQSYMBOLTYPE_VECTOR=1;this.MQTEXTALIGNMENT_CENTER=1;this.MQTEXTALIGNMENT_LEFT=2;this.MQTEXTALIGNMENT_RIGHT=4;this.MQTEXTALIGNMENT_BASELINE=8;this.MQTEXTALIGNMENT_BOTTOM=16;this.MQTEXTALIGNMENT_TOP=32;this.MQFONTSTYLE_INVALID=-1;this.MQFONTSTYLE_NORMAL=0;this.MQFONTSTYLE_BOLD=1;this.MQFONTSTYLE_BOXED=2;this.MQFONTSTYLE_OUTLINED=4;this.MQFONTSTYLE_ITALICS=8;this.MQFONTSTYLE_UNDERLINE=16;this.MQFONTSTYLE_STRIKEOUT=32;this.MQFONTSTYLE_THIN=64;this.MQFONTSTYLE_SEMIBOLD=128;this.MQFONTSTYLE_MAX_VALUE=256;this.MQBASEDTSTYLE_DT_NULL=65532;this.MQBASEDTSTYLE_CT_ROAD=0;this.MQBASEDTSTYLE_CT_LINE=1;this.MQBASEDTSTYLE_CT_POLYGON=2;this.MQBASEDTSTYLE_CT_POINT=3;this.MQBASEDTSTYLE_CT_POI=4;this.MQBASEDTSTYLE_CT_SEED=5;this.MQBASEDTSTYLE_CT_DISPLAYLIST=6;this.MQBASEDTSTYLE_CT_APP=7;this.MQBASEDTSTYLE_CT_XA=8;this.MQBASEDTSTYLE_BT_LINE=0;this.MQBASEDTSTYLE_BT_POLYGON=1;this.MQBASEDTSTYLE_BT_POINT=2;this.MQBASEDTSTYLE_BT_OTHER=3;this.MQBASEDTSTYLE_BT_XA=4;this.MQFEATURESPECIFERATTRIBUTETYPE_GEFID=0;this.MQFEATURESPECIFERATTRIBUTETYPE_NAME=1;this.MQMATCHTYPE_LOC=0;this.MQMATCHTYPE_INTR=1;this.MQMATCHTYPE_NEARBLK=2;this.MQMATCHTYPE_REPBLK=3;this.MQMATCHTYPE_BLOCK=4;this.MQMATCHTYPE_AA1=5;this.MQMATCHTYPE_AA2=6;this.MQMATCHTYPE_AA3=7;this.MQMATCHTYPE_AA4=8;this.MQMATCHTYPE_AA5=9;this.MQMATCHTYPE_AA6=10;this.MQMATCHTYPE_AA7=11;this.MQMATCHTYPE_PC1=12;this.MQMATCHTYPE_PC2=13;this.MQMATCHTYPE_PC3=14;this.MQMATCHTYPE_PC4=15;this.MQMATCHTYPE_POI=16;this.MQQUALITYTYPE_EXACT=0;this.MQQUALITYTYPE_GOOD=1;this.MQQUALITYTYPE_APPROX=2;}
var MQCONSTANT=new MQConstants();function MQErrors(){this.RECORDSET_GETFIELD_1="failure in getField -- m_curRec is not Pointing to an existing Record";this.RECORDSET_GETFIELD_2="failure in getField -- could not find strFieldName";this.RECORDSET_MOVEFIRST_1="failure in moveFirst -- Error Moving Cursor, RecordSet is Empty.";this.RECORDSET_MOVELAST_1="Error Moving Cursor, RecordSet is Empty.";this.RECORDSET_MOVENEXT_1="Error Moving Cursor, EOF was true.";this.RECORDSET_MOVENEXT_2="Error Moving Cursor, Unknown Error.";this.RECORDSET_MOVENEXT_3="Error Moving Cursor, RecordSet is Empty.";}
var MQERROR=new MQErrors();MQSign.prototype=new MQObject();MQSign.prototype.constructor=MQSign;function MQSign(){MQObject.call(this);this.setM_Xpath("Sign");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSIGN()));}
MQSign.prototype.getClassName=function(){return"MQSign";};MQSign.prototype.getObjectVersion=function(){return 0;};MQSign.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQSign.prototype.loadXmlFromNode=function(node){this.setM_XmlDoc(mqCreateXMLDocImportNode(node));};MQSign.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQSign.prototype.clear=function(){this.setType(0);this.setText("");this.setExtraText("");this.setDirection(MQCONSTANT.MQMANEUVER_HEADING_NULL);};MQSign.prototype.setType=function(type){this.setProperty("Type",type);};MQSign.prototype.getType=function(){return this.getProperty("Type");};MQSign.prototype.setText=function(text){this.setProperty("Text",text);};MQSign.prototype.getText=function(){return this.getProperty("Text");};MQSign.prototype.setExtraText=function(extraText){this.setProperty("ExtraText",extraText);};MQSign.prototype.getExtraText=function(){return this.getProperty("ExtraText");};MQSign.prototype.setDirection=function(direction){this.setProperty("Direction",direction);};MQSign.prototype.getDirection=function(){return this.getProperty("Direction");};MQLocation.prototype=new MQObject();MQLocation.prototype.constructor=MQLocation;function MQLocation(){MQObject.call(this);this.setM_Xpath("Location");}
MQLocation.prototype.getClassName=function(){return"MQLocation";};MQLocation.prototype.getObjectVersion=function(){return 0;};MQLocation.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQLocation.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQAddress.prototype=new MQLocation();MQAddress.prototype.constructor=MQAddress;function MQAddress(){MQLocation.call(this);this.setM_Xpath("Address");if(this.getClassName()==="MQAddress"){this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getADDRESS()));}}
MQAddress.prototype.getClassName=function(){return"MQAddress";};MQAddress.prototype.getObjectVersion=function(){return 0;};MQAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQAddress.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQAddress.prototype.getAdminArea=function(intIndex){return this.getProperty("AdminArea"+intIndex);};MQAddress.prototype.setAdminArea=function(intIndex,strAdminArea){this.setProperty("AdminArea"+intIndex,strAdminArea);};MQAddress.prototype.getCountry=function(){return this.getProperty("AdminArea1");};MQAddress.prototype.setCountry=function(strCountry){this.setProperty("AdminArea1",strCountry);};MQAddress.prototype.getCounty=function(){return this.getProperty("AdminArea4");};MQAddress.prototype.setCounty=function(strCounty){this.setProperty("AdminArea4",strCounty);};MQAddress.prototype.getCity=function(){return this.getProperty("AdminArea5");};MQAddress.prototype.setCity=function(strCity){this.setProperty("AdminArea5",strCity);};MQAddress.prototype.getPostalCode=function(){return this.getProperty("PostalCode");};MQAddress.prototype.setPostalCode=function(strPostalCode){this.setProperty("PostalCode",strPostalCode);};MQAddress.prototype.getState=function(){return this.getProperty("AdminArea3");};MQAddress.prototype.setState=function(strState){this.setProperty("AdminArea3",strState);};MQAddress.prototype.setStreet=function(strStreet){this.setProperty("Street",strStreet);};MQAddress.prototype.getStreet=function(){return this.getProperty("Street");};MQSingleLineAddress.prototype=new MQLocation();MQSingleLineAddress.prototype.constructor=MQSingleLineAddress;function MQSingleLineAddress(){MQLocation.call(this);this.setM_Xpath("SingleLineAddress");if(this.getClassName()==="MQSingleLineAddress"){this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSINGLELINEADDRESS()));}}
MQSingleLineAddress.prototype.getClassName=function(){return"MQSingleLineAddress";};MQSingleLineAddress.prototype.getObjectVersion=function(){return 0;};MQSingleLineAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));};MQSingleLineAddress.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQSingleLineAddress.prototype.setAddress=function(strAddress){this.setProperty("Address",strAddress);};MQSingleLineAddress.prototype.getAddress=function(){return this.getProperty("Address");};MQSingleLineAddress.prototype.setCountry=function(strCountry){this.setProperty("Country",strCountry);};MQSingleLineAddress.prototype.getCountry=function(){return this.getProperty("Country");};MQGeoAddress.prototype=new MQAddress();MQGeoAddress.prototype.constructor=MQGeoAddress;function MQGeoAddress(){MQAddress.call(this);this.setM_Xpath("GeoAddress");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getGEOADDRESS()));var m_MQLatLng=new MQLatLng();this.getMQLatLng=function(){return m_MQLatLng;};this.setMQLatLng=function(latLng){m_MQLatLng=latLng;};}
MQGeoAddress.prototype.getClassName=function(){return"MQGeoAddress";};MQGeoAddress.prototype.getObjectVersion=function(){return 0;};MQGeoAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var lat=this.getProperty("LatLng/Lat");var lng=this.getProperty("LatLng/Lng");this.getMQLatLng().setLatLng(lat,lng);};MQGeoAddress.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getMQLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQGeoAddress.prototype.setDistAlong=function(dblDistAlong){this.setProperty("DistAlong",dblDistAlong);};MQGeoAddress.prototype.getDistAlong=function(){return this.getProperty("DistAlong");};MQGeoAddress.prototype.setGEFID=function(intGEFID){this.setProperty("GEFID",intGEFID);};MQGeoAddress.prototype.getGEFID=function(){return this.getProperty("GEFID");};MQGeoAddress.prototype.setResultCode=function(strResultCode){this.setProperty("ResultCode",strResultCode);};MQGeoAddress.prototype.getResultCode=function(){return this.getProperty("ResultCode");};MQGeoAddress.prototype.setSourceId=function(strSourceId){this.setProperty("SourceId",strSourceId);};MQGeoAddress.prototype.getSourceId=function(){return this.getProperty("SourceId");};MQManeuver.prototype=new MQObject();MQManeuver.prototype.constructor=MQManeuver;function MQManeuver(){MQObject.call(this);this.setM_Xpath("Maneuver");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getMANEUVER()));var m_Streets=new MQStringCollection("Item");m_Streets.setM_Xpath("Streets");this.getStreets=function(){return m_Streets;};this.setStreets=function(streets){m_Streets.removeAll();m_Streets.append(streets);};var m_ShapePoints=new MQLatLngCollection();m_ShapePoints.setM_Xpath("ShapePoints");this.getShapePoints=function(){return m_ShapePoints;};this.setShapePoints=function(shapePoints){if(shapePoints.getClassName()==="MQLatLngCollection"){m_ShapePoints.removeAll();m_ShapePoints.append(shapePoints);}
else{alert("failure in setShapePoints");throw"failure in setShapePoints";}};var m_GEFIDs=new MQIntCollection("Item");m_GEFIDs.setM_Xpath("GEFIDs");this.getGEFIDs=function(){return m_GEFIDs;};this.setGEFIDs=function(GEFIDs){m_GEFIDs.removeAll();m_GEFIDs.append(GEFIDs);};var m_Signs=new MQSignCollection("Sign");m_Signs.setM_Xpath("Signs");this.getSigns=function(){return m_Signs;};this.setSigns=function(signs){m_Signs.removeAll();m_Signs.append(signs);};}
MQManeuver.prototype.getClassName=function(){return"MQManeuver";};MQManeuver.prototype.getObjectVersion=function(){return 1;};MQManeuver.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var streets=this.getStreets();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Streets")!==null)
streets.loadXmlFromNode(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Streets"));var shapes=this.getShapePoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ShapePoints")!==null)
shapes.loadXmlFromNode(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ShapePoints"));var gefids=this.getGEFIDs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/GEFIDs")!==null)
gefids.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/GEFIDs")));var signs=this.getSigns();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Signs")!==null)
signs.loadXmlFromNode(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Signs"));};MQManeuver.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getStreets().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Streets"));newNode=MQA.createXMLDoc(this.getShapePoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"ShapePoints"));newNode=MQA.createXMLDoc(this.getGEFIDs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"GEFIDs"));newNode=MQA.createXMLDoc(this.getSigns().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Signs"));return mqXmlToStr(this.getM_XmlDoc());};MQManeuver.prototype.setTurnType=function(type){this.setProperty("TurnType",type);};MQManeuver.prototype.getTurnType=function(){return this.getProperty("TurnType");};MQManeuver.prototype.setDistance=function(distance){this.setProperty("Distance",distance);};MQManeuver.prototype.getDistance=function(){return this.getProperty("Distance");};MQManeuver.prototype.setTime=function(seconds){this.setProperty("Time",seconds);};MQManeuver.prototype.getTime=function(){return this.getProperty("Time");};MQManeuver.prototype.setDirection=function(direction){this.setProperty("Direction",direction);};MQManeuver.prototype.getDirection=function(){return this.getProperty("Direction");};MQManeuver.prototype.getDirectionName=function(){switch(parseInt(this.getDirection()))
{case MQCONSTANT.MQMANEUVER_HEADING_NORTH:return"North";case MQCONSTANT.MQMANEUVER_HEADING_NORTH_WEST:return"Northwest";case MQCONSTANT.MQMANEUVER_HEADING_NORTH_EAST:return"Northeast";case MQCONSTANT.MQMANEUVER_HEADING_SOUTH:return"South";case MQCONSTANT.MQMANEUVER_HEADING_SOUTH_EAST:return"Southeast";case MQCONSTANT.MQMANEUVER_HEADING_SOUTH_WEST:return"Southwest";case MQCONSTANT.MQMANEUVER_HEADING_WEST:return"West";case MQCONSTANT.MQMANEUVER_HEADING_EAST:return"East";default:return"";}};MQManeuver.prototype.setAttributes=function(attributes){this.setProperty("Attributes",attributes);};MQManeuver.prototype.getAttributes=function(){return this.getProperty("Attributes");};MQManeuver.prototype.setNarrative=function(narrative){this.setProperty("Narrative",narrative);};MQManeuver.prototype.getNarrative=function(){return this.getProperty("Narrative");};MQTrekRoute.prototype=new MQObject();MQTrekRoute.prototype.constructor=MQTrekRoute;function MQTrekRoute(){MQObject.call(this);this.setM_Xpath("TrekRoute");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getTREKROUTE()));var maneuverList=new MQManeuverCollection("Maneuver");maneuverList.setM_Xpath("Maneuvers");this.getManeuvers=function(){return maneuverList;};var shapePoints=null;this.getShapePoints=function(){if(shapePoints===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var man=0;man<this.getManeuvers().getSize();man++){shapePoints.append(this.getManeuvers().get(man).getShapePoints());distance+=parseFloat(this.getManeuvers().get(man).getDistance());time+=parseInt(this.getManeuvers().get(man).getTime());}}
return shapePoints;};var distance=null;this.getDistance=function(){if(distance===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var man=0;man<this.getManeuvers().getSize();man++){shapePoints.append(this.getManeuvers().get(man).getShapePoints());distance+=parseFloat(this.getManeuvers().get(man).getDistance());time+=parseInt(this.getManeuvers().get(man).getTime());}}
return distance;};var time=null;this.getTime=function(){if(time===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var man=0;man<this.getManeuvers().getSize();man++){shapePoints.append(this.getManeuvers().get(man).getShapePoints());distance+=parseFloat(this.getManeuvers().get(man).getDistance());time+=parseInt(this.getManeuvers().get(man).getTime());}}
return time;};}
MQTrekRoute.prototype.getClassName=function(){return"MQTrekRoute";};MQTrekRoute.prototype.getObjectVersion=function(){return 0;};MQTrekRoute.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var maneuvers=this.getManeuvers();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Maneuvers")!==null)
maneuvers.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Maneuvers")));};MQTrekRoute.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getManeuvers().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Maneuvers"));return mqXmlToStr(this.getM_XmlDoc());};MQRouteOptions.prototype=new MQObject();MQRouteOptions.prototype.constructor=MQRouteOptions;function MQRouteOptions(){MQObject.call(this);this.setM_Xpath("RouteOptions");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getROUTEOPTIONS()));var m_AvoidAttrList=new MQStringCollection();m_AvoidAttrList.setM_Xpath("AvoidAttributeList");this.getAvoidAttrList=function(){return m_AvoidAttrList;};this.setAvoidAttrList=function(avoidAttrList){m_AvoidAttrList.removeAll();m_AvoidAttrList.append(avoidAttrList);};var m_AvoidGefIdList=new MQIntCollection();m_AvoidGefIdList.setM_Xpath("AvoidGefIdList");this.getAvoidGefIdList=function(){return m_AvoidGefIdList;};this.setAvoidGefIdList=function(avoidGefIdList){m_AvoidGefIdList.removeAll();m_AvoidGefIdList.append(avoidGefIdList);};var m_AvoidAbsGefIdList=new MQIntCollection();m_AvoidAbsGefIdList.setM_Xpath("AvoidAbsoluteGefIdList");this.getAvoidAbsGefIdList=function(){return m_AvoidAbsGefIdList;};this.setAvoidAbsGefIdList=function(avoidAbsGefIdList){m_AvoidAbsGefIdList.removeAll();m_AvoidAbsGefIdList.append(avoidAbsGefIdList);};var m_AutoRouteCovSwitch=new MQAutoRouteCovSwitch("CovSwitcher");this.getAutoRouteCovSwitch=function(){return m_AutoRouteCovSwitch;};this.setAutoRouteCovSwitch=function(autoRouteCovSwitch){m_AutoRouteCovSwitch=autoRouteCovSwitch;};var m_RouteType=new MQRouteType(0);this.getRouteType=function(){return m_RouteType;};this.setRouteType=function(routeType){m_RouteType=routeType;};var m_NarrativeType=new MQNarrativeType(0);this.getNarrativeType=function(){return m_NarrativeType;};this.setNarrativeType=function(narrativeType){m_NarrativeType=narrativeType;};var m_DistanceUnits=new MQDistanceUnits(0);this.getDistanceUnits=function(){return m_DistanceUnits;};this.setDistanceUnits=function(distanceUnits){m_DistanceUnits=distanceUnits;};};MQRouteOptions.prototype.getClassName=function(){return"MQRouteOptions";};MQRouteOptions.prototype.getObjectVersion=function(){return 3;};MQRouteOptions.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var avoidAttributeList=this.getAvoidAttrList();avoidAttributeList.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/AvoidAttributeList")));var avoidGefIdList=this.getAvoidGefIdList();avoidGefIdList.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/AvoidGefIdList")));var avoidAbsoluteGefIdList=this.getAvoidAbsGefIdList();avoidAbsoluteGefIdList.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/AvoidAbsoluteGefIdList")));var covSwitcher=this.getAutoRouteCovSwitch();covSwitcher.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CovSwitcher")));this.setRouteType(new MQRouteType(Math.floor(this.getProperty("RouteType"))));this.getNarrativeType(new MQNarrativeType(Math.floor(this.getProperty("NarrativeType"))));this.getDistanceUnits(new MQDistanceUnits(Math.floor(this.getProperty("NarrativeDistanceUnitType"))));};MQRouteOptions.prototype.saveXml=function(){var newNode=null;this.setProperty("RouteType",this.getRouteType().intValue());this.setProperty("NarrativeType",this.getNarrativeType().intValue());this.setProperty("NarrativeDistanceUnitType",this.getDistanceUnits().getValue());newNode=MQA.createXMLDoc(this.getAutoRouteCovSwitch().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CovSwitcher"));newNode=MQA.createXMLDoc(this.getAvoidAttrList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidAttributeList"));newNode=MQA.createXMLDoc(this.getAvoidGefIdList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidGefIdList"));newNode=MQA.createXMLDoc(this.getAvoidAbsGefIdList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidAbsoluteGefIdList"));return mqXmlToStr(this.getM_XmlDoc());};MQRouteOptions.prototype.setMaxShapePointsPerManeuver=function(nCount){this.setProperty("MaxShape",nCount);};MQRouteOptions.prototype.getMaxShapePointsPerManeuver=function(){return this.getProperty("MaxShape");};MQRouteOptions.prototype.setMaxGEFIDsPerManeuver=function(nCount){this.setProperty("MaxGEFID",nCount);};MQRouteOptions.prototype.getMaxGEFIDsPerManeuver=function(){return this.getProperty("MaxGEFID");};MQRouteOptions.prototype.setLanguage=function(strLanguage){this.setProperty("Language",strLanguage);};MQRouteOptions.prototype.getLanguage=function(){return this.getProperty("Language");};MQRouteOptions.prototype.setCoverageName=function(newCoverageName){this.setProperty("CoverageName",newCoverageName);};MQRouteOptions.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQRouteOptions.prototype.setStateBoundaryDisplay=function(bFlag){this.setProperty("StateBoundaryDisplay",(bFlag===true)?1:0);};MQRouteOptions.prototype.getStateBoundaryDisplay=function(){return(this.getProperty("StateBoundaryDisplay")==1)?true:false;};MQRouteOptions.prototype.setCountryBoundaryDisplay=function(bFlag){this.setProperty("CountryBoundaryDisplay",(bFlag===true)?1:0);};MQRouteOptions.prototype.getCountryBoundaryDisplay=function(){return(this.getProperty("CountryBoundaryDisplay")==1)?true:false;};MQRouteResults.prototype=new MQObject();MQRouteResults.prototype.constructor=MQRouteResults;function MQRouteResults(){MQObject.call(this);this.setM_Xpath("RouteResults");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getROUTERESULTS()));var m_Locations=new MQLocationCollection();m_Locations.setM_Xpath("Locations");this.getLocations=function(){return m_Locations;};var m_TrekRoutes=new MQTrekRouteCollection("TrekRoute");m_TrekRoutes.setM_Xpath("TrekRoutes");this.getTrekRoutes=function(){return m_TrekRoutes;};var m_ResultCode=new MQRouteResultsCode(MQCONSTANT.MQROUTERESULTSCODE_NOT_SPECIFIED);this.getResultCode=function(){return m_ResultCode;};this.setResultCode=function(resultCode){m_ResultCode=resultCode;};var m_ResultMessages=new MQStringCollection("Item");m_ResultMessages.setM_Xpath("ResultMessages");this.getResultMessages=function(){return m_ResultMessages;};var shapePoints=null;this.getShapePoints=function(){if(shapePoints===null){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var tr=0;tr<this.getTrekRoutes().getSize();tr++){var trek=this.getTrekRoutes().get(tr);for(var man=0;man<trek.getManeuvers().getSize();man++){shapePoints.append(trek.getManeuvers().get(man).getShapePoints());distance+=parseFloat(trek.getManeuvers().get(man).getDistance());time+=parseInt(trek.getManeuvers().get(man).getTime());}}}
return shapePoints;};var distance=-1.0;this.getDistance=function(){if(distance===-1.0){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var tr=0;tr<this.getTrekRoutes().getSize();tr++){var trek=this.getTrekRoutes().get(tr);for(var man=0;man<trek.getManeuvers().getSize();man++){shapePoints.append(trek.getManeuvers().get(man).getShapePoints());distance+=parseFloat(trek.getManeuvers().get(man).getDistance());time+=parseInt(trek.getManeuvers().get(man).getTime());}}}
return distance;};var time=-1;this.getTime=function(){if(time===-1){distance=0.0;time=0;shapePoints=new MQLatLngCollection();shapePoints.setM_Xpath("ShapePoints");for(var tr=0;tr<this.getTrekRoutes().getSize();tr++){var trek=this.getTrekRoutes().get(tr);for(var man=0;man<trek.getManeuvers().getSize();man++){shapePoints.append(trek.getManeuvers().get(man).getShapePoints());distance+=parseFloat(trek.getManeuvers().get(man).getDistance());time+=parseInt(trek.getManeuvers().get(man).getTime());}}}
return time;};}
MQRouteResults.prototype.getClassName=function(){return"MQRouteResults";};MQRouteResults.prototype.getObjectVersion=function(){return 1;};MQRouteResults.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var locs=this.getLocations();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Locations")!==null)
locs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Locations")));var trek=this.getTrekRoutes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TrekRoutes")!==null)
trek.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TrekRoutes")));var mesgs=this.getResultMessages();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")!==null)
mesgs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")));this.setResultCode(new MQRouteResultsCode(Math.floor(this.getProperty("ResultCode"))));};MQRouteResults.prototype.saveXml=function(){this.setProperty("ResultCode",this.getResultCode().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRouteResults.prototype.setCoverageName=function(strName){this.setProperty("CoverageName",strName);};MQRouteResults.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};function MQType(){};MQType.prototype.equals=function(type){if(type){try{var className=type.getClassName();}catch(error){alert("Invalid type for this function!");throw"Invalid type for this function!";}
if(className===this.getClassName()){return(this.intValue()===type.intValue());}else{alert("Invalid type for this function!");throw"Invalid type for this function!";}}else{alert("An MQType parameter must be provided for this function!");throw"An MQType parameter must be provided for this function!";}};MQRouteType.prototype=new MQType();MQRouteType.prototype.constructor=MQRouteType;function MQRouteType(val){var value=-1;switch(val)
{case MQCONSTANT.MQROUTETYPE_FASTEST:value=val;break;case MQCONSTANT.MQROUTETYPE_SHORTEST:value=val;break;case MQCONSTANT.MQROUTETYPE_PEDESTRIAN:value=val;break;case MQCONSTANT.MQROUTETYPE_OPTIMIZED:value=val;break;case MQCONSTANT.MQROUTETYPE_SELECT_DATASET_ONLY:value=val;break;default:alert(val+" is an invalid value for MQRouteType!");throw val+" invalid value for MQRouteType!";};this.intValue=function(){return value;};}
MQRouteType.prototype.getClassName=function(){return"MQRouteType";};MQRouteType.prototype.getObjectVersion=function(){return 0;};MQNarrativeType.prototype=new MQType();MQNarrativeType.prototype.constructor=MQNarrativeType;function MQNarrativeType(val){var value=-2;switch(val)
{case MQCONSTANT.MQNARRATIVETYPE_DEFAULT:value=val;break;case MQCONSTANT.MQNARRATIVETYPE_HTML:value=val;break;case MQCONSTANT.MQNARRATIVETYPE_NONE:value=val;break;default:alert(val+" is an invalid value for MQNarrativeType!");throw val+" invalid value for MQNarrativeType!";};this.intValue=function(){return value;};}
MQNarrativeType.prototype.getClassName=function(){return"MQNarrativeType";};MQNarrativeType.prototype.getObjectVersion=function(){return 0;};MQDistanceUnits.prototype=new MQType();MQDistanceUnits.prototype.constructor=MQDistanceUnits;function MQDistanceUnits(val){var value=0;val=val||0;switch(val)
{case MQCONSTANT.MQDISTANCEUNITS_MILES:value=val;break;case MQCONSTANT.MQDISTANCEUNITS_KILOMETERS:value=val;break;default:alert(val+" is an invalid value for MQDistanceUnits!");throw val+" invalid value for MQDistanceUnist!";};this.getValue=function(){return value;};}
MQDistanceUnits.prototype.getClassName=function(){return"MQDistanceUnits";};MQDistanceUnits.prototype.getObjectVersion=function(){return 0;};MQRouteResultsCode.prototype=new MQType();MQRouteResultsCode.prototype.constructor=MQRouteResultsCode;function MQRouteResultsCode(val){var value=-2;switch(val)
{case MQCONSTANT.MQROUTERESULTSCODE_NOT_SPECIFIED:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_SUCCESS:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_INVALID_LOCATION:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_ROUTE_FAILURE:value=val;break;case MQCONSTANT.MQROUTERESULTSCODE_NO_DATASET_FOUND:value=val;break;default:alert(val+" is an invalid value for MQRouteResultsCode!");throw val+" invalid value for MQRouteResultsCode!";};this.intValue=function(){return value;};}
MQRouteResultsCode.prototype.getClassName=function(){return"MQRouteResultsCode";};MQRouteResultsCode.prototype.getObjectVersion=function(){return 0;};MQLocationCollection.prototype=new MQObjectCollection(32678);MQLocationCollection.prototype.constructor=MQLocationCollection;function MQLocationCollection(){MQObjectCollection.call(this,32678);this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getLOCATIONCOLLECTION()));this.setM_Xpath("LocationCollection");}
MQLocationCollection.prototype.getClassName=function(){return"MQLocationCollection";};MQLocationCollection.prototype.getObjectVersion=function(){return 0;};MQLocationCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var loc=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="Address"){loc=new MQAddress();loc.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="GeoAddress"){loc=new MQGeoAddress();loc.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="SingleLineAddress"){loc=new MQSingleLineAddress();loc.loadXml(mqXmlToStr(nodes[count]));}
this.add(loc);}}};MQLocationCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQLocationCollection.prototype.isValidObject=function(obj){if(obj){if(obj.getClassName()==="MQGeoAddress"||obj.getClassName()==="MQAddress"||obj.getClassName()==="MQSingleLineAddress"){return true;}}
return false;};MQSignCollection.prototype=new MQObjectCollection(32678);MQSignCollection.prototype.constructor=MQSignCollection;function MQSignCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQSign");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSIGNCOLLECTION()));this.setM_Xpath("SignCollection");}
MQSignCollection.prototype.getClassName=function(){return"MQSignCollection";};MQSignCollection.prototype.getObjectVersion=function(){return 0;};MQSignCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var sign=null;if(this.getValidClassName()==="MQSign"){for(var count=minCount;count<maxCount;count++){sign=new MQSign();sign.setM_Xpath(this.getM_itemXpath());sign.loadXml(mqXmlToStr(nodes[count]));this.add(sign);}}}};MQSignCollection.prototype.loadXmlFromNode=function(node){var xmlDoc=mqCreateXMLDocImportNode(node);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var sign=null;if(this.getValidClassName()==="MQSign"){for(var count=minCount;count<maxCount;count++){sign=new MQSign();sign.setM_Xpath(this.getM_itemXpath());sign.loadXmlFromNode(nodes[count]);this.add(sign);}}}};MQSignCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQManeuverCollection.prototype=new MQObjectCollection(32678);MQManeuverCollection.prototype.constructor=MQManeuverCollection;function MQManeuverCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQManeuver");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getMANEUVERCOLLECTION()));this.setM_Xpath("ManeuverCollection");}
MQManeuverCollection.prototype.getClassName=function(){return"MQManeuverCollection";};MQManeuverCollection.prototype.getObjectVersion=function(){return 0;};MQManeuverCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var maneuver=null;if(this.getValidClassName()==="MQManeuver"){for(var count=minCount;count<maxCount;count++){maneuver=new MQManeuver();maneuver.setM_Xpath(this.getM_itemXpath());maneuver.loadXml(mqXmlToStr(nodes[count]));this.add(maneuver);}}}};MQManeuverCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQTrekRouteCollection.prototype=new MQObjectCollection(32678);MQTrekRouteCollection.prototype.constructor=MQTrekRouteCollection;function MQTrekRouteCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQTrekRoute");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getTREKROUTECOLLECTION()));this.setM_Xpath("TrekRouteCollection");}
MQTrekRouteCollection.prototype.getClassName=function(){return"MQTrekRouteCollection";};MQTrekRouteCollection.prototype.getObjectVersion=function(){return 0;};MQTrekRouteCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var trek=null;if(this.getValidClassName()==="MQTrekRoute"){for(var count=minCount;count<maxCount;count++){trek=new MQTrekRoute();trek.setM_Xpath(this.getM_itemXpath());trek.loadXml(mqXmlToStr(nodes[count]));this.add(trek);}}}};MQTrekRouteCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQIntCollection.prototype=new MQObjectCollection(32678);MQIntCollection.prototype.constructor=MQIntCollection;function MQIntCollection(itemXpath){MQObjectCollection.call(this,32678);this.setValidClassName("int");if(itemXpath){this.setM_itemXpath(itemXpath);}
if(this.getClassName()==="MQIntCollection"){this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getINTCOLLECTION()));this.setM_Xpath("IntCollection");}}
MQIntCollection.prototype.getClassName=function(){return"MQIntCollection";};MQIntCollection.prototype.getObjectVersion=function(){return 0;};MQIntCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var str=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].firstChild!==null){str=parseInt(nodes[count].firstChild.nodeValue);}else{str=0;}
this.add(str);}}};MQIntCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]="<"+this.getM_itemXpath()+">"+this.get(i)+"</"+this.getM_itemXpath()+">";}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQStringCollection.prototype=new MQObjectCollection(32678);MQStringCollection.prototype.constructor=MQStringCollection;function MQStringCollection(itemXpath){MQObjectCollection.call(this,32678);this.setValidClassName("String");if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSTRINGCOLLECTION()));this.setM_Xpath("StringCollection");}
MQStringCollection.prototype.getClassName=function(){return"MQStringCollection";};MQStringCollection.prototype.getObjectVersion=function(){return 0;};MQStringCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var str=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].firstChild!==null){str=nodes[count].firstChild.nodeValue;}else{str="";}
this.add(str);}}};MQStringCollection.prototype.loadXmlFromNode=function(node){this.setM_XmlDoc(mqCreateXMLDocImportNode(node));var xmlDoc=this.getM_XmlDoc();if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var str=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].firstChild!==null){str=nodes[count].firstChild.nodeValue;}else{str="";}
this.add(str);}}};MQStringCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]="<"+this.getM_itemXpath()+">"+this.get(i)+"</"+this.getM_itemXpath()+">";}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQAutoRouteCovSwitch.prototype=new MQObject();MQAutoRouteCovSwitch.prototype.constructor=MQAutoRouteCovSwitch;function MQAutoRouteCovSwitch(strXpath){MQObject.call(this);if(this.getClassName()==="MQAutoRouteCovSwitch"){if(strXpath){this.setM_Xpath(strXpath);this.setM_XmlDoc(MQA.createXMLDoc("<"+strXpath+"><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></"+strXpath+">"));}else{this.setM_Xpath("AutoRouteCovSwitch");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getAUTOROUTECOVSWITCH()));}}
var m_DataVendorCodes=new MQIntCollection();m_DataVendorCodes.setM_Xpath("DataVendorCodes");this.getDataVendorCodes=function(){return m_DataVendorCodes;};}
MQAutoRouteCovSwitch.prototype.getClassName=function(){return"MQAutoRouteCovSwitch";};MQAutoRouteCovSwitch.prototype.getObjectVersion=function(){return 0;};MQAutoRouteCovSwitch.prototype.loadXml=function(strXml){this.setM_XmlDoc(MQA.createXMLDoc(strXml));var dataVendorCodes=this.getDataVendorCodes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DataVendorCodes")!==null)
dataVendorCodes.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DataVendorCodes")));};MQAutoRouteCovSwitch.prototype.saveXml=function(){var newNode=MQA.createXMLDoc(this.getDataVendorCodes().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DataVendorCodes"));return mqXmlToStr(this.getM_XmlDoc());};MQAutoRouteCovSwitch.prototype.setName=function(strName){this.setProperty("Name",strName);};MQAutoRouteCovSwitch.prototype.getName=function(){return this.getProperty("Name");};MQAutoRouteCovSwitch.prototype.setDataVendorCodeUsage=function(lDataVendorCodeUsage){this.setProperty("DataVendorCodeUsage",lDataVendorCodeUsage);};MQAutoRouteCovSwitch.prototype.getDataVendorCodeUsage=function(){return this.getProperty("DataVendorCodeUsage");};MQSession.prototype=new MQObjectCollection(32678);MQSession.prototype.constructor=MQSession;function MQSession(){MQObjectCollection.call(this,32678);this.setM_Xpath("Session");this.setM_XmlDoc(MQA.createXMLDocFromNode(MQA.MQXML.getSESSION()));}
MQSession.prototype.getClassName=function(){return"MQSession";};MQSession.prototype.getObjectVersion=function(){return 0;};MQSession.prototype.loadXml=function(strXml){var xmlDoc=MQA.createXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var obj=null;for(var count=minCount;count<maxCount;count++){obj=null;if(nodes[count].nodeName==="MapState"){obj=new MQMapState();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="CoverageStyle"){obj=new MQCoverageStyle();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="AutoMapCovSwitch"){obj=new MQAutoMapCovSwitch();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="DBLayerQueryCollection"){obj=new MQDBLayerQueryCollection();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="FeatureCollection"){obj=new MQFeatureCollection();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="PrimitiveCollection"){obj=new MQPrimitiveCollection();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="Center"){obj=new MQCenter();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="CenterLL"){obj=new MQCenterLL();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomIn"){obj=new MQZoomIn();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomOut"){obj=new MQZoomOut();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomTo"){obj=new MQZoomTo();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomToRect"){obj=new MQZoomToRect();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="ZoomToRectLL"){obj=new MQZoomToRectLL();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="Pan"){obj=new MQPan();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="BestFit"){obj=new MQBestFit();obj.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="BestFitLL"){obj=new MQBestFitLL();obj.loadXml(mqXmlToStr(nodes[count]));}
if(obj!==null)
this.add(obj);}}};MQSession.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="</"+this.getM_Xpath()+">";var strRet=strRetArray.join("");return strRet;};MQSession.prototype.add=function(obj){return this.addOne(obj,null);}
MQSession.prototype.isMapCommandObject=function(obj)
{if(obj){var cls=obj.getClassName();if(cls==="MQCenter"||cls==="MQCenterLatLng"||cls==="MQZoomIn"||cls==="MQZoomOut"||cls==="MQZoomTo"||cls==="MQZoomToRect"||cls==="MQZoomToRectLatLng"||cls==="MQPan"||cls==="MQBestFit"||cls==="MQBestFitLL"){return true;}else{return false;}}}
MQSession.prototype.addOne=function(newElement,replacedElement){var collectionSize=this.getSize();var newTypeId=newElement.getClassName();var newIndex=0;if(this.isValidObject(newElement)){if(this.isMapCommandObject(newElement)){for(newIndex=0;newIndex<collectionSize;newIndex++){if(isMapCommandObject(get(newIndex)))
break;}}else{for(newIndex=0;newIndex<collectionSize;newIndex++){if(get(newIndex).getClassId()==newTypeId)
break;}}}else{alert("Invalid object for this collection.");throw("Invalid object for this collection.");}
if(newIndex<collectionSize){replacedElement=this.set(newIndex,newElement);}else{m_collection.add(newElement);}
return newIndex;}
MQSession.prototype.isValidObject=function(obj){if(obj){var cls=obj.getClassName();if(cls==="MQCenter"||cls==="MQCenterLatLng"||cls==="MQZoomIn"||cls==="MQZoomOut"||cls==="MQZoomTo"||cls==="MQZoomToRect"||cls==="MQZoomToRectLatLng"||cls==="MQPan"||cls==="MQBestFit"||cls==="MQBestFitLL"||cls==="MQDBLayerQueryCollection"||cls==="MQCoverageStyle"||cls==="MQFeatureCollection"||cls==="MQAutoMapCovSwitch"||cls==="MQPrimitiveCollection"||cls==="MQMapState"){return true;}else{return false;}}}
function MQAuthentication(strInfo){var strTransactionInfo=(strInfo!=null)?strInfo:"";this.getInfo=function(){return strTransactionInfo;}}
MQAuthentication.prototype.saveXml=function(){return"<Authentication Version=\""+this.getObjectVersion()+"\">"+"<TransactionInfo>"+this.getInfo()+"</TransactionInfo>"+"</Authentication>";};MQAuthentication.prototype.getClassName=function(){return"MQAuthentication";};MQAuthentication.prototype.getObjectVersion=function(){return 2;};function MQXmlNodeObject(strName,strValue){var nodeName=strName;var nodeValue=strValue;this.saveXml=function(){return"<"+nodeName+">"+nodeValue+"</"+nodeName+">";};}
try{var testCommons=new MQObject();testCommons=null;}catch(error){throw"You must include mqcommon.js or toolkit api script prior to mqexec.js.";}
function MQExec(strServerNameORmqeObj,strPathToServer,nServerPort,strProxyServerName,strPathToProxyServerPage,nProxyServerPort)
{var m_strServerName;var m_strServerPath;var m_nServerPort;var m_strProxyServerPath;var m_strProxyServerName;var m_nProxyServerPort;var m_lSocketTimeout;var m_strXInfo="";if(typeof strServerNameORmqeObj=="string"){m_strServerName=strServerNameORmqeObj||"localhost";m_strServerPath=strPathToServer||"mq";m_nServerPort=nServerPort||80;m_strProxyServerPath=strPathToProxyServerPage||"";m_strProxyServerName=strProxyServerName||"";m_nProxyServerPort=nProxyServerPort||0;m_lSocketTimeout=0;}else if(strServerNameORmqeObj.getClassName()&&strServerNameORmqeObj.getClassName()=="MQExec"){m_strServerName=strServerNameORmqeObj.getServerName();m_strServerPath=strServerNameORmqeObj.getServerPath();m_nServerPort=strServerNameORmqeObj.getServerPort();m_strProxyServerName=strServerNameORmqeObj.getProxyServerName();m_nProxyServerPort=strServerNameORmqeObj.getProxyServerPort();m_strProxyServerPath=strServerNameORmqeObj.getProxyServerPath();m_lSocketTimeout=strServerNameORmqeObj.m_lSocketTimeout;}
this.setServerName=function(strServerName){m_strServerName=strServerName;};this.getServerName=function(){return m_strServerName;};this.setServerPath=function(strServerPath){m_strServerPath=strServerPath;};this.getServerPath=function(){return m_strServerPath;};this.setServerPort=function(nServerPort){m_nServerPort=nServerPort;};this.getServerPort=function(){return m_nServerPort;};this.setProxyServerName=function(strProxyServerName){m_strProxyServerName=strProxyServerName;};this.getProxyServerName=function(){return m_strProxyServerName;};this.setProxyServerPath=function(strProxyServerPath){m_strProxyServerPath=strProxyServerPath;};this.getProxyServerPath=function(){return m_strProxyServerPath;};this.setProxyServerPort=function(nProxyServerPort){m_nProxyServerPort=nProxyServerPort;};this.getProxyServerPort=function(){return m_nProxyServerPort;};this.setTransactionInfo=function(strXInfo){if(strXInfo.length>32)
m_strXInfo=strXInfo.substring(0,32);else
m_strXInfo=strXInfo;};this.getTransactionInfo=function(){return m_strXInfo;};}
MQExec.prototype.ROUTE_VERSION="2";MQExec.prototype.SEARCH_VERSION="0";MQExec.prototype.GEOCODE_VERSION="1";MQExec.prototype.ROUTEMATRIX_VERSION="0";MQExec.prototype.GETRECORDINFO_VERSION="0";MQExec.prototype.REVERSEGEOCODE_VERSION="0";MQExec.prototype.GETSESSION_VERSION="1";MQExec.prototype.getRequestXml=function(strTransaction,arrRequest,strVersion){var arrXmlBuf=new Array();var version=strVersion||"0";arrXmlBuf.push("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n");arrXmlBuf.push("<"+strTransaction+" Version=\""+version+"\">\n");for(var i=0;i<arrRequest.length;i++){arrXmlBuf.push(arrRequest[i].saveXml());arrXmlBuf.push("\n");}
arrXmlBuf.push("</"+strTransaction+">");return arrXmlBuf.join("");};MQExec.prototype.doTransaction=function(strTransaction,arrRequest,strVersion){var xmlDoc;var strResXml;var http_request=mqXMLHttpRequest();var strUrl="";arrRequest.push(new MQAuthentication(this.getTransactionInfo()));var strReqXml=this.getRequestXml(strTransaction,arrRequest,strVersion);if(this.getProxyServerName()!=""){strUrl+="http://"+this.getProxyServerName();if(this.getProxyServerPort()!=0){strUrl+=":"+this.getProxyServerPort();}
strUrl+="/";}
strUrl+=this.getProxyServerPath();strUrl+="?sname="+this.getServerName();strUrl+="&spath="+this.getServerPath();strUrl+="&sport="+this.getServerPort();display("mqXmlLogs","Request URL: ",strUrl,"rURL","mqDisplay");display("mqXmlLogs","Request XML: ",strReqXml,"","mqDisplay");http_request.open("POST",strUrl,false);http_request.send(strReqXml);if(http_request.status==200){xmlDoc=http_request.responseXML;}
else{alert("HTTP Status: "+http_request.status+" ("+http_request.statusText+")\n"+"Details: \n"+http_request.responseText);xmlDoc=null;}
display("mqXmlLogs","Response XML: ",mqXmlToStr(xmlDoc),"resXML","mqDisplay");return xmlDoc;};MQExec.prototype.geocode=function(mqaAddress,mqlcLocations,theOptions){var xmlDoc;var strXml;var arrRequest=new Array();if(mqaAddress==null||(mqaAddress.getClassName()!=="MQAddress"&&mqaAddress.getClassName()!=="MQSingleLineAddress")){throw"Null or Illegal Argument passed for MQAddress";}else{arrRequest.push(mqaAddress);}
if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}
if(theOptions!=null){if(theOptions.getClassName()!=="MQAutoGeocodeCovSwitch"&&theOptions.getClassName()!=="MQGeocodeOptionsCollection"){throw"Illegal Argument passed for Geocode Options";}else{arrRequest.push(theOptions);}}
mqLogTime("MQExec.geocode: Transaction Start");xmlDoc=this.doTransaction("Geocode",arrRequest,this.GEOCODE_VERSION);mqLogTime("MQExec.geocode: Transaction End");mqLogTime("MQExec.geocode: Loading of GeocodeResponse Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GeocodeResponse/LocationCollection"));mqlcLocations.loadXml(strXml);mqLogTime("MQExec.geocode: Loading of GeocodeResponse End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.batchGeocode=function(mqlcLocations,mqlccLocations,theOptions){var xmlDoc;var strXml;var arrRequest=new Array();if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}else{arrRequest.push(mqlcLocations);}
if(mqlccLocations==null||mqlccLocations.getClassName()!=="MQLocationCollectionCollection"){throw"Null or Illegal Argument passed for MQLocationCollectionCollection";}
if(theOptions!=null){if(theOptions.getClassName()!=="MQAutoGeocodeCovSwitch"&&theOptions.getClassName()!=="MQGeocodeOptionsCollection"){throw"Illegal Argument passed for Geocode Options";}else{arrRequest.push(theOptions);}}
mqLogTime("MQExec.batchGeocode: Transaction Start");xmlDoc=this.doTransaction("BatchGeocode",arrRequest,this.GEOCODE_VERSION);mqLogTime("MQExec.batchGeocode: Transaction End");mqLogTime("MQExec.batchGeocode: Loading of GeocodeResponse Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/BatchGeocodeResponse/LocationCollectionCollection"));mqlccLocations.loadXml(strXml);mqLogTime("MQExec.batchGeocode: Loading of GeocodeResponse End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.doRoute=function(mqlcLocations,mqroOptions,mqrrResults,strSessionUID,mqRectLL){var xmlDoc;var strXml;var arrRequest=new Array();if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}else{arrRequest.push(mqlcLocations);}
if(mqroOptions==null||mqroOptions.getClassName()!=="MQRouteOptions"){throw"Null or Illegal Argument passed for MQRouteOptions";}else{arrRequest.push(mqroOptions);}
if(mqrrResults==null||mqrrResults.getClassName()!=="MQRouteResults"){throw"Null or Illegal Argument passed for MQRouteResults";}else{var sessionId=strSessionUID||"";arrRequest.push(new MQXmlNodeObject("SessionID",sessionId));}
mqLogTime("MQExec.doRoute: Transaction Start");xmlDoc=this.doTransaction("DoRoute",arrRequest,this.ROUTE_VERSION);mqLogTime("MQExec.doRoute: Transaction End");mqLogTime("MQExec.doRoute: Loading of RouteResults Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/DoRouteResponse/RouteResults"));mqrrResults.loadXml(strXml);mqLogTime("MQExec.doRoute: Loading of RouteResults End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");if(mqRectLL!==null&&sessionId!==""){this.getRouteBoundingBoxFromSessionResponse(sessionId,mqRectLL);}};MQExec.prototype.createSessionEx=function(mqsSession){var xmlDoc;var strSessId;var arrRequest=new Array();if(mqsSession==null||mqsSession.getClassName()!=="MQSession"){throw"Null or Illegal Argument passed for MQSession";}else{arrRequest.push(mqsSession);}
xmlDoc=this.doTransaction("CreateSession",arrRequest);strSessId=mqGetNodeText(mqGetNode(xmlDoc,"/CreateSessionResponse/SessionID"));return strSessId;};MQExec.prototype.getSession=function(strSessionID,mqObj){var xmlDoc;var strXml;var sessionId=strSessionID||"";var arrRequest=new Array();arrRequest.push(new MQXmlNodeObject("SessionID",sessionId));xmlDoc=this.doTransaction("GetSession",arrRequest,this.GETSESSION_VERSION);if(mqObj.getClassName()==="MQMapState"){strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GetSessionResponse/Session/MapState"));mqObj.loadXml(strXml);}else if(mqObj.getClassName()==="MQSession"){strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GetSessionResponse/Session"));mqObj.loadXml(strXml);}};MQExec.prototype.doRouteMatrix=function(mqlcLocations,bAllToAll,mqroOptions,mqrmrResults){var xmlDoc;var strXml;var arrRequest=new Array();if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}else{arrRequest.push(mqlcLocations);}
if(bAllToAll==null||typeof bAllToAll!="boolean"){throw"Null or Illegal Argument passed for bAllToAll";}else{var iAllToAll=bAllToAll?1:0;arrRequest.push(new MQXmlNodeObject("AllToAll",iAllToAll));}
if(mqroOptions==null||mqroOptions.getClassName()!=="MQRouteOptions"){throw"Null or Illegal Argument passed for MQRouteOptions";}else{arrRequest.push(mqroOptions);}
if(mqrmrResults==null||mqrmrResults.getClassName()!=="MQRouteMatrixResults"){throw"Null or Illegal Argument passed for MQRouteMatrixResults";}
mqLogTime("MQExec.doRoute: Transaction Start");xmlDoc=this.doTransaction("DoRouteMatrix",arrRequest,this.ROUTEMATRIX_VERSION);mqLogTime("MQExec.doRoute: Transaction End");mqLogTime("MQExec.doRoute: Loading of RouteResults Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/DoRouteMatrixResponse/RouteMatrixResults"));mqrmrResults.loadXml(strXml);mqLogTime("MQExec.doRoute: Loading of RouteResults End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.getRecordInfo=function(mqscFieldNames,mqdlqQuery,mqrsResults,mqscRecIds){var xmlDoc;var strXml;var arrRequest=new Array();if(mqscFieldNames==null||mqscFieldNames.getClassName()!=="MQStringCollection"){throw"Null or Illegal Argument passed for MQStringCollection";}else{var fields=new MQStringCollection();fields.setM_Xpath("Fields");fields.append(mqscFieldNames);arrRequest.push(fields);}
if(mqdlqQuery==null||mqdlqQuery.getClassName()!=="MQDBLayerQuery"){throw"Null or Illegal Argument passed for MQDBLayerQuery";}else{arrRequest.push(mqdlqQuery);}
if(mqrsResults==null||mqrsResults.getClassName()!=="MQRecordSet"){throw"Null or Illegal Argument passed for MQRecordSet";}
if(mqscRecIds==null||mqscRecIds.getClassName()!=="MQStringCollection"){throw"Null or Illegal Argument passed for MQStringCollection";}else{var recordIds=new MQStringCollection();recordIds.setM_Xpath("RecordIds");recordIds.append(mqscRecIds);arrRequest.push(recordIds);}
mqLogTime("MQExec.getRecordInfo: Transaction Start");xmlDoc=this.doTransaction("GetRecordInfo",arrRequest,this.GETRECORDINFO_VERSION);mqLogTime("MQExec.getRecordInfo: Transaction End");mqLogTime("MQExec.getRecordInfo: Loading of RecordSet Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/GetRecordInfoResponse/RecordSet"));mqrsResults.loadXml(strXml);mqLogTime("MQExec.getRecordInfo: Loading of RecordSet End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.reverseGeocode=function(mqllLatLng,mqlcLocations,strMapCovName,strGeocodeCovName){var xmlDoc;var strXml;var arrRequest=new Array();if(mqllLatLng==null||mqllLatLng.getClassName()!=="MQLatLng"){throw"Null or Illegal Argument passed for MQLatLng";}else{arrRequest.push(mqllLatLng);}
if(mqlcLocations==null||mqlcLocations.getClassName()!=="MQLocationCollection"){throw"Null or Illegal Argument passed for MQLocationCollection";}
var mapPool=strMapCovName||"";arrRequest.push(new MQXmlNodeObject("MapPool",mapPool));var geocodePool=strGeocodeCovName||"";arrRequest.push(new MQXmlNodeObject("GeocodePool",geocodePool));mqLogTime("MQExec.reverseGeocode: Transaction Start");xmlDoc=this.doTransaction("ReverseGeocode",arrRequest,this.REVERSEGEOCODE_VERSION);mqLogTime("MQExec.reverseGeocode: Transaction End");mqLogTime("MQExec.reverseGeocode: Loading of Response Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/ReverseGeocodeResponse/LocationCollection"));mqlcLocations.loadXml(strXml);mqLogTime("MQExec.reverseGeocode: Loading of Response End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.search=function(mqscCriteria,mqfcSearchResults,strCoverageName,mqdlqcDbLayers,mqfcFeatures,mqdcDisplayTypes){var xmlDoc;var strXml;var arrRequest=new Array();var strName=mqscCriteria?mqscCriteria.getClassName():null;if(strName==null||(strName!=="MQSearchCriteria"&&strName!=="MQRadiusSearchCriteria"&&strName!=="MQRectSearchCriteria"&&strName!=="MQPolySearchCriteria"&&strName!=="MQCorridorSearchCriteria")){throw"Null or Illegal Argument passed for Search Criteria";}else{arrRequest.push(mqscCriteria);}
if(mqfcSearchResults==null||mqfcSearchResults.getClassName()!=="MQFeatureCollection"){throw"Null or Illegal Argument passed for MQFeatureCollection";}
if(typeof strCoverageName!=="string"){throw"Illegal Argument passed for strCoverageName";}else{arrRequest.push(new MQXmlNodeObject("CoverageName",strCoverageName));}
if(mqdlqcDbLayers!=null&&mqdlqcDbLayers.getClassName()!=="MQDBLayerQueryCollection"){throw"Illegal Argument passed for MQRouteOptions";}else if(mqdlqcDbLayers==null){mqdlqcDbLayers=new MQDBLayerQueryCollection();}
arrRequest.push(mqdlqcDbLayers);if(mqfcFeatures!=null&&mqfcFeatures.getClassName()!=="MQFeatureCollection"){throw"Illegal Argument passed for MQFeatureCollection";}else if(mqfcFeatures==null){mqfcFeatures=new MQFeatureCollection();}
arrRequest.push(mqfcFeatures);if(mqdcDisplayTypes!=null&&mqdcDisplayTypes.getClassName()!=="MQDTCollection"){throw"Illegal Argument passed for MQDTCollection";}else if(mqdcDisplayTypes==null){mqdcDisplayTypes=new MQDTCollection();}
arrRequest.push(mqdcDisplayTypes);mqLogTime("MQExec.Search: Transaction Start");xmlDoc=this.doTransaction("Search",arrRequest,this.SEARCH_VERSION);mqLogTime("MQExec.Search: Transaction End");mqLogTime("MQExec.Search: Loading of Search results Start");strXml=mqXmlToStr(mqGetNode(xmlDoc,"/SearchResponse/FeatureCollection"));mqfcSearchResults.loadXml(strXml);mqLogTime("MQExec.Search: Loading of Search results End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");};MQExec.prototype.getRouteBoundingBoxFromSessionResponse=function(sessionId,mqRectLL){var xmlDoc;var strXml;var arrRequest=new Array();if(mqRectLL==null){throw"Null or Illegal Argument passed for MQRectLL";}
arrRequest.push(new MQXmlNodeObject("SessionID",sessionId));xmlDoc=this.doTransaction("GetRouteBoundingBoxFromSession",arrRequest);mqLogTime("MQExec.doRoute: Loading of MQRectLL Start");var nodes=xmlDoc.documentElement.childNodes;var ul=new MQLatLng();ul.loadXml(mqXmlToStr(nodes[0]));var lr=new MQLatLng();lr.loadXml(mqXmlToStr(nodes[1]));mqRectLL.setUpperLeft(ul);mqRectLL.setLowerRight(lr);mqLogTime("MQExec.doRoute: Loading of MQRectLL End");};MQExec.prototype.isAlive=function(){if(this.getServerPort()==-1||this.getServerName()=="")
return false;return true;};MQExec.prototype.getServerInfo=function(lType){if(!this.isAlive())
return null;var strReqXml;var xmlDoc;var strXml;var type=lType||0;var arrRequest=new Array();if(typeof type!=="number"){throw"Illegal Argument passed for lType";}else{arrRequest.push(new MQXmlNodeObject("Type",type));}
mqLogTime("MQExec.GetServerInfo: Transaction Start");xmlDoc=this.doTransaction("GetServerInfo",arrRequest);mqLogTime("MQExec.GetServerInfo: Transaction End");display("results","Response",mqXmlToStr(xmlDoc),"","mqDisplay");return xmlDoc;};
