
i18="tile21.mqcdn.com";i10="btileprint.access.mapquest.com";mqz=Array;j27="btilelog.access.mapquest.com:80";k31="tile23.mqcdn.com";k30="tile22.mqcdn.com";k29="tile24.mqcdn.com";d17=new mqz(i18,k30,k31,k29);b43=new mqz(i18,k30,k31,k29);b22=new mqz(i18,k30,k31,k29);c39=i18;c44=j27;c43=i10;IsDotCom=false;if(typeof Prototype=="undefined")
{var Prototype={Version:'1.5.0',BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
Object.extend=function(destination,source){for(var property in source){destination[property]=source[property];}
return destination;}
Object.extend(Object,{inspect:function(object){try{if(object===undefined)return'undefined';if(object===null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);}});var $break=new Object();var $continue=new Object();var Enumerable={each:function(iterator){var index=0;try{this._each(function(value){try{iterator(value,index++);}catch(e){if(e!=$continue)throw e;}});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator){var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.map(iterator);},all:function(iterator){var result=true;this.each(function(value,index){result=result&&!!(iterator||Prototype.K)(value,index);if(!result)throw $break;});return result;},any:function(iterator){var result=false;this.each(function(value,index){if(result=!!(iterator||Prototype.K)(value,index))
throw $break;});return result;},collect:function(iterator){var results=[];this.each(function(value,index){results.push((iterator||Prototype.K)(value,index));});return results;},detect:function(iterator){var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(pattern,iterator){var results=[];this.each(function(value,index){var stringValue=value.toString();if(stringValue.match(pattern))
results.push((iterator||Prototype.K)(value,index));})
return results;},include:function(object){var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=fillWith===undefined?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});},inject:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(result==undefined||value>=result)
result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(result==undefined||value<result)
result=value;});return result;},partition:function(iterator){var trues=[],falses=[];this.each(function(value,index){((iterator||Prototype.K)(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator){return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},size:function(){return this.toArray().length;},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}}
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0;i<iterable.length;i++)
results.push(iterable[i]);return results;}}
Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)
Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(value&&value.constructor==Array?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},indexOf:function(object){for(var i=0,length=this.length;i<length;i++)
if(this[i]==object)return i;return-1;},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(){return this.inject([],function(array,value){return array.include(value)?array:array.concat([value]);});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';}});if(!window.Element)
var Element=new Object();Element.extend=function(element){if(!element||_nativeExtensions||element.nodeType==3)return element;if(!element._extended&&element.tagName&&element!=window){var methods=Object.clone(Element.Methods),cache=Element.extend.cache;if(element.tagName=='FORM')
Object.extend(methods,Form.Methods);if(['INPUT','TEXTAREA','SELECT'].include(element.tagName))
Object.extend(methods,Form.Element.Methods);Object.extend(methods,Element.Methods.Simulated);for(var property in methods){var value=methods[property];if(typeof value=='function'&&!(property in element))
element[property]=cache.findOrStore(value);}}
element._extended=true;return element;};Element.extend.cache={findOrStore:function(value){return this[value]=this[value]||function(){return value.apply(null,[this].concat($A(arguments)));}}};Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){$(element).style.display='none';return element;},show:function(element){$(element).style.display='';return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:function(element,html){html=typeof html=='undefined'?'':html.toString();$(element).innerHTML=html.stripScripts();setTimeout(function(){html.evalScripts()},10);return element;},replace:function(element,html){element=$(element);html=typeof html=='undefined'?'':html.toString();if(element.outerHTML){element.outerHTML=html.stripScripts();}else{var range=element.ownerDocument.createRange();range.selectNodeContents(element);element.parentNode.replaceChild(range.createContextualFragment(html.stripScripts()),element);}
setTimeout(function(){html.evalScripts()},10);return element;},inspect:function(element){element=$(element);var result='<'+element.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||'').toString();if(value)result+=' '+attribute+'='+value.inspect(true);});return result+'>';},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property])
if(element.nodeType==1)
elements.push(Element.extend(element));return elements;},ancestors:function(element){return $(element).recursivelyCollect('parentNode');},descendants:function(element){return $A($(element).getElementsByTagName('*'));},immediateDescendants:function(element){if(!(element=$(element).firstChild))return[];while(element&&element.nodeType!=1)element=element.nextSibling;if(element)return[element].concat($(element).nextSiblings());return[];},previousSiblings:function(element){return $(element).recursivelyCollect('previousSibling');},nextSiblings:function(element){return $(element).recursivelyCollect('nextSibling');},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings());},match:function(element,selector){if(typeof selector=='string')
selector=new Selector(selector);return selector.match($(element));},up:function(element,expression,index){return Selector.findElement($(element).ancestors(),expression,index);},down:function(element,expression,index){return Selector.findElement($(element).descendants(),expression,index);},previous:function(element,expression,index){return Selector.findElement($(element).previousSiblings(),expression,index);},next:function(element,expression,index){return Selector.findElement($(element).nextSiblings(),expression,index);},getElementsBySelector:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args);},getElementsByClassName:function(element,className){return document.getElementsByClassName(className,element);},readAttribute:function(element,name){element=$(element);if(document.all&&!window.opera){var t=Element._attributeTranslations;if(t.values[name])return t.values[name](element,name);if(t.names[name])name=t.names[name];var attribute=element.attributes[name];if(attribute)return attribute.nodeValue;}
return element.getAttribute(name);},getHeight:function(element){return $(element).getDimensions().height;},getWidth:function(element){return $(element).getDimensions().width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;var elementClassName=element.className;if(elementClassName.length==0)return false;if(elementClassName==className||elementClassName.match(new RegExp("(^|\\s)"+className+"(\\s|$)")))
return true;return false;},addClassName:function(element,className){if(!(element=$(element)))return;Element.classNames(element).add(className);return element;},removeClassName:function(element,className){if(!(element=$(element)))return;Element.classNames(element).remove(className);return element;},toggleClassName:function(element,className){if(!(element=$(element)))return;Element.classNames(element)[element.hasClassName(className)?'remove':'add'](className);return element;},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first();},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first();},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue))
element.removeChild(node);node=nextNode;}
return element;},empty:function(element){return $(element).innerHTML.match(/^\s*$/);},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);while(element=element.parentNode)
if(element==ancestor)return true;return false;},scrollTo:function(element){element=$(element);var pos=Position.cumulativeOffset(element);window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);if(['float','cssFloat'].include(style))
style=(typeof element.style.styleFloat!='undefined'?'styleFloat':'cssFloat');style=style.camelize();var value=element.style[style];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}else if(element.currentStyle){value=element.currentStyle[style];}}
if((value=='auto')&&['width','height'].include(style)&&(element.getStyle('display')!='none'))
value=element['offset'+style.capitalize()]+'px';if(window.opera&&['left','top','right','bottom'].include(style))
if(Element.getStyle(element,'position')=='static')value='auto';if(style=='opacity'){if(value)return parseFloat(value);if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
return value=='auto'?null:value;},setStyle:function(element,style){element=$(element);for(var name in style){var value=style[name];if(name=='opacity'){if(value==1){value=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)
element.style.filter=element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'');}else if(value==''){if(/MSIE/.test(navigator.userAgent)&&!window.opera)
element.style.filter=element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'');}else{if(value<0.00001)value=0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)
element.style.filter=element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+value*100+')';}}else if(['float','cssFloat'].include(name))name=(typeof element.style.styleFloat!='undefined')?'styleFloat':'cssFloat';element.style[name.camelize()]=value;}
return element;},getDimensions:function(element){element=$(element);var display=$(element).getStyle('display');if(display!='none'&&display!=null)
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}
return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}
return element;},makeClipping:function(element){element=$(element);if(element._overflow)return element;element._overflow=element.style.overflow||'auto';if((Element.getStyle(element,'overflow')||'visible')!='hidden')
element.style.overflow='hidden';return element;},undoClipping:function(element){element=$(element);if(!element._overflow)return element;element.style.overflow=element._overflow=='auto'?'':element._overflow;element._overflow=null;return element;}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
['','Form','Input','TextArea','Select'].each(function(tag){var className='HTML'+tag+'Element';if(window[className])return;var klass=window[className]={};klass.prototype=document.createElement(tag?tag.toLowerCase():'div').__proto__;});Element.addMethods=function(methods){Object.extend(Element.Methods,methods||{});function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;var cache=Element.extend.cache;for(var property in methods){var value=methods[property];if(!onlyIfAbsent||!(property in destination))
destination[property]=cache.findOrStore(value);}}
if(typeof HTMLElement!='undefined'){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);copy(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(klass){copy(Form.Element.Methods,klass.prototype);});_nativeExtensions=true;}}
var Toggle=new Object();Toggle.display=Element.toggle;Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(typeof element=='string')
element=document.getElementById(element);return Element.extend(element);}
if(!window.Event){var Event=new Object();}
if(!window.Event){var Event=new Object();}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(event){return event.target||event.srcElement;},isLeftClick:function(event){return(((event.which)&&(event.which==1))||((event.button)&&(event.button==1)));},pointerX:function(event){return event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(event){return event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}},findElement:function(event,tagName){var element=Event.element(event);while(element.parentNode&&(!element.tagName||(element.tagName.toUpperCase()!=tagName.toUpperCase())))
element=element.parentNode;return element;},observers:false,_observeAndCache:function(element,name,observer,useCapture){if(!this.observers)this.observers=[];if(element.addEventListener){this.observers.push([element,name,observer,useCapture]);element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){this.observers.push([element,name,observer,useCapture]);element.attachEvent('on'+name,observer);}},unloadCache:function(){if(!Event.observers)return;for(var i=0,length=Event.observers.length;i<length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}
Event.observers=false;},observe:function(element,name,observer,useCapture){element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
name='keydown';Event._observeAndCache(element,name,observer,useCapture);},stopObserving:function(element,name,observer,useCapture){element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.detachEvent))
name='keydown';if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else if(element.detachEvent){try{element.detachEvent('on'+name,observer);}catch(e){}}}});if(navigator.appVersion.match(/\bMSIE\b/))
Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return[valueL,valueT];},offsetParent:function(element){if(element.offsetParent)return element.offsetParent;if(element==document.body)return element;while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return element;return document.body;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=this.realOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=this.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},page:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!window.opera||element.tagName=='BODY'){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return[valueL,valueT];},clone:function(source,target){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})
source=$(source);var p=Position.page(source);target=$(target);var delta=[0,0];var parent=null;if(Element.getStyle(target,'position')=='absolute'){parent=Position.offsetParent(target);delta=Position.page(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)target.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)target.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)target.style.width=source.offsetWidth+'px';if(options.setHeight)target.style.height=source.offsetHeight+'px';},absolutize:function(element){element=$(element);if(element.style.position=='absolute')return;Position.prepare();var offsets=Position.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';},relativize:function(element){element=$(element);if(element.style.position=='relative')return;Position.prepare();element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;}}}a9=74900;a8=74999;a7=88011773;a6=90;a5=90.0;a4=9000;a3=95;a2=9778;a1=9779086;a0=99991;i50="mqloading";a50=13;i49="&lnglr=";i48="&rand=";i47="auto";i46="&height=";i45="/scales/scalebar.gif' />";i44="mz1copy.gif";i43="no";i42="/?e=0&GetMapFromUpdatedSession.1=1280:";i41="style";i40="&latul=";a49=140818;a48=15;a47=1500;a46=1504475;a45=154950;a44=16;a43=179;a42=18;a41=180;a40=180.0;i39="ak_14";i38="print";i37="url(";i35="hidden";i34="mouseover";i33="mqrtehl";i32="mousedown";i31="mouseup";a39=18000;a38=190;a37=19558;a36=2.0;a35=22;a34=2272;a33=234;a32=234698;a31=250;a30=2500;i29=", ";i28="movestart";i27="/";i26="moveend";i25="&c2=";i24="190";i23="&lng=";i22="click";i21="/tilelog/transaction?transaction=log&t=m&c=";i20="18";a29=250344597.90989706;a28=255;a27=256;a26=29337258;a25=315552459.66191697;a24=324767;a23=352047;a22=3520471;a21=36;a20=360.0;i17="mouseout";i16="loading.gif)";i15="dg_1";i14="relative";i13=",1270:2,1190:,rtehl,";i12="/res/";i11="12";a19=36000;a18=39116;a17=4694;a16=4700;a15=50;a14=502;a13=60;a12=701289;a11=7168;a10=72.0;mqz=Array;ak_8="http://";ak_7=Math.max;ak_6=Math.abs;ak_5=Math.random;ak_4=Math.floor;ak_3=Math.ceil;ak_2=parseFloat;ak_1=parseInt;j50="ak_11";j49="SetTileMode";j48="&width=";j47="/tileprint.php";j46="124";j45="Safari";j44="0px";j43="nothing.gif";j42="#FFFFFF";j41="mqhybdiv";j40="dragstart";j39="/hyb/Scale";j38=",";j37="div";j36="15";j35="/sat/Scale";j34="mqsatdiv";j33="/map/Scale";j31="off";j30="115";j29="ak_12";j28="drag";j26="&key=";j25="dblclick";j24="mz7copy.gif";j23="0.6";j22="ak_9";j21="text/css";j20="move";j19="124px";j18="18px";j17=" );";j16="ak_13";j15="IMG";j14="mjtd%7Clu6y2d6121%2Crs%3Do5-0w7aq";j13="on";j12="&lat=";j11="/tilelog/transaction?transaction=log&t=a&c=";j10="550px";b16=0.0;b15=0.40;b14=1.0;b13=1.5;b12=100;b11=100.0;b10=1000;ai_7="absolute";ai_6="block";ai_5="none";ai_4="/scales/zoom";ai_3="px";ai_2=".jpg";ai_1=".gif";k9="-moz-grab";k8="&scale=";k7="dragend";k6="BackgroundImageCache";k5="&latlr=";k4="in core, about to rebuild tiles";k3="mz0copy.gif";k2="repeat";k1="sz1copy.gif";k0="&lngul=";j9="mqpoidiv";j8=", 1, ";j7="mqtiledmap";j6="-moz-grabbing";j5="mqmapdiv";j4="MSIE";j3="95";j2=", 0, 0, ";j1="mqlogo.gif";j0="";i9="/tilelog/transaction?transaction=log&t=h&c=";i8="img";i7="img#mqrtehl { visibility:hidden; display:none }";k28="MASTER_BROKER.DoSlide( ";k27="<img style='-moz-user-select:none;' unselectable='on' src='http://";k26="visible";k25="mqcopy.gif";k24="grab.cur";k23="0";k22="mousemove";k21="mqstaticmapdiv";k20="475px";aj="loading.gif";ai="hyb";ah="sat";ag="map";b9=1000000;b8=1000000.0;k19="msie";b7=103;k18="undefined";b6=107;k17="mz4copy.gif";b5=1084;k16="103";b4=109;b3=11;k15="default";b2=115;k14="alpha(opacity='60')";b1=12;k13="&s=";b0=124;k12="grabbing.cur";k11=",1050:6,nodata,1062:1537,,,Visible+False,1062:1577,,,Visible+False,1062:1578,,,Visible+False,1062:764,,,Visible+False,1062:1279,,,polygon+brush+style+solid+color+224%2c224%2c224,1062:765,,,Visible+True+Line+Pen+Style+Solid+Size+150+Color+255%2c0%2c0+Opacity+255+CasePen+Style+Solid+Size+210+Color+255%2c255%2c255+Opacity+255,1650.1:77,72,1,1400.2:,,,";k10="ak_10";Key=j14;MQTileMapCount=0;c7=a25;d6=a29;d26=a27;b45=9;d14=b3;d34=new mqz(0,a7,a26,a1,a22,a46,a12,a24,a45,a8,a19,a39,a4,a16,a30,a47,b10);b25=new mqz(0,4,b1,a21,b12,a33,a14,b5,a34,a17,a2,a37,a18,a9,a49,a32,a23);d8=new mqz(j0,i44,k17,j24,k3);d13=new mqz(0,1,1,1,2,2,2,3,3,3,4,4,4,4,4,4,4);c31=ak_8+c39+i12;c10=ak_8+c43+j47;b33=c31+j43;CORNER_TOPLEFT=0;CORNER_TOPRIGHT=1;CORNER_BOTTOMLEFT=2;CORNER_BOTTOMRIGHT=3;LOGO_MQ_LOGO=0;LOGO_MQ_SCALES=1;LOGO_MQ_COPY=2;LOGO_NT_COPY=3;LOGO_I3_COPY=4;LOGO_MAP_COPY=3;LOGO_SAT_COPY=4;EVENT_NONE=-1;EVENT_CLICK=0;EVENT_DBLCLICK=1;OPER_RECENTER=0;OPER_RECENTERZOOM=1;c30=a11;b38=a11;BUTTON_MQ_LEFT=0;BUTTON_MQ_MIDDLE=1;BUTTON_MQ_RIGHT=2;MASTER_BROKER=null;SURFACE_OFFSET=2*d26;SAFARI_BROWSER=(navigator.userAgent.indexOf(j45)>=0);function GetMapResources(){return c31;}function GetStaticMapResources(){return c10;}function IncrMQTileMapCount(){MQTileMapCount=MQTileMapCount+1;return MQTileMapCount;}function GetMQTileMapCount(){return MQTileMapCount;}function pause(f_0){var g0=new Date();var h22=g0.getTime()+f_0;while(true){g0=new Date();if(g0.getTime()>h22)return;};};function e13(f_0,f_1){var y=(f_0+a5)*(c7/f_1);var b46=ak_1(y/d26);return b46;};function e44(f_0,f_1){var y=(f_0+a5)*(c7/f_1);var b46=ak_1(y/d26);return(y-b46*d26);};function h13(f_0,f_1,f_2){var y=f_0*d26+f_1;var c47=y/(c7/f_2)-a5;c47=ak_1(c47*b9)/b8;return c47;};function h1(f_0,f_1){var x=(f_0+a40)*(d6/f_1);var b36=ak_1(x/d26);return b36;};function h28(f_0,f_1){var x=(f_0+a40)*(d6/f_1);var b36=ak_1(x/d26);return(x-b36*d26);};function d45(f_0,f_1,f_2){var x=f_0*d26+f_1;var c38=x/(d6/f_2)-a40;c38=ak_1(c38*b9)/b8;while(c38>a40)c38-=a20;while(c38<-a40)c38+=a20;return c38;};function e50(f_0){var b28=new PointXY(0,0);while(f_0){b28.x+=f_0.offsetLeft;b28.y+=f_0.offsetTop;f_0=f_0.offsetParent;};return b28;};function h21(f_0){return f_0+ai_3;};function h9(f_0,f_1,f_2,f_3,f_4,f_5){var c25;c25=document.createElement(j15);c25.galleryimg=i43;c25.lt=f_1;c25.tp=f_2;var d35=c25.style;d35.width=h21(f_3);d35.height=h21(f_4);d35.position=ai_7;d35.left=h21(f_1);d35.top=h21(f_2);d35.zIndex=f_5;d35.MozUserSelect=ai_5;d35.display=ai_6;d35.border=k23;if(f_0.length==0){d35.visibility=i35;}else{d35.visibility=k26;c25.src=f_0;}c25.unselectable=j13;c25.onselectstart=function(){return false;};c25.oncontextmenu=function(){return false;};return c25;};function MQEventCallback(f_0,f_1){var c45=f_0;return function(event){if(c45.turnEventsOff||(c45.f22&&c45.f22.turnEventsOff))return;if(!event)event=window.event;c45[f_1](event);};};function SlideBroker(){this.h18=new mqz();}SlideBroker.prototype={h5:function(f_0){var g25=this.h18.length;this.h18[g25]=f_0;return g25;},DoSlide:function(f_0,f_1,f_2,f_3,f_4,f_5,f_6,f_7){this.h18[f_0].ak_18(f_0,f_1,f_2,f_3,f_4,f_5,f_6,f_7);}};function PointFloatXY(f_0,f_1){this.x=ak_2(f_0);this.y=ak_2(f_1);};function PointXY(f_0,f_1){this.x=ak_1(f_0);this.y=ak_1(f_1);};function PointLL(f_0,f_1){this.lat=ak_2(f_0);this.lng=ak_2(f_1);};function RectLL(f_0,f_1){this.ul=new PointLL(f_0.lat,f_0.lng);this.lr=new PointLL(f_1.lat,f_1.lng);};function RectXY(f_0,f_1){this.ul=new PointXY(f_0.x,f_0.y);this.lr=new PointXY(f_1.x,f_1.y);};function Size(f_0,f_1){this.width=ak_1(f_0);this.height=ak_1(f_1);};function Image(){this.image=null;};function Tile(f_0,f_1,f_2,f_3,f_4,f_5,f_6,f_7,f_8){this.parent=f_0;this.div=f_1;this.g19=f_8;this.lt=f_2;this.tp=f_3;var ak_17=this;if(this.parent.h0){this.mag=new Image();if(!SAFARI_BROWSER){this.mag.image=h9(j0,this.lt,this.tp,this.g19,this.g19,0);this.mag.image.onload=function(){ak_17.f50();};}else{this.mag.image=h9(c31+aj,this.lt,this.tp,this.g19,this.g19,0);}this.div.e43.appendChild(this.mag.image);}if(this.parent.f4){this.mah=new Image();if(!SAFARI_BROWSER){this.mah.image=h9(j0,this.lt,this.tp,this.g19,this.g19,0);this.mah.image.onload=function(){ak_17.f33();};}else{this.mah.image=h9(c31+aj,this.lt,this.tp,this.g19,this.g19,0);}this.div.d42.appendChild(this.mah.image);}if(this.parent.e23){this.mai=new Image();if(!SAFARI_BROWSER){this.mai.image=h9(j0,this.lt,this.tp,this.g19,this.g19,0);this.mai.image.onload=function(){ak_17.f45();};}else{this.mai.image=h9(c31+aj,this.lt,this.tp,this.g19,this.g19,0);}this.div.e3.appendChild(this.mai.image);}this.e1(f_2,f_3,f_4,f_5,f_6,f_7);};Tile.prototype={e1:function(f_0,f_1,f_2,f_3,f_4,f_5){var c20=ak_1(f_2/b10);var b17=ak_1(f_3/b10);this.lt=f_0;this.tp=f_1;this.x=f_2;this.y=f_3;while(f_2<0)f_2+=b25[f_5];while(f_2>=b25[f_5])f_2-=b25[f_5];c20=ak_1(f_2/b10);b17=ak_1(f_3/b10);if(this.parent.h0){this.g2=ak_8+d17[f_2%d17.length]+j33+f_4+i27+b17+i27+(f_3-b17*b10)+i27+c20+i27+(f_2-c20*b10)+ai_1;this.mag.image.src=this.g2;this.mag.image.lt=this.lt;this.mag.image.tp=this.tp;this.mag.image.style.left=h21(this.lt);this.mag.image.style.top=h21(this.tp);}if(this.parent.f4){this.g2=ak_8+b22[f_2%b22.length]+j35+f_4+i27+b17+i27+(f_3-b17*b10)+i27+c20+i27+(f_2-c20*b10)+ai_2;this.mah.image.src=this.g2;this.mah.image.lt=this.lt;this.mah.image.tp=this.tp;this.mah.image.style.left=h21(this.lt);this.mah.image.style.top=h21(this.tp);}if(this.parent.e23){this.g2=ak_8+b43[f_2%b43.length]+j39+f_4+i27+b17+i27+(f_3-b17*b10)+i27+c20+i27+(f_2-c20*b10)+ai_1;this.mai.image.src=this.g2;this.mai.image.lt=this.lt;this.mai.image.tp=this.tp;this.mai.image.style.left=h21(this.lt);this.mai.image.style.top=h21(this.tp);}},f15:function(){var ak_17=this;if(this.parent.h0){if(!this.mag){this.mag=new Image();if(!SAFARI_BROWSER){this.mag.image=h9(j0,this.lt,this.tp,this.g19,this.g19,0);this.mag.image.onload=function(){ak_17.f50();};}else{this.mag.image=h9(c31+aj,this.lt,this.tp,this.g19,this.g19,0);}this.div.e43.appendChild(this.mag.image);}else{if(!SAFARI_BROWSER){this.mag.image.style.visibility=i35;}else{this.mag.image.src=c31+aj;}}}if(this.parent.f4){if(!this.mah){this.mah=new Image();if(!SAFARI_BROWSER){this.mah.image=h9(j0,this.lt,this.tp,this.g19,this.g19,0);this.mah.image.onload=function(){ak_17.f33();};}else{this.mah.image=h9(c31+aj,this.lt,this.tp,this.g19,this.g19,0);}this.div.d42.appendChild(this.mah.image);}else{if(!SAFARI_BROWSER){this.mah.image.style.visibility=i35;}else{this.mah.image.src=c31+aj;}}}if(this.parent.e23){if(!this.mai){this.mai=new Image();if(!SAFARI_BROWSER){this.mai.image=h9(j0,this.lt,this.tp,this.g19,this.g19,0);this.mai.image.onload=function(){ak_17.f45();};}else{this.mai.image=h9(c31+aj,this.lt,this.tp,this.g19,this.g19,0);}this.div.e3.appendChild(this.mai.image);}else{if(!SAFARI_BROWSER){this.mai.image.style.visibility=i35;}else{this.mai.image.src=c31+aj;}}}},f50:function(){if(this.parent.h0){this.mag.image.style.visibility=k26;}},f33:function(){if(this.parent.f4){this.mah.image.style.visibility=k26;}},f45:function(){if(this.parent.e23){this.mai.image.style.visibility=k26;}}};function Map(f_0,f_1,f_2,f_3,f_4){this.h0=true;this.f4=false;this.e23=false;this.g48=false;this.e30=true;this.e29=true;this.e11=ag;this.e47="mag";this.g49=null;this.e20=null;this.f47=0;if(f_3==ah){this.f4=true;this.h0=false;this.e11=f_3;this.e47="mah";}if(f_3==ai){this.f4=true;this.e23=true;this.h0=false;this.e11=f_3;this.e47="mai";}var ak_17=this;window.onunload=function(){ak_17.d40(true);};document.body.onunload=function(){ak_17.d40(true);};if(MASTER_BROKER==null){MASTER_BROKER=new SlideBroker();}this.g26=MASTER_BROKER.h5(ak_17);this.parent=f_0;if(!this.parent.style.height||ak_1(this.parent.style.height)<b12){this.parent.style.width=j10;this.parent.style.height=k20;}this.width=ak_1(this.parent.style.width);this.height=ak_1(this.parent.style.height);if(this.width>b38)this.width=b38;if(this.height>c30)this.height=c30;if(f_4!=null){if(f_4.getBestFitMargin()!=null){this.SetBestFitMargin(f_4.getBestFitMargin())}if(f_4.getBestFitRect()!=null){this.SetBestFitRect(f_4.getBestFitRect());this.SetKeepCenter(f_4.isKeepCenter());f_1=this.GetZoom(f_4.getBestFitRect(),f_2,f_4.isKeepCenter(),f_4.getMinZoom(),f_4.getMaxZoom());if(f_4.isKeepCenter()==false){f_2=this.GetPtLlCenter(f_4.getBestFitRect());}}}this.zoom=(f_1>a44)?a44:ak_1(f_1);this.scale=d34[this.zoom];this.g36=d26;this.centerlat=f_2.lat;this.centerlng=f_2.lng;this.e25=this.centerlat;this.g17=this.centerlng;this.f1=ak_3(this.height/this.g36)+2;this.f17=ak_3(this.width/this.g36)+2;this.g3=false;this.d44=false;this.f43=false;this.e22=null;this.h27=null;this.e49=EVENT_NONE;this.h15=-1;this.g16=j0;this.f40=j0;this.d41=false;this.g14=b16;this.f36=b16;this.g6=b16;this.g13=b16;this.f35=b16;this.g5=b16;this.e45=b16;this.g37=false;this.g30=false;this.div=this.CreateParentDiv(j7,0,0,ai_7,0,0,0,null,null);this.parent.style.overflow=i35;this.parent.style.background=j42;this.parent.style.position=i14;this.parent.style.top=j44;this.parent.style.left=j44;this.parent.style.width=this.width+ai_3;this.parent.style.height=this.height+ai_3;this.parent.appendChild(this.div);if(navigator.userAgent.indexOf(j4)>=0)document.execCommand(k6,false,true);this.div.f42=this.CreateParentDiv(i50,0,0,ai_7,0,0,0,(this.f17*d26),(this.f1*d26));this.div.f42.style.backgroundImage=i37+c31+i16;this.div.f42.style.backgroundRepeat=k2;this.div.appendChild(this.div.f42);Event.observe(document,k22,MQEventCallback(this,j22));Event.observe(document,i31,MQEventCallback(this,k10));Event.observe(document,i17,MQEventCallback(this,j50));Event.observe(this.parent,i34,MQEventCallback(this,j29));Event.observe(this.parent,i32,MQEventCallback(this,j16));this.h14(EVENT_DBLCLICK,OPER_RECENTER);this.f25=this.h31(null,j13,ai_5,ai_5,a15);this.f25.id=i33;this.f25.onload=function(){ak_17.e38();};this.f25.onselectstart=function(){return false;};this.f25.oncontextmenu=function(){return false;};this.f25.style.position=ai_7;this.f25.style.opacity=j23;this.f25.style.filter=k14;this.div.appendChild(this.f25);this.f7=document.createElement(i41);this.f7.type=j21;this.f7.media=i38;var d4=i7;if(this.f7.styleSheet){this.f7.styleSheet.cssText=d4;}else{var b40=document.createTextNode(d4);this.f7.appendChild(b40);}document.body.appendChild(this.f7);this.f29=this.h31(null,j13,ai_5,ai_5,null);this.f29.src=c31+aj;this.parent.appendChild(this.f29);this.g34=this.h31(b33,j13,ai_5,ai_5,null);this.parent.appendChild(this.g34);this.e2=this.h31(b33,j13,ai_5,ai_5,null);this.parent.appendChild(this.e2);this.e41=this.h31(b33,j13,ai_5,ai_5,null);this.parent.appendChild(this.e41);this.f44=new mqz(5);this.f44[0]=this.CreateImgLogo(ai_5,j13,0,new PointXY(0,0),ai_7,ai_6,a35,null,a3,a48);this.f44[0].src=c31+j1;this.e31(this.f44[0]);this.parent.appendChild(this.f44[0]);this.f44[1]=document.createElement(j37);this.f44[1].corner=1;this.f44[1].offset=new PointXY(0,0);this.f44[1].style.position=ai_7;this.f44[1].style.display=ai_6;this.f44[1].style.zIndex=a35;this.f44[1].width=j46;this.f44[1].height=i20;this.f44[1].style.overflow=i35;this.f44[1].style.width=j19;this.f44[1].style.height=j18;this.f44[1].innerHTML=k27+c39+i45;this.e31(this.f44[1]);this.parent.appendChild(this.f44[1]);this.f44[2]=this.CreateImgLogo(ai_5,j13,2,new PointXY(0,0),ai_7,ai_6,a35,null,b7,b1);this.f44[2].src=c31+k25;this.e31(this.f44[2]);this.parent.appendChild(this.f44[2]);d43=(this.e11!=ah)?ai_6:ai_5;this.f44[LOGO_MAP_COPY]=this.CreateImgLogo(ai_5,j13,3,new PointXY(0,0),ai_7,d43,a35,null,a38,b1);this.f44[LOGO_MAP_COPY].src=c31+d8[1];this.e31(this.f44[LOGO_MAP_COPY]);this.parent.appendChild(this.f44[LOGO_MAP_COPY]);d43=(this.e11!=ag)?ai_6:ai_5;this.f44[LOGO_SAT_COPY]=this.CreateImgLogo(ai_5,j13,3,new PointXY(0,-a50),ai_7,d43,a35,null,b2,b1);this.f44[LOGO_SAT_COPY].src=c31+k1;this.e31(this.f44[LOGO_SAT_COPY]);this.parent.appendChild(this.f44[LOGO_SAT_COPY]);this.h33=this.div.attachEvent?c31+k24:k9;this.h46=this.div.attachEvent?c31+k12:j6;this.h37=this.h33;this.div.style.cursor=this.h37;this.div.e43=this.CreateParentDiv(j5,0,0,ai_7,0,0,null,null,null);this.div.appendChild(this.div.e43);this.div.d42=this.CreateParentDiv(j34,0,0,ai_7,0,0,null,null,null);this.div.appendChild(this.div.d42);this.div.e3=this.CreateParentDiv(j41,0,0,ai_7,0,0,null,null,null);this.div.appendChild(this.div.e3);this.div.e6=this.CreateParentDiv(k21,0,0,ai_7,0,0,a13,null,null);this.div.appendChild(this.div.e6);this.div.g27=this.CreateParentDiv(j9,0,0,ai_7,0,0,a6,null,null);this.div.g27.style.cursor=i47;this.div.g27.UNSELECTABLE=j31;this.div.appendChild(this.div.g27);this.RebuildTiles();};Map.prototype={GetZoom:function(f_0,f_1,f_2,f_3,f_4,f_5){var f_5=(typeof(f_5)!=k18)?f_5:this.getSize();if(f_2==null)f_2=false;if(f_3==null){f_3=1;}else{f_3=ak_1(f_3);if(f_3<1||f_3>a48){f_3=1;}}if(f_4==null){f_4=a44;}else{f_4=ak_1(f_4);if(f_4<1||f_4>a44){f_4=a44;}if(f_4<f_3){f_4=f_3+1;}}var zoom=f_3;var e46=f_4;var g21=new PointFloatXY((f_0.ul.lng+a40)*(d6/d34[zoom]),(f_0.ul.lat+a5)*(c7/d34[zoom]));var h8=new PointFloatXY((f_0.lr.lng+a40)*(d6/d34[zoom]),(f_0.lr.lat+a5)*(c7/d34[zoom]));var e33=new PointLL(f_0.ul.lat,f_0.ul.lng);var f24=new PointLL(f_0.lr.lat,f_0.lr.lng);var width=ak_6(f24.lng-e33.lng)*(d6/d34[zoom]);var height=ak_6(f24.lat-e33.lat)*(c7/d34[zoom]);if(f_2==true){var g46=new PointFloatXY((f_1.lng+a40)*(d6/d34[zoom]),(f_1.lat+a5)*(c7/d34[zoom]));var h20=ak_7(ak_6(g46.x-g21.x),ak_6(g46.x-h8.x));var e18=ak_7(ak_6(g46.y-g21.y),ak_6(g46.y-h8.y));width=h20*2;height=e18*2;}var f47=(this.f47<(f_5.width/2)&&this.f47<(f_5.height/2)?this.f47:Math.round(Math.min(((f_5.width/2)-1),((f_5.height/2)-1))));var scale=ak_7((d34[zoom]*(width/(f_5.width-(f47*2)))),(d34[zoom]*(height/(f_5.height-(f47*2)))));if(scale>d34[zoom]){return zoom;}while(scale<d34[zoom]&&zoom<=e46){zoom++;}return zoom-1;},GetPtLlCenter:function(f_0){var e33=new PointLL(f_0.ul.lat,f_0.ul.lng);var f24=new PointLL(f_0.lr.lat,f_0.lr.lng);var f16=new PointLL(((e33.lat+f24.lat)/a36),((e33.lng+f24.lng)/a36));return f16;},RebuildTiles:function(f_0){this.e25=this.centerlat;this.g17=this.centerlng;this.i2=h1(this.centerlng,this.scale);this.i0=e13(this.centerlat,this.scale);this.i3=h28(this.centerlng,this.scale);this.i1=this.g36-e44(this.centerlat,this.scale);this.h34=ak_4(this.i3);this.i6=ak_4(this.i1);this.h49=ak_1(this.width/2)-this.h34;this.h47=ak_1(this.height/2)-this.i6;this.h36=0;this.h35=0;while(this.h49<0){this.h49+=this.g36;this.h36--;this.i2++;};while(this.h47<0){this.h47+=this.g36;this.h35--;this.i0--;};while(this.h49>2*this.g36){this.h49-=this.g36;this.h36++;this.i2--;};while(this.h47>2*this.g36){this.h47-=this.g36;this.h35++;this.i0++;};this.h45=this.h49;this.h44=this.h47;while(this.h45>this.g36)this.h45-=this.g36;while(this.h44>this.g36)this.h44-=this.g36;this.h39=0;this.h38=0;this.i5=0;this.i4=0;this.h50=0;this.h48=0;this.h41=0;this.h40=0;this.h43=0;this.h42=0;this.e45=0;this.div.lt=0;this.div.tp=0;this.div.style.left=this.div.lt+ai_3;this.div.style.top=this.div.tp+ai_3;f_0=(typeof(f_0)==k18)?false:f_0;if(this.e22==null){this.e22=new mqz(this.f17);for(var a=0;a<this.f17;a++){this.e22[a]=new mqz(this.f1);for(var b=0;b<this.f1;b++){this.e22[a][b]=new Tile(this,this.div,(a-2)*this.g36+this.h49,(b-2)*this.g36+this.h47,this.i2-2+a,this.i0+2-b,this.scale,this.zoom,this.g36);}}}else{for(var a=0;a<this.f17;a++){for(var b=0;b<this.f1;b++){this.e22[a][b].f15();}}for(var a=0;a<this.f17;a++){for(var b=0;b<this.f1;b++){this.e22[a][b].e1((a-2)*this.g36+this.h49,(b-2)*this.g36+this.h47,this.i2-2+a,this.i0+2-b,this.scale,this.zoom,this.g36);}}}this.div.f42.tp=this.e22[0][0].tp;this.div.f42.lt=this.e22[0][0].lt;this.div.f42.style.top=h21(this.div.f42.tp);this.div.f42.style.left=h21(this.div.f42.lt);this.f44[1].childNodes[0].style.marginTop=-((this.zoom-1)*ak_1(this.f44[1].height))+ai_3;this.f44[LOGO_MAP_COPY].src=c31+d8[d13[this.zoom]];if(this.h0){this.g14+=b14;this.g13+=b14;}if(this.f4){this.f36+=b14;this.f35+=b14;}if(this.e23){this.g6+=b14;this.g5+=b14;}if(this.g48){this.f25.style.display=ai_5;this.g33();}if(!f_0&&this.f14){var y=this.f14.length;for(var x=0;x<y;x++){var e0=this.f14[x];var b48=this.GetLLToXY(e0.ll);e0.style.left=(b48.x+e0.offset.x-this.h39)+ai_3;e0.style.top=(b48.y+e0.offset.y-this.h38)+ai_3;}}},TilesExist:function(){return(this.e22!=null);},e31:function(f_0){var b18;var b32;if(f_0.corner==0){b18=0;b32=0;}else if(f_0.corner==1){b18=this.width-ak_1(f_0.width);b32=0;}else if(f_0.corner==2){b18=0;b32=this.height-ak_1(f_0.height);}else if(f_0.corner==3){b18=this.width-ak_1(f_0.width);b32=this.height-ak_1(f_0.height);}b18+=f_0.offset.x;b32+=f_0.offset.y;f_0.style.left=b18+ai_3;f_0.style.top=b32+ai_3;},SetLogoZindex:function(f_0,f_1){f_0=ak_1(f_0);f_1=ak_1(f_1);var g41=this.f44[f_0];if(g41.style){g41.style.zIndex=f_1;}},h14:function(f_0,f_1){if(this.e49==EVENT_CLICK){Event.stopObserving(this.parent,i22,this.e12);}else if(this.e49==EVENT_DBLCLICK){Event.stopObserving(this.parent,j25,this.e12);}this.e49=f_0;this.h15=f_1;if(this.e49==EVENT_CLICK){this.e12=MQEventCallback(this,i39);Event.observe(this.parent,i22,this.e12);}else if(this.e49==EVENT_DBLCLICK){this.e12=MQEventCallback(this,i15);Event.observe(this.parent,j25,this.e12);}},d40:function(f_0){if(this.h0&&this.g14>b16){this.g34.src=ak_8+c44+i21+(ak_1(this.g14*b9)/b8)+i25+(ak_1(this.g13*b9)/b8)+k13+this.scale+j12+this.e25+i23+this.g17+j26+Key+i48+ak_4(ak_5()*a0);this.g14=b16;this.g13=b16;}if(this.f4&&this.f36>b16){this.e2.src=ak_8+c44+j11+(ak_1(this.f36*b9)/b8)+i25+(ak_1(this.f35*b9)/b8)+k13+this.scale+j12+this.e25+i23+this.g17+j26+Key+i48+ak_4(ak_5()*a0);this.f36=b16;this.f35=b16;}if(this.e23&&this.g6>b16){this.e41.src=ak_8+c44+i9+(ak_1(this.g6*b9)/b8)+i25+(ak_1(this.g5*b9)/b8)+k13+this.scale+j12+this.e25+i23+this.g17+j26+Key+i48+ak_4(ak_5()*a0);this.g6=b16;this.g5=b16;}this.h41=0;this.h40=0;if(f_0!=null&&f_0==true)pause(a31);},g33:function(){var c1=e13(this.h27.ul.lat,this.scale);var c3=h1(this.h27.ul.lng,this.scale);var c41=e13(this.h27.lr.lat,this.scale);var c42=h1(this.h27.lr.lng,this.scale);this.h25=-1;this.d48=2;if(this.e22==null){this.RebuildTiles();}var b30=this.e22[0][0];var c37=this.e22[this.f17-1][this.f1-1];if(c3>b30.x&&c1<b30.y&&c42<c37.x&&c41>c37.y){this.h25=0;this.d48=-1;b30=this.e22[c3-b30.x][b30.y-c1];c37=this.e22[this.f17-1-(c37.x-c42)][this.f1-1-(c41-c37.y)];}var c32=h13(b30.y+this.h25*-1,a28,this.scale);var c2=d45(b30.x-1+this.h25*1,a28,this.scale);var d33=h13(c37.y-1+this.h25*1,a28,this.scale);var d5=d45(c37.x+this.h25*-1,a28,this.scale);var b34=(1+(c37.x+this.h25*-1)-(b30.x+this.h25*1))*this.g36;var c29=(1+(b30.y+this.h25*-1)-(c37.y+this.h25*1))*this.g36;this.h50=0;this.h48=0;if(this.zoom<3&&c2>b16&&this.centerlng<b16){c2-=a20;}var d37=!((c2>this.h27.lr.lng)||(d5<this.h27.ul.lng)||(d33>this.h27.ul.lat)||(c32<this.h27.lr.lat));if(this.h25==0||d37){this.f25.lt=(b30.lt+this.h25*this.g36+1);this.f25.tp=(b30.tp+this.h25*this.g36+1);this.f25.style.left=this.f25.lt+ai_3;this.f25.style.top=this.f25.tp+ai_3;this.f25.style.width=b34+ai_3;this.f25.style.height=c29+ai_3;if(this.f40.length>0){var c17=(c32+d33)/a36;var c9=(c2+d5)/a36;this.f25.src=this.g16+i42+this.f40+i13+c17+j38+c9+j38+(b34/a10)+j38+(c29/a10)+j38+this.scale+k11+i48+ak_4(ak_5()*a0);}else{this.f25.src=this.g16+i40+c32+k0+c2+k5+d33+i49+d5+j48+b34+i46+c29+k8+this.scale+i48+ak_4(ak_5()*a0);}}},e38:function(){this.f25.style.display=ai_6;},d38:function(f_0,f_1){this.g37=true;if(f_0!=0||f_1!=0)this.HandleMove(j20);if((f_0!=0||f_1!=0)&&this.d44)this.HandleDrag(j28);this.h39+=f_0;this.h38+=f_1;this.i5+=f_0;this.i4+=f_1;this.h43+=f_0;this.h42+=f_1;this.div.lt=this.div.lt+f_0;this.div.tp=this.div.tp+f_1;this.div.style.left=this.div.lt+ai_3;this.div.style.top=this.div.tp+ai_3;var b41=b16;while(this.i5+this.h45>d26){this.e22.unshift(this.e22.pop());for(var b=0;b<this.f1;b++){this.e22[0][b].f15();}for(var b=0;b<this.f1;b++){var ak_15=this.e22[0][b];var ak_16=this.e22[1][b];ak_15.e1(ak_16[this.e47].image.lt-this.g36,ak_15[this.e47].image.tp,ak_16.x-1,ak_15.y,this.scale,this.zoom);}this.i5-=this.g36;this.h50--;this.h41--;b41+=(this.f1-2);this.div.f42.lt-=d26;this.div.f42.style.left=h21(this.div.f42.lt);}while(this.i5+this.h45<0){this.e22.push(this.e22.shift());for(var b=0;b<this.f1;b++){this.e22[this.f17-1][b].f15();}for(var b=0;b<this.f1;b++){var ak_15=this.e22[this.f17-1][b];var ak_16=this.e22[this.f17-2][b];ak_15.e1(ak_16[this.e47].image.lt+this.g36,ak_15[this.e47].image.tp,ak_16.x+1,ak_15.y,this.scale,this.zoom);}this.i5+=this.g36;this.h50++;this.h41++;b41+=(this.f1-2);this.div.f42.lt+=d26;this.div.f42.style.left=h21(this.div.f42.lt);}while(this.i4+this.h44>d26){for(var a=0;a<this.f17;a++){this.e22[a].unshift(this.e22[a].pop());this.e22[a][0].f15();}for(var a=0;a<this.f17;a++){var ak_15=this.e22[a][0];var ak_16=this.e22[a][1];ak_15.e1(ak_15[this.e47].image.lt,ak_16[this.e47].image.tp-this.g36,ak_15.x,ak_16.y+1,this.scale,this.zoom);}this.i4-=this.g36;this.h48--;this.h40--;b41+=(this.f17-2);this.div.f42.tp-=d26;this.div.f42.style.top=h21(this.div.f42.tp);}while(this.i4+this.h44<0){for(var a=0;a<this.f17;a++){this.e22[a].push(this.e22[a].shift());this.e22[a][this.f1-1].f15();}for(var a=0;a<this.f17;a++){var ak_15=this.e22[a][this.f1-1];var ak_16=this.e22[a][this.f1-2];ak_15.e1(ak_15[this.e47].image.lt,ak_16[this.e47].image.tp+this.g36,ak_15.x,ak_16.y-1,this.scale,this.zoom);}this.i4+=this.g36;this.h48++;this.h40++;b41+=(this.f17-2);this.div.f42.tp+=d26;this.div.f42.style.top=h21(this.div.f42.tp);}if(this.h39>1*b25[this.zoom]*this.g36){this.h39-=b25[this.zoom]*this.g36;}if(this.h39<-1*b25[this.zoom]*this.g36){this.h39+=b25[this.zoom]*this.g36;}if(b41>b16){b41=b41/((this.f17-2)*(this.f1-2)*9);if(this.h0)this.g14+=b41;if(this.f4)this.f36+=b41;if(this.e23)this.g6+=b41;}if(ak_6(this.h40)>4||ak_6(this.h41)>4){this.d40();}var h12=ak_6(this.h39)%SURFACE_OFFSET;var h11=ak_6(this.h38)%SURFACE_OFFSET;var g12=ak_3(SURFACE_OFFSET/b13);if((h12>g12)&&this.e30){this.HandleOverlays();this.e30=false;};if((h11>g12)&&this.e29){this.HandleOverlays();this.e29=false;};if(h12<g12&&!this.e30)this.e30=true;if(h11<g12&&!this.e29)this.e29=true;if(this.g48&&(this.d48>0)&&(this.h48>=this.d48||this.h48<=this.d48*-1||this.h50>=this.d48||this.h50<=this.d48*-1)){this.f25.style.display=ai_5;this.g33();}},ak_18:function(f_0,f_1,f_2,f_3,f_4,f_5,f_6,f_7){var f13=f_5/f_6;var g45=ak_1(f13*f_3)-f_1;var g44=ak_1(f13*f_4)-f_2;this.d38(g45,g44);f_1+=g45;f_2+=g44;f_5++;if(f_5<=f_6){setTimeout(k28+f_0+i29+f_1+i29+f_2+i29+f_3+i29+f_4+i29+f_5+i29+f_6+i29+f_7+j17,f_7);}else{this.f43=false;this.g37=false;this.HandleMove(i26);}},f46:function(f_0){if(this.f14==null)return false;while(f_0!=null&&f_0!=this.parent){var j=this.f14.length;for(var i=0;i<j;i++){if(this.f14[i]==f_0)return true;}f_0=f_0.parentNode;}return false;},ak_9:function(event){if(this.g30){this.g30=false;this.HandleMove(i28);}if(this.f26){this.f26=false;this.HandleDrag(j40);}this.h32=false;this.HandleObjectDrag(event);if(!this.d44||this.g3)return;var f18=e50(this.parent);var h3=event.clientX-f18.x;var h2=event.clientY-f18.y;var g24=ak_1(this.width/2)-h3;var g23=ak_1(this.height/2)-h2;this.e25=h13(this.i0-this.h35,this.g36-this.i1+this.h38+g23,this.scale);this.g17=d45(this.i2+this.h36,this.i3-this.h39-g24,this.scale);var e17=h3-this.e8;var e16=h2-this.e7;this.e8=h3;this.e7=h2;this.d38(e17,e16);},ak_10:function(event){this.HandleObjectDrop(event);if(!this.d44||this.g3)return;this.h37=this.h33;this.div.style.cursor=this.h37;if(!this.h32){var f30=ak_6(this.h43-this.g31);var g8=ak_6(this.h42-this.g29);this.e45+=((f30*g8)+((this.width-f30)*g8)+((this.height-g8)*f30));var d39=((this.e45/(this.width*this.height))>=b15);if(this.h0&&d39){this.g13+=b14;this.e45=0;};if(this.f4&&d39){this.f35+=b14;this.e45=0;};if(this.e23&&d39){this.g5+=b14;this.e45=0;};}var f18=e50(this.parent);event.h3=event.clientX-f18.x;event.h2=event.clientY-f18.y;this.g30=false;if(this.g37){this.g37=false;this.HandleMove(i26);}this.f26=false;if(this.d44&&!this.h32){this.HandleDrag(k7,event);}this.HandleMouse(i31,event);Event.stop(event);this.d44=false},ak_12:function(event){this.div.style.cursor=this.h37;},ak_13:function(event){this.h32=true;if(this.f43||this.g3)return;if(this.f46(Event.element(event)))return;var f18=e50(this.parent);this.h37=this.h46;this.div.style.cursor=this.h37;var h3=event.clientX-f18.x;var h2=event.clientY-f18.y;this.g31=this.h43;this.g29=this.h42;this.e8=h3;this.e7=h2;this.d44=true;this.g30=true;this.f26=true;event.h3=h3;event.h2=h2;this.HandleMouse(i32,event);Event.stop(event);},ak_11:function(event){if(!event.relatedTarget&&!event.toElement)this.ak_10(event);},ak_14:function(event){this.e39(event,true);},dg_1:function(event){this.e39(event,false);},e39:function(event,f_0){if(this.d44||this.f43||(!this.h32&&f_0))return;this.h32=false;this.div.style.cursor=k15;var f18=e50(this.parent);var h3=(event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)))-f18.x;var h2=(event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop)))-f18.y;if(this.h15==OPER_RECENTER||this.zoom==a44){this.SlideMapToPoint(new PointXY(h3,h2));}else{var f5=this.GetXYToLL(new PointXY(h3,h2));this.SetCenterLatLngZoomLevel(f5,this.zoom+1);}this.div.style.cursor=this.h37;},e10:function(event){if(this.d44)return;if(event.wheelDelta>0&&this.zoom<a44){this.ZoomIn();}if(event.wheelDelta<0&&this.zoom>1){this.ZoomOut();}},d50:function(event){if(this.d44)return;key=event.which?event.which:event.keyCode;if(key==b6&&this.zoom<a44){this.ZoomIn();}if(key==b4&&this.zoom>1){this.ZoomOut();}},ZoomOut:function(){this.SetZoomLevel(this.zoom-1);},ZoomIn:function(){this.SetZoomLevel(this.zoom+1);},SetZoomLevel:function(f_0){f_0=ak_1(f_0);if(f_0<1||f_0>a44||this.d44||this.f43||f_0==this.zoom)return;var f5=this.GetCenterLatLng();this.d40();this.centerlat=f5.lat;this.centerlng=f5.lng;this.zoom=f_0;this.scale=d34[this.zoom];this.RebuildTiles();},GetZoomLevel:function(){return this.zoom;},GetScaleFromZoom:function(f_0){var i=(f_0)?(((f_0>=1)&&(f_0<=a44))?f_0:0):0;return d34[i];},SlideMapByOffset:function(f_0){if(this.f43)return;this.HandleMove(i28);this.f43=true;setTimeout(k28+this.g26+j2+f_0.x+i29+f_0.y+j8+b45+i29+d14+j17,d14);var f30=ak_6(f_0.x);var g8=ak_6(f_0.y);this.e45+=((f30*g8)+((this.width-f30)*g8)+((this.height-g8)*f30));var d39=((this.e45/(this.width*this.height))>=b15);if(this.h0&&d39){this.g13+=b14;this.e45=0;};if(this.f4&&d39){this.f35+=b14;this.e45=0;};if(this.e23&&d39){this.g5+=b14;this.e45=0;};},SlideMapToPoint:function(f_0){if(this.f43)return;this.HandleMove(i28);var g24=ak_1(this.width/2)-f_0.x;var g23=ak_1(this.height/2)-f_0.y;this.f43=true;setTimeout(k28+this.g26+j2+g24+i29+g23+j8+b45+i29+d14+j17,d14);var f30=ak_6(g24);var g8=ak_6(g23);this.e45+=((f30*g8)+((this.width-f30)*g8)+((this.height-g8)*f30));var d39=((this.e45/(this.width*this.height))>=b15);if(this.h0&&d39){this.g13+=b14;this.e45=0;};if(this.f4&&d39){this.f35+=b14;this.e45=0;};if(this.e23&&d39){this.g5+=b14;this.e45=0;};},PanNorth:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2),ak_1(this.height/2)-ak_1(this.height*(f_0/b11))));},PanSouth:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2),ak_1(this.height/2)+ak_1(this.height*(f_0/b11))));},PanEast:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2)+ak_1(this.width*(f_0/b11)),ak_1(this.height/2)));},PanWest:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2)-ak_1(this.width*(f_0/b11)),ak_1(this.height/2)));},PanNorthWest:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2)-ak_1(this.width*(f_0/b11)),ak_1(this.height/2)-ak_1(this.height*(f_0/b11))));},PanSouthWest:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2)-ak_1(this.width*(f_0/b11)),ak_1(this.height/2)+ak_1(this.height*(f_0/b11))));},PanNorthEast:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2)+ak_1(this.width*(f_0/b11)),ak_1(this.height/2)-ak_1(this.height*(f_0/b11))));},PanSouthEast:function(f_0){this.SlideMapToPoint(new PointXY(ak_1(this.width/2)+ak_1(this.width*(f_0/b11)),ak_1(this.height/2)+ak_1(this.height*(f_0/b11))));},SetCenterLatLng:function(f_0){this.centerlat=ak_1(f_0.lat*b9)/b8;this.centerlng=ak_1(f_0.lng*b9)/b8;this.d40();this.RebuildTiles();},SetCenterLatLngZoomLevel:function(f_0,f_1){f_1=ak_1(f_1);this.centerlat=ak_1(f_0.lat*b9)/b8;this.centerlng=ak_1(f_0.lng*b9)/b8;if(f_1<1){f_1=1;}if(f_1>a44){f_1=a44;}this.zoom=f_1;this.scale=d34[f_1];this.d40();this.RebuildTiles();},SetCenterXY:function(f_0){var g24=ak_1(this.width/2)-f_0.x;var g23=ak_1(this.height/2)-f_0.y;this.centerlat=h13(this.i0-this.h35,this.g36-this.i1+this.h38+g23,this.scale);this.centerlng=d45(this.i2+this.h36,this.i3+this.h39-g24,this.scale);this.d40();this.RebuildTiles();},GetCenterLatLng:function(){var ll=new PointLL(0,0);ll.lat=h13(this.i0-this.h35,this.g36-this.i1+this.h38,this.scale);ll.lng=d45(this.i2+this.h36,this.i3-this.h39,this.scale);return ll;},GetLLToXY:function(f_0){var h29=new PointXY(0,0);var g39=h1(f_0.lng,this.scale);var g38=e13(f_0.lat,this.scale);var g11=h28(f_0.lng,this.scale);var g9=this.g36-e44(f_0.lat,this.scale);h29.x=ak_1(this.width/2)-((this.i2+this.h36-g39)*this.g36)-(this.i3-this.h39-g11);h29.y=ak_1(this.height/2)+((this.i0-this.h35-g38)*this.g36)-(this.i1-this.h38-g9);h29.x=ak_1(h29.x);h29.y=ak_1(h29.y);return h29;},GetXYToLL:function(f_0){var g24=ak_1(this.width/2)-f_0.x;var g23=ak_1(this.height/2)-f_0.y;var ll=new PointLL(b16,b16);ll.lat=h13(this.i0-this.h35,this.g36-this.i1+this.h38+g23,this.scale);ll.lng=d45(this.i2+this.h36,this.i3-this.h39-g24,this.scale);return ll;},ResizeMap:function(f_0){if(f_0.width==this.width&&f_0.height==this.height)return;var f5=this.GetCenterLatLng();this.width=ak_1(f_0.width);this.height=ak_1(f_0.height);if(this.width>b38)this.width=b38;if(this.height>c30)this.height=c30;this.centerlat=f5.lat;this.centerlng=f5.lng;this.f1=ak_3(this.height/this.g36)+2;this.f17=ak_3(this.width/this.g36)+2;this.d44=false;this.f43=false;this.parent.style.width=this.width+ai_3;this.parent.style.height=this.height+ai_3;var j=this.f44.length;for(i=0;i<j;i++){this.e31(this.f44[i]);}this.e22=null;while(this.div.e43.hasChildNodes())this.div.e43.removeChild(this.div.e43.firstChild);while(this.div.d42.hasChildNodes())this.div.d42.removeChild(this.div.d42.firstChild);while(this.div.e3.hasChildNodes())this.div.e3.removeChild(this.div.e3.firstChild);this.div.f42.style.width=(this.f17*d26)+ai_3;this.div.f42.style.height=(this.f1*d26)+ai_3;this.d40();this.RebuildTiles();},AddRouteHighlight:function(f_0,f_1,f_2,f_3,f_4,f_5,f_6){this.h27=f_0;this.g16=f_1;if(f_2==null){this.f40=j0;}else{this.f40=f_2.toString();}if(this.h27.ul.lat<this.h27.lr.lat){var f9=this.h27.ul.lat;this.h27.ul.lat=this.h27.lr.lat;this.h27.lr.lat=f9;}if(this.h27.ul.lng>this.h27.lr.lng){var g50=this.h27.ul.lng;this.h27.ul.lng=this.h27.lr.lng;this.h27.lr.lng=g50;}this.g48=true;if(f_3==null||f_3==false){this.g33();}else{if(f_4==null)f_4=false;if(f_5==null)f_5=1;if(f_6==null)f_6=a44;this.BestFitRoute(f_4,f_5,f_6);}},RemoveRouteHighlight:function(){this.g48=false;this.h27=null;this.f25.style.display=ai_5;this.f40=j0;},SetRouteBestFit:function(f_0){this.d41=f_0;},IsRouteBestFit:function(){return this.d41;},SetRouteSession:function(f_0){this.f40=f_0;},GetRouteSession:function(){return this.f40;},SetRouteServer:function(f_0){this.g16=f_0;},GetRouteServer:function(){return this.g16;},AddPOI:function(f_0,f_1,f_2){if(this.f14==null){this.f14=new mqz();}var h29=this.GetLLToXY(f_0);f_2.ll=f_0;f_2.offset=f_1;f_2.style.position=ai_7;f_2.style.zIndex=a6;f_2.style.left=(h29.x+f_1.x-this.h39)+ai_3;f_2.style.top=(h29.y+f_1.y-this.h38)+ai_3;f_2.oncontextmenu=function(){return false;};this.f14.push(f_2);this.div.g27.appendChild(f_2);},UpdatePOI:function(f_0,f_1,f_2){if(this.f14==null)return;var f37=false;var j=this.f14.length;for(var i=0;i<j;i++){if(this.f14[i]==f_2){f37=true;}}if(f37){var h29=this.GetLLToXY(f_0);f_2.ll=f_0;f_2.offset=f_1;f_2.style.left=(h29.x+f_1.x-this.h39)+ai_3;f_2.style.top=(h29.y+f_1.y-this.h38)+ai_3;}},RemovePOI:function(f_0){var f48=[];if(this.f14==null)return;var j=this.f14.length;for(var i=0;i<j;i++){if(this.f14[i]!=f_0){f48.push(this.f14[i]);}else{if(this.div.g27.childNodes.length>0){this.div.g27.removeChild(this.f14[i]);}}}this.f14.clear();this.f14=null;var k=f48.length;for(var i=0;i<k;i++){if(this.f14==null)this.f14=new mqz();this.f14.push(f48[i]);}f48=null;},ClearPOIs:function(){if(this.f14==null)return;var j=this.f14.length;for(var i=0;i<j;i++){this.div.g27.removeChild(this.f14[i]);}this.f14=null;},AppendOverlayDiv:function(f_0){this.div.d46=f_0;this.div.appendChild(this.div.d46);},GetTileSize:function(){return d26;},GetLoadingDiv:function(){return this.div.f42;},GetMapDiv:function(){return this.div.e43;},GetStaticMapDiv:function(){return this.div.e6;},GetOverlayDiv:function(){return this.div.d46;},GetPoiDiv:function(){return this.div.g27;},BestFit:function(f_0,f_1,f_2,f_3){var g21,h8,e33,f24,zoom,g40;if(f_1==null)f_1=false;if(f_2==null){zoom=1;}else{f_2=ak_1(f_2);if(f_2<1||f_2>a48){zoom=1;}else{zoom=f_2+1;}}if(f_3==null){g40=a44;}else{f_3=ak_1(f_3);if(f_3<1||f_3>a44){g40=a44;}else{g40=f_3;}if(g40<zoom)g40=zoom+1;}if(f_0.ul.x){g21=new PointXY(f_0.ul.x,f_0.ul.y);h8=new PointXY(f_0.lr.x,f_0.lr.y);e33=this.GetXYToLL(new PointXY(f_0.ul.x,f_0.ul.y));f24=this.GetXYToLL(new PointXY(f_0.lr.x,f_0.lr.y));}else{g21=this.GetLLToXY(new PointLL(f_0.ul.lat,f_0.ul.lng));h8=this.GetLLToXY(new PointLL(f_0.lr.lat,f_0.lr.lng));e33=new PointLL(f_0.ul.lat,f_0.ul.lng);f24=new PointLL(f_0.lr.lat,f_0.lr.lng);}var width=ak_6(f24.lng-e33.lng)*(d6/this.scale);var height=ak_6(f24.lat-e33.lat)*(c7/this.scale);if(f_1==true){var g46=this.GetLLToXY(this.GetCenterLatLng());var h20=ak_7(ak_6(g46.x-g21.x),ak_6(g46.x-h8.x));var e18=ak_7(ak_6(g46.y-g21.y),ak_6(g46.y-h8.y));width=h20*2;height=e18*2;}var f47=(this.f47<(this.width/2)&&this.f47<(this.height/2)?this.f47:Math.round(Math.min(((this.width/2)-1),((this.height/2)-1))));var scale=ak_7((this.scale*(width/(this.width-(f47*2)))),(this.scale*(height/(this.height-(f47*2)))));while(scale<d34[zoom]&&zoom<=g40)zoom++;if(f_1==true){this.SetZoomLevel((zoom-1));}else{this.SetCenterLatLngZoomLevel(new PointLL(((e33.lat+f24.lat)/a36),((e33.lng+f24.lng)/a36)),(zoom-1));}},BestFitPOIs:function(f_0,f_1,f_2){if(this.f14==null)return;if(f_0==null)f_0=false;if(f_1==null)f_1=1;if(f_2==null)f_2=a44;var f20=new RectLL(new PointLL(this.f14[0].ll.lat,this.f14[0].ll.lng),new PointLL(this.f14[0].ll.lat,this.f14[0].ll.lng));var j=this.f14.length;for(var i=1;i<j;i++){var e35=this.f14[i].ll;if(e35.lat>f20.ul.lat)f20.ul.lat=e35.lat;if(e35.lng<f20.ul.lng)f20.ul.lng=e35.lng;if(e35.lat<f20.lr.lat)f20.lr.lat=e35.lat;if(e35.lng>f20.lr.lng)f20.lr.lng=e35.lng;}this.BestFit(f20,f_0,f_1,f_2);},BestFitRoute:function(f_0,f_1,f_2){if(this.h27){if(f_0==null)f_0=false;if(f_1==null)f_1=1;if(f_2==null)f_2=a44;this.BestFit(this.h27,f_0,f_1,f_2);}},GetTileMode:function(){return this.e11;},SetTileMode:function(f_0,f_1){if(f_0==ag||f_0==ah||f_0==ai&&(this.e11!=f_0)){this.d40();this.h0=false;this.f4=false;this.e23=false;this.div.e43.style.display=ai_5;this.div.d42.style.display=ai_5;this.div.e3.style.display=ai_5;if(f_0==ag){this.h0=true;this.div.e43.style.display=ai_6;this.f44[LOGO_MAP_COPY].style.display=ai_6;this.f44[LOGO_SAT_COPY].style.display=ai_5;this.e47="mag";}if(f_0==ah){this.f4=true;this.div.d42.style.display=ai_6;this.f44[LOGO_MAP_COPY].style.display=ai_5;this.f44[LOGO_SAT_COPY].style.display=ai_6;this.e47="mah";}if(f_0==ai){this.f4=true;this.e23=true;this.div.d42.style.display=ai_6;this.div.e3.style.display=ai_6;this.f44[LOGO_MAP_COPY].style.display=ai_6;this.f44[LOGO_SAT_COPY].style.display=ai_6;this.e47="mai";}this.e11=f_0;f_1=(typeof(f_1)==k18)?false:f_1;if(!f_1){var f5=this.GetCenterLatLng();this.centerlat=f5.lat;this.centerlng=f5.lng;this.RebuildTiles();}}},SetLogoPlacement:function(f_0,f_1,f_2){f_0=ak_1(f_0);f_1=ak_1(f_1);if(f_0>=0&&f_0<=LOGO_SAT_COPY&&f_1>=0&&f_1<=3){this.f44[f_0].corner=f_1;this.f44[f_0].offset=f_2;this.e31(this.f44[f_0]);}},GetLogoPlacement:function(f_0){f_0=ak_1(f_0);if(f_0>=0&&f_0<=LOGO_SAT_COPY){var f6=new Object();f6.corner=this.f44[f_0].corner;f6.offset=new PointXY(this.f44[f_0].offset.x,this.f44[f_0].offset.y);return f6;}},SetClickOperation:function(f_0,f_1){f_0=ak_1(f_0);f_1=ak_1(f_1);if(f_0>=EVENT_NONE&&f_0<=EVENT_DBLCLICK&&f_1>=OPER_RECENTER&&f_1<=OPER_RECENTERZOOM){this.h14(f_0,f_1);}},DisableDragging:function(f_0){this.g3=(f_0==true);},GetDraggingState:function(){return this.g3;},GetLatitudeDegreesPerPixel:function(scale){return(c7/scale);},GetLongitudeDegreesPerPixel:function(scale){return(d6/scale);},HandleMove:function(){},HandleDrag:function(){},HandleMouse:function(){},HandleOverlays:function(){},HandleObjectDrag:function(){},HandleObjectDrop:function(){},GetClickFlag:function(){return(this.h32)?this.h32:false;},GetDragOffset:function(){return new MQPoint(this.h39,this.h38);},GetRouteRect:function(){return this.h27;},SetRouteRect:function(f_0){this.h27=f_0;},GetBestFitRect:function(){return this.g49;},SetBestFitRect:function(f_0){this.g49=f_0;},IsKeepCenter:function(){return this.e20;},SetKeepCenter:function(f_0){this.e20=f_0;},h31:function(src,unselectable,f_0,display,f_1){var e48=document.createElement(i8);if(src!=null)e48.src=src;e48.unselectable=unselectable;e48.style.MozUserSelect=f_0;e48.style.display=display;if(f_1!=null)e48.style.zIndex=f_1;return e48;},CreateImgLogo:function(f_0,unselectable,corner,offset,position,display,f_1,src,width,height){var h17=document.createElement(i8);h17.style.MozUserSelect=f_0;h17.unselectable=unselectable;h17.corner=corner;h17.offset=offset;h17.style.position=position;h17.style.display=display;h17.style.zIndex=f_1;if(width!=null)h17.width=width;if(height!=null)h17.height=height;return h17;},CreateParentDiv:function(id,lt,tp,position,top,left,f_0,width,height){e19=document.createElement(j37);e19.id=id;e19.lt=lt;e19.tp=tp;e19.style.position=position;e19.style.top=top+ai_3;e19.style.left=left+ai_3;if(f_0!=null)e19.style.zIndex=f_0;if(width!=null)e19.style.width=width+ai_3;if(height!=null)e19.style.height=height+ai_3;return e19;},SetBestFitMargin:function(f_0){this.f47=f_0;},GetBestFitMargin:function(){return this.f47;}};document.write("<link rel='stylesheet' href='http://btilelog.access.mapquest.com/tilelog/transaction?transaction=script&key=mjtd%7Clu6y2d6121%2Crs%3Do5-0w7aq&v=5.2.0&itkcss=true 'type='text/css'  charset='iso-8859-1'/>");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 browser=new MQBrowser();browser.name=browser.version=browser.os="unknown";var userAgent=window.navigator.userAgent.toLowerCase();var appname=window.navigator.appName;var appVersion=window.navigator.appVersion;var browserListArray=new Array("firefox","msie","netscape","opera","safari");var osListArray=new Array("linux","mac","windows","x11");var browserListlength=browserListArray.length;var strPosition="";for(var i=0,n=browserListlength;i<n;i++)
{strPosition=userAgent.indexOf(browserListArray[i])+1;if(strPosition>0)
{browser.name=browserListArray[i];var versionPosition=strPosition+browser.name.length;var incr=((browser.name=="safari")||(userAgent.charAt(versionPosition+4)>0&&userAgent.charAt(versionPosition+4)<9))?5:3;browser.version=userAgent.substring(versionPosition,versionPosition+incr);}}
var osListArrayLength=osListArray.length;for(var j=0,m=osListArrayLength;j<m;j++)
{strPosition=userAgent.indexOf(osListArray[j])+1;if(strPosition>0)
{browser.os=osListArray[j];}}
if(appname=="Netscape")
browser.appname="ns";else if(appname=="Microsoft Internet Explorer")
browser.appname="ie";browser.appVersion=appVersion;browser.vMajor=parseInt(browser.appVersion);browser.isNS=(browser.appname=="ns"&&browser.vMajor>=4);browser.isNS4=(browser.appname=="ns"&&browser.vMajor==4);browser.isNS6=(browser.appname=="ns"&&browser.vMajor==5);browser.isIE=(browser.appname=="ie"&&browser.vMajor>=4);browser.isIE4=(browser.appVersion.indexOf('MSIE 4')>0);browser.isIE5=(browser.appVersion.indexOf('MSIE 5')>0);browser.isDOM=(document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;browser.isSafari=(browser.name=="safari");if(userAgent.indexOf("win")>-1)
browser.platform="win";else if(userAgent.indexOf("mac")>-1)
browser.platform="mac";else
browser.platform="other";return browser;}
var mqBrowserInfo=mqGetBrowserInfo();function MQObject(){var m_xmlDoc=null;this.getM_XmlDoc=function(){return m_xmlDoc;};this.setM_XmlDoc=function(xmlDoc){m_xmlDoc=xmlDoc;};var m_xpath=null;this.getM_Xpath=function(){return m_xpath;};this.setM_Xpath=function(xpath){m_xpath=xpath;};}
MQObject.prototype.getClassName=function(){return"MQObject";};MQObject.prototype.getObjectVersion=function(){return 0;};MQObject.prototype.setProperty=function(strPropName,strPropValue){var strXPathExpression;if(strPropName!==null)strXPathExpression="/"+this.getM_Xpath()+"/"+strPropName;else strXPathExpression="/"+this.getM_Xpath();var ndNewProp=mqSetNodeText(this.getM_XmlDoc(),strXPathExpression,strPropValue);if(ndNewProp===null){var ndNewPropParent=this.getM_XmlDoc().createElement(strPropName);var ndRoot=this.getM_XmlDoc().documentElement.appendChild(ndNewPropParent);ndNewProp=mqSetNodeText(this.getM_XmlDoc(),strXPathExpression,strPropValue);}
return ndNewProp;};MQObject.prototype.getProperty=function(strPropName){var strXPathExpression;if(strPropName!==null)strXPathExpression="/"+this.getM_Xpath()+"/"+strPropName;else strXPathExpression="/"+this.getM_Xpath();return mqGetXPathNodeText(this.getM_XmlDoc(),strXPathExpression);};MQObject.prototype.copy=function(){var cp=new this.constructor;cp.loadXml(this.saveXml());return cp;};MQObject.prototype.internalCopy=function(obj){var strXml="<"+obj.getM_Xpath();if(this.getObjectVersion()>0){strXml=strXml+" Version=\""+this.getObjectVersion()+"\"";}
strXml=strXml+">";var root=this.getM_XmlDoc().documentElement;var nodes=root.childNodes;var maxCount=nodes.length;for(var count=0;count<maxCount;count++){strXml=strXml+mqXmlToStr(nodes[count]);}
strXml=strXml+"</"+obj.getM_Xpath()+">";var cp=new this.constructor;cp.loadXml(strXml);return cp;};MQPoint.prototype=new MQObject();MQPoint.prototype.constructor=MQPoint;function MQPoint(param1,param2){MQObject.call(this);this.x=0;this.y=0;this.setM_Xpath("Point");if(arguments.length==1){this.setM_Xpath(param1);}
else if(arguments.length==2){this.x=parseInt(param1);this.y=parseInt(param2);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(strXml){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(mqCreateXMLDoc(strXml));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(x){this.x=parseInt(x);if(isNaN(this.x))
throw new Error("MQPoint.setX called with invalid parameter");};MQPoint.prototype.getX=function(){return this.x;};MQPoint.prototype.setY=function(y){this.y=parseInt(y);if(isNaN(this.y))
throw new Error("MQPoint.setY called with invalid parameter");};MQPoint.prototype.getY=function(){return this.y;};MQPoint.prototype.setXY=function(x,y){this.x=parseInt(x);this.y=parseInt(y);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(pt){if(pt){return(this.x===pt.x&&this.y===pt.y);}
return false;};MQPoint.prototype.toString=function(){return this.x+","+this.y;};MQLatLng.prototype=new MQObject();MQLatLng.prototype.constructor=MQLatLng;function MQLatLng(param1,param2){MQObject.call(this);this.lat=0.0;this.lng=0.0;this.setM_Xpath("LatLng");if(arguments.length==1){this.setM_Xpath(param1);}
else if(arguments.length==2){this.lat=parseFloat(param1);this.lng=parseFloat(param2);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(strXml){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(mqCreateXMLDoc(strXml));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(fLatitude){this.lat=parseFloat(fLatitude);if(isNaN(this.lat))
throw new Error("MQLatLng.setLatitude called with invalid parameter");};MQLatLng.prototype.getLatitude=function(){return this.lat;};MQLatLng.prototype.setLongitude=function(fLongitude){this.lng=parseFloat(fLongitude);if(isNaN(this.lng))
throw new Error("MQLatLng.setLongitude called with invalid parameter");};MQLatLng.prototype.getLongitude=function(){return this.lng;};MQLatLng.prototype.setLatLng=function(fLatitude,fLongitude){this.lat=parseFloat(fLatitude);this.lng=parseFloat(fLongitude);if(isNaN(this.lat)||isNaN(this.lng))
throw new Error("MQLatLng.setLatLng called with invalid parameter");};MQLatLng.prototype.arcDistance=function(ll2,lUnits){if("undefined"!==typeof(mqutils)){if(ll2){if(ll2.getClassName()!=="MQLatLng"){alert("failure in arcDistance");throw"failure in arcDistance";}}else{alert("failure in arcDistance");throw"failure in arcDistance";}
if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(this.getLatitude()==ll2.getLatitude()&&this.getLongitude()==ll2.getLongitude()){return 0.0;}
var dLon=ll2.getLongitude()-this.getLongitude();var a=MQCONSTANT.MQLATLNG_RADIANS*(90.0-this.getLatitude());var c=MQCONSTANT.MQLATLNG_RADIANS*(90.0-ll2.getLatitude());var cosB=(Math.cos(a)*Math.cos(c))+(Math.sin(a)*Math.sin(c)*Math.cos(MQCONSTANT.MQLATLNG_RADIANS*(dLon)));var radius=(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_MILES)?3963.205:6378.160187;if(cosB<-1.0)
return MQCONSTANT.PI*radius;else if(cosB>=1.0)
return 0;else
return Math.acos(cosB)*radius;}
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(ll){if(ll!==null){return(this.getLongitude()===ll.getLongitude()&&this.getLatitude()===ll.getLatitude());}
return false;};MQLatLng.prototype.toString=function(){return this.lat+","+this.lng;};function mqCreateXMLDoc(strXML){var newDoc;if(document.implementation.createDocument){var parser=new window.DOMParser();if(mqBrowserInfo.isSafari)
strXML=strXML.replace(/&/g,'&amp;');newDoc=parser.parseFromString(strXML,"text/xml");}else if(window.ActiveXObject){newDoc=new window.ActiveXObject("Microsoft.XMLDOM");newDoc.async="false";newDoc.loadXML(strXML);}
return newDoc;}
function mqCreateXMLDocFromNode(ndNewRoot){var newDoc;ndNewRoot=ndNewRoot.documentElement;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 MQXMLDOC(){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=mqCreateXMLDoc("<AutoGeocodeCovSwitch/>");return this.AUTOGEOCODECOVSWITCH;}
this.getAUTOROUTECOVSWITCH=function(){if(this.AUTOROUTECOVSWITCH===null)
this.AUTOROUTECOVSWITCH=mqCreateXMLDoc("<AutoRouteCovSwitch><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></AutoRouteCovSwitch>");return this.AUTOROUTECOVSWITCH;}
this.getAUTOMAPCOVSWITCH=function(){if(this.AUTOMAPCOVSWITCH===null)
this.AUTOMAPCOVSWITCH=mqCreateXMLDoc("<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=mqCreateXMLDoc("<DBLayerQuery/>");return this.DBLAYERQUERY;}
this.getLINEPRIMITIVE=function(){if(this.LINEPRIMITIVE===null)
this.LINEPRIMITIVE=mqCreateXMLDoc("<LinePrimitive Version=\"2\"/>");return this.LINEPRIMITIVE;}
this.getPOLYGONPRIMITIVE=function(){if(this.POLYGONPRIMITIVE===null)
this.POLYGONPRIMITIVE=mqCreateXMLDoc("<PolygonPrimitive Version=\"2\"/>");return this.POLYGONPRIMITIVE;}
this.getRECTANGLEPRIMITIVE=function(){if(this.RECTANGLEPRIMITIVE===null)
this.RECTANGLEPRIMITIVE=mqCreateXMLDoc("<RectanglePrimitive Version=\"2\"/>");return this.RECTANGLEPRIMITIVE;}
this.getELLIPSEPRIMITIVE=function(){if(this.ELLIPSEPRIMITIVE===null)
this.ELLIPSEPRIMITIVE=mqCreateXMLDoc("<EllipsePrimitive Version=\"2\"/>");return this.ELLIPSEPRIMITIVE;}
this.getTEXTPRIMITIVE=function(){if(this.TEXTPRIMITIVE===null)
this.TEXTPRIMITIVE=mqCreateXMLDoc("<TextPrimitive Version=\"2\"/>");return this.TEXTPRIMITIVE;}
this.getSYMBOLPRIMITIVE=function(){if(this.SYMBOLPRIMITIVE===null)
this.SYMBOLPRIMITIVE=mqCreateXMLDoc("<SymbolPrimitive Version=\"2\"/>");return this.SYMBOLPRIMITIVE;}
this.getLATLNG=function(){if(this.LATLNG===null)
this.LATLNG=mqCreateXMLDoc("<LatLng/>");return this.LATLNG;}
this.getPOINT=function(){if(this.POINT===null)
this.POINT=mqCreateXMLDoc("<Point/>");return this.POINT;}
this.getPOINTFEATURE=function(){if(this.POINTFEATURE===null)
this.POINTFEATURE=mqCreateXMLDoc("<PointFeature/>");return this.POINTFEATURE;}
this.getLINEFEATURE=function(){if(this.LINEFEATURE===null)
this.LINEFEATURE=mqCreateXMLDoc("<LineFeature/>");return this.LINEFEATURE;}
this.getPOLYGONFEATURE=function(){if(this.POLYGONFEATURE===null)
this.POLYGONFEATURE=mqCreateXMLDoc("<PolygonFeature/>");return this.POLYGONFEATURE;}
this.getLOCATION=function(){if(this.LOCATION===null)
this.LOCATION=mqCreateXMLDoc("<Location/>");return this.LOCATION;}
this.getADDRESS=function(){if(this.ADDRESS===null)
this.ADDRESS=mqCreateXMLDoc("<Address/>");return this.ADDRESS;}
this.getSINGLELINEADDRESS=function(){if(this.SINGLELINEADDRESS===null)
this.SINGLELINEADDRESS=mqCreateXMLDoc("<SingleLineAddress/>");return this.SINGLELINEADDRESS;}
this.getGEOADDRESS=function(){if(this.GEOADDRESS===null)
this.GEOADDRESS=mqCreateXMLDoc("<GeoAddress/>");return this.GEOADDRESS;}
this.getGEOCODEOPTIONS=function(){if(this.GEOCODEOPTIONS===null)
this.GEOCODEOPTIONS=mqCreateXMLDoc("<GeocodeOptions/>");return this.GEOCODEOPTIONS;}
this.getMANEUVER=function(){if(this.MANEUVER===null)
this.MANEUVER=mqCreateXMLDoc("<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=mqCreateXMLDoc("<RouteOptions Version=\"3\"><RouteType>0</RouteType><NarrativeType>1</NarrativeType><NarrativeDistanceUnitType>0</NarrativeDistanceUnitType><MaxShape>0</MaxShape><MaxGEFID>0</MaxGEFID><Language>English</Language><CoverageName>navt_r</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=mqCreateXMLDoc("<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=mqCreateXMLDoc("<RouteMatrixResults/>");return this.ROUTEMATRIXRESULTS;}
this.getRADIUSSEARCHCRITERIA=function(){if(this.RADIUSSEARCHCRITERIA===null)
this.RADIUSSEARCHCRITERIA=mqCreateXMLDoc("<RadiusSearchCriteria/>");return this.RADIUSSEARCHCRITERIA;}
this.getRECTSEARCHCRITERIA=function(){if(this.RECTSEARCHCRITERIA===null)
this.RECTSEARCHCRITERIA=mqCreateXMLDoc("<RectSearchCriteria/>");return this.RECTSEARCHCRITERIA;}
this.getPOLYSEARCHCRITERIA=function(){if(this.POLYSEARCHCRITERIA===null)
this.POLYSEARCHCRITERIA=mqCreateXMLDoc("<PolySearchCriteria/>");return this.POLYSEARCHCRITERIA;}
this.getCORRIDORSEARCHCRITERIA=function(){if(this.CORRIDORSEARCHCRITERIA===null)
this.CORRIDORSEARCHCRITERIA=mqCreateXMLDoc("<CorridorSearchCriteria/>");return this.CORRIDORSEARCHCRITERIA;}
this.getSIGN=function(){if(this.SIGN===null)
this.SIGN=mqCreateXMLDoc("<Sign><Type>0</Type><Text></Text><ExtraText></ExtraText><Direction>0</Direction></Sign>");return this.SIGN;}
this.getTREKROUTE=function(){if(this.TREKROUTE===null)
this.TREKROUTE=mqCreateXMLDoc("<TrekRoute><Maneuvers Count=\"0\"/></TrekRoute>");return this.TREKROUTE;}
this.getINTCOLLECTION=function(){if(this.INTCOLLECTION===null)
this.INTCOLLECTION=mqCreateXMLDoc("<IntCollection Count=\"0\"/>");return this.INTCOLLECTION;}
this.getDTCOLLECTION=function(){if(this.DTCOLLECTION===null)
this.DTCOLLECTION=mqCreateXMLDoc("<DTCollection Version=\"1\" Count=\"0\"/>");return this.DTCOLLECTION;}
this.getLATLNGCOLLECTION=function(){if(this.LATLNGCOLLECTION===null)
this.LATLNGCOLLECTION=mqCreateXMLDoc("<LatLngCollection Version=\"1\" Count=\"0\"/>");return this.LATLNGCOLLECTION;}
this.getLOCATIONCOLLECTION=function(){if(this.LOCATIONCOLLECTION===null)
this.LOCATIONCOLLECTION=mqCreateXMLDoc("<LocationCollection Count=\"0\"/>");return this.LOCATIONCOLLECTION;}
this.getLOCATIONCOLLECTIONCOLLECTION=function(){if(this.LOCATIONCOLLECTIONCOLLECTION===null)
this.LOCATIONCOLLECTIONCOLLECTION=mqCreateXMLDoc("<LocationCollectionCollection Count=\"0\"/>");return this.LOCATIONCOLLECTIONCOLLECTION;}
this.getMANEUVERCOLLECTION=function(){if(this.MANEUVERCOLLECTION===null)
this.MANEUVERCOLLECTION=mqCreateXMLDoc("<ManeuverCollection Count=\"0\"/>");return this.MANEUVERCOLLECTION;}
this.getSIGNCOLLECTION=function(){if(this.SIGNCOLLECTION===null)
this.SIGNCOLLECTION=mqCreateXMLDoc("<SignCollection Count=\"0\"/>");return this.SIGNCOLLECTION;}
this.getSTRINGCOLLECTION=function(){if(this.STRINGCOLLECTION===null)
this.STRINGCOLLECTION=mqCreateXMLDoc("<StringCollection Count=\"0\"/>");return this.STRINGCOLLECTION;}
this.getSTRCOLCOLLECTION=function(){if(this.STRCOLCOLLECTION===null)
this.STRCOLCOLLECTION=mqCreateXMLDoc("<StrColCollectin/>");return this.STRCOLCOLLECTION;}
this.getFEATURECOLLECTION=function(){if(this.FEATURECOLLECTION===null)
this.FEATURECOLLECTION=mqCreateXMLDoc("<FeatureCollection Count=\"0\"/>");return this.FEATURECOLLECTION;}
this.getPRIMITIVECOLLECTION=function(){if(this.PRIMITIVECOLLECTION===null)
this.PRIMITIVECOLLECTION=mqCreateXMLDoc("<PrimitiveCollection Count=\"0\"/>");return this.PRIMITIVECOLLECTION;}
this.getPOINTCOLLECTION=function(){if(this.POINTCOLLECTION===null)
this.POINTCOLLECTION=mqCreateXMLDoc("<PointCollection Count=\"0\"/>");return this.POINTCOLLECTION;}
this.getTREKROUTECOLLECTION=function(){if(this.TREKROUTECOLLECTION===null)
this.TREKROUTECOLLECTION=mqCreateXMLDoc("<TrekRouteCollection Count=\"0\"/>");return this.TREKROUTECOLLECTION;}
this.getFEATURESPECIFIERCOLLECTION=function(){if(this.FEATURESPECIFIERCOLLECTION===null)
this.FEATURESPECIFIERCOLLECTION=mqCreateXMLDoc("<FeatureSpecifierCollection Count=\"0\"/>");return this.FEATURESPECIFIERCOLLECTION;}
this.getGEOCODEOPTIONSCOLLECTION=function(){if(this.GEOCODEOPTIONSCOLLECTION===null)
this.GEOCODEOPTIONSCOLLECTION=mqCreateXMLDoc("<GeocodeOptionsCollection Count=\"0\"/>");return this.GEOCODEOPTIONSCOLLECTION;}
this.getCOVERAGESTYLE=function(){if(this.COVERAGESTYLE===null)
this.COVERAGESTYLE=mqCreateXMLDoc("<CoverageStyle/>");return this.COVERAGESTYLE;}
this.getRECORDSET=function(){if(this.RECORDSET===null)
this.RECORDSET=mqCreateXMLDoc("<RecordSet/>");return this.RECORDSET;}
this.getMAPSTATE=function(){if(this.MAPSTATE===null)
this.MAPSTATE=mqCreateXMLDoc("<MapState/>");return this.MAPSTATE;}
this.getSESSION=function(){if(this.SESSION===null)
this.SESSION=mqCreateXMLDoc("<Session Count=\"0\"/>");return this.SESSION;}
this.getSESSIONID=function(){if(this.SESSIONID===null)
this.SESSIONID=mqCreateXMLDoc("<SessionID/>");return this.SESSIONID;}
this.getDTSTYLE=function(){if(this.DTSTYLE===null)
this.DTSTYLE=mqCreateXMLDoc("<DTStyle/>");return this.DTSTYLE;}
this.getDTSTYLEEX=function(){if(this.DTSTYLEEX===null)
this.DTSTYLEEX=mqCreateXMLDoc("<DTStyleEx/>");return this.DTSTYLEEX;}
this.getDTFEATURESTYLEEX=function(){if(this.DTFEATURESTYLEEX===null)
this.DTFEATURESTYLEEX=mqCreateXMLDoc("<DTFeatureStyleEx/>");return this.DTFEATURESTYLEEX;}
this.getFEATURESPECIFIER=function(){if(this.FEATURESPECIFIER===null)
this.FEATURESPECIFIER=mqCreateXMLDoc("<FeatureSpecifier/>");return this.FEATURESPECIFIER;}
this.getBESTFIT=function(){if(this.BESTFIT===null)
this.BESTFIT=mqCreateXMLDoc("<BestFit Version=\"2\"/>");return this.BESTFIT;}
this.getBESTFITLL=function(){if(this.BESTFITLL===null)
this.BESTFITLL=mqCreateXMLDoc("<BestFitLL Version=\"2\"/>");return this.BESTFITLL;}
this.getCENTER=function(){if(this.CENTER===null)
this.CENTER=mqCreateXMLDoc("<Center/>");return this.CENTER;}
this.getCENTERLATLNG=function(){if(this.CENTERLATLNG===null)
this.CENTERLATLNG=mqCreateXMLDoc("<CenterLatLng/>");return this.CENTERLATLNG;}
this.getPAN=function(){if(this.PAN===null)
this.PAN=mqCreateXMLDoc("<Pan/>");return this.PAN;}
this.getZOOMIN=function(){if(this.ZOOMIN===null)
this.ZOOMIN=mqCreateXMLDoc("<ZoomIn/>");return this.ZOOMIN;}
this.getZOOMOUT=function(){if(this.ZOOMOUT===null)
this.ZOOMOUT=mqCreateXMLDoc("<ZoomOut/>");return this.ZOOMOUT;}
this.getZOOMTO=function(){if(this.ZOOMTO===null)
this.ZOOMTO=mqCreateXMLDoc("<ZoomTo/>");return this.ZOOMTO;}
this.getZOOMTORECT=function(){if(this.ZOOMTORECT===null)
this.ZOOMTORECT=mqCreateXMLDoc("<ZoomToRect/>");return this.ZOOMTORECT;}
this.getZOOMTORECTLATLNG=function(){if(this.ZOOMTORECTLATLNG===null)
this.ZOOMTORECTLATLNG=mqCreateXMLDoc("<ZoomToRectLatLng/>");return this.ZOOMTORECTLATLNG;}}
var MQXML=new MQXMLDOC();MQObjectCollection.prototype=new MQObject();MQObjectCollection.prototype.constructor=MQObjectCollection;function MQObjectCollection(max){MQObject.call(this);var m_items=new Array();this.getM_Items=function(){return m_items;};var m_maxItems=(max!==null)?max:-1;var validClassName="MQObject";this.getValidClassName=function(){return validClassName;};this.setValidClassName=function(className){validClassName=className;};this.add=function(obj){if(this.isValidObject(obj)){if(m_maxItems!==-1&&m_items.length===max)return;m_items.push(obj);return m_items.length;}
return;};this.getSize=function(){return m_items.length;};this.get=function(i){return m_items[i];};this.remove=function(iIndex){return m_items.splice(iIndex,1);};this.removeAll=function(){m_items=null;m_items=new Array();};this.contains=function(item){var size=this.getSize();for(var count=0;count<size;count++){if(m_items[count]===item){return true;}}
return false;};this.append=function(collection){if(this.getClassName()===collection.getClassName()){m_items=m_items.concat(collection.getM_Items());}else{alert("Invalid attempt to append "+this.getClassName()+" to "+collection.getClassName()+"!");throw"Invalid attempt to append "+this.getClassName()+" to "+collection.getClassName()+"!";}};this.set=function(i,newO){var oldO=get(i);m_items[i]=newO;return oldO;};this.isValidObject=function(obj){if(obj!==null){if(validClassName==="ALL"){return true;}else if(validClassName==="MQObject"){return true;}else if(validClassName==="String"){return true;}else if(validClassName==="int"){if(isNaN(obj)){return false;}else if(obj===Math.floor(obj)){return true;}}else if(obj.getClassName()===validClassName){return true;}}
return false;};var m_itemXpath="Item";this.getM_itemXpath=function(){return m_itemXpath;};this.setM_itemXpath=function(itemXpath){m_itemXpath=itemXpath;};this.getById=function(strId){try{for(var count=0;count<this.getSize();count++){if(m_items[count].getId()==strId){return m_items[count];}}}catch(Error){}
return null;};this.removeItem=function(item){for(var i=0;i<m_items.length;i++)
{if(m_items[i]==item)
{this.remove(i);i=m_items.length;}}};}
MQObjectCollection.prototype.getClassName=function(){return"MQObjectCollection";};MQObjectCollection.prototype.getObjectVersion=function(){return 0;};MQObjectCollection.prototype.getAt=function(i){return this.get(i);};MQLatLngCollection.prototype=new MQObjectCollection(32678);MQLatLngCollection.prototype.constructor=MQLatLngCollection;function MQLatLngCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQLatLng");this.setM_Xpath("LatLngCollection");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getLATLNGCOLLECTION()));}
MQLatLngCollection.prototype.getClassName=function(){return"MQLatLngCollection";};MQLatLngCollection.prototype.getObjectVersion=function(){return 1;};MQLatLngCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){this._loadCollection(xmlDoc);}};MQLatLngCollection.prototype.loadXmlFromNode=function(xmlNode){this.removeAll();var xmlDoc=mqCreateXMLDocImportNode(xmlNode);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){this._loadCollection(xmlDoc);}};MQLatLngCollection.prototype._loadCollection=function(xmlDoc){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var prevLat=0;var prevLng=0;var currentLat=0;var currentLng=0;var latlng=null;if(this.getValidClassName()==="MQLatLng"){for(var count=0;count<maxCount;count++){if(count==0){if(nodes[count].firstChild!==null){currentLat=nodes[count].firstChild.nodeValue/1000000;}
count++;if(nodes[count].firstChild!==null){currentLng=nodes[count].firstChild.nodeValue/1000000;}}else{if(nodes[count].firstChild!==null){currentLat=prevLat+(nodes[count].firstChild.nodeValue/1000000);}
count++;if(nodes[count].firstChild!==null){currentLng=prevLng+(nodes[count].firstChild.nodeValue/1000000);}}
prevLat=currentLat;prevLng=currentLng;latlng=new MQLatLng(currentLat,currentLng);this.add(latlng);}}};MQLatLngCollection.prototype.saveXml=function(){var strRet="<"+this.getM_Xpath()+" Version=\""+this.getObjectVersion()+"\" Count=\""+this.getSize()+"\">";var size=parseInt(this.getSize());if(size>=1){var nLat=nLng=nPrevLat=nPrevLng=nDeltaLat=nDeltaLng=0;var latLng=null;for(var i=0;i<size;i++){latLng=this.getAt(i);nLat=parseInt(latLng.getLatitude()*1000000);nLng=parseInt(latLng.getLongitude()*1000000);nDeltaLat=nLat-nPrevLat;nDeltaLng=nLng-nPrevLng;strRet+="<Lat>"+nDeltaLat+"</Lat>";strRet+="<Lng>"+nDeltaLng+"</Lng>";nPrevLat=nLat;nPrevLng=nLng;}}
strRet=strRet+"</"+this.getM_Xpath()+">";return strRet;};MQLatLngCollection.prototype.generalize=function(dDeviance){var SOrigPoint=function()
{this.pLL=null;this.dSegmentLength=0.0;this.dPriorLength=0.0;};var SDerivedPoint=function()
{this.pLL=null;this.ulOriginalPoint=0;};mqllAnchor=null;var ulAnchor;var i;var dAccumLength=0.0;var nPoints=this.getSize();var pOrigPoints=new Array(nPoints);var pDerivedPoints=new Array(nPoints);var nDerivedPoints=0;if(nPoints<2)
return;for(i=0;i<nPoints;i++)
{pOrigPoints[i]=new SOrigPoint();pDerivedPoints[i]=new SDerivedPoint();pOrigPoints[i].pLL=this.getAt(i);}
for(i=0;i<nPoints-1;i++)
{pOrigPoints[i].dSegmentLength=pOrigPoints[i].pLL.arcDistance(pOrigPoints[(i+1)].pLL);if(i==0)
pOrigPoints[i].dPriorLength=0.0;else
pOrigPoints[i].dPriorLength=dAccumLength;dAccumLength+=pOrigPoints[i].dSegmentLength;}
mqllAnchor=pOrigPoints[0].pLL;ulAnchor=0;pDerivedPoints[0].pLL=mqllAnchor;pDerivedPoints[0].ulOriginalPoint=0;nDerivedPoints=1;for(i=2;i<nPoints;i++)
{if(!this.isEverybodyWithinDeviation(pOrigPoints,ulAnchor,i,dDeviance))
{mqllAnchor=pOrigPoints[(i-1)].pLL;ulAnchor=(i-1);pDerivedPoints[nDerivedPoints].pLL=mqllAnchor;pDerivedPoints[nDerivedPoints].ulOriginalPoint=(i-1);nDerivedPoints++;}}
pDerivedPoints[nDerivedPoints].pLL=pOrigPoints[nPoints-1].pLL;pDerivedPoints[nDerivedPoints].ulOriginalPoint=nPoints-1;nDerivedPoints++;var nPrev=nPoints;var nCount;for(nCount=(nDerivedPoints-1);nCount>=0;nCount--)
{if((nPrev-1)!=pDerivedPoints[nCount].ulOriginalPoint)
{for(var x=(nPrev-1);x>pDerivedPoints[nCount].ulOriginalPoint;x--)
{try
{this.remove(x);}
catch(e)
{}}
nPrev=pDerivedPoints[nCount].ulOriginalPoint;}
else
{nPrev--;}}
pOrigPoints=null;pDerivedPoints=null;};MQLatLngCollection.prototype.isEverybodyWithinDeviation=function(pOrigPoints,ulOrigStartPoint,ulOrigEndPoint,dMaxDeviation)
{var dMilesPerLng=0.0;var dMaxDeviationSquared=0.0;var mqllStartPoint=null;var mqllEndPoint=null;var dLineLatMiles=0.0;var dLineLngMiles=0.0;var dLineLengthSquared=0.0;var i;var mqllPoint=null;var dPointLatMiles=0.0;var dPointLngMiles=0.0;var dPointLengthSquared=0.0;var dRatio=0.0;var dNumerator=0.0;var dDenominator=0.0;var dProjectionLengthSquared=0.0;var dDeviationLengthSquared=0.0;dMilesPerLng=DistanceApproximation.getMilesPerLngDeg(pOrigPoints[ulOrigStartPoint].pLL.getLatitude());dMaxDeviationSquared=dMaxDeviation*dMaxDeviation;mqllStartPoint=pOrigPoints[ulOrigStartPoint].pLL;mqllEndPoint=pOrigPoints[ulOrigEndPoint].pLL;dLineLatMiles=(mqllEndPoint.getLatitude()-mqllStartPoint.getLatitude())*DistanceApproximation.MILES_PER_LATITUDE;dLineLngMiles=(mqllEndPoint.getLongitude()-mqllStartPoint.getLongitude())*dMilesPerLng;dLineLengthSquared=dLineLatMiles*dLineLatMiles+dLineLngMiles*dLineLngMiles;for(i=ulOrigStartPoint+1;i<ulOrigEndPoint;i++)
{mqllPoint=pOrigPoints[i].pLL;dPointLatMiles=(mqllPoint.getLatitude()-mqllStartPoint.getLatitude())*DistanceApproximation.MILES_PER_LATITUDE;;dPointLngMiles=(mqllPoint.getLongitude()-mqllStartPoint.getLongitude())*dMilesPerLng;dPointLengthSquared=dPointLatMiles*dPointLatMiles+dPointLngMiles*dPointLngMiles;dNumerator=dLineLatMiles*dPointLatMiles+dLineLngMiles*dPointLngMiles;dDenominator=dLineLatMiles*dLineLatMiles+dLineLngMiles*dLineLngMiles;if(dDenominator==0)
dRatio=0;else
dRatio=dNumerator/dDenominator;dProjectionLengthSquared=dRatio*dRatio*dLineLengthSquared;dDeviationLengthSquared=dPointLengthSquared-dProjectionLengthSquared;if(dDeviationLengthSquared>dMaxDeviationSquared)
return false;}
return true;};var 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.170310,61.631630,61.074176,60.498118,59.903632,59.290899,58.660106,58.011443,57.345111,56.661310,55.960250,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.585570,41.627796,40.657342,39.674504,38.679582,37.672877,36.654698,35.625354,34.585159,33.534429,32.473485,31.402650,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.381280,13.198283,12.011266,10.820591,9.626619,8.429716,7.230245,6.028572,4.825062,3.620083,2.414002,1.207185,1.000000);this.MILES_PER_LATITUDE=69.170976;this.KILOMETERS_PER_MILE=1.609347;this.getMilesPerLngDeg=function(lat)
{return(Math.abs(lat)<=90.0)?this.m_milesPerLngDeg[parseInt(Math.abs(lat)+0.5)]:69.170976;}};function MQTKObjectCollection(max){var m_items=new Array();var m_maxItems=max||-1;this.add=function(obj){if(m_maxItems!=-1&&m_items.length==max)return;m_items.push(obj);return m_items.length;}
this.getSize=function(){return m_items.length;}
this.getAt=function(iIndex){return m_items[iIndex];}
this.remove=function(iIndex){return m_items.splice(iIndex,1);}
this.removeAll=function(){m_items=null;m_items=new Array();}
this.contains=function(item){for(var count=0,x=this.getSize();count<x;count++)
{if(m_items[count]==item)
{return true;}}
return false;}
this.getById=function(strId){for(var count=0,x=this.getSize();count<x;count++)
{if(m_items[count].getId()==strId)
{return m_items[count];}}
return null;}
this.removeItem=function(item){for(i=0;i<m_items.length;i++)
{if(m_items[i]==item)
{this.remove(i);i=m_items.length;}}}}
CONTROL_PANZOOM=0;CONTROL_PAN=1;CONTROL_ZOOM=2;CONTROL_TYPE=3;function MQMapLogo()
{throw new Error("Do NOT instantiate MQMapLogo - use static values");}
MQMapLogo.MAPQUEST=LOGO_MQ_LOGO;MQMapLogo.SCALES=LOGO_MQ_SCALES;MQMapLogo.MAPQUEST_COPYRIGHT=LOGO_MQ_COPY;MQMapLogo.NAVTEQ_COPYRIGHT=LOGO_NT_COPY;MQMapLogo.ICUBED_COPYRIGHT=LOGO_I3_COPY;function MQMapCorner()
{throw new Error("Do NOT instantiate MQMapCorner - use static values");}
MQMapCorner.TOP_LEFT=CORNER_TOPLEFT;MQMapCorner.TOP_RIGHT=CORNER_TOPRIGHT;MQMapCorner.BOTTOM_LEFT=CORNER_BOTTOMLEFT;MQMapCorner.BOTTOM_RIGHT=CORNER_BOTTOMRIGHT;function MQMapCornerPlacement(mapCorner,offsetSize)
{if(mapCorner==null)mapCorner=MQMapCorner.TOP_LEFT;if(offsetSize==null)offsetSize=new MQSize(0,0);this.mapCorner=mapCorner;this.offsetSize=new MQSize(offsetSize.getWidth(),offsetSize.getHeight());}
MQMapCornerPlacement.prototype.getMapCorner=function()
{return this.mapCorner;}
MQMapCornerPlacement.prototype.getOffsetSize=function()
{return new MQSize(this.offsetSize.getWidth(),this.offsetSize.getHeight());}
MQRectLL.prototype=RectLL.prototype;MQRectLL.prototype.constructor=MQRectLL;function MQRectLL(ulPoint,lrPoint)
{if(ulPoint==null)ulPoint=new MQLatLng(0.0,0.0);if(lrPoint==null)lrPoint=new MQLatLng(0.0,0.0);RectLL.call(this,ulPoint,lrPoint);}
MQRectLL.prototype.setLowerRight=function(mqLatLng)
{this.lr=new MQLatLng(mqLatLng.getLatitude(),mqLatLng.getLongitude());}
MQRectLL.prototype.setUpperLeft=function(mqLatLng)
{this.ul=new MQLatLng(mqLatLng.getLatitude(),mqLatLng.getLongitude());}
MQRectLL.prototype.getUpperLeft=function()
{return new MQLatLng(this.ul.lat,this.ul.lng);}
MQRectLL.prototype.getLowerRight=function()
{return new MQLatLng(this.lr.lat,this.lr.lng);}
MQRectLL.prototype.setBounds=function(arrayLL)
{for(var i=1;i<arrayLL.length;i++)
{var poiLL=arrayLL[i];this.extend(poiLL)}}
MQRectLL.prototype.extend=function(mqLatLng)
{if(mqLatLng.lat>this.ul.lat)this.ul.lat=mqLatLng.lat;if(mqLatLng.lng<this.ul.lng)this.ul.lng=mqLatLng.lng;if(mqLatLng.lat<this.lr.lat)this.lr.lat=mqLatLng.lat;if(mqLatLng.lng>this.lr.lng)this.lr.lng=mqLatLng.lng;}
MQRectXY.prototype=RectXY.prototype;MQRectXY.prototype.constructor=MQRectXY;function MQRectXY(ulPoint,lrPoint)
{if(ulPoint==null)ulPoint=new MQPoint(0,0);if(lrPoint==null)lrPoint=new MQPoint(0,0);RectXY.call(this,ulPoint,lrPoint);}
MQRectXY.prototype.setUpperLeft=function(mqPoint)
{this.ul=new MQPoint(mqPoint.getX(),mqPoint.getY());}
MQRectXY.prototype.setLowerRight=function(mqPoint)
{this.lr=new MQPoint(mqPoint.getX(),mqPoint.getY());}
MQRectXY.prototype.getUpperLeft=function()
{return new MQPoint(this.ul.x,this.ul.y);}
MQRectXY.prototype.getLowerRight=function()
{return new MQPoint(this.lr.x,this.lr.y);}
MQSize.prototype=Size.prototype;MQSize.prototype.constructor=MQSize;function MQSize(w,h)
{if(w==null)w=0;if(h==null)h=0;Size.call(this,w,h);}
MQSize.prototype.getWidth=function(){return this.width;}
MQSize.prototype.getHeight=function(){return this.height;}
MQSize.prototype.setWidth=function(w){this.width=parseInt(w);}
MQSize.prototype.setHeight=function(h){this.height=parseInt(h);}
MQSize.prototype.toString=function()
{return this.width+","+this.height;}
function isSupportedBrowser()
{browser=getBrowserInfo();switch(browser.name)
{case"msie":if(browser.version>=6)return true;return false;break;case"firefox":if(browser.version>1.5)return true;return false;break;case"netscape":return false;break;case"opera":return false;break;case"safari":if(browser.version>=2)return true;return false;break;}
return true;}
function getBrowserInfo()
{browser=new Object();browser.name=browser.version=browser.os="unknown";var userAgent=navigator.userAgent.toLowerCase();var browserListArray=new Array("firefox","msie","netscape","opera","safari");var osListArray=new Array("linux","mac","windows","x11");for(var i=0,n=browserListArray.length;i<n;i++)
{var strPosition=userAgent.indexOf(browserListArray[i])+1;if(strPosition>0)
{browser.name=browserListArray[i];var versionPosition=strPosition+browser.name.length;var incr=((browser.name=="safari")||(userAgent.charAt(versionPosition+4)>0&&userAgent.charAt(versionPosition+4)<9))?5:3;browser.version=userAgent.substring(versionPosition,versionPosition+incr);}}
for(var i=0,n=osListArray.length;i<n;i++)
{var strPosition=userAgent.indexOf(osListArray[i])+1;if(strPosition>0)
{browser.os=osListArray[i];}}
return browser;}
function getBrowserSize()
{size=new MQSize(0,0);if(document.body.scrollHeight>document.body.offsetHeight)
{size.width=document.body.scrollWidth;size.height=document.body.scrollHeight;}
else
{size.width=document.body.offsetWidth;size.height=document.body.offsetHeight;}
if(document.body.clientWidth)
{size.width=document.body.clientWidth;size.height=document.body.clientHeight;}
else
{size.width=document.body.offsetWidth;size.height=document.body.offsetHeight;}
if(document.documentElement.clientWidth)
{size.width=document.documentElement.clientWidth;size.height=document.documentElement.clientHeight;}
if(self.innerWidth)
{size.width=self.innerWidth;size.height=self.innerHeight;}
return size;}
MQ=new Object();MQ.browser=getBrowserInfo();MQ.utils={_createImage:function(url,left,top,width,height,imgIsPng)
{var img;img=document.createElement("img");if(imgIsPng==null)imgIsPng=false;if(imgIsPng)
img.isPng=imgIsPng;else
img.isPng=this._hasPngExtention(url);if(!img.isPng)
{img.src=url;}
else
{if(MQ.browser.name=="msie"&&((MQ.browser.version<7)&&MQ.browser.version>5))
{img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='image')";img.src="http://img.mqcdn.com/a/a";}
else
{img.src=url;}}
img.style.left=left+"px";img.style.top=top+"px";img.style.width=width+"px";img.style.height=height+"px";img.style.position="absolute";img.style.zIndex=200;img.style.MozUserSelect="none";img.style.border="none";img.style.display="block";img.unselectable="on";img.onselectstart=function(){return false;};img.oncontextmenu=function(){return false;};if(imgIsPng==null)imgIsPng=false;if(imgIsPng)
img.isPng=imgIsPng;else
img.isPng=this._hasPngExtention(url);return img;},_hasPngExtention:function(url)
{var urlLowerCase=url.toLowerCase();var extIndex=urlLowerCase.lastIndexOf(".png");if((extIndex!=-1)&&(extIndex==(urlLowerCase.length-4)))
{return true;}
return false;},getSuperRect:function(RECT1,RECT2)
{var rectLL=new RectLL(new PointLL(0,0),new PointLL(0,0));rectLL.ul.lat=Math.max(RECT1.ul.lat,RECT2.ul.lat);rectLL.ul.lng=Math.min(RECT1.ul.lng,RECT2.ul.lng);rectLL.lr.lat=Math.min(RECT1.lr.lat,RECT2.lr.lat);rectLL.lr.lng=Math.max(RECT1.lr.lng,RECT2.lr.lng);return rectLL;},pngFilter:function(imgObj)
{if(!document.getElementsByTagName)return;if(MQ.browser.info.name=="msie"&&((MQ.browser.info.version<7)&&MQ.browser.info.version>5))
{var images=(imgObj)?imgObj:document.images;for(var i=0,l=images.length;i<l;i++)
{var img=images[i];var imageName=img.src;if(imageName)
{var imageLength=imageName.length;if(imageName.toLowerCase().substring(imageLength-4,imageLength)==".png")
{if(!img.title)
{img.title=(img.alt)?img.alt:"";}
img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"');";img.src=MQ.art.spacer;}}}}},getOffsetLftTop:function(element)
{var left=0;var top=0;lftTop=new Object();while(element)
{left+=element.offsetLeft;top+=element.offsetTop;element=element.offsetParent;}
lftTop.left=left;lftTop.top=top;return lftTop;},deleteElement:function(obj)
{if(obj)
{obj.parentNode.removeChild(obj);}},deleteChildElements:function(obj)
{if(obj&&obj.childNodes.length>0)
{for(var i=(obj.childNodes.length-1);i>=0;i--)
{obj.removeChild(obj.childNodes[i]);}}},centreElement:function(element)
{element.style.left=(MQ.browser.size().width-element.offsetWidth)/2+"px";element.style.top=(MQ.browser.size().height-element.offsetHeight)/2+"px";},getTop:function(element)
{var top=0;while(element)
{top+=parseInt(element.offsetTop);element=element.offsetParent;}
return(top);},isMouseLeaveOrEnter:function(e,handler)
{if(e.type!='mouseout'&&e.type!='mouseover')return false;var reltg=e.relatedTarget?e.relatedTarget:e.type=='mouseout'?e.toElement:e.fromElement;while(reltg&&reltg!=handler)reltg=reltg.parentNode;return(reltg!=handler);}}
function MQClip(xMin,xMax,yMin,yMax,vIn,closed)
{var vOut=new Array();var D=(closed?3:2);if(vIn.length<D)
{return vOut;};vOut=clipAgainstEdge(0,vIn,closed);var vOut2=clipAgainstEdge(1,vOut,closed);var vOut3=clipAgainstEdge(2,vOut2,closed);var vOut4=clipAgainstEdge(3,vOut3,closed);return vOut4;function clipAgainstEdge(lEdge,lVin,lClosed)
{var v1;var v1in,v2in;var newv;var lVout=new Array();for(var v2=0;v2<lVin.length;v2++)
{if(closed)
v1=(v2==0?lVin.length-1:v2-1);else
v1=(v2==0?0:v2-1);v1in=inside(lEdge,lVin[v1]);v2in=inside(lEdge,lVin[v2]);if(v1in&&v2in)
{lVout.push(lVin[v2]);}
else if(!v1in&&v2in)
{newv=clipIntersection(lEdge,lVin[v2],lVin[v1]);lVout.push(newv);lVout.push(lVin[v2]);}
else if(v1in&&!v2in)
{newv=clipIntersection(lEdge,lVin[v1],lVin[v2]);lVout.push(newv);};};return lVout;};function clipIntersection(llEdge,inv,outv)
{var x1=inv.x;var y1=inv.y;var x2=outv.x;var y2=outv.y;var AU=0;var newv={x:0,y:0};switch(llEdge)
{case 0:var x3=xMin;var y3=yMin;var x4=xMin;var y4=yMax;break;case 1:var x3=xMax;var y3=yMin;var x4=xMax;var y4=yMax;break;case 2:var x3=xMin;var y3=yMax;var x4=xMax;var y4=yMax;break;case 3:var x3=xMin;var y3=yMin;var x4=xMax;var y4=yMin;break;};UA=(((x4-x3)*(y1-y3))-((y4-y3)*(x1-x3)))/(((y4-y3)*(x2-x1))-((x4-x3)*(y2-y1)));newv.x=x1+(UA*(x2-x1));newv.y=y1+(UA*(y2-y1));return newv;};function inside(edge,v)
{switch(edge)
{case 0:return(v.x>xMin);case 1:return(v.x<xMax);case 2:return(v.y<yMax);case 3:return(v.y>yMin);};return false;};};function isOverLimit(pnts)
{var overLimit=false;var limit=16000;for(var i=0;i<pnts.length;i++){if(pnts[i].x>limit||pnts[i].x<-limit||pnts[i].y>limit||pnts[i].y<-limit){overLimit=true;break;};};return overLimit;};function calcPercentage(shift,percentOf)
{return Math.round((shift/percentOf)*100);};function panAngle(initialMouseX,initialMouseY,newMouseX,newMouseY)
{var b=(newMouseY-initialMouseY);var c=(newMouseX-initialMouseX);if(b<0)
b=b*-1;if(c<0)
c=c*-1;var a=Math.round(Math.sqrt(b*b+c*c));var angle=Math.round((Math.asin(b/a)*360)/(2*3.14));return angle;};function stripHTMLTags(s){return s.replace(/<\/?[^>]+>/gi,'');};function getHTMLSubstring(strHtml,length,truncationChar)
{var regExp=/<\/?[^>]+>/ig;var tagArray=new Array();var tempStr=strHtml.replace(regExp,'|');var textArray=tempStr.split('|');tagArray=strHtml.match(regExp);var resultStr="";var arraySkipFlag=false;for(var i=charCount=0;i<textArray.length;i++)
{charCount+=textArray[i].length;if(charCount>=length&&arraySkipFlag==false)
{charCount-=textArray[i].length;textArray[i]=textArray[i].substr(0,(length-charCount))+truncationChar;arraySkipFlag=true;continue;}
if(arraySkipFlag==true)textArray[i]="";}
for(var i=0;i<textArray.length;i++)
{resultStr+=textArray[i];if(tagArray&&(tagArray.length>0)&&(i<tagArray.length))
resultStr+=tagArray[i];}
return(resultStr);};function getWindowScrollXY()
{var scrOff=new MQPoint(0,0);if(typeof(window.pageYOffset)=='number')
{scrOff.setX(window.pageXOffset);scrOff.setY(window.pageYOffset);}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop))
{scrOff.setX(document.body.scrollLeft);scrOff.setY(document.body.scrollTop);}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop))
{scrOff.setX(document.documentElement.scrollLeft);scrOff.setY(document.documentElement.scrollTop);}
return(scrOff);};function MQInitDojo(callback)
{if(dojo.require)
{dojo.require("dojox.gfx");if(callback)
{dojo.addOnLoad(callback);};};};function MQMapInit()
{this.bestFitRect=null;this.bestFitMargin=0;this.keepCenter=false;this.minZoom=1;this.maxZoom=16;};MQMapInit.prototype={setBestFitRect:function(RECT)
{this.bestFitRect=RECT;},getBestFitRect:function()
{return this.bestFitRect;},setBestFitMargin:function(MARGIN)
{this.bestFitMargin=MARGIN;},getBestFitMargin:function()
{return this.bestFitMargin;},setKeepCenter:function(BOOL)
{this.keepCenter=BOOL;},isKeepCenter:function()
{return this.keepCenter;},setMinZoom:function(MINZOOM)
{MINZOOM=parseInt(MINZOOM);if(MINZOOM<1||MINZOOM>15)
{this.minZoom=1;}
else
{this.minZoom=MINZOOM;}
if(this.minZoom>this.maxZoom)
{this.minZoom=this.maxZoom;}},getMinZoom:function()
{return this.minZoom;},setMaxZoom:function(MAXZOOM)
{MAXZOOM=parseInt(MAXZOOM);if(MAXZOOM<1||MAXZOOM>16)
{this.maxZoom=16;}
else
{this.maxZoom=MAXZOOM;}
if(this.maxZoom<this.minZoom)
{this.maxZoom=this.minZoom;}},getMaxZoom:function()
{return this.maxZoom;}};MQTileMap.prototype=Map.prototype;MQTileMap.prototype.constructor=MQTileMap;function MQTileMap(parent,zoom,mqLatLng,mtype,mqmapinit)
{this.div1=document.createElement("div");this.div1.style.width=parent.style.width;this.div1.style.height=parent.style.height;this.div1.style.zIndex=0;parent.style.position="relative";this.parent2=parent;parent.appendChild(this.div1);this.controls=[];this.mypois=new MQPoiCollection();try{this.myoverlays=new MQOverlayCollection();}catch(err){this.myoverlays=null;};try{this.mydeclutter=new MQDeclutter(this);}catch(err){this.mydeclutter=null;};this.iwparent=document.createElement("div");if(zoom==null)zoom=1;if(mqLatLng==null)mqLatLng=new MQLatLng(38.134557,-98.4375);Map.call(this,this.div1,zoom,mqLatLng,mtype,mqmapinit);this.SetClickOperation(EVENT_DBLCLICK,OPER_RECENTER);this.surface=null;this.overlayOffsetX=null;this.overlayOffsetY=null;this.dcCanvasDiv=null;this.dcCanvasContext=null;this.canvasOffsetX=null
this.canvasOffsetY=null;this.infowindow=new MQInfoWindow(this);this.infoWindowTitle=null;this.infoWindowContent=null;this.rolloverwindow=new MQRolloverWindow(this);this.rolloversEnabled=true;Event.observe(this.div1,"click",MQEventCallback(this,"onClick"));this.savedCenter=null;this.savedZoomLevel=null;this.savedMapType=null;this.saveState();IncrMQTileMapCount();this.uniqueMapID=GetMQTileMapCount();this.startDragPoint=new MQPoint(0,0);this.endDragPoint=new MQPoint(0,0);this.draggedObject=null;this.staticMapEnabled=false;this.turnEventsOff=false;if(mqmapinit!=null)
{this.showDragableMap();}}
MQTileMap.prototype.tilesExist=function()
{return this.TilesExist();}
MQTileMap.prototype._getParentOffset=function(element)
{var ptOffset=new MQPoint(0,0);while(element)
{ptOffset.x+=element.offsetLeft;ptOffset.y+=element.offsetTop;element=element.offsetParent;}
return ptOffset;}
MQTileMap.prototype.getDragOffset=function()
{return this.GetDragOffset();}
MQTileMap.prototype.onClick=function(e)
{if(e.srcObject&&e.srcObject.createFillerDiv)return;if(this.GetClickFlag())
{var ptOffset=this._getParentOffset(this.parent);var ptOffsetX=0;var ptOffsetY=0;if(typeof(window.pageYOffset)=='number'){ptOffsetY=window.pageYOffset;ptOffsetX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){ptOffsetY=document.body.scrollTop;ptOffsetX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){ptOffsetY=document.documentElement.scrollTop;ptOffsetX=document.documentElement.scrollLeft;}
var mqe=new MQEvent();mqe.srcObject=e.srcObject;if(!e.clientX&&e.domEvent){mqe.domEvent=e.domEvent;}else{mqe.domEvent=e;};var cx=(mqe.domEvent.clientX+ptOffsetX)-ptOffset.x;var cy=(mqe.domEvent.clientY+ptOffsetY)-ptOffset.y;mqe.xy=new MQPoint(cx,cy);mqe.ll=this.pixToLL(mqe.xy);mqe.eventName='MQTileMap.click';MQEventManager.trigger(this,"click",mqe);}}
MQTileMap.prototype.onZoomStart=function(e)
{if((getBrowserInfo().name=='firefox')&&this.infowindow.popup.content.childNodes[1]){var left=this.infowindow.popup.content.childNodes[1].scrollLeft;var top=this.infowindow.popup.content.childNodes[1].scrollTop;this.infowindow.popup.content.childNodes[1].style.overflow="hidden";this.infowindow.popup.content.childNodes[1].scrollLeft=left;this.infowindow.popup.content.childNodes[1].scrollTop=top;}
MQEventManager.trigger(this,"zoomstart",e);}
MQTileMap.prototype.onZoomEnd=function(e)
{this.HandleOverlays();if((getBrowserInfo().name=='firefox')&&this.infowindow.popup.content.childNodes[1]){var left=this.infowindow.popup.content.childNodes[1].scrollLeft;var top=this.infowindow.popup.content.childNodes[1].scrollTop;this.infowindow.popup.content.childNodes[1].style.overflow="auto";this.infowindow.popup.content.childNodes[1].scrollLeft=left;this.infowindow.popup.content.childNodes[1].scrollTop=top;}
MQEventManager.trigger(this,"zoomend",e);}
MQTileMap.prototype.onMapTypeChanged=function(e)
{if(this.GetDragOffset().x!=this.overlayOffsetX||this.GetDragOffset().y!=this.overlayOffsetY){this.HandleOverlays();};MQEventManager.trigger(this,"maptypechanged",e);}
MQTileMap.prototype.onPoiAdded=function(e)
{MQEventManager.trigger(this,"poiadded",e);}
MQTileMap.prototype.onPoiRemoved=function(e)
{MQEventManager.trigger(this,"poiremoved",e);}
MQTileMap.prototype.onMapCleared=function(e)
{MQEventManager.trigger(this,"mapcleared",e);}
MQTileMap.prototype.onOverlayAdded=function(e)
{MQEventManager.trigger(this,"overlayadded",e);}
MQTileMap.prototype.onOverlayRemoved=function(e)
{MQEventManager.trigger(this,"overlayremoved",e);}
MQTileMap.prototype.onInfoWindowOpen=function(e)
{MQEventManager.trigger(this,"infowindowopen",e);}
MQTileMap.prototype.onInfoWindowClose=function(e)
{MQEventManager.trigger(this,"infowindowclose",e);}
MQTileMap.prototype.onMoveStart=function(e)
{if((getBrowserInfo().name=='firefox')&&this.infowindow.popup.content.childNodes[1]){var left=this.infowindow.popup.content.childNodes[1].scrollLeft;var top=this.infowindow.popup.content.childNodes[1].scrollTop;this.infowindow.popup.content.childNodes[1].style.overflow="hidden";this.infowindow.popup.content.childNodes[1].scrollLeft=left;this.infowindow.popup.content.childNodes[1].scrollTop=top;}
MQEventManager.trigger(this,"movestart",e);}
MQTileMap.prototype.onMove=function(e)
{MQEventManager.trigger(this,"move",e);}
MQTileMap.prototype.onMoveEnd=function(e)
{if((getBrowserInfo().name=='firefox')&&this.infowindow.popup.content.childNodes[1]){var left=this.infowindow.popup.content.childNodes[1].scrollLeft;var top=this.infowindow.popup.content.childNodes[1].scrollTop;this.infowindow.popup.content.childNodes[1].style.overflow="auto";this.infowindow.popup.content.childNodes[1].scrollLeft=left;this.infowindow.popup.content.childNodes[1].scrollTop=top;}
MQEventManager.trigger(this,"moveend",e);}
MQTileMap.prototype.HandleMove=function()
{if(arguments.length==1)
{var e=new MQEvent();var movePhase=arguments[0];if(movePhase=="move"){e.eventName='MQTileMap.move';this.onMove(e);}else if(movePhase=="movestart"){e.eventName='MQTileMap.movestart';this.onMoveStart(e);}else if(movePhase=="moveend"){e.eventName='MQTileMap.moveend';this.onMoveEnd(e);};}}
MQTileMap.prototype.onDragStart=function(e)
{if((getBrowserInfo().name=='firefox')&&this.infowindow.popup.content.childNodes[1]){var left=this.infowindow.popup.content.childNodes[1].scrollLeft;var top=this.infowindow.popup.content.childNodes[1].scrollTop;this.infowindow.popup.content.childNodes[1].style.overflow="hidden";this.infowindow.popup.content.childNodes[1].scrollLeft=left;this.infowindow.popup.content.childNodes[1].scrollTop=top;}
MQEventManager.trigger(this,"dragstart",e);}
MQTileMap.prototype.onDrag=function(e)
{MQEventManager.trigger(this,"drag",e);}
MQTileMap.prototype.onDragEnd=function(e)
{if((getBrowserInfo().name=='firefox')&&this.infowindow.popup.content.childNodes[1]){var left=this.infowindow.popup.content.childNodes[1].scrollLeft;var top=this.infowindow.popup.content.childNodes[1].scrollTop;this.infowindow.popup.content.childNodes[1].style.overflow="auto";this.infowindow.popup.content.childNodes[1].scrollLeft=left;this.infowindow.popup.content.childNodes[1].scrollTop=top;}
MQEventManager.trigger(this,"dragend",e);}
MQTileMap.prototype.HandleDrag=function()
{if(arguments.length==1)
{var e=new MQEvent();var dragPhase=arguments[0];if(dragPhase=="drag"){e.eventName='MQTileMap.drag';this.onDrag(e);}else if(dragPhase=="dragstart"){e.eventName='MQTileMap.dragStart';this.onDragStart(e);}else if(dragPhase=="dragend"){e.eventName='MQTileMap.dragEnd';this.onDragEnd(e);};}else if(arguments.length==2){var e=new MQEvent();var dragPhase=arguments[0];if(dragPhase=="dragend"){var baseEvent=arguments[1];var ptOffset=this._getParentOffset(this.parent);e.clientX=baseEvent.clientX-ptOffset.x;e.clientY=baseEvent.clientY-ptOffset.y;this.endDragPoint=new MQPoint(e.clientX,e.clientY);e.dragDirection=this.direction(this.startDragPoint.x,this.startDragPoint.y,this.endDragPoint.x,this.endDragPoint.y);var directionsX=this.endDragPoint.x-this.startDragPoint.x;var directionsY=this.endDragPoint.y-this.startDragPoint.y;var panDistanceInfo=this.percentage(0,0,directionsX,directionsY,false);e.dragPercentage=Math.round(Math.sqrt(panDistanceInfo.shiftX*panDistanceInfo.shiftX+panDistanceInfo.shiftY*panDistanceInfo.shiftY));e.eventName='MQTileMap.dragEnd';this.onDragEnd(e);}}}
MQTileMap.prototype.direction=function(initialMouseX,initialMouseY,newMouseX,newMouseY)
{var mouseMoveDir="";if(newMouseY<initialMouseY)
{mouseMoveDir="n";}
else if(newMouseY>initialMouseY)
{mouseMoveDir="s";}
if(newMouseX>initialMouseX)
{mouseMoveDir+="e";}
else if(newMouseX<initialMouseX)
{mouseMoveDir+="w";}
var angle=panAngle(initialMouseX,initialMouseY,newMouseX,newMouseY);if(mouseMoveDir=="ne")
{if(angle<22)
mouseMoveDir="e";else if(angle>68)
mouseMoveDir="n";}
else if(mouseMoveDir=="nw")
{if(angle<22)
mouseMoveDir="w";else if(angle>68)
mouseMoveDir="n";}
else if(mouseMoveDir=="se")
{if(angle<22)
mouseMoveDir="e";else if(angle>68)
mouseMoveDir="s";}
else if(mouseMoveDir=="sw")
{if(angle<22)
mouseMoveDir="w";else if(angle>68)
mouseMoveDir="s";}
return mouseMoveDir;}
MQTileMap.prototype.percentage=function(initialMouseX,initialMouseY,newMouseX,newMouseY,returnInPixels)
{var panDistanceInfo={shiftX:0,shiftY:0};if(parseInt(newMouseX)>parseInt(initialMouseX))
{panDistanceInfo.shiftX=parseInt(newMouseX)-parseInt(initialMouseX);}
else
{panDistanceInfo.shiftX=parseInt(initialMouseX)-parseInt(newMouseX);}
if(parseInt(newMouseY)>parseInt(initialMouseY))
{panDistanceInfo.shiftY=parseInt(newMouseY)-parseInt(initialMouseY);}
else
{panDistanceInfo.shiftY=parseInt(initialMouseY)-parseInt(newMouseY);}
if(!returnInPixels||typeof(returnInPixels)=="undefined")
{panDistanceInfo.shiftY=calcPercentage(panDistanceInfo.shiftY,this.height);panDistanceInfo.shiftX=calcPercentage(panDistanceInfo.shiftX,this.width);}
return panDistanceInfo;}
MQTileMap.prototype.onTKMouseDown=function(e)
{MQEventManager.trigger(this,"mousedown",e);}
MQTileMap.prototype.onTKMouseUp=function(e)
{MQEventManager.trigger(this,"mouseup",e);}
MQTileMap.prototype.HandleMouse=function()
{if(arguments.length==2)
{var baseEvent=arguments[1];var str="";var e=new MQEvent();var ptOffset=this._getParentOffset(this.parent);e.button=(Event.isLeftClick(baseEvent))?BUTTON_MQ_LEFT:BUTTON_MQ_RIGHT;e.clientX=baseEvent.clientX-ptOffset.x;e.clientY=baseEvent.clientY-ptOffset.y;var mousePhase=arguments[0];if(mousePhase=="mousedown"){this.startDragPoint=new MQPoint(e.clientX,e.clientY);if(this.surface){this.surface.rawNode.style.cursor=this.grab_mousecursor;this.overlaydiv.style.cursor=this.grab_mousecursor;};e.eventName='MQTileMap.mouseDown';this.onTKMouseDown(e);}else if(mousePhase=="mouseup"){if(this.surface){this.surface.rawNode.style.cursor=this.current_mousecursor;};e.eventName='MQTileMap.mouseUp';this.onTKMouseUp(e);};}}
MQTileMap.prototype.addControl=function(control,position)
{control.initialize(this);this.controls[control.type]=control;var style=control.elem.style;if(position!=null)
{control.position=position;}
this.parent2.appendChild(control.elem);this.placeControl(control);style.display="block";style.zIndex=0;}
MQTileMap.prototype.removeControl=function(control)
{if(control.destructor)
{control.destructor();}
this.parent2.removeChild(control.elem);this.controls[control.type]=null;}
MQTileMap.prototype.updateZoom=function(which)
{if(this.controls[CONTROL_PANZOOM]!=null){this.controls[CONTROL_PANZOOM].setZoom(this.getZoomLevel());this.controls[CONTROL_PANZOOM].unselectZoom(0);}}
MQTileMap.prototype.placeControl=function(control)
{var pos=control.getPosition();var mapCorner=pos.getMapCorner();var left;var top;if(mapCorner==MQMapCorner.TOP_LEFT)
{left=0;top=0;}
else if(mapCorner==MQMapCorner.TOP_RIGHT)
{left=this.width-control.getWidth();top=0;var args=arguments;if(typeof args[1]=="undefined")
{pos.offsetSize.width*=-1;}}
else if(mapCorner==MQMapCorner.BOTTOM_LEFT)
{left=0;top=this.height-control.getHeight();var args=arguments;if(typeof args[1]=="undefined")
{pos.offsetSize.height*=-1;}}
else if(mapCorner==MQMapCorner.BOTTOM_RIGHT)
{left=this.width-control.getWidth();top=this.height-control.getHeight();var args=arguments;if(typeof args[1]=="undefined")
{pos.offsetSize.width*=-1;pos.offsetSize.height*=-1;}}
left+=pos.offsetSize.width;top+=pos.offsetSize.height;control.elem.style.left=left+"px";control.elem.style.top=top+"px";}
MQTileMap.prototype.setLogoZindex=function(mapLogo,index)
{this.SetLogoZindex(mapLogo,index);}
MQTileMap.prototype.setLogoPlacement=function(mapLogo,mapCornerPlacement)
{var mapCorner=mapCornerPlacement.getMapCorner();var offsetWidth=Math.abs(mapCornerPlacement.getOffsetSize().getWidth());var offsetHeight=Math.abs(mapCornerPlacement.getOffsetSize().getHeight());var leftOffset=0;var topOffset=0;if(mapCorner==MQMapCorner.TOP_LEFT)
{leftOffset=offsetWidth;topOffset=offsetHeight;}
else if(mapCorner==MQMapCorner.TOP_RIGHT)
{leftOffset=(-offsetWidth);topOffset=offsetHeight;}
else if(mapCorner==MQMapCorner.BOTTOM_LEFT)
{leftOffset=offsetWidth;topOffset=(-offsetHeight);}
else if(mapCorner==MQMapCorner.BOTTOM_RIGHT)
{leftOffset=(-offsetWidth);topOffset=(-offsetHeight);}
else
{return;}
this.SetLogoPlacement(mapLogo,mapCorner,new MQPoint(leftOffset,topOffset));}
MQTileMap.prototype.addPois=function(mqPois)
{if(mqPois)
{var h=mqPois.getSize();for(i=0;i<h;i++){this.addPoi(mqPois.getAt(i));}}}
MQTileMap.prototype.addPoi=function(mqPoi)
{if(this.mypois.contains(mqPoi))return;mqPoi.getIcon()._checkInit();this.AddPOI(mqPoi.getLatLng(),mqPoi.getIcon().getAnchorOffset(),mqPoi.getElement());this.mypois.add(mqPoi);var e=new MQEvent('MQTileMap.poiAdded');e.poi=mqPoi;this.onPoiAdded(e);mqPoi.redrawLabel();mqPoi.map=this;mqPoi.mqrw=this.getRolloverWindow();mqPoi.mqiw=this.getInfoWindow();if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()!=0)this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());};}
MQTileMap.prototype.removePoi=function(mqPoi)
{this.RemovePOI(mqPoi.element);this.mypois.removeItem(mqPoi);var e=new MQEvent('MQTileMap.poiRemoved');mqPoi.onRemoved(e);e.poi=mqPoi;this.onPoiRemoved(e);mqPoi.map=null;if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()!=0)this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());};}
MQTileMap.prototype.removeAllPois=function()
{if(this.getDeclutter()){var tempDCM=this.getDeclutter().getDeclutterMode();};if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()!=0)this.getDeclutter().setDeclutterMode(0);};while(this.mypois.getSize()>0)
{this.removePoi(this.mypois.getAt(0));}
if(this.getDeclutter()){if(tempDCM!=0){this.getDeclutter().setDeclutterMode(tempDCM);};};this.onMapCleared(new MQEvent('MQTileMap.mapCleared'));}
MQTileMap.prototype.replacePois=function(mypois)
{if(this.getDeclutter()){var dcm=this.getDeclutter().getDeclutterMode();};this.removeAllPois();for(var i=0,j=mypois.getSize();i<j;i++)
{this.addPoi(mypois.getAt(i));}
if(this.getDeclutter()){if(dcm!=0)this.getDeclutter().setDeclutterMode(dcm);};}
MQTileMap.prototype.createDrawingSurface=function()
{try{if(dojox.gfx.createSurface){this.TILESIZE=this.GetTileSize();this.SURFACE_OFFSET=2*this.TILESIZE;this.overlayOffsetX=0;this.overlayOffsetY=0;this.overlaydiv=document.createElement("div");this.overlaydiv.id="mqOverlayDiv";var vpWidth=this.div1.style.width.replace('px','');var vpHeight=this.div1.style.height.replace('px','');var tileBlocksWidth=Math.ceil(vpWidth/this.TILESIZE)*this.TILESIZE;var tileBlocksHeight=Math.ceil(vpHeight/this.TILESIZE)*this.TILESIZE;var surfaceWidth=tileBlocksWidth+(2*this.SURFACE_OFFSET);var surfaceHeight=tileBlocksHeight+(2*this.SURFACE_OFFSET);var offsetX=-(Math.round((tileBlocksWidth-vpWidth)/2)+this.SURFACE_OFFSET);var offsetY=-(Math.round((tileBlocksHeight-vpHeight)/2)+this.SURFACE_OFFSET);var offsetX=-(this.SURFACE_OFFSET);var offsetY=-(this.SURFACE_OFFSET);this.overlaydiv.lt=offsetX+'px';this.overlaydiv.tp=offsetY+'px';this.overlaydiv.style.position="absolute";this.overlaydiv.style.top=offsetY+'px';this.overlaydiv.style.left=offsetX+'px';this.overlaydiv.style.height=surfaceHeight+'px';this.overlaydiv.style.width=surfaceWidth+'px';this.overlaydiv.style.zIndex=70;this.overlaydiv.UNSELECTABLE="on";this.overlaydiv.style.MozUserSelect="none";this.overlaydiv.style.cursor=this.current_mousecursor;this.AppendOverlayDiv(this.overlaydiv);this.surface=dojox.gfx.createSurface(this.overlaydiv,surfaceWidth,surfaceHeight);}else{this.surface=null;};}catch(err){this.surface=null;};};MQTileMap.prototype.createCanvas=function()
{try{this.TILESIZE=this.GetTileSize();this.SURFACE_OFFSET=2*this.TILESIZE;this.canvasOffsetX=0;this.canvasOffsetY=0;this.dcCanvasDiv=document.createElement("div");this.dcCanvasDiv.id="mqCanvasDiv";var vpWidth=this.div1.style.width.replace('px','');var vpHeight=this.div1.style.height.replace('px','');var tileBlocksWidth=Math.ceil(vpWidth/this.TILESIZE)*this.TILESIZE;var tileBlocksHeight=Math.ceil(vpHeight/this.TILESIZE)*this.TILESIZE;var canvasWidth=tileBlocksWidth+(2*this.SURFACE_OFFSET);var canvasHeight=tileBlocksHeight+(2*this.SURFACE_OFFSET);var offsetX=-(Math.round((tileBlocksWidth-vpWidth)/2)+this.SURFACE_OFFSET);var offsetY=-(Math.round((tileBlocksHeight-vpHeight)/2)+this.SURFACE_OFFSET);var offsetX=-(this.SURFACE_OFFSET);var offsetY=-(this.SURFACE_OFFSET);this.dcCanvasDiv.style.position="absolute";this.dcCanvasDiv.style.top=offsetY+'px';this.dcCanvasDiv.style.left=offsetX+'px';this.dcCanvasDiv.style.height=canvasHeight+'px';this.dcCanvasDiv.style.width=canvasWidth+'px';this.dcCanvasDiv.style.cursor="auto";this.dcCanvasDiv.style.zIndex=70;this.dcCanvasDiv.UNSELECTABLE="off";this.AppendOverlayDiv(this.dcCanvasDiv);var c=document.createElement('canvas');c.setAttribute("height",parseInt(this.dcCanvasDiv.style.height));c.setAttribute("width",parseInt(this.dcCanvasDiv.style.width));c.setAttribute("id","mqCanvas");this.dcCanvasDiv.appendChild(c);this.dcCanvasContext=c.getContext('2d');}catch(err){this.dcCanvasDiv=null;this.dcCanvasContext=null;};};MQTileMap.prototype.getOverlays=function()
{if(this.myoverlays){var tempOverlayCollection=new MQOverlayCollection;for(var i=0,j=this.myoverlays.getSize();i<j;i++)
{tempOverlayCollection.add(this.myoverlays.getAt(i));}
tempOverlayCollection.setName(this.myoverlays.getName());return tempOverlayCollection;}else{return null;};}
MQTileMap.prototype.addOverlays=function(mqOverlays)
{if(mqOverlays)
{var h=mqOverlays.getSize();for(i=0;i<h;i++){this.addOverlay(mqOverlays.getAt(i));}}}
MQTileMap.prototype.addOverlay=function(mqOverlay)
{if(!this.getOverlays())throw('overlays.js has not been included.');if(!this.surface)this.createDrawingSurface();if(!this.surface)throw('Overlay drawing surface does not exist.');if(this.myoverlays.contains(mqOverlay))return;mqOverlay.map=this;if(mqOverlay.shapePointsXY){var newShapePoints=new MQLatLngCollection();for(var i=0,y=mqOverlay.shapePoints.getSize();i<y;i++){newShapePoints.add(this.pixToLL(mqOverlay.shapePoints.get(i)));};mqOverlay.shapePoints=newShapePoints;mqOverlay.shapePointsXY=0;};this.myoverlays.add(mqOverlay);if(this.GetDragOffset().x!=this.overlayOffsetX||this.GetDragOffset().y!=this.overlayOffsetY){this.overlayOffsetX=this.GetDragOffset().x;this.overlayOffsetY=this.GetDragOffset().y;this.overlaydiv.style.left=-(this.SURFACE_OFFSET+this.overlayOffsetX)+'px';this.overlaydiv.style.top=-(this.SURFACE_OFFSET+this.overlayOffsetY)+'px';this.redrawOverlays();}else{mqOverlay.drawShape();};var e=new MQEvent('MQTileMap.overlayAdded');e.overlay=mqOverlay;this.onOverlayAdded(e);}
MQTileMap.prototype.removeOverlay=function(mqOverlay)
{function removeChildrenFromNode(node)
{if(node!==undefined&&node!==null)return;while(node.hasChildNodes()){node.removeChild(node.firstChild);};};if(!this.getOverlays())throw('overlays.js has not been included.');var i;if(mqOverlay){for(i=0;i<this.myoverlays.getSize();i++){if(mqOverlay==this.myoverlays.getAt(i)){mqOverlay.onRemoved(e);if(mqOverlay.className=='MQImageOverlay'&&mqOverlay.shape){mqOverlay.shape.firstChild.style.width='0px';mqOverlay.shape.firstChild.style.height='0px';mqOverlay.shape.firstChild.src='';mqOverlay.shape.removeChild(mqOverlay.shape.firstChild);this.overlaydiv.removeChild(mqOverlay.shape);mqOverlay.shape=null;}else{if(mqOverlay.shape)
{this.surface.remove(mqOverlay.shape);}
mqOverlay.shape=null;};mqOverlay.map=null;this.myoverlays.remove(i,1);var e=new MQEvent('MQTileMap.overlayRemoved');e.overlay=mqOverlay;this.onOverlayRemoved(e);break;};};};}
MQTileMap.prototype.removeAllOverlays=function()
{if(!this.getOverlays())throw('overlays.js has not been included.');while(this.myoverlays.getSize()>0)
{this.removeOverlay(this.myoverlays.getAt(0));}}
MQTileMap.prototype.replaceOverlays=function(myOverlayCollection)
{if(!this.getOverlays())throw('overlays.js has not been included.');var i;this.removeAllOverlays();for(i=0;i<myOverlayCollection.getSize();i++)
{this.addOverlay(myOverlayCollection.getAt(i));}
this.getOverlays().setName(myOverlayCollection.getName());}
MQTileMap.prototype.redrawOverlays=function()
{var i,j
if(!this.getOverlays())throw('overlays.js has not been included.');for(i=0,j=this.getOverlays().getSize();i<j;i++)
{this.getOverlays().getAt(i).redraw();};}
MQTileMap.prototype.HandleOverlays=function()
{if(this.surface){this.overlayOffsetX=this.GetDragOffset().x;this.overlayOffsetY=this.GetDragOffset().y;this.overlaydiv.style.left=-(this.SURFACE_OFFSET+this.overlayOffsetX)+'px';this.overlaydiv.style.top=-(this.SURFACE_OFFSET+this.overlayOffsetY)+'px';this.redrawOverlays();if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()==2){this.getDeclutter().adjustLeaderLineSurface();this.getDeclutter().redrawLeaderLines();};};};};MQTileMap.prototype.getMapType=function()
{return this.GetTileMode();}
MQTileMap.prototype.pixToLL=function(mqPoint)
{var ll=this.GetXYToLL(mqPoint);return new MQLatLng(ll.lat,ll.lng);}
MQTileMap.prototype.llToPix=function(mqLatLng)
{var xy=this.GetLLToXY(mqLatLng);return new MQPoint(xy.x,xy.y);}
MQTileMap.prototype.setMapType=function(type)
{var prevMT=this.getMapType();if(prevMT!=type){var newMode="";switch(type)
{case"map":case"sat":case"hyb":break;default:return;}
this.SetTileMode(type);this.redrawOverlays();if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()==2){this.getDeclutter().resetDraggedPois();this.getDeclutter().redrawLeaderLines();};};if(this.controls[CONTROL_TYPE]!=null){this.controls[CONTROL_TYPE].updateControl(type);}
var evt=new MQEvent('MQTileMap.mapTypeChanged');evt.prevMapType=prevMT;evt.mapType=type;this.onMapTypeChanged(evt);}}
MQTileMap.prototype.zoomIn=function()
{var prevZoom=this.getZoomLevel();prevZoom++;this.setZoomLevel(prevZoom);}
MQTileMap.prototype.zoomOut=function()
{var prevZoom=this.getZoomLevel();prevZoom--;this.setZoomLevel(prevZoom);}
MQTileMap.prototype.setZoomLevel=function(level)
{var prevZoom=this.getZoomLevel();var evt=new MQEvent('MQTileMap.zoomStart');evt.zoom=prevZoom;this.onZoomStart(evt);this.SetZoomLevel(level);this.updateZoom("on");var e=new MQEvent('MQTileMap.zoomEnd');e.prevZoom=prevZoom;e.zoom=this.getZoomLevel();this.onZoomEnd(e);if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()!=0)this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());};}
MQTileMap.prototype.getZoomLevel=function()
{return this.GetZoomLevel();}
MQTileMap.prototype.zoomToRect=function(rectLL,keepcenter,minzoom,maxzoom)
{var prevZoom=this.getZoomLevel();if(keepcenter==null)keepcenter=false;if(minzoom==null)minzoom=1;if(maxzoom==null)maxzoom=16;var evt=new MQEvent('MQTileMap.zoomStart');evt.zoom=prevZoom;this.onZoomStart(evt);this.updateZoom("off");this.BestFit(rectLL,keepcenter,minzoom,maxzoom);this.updateZoom("on");var e=new MQEvent('MQTileMap.zoomEnd');e.prevZoom=prevZoom;e.zoom=this.getZoomLevel();this.onZoomEnd(e);if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()!=0)this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());};}
MQTileMap.prototype.getScaleFromZoom=function()
{return this.GetScaleFromZoom(this.getZoomLevel());}
MQTileMap.prototype.bestFit=function(keepCenter,minZoomLevel,maxZoomLevel)
{var prevZoom=this.getZoomLevel();if(keepCenter==null)keepCenter=false;if(minZoomLevel==null)minZoomLevel=1;if(maxZoomLevel==null)maxZoomLevel=16;var evt=new MQEvent('MQTileMap.zoomStart');evt.zoom=prevZoom;this.onZoomStart(evt);this.updateZoom("off");this.BestFitPOIs(keepCenter,minZoomLevel,maxZoomLevel);this.updateZoom("on");var e=new MQEvent('MQTileMap.zoomEnd');e.prevZoom=prevZoom;e.zoom=this.getZoomLevel();this.onZoomEnd(e);if(this.getDeclutter()){if(this.getDeclutter().getDeclutterMode()!=0)this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());};}
MQTileMap.prototype.bestFitLL=function(arrayLL,keepCenter,minZoomLevel,maxZoomLevel)
{if(!arrayLL.length)return;if(keepCenter==null)keepCenter=false;if(minZoomLevel==null)minZoomLevel=1;if(maxZoomLevel==null)maxZoomLevel=16;var rect=new MQRectLL(arrayLL[0],arrayLL[0]);rect.setBounds(arrayLL);this.zoomToRect(rect,keepCenter,minZoomLevel,maxZoomLevel);}
MQTileMap.prototype.getCenter=function()
{var ll=this.GetCenterLatLng();return new MQLatLng(ll.lat,ll.lng);}
MQTileMap.prototype.setCenter=function(mqLatLng,zoom)
{if(zoom==null)
{this.SetCenterLatLng(mqLatLng);}else{var prevZoom=this.getZoomLevel();var evt=new MQEvent('MQTileMap.zoomStart');evt.zoom=prevZoom;this.onZoomStart(evt);this.updateZoom("off");this.SetCenterLatLngZoomLevel(mqLatLng,zoom);this.updateZoom("on");var e=new MQEvent('MQTileMap.zoomEnd');e.prevZoom=prevZoom;e.zoom=this.getZoomLevel();this.onZoomEnd(e);}}
MQTileMap.prototype.panToLatLng=function(mqLatLng)
{var pnt=this.llToPix(mqLatLng)
if((pnt.getX()>-100&&pnt.getX()<this.width+100)||(pnt.getY()>-100&&pnt.getY()<this.height+100)){this.SlideMapToPoint(pnt);}else{this.setCenter(mqLatLng);}}
MQTileMap.prototype.getRolloverWindow=function()
{return this.rolloverwindow;}
MQTileMap.prototype.getInfoWindow=function()
{return this.infowindow;}
MQTileMap.prototype.setInfoTitleHTML=function(title)
{var container=document.createElement("div");container.innerHTML="<div>"+title+"</div>";this.infoWindowTitle=container;}
MQTileMap.prototype.setInfoContentHTML=function(content)
{var container=document.createElement("div");container.innerHTML="<div>"+content+"</div>";this.infoWindowContent=container;}
MQTileMap.prototype.setInfoTitleElement=function(titleContainer)
{this.infoWindowTitle=titleContainer;}
MQTileMap.prototype.setInfoContentElement=function(contentContainer)
{this.infoWindowContent=contentContainer;}
MQTileMap.prototype.openInfoWindow=function(mqPoint)
{if(this.iwparent.parentNode)
{this.RemovePOI(this.iwparent);}
this.AddPOI(this.pixToLL(mqPoint),new MQPoint(0,0),this.iwparent);this.iwparent.appendChild(this.infowindow.popup);this.infowindow.modify(mqPoint,this.infoWindowTitle,this.infoWindowContent,new MQPoint(-7,-14));this.infowindow.setOpenerAndShow(this);this.onInfoWindowOpen(new MQEvent('MQTileMap.infoWindowOpen'));}
MQTileMap.prototype.setRolloversEnabled=function(benable)
{this.rolloversEnabled=benable;}
MQTileMap.prototype.getRolloversEnabled=function()
{return this.rolloversEnabled;}
MQTileMap.prototype.enableDragging=function(benable)
{this.DisableDragging(!benable);}
MQTileMap.prototype.getDragEnabled=function()
{return!this.GetDraggingState();}
MQTileMap.prototype.getPois=function()
{var tempPoiCollection=new MQPoiCollection;for(var i=0,j=this.mypois.getSize();i<j;i++)
{tempPoiCollection.add(this.mypois.getAt(i));}
return tempPoiCollection;}
MQTileMap.prototype.getSize=function()
{return new MQSize(this.div1.style.width,this.div1.style.height);}
MQTileMap.prototype.setSize=function(mqSize)
{if(typeof(mqSize)=='undefined')
{var mqSize={};}
var w=(typeof(mqSize.width)=='undefined')?this.parent2.clientWidth:mqSize.width;var h=(typeof(mqSize.height)=='undefined')?this.parent2.clientHeight:mqSize.height;this.ResizeMap(new MQSize(w,h));var dcMode=this.getDeclutter().getDeclutterMode();if(dcMode!=0){this.getDeclutter().setDeclutterMode(0);this.getDeclutter().setDeclutterMode(dcMode);};if(this.getOverlays()){this.redrawOverlays();};for(var x=0,y=this.controls.length;x<y;x++)
{if(this.controls[x])
{this.placeControl(this.controls[x],true);}}}
MQTileMap.prototype.getRectFromMapstate=function(mqmapstate)
{try{var exist=new MQMapState();exist=null;}catch(e)
{throw"The JSAPI must be included to use this function.";return;}
if(mqmapstate==null)return;var cLat=parseFloat(mqmapstate.getCenter().getLatitude());var cLng=parseFloat(mqmapstate.getCenter().getLongitude());var heightpx=mqmapstate.getHeightPixels();var widthpx=mqmapstate.getWidthPixels();var scale=mqmapstate.getMapScale();var deltaLat=(heightpx/2)/this.GetLatitudeDegreesPerPixel(scale);var deltaLng=(widthpx/2)/this.GetLongitudeDegreesPerPixel(scale);deltaLat=parseInt(deltaLat*1000000.0)/1000000.0;deltaLng=parseInt(deltaLng*1000000.0)/1000000.0;var ul=new MQLatLng(cLat+deltaLat,cLng-deltaLng);var lr=new MQLatLng(cLat-deltaLat,cLng+deltaLng);return new MQRectLL(ul,lr);}
MQTileMap.prototype.addRouteHighlight=function(rectll,mapserverurl,sessionid,bestfit)
{var prevZoom=this.getZoomLevel();var evt=new MQEvent('MQTileMap.zoomStart');evt.zoom=prevZoom;this.onZoomStart(evt);this.updateZoom("off");this.AddRouteHighlight(rectll,mapserverurl,sessionid,bestfit);this.updateZoom("on");var e=new MQEvent('MQTileMap.zoomEnd');e.prevZoom=prevZoom;e.zoom=this.getZoomLevel();this.onZoomEnd(e);}
MQTileMap.prototype.getRouteSession=function()
{return this.GetRouteSession();}
MQTileMap.prototype.getBounds=function()
{var ulLL=this.pixToLL(new MQPoint(0,0));var lrLL=this.pixToLL(new MQPoint(this.div1.style.width,this.div1.style.height));return new MQRectLL(ulLL,lrLL);}
MQTileMap.prototype.restoreState=function()
{this.setCenter(this.savedCenter);this.setZoomLevel(this.savedZoomLevel);this.setMapType(this.savedMapType);}
MQTileMap.prototype.saveState=function()
{this.savedCenter=this.getCenter();this.savedZoomLevel=this.getZoomLevel();this.savedMapType=this.getMapType();}
MQTileMap.prototype.removeRouteHighlight=function()
{this.RemoveRouteHighlight();}
MQTileMap.prototype.getDeclutter=function()
{return this.mydeclutter;}
MQTileMap.prototype.showDragableMap=function()
{this.GetPoiDiv().style.zIndex=90;if(getBrowserInfo().name=='safari'&&this.dcCanvasDiv){this.dcCanvasDiv.style.zIndex=70;}
this.div1.style.zIndex=0;if(this.staticMapEnabled)
{this.RebuildTiles(true);}
if(this.GetRouteSession()!="")
{var tmpRect=(this.GetBestFitRect()!=null)?this.GetBestFitRect():this.GetRouteRect();this.addRouteHighlight(tmpRect,this.GetRouteServer(),this.GetRouteSession(),this.IsRouteBestFit());}
this.GetLoadingDiv().style.zIndex=-1;},MQTileMap.prototype.showStaticMap=function()
{this.GetLoadingDiv().style.zIndex=110;this.div1.style.zIndex=100;this.setLogoZindex(MQMapLogo.MAPQUEST_COPYRIGHT,-100);this.setLogoZindex(MQMapLogo.MAPQUEST,-100);this.setLogoZindex(MQMapLogo.SCALES,-100);this.setLogoZindex(MQMapLogo.ICUBED_COPYRIGHT,-100);this.setLogoZindex(MQMapLogo.NAVTEQ_COPYRIGHT,-100);this.turnEventsOff=true;var reqData={type:this.getMapType(),size:this.getSize().toString(),scale:this.getScaleFromZoom(),center:this.getCenter(),key:Key}
if(this.GetRouteSession()!="")
{reqData.session=this.GetRouteSession();}
if(IsDotCom)
{this.GetPoiDiv().style.zIndex=-100;if(getBrowserInfo().name=='safari'&&this.dcCanvasDiv){this.dcCanvasDiv.style.zIndex=-100;}
this.getDeclutter().removeLeaderLines();reqData.stops=reqData.pois="";var poiData=this.getPois();for(var i=0,j=poiData.getSize();i<j;i++)
{var thisPoi=poiData.getAt(i);var thisDragLeft=(thisPoi.dragLeft==null)?0:((-1*thisPoi.dragLeft)-thisPoi.mqMapIcon.getAnchorOffset().getX());var thisDragTop=(thisPoi.dragTop==null)?0:((-1*thisPoi.dragTop)-thisPoi.mqMapIcon.getAnchorOffset().getY());switch(thisPoi.getKey())
{case"mcenter":case"scenter":case"ecenter":case"pcenter":reqData[thisPoi.getKey()]=thisPoi.getLatLng().toString()+","+thisDragLeft+","+thisDragTop;break;default:var thisKeyLabel=thisPoi.getKey().split("-");switch(thisKeyLabel[0])
{case"stops":case"pois":reqData[thisKeyLabel[0]]+=thisKeyLabel[1].toUpperCase()+","+thisPoi.getLatLng().toString()+","+thisDragLeft+","+thisDragTop+"|";break;}
break;}}}
var staticMapImgSrc=GetStaticMapResources()+"?";for(var nv in reqData)
{staticMapImgSrc+=(reqData[nv]!="")?nv+"="+reqData[nv]+"&":"";}
staticMapImgSrc+"rand="+(Math.round((Math.random()*10000)));if(this.staticMapImg)
{var prevstaticMapImg=this.staticMapImg.src;if(prevstaticMapImg.split("&rand=")[0]==staticMapImgSrc.split("&rand=")[0])
{this.staticMapImg.style.display="block";this.GetLoadingDiv().style.zIndex=0;this.staticMapEnabled=true;return prevstaticMapImg;}}
var staticHW=this.getSize().toString().split(",");var tmpDiv=this.GetStaticMapDiv();tmpDiv.style.top=(0-this.getDragOffset().y)+"px";tmpDiv.style.left=(0-this.getDragOffset().x)+"px";if(!this.staticMapImg)
{this.staticMapImg=document.createElement("img");this.staticMapImg.className="map-static";this.staticMapImg.style.position="absolute";this.staticMapImg.style.top="0";this.staticMapImg.style.left="0";this.staticMapImg.style.border="none";this.staticMapImg.style.display="block";this.staticMapImg.alt="";tmpDiv.appendChild(this.staticMapImg);}
this.staticMapImg.style.width=staticHW[0]+"px";this.staticMapImg.style.height=staticHW[1]+"px";this.staticMapImg.src=staticMapImgSrc;this.staticMapImg.style.display="block";this.staticMapEnabled=true;this.GetLoadingDiv().style.zIndex=0;}
MQTileMap.prototype.hideStaticMap=function()
{if(!this.staticMapEnabled){return;}
this.turnEventsOff=false;if(!this.tilesExist())
{this.showDragableMap();}
if(this.staticMapImg)
{this.staticMapImg.style.display="none";this.div1.style.zIndex=0;this.GetPoiDiv().style.zIndex=90;if(getBrowserInfo().name=='safari'&&this.dcCanvasDiv){this.dcCanvasDiv.style.zIndex=70;}
this.setLogoZindex(MQMapLogo.MAPQUEST_COPYRIGHT,22);this.setLogoZindex(MQMapLogo.MAPQUEST,22);this.setLogoZindex(MQMapLogo.SCALES,22);this.setLogoZindex(MQMapLogo.ICUBED_COPYRIGHT,22);this.setLogoZindex(MQMapLogo.NAVTEQ_COPYRIGHT,22);this.getDeclutter().redrawLeaderLines();}
this.staticMapEnabled=false;}
MQTileMap.prototype.HandleObjectDrag=function(e)
{if(this.draggedObject){this.draggedObject.element.style.left=this.draggedObject.offsetX+e.clientX-this.draggedObject.startX+"px";this.draggedObject.element.style.top=this.draggedObject.offsetY+e.clientY-this.draggedObject.startY+"px";if(this.draggedObject.mqrw&&!this.draggedObject.mqrw.isHidden()&&(Math.abs(this.draggedObject.startX-e.clientX)>3||Math.abs(this.draggedObject.startY-e.clientY)>3)&&!this.getDeclutter().keepRolloversOnDrag)
this.draggedObject.mqrw.hide();};};MQTileMap.prototype.HandleObjectDrop=function(e)
{if(this.draggedObject&&this.mypois.contains(this.draggedObject)&&this.draggedObject.isDragging)
{this.draggedObject.mqrw.hide();this.draggedObject.finishDrag();}}
MQTileMap.prototype.setBestFitMargin=function(bestFitMargin)
{this.SetBestFitMargin(bestFitMargin);};MQTileMap.prototype.getBestFitMargin=function()
{return this.GetBestFitMargin();};function MQInitOverlays(callback)
{if(dojo.require){dojo.require("dojox.gfx");if(callback){dojo.addOnLoad(callback);};};};MQShapeOverlay.prototype=new MQObject();MQShapeOverlay.prototype.constructor=MQShapeOverlay;function MQShapeOverlay()
{this.map=null;this.key='';this.color=[0,0,0,1];this.altColor=null;this.colorAlpha='1';this.altColorAlpha=null;this.fillColor=[0,0,0,1];this.altFillColor=null;this.fillColorAlpha='1';this.altFillColorAlplha=null;this.borderWidth='3';this.altBorderWidth=null;this.altStateFlag=false;this.visible=true;this.className='MQShapeOverlay';this.shapePoints=null;this.shapePointsXY=0;this.shape=null;this.maxZoomLevel=16;this.minZoomLevel=1;};MQShapeOverlay.prototype.adjustXY=function(pntXY)
{pntXY.x=pntXY.x+(this.map.SURFACE_OFFSET);pntXY.y=pntXY.y+(this.map.SURFACE_OFFSET);return pntXY;};MQShapeOverlay.prototype.setKey=function(key)
{this.key=key;};MQShapeOverlay.prototype.getKey=function()
{return this.key;};MQShapeOverlay.prototype.setColor=function(color)
{this.color=dojox.gfx.normalizeColor(color).toRgba();this.color[3]=this.colorAlpha;if(this.shape&&!this.altStateFlag){this.shape.setStroke({color:this.color,width:this.borderWidth});};};MQShapeOverlay.prototype.getColor=function()
{return[this.color[0],this.color[1],this.color[2]];};MQShapeOverlay.prototype.setAltColor=function(altColor)
{this.altColor=dojox.gfx.normalizeColor(altColor).toRgba();this.altColor[3]=this.altColorAlpha;if(this.shape&&this.altStateFlag){this.shape.setStroke({color:this.altColor,width:this.altBorderWidth});};};MQShapeOverlay.prototype.getAltColor=function()
{if(this.altColor){return[this.altColor[0],this.altColor[1],this.altColor[2]];}else{return[this.color[0],this.color[1],this.color[2]];};};MQShapeOverlay.prototype.setColorAlpha=function(colorAlpha)
{var c=this.color;c[3]=(colorAlpha!=0?colorAlpha:0.001);this.color=c;this.colorAlpha=c[3];if(this.shape&&!this.altStateFlag){this.shape.setStroke({color:this.color,width:this.borderWidth});};};MQShapeOverlay.prototype.getColorAlpha=function()
{return(this.colorAlpha!=0.001?this.colorAlpha:0);};MQShapeOverlay.prototype.setAltColorAlpha=function(altColorAlpha)
{var c=(this.altColor!=null?this.altColor:this.color);c[3]=(altColorAlpha!=0?altColorAlpha:0.001);this.altColorAlpha=c[3];if(this.shape&&this.altStateFlag){this.shape.setStroke({color:c,width:this.altBorderWidth});};};MQShapeOverlay.prototype.getAltColorAlpha=function()
{if(this.altColorAlpha!=null){return(this.altColorAlpha!=0.001?this.altColorAlpha:0);}else{return(this.colorAlpha!=0.001?this.colorAlpha:0);};};MQShapeOverlay.prototype.setFillColor=function(fillColor)
{this.fillColor=dojox.gfx.normalizeColor(fillColor).toRgba();this.fillColor[3]=this.fillColorAlpha;if(this.shape&&!this.altStateFlag){this.shape.setFill(this.fillColor);};};MQShapeOverlay.prototype.getFillColor=function()
{return[this.fillColor[0],this.fillColor[1],this.fillColor[2]];};MQShapeOverlay.prototype.setAltFillColor=function(altFillColor)
{this.altFillColor=dojox.gfx.normalizeColor(altFillColor).toRgba();this.altFillColor[3]=(this.altFillColorAlpha!=null?this.altFillColorAlpha:this.fillColorAlpha);if(this.shape&&this.altStateFlag){this.shape.setFill(this.altFillColor);};};MQShapeOverlay.prototype.getAltFillColor=function()
{if(this.altFillColor!=null){return[this.altFillColor[0],this.altFillColor[1],this.altFillColor[2]];}else{return[this.fillColor[0],this.fillColor[1],this.fillColor[2]];};};MQShapeOverlay.prototype.setFillColorAlpha=function(fillColorAlpha)
{var c=this.fillColor;c[3]=(fillColorAlpha!=0?fillColorAlpha:0.001);this.fillColor=c;this.fillColorAlpha=c[3];if(this.shape&&!this.altStateFlag){this.shape.setFill(this.fillColor);};};MQShapeOverlay.prototype.getFillColorAlpha=function()
{return(this.fillColorAlpha!=0.001?this.fillColorAlpha:0);};MQShapeOverlay.prototype.setAltFillColorAlpha=function(altFillColorAlpha)
{var c=(this.altFillColor!=null?this.altFillColor:this.fillColor);c[3]=(altFillColorAlpha!=0?altFillColorAlpha:0.001);this.altFillColorAlpha=c[3];if(this.shape&&this.altStateFlag){this.shape.setFill(c);};};MQShapeOverlay.prototype.getAltFillColorAlpha=function()
{if(this.altFillColorAlpha!=null){return(this.altFillColorAlpha!=0.001?this.altFillColorAlpha:0);}else{return(this.fillColorAlpha!=0.001?this.fillColorAlpha:0);};};MQShapeOverlay.prototype.setBorderWidth=function(lineWidth)
{this.borderWidth=lineWidth;if(this.shape&&!this.altStateFlag){this.shape.setStroke({color:this.color,width:this.borderWidth});};};MQShapeOverlay.prototype.getBorderWidth=function()
{return this.borderWidth;};MQShapeOverlay.prototype.setAltBorderWidth=function(lineWidth)
{this.altBorderWidth=lineWidth;if(this.shape&&this.altStateFlag){this.shape.setStroke({color:this.altColor,width:this.altBorderWidth});};};MQShapeOverlay.prototype.getAltBorderWidth=function()
{if(this.altBorderWidth!=null){return this.altBorderWidth;}else{return this.borderWidth;};};MQShapeOverlay.prototype.setAltStateFlag=function(altStateFlag)
{this.altStateFlag=altStateFlag;if(this.shape){props=this.getCurrentState();this.shape.setStroke({color:props.color,width:props.borderWidth});this.shape.setFill(props.fillColor);};};MQShapeOverlay.prototype.getAltStateFlag=function()
{return this.altStateFlag;};MQShapeOverlay.prototype.setVisible=function(bVisible)
{this.visible=bVisible;if(this.shape){var theOverlay=(this.className=='MQImageOverlay'?this.shape.firstChild:this.shape.rawNode);theOverlay.style.display=(bVisible?'inline':'none');};};MQShapeOverlay.prototype.getVisible=function()
{return this.visible;};MQShapeOverlay.prototype.setMaxZoomLevel=function(level)
{var zoomLevel=parseInt(level);if(isNaN(zoomLevel))return;this.maxZoomLevel=(zoomLevel>16)?16:((zoomLevel<this.minZoomLevel)?this.minZoomLevel:zoomLevel);this.redraw();};MQShapeOverlay.prototype.getMaxZoomLevel=function()
{return this.maxZoomLevel;};MQShapeOverlay.prototype.setMinZoomLevel=function(level)
{var zoomLevel=parseInt(level);if(isNaN(zoomLevel))return;this.minZoomLevel=(zoomLevel<1)?1:((zoomLevel>this.maxZoomLevel)?this.maxZoomLevel:zoomLevel);this.redraw();};MQShapeOverlay.prototype.getMinZoomLevel=function()
{return this.minZoomLevel;};MQShapeOverlay.prototype.getClassName=function()
{return this.className;};MQShapeOverlay.prototype.setShapePoints=function(shapePnts)
{this.shapePointsXY=(arguments.length==2?arguments[1]:0);if(this.shapePointsXY){if(shapePnts.setLowerRight){var newShapePoints=new MQObjectCollection();newShapePoints.add(new MQPoint(shapePnts.ul.x,shapePnts.ul.y));newShapePoints.add(new MQPoint(shapePnts.lr.x,shapePnts.lr.y));shapePnts=newShapePoints;};}else{if(shapePnts.setLowerRight){var newShapePoints=new MQLatLngCollection();newShapePoints.add(new MQLatLng(shapePnts.ul.lat,shapePnts.ul.lng));newShapePoints.add(new MQLatLng(shapePnts.lr.lat,shapePnts.lr.lng));shapePnts=newShapePoints;};};this.shapePoints=shapePnts;if(this.shape){this.drawShape();};};MQShapeOverlay.prototype.getShapePoints=function()
{return this.shapePoints;};MQShapeOverlay.prototype.setAll=function(params)
{if(typeof(params.shapePoints)!='undefined')this.setShapePoints(params.shapePoints);if(typeof(params.key)!='undefined')this.setKey(params.key);if(typeof(params.color)!='undefined')this.setColor(params.color);if(typeof(params.altColor)!='undefined')this.setAltColor(params.altColor);if(typeof(params.colorAlpha)!='undefined')this.setColorAlpha(params.colorAlpha);if(typeof(params.altColorAlpha)!='undefined')this.setAltColorAlpha(params.altColorAlpha);if(this.className!='MQLineOverlay'){if(typeof(params.fillColor)!='undefined')this.setFillColor(params.fillColor);if(typeof(params.altFillColor)!='undefined')this.setAltFillColor(params.altFillColor);if(typeof(params.fillColorAlpha)!='undefined')this.setfillColorAlpha(params.fillColorAlpha);if(typeof(params.altFillColorAlpha)!='undefined')this.setAltFillColorAlpha(params.altFillColorAlpha);};if(typeof(params.borderWidth)!='undefined')this.setBorderWidth(params.borderWidth);if(typeof(params.altBorderWidth)!='undefined')this.setAltBorderWidth(params.altBorderWidth);if(typeof(params.altStateFlag)!='undefined')this.setAltStateFlag(params.altStateFlag);if(typeof(params.visible)!='undefined')this.setVisible(params.visible);};MQShapeOverlay.prototype.getCurrentState=function()
{var propSet=new Object();if(!this.altStateFlag){propSet.color=this.color;propSet.colorAlpha=this.colorAlpha;propSet.fillColor=this.fillColor;propSet.fillColorAlpha=this.fillColorAlpha;propSet.borderWidth=this.borderWidth;propSet.color[3]=this.colorAlpha;propSet.fillColor[3]=this.fillColorAlpha;}else{propSet.color=(this.altColor!=null?this.altColor:this.color);propSet.colorAlpha=(this.altColorAlpha!=null?this.altColorAlpha:this.colorAlpha);propSet.fillColor=(this.altFillColor!=null?this.altFillColor:this.fillColor);propSet.fillColorAlpha=(this.altFillColorAlpha!=null?this.altFillColorAlpha:this.fillColorAlpha);propSet.borderWidth=(this.altBorderWidth!=null?this.altBorderWidth:this.borderWidth);propSet.color[3]=(this.altColorAlpha!=null?this.altColorAlpha:this.colorAlpha)
propSet.fillColor[3]=(this.altFillColorAlpha!=null?this.altFillColorAlpha:this.fillColorAlpha);};propSet.visible=this.visible;propSet.url=this.url;propSet.maxZoomLevel=this.maxZoomLevel;propSet.minZoomLevel=this.minZoomLevel;return propSet;};MQShapeOverlay.prototype.clone=function(overlayToClone)
{this.key=overlayToClone.key;this.color=overlayToClone.color;this.altColor=overlayToClone.altColor;this.colorAlpha=overlayToClone.colorAlpha;this.altColorAlpha=overlayToClone.altColorAlpha;this.fillColor=overlayToClone.fillColor;this.altFillColor=overlayToClone.altFillColor;this.fillColorAlpha=overlayToClone.fillColorAlpha;this.altFillColorAlpha=overlayToClone.altFillColorAlpha;this.borderWidth=overlayToClone.borderWidth;this.altBorderWidth=overlayToClone.altBorderWidth;this.altStateFlag=overlayToClone.altStateFlag;this.visible=overlayToClone.visible;this.maxZoomLevel=overlayToClone.maxZoomLevel;this.minZoomLevel=overlayToClone.minZoomLevel;this.shapePoints=overlayToClone.shapePoints;this.shape=null;this.map=null;};MQShapeOverlay.prototype.redraw=function()
{if(!this.map)return;this.drawShape();};MQShapeOverlay.prototype.onClick=function(e)
{var mqe=new MQEvent(this.className+'.click');mqe.domEvent=e;MQEventManager.trigger(this,"click",mqe);mqe.srcObject=this;this.map.onClick(mqe);Event.stop(e);}
MQShapeOverlay.prototype.onDoubleClick=function(e)
{var mqe=new MQEvent(this.className+'.doubleClick');mqe.domEvent=e;MQEventManager.trigger(this,"dblclick",mqe);}
MQShapeOverlay.prototype.onMouseDown=function(e)
{var mqe=new MQEvent(this.className+'.mouseDown');mqe.domEvent=e;MQEventManager.trigger(this,"mousedown",mqe);}
MQShapeOverlay.prototype.onMouseUp=function(e)
{var mqe=new MQEvent(this.className+'.mouseUp');mqe.domEvent=e;MQEventManager.trigger(this,"mouseup",mqe);}
MQShapeOverlay.prototype.onMouseOver=function(e)
{var mqe=new MQEvent(this.className+'.mouseOver');mqe.domEvent=e;MQEventManager.trigger(this,"mouseover",mqe);Event.stop(e);}
MQShapeOverlay.prototype.onMouseOut=function(e)
{var mqe=new MQEvent(this.className+'.mouseOut');mqe.domEvent=e;MQEventManager.trigger(this,"mouseout",mqe);Event.stop(e);}
MQShapeOverlay.prototype.onRemoved=function(e)
{var mqe=new MQEvent(this.className+'.removed');mqe.domEvent=e;MQEventManager.trigger(this,"removed",mqe);}
MQRectangleOverlay.prototype=new MQShapeOverlay();MQRectangleOverlay.prototype.constructor=MQRectangleOverlay;function MQRectangleOverlay(overlayToClone)
{MQShapeOverlay.call(this);this.className='MQRectangleOverlay';if(overlayToClone){if(overlayToClone.getClassName()==this.className){this.clone(overlayToClone);};};};MQRectangleOverlay.prototype.drawShape=function()
{var xy1,xy2,iHeight,iWidth,propSet,tempx1,tempx2,tempy1,tempy2;xy1=this.map.llToPix(this.shapePoints.get(0));xy2=this.map.llToPix(this.shapePoints.get(1));xy1=this.adjustXY(xy1);xy2=this.adjustXY(xy2);tempx1=xy1.x;tempx2=xy2.x;tempy1=xy1.y;tempy2=xy2.y;if(xy1.x>xy2.x){xy1.x=tempx2;xy2.x=tempx1;};if(xy1.y>xy2.y){xy1.y=tempy2;xy2.y=tempy1;};propSet=this.getCurrentState();if(this.shape!=null){this.map.surface.remove(this.shape);};if((this.map.getZoomLevel()<propSet.minZoomLevel)||(this.map.getZoomLevel()>propSet.maxZoomLevel))return;var surfaceWidth=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));var surfaceHeight=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));xy1.x=(xy1.x<0?0:xy1.x);xy1.y=(xy1.y<0?0:xy1.y);iHeight=xy2.y-xy1.y;iWidth=xy2.x-xy1.x;iHeight=(iHeight>surfaceHeight?surfaceHeight:iHeight);iWidth=(iWidth>surfaceWidth?surfaceWidth:iWidth);if(!(iHeight<1||iWidth<1)){this.shape=this.map.surface.createRect({x:xy1.x,y:xy1.y,width:iWidth,height:iHeight}).setFill(propSet.fillColor).setStroke({color:propSet.color,width:propSet.borderWidth});this.shape.rawNode.style.display=(propSet.visible?'inline':'none');};if(this.shape){Event.observe(this.shape.rawNode,"click",MQEventCallback(this,"onClick"));Event.observe(this.shape.rawNode,"dblclick",MQEventCallback(this,"onDoubleClick"));Event.observe(this.shape.rawNode,"mousedown",MQEventCallback(this,"onMouseDown"));Event.observe(this.shape.rawNode,"mouseup",MQEventCallback(this,"onMouseUp"));Event.observe(this.shape.rawNode,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.shape.rawNode,"mouseout",MQEventCallback(this,"onMouseOut"));};};MQLineOverlay.prototype=new MQShapeOverlay();MQLineOverlay.prototype.constructor=MQLineOverlay;function MQLineOverlay(overlayToClone)
{MQShapeOverlay.call(this);this.className='MQLineOverlay';this.fillColorAlpha='0.001';this.altFillColorAlpha='0.001';if(overlayToClone){if(overlayToClone.getClassName()==this.className){this.clone(overlayToClone);};};};MQLineOverlay.prototype.drawShape=function()
{var i,j;var xy=new Array;for(i=0,j=this.shapePoints.getSize();i<j;i++){var p=new Object;p.x=this.map.llToPix(this.shapePoints.get(i)).x;p.y=this.map.llToPix(this.shapePoints.get(i)).y;p=this.adjustXY(p);xy[i]=p;};var propSet=this.getCurrentState();if(this.shape!=null){this.map.surface.remove(this.shape);};if((this.map.getZoomLevel()<propSet.minZoomLevel)||(this.map.getZoomLevel()>propSet.maxZoomLevel))return;var clippedXY=new Array();if(isOverLimit(xy)){var surfaceWidth=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));var surfaceHeight=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));clippedXY=MQClip(0,surfaceWidth,0,surfaceHeight,xy,false);}else{clippedXY=xy;};if(clippedXY.length){var sArray=new Array();sArray[sArray.length]='M '+Math.round(clippedXY[0].x)+','+Math.round(clippedXY[0].y)+' L ';for(var i=1,x=clippedXY.length;i<x;i++){sArray[sArray.length]=Math.round(clippedXY[i].x)+','+Math.round(clippedXY[i].y)+' ';};var s=sArray.join("");this.shape=this.map.surface.createPath(s).setFill(propSet.fillColor).setStroke({color:propSet.color,width:propSet.borderWidth});this.shape.rawNode.style.display=(propSet.visible?'inline':'none');};if(this.shape){Event.observe(this.shape.rawNode,"click",MQEventCallback(this,"onClick"));Event.observe(this.shape.rawNode,"dblclick",MQEventCallback(this,"onDoubleClick"));Event.observe(this.shape.rawNode,"mousedown",MQEventCallback(this,"onMouseDown"));Event.observe(this.shape.rawNode,"mouseup",MQEventCallback(this,"onMouseUp"));Event.observe(this.shape.rawNode,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.shape.rawNode,"mouseout",MQEventCallback(this,"onMouseOut"));};};MQLineOverlay.prototype.setFillColor=function()
{};MQLineOverlay.prototype.setAltFillColor=function()
{};MQLineOverlay.prototype.setFillColorAlpha=function()
{};MQLineOverlay.prototype.setAltFillColorAlpha=function()
{};MQPolygonOverlay.prototype=new MQShapeOverlay();MQPolygonOverlay.prototype.constructor=MQPolygonOverlay;function MQPolygonOverlay(overlayToClone)
{MQShapeOverlay.call(this);this.className='MQPolygonOverlay';if(overlayToClone){if(overlayToClone.getClassName()==this.className){this.clone(overlayToClone);};};};MQPolygonOverlay.prototype.drawShape=function()
{var i,j;var xy=new Array;for(i=0,j=this.shapePoints.getSize();i<j;i++){var p=new Object;p.x=this.map.llToPix(this.shapePoints.get(i)).x;p.y=this.map.llToPix(this.shapePoints.get(i)).y;p=this.adjustXY(p);xy[i]=p;};var propSet=this.getCurrentState();if(this.shape!=null){this.map.surface.remove(this.shape);};if((this.map.getZoomLevel()<propSet.minZoomLevel)||(this.map.getZoomLevel()>propSet.maxZoomLevel))return;var clippedXY=new Array();if(isOverLimit(xy)){var surfaceWidth=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));var surfaceHeight=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));clippedXY=MQClip(0,surfaceWidth,0,surfaceHeight,xy,true);}else{clippedXY=xy;};if(clippedXY.length){var sArray=new Array();sArray[sArray.length]='M '+Math.round(clippedXY[0].x)+','+Math.round(clippedXY[0].y)+' L ';for(var i=1,x=clippedXY.length;i<x;i++){sArray[sArray.length]=Math.round(clippedXY[i].x)+','+Math.round(clippedXY[i].y)+' ';};sArray[sArray.length]='Z';var s=sArray.join("");this.shape=this.map.surface.createPath(s).setFill(propSet.fillColor).setStroke({color:propSet.color,width:propSet.borderWidth});this.shape.rawNode.style.display=(propSet.visible?'inline':'none');};if(this.shape){Event.observe(this.shape.rawNode,"click",MQEventCallback(this,"onClick"));Event.observe(this.shape.rawNode,"dblclick",MQEventCallback(this,"onDoubleClick"));Event.observe(this.shape.rawNode,"mousedown",MQEventCallback(this,"onMouseDown"));Event.observe(this.shape.rawNode,"mouseup",MQEventCallback(this,"onMouseUp"));Event.observe(this.shape.rawNode,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.shape.rawNode,"mouseout",MQEventCallback(this,"onMouseOut"));};};MQEllipseOverlay.prototype=new MQShapeOverlay();MQEllipseOverlay.prototype.constructor=MQEllipseOverlay;function MQEllipseOverlay(overlayToClone)
{MQShapeOverlay.call(this);this.className='MQEllipseOverlay';if(overlayToClone){if(overlayToClone.getClassName()==this.className){this.clone(overlayToClone);};};};MQEllipseOverlay.prototype.drawShape=function()
{var xy1,xy2,iHeight,iWidth,propSet,tempx1,tempx2,tempy1,tempy2;var xRadius,yRadius,centerX,centerY;xy1=this.map.llToPix(this.shapePoints.get(0));xy2=this.map.llToPix(this.shapePoints.get(1));xy1=this.adjustXY(xy1);xy2=this.adjustXY(xy2);tempx1=xy1.x;tempx2=xy2.x;tempy1=xy1.y;tempy2=xy2.y;if(xy1.x>xy2.x){xy1.x=tempx2;xy2.x=tempx1;};if(xy1.y>xy2.y){xy1.y=tempy2;xy2.y=tempy1;};xRadius=Math.round((xy2.x-xy1.x)/2);yRadius=Math.round((xy2.y-xy1.y)/2);centerX=xy1.x+xRadius;centerY=xy1.y+yRadius;var surfaceWidth=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));var surfaceHeight=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));var drawMethod=0;if((xy1.x>surfaceWidth)||(xy2.x<0)||(xy1.y>surfaceHeight)||(xy2.y<0))drawMethod=1;if(!drawMethod){var x,y,c;var isInside=false;x=0;y=0;isInside=((x-centerX)*(x-centerX)/(xRadius*xRadius)+(y-centerY)*(y-centerY)/(yRadius*yRadius))<1;if(isInside){x=surfaceWidth;y=0;isInside=isInside&&(((x-centerX)*(x-centerX)/(xRadius*xRadius)+(y-centerY)*(y-centerY)/(yRadius*yRadius))<1);if(isInside){x=0;y=surfaceHeight;isInside=isInside&&(((x-centerX)*(x-centerX)/(xRadius*xRadius)+(y-centerY)*(y-centerY)/(yRadius*yRadius))<1);if(isInside){x=surfaceWidth;y=surfaceHeight;isInside=isInside&&(((x-centerX)*(x-centerX)/(xRadius*xRadius)+(y-centerY)*(y-centerY)/(yRadius*yRadius))<1);};};};if(isInside)drawMethod=2;};if(!drawMethod){if((xRadius*2)>32000||(yRadius*2)>32000){drawMethod=3;};};var propSet=this.getCurrentState();if(this.shape!=null){this.map.surface.remove(this.shape);};if((this.map.getZoomLevel()<propSet.minZoomLevel)||(this.map.getZoomLevel()>propSet.maxZoomLevel))return;switch(drawMethod){case 0:if(xRadius>1&&yRadius>1){this.shape=this.map.surface.createEllipse({cx:centerX,cy:centerY,rx:xRadius,ry:yRadius}).setFill(propSet.fillColor).setStroke({color:propSet.color,width:propSet.borderWidth});this.shape.rawNode.style.display=(propSet.visible?'inline':'none');};break;case 1:break;case 2:this.shape=this.map.surface.createRect({x:0,y:0,width:surfaceWidth,height:surfaceHeight}).setFill(propSet.fillColor).setStroke({color:propSet.color,width:propSet.borderWidth});this.shape.rawNode.style.display=(propSet.visible?'inline':'none');break;case 3:break;};if(this.shape){Event.observe(this.shape.rawNode,"click",MQEventCallback(this,"onClick"));Event.observe(this.shape.rawNode,"dblclick",MQEventCallback(this,"onDoubleClick"));Event.observe(this.shape.rawNode,"mousedown",MQEventCallback(this,"onMouseDown"));Event.observe(this.shape.rawNode,"mouseup",MQEventCallback(this,"onMouseUp"));Event.observe(this.shape.rawNode,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.shape.rawNode,"mouseout",MQEventCallback(this,"onMouseOut"));};};MQImageOverlay.prototype=new MQShapeOverlay();MQImageOverlay.prototype.constructor=MQImageOverlay;function MQImageOverlay(overlayToClone)
{MQShapeOverlay.call(this);this.className='MQImageOverlay';this.url=null;this.levels=null;this.opacity=1.0;if(overlayToClone){if(overlayToClone.getClassName()==this.className){this.clone(overlayToClone);};};};MQImageOverlay.prototype.drawShape=function()
{var xy1,xy2,iHeight,iWidth,propSet,tempx1,tempx2,tempy1,tempy2,iURL,currLevel,currDiff,newDiff,currImage;propSet=this.getCurrentState();if(this.levels){currLevel=this.map.getZoomLevel();currDiff=17;for(var i=0,j=this.levels.length;i<j;i++){if(this.levels[i].zoomLevel==currLevel){iURL=this.levels[i].url;break;}else{newDiff=Math.abs(this.levels[i].zoomLevel-currLevel);if(newDiff<currDiff){iURL=this.levels[i].url;currDiff=newDiff;};};};propSet.url=iURL;}else{propSet.url=this.url;};xy1=this.map.llToPix(this.shapePoints.get(0));xy2=this.map.llToPix(this.shapePoints.get(1));xy1=this.adjustXY(xy1);xy2=this.adjustXY(xy2);tempx1=xy1.x;tempx2=xy2.x;tempy1=xy1.y;tempy2=xy2.y;if(xy1.x>xy2.x){xy1.x=tempx2;xy2.x=tempx1;};if(xy1.y>xy2.y){xy1.y=tempy2;xy2.y=tempy1;};if(this.shape!=null){this.shape.firstChild.style.width='0px';this.shape.firstChild.height='0px';this.shape.firstChild.src='';this.shape.removeChild(this.shape.firstChild);this.map.overlaydiv.removeChild(this.shape);this.shape=null;};if((this.map.getZoomLevel()<propSet.minZoomLevel)||(this.map.getZoomLevel()>propSet.maxZoomLevel))return;if(this.map.GetDragOffset().x!=this.map.overlayOffsetX||this.map.GetDragOffset().y!=this.map.overlayOffsetY)
{this.map.overlayOffsetX=this.map.GetDragOffset().x;this.map.overlayOffsetY=this.map.GetDragOffset().y;if(this.map.overlaydiv)
{this.map.overlaydiv.style.left=-(this.map.SURFACE_OFFSET+this.map.overlayOffsetX)+'px';this.map.overlaydiv.style.top=-(this.map.SURFACE_OFFSET+this.map.overlayOffsetY)+'px';};};iHeight=xy2.y-xy1.y;iWidth=xy2.x-xy1.x;if(!(iHeight<1||iWidth<1)){this.shape=document.createElement('div');this.shape.style.position='absolute';this.shape.style.left=xy1.x;this.shape.style.top=xy1.y;this.map.overlaydiv.appendChild(this.shape);var theImage=document.createElement('img');theImage.width=iWidth;theImage.height=iHeight;theImage.style.height=iHeight+'px';theImage.style.width=iWidth+'px';theImage.src=propSet.url;theImage.UNSELECTABLE="on";theImage.MozUserSelect="none";this.shape.appendChild(theImage);this.shape.firstChild.style.display=(propSet.visible?'inline':'none');this.setImageOpacity(this.opacity);};if(this.shape){Event.observe(this.shape,"click",MQEventCallback(this,"onClick"));Event.observe(this.shape,"dblclick",MQEventCallback(this,"onDoubleClick"));Event.observe(this.shape,"mousedown",MQEventCallback(this,"onMouseDown"));Event.observe(this.shape,"mouseup",MQEventCallback(this,"onMouseUp"));Event.observe(this.shape,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.shape,"mouseout",MQEventCallback(this,"onMouseOut"));};};MQImageOverlay.prototype.setImageURL=function(url)
{if(this.levels==null)
{this.url=url;if(this.shape!=null)
{this.drawShape();};};};MQImageOverlay.prototype.getImageURL=function()
{return this.url;};function MQImageOverlayLevel(url,zoomLevel)
{this.url=url;this.zoomLevel=zoomLevel;};MQImageOverlay.prototype.setImageOverlayLevels=function(levels)
{this.levels=levels;if(this.shape!=null)
{this.drawShape();};};MQImageOverlay.prototype.getImageOverlayLevels=function()
{return this.levels;};MQImageOverlay.prototype.setImageOpacity=function(op)
{this.opacity=op;if(this.shape){if(getBrowserInfo().name=='msie'){this.shape.firstChild.style.filter='alpha(opacity='+(op*100)+')';};this.shape.firstChild.style.MozOpacity=op;this.shape.firstChild.style.opacity=op;};};MQImageOverlay.prototype.getImageOpacity=function()
{return this.opacity;};MQOverlayCollection.prototype=new MQTKObjectCollection();MQOverlayCollection.prototype.constructor=MQOverlayCollection;function MQOverlayCollection()
{MQTKObjectCollection.call(this);this.overlayCollectionName='default';};MQOverlayCollection.prototype.append=function(myOverlayCollection)
{var i;for(i=0;i<myOverlayCollection.getSize();i++)
{this.add(myOverlayCollection.getAt(i));};};MQOverlayCollection.prototype.getName=function()
{return this.overlayCollectionName;};MQOverlayCollection.prototype.setName=function(mqOverlayCollectionName)
{this.overlayCollectionName=mqOverlayCollectionName;};PAN_NORTH=0;PAN_SOUTH=1;PAN_EAST=2;PAN_WEST=3;function MQControl()
{}
MQControl.prototype={initialize:function(map)
{this.map=map;},getPosition:function()
{return this.position;},getHeight:function()
{return this.getHeightInternal(this.elem);},getHeightInternal:function(parent)
{var children=parent.childNodes;var height=0;for(var i=0,j=children.length;i<j;i++)
{if(children[i].childNodes.length>0&&children[i].style.overflow!="hidden")
{childHeight=this.getHeightInternal(children[i]);if(childHeight>height)height=childHeight;}
if(children[i].offsetHeight>height)height=children[i].offsetHeight;}
return height;},getWidth:function()
{return this.getWidthInternal(this.elem);},getWidthInternal:function(parent)
{var children=parent.childNodes;var width=0;for(var i=0,j=children.length;i<j;i++)
{if(children[i].childNodes.length>0&&children[i].style.overflow!="hidden")
{childWidth=this.getWidthInternal(children[i]);if(childWidth>width)width=childWidth;}
if(children[i].offsetWidth>width)width=children[i].offsetWidth;}
return width;}}
function MQLargeZoomControl()
{browser=getBrowserInfo();this.pan=new Array();this.zoombar=new Array();this.map=null;this.position=new MQMapCornerPlacement(MQMapCorner.TOP_LEFT,new MQSize(5,30));this.elem=document.createElement("div");this.elem.style.position="absolute";this.elem.style.overflow="visible";temp=document.createElement("div");temp.className="map-controls-bg screen";this.elem.appendChild(temp);temp1=document.createElement("div");temp1.style.position='relative';temp1.style.width='48px';temp1.style.height='45px';temp1.style.margin='0';temp1.style.padding='0 1px';if(browser.name=="msie"&&browser.version<7){temp1.style.backgroundImage="none";temp1.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-controls-top-bg.png', sizingMethod='image');";}else{temp1.style.backgroundColor="transparent";temp1.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/map-controls-top-bg.png)";temp1.style.backgroundPosition="0 0";temp1.style.backgroundRepeat="no-repeat";};temp.appendChild(temp1);temp1=document.createElement("div");temp1.style.position='relative';temp1.style.width='48px';temp1.style.height='236px';temp1.style.margin='0';temp1.style.padding='5px 0 0';if(browser.name=="msie"&&browser.version<7){temp1.style.backgroundImage="none";temp1.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-controls-middle-bg.png', sizingMethod='crop')";}else{temp1.style.backgroundColor="transparent";temp1.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/map-controls-middle-short-bg.png)";temp1.style.backgroundPosition="0 0";temp1.style.backgroundRepeat="repeat-y";};if(browser.name=='msie')
{temp1.style.height='241px';};temp.appendChild(temp1);temp1=document.createElement("div");temp1.style.position='relative';temp1.style.width='48px';temp1.style.height='18px';temp1.style.margin='0';temp1.style.padding='0';if(browser.name=="msie"&&browser.version<7){temp1.style.backgroundImage="none";temp1.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-controls-btm-short-bg.png', sizingMethod='image')";}else{temp1.style.backgroundColor="transparent";temp1.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/map-controls-btm-short-bg.png)";temp1.style.backgroundPosition="0 0";temp1.style.backgroundRepeat="no-repeat";};temp.appendChild(temp1);temp=document.createElement("ul");temp.className="map-controls screen";this.elem.appendChild(temp);temp1=document.createElement("li");temp1.className="map-compass-wrapper";temp.appendChild(temp1);temp2=document.createElement("div");temp2.className="map-compass";temp1.appendChild(temp2);temp3=document.createElement("img");temp3.border=0;if(browser.name=="msie"&&browser.version<7)
{temp3.src="http://img.mqcdn.com/a/a";temp3.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqmaptiled/map-compassrose.png', sizingMethod='image')";}
else
{temp3.src="http://img.mqcdn.com/mqtoolkit/map-compassrose.png";}
temp3.alt="compass rose";temp3.className="";temp2.appendChild(temp3);this.compassrose=temp3;temp3=document.createElement("img");temp3.border=0;temp3.src="http://img.mqcdn.com/a/a";temp3.className="map-compass-links";temp3.useMap="#mq-zoomcontrol-linkmap";temp2.appendChild(temp3);this.compassroseimg=temp3;temp3=document.createElement("map");temp3.name="mq-zoomcontrol-linkmap";temp3.id="mq-zoomcontrol-linkmap";temp2.appendChild(temp3);this.compassrosemap=temp3;temp4=document.createElement("area");temp4.shape="poly";temp4.coords="14,21,16,16,21,14,25,16,27,21,25,25,21,27,16,25,14,21,14,21";temp4.href="#center";temp3.appendChild(temp4);temp4=document.createElement("area");temp4.shape="rect";temp4.coords="11,1,29,12";temp4.href="#north";temp4.title="Pan North";temp4.alt="Pan North";temp3.appendChild(temp4);this.pan[PAN_NORTH]=temp4;temp4=document.createElement("area");temp4.shape="rect";temp4.coords="27,13,40,28";temp4.href="#east";temp4.title="Pan East";temp4.alt="Pan East";temp3.appendChild(temp4);this.pan[PAN_EAST]=temp4;temp4=document.createElement("area");temp4.shape="rect";temp4.coords="1,13,14,28";temp4.href="#west";temp4.title="Pan West";temp4.alt="Pan West";temp3.appendChild(temp4);this.pan[PAN_WEST]=temp4;temp4=document.createElement("area");temp4.shape="rect";temp4.coords="11,29,29,40";temp4.href="#south";temp4.title="Pan South";temp4.alt="Pan South";temp3.appendChild(temp4);this.pan[PAN_SOUTH]=temp4;temp1=document.createElement("li");temp1.className="map-zoom";temp.appendChild(temp1);temp2=document.createElement("div");temp2.className="io map-zoom-in";temp1.appendChild(temp2);this.zoomin=document.createElement("img");this.zoomin.alt="Zoom In";this.zoomin.title="Zoom In";this.zoomin.border=0;if(browser.name=="msie"&&browser.version<7)
{this.zoomin.src="http://img.mqcdn.com/a/a";this.zoomin.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/z-in.png', sizingMethod='image')";}
else
{this.zoomin.src="http://img.mqcdn.com/mqtoolkit/z-in.png";}
temp2.appendChild(this.zoomin);var ztemp=document.createElement("div");ztemp.className="map-zoombox";var obj=document.createElement("img");obj.border=0;if(browser.name=="msie"&&browser.version<7.0)
{obj.src="http://img.mqcdn.com/a/a";obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqmaptiled/zoombar.png', sizingMethod='image')";}
else
{obj.src="http://img.mqcdn.com/mqmaptiled/zoombar.png";}
ztemp.appendChild(obj);strHtm="<img src='http://img.mqcdn.com/a/a' border='0' class='map-zoom-links'/>";strHtm+="<img src='http://img.mqcdn.com/mqmaptiled/z-on.png' border='0' class='map-zoom-on'/>";strHtm+="<map>";var initX=1;var initY=10;for(var i=0;i<16;i++)
{strHtm+="<area alt='Zoom to level "+(16-i)+"' title='Zoom to level "+(16-i)+"' shape='rect' coords='1, "+(initX+i*12)+", 22, "+(initY+i*12)+"' />";}
strHtm+="</map>";ztemp.innerHTML+=strHtm;this.zoombox=ztemp;this.zoomarea=ztemp.childNodes[3].childNodes;temp1.appendChild(ztemp);temp2=document.createElement("div");temp2.className="io map-zoom-out";temp1.appendChild(temp2);this.zoomout=document.createElement("img");this.zoomout.alt="Zoom Out";this.zoomout.title="Zoom Out";this.zoomout.border=0;if(browser.name=="msie"&&browser.version<7)
{this.zoomout.src="http://img.mqcdn.com/a/a";this.zoomout.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/z-out.png', sizingMethod='image')";}
else
{this.zoomout.src="http://img.mqcdn.com/mqtoolkit/z-out.png";}
temp2.appendChild(this.zoomout);}
MQLargeZoomControl.prototype=new MQControl();MQLargeZoomControl.prototype.constructor=MQLargeZoomControl;MQLargeZoomControl.prototype.destructor=function()
{for(var i=0;i<4;i++)
{Event.stopObserving(this.pan[i],'click',this.MQEventCallbackObserver);Event.stopObserving(this.pan[i],'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.pan[i],'mouseout',this.MQEventCallbackObserver);}
Event.stopObserving(this.zoomin,'click',this.MQEventCallbackObserver);Event.stopObserving(this.zoomout,'click',this.MQEventCallbackObserver);Event.stopObserving(this.zoomin,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.zoomout,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.zoomin,'mouseout',this.MQEventCallbackObserver);Event.stopObserving(this.zoomout,'mouseout',this.MQEventCallbackObserver);for(var i=0;i<16;i++)
{Event.stopObserving(this.zoomarea[i],'click',this.MQEventCallbackObserver);Event.stopObserving(this.zoomarea[i],'mouseover',this.MQEventCallbackObserver);}
Event.stopObserving(this.zoombox,'mouseout',this.MQEventCallbackObserver);},MQLargeZoomControl.prototype.initialize=function(map)
{this.map=map;this.type=CONTROL_PANZOOM;this.setZoom(this.map.GetZoomLevel());this.MQEventCallbackObserver=MQEventCallback(this,"eventmonitor");this.compassroseimg.useMap="#mq-zoomcontrol-linkmap"+this.map.uniqueMapID;this.compassrosemap.name="mq-zoomcontrol-linkmap"+this.map.uniqueMapID;this.compassrosemap.id="mq-zoomcontrol-linkmap"+this.map.uniqueMapID;this.zoombox.childNodes[1].useMap="#zoompositions"+this.map.uniqueMapID;this.zoombox.childNodes[3].name="zoompositions"+this.map.uniqueMapID;this.zoombox.childNodes[3].id="zoompositions"+this.map.uniqueMapID;for(var i=0;i<4;i++)
{Event.observe(this.pan[i],'click',this.MQEventCallbackObserver);Event.observe(this.pan[i],'mouseover',this.MQEventCallbackObserver);Event.observe(this.pan[i],'mouseout',this.MQEventCallbackObserver);}
Event.observe(this.zoomin,'click',this.MQEventCallbackObserver);Event.observe(this.zoomout,'click',this.MQEventCallbackObserver);Event.observe(this.zoomin,'mouseover',this.MQEventCallbackObserver);Event.observe(this.zoomout,'mouseover',this.MQEventCallbackObserver);Event.observe(this.zoomin,'mouseout',this.MQEventCallbackObserver);Event.observe(this.zoomout,'mouseout',this.MQEventCallbackObserver);for(var i=0;i<16;i++)
{Event.observe(this.zoomarea[i],'click',this.MQEventCallbackObserver);Event.observe(this.zoomarea[i],'mouseover',this.MQEventCallbackObserver);}
Event.observe(this.zoombox,'mouseout',this.MQEventCallbackObserver);}
MQLargeZoomControl.prototype.eventmonitor=function(evt)
{if(Event.element(evt)==this.pan[PAN_NORTH])eventId="n";if(Event.element(evt)==this.pan[PAN_SOUTH])eventId="s";if(Event.element(evt)==this.pan[PAN_EAST])eventId="e";if(Event.element(evt)==this.pan[PAN_WEST])eventId="w";if(Event.element(evt)==this.zoomin)eventId="in";if(Event.element(evt)==this.zoomout)eventId="out";if(Event.element(evt)==this.zoombox.childNodes[1])return;for(var i=0;i<16;i++)
{if(Event.element(evt)==this.zoomarea[i]){eventId=16-i;break;};}
switch(evt.type)
{case"click":switch(eventId)
{case"in":if(this.map.getZoomLevel()<16)
{this.map.zoomIn();}
break;case"out":this.map.zoomOut();break;case"n":this.map.PanNorth(50);break;case"s":this.map.PanSouth(50);break;case"e":this.map.PanEast(50);break;case"w":this.map.PanWest(50);break;case"nil":break;default:this.map.setZoomLevel(eventId);break;}
break;case"mouseover":switch(eventId)
{case"in":case"out":Event.element(evt).addClassName("o");break;case"n":this.compassrose.className="n";break;case"s":this.compassrose.className="s";break;case"e":this.compassrose.className="e";break;case"w":this.compassrose.className="w";break;default:this.selectZoom(eventId);break;}
break;case"mouseout":switch(eventId)
{case"in":case"out":if(Event.element(evt).className!="o")return;Event.element(evt).removeClassName("o");break;case"n":case"s":case"e":case"w":this.compassrose.className="";break;default:if(parseFloat(eventId)!=this.map.GetZoomLevel())
{this.unselectZoom(eventId);}
break;}
break;}}
MQLargeZoomControl.prototype.setZoom=function(level)
{var z=this.zoombox.childNodes[2];z.style.top=((16-level)*12+1)+"px";z.alt="Zoom to level "+(level);z.title="Zoom to level "+(level);}
MQLargeZoomControl.prototype.selectZoom=function(level)
{this.zoombox.childNodes[0].style.left=0-((17-level)*25)+"px";}
MQLargeZoomControl.prototype.unselectZoom=function(level)
{this.zoombox.childNodes[0].style.left="0";}
MQLargeZoomControl.prototype.getHeight=function()
{return 298;}
MQLargeZoomControl.prototype.getWidth=function()
{return 45;}
function MQPanControl()
{browser=getBrowserInfo();this.pans=new Array();this.map=null;this.position=new MQMapCornerPlacement(MQMapCorner.TOP_LEFT,new MQSize(0,30));this.elem=document.createElement("div");this.elem.style.position="absolute";this.elem.style.overflow="visible";temp=document.createElement("div");temp.className="map-controls-bg screen";this.elem.appendChild(temp);temp1=document.createElement("div");temp1.style.position='relative';temp1.style.width='48px';temp1.style.height='52px';temp1.style.margin='0';temp1.style.padding='0 3px';if(browser.name=="msie"&&browser.version<7){temp1.style.backgroundImage="none";temp1.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-controls-box-bg.png', sizingMethod='image')";}else{temp1.style.backgroundColor="transparent";temp1.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/map-controls-box-bg.png)";temp1.style.backgroundPosition="0 0";temp1.style.backgroundRepeat="no-repeat";};temp.appendChild(temp1);temp=document.createElement("ul");temp.className="map-controls screen";this.elem.appendChild(temp);temp1=document.createElement("li");temp1.className="map-box-wrapper";temp.appendChild(temp1);temp2=document.createElement("div");temp2.className="map-compass";temp1.appendChild(temp2);temp3=document.createElement("img");temp3.border=0;if(browser.name=="msie"&&browser.version<7)
{temp3.src="http://img.mqcdn.com/a/a";temp3.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-compassrose.png', sizingMethod='image')";}
else
{temp3.src="http://img.mqcdn.com/mqtoolkit/map-compassrose.png";}
temp3.alt="compass rose";temp3.className="";temp2.appendChild(temp3);this.compassrose=temp3;temp3=document.createElement("img");temp3.border=0;temp3.src="http://img.mqcdn.com/a/a";temp3.className="map-compass-links";temp3.useMap="#mq-pancontrol-linkmap";temp2.appendChild(temp3);temp3=document.createElement("map");temp3.id="mq-pancontrol-linkmap";temp3.name="mq-pancontrol-linkmap";temp2.appendChild(temp3);temp4=document.createElement("area");temp4.shape="poly";temp4.coords="14,21,16,16,21,14,25,16,27,21,25,25,21,27,16,25,14,21,14,21";temp4.href="#center";temp3.appendChild(temp4);temp4=document.createElement("area");temp4.shape="rect";temp4.coords="11,1,29,12";temp4.href="#north";temp4.title="Pan North";temp4.alt="Pan North";temp3.appendChild(temp4);this.pans[PAN_NORTH]=temp4;temp4=document.createElement("area");temp4.shape="rect";temp4.coords="27,13,40,28";temp4.href="#east";temp4.title="Pan East";temp4.alt="Pan East";temp3.appendChild(temp4);this.pans[PAN_EAST]=temp4;temp4=document.createElement("area");temp4.shape="rect";temp4.coords="1,13,14,28";temp4.href="#west";temp4.title="Pan West";temp4.alt="Pan West";temp3.appendChild(temp4);this.pans[PAN_WEST]=temp4;temp4=document.createElement("area");temp4.shape="rect";temp4.coords="11,29,29,40";temp4.href="#south";temp4.title="Pan South";temp4.alt="Pan South";temp3.appendChild(temp4);this.pans[PAN_SOUTH]=temp4;}
MQPanControl.prototype=new MQControl();MQPanControl.prototype.constructor=MQPanControl;MQPanControl.prototype.destructor=function()
{for(var i=0;i<4;i++)
{Event.stopObserving(this.pans[i],'click',this.MQEventCallbackObserver);Event.stopObserving(this.pans[i],'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.pans[i],'mouseout',this.MQEventCallbackObserver);}}
MQPanControl.prototype.initialize=function(map)
{this.map=map;this.type=CONTROL_PAN;this.MQEventCallbackObserver=MQEventCallback(this,"eventmonitors");for(var i=0;i<4;i++)
{Event.observe(this.pans[i],'click',this.MQEventCallbackObserver);Event.observe(this.pans[i],'mouseover',this.MQEventCallbackObserver);Event.observe(this.pans[i],'mouseout',this.MQEventCallbackObserver);}}
MQPanControl.prototype.eventmonitors=function(evt)
{if(Event.element(evt)==this.pans[PAN_NORTH])eventId="n";if(Event.element(evt)==this.pans[PAN_SOUTH])eventId="s";if(Event.element(evt)==this.pans[PAN_EAST])eventId="e";if(Event.element(evt)==this.pans[PAN_WEST])eventId="w";switch(evt.type)
{case"click":switch(eventId)
{case"n":this.map.PanNorth(50);break;case"s":this.map.PanSouth(50);break;case"e":this.map.PanEast(50);break;case"w":this.map.PanWest(50);break;}
break;case"mouseover":switch(eventId)
{case"n":this.compassrose.className="n";break;case"s":this.compassrose.className="s";break;case"e":this.compassrose.className="e";break;case"w":this.compassrose.className="w";break;}
break;case"mouseout":this.compassrose.className="";break;}}
MQPanControl.prototype.getHeight=function()
{return 48;}
MQPanControl.prototype.getWidth=function()
{return 47;}
function MQZoomControl()
{browser=getBrowserInfo();this.map=null;this.position=new MQMapCornerPlacement(MQMapCorner.TOP_LEFT,new MQSize(0,30));this.elem=document.createElement("div");this.elem.style.position="absolute";this.elem.style.overflow="visible";temp=document.createElement("div");temp.className="map-controls-bg screen";temp.style.width="60px";this.elem.appendChild(temp);temp1=document.createElement("div");temp1.style.position='relative';temp1.style.width='60px';temp1.style.height='45px';temp1.style.margin='0';temp1.style.padding='0';if(browser.name=="msie"&&browser.version<7){temp1.style.backgroundImage="none";temp1.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/zoom-bg-tilemap.png', sizingMethod='image')";}else{temp1.style.backgroundColor="transparent";temp1.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/zoom-bg-tilemap.png)";temp1.style.backgroundPosition="0 0";temp1.style.backgroundRepeat="no-repeat";};temp.appendChild(temp1);temp=document.createElement("ul");temp.className="map-controls screen";this.elem.appendChild(temp);temp1=document.createElement("li");temp1.className="map-zoom";temp1.style.width="60px";temp1.style.height="50px";temp.appendChild(temp1);temp2=document.createElement("div");temp2.style.position="absolute";temp2.style.left="6px";temp2.style.top="8px";temp2.style.width="22px";temp2.className="io map-zoom-in";temp1.appendChild(temp2);this.zoomin=document.createElement("img");this.zoomin.alt="Zoom In";this.zoomin.title="Zoom In";this.zoomin.border=0;if(browser.name=="msie"&&browser.version<7)
{this.zoomin.src="http://img.mqcdn.com/a/a";this.zoomin.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/z-in.png', sizingMethod='image')";}
else
{this.zoomin.src="http://img.mqcdn.com/mqtoolkit/z-in.png";}
temp2.appendChild(this.zoomin);temp2=document.createElement("div");temp2.style.position="absolute";temp2.style.left="29px";temp2.style.top="6px";temp2.style.width="22px";temp2.className="io map-zoom-out";temp1.appendChild(temp2);this.zoomout=document.createElement("img");this.zoomout.alt="Zoom Out";this.zoomout.title="Zoom Out";this.zoomout.border=0;if(browser.name=="msie"&&browser.version<7)
{this.zoomout.src="http://img.mqcdn.com/a/a";this.zoomout.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/z-out.png', sizingMethod='image')";}
else
{this.zoomout.src="http://img.mqcdn.com/mqtoolkit/z-out.png";}
temp2.appendChild(this.zoomout);}
MQZoomControl.prototype=new MQControl();MQZoomControl.prototype.constructor=MQZoomControl;MQZoomControl.prototype.destructor=function()
{Event.stopObserving(this.zoomin,'click',this.MQEventCallbackObserver);Event.stopObserving(this.zoomout,'click',this.MQEventCallbackObserver);Event.stopObserving(this.zoomin,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.zoomout,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.zoomin,'mouseout',this.MQEventCallbackObserver);Event.stopObserving(this.zoomout,'mouseout',this.MQEventCallbackObserver);}
MQZoomControl.prototype.initialize=function(map)
{this.map=map;this.type=CONTROL_ZOOM;this.MQEventCallbackObserver=MQEventCallback(this,"eventmonitor");Event.observe(this.zoomin,'click',this.MQEventCallbackObserver);Event.observe(this.zoomout,'click',this.MQEventCallbackObserver);Event.observe(this.zoomin,'mouseover',this.MQEventCallbackObserver);Event.observe(this.zoomout,'mouseover',this.MQEventCallbackObserver);Event.observe(this.zoomin,'mouseout',this.MQEventCallbackObserver);Event.observe(this.zoomout,'mouseout',this.MQEventCallbackObserver);}
MQZoomControl.prototype.eventmonitor=function(evt)
{if(Event.element(evt)==this.zoomin)eventId="in";if(Event.element(evt)==this.zoomout)eventId="out";switch(evt.type)
{case"click":switch(eventId)
{case"in":if(this.map.getZoomLevel()<16)
{this.map.zoomIn();}
break;case"out":this.map.zoomOut();break;default:this.map.setZoomLevel(eventId);break;}
break;case"mouseover":switch(eventId)
{case"in":case"out":Event.element(evt).addClassName("o");break;default:Event.element(evt).src="http://img.mqcdn.com/mqmaptiled/z-on.png";}
break;case"mouseout":switch(eventId)
{case"in":case"out":Event.element(evt).removeClassName("o");break;default:if(parseFloat(eventId)!=this.map.getZoomLevel())
{Event.element(evt).src="http://img.mqcdn.com/mqmaptiled/z-"+eventId+".png";}}
break;}}
MQZoomControl.prototype.getHeight=function()
{return 40;}
MQZoomControl.prototype.getWidth=function()
{return 62;}
function MQViewControl()
{browser=getBrowserInfo();this.map=null;this.position=new MQMapCornerPlacement(MQMapCorner.TOP_RIGHT,new MQSize(150,0));this.elem=document.createElement("div");this.elem.style.position="absolute";this.elem.style.overflow="visible";temp=document.createElement("ul");temp.className="map-view screen";this.elem.appendChild(temp);temp1=document.createElement("li");temp1.className="map-view-street";temp.appendChild(temp1);this.streetview=document.createElement("img");this.streetview.className="";this.streetview.border=0;if(browser.name=="msie"&&browser.version<7)
{this.streetview.src="http://img.mqcdn.com/a/a";this.streetview.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/icon-btn-street-view.png', sizingMethod='image')";}
else
{this.streetview.src="http://img.mqcdn.com/mqtoolkit/icon-btn-street-view.png";}
this.streetview.alt="View Street Map";this.streetview.title="View Street Map";temp1.appendChild(this.streetview);temp1=document.createElement("li");temp1.className="map-view-aerial";temp.appendChild(temp1);this.aerialview=document.createElement("img");this.aerialview.className="";this.aerialview.border=0;if(browser.name=="msie"&&browser.version<7)
{this.aerialview.src="http://img.mqcdn.com/a/a";this.aerialview.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/icon-btn-aerial-view.png', sizingMethod='image')";}
else
{this.aerialview.src="http://img.mqcdn.com/mqtoolkit/icon-btn-aerial-view.png";}
this.aerialview.alt="View Aerial Image";this.aerialview.title="View Aerial Image";temp1.appendChild(this.aerialview);temp1=document.createElement("li");temp1.className="map-view-hybrid";temp.appendChild(temp1);this.hybridview=document.createElement("img");this.hybridview.className="";this.hybridview.border=0;if(browser.name=="msie"&&browser.version<7)
{this.hybridview.src="http://img.mqcdn.com/a/a";this.hybridview.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/icon-btn-hybrid-view.png', sizingMethod='image')";}
else
{this.hybridview.src="http://img.mqcdn.com/mqtoolkit/icon-btn-hybrid-view.png";}
this.hybridview.alt="View Hybrid Map";this.hybridview.title="View Hybrid Map";temp1.appendChild(this.hybridview);}
MQViewControl.prototype=new MQControl();MQViewControl.prototype.constructor=MQViewControl;MQViewControl.prototype.destructor=function()
{Event.stopObserving(this.streetview,'click',this.MQEventCallbackObserver);Event.stopObserving(this.streetview,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.streetview,'mouseout',this.MQEventCallbackObserver);Event.stopObserving(this.aerialview,'click',this.MQEventCallbackObserver);Event.stopObserving(this.aerialview,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.aerialview,'mouseout',this.MQEventCallbackObserver);Event.stopObserving(this.hybridview,'click',this.MQEventCallbackObserver);Event.stopObserving(this.hybridview,'mouseover',this.MQEventCallbackObserver);Event.stopObserving(this.hybridview,'mouseout',this.MQEventCallbackObserver);}
MQViewControl.prototype.initialize=function(map)
{this.map=map;this.type=CONTROL_TYPE;this.MQEventCallbackObserver=MQEventCallback(this,"eventmonitor");Event.observe(this.streetview,'click',this.MQEventCallbackObserver);Event.observe(this.streetview,'mouseover',this.MQEventCallbackObserver);Event.observe(this.streetview,'mouseout',this.MQEventCallbackObserver);Event.observe(this.aerialview,'click',this.MQEventCallbackObserver);Event.observe(this.aerialview,'mouseover',this.MQEventCallbackObserver);Event.observe(this.aerialview,'mouseout',this.MQEventCallbackObserver);Event.observe(this.hybridview,'click',this.MQEventCallbackObserver);Event.observe(this.hybridview,'mouseover',this.MQEventCallbackObserver);Event.observe(this.hybridview,'mouseout',this.MQEventCallbackObserver);if(this.map.getMapType()=="map")this.streetview.addClassName("a");if(this.map.getMapType()=="sat")this.aerialview.addClassName("a");if(this.map.getMapType()=="hyb")this.hybridview.addClassName("a");}
MQViewControl.prototype.eventmonitor=function(evt)
{switch(evt.type)
{case"click":if(Event.element(evt)==this.streetview)this.selectMode("street");if(Event.element(evt)==this.aerialview)this.selectMode("aerial");if(Event.element(evt)==this.hybridview)this.selectMode("hybrid");break;case"mouseover":Event.element(evt).addClassName("o");break;case"mouseout":Event.element(evt).removeClassName("o");break;}}
MQViewControl.prototype.updateControl=function(mtype)
{switch(mtype)
{case"map":this.aerialview.removeClassName("a");this.hybridview.removeClassName("a");this.streetview.addClassName("a");break;case"sat":this.hybridview.removeClassName("a");this.streetview.removeClassName("a");this.aerialview.addClassName("a");break;case"hyb":this.aerialview.removeClassName("a");this.streetview.removeClassName("a");this.hybridview.addClassName("a");break;}}
MQViewControl.prototype.selectMode=function(mode)
{var mtype=this.map.getMapType();var newMT="noChange";if(mode=="street"&&mtype!="map")
{newMT="map";}
if(mode=="aerial"&&mtype!="sat")
{newMT="sat";}
if(mode=="hybrid"&&mtype!="hyb")
{newMT="hyb";}
if(newMT!="noChange")
{this.map.setMapType(newMT);}}
MQViewControl.prototype.getHeight=function()
{return 22;}
MQViewControl.prototype.getWidth=function()
{return 209;}
if(MQ.browser.name=="msie"&&((MQ.browser.version<7)&&MQ.browser.version>5))
{MQ.utils._createImage("http://img.mqcdn.com/a/a",0,0,1,1,false);}
MQPoiCollection.prototype=new MQTKObjectCollection();MQPoiCollection.prototype.constructor=MQPoiCollection;function MQPoiCollection()
{MQTKObjectCollection.call(this);}
MQPoiCollection.prototype.getBoundingRect=function()
{if(this.getSize()==0)return null;var ulPoint=new MQLatLng(0.0,0.0);var lrPoint=new MQLatLng(0.0,0.0);for(i=0;i<this.getSize();i++)
{if(i==0)
{ulPoint.lat=this.getAt(i).element.ll.lat;ulPoint.lng=this.getAt(i).element.ll.lng;lrPoint.lat=this.getAt(i).element.ll.lat;lrPoint.lng=this.getAt(i).element.ll.lng;}
else
{if(this.getAt(i).element.ll.lat>ulPoint.lat)ulPoint.lat=this.getAt(i).element.ll.lat;if(this.getAt(i).element.ll.lat<lrPoint.lat)lrPoint.lat=this.getAt(i).element.ll.lat;if(this.getAt(i).element.ll.lng<ulPoint.lng)ulPoint.lng=this.getAt(i).element.ll.lng;if(this.getAt(i).element.ll.lng>lrPoint.lng)lrPoint.lng=this.getAt(i).element.ll.lng;}}
return new MQRectLL(ulPoint,lrPoint);}
MQPoiCollection.prototype.append=function(mqPoiCollection)
{for(i=0;i<mqPoiCollection.getSize();i++)
{this.add(mqPoiCollection.getAt(i));}}
function MQMapIcon(source)
{this.parentPoi=null;this.element=document.createElement("div");this.element.style.position="absolute";this.element.style.display="block";this.element.style.zIndex=0;this.image=null;this.shadow=null;this.anchorOffset=null;this.infoWindowAnchor=null;this.infoContentExists=false;if(source&&(source instanceof MQMapIcon))
{if(source.image)
{this.image=this._createImage(this._getImgSrc(source.image),parseInt(source.image.style.left),parseInt(source.image.style.top),parseInt(source.image.style.width),parseInt(source.image.style.height),source.image.isPng);}
if(source.shadow)
{this.shadow=this._createImage(this._getImgSrc(source.shadow),parseInt(source.shadow.style.left),parseInt(source.shadow.style.top),parseInt(source.shadow.style.width),parseInt(source.shadow.style.height),source.shadow.isPng);}
this.anchorOffset=new MQPoint(source.getAnchorOffset().getX(),source.getAnchorOffset().getY());this.infoWindowAnchor=new MQPoint(source.getInfoWindowAnchor().getX(),source.getInfoWindowAnchor().getY());}
else
{this.image=null;this.shadow=null;this.anchorOffset=null;this.infoWindowAnchor=null;this._calculateAnchors();}
if(this.image)
{this.element.appendChild(this.image);}
if(this.shadow)
{this.element.appendChild(this.shadow);}
this._defImageHeight=29;this._defImageWidth=29;}
MQMapIcon.prototype._calculateAnchors=function()
{if(this.image)
{this.anchorOffset=new MQPoint(-(parseInt(this.image.style.width)/2),-(parseInt(this.image.style.height)/2));this.infoWindowAnchor=new MQPoint(parseInt(this.image.style.width)/2,0);}}
MQMapIcon.prototype._fixPng=function(img)
{if((img.isPng)&&(MQ.browser.name=="msie"&&((MQ.browser.version<7)&&MQ.browser.version>5)))
{img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"', sizingMethod='image')";img.src="http://img.mqcdn.com/a/a";}}
MQMapIcon.prototype._getImgSrc=function(img)
{if(img)
{if((img.isPng)&&(MQ.browser.name=="msie"&&((MQ.browser.version<7)&&MQ.browser.version>5)))
{var filter=img.style.filter;var startIndex=filter.indexOf("src='");if(startIndex==-1)
throw new Error("MQMapIcon._getImgSrc: missing start of src string");startIndex+=5;var endIndex=filter.indexOf("'",startIndex);if(endIndex==-1)
throw new Error("MQMapIcon._getImgSrc: missing end of src string");var src=filter.substr(startIndex,endIndex-startIndex);return src;}
else
return img.src;}}
MQMapIcon.prototype.getImage=function()
{return this.image;}
MQMapIcon.prototype.setImage=function(url,width,height,recalculateAnchors,imgIsPng)
{if(this.image)this.element.removeChild(this.image);this.image=this._createImage(url,0,0,width,height,imgIsPng);this.element.appendChild(this.image);if((recalculateAnchors==null)||(recalculateAnchors==true))
this._calculateAnchors();}
MQMapIcon.prototype.getShadow=function()
{return this.shadow;}
MQMapIcon.prototype.setShadow=function(url,left,top,width,height,imgIsPng)
{if(this.shadow)this.element.removeChild(this.shadow);this.shadow=this._createImage(url,left,top,width,height,imgIsPng);this.element.appendChild(this.shadow);}
MQMapIcon.prototype.getElement=function()
{return this.element;}
MQMapIcon.prototype.getAnchorOffset=function()
{return this.anchorOffset;}
MQMapIcon.prototype.setAnchorOffset=function(mqPoint)
{this.anchorOffset=mqPoint;this.redraw();}
MQMapIcon.prototype.getInfoWindowAnchor=function()
{return this.infoWindowAnchor;}
MQMapIcon.prototype.setInfoWindowAnchor=function(mqPoint)
{this.infoWindowAnchor=mqPoint;}
MQMapIcon.prototype.redraw=function()
{if(!this.parentPoi)return;this.parentPoi.redraw();}
MQMapIcon.prototype._createImage=function(url,left,top,width,height,imgIsPng)
{return MQ.utils._createImage(url,left,top,width,height,imgIsPng);}
MQMapIcon.prototype._hasPngExtention=function(url)
{return MQ.utils._hasPngExtension(url);}
MQMapIcon.prototype._checkInit=function(url)
{if(this.image==null)
{this.image=this._createImage("http://img.mqcdn.com/mqtoolkit/star.png",0,0,this._defImageHeight,this._defImageWidth,true);this.element.appendChild(this.image);}
if(this.shadow==null)
{this.shadow=this._createImage("http://img.mqcdn.com/mqtoolkit/shadow.png",6,25,23,7,true);this.element.appendChild(this.shadow);}
if(this.anchorOffset==null)
{this.anchorOffset=new MQPoint(-(parseInt(this.image.style.width)/2),-(parseInt(this.image.style.height)/2));}
if(this.infoWindowAnchor==null)
{this.infoWindowAnchor=new MQPoint(parseInt(this.image.style.width)/2,0);}}
function MQPoi(mqLatLng,mqMapIcon)
{this.map=null;this.mqrw=null;this.mqiw=null;this.mqMapIcon=null;if(mqMapIcon&&(mqMapIcon instanceof MQMapIcon))
this.mqMapIcon=mqMapIcon;else
this.mqMapIcon=new MQMapIcon();this.mqMapIcon.parentPoi=this;this.mqAltMapIcon=null;this.altStateFlag=false;this.element=document.createElement("div");this.element.ll=new MQLatLng(mqLatLng.getLatitude(),mqLatLng.getLongitude());this.element.offset=this.mqMapIcon.getAnchorOffset();this.element.style.display="block";this.element.appendChild(this.mqMapIcon.getElement());this.labelDiv=null;this.labelText=null;this.labelSpan=null;this.key="";this.rolloverContent=null;this.infoWindowContent=null;this.rolloverEnabled=true;this.showingInfo=false;this.isDraggable=false;this.isDragging=false;this.dragFlag=false;this.snapback=false;this.keepRolloverOnDrag=true;this.leaderLine=false;this.leaderLineDot=false;this.leaderLineColor=null;this.leaderLineDotImage=null;this.leaderLineDotIcon=null;this.dragTop=null;this.dragLeft=null;Event.observe(this.element,"click",MQEventCallback(this,"onClick"));Event.observe(this.element,"dblclick",MQEventCallback(this,"onDoubleClick"));Event.observe(this.element,"mousedown",MQEventCallback(this,"onMouseDown"));Event.observe(this.element,"mouseup",MQEventCallback(this,"onMouseUp"));Event.observe(this.element,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.element,"mouseout",MQEventCallback(this,"onMouseOut"));}
MQPoi.prototype.getElement=function()
{return this.element;}
MQPoi.prototype.onClick=function(e)
{if(Event.element(e).id=="poiclose"||Event.element(e).parentNode.id=="poiclose")return;if(this.mqiw!=null&&this.mqiw.opener==this)return;if(!this.dragFlag||(this.dragFlag&&(Math.abs(this.startX-e.clientX)<3&&Math.abs(this.startY-e.clientY)<3))){this.showInfoWindow();var mqe=new MQEvent('MQPoi.click');var ptOffset=this.map._getParentOffset(this.map.parent);var cx=e.clientX-ptOffset.x;var cy=e.clientY-ptOffset.y;mqe.xy=new MQPoint(cx,cy);mqe.button=(Event.isLeftClick(e))?BUTTON_MQ_LEFT:BUTTON_MQ_RIGHT;mqe.domEvent=e;MQEventManager.trigger(this,"click",mqe);mqe.srcObject=this;this.map.onClick(mqe);Event.stop(e);};this.dragFlag=false;}
MQPoi.prototype.onDoubleClick=function(e)
{var mqe=new MQEvent('MQPoi.dblClick');var ptOffset=this.map._getParentOffset(this.map.parent);var cx=e.clientX-ptOffset.x;var cy=e.clientY-ptOffset.y;mqe.xy=new MQPoint(cx,cy);mqe.button=(Event.isLeftClick(e))?BUTTON_MQ_LEFT:BUTTON_MQ_RIGHT;mqe.domEvent=e;MQEventManager.trigger(this,"dblclick",mqe);}
MQPoi.prototype.onMouseDown=function(e)
{var mqe=new MQEvent('MQPoi.mouseDown');var ptOffset=this.map._getParentOffset(this.map.parent);var cx=e.clientX-ptOffset.x;var cy=e.clientY-ptOffset.y;mqe.xy=new MQPoint(cx,cy);mqe.button=(Event.isLeftClick(e))?BUTTON_MQ_LEFT:BUTTON_MQ_RIGHT;mqe.domEvent=e;if(this.getDraggable()){var poiImg=(this.altStateFlag&&this.mqAltMapIcon)?this.mqAltMapIcon.image:this.mqMapIcon.image;var dragOffset=this.map.getDragOffset();var scrOff=getWindowScrollXY();var evtX=cx+scrOff.x;var evtY=cy+scrOff.y;var poiLeft=parseInt(this.element.style.left)+dragOffset.x;var poiTop=parseInt(this.element.style.top)+dragOffset.y;var poiMouseDownFlg=(evtY>=poiTop)&&(evtY<=(poiTop+parseInt(poiImg.height)));poiMouseDownFlg=poiMouseDownFlg&&(evtX>=poiLeft)&&evtX<=(poiLeft+parseInt(poiImg.width));if(!poiMouseDownFlg)
{MQEventManager.trigger(this,"mousedown",mqe);return;}
if(isNaN(parseInt(this.element.style.left))){this.element.style.left=0};if(isNaN(parseInt(this.element.style.top))){this.element.style.top=0};this.offsetX=parseInt(this.element.style.left);this.offsetY=parseInt(this.element.style.top);this.startX=e.clientX;this.startY=e.clientY;this.isDragging=true;this.map.draggedObject=this;if(this.leaderLine)this.map.surface.remove(this.leaderLine);if(this.leaderLineDot)this.map.surface.remove(this.leaderLineDot);if(this.map.dcCanvasContext){this.map.dcCanvasContext.clearRect(0,0,parseInt(this.map.dcCanvasDiv.style.width),parseInt(this.map.dcCanvasDiv.style.height));if(this.map.getDeclutter()){if(this.map.getDeclutter().getDeclutterMode()==2){this.map.getDeclutter().redrawLeaderLines(this);};};};if(this.leaderLineDotIcon)this.leaderLineDotIcon.div.im.style.display='none';if(this.map.getDeclutter()){if(!this.map.getDeclutter().keepRolloversOnDrag&&this.map.getDeclutter().getDeclutterMode()==2){if(this.isRolloverShowable())
{};}else{if(!this.keepRolloverOnDrag){if(this.isRolloverShowable())
{this.mqrw.hide();};};};}else{if(!this.keepRolloverOnDrag){if(this.isRolloverShowable())
{this.mqrw.hide();};};};if(e.preventDefault)e.preventDefault();if((getBrowserInfo().name=='firefox')&&this.mqiw&&this.mqiw.opener==this&&this.mqiw.popup.content.childNodes[1]){var left=this.mqiw.popup.content.childNodes[1].scrollLeft;var top=this.mqiw.popup.content.childNodes[1].scrollTop;this.mqiw.popup.content.childNodes[1].style.overflow="hidden";this.mqiw.popup.content.childNodes[1].scrollLeft=left;this.mqiw.popup.content.childNodes[1].scrollTop=top;}};MQEventManager.trigger(this,"mousedown",mqe);};MQPoi.prototype.onMouseUp=function(e)
{var mqe=new MQEvent('MQPoi.mouseUp');var ptOffset=this.map._getParentOffset(this.map.parent);var cx=e.clientX-ptOffset.x;var cy=e.clientY-ptOffset.y;mqe.xy=new MQPoint(cx,cy);mqe.button=(Event.isLeftClick(e))?BUTTON_MQ_LEFT:BUTTON_MQ_RIGHT;mqe.domEvent=e;if(this.isDragging){if(this.isRolloverShowable()&&!this.map.getDeclutter().keepRolloversOnDrag)
{this.mqrw.setOpenerAndShow(this);this.element.style.zIndex=110;};this.finishDrag();};MQEventManager.trigger(this,"mouseup",mqe);}
MQPoi.prototype.finishDrag=function()
{var safari=(getBrowserInfo().name=='safari');this.isDragging=false;var dragOffset=this.map.getDragOffset();if(this.getAltStateFlag()){var iconOffsetX=this.getAltIcon().getAnchorOffset().getX();var iconOffsetY=this.getAltIcon().getAnchorOffset().getY();}else{var iconOffsetX=this.getIcon().getAnchorOffset().getX();var iconOffsetY=this.getIcon().getAnchorOffset().getY();};var newX=(parseInt(this.element.style.left)-iconOffsetX)+dragOffset.x;var newY=(parseInt(this.element.style.top)-iconOffsetY)+dragOffset.y;this.dragFlag=true;if((Math.abs(this.offsetX-parseInt(this.element.style.left))>3)||(Math.abs(this.offsetY-parseInt(this.element.style.top)>3))){if(this.map.getDeclutter()){if(this.map.getDeclutter().getDeclutterMode()==2&&!this.getAltStateFlag()){this.setAltStateFlag(true);};};};var dcMode=(this.map.getDeclutter()?this.map.getDeclutter().getDeclutterMode():0);if(this.snapback&&dcMode!=2){this.setLatLng(this.getLatLng());}else{if(this.map.getDeclutter()){if(this.map.getDeclutter().getDeclutterMode()==0){this.setLatLng(this.map.pixToLL(new MQPoint(newX,newY)));}else if(this.map.getDeclutter().getDeclutterMode()==2){theLatLngXY=this.map.llToPix(this.getLatLng())
this.dragLeft=theLatLngXY.x-(dragOffset.x+parseInt(this.element.style.left));this.dragTop=theLatLngXY.y-(dragOffset.y+parseInt(this.element.style.top));if((Math.abs(this.offsetX-parseInt(this.element.style.left))>3)||(Math.abs(this.offsetY-parseInt(this.element.style.top))>3)||this.getAltStateFlag()){if(!safari){this.map.getDeclutter().drawLeaderLine(this);}else{this.map.getDeclutter().redrawLeaderLines();};};}else{};}else{this.setLatLng(this.map.pixToLL(new MQPoint(newX,newY)));};};this.map.draggedObject=null;if((getBrowserInfo().name=='firefox')&&this.mqiw&&this.mqiw.opener==this&&this.mqiw.popup.content.childNodes[1]){var left=this.mqiw.popup.content.childNodes[1].scrollLeft;var top=this.mqiw.popup.content.childNodes[1].scrollTop;this.mqiw.popup.content.childNodes[1].style.overflow="auto";this.mqiw.popup.content.childNodes[1].scrollLeft=left;this.mqiw.popup.content.childNodes[1].scrollTop=top;}};MQPoi.prototype.onMouseOver=function(e)
{if(MQ.utils.isMouseLeaveOrEnter(e,this.element)){var mqe=new MQEvent('MQPoi.mouseOver');mqe.domEvent=e;var draggedPoiPresent=(this.map.draggedObject&&this.map.mypois.contains(this.map.draggedObject)&&this.map.draggedObject.isDragging)?true:false;if(!this.isDragging&&!draggedPoiPresent&&(this.mqrw.isHidden()||this.mqrw.opener!=this)){this.showRolloverWindow(mqe);};MQEventManager.trigger(this,"mouseover",mqe);}}
MQPoi.prototype.onMouseOut=function(e)
{if(MQ.utils.isMouseLeaveOrEnter(e,this.element)){if(this.isRolloverShowable()&&!this.isDragging&&this.mqrw.opener==this)
{this.mqrw.hide();}
var mqe=new MQEvent('MQPoi.mouseOut');mqe.domEvent=e;MQEventManager.trigger(this,"mouseout",mqe);}}
MQPoi.prototype.onInfoWindowOpen=function(e)
{this.element.style.zIndex=100;var mqe=new MQEvent('MQPoi.infoWindowOpen');mqe.domEvent=e;this.showRolloverWindow(mqe);MQEventManager.trigger(this,"infowindowopen",mqe);}
MQPoi.prototype.onInfoWindowClose=function(e)
{this.showingInfo=false;this.element.style.zIndex=90;var mqe=new MQEvent('MQPoi.infoWindowClose');mqe.domEvent=e;MQEventManager.trigger(this,"infowindowclose",mqe);}
MQPoi.prototype.onRolloverOpen=function(e)
{this.element.style.zIndex=110;MQEventManager.trigger(this,"rolloveropen",e);}
MQPoi.prototype.onRolloverClose=function(e)
{this.element.style.zIndex=90;MQEventManager.trigger(this,"rolloverclose",e);}
MQPoi.prototype.onRemoved=function(e)
{var mqe=new MQEvent('MQPoi.removed');mqe.domEvent=e;MQEventManager.trigger(this,"removed",mqe);}
MQPoi.prototype.getLatLng=function()
{return new MQLatLng(this.element.ll.lat,this.element.ll.lng);}
MQPoi.prototype.setLatLng=function(mqLatLng)
{this.element.ll=new MQLatLng(mqLatLng.getLatitude(),mqLatLng.getLongitude());this.redraw();}
MQPoi.prototype.getIcon=function()
{return this.mqMapIcon;}
MQPoi.prototype.setIcon=function(mqMapIcon)
{this.element.removeChild(this.mqMapIcon.getElement());this.mqMapIcon=mqMapIcon;this.element.appendChild(this.mqMapIcon.getElement());this.mqMapIcon.parentpoi=this;this.redraw();}
MQPoi.prototype.isIconVisible=function()
{var isVisible=false;isVisible=(this.mqMapIcon.getElement().style.display!="none");isVisible=isVisible||(this.mqAltMapIcon.getElement().style.display!="none");return isVisible;}
MQPoi.prototype.setIconVisible=function(b)
{if(b){if(this.altStateFlag){if(this.mqAltMapIcon){this.mqAltMapIcon.getElement().style.display="block";this.mqMapIcon.getElement().style.display="none";}else{this.mqMapIcon.getElement().style.display="block";};}else{this.mqMapIcon.getElement().style.display="block";if(this.mqAltMapIcon){this.mqAltMapIcon.getElement().style.display="none";};};}else{this.mqMapIcon.getElement().style.display="none";this.mqAltMapIcon.getElement().style.display="none";};};MQPoi.prototype.getAltIcon=function()
{if(this.mqAltMapIcon){return this.mqAltMapIcon;}else{return this.mqMapIcon;};}
MQPoi.prototype.setAltIcon=function(mqAltMapIcon)
{if(isNaN(parseInt(this.element.style.left))){this.element.style.left=0};if(isNaN(parseInt(this.element.style.top))){this.element.style.top=0};var cx=parseInt(this.element.style.left);var cy=parseInt(this.element.style.top);if(this.mqAltMapIcon){this.element.removeChild(this.mqAltMapIcon.getElement());};this.mqAltMapIcon=new MQMapIcon();this.mqAltMapIcon=mqAltMapIcon;this.mqAltMapIcon.parentPoi=this;this.element.appendChild(this.mqAltMapIcon.getElement());this.setAltStateFlag(this.altStateFlag);this.redraw();this.element.style.left=cx+"px";this.element.style.top=cy+"px";};MQPoi.prototype.setAltStateFlag=function(b)
{this.altStateFlag=b;if(this.mqAltMapIcon){if(this.map){var theDiffX=this.getIcon().getAnchorOffset().getX()-this.getAltIcon().getAnchorOffset().getX();var theDiffY=this.getIcon().getAnchorOffset().getY()-this.getAltIcon().getAnchorOffset().getY();}else{theDiffX=0;theDiffY=0;};if(b){this.element.style.left=(parseInt(this.element.style.left)+theDiffX)+'px';this.element.style.top=(parseInt(this.element.style.top)+theDiffY)+'px';this.mqAltMapIcon.getElement().style.display="block";this.mqMapIcon.getElement().style.display="none";}else{if(this.map&&(this.map.getDeclutter().getDeclutterMode()==0)){this.element.style.left=(parseInt(this.element.style.left)-theDiffX)+'px';this.element.style.top=(parseInt(this.element.style.top)-theDiffY)+'px';};this.mqAltMapIcon.getElement().style.display="none";this.mqMapIcon.getElement().style.display="block";};if(this.map){if(this.map.getDeclutter()&&b){if(this.map.getDeclutter().getDeclutterMode()==2)this.map.getDeclutter().drawLeaderLine(this);};};};}
MQPoi.prototype.getAltStateFlag=function()
{return this.altStateFlag;}
MQPoi.prototype.getKey=function()
{return this.key;}
MQPoi.prototype.setKey=function(key)
{this.key=key;}
MQPoi.prototype.isVisible=function()
{return(this.element.style.display!="none"?true:false);}
MQPoi.prototype.setVisible=function(b)
{if(b)
this.element.style.display="block";else
this.element.style.display="none";}
MQPoi.prototype.setLevel=function(i)
{this.element.style.zIndex=i;}
MQPoi.prototype.getLabel=function()
{return(this.labelText==null)?"":this.labelText.data;}
MQPoi.prototype.setLabel=function(label,className)
{if(!this.labelDiv){this.labelDiv=document.createElement("div");this.labelDiv.className="mq-poi-label";this.labelDiv.style.MozUserSelect="none";this.labelDiv.onselectstart=function(){return false;};this.labelSpan=document.createElement("span");this.labelText=document.createTextNode("");this.labelSpan.appendChild(this.labelText);this.labelDiv.appendChild(this.labelSpan);this.element.appendChild(this.labelDiv);};this.labelText.data=label;if(!className)
{this.labelDiv.className="mq-poi-label";this.redrawLabel();}
else
{this.labelDiv.className=className;}}
MQPoi.prototype.getLabelStyle=function()
{return this.labelDiv.style;}
MQPoi.prototype.isLabelVisible=function()
{return(this.labelDiv.style.display!="none"?true:false);}
MQPoi.prototype.setLabelVisible=function(b)
{if(b)
{this.labelDiv.style.display="block";this.redrawLabel();}
else
this.labelDiv.style.display="none";}
MQPoi.prototype.redrawLabel=function()
{if(this.labelDiv){if(this.labelDiv.className=="mq-poi-label"&&this.labelText.data.length>0)
{this.labelDiv.style.width=this.labelSpan.offsetWidth+"px";var width=(this.mqMapIcon.getImage())?this.mqMapIcon.getImage().style.width:this.mqMapIcon._defImageWidth;var height=(this.mqMapIcon.getImage())?this.mqMapIcon.getImage().height:this.mqMapIcon._defImageHeight;this.labelDiv.style.left=(parseInt(width)/2-this.labelSpan.offsetWidth/2)+"px";this.labelDiv.style.top=height+"px";};};}
MQPoi.prototype.redraw=function()
{if(!this.map)return;this.map.UpdatePOI(this.element.ll,this.mqMapIcon.getAnchorOffset(),this.element);if(this.mqAltMapIcon&&this.altStateFlag){this.map.UpdatePOI(this.element.ll,this.mqMapIcon.getAnchorOffset(),this.element);};this.redrawLabel();}
MQPoi.prototype.showRolloverWindow=function(e)
{if(this.mqrw==null)
{this.mqrw=this.map.getRolloverWindow();}
if(this.isRolloverShowable())
{this.element.appendChild(this.mqrw.minipopup);this.mqrw.modify(this.map.GetLLToXY(this.element.ll),this.rolloverContent,this.getIcon().getInfoWindowAnchor(),this);this.mqrw.setOpenerAndShow(this);this.onRolloverOpen(new MQEvent('MQPoi.rolloverOpen'));}}
MQPoi.prototype.showInfoWindow=function()
{if(this.infoWindowContent!=null)
{if(this.mqiw==null)
{this.mqiw=this.map.getInfoWindow();}
if(this.isRolloverShowable())
{this.mqrw.hide();}
this.element.appendChild(this.mqiw.popup);this.mqiw.modify(this.map.GetLLToXY(this.element.ll),this.rolloverContent,this.infoWindowContent,this.getIcon().getInfoWindowAnchor());this.mqiw.setOpenerAndShow(this);this.showingInfo=true;this.onInfoWindowOpen(new MQEvent('MQPoi.infoWindowOpen'));}}
MQPoi.prototype.setInfoTitleHTML=function(title)
{var container=document.createElement("div");container.innerHTML="<div>"+title+"</div>";this.rolloverContent=container;}
MQPoi.prototype.setInfoContentHTML=function(content)
{if(content==undefined)return;if(content!="")this.infoContentExists=true;var container=document.createElement("div");container.innerHTML="<div>"+content+"</div>";this.infoWindowContent=container;}
MQPoi.prototype.setInfoTitleElement=function(titleContainer)
{this.rolloverContent=titleContainer;}
MQPoi.prototype.setInfoContentElement=function(contentContainer)
{this.infoWindowContent=contentContainer;}
MQPoi.prototype.setRolloverEnabled=function(benable)
{this.rolloverEnabled=benable;}
MQPoi.prototype.isRolloverEnabled=function()
{return this.rolloverEnabled;}
MQPoi.prototype.isRolloverShowable=function()
{return this.isRolloverEnabled()&&this.map.getRolloversEnabled()&&(this.rolloverContent!=null)&&!this.showingInfo;}
MQPoi.prototype.getInfoWindow=function()
{return this.mqiw;}
MQPoi.prototype.getDraggable=function()
{if(this.map){if(this.map.getDeclutter()){if(this.map.getDeclutter().getDeclutterMode()==2){return true;};};};return this.isDraggable;}
MQPoi.prototype.setDraggable=function(isEnabled)
{this.isDraggable=isEnabled;if(arguments.length>1){this.keepRolloverOnDrag=arguments[1];};}
MQPoi.prototype.getSnapback=function()
{return this.snapback;}
MQPoi.prototype.setSnapback=function(snap)
{this.snapback=snap;}
MQPoi.prototype.getLeaderLineColor=function()
{if(this.leaderLineColor){return this.leaderLineColor;}else{if(this.map.getDeclutter()){return this.map.getDeclutter().leaderLineColor;}else{return'#000000';};};};MQPoi.prototype.setLeaderLineColor=function(c)
{this.leaderLineColor=c;if(this.map.getDeclutter()){if(this.map.getDeclutter().getDeclutterMode()==2){this.map.getDeclutter().drawLeaderLine(this);};};};MQPoi.prototype.setRolloverDrag=function(b)
{this.keepRolloverOnDrag=b;};MQPoi.prototype.getRolloverDrag=function()
{return this.keepRolloverOnDrag;};MQPoi.prototype.setLeaderLineDotImage=function(url,width,height)
{this.leaderLineDotImage=new MQLeaderLineDotImage(url,width,height);if(this.map.getDeclutter()){if(this.map.getDeclutter().getDeclutterMode()==2){this.map.getDeclutter().drawLeaderLine(this);};};};MQPoi.prototype.getLeaderLineDotImage=function()
{return this.leaderLineDotImage;};function MQLeaderLineDotImage(url,width,height)
{this.url=url;this.width=width;this.height=height;};function MQLeaderLineDotIcon(dotImage,map,poi){this.map=map;this.div=document.createElement('div');this.div.im=document.createElement('img');this.div.im.src=dotImage.url;this.div.im.style.height=dotImage.height;this.div.im.style.width=dotImage.width;this.div.im.style.position='absolute';this.div.im.style.display='block';this.div.style.MozUserSelect="none";this.div.appendChild(this.div.im);this.map.AddPOI(poi.getLatLng(),new PointXY(-dotImage.width/2,-dotImage.height/2),this.div);};function MQInfoWindow(map)
{this.map=map;this.enabled=true;this.point=null;this.title=null;this.content=null;this.offset=null;this.maxwidth=this.map.width-50;this.minwidth=60;this.maxheight=this.map.height-50;this.contentwidth=null;this.titlebackgroundcolor=null;this.opener=null;this.infoWindowSrc="http://img.mqcdn.com/mqtoolkit/infopopup.png";this.popup=document.createElement("div");this.popup.id="popupcontainer";this.popup.className="mqpoipopup";this.popup.currentElement=null;this.popup.oncontextmenu=function(){return false;};var str="<div id='poiclose' class='mqpoiclose'><div style='width:650px;height:685px;margin-left:-180px;margin-top:-650px;'></div></div>";str+="<div id='popup-topleft' style='position:absolute;overflow:hidden;'><div style='width:650px;height:685px;'></div></div>";str+="<div id='popup-topright' style='position:absolute;width:20px;overflow:hidden;'><div style='width:650px;height:685px;margin-left:-630px;'></div></div>";str+="<div id='popup-bottomleft' style='position:absolute;height:15px;overflow:hidden;'><div style='width:650px;height:685px;margin-top:-630px;'></div></div>";str+="<div id='popup-bottomright' style='position:absolute;width:20px;height:15px;overflow:hidden;'><div style='width:650px;height:685px;margin-left:-630px;margin-top:-630px;'></div></div>";str+="<div id='popup-pointer' style='position:absolute;width:20px;height:22px;overflow:hidden;'><div style='width:650px;height:685px;margin-left:-50px;margin-top:-654px;'></div></div>";str+="<div id='popup-fillercontainer'></div>";str+="<div id='popup-content' style='position:absolute;left:13px;top:13px;overflow:auto;z-index:1;'></div></div>";this.popup.innerHTML=str;this.popup.style.position="absolute";this.popup.style.visibility="hidden";this.popup.style.left='-1000px';this.popup.style.top='-1000px';document.body.appendChild(this.popup);var poiclose=this.popup.childNodes[0];var popupTopLeft=this.popup.childNodes[1];var popupTopRight=this.popup.childNodes[2];var popupBottomLeft=this.popup.childNodes[3];var popupBottomRight=this.popup.childNodes[4];var popupPointer=this.popup.childNodes[5];var popupFillerContainer=this.popup.childNodes[6];Event.observe(poiclose,"click",MQEventCallback(this,"clickClose"));this.popup.content=this.popup.childNodes[7];;Event.observe(this.popup,"click",MQEventCallback(this,"onClick"));if(MQ.browser.name=="msie"&&(MQ.browser.version>5)&&(MQ.browser.version<7))
{popupTopLeft.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";popupTopRight.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";popupBottomLeft.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";popupBottomRight.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";popupPointer.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";poiclose.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";}
else
{popupTopLeft.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";popupTopRight.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";popupBottomLeft.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";popupBottomRight.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";popupPointer.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";poiclose.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";}}
MQInfoWindow.prototype.onOpen=function(e)
{MQEventManager.trigger(this,"opened",e);}
MQInfoWindow.prototype.onClose=function(e)
{MQEventManager.trigger(this,"closed",e);}
MQInfoWindow.prototype.onClickedClosed=function(e)
{e=new MQEvent('MQInfoWindow.clickedClosed');MQEventManager.trigger(this,"clickedclosed",e);Event.stop(e);}
MQInfoWindow.prototype.clickClose=function(evt)
{this.hide();this.onClickedClosed(evt);Event.stop(evt);}
MQInfoWindow.prototype.onClick=function(evt)
{evt.srcObject=this;};MQInfoWindow.prototype.hide=function()
{if(!this.isHidden())
{if(this.popup.style.visibility!="hidden"){this.popup.style.visibility="hidden";this.popup.style.display="none";}
if(this.opener!=null)
{if(this.map.getDeclutter()){if((this.map.getDeclutter().getDeclutterMode()!=0)&&this.opener.decluttered){this.opener.setVisible(false);};};this.opener.onInfoWindowClose(new MQEvent('MQTileMap.infoWindowClose'));this.opener=null;}
this.onClose(new MQEvent('MQInfoWindow.close'));}}
MQInfoWindow.prototype.setOpenerAndShow=function(opener)
{this.show();this.opener=opener;}
MQInfoWindow.prototype.show=function()
{if(!this.isHidden())this.hide();this.popup.style.display="block";var offsetY=this.offset.y;var offsetHeight=this.popup.offsetHeight+3;var offsetX=this.offset.x;var offsetWidth=25;this.popup.style.top=(offsetY-offsetHeight)+"px";this.popup.style.left=(offsetX-offsetWidth)+"px";this.popup.style.visibility="visible";this.avoidPopupCollisions(this.popup);this.onOpen(new MQEvent('MQInfoWindow.open'));}
MQInfoWindow.prototype.isHidden=function()
{return(this.popup.style.visibility=="hidden");}
MQInfoWindow.prototype.modify=function(point,title,content,offset)
{if(point)this.point=point;if(title)this.title=title;if(content)this.content=content;this.offset=new PointXY(0,0);if(offset)this.offset=offset;this.popup.style.position="absolute";this.resize(false);}
MQInfoWindow.prototype.getMaxWidth=function()
{return this.maxwidth;}
MQInfoWindow.prototype.setMaxWidth=function(width)
{width=parseInt(width);if(isNaN(width))return;this.maxwidth=(width>this.map.width-50)?(this.map.width-50):(width<this.minwidth)?this.minwidth:width;}
MQInfoWindow.prototype.getMinWidth=function()
{return this.minwidth;}
MQInfoWindow.prototype.setMinWidth=function(width)
{width=parseInt(width);if(isNaN(width))return;this.minwidth=(width<60)?60:(width>this.maxwidth)?this.maxwidth:width;}
MQInfoWindow.prototype.getContentWidth=function()
{return this.contentwidth;}
MQInfoWindow.prototype.setContentWidth=function(width)
{this.contentwidth=width;}
MQInfoWindow.prototype.getTitleBackgroundColor=function()
{return this.titlebackgroundcolor;}
MQInfoWindow.prototype.setTitleBackgroundColor=function(color)
{this.titlebackgroundcolor=color;}
MQInfoWindow.prototype.getPointLL=function()
{return this.map.GetXYToLL(this.point);}
MQInfoWindow.prototype.getPointXY=function()
{return this.point;}
MQInfoWindow.prototype.getPixelOffset=function()
{return this.offset;}
MQInfoWindow.prototype.avoidPopupCollisions=function(popup){var collisionInfo=this.getCollisionInfo(popup);if(collisionInfo.panX!=0||collisionInfo.panY!=0){this.map.SlideMapByOffset(new PointXY(collisionInfo.panX,collisionInfo.panY));}}
MQInfoWindow.prototype.getCollisionInfo=function(element)
{var mapElement=this.map.parent;var collisionInfo={panX:0,panY:0};var mapLftTop=MQ.utils.getOffsetLftTop(mapElement);var elemPos=Position.cumulativeOffset(element);var leftTopPad=10;elemPos[0]=elemPos[0]-mapLftTop.left-leftTopPad;elemPos[1]=elemPos[1]-mapLftTop.top-leftTopPad;var compassDims={width:37,height:300}
var viewBtnDims={width:139,height:15}
var leftBound=(elemPos[0]<compassDims.width&&elemPos[1]<compassDims.height+leftTopPad)?compassDims.width:0;var topBound=(elemPos[0]+element.clientWidth>mapElement.clientWidth-viewBtnDims.width&&elemPos[1]<viewBtnDims.height+leftTopPad)?viewBtnDims.height:0;if(element.clientWidth>0&&element.clientHeight>0){if(elemPos[0]<leftBound){collisionInfo.panX=Math.abs(elemPos[0]-leftBound);}
else if(elemPos[0]+leftTopPad+element.clientWidth>mapElement.clientWidth){collisionInfo.panX=-1*(element.clientWidth+elemPos[0]+leftTopPad-mapElement.clientWidth);}
if(elemPos[1]<topBound){collisionInfo.panY=Math.abs(elemPos[1]-topBound);}
else if(elemPos[1]+element.clientHeight>mapElement.clientHeight){collisionInfo.panY=mapElement.clientHeight-elemPos[1]-element.clientHeight;}}
return collisionInfo;}
MQInfoWindow.prototype.getOpener=function()
{return this.opener;}
MQInfoWindow.prototype.resize=function(bContentChanged)
{var poiclose=this.popup.childNodes[0];var popupTopLeft=this.popup.childNodes[1];var popupTopRight=this.popup.childNodes[2];var popupBottomLeft=this.popup.childNodes[3];var popupBottomRight=this.popup.childNodes[4];var popupPointer=this.popup.childNodes[5];var popupFillerContainer=this.popup.childNodes[6];var xtraDivInfoForTitle="";if(this.getTitleBackgroundColor()){xtraDivInfoForTitle=" style=background:"+this.getTitleBackgroundColor();}
popupFillerContainer.innerHTML="";this.popup.style.display="block";this.popup.content.style.width="auto";this.popup.content.style.height="auto";this.popup.content.style.overflow="visible";var contentHtml="";if(bContentChanged){if(this.popup.content)
contentHtml=this.popup.content.innerHTML;}else{contentHtml="<div class='mqpoiheading'"+xtraDivInfoForTitle+" title='"+stripHTMLTags(this.title.innerHTML)+"'>"+this.title.innerHTML+"</div><div class='mqpoicontenttext'>"+this.content.innerHTML+"</div>";}
this.popup.content.innerHTML=contentHtml;var popupContentHeading=this.popup.content.childNodes[0];var popupContentText=this.popup.content.childNodes[1];popupContentHeading.style.display="none";popupContentText.style.whiteSpace="nowrap";popupContentText.style.overflow="visible";popupContentText.style.width="auto";popupContentText.style.height="auto";var popupOffWidth=this.popup.content.offsetWidth+35+2;var hScrollAdj=(popupOffWidth>this.maxwidth)?18:0;popupOffWidth=(popupOffWidth>this.maxwidth)?this.maxwidth:(popupOffWidth<this.minwidth)?this.minwidth:popupOffWidth;var contentWidth=popupOffWidth-35;popupContentText.style.width=contentWidth+"px";popupContentHeading.style.display="";popupContentText.style.whiteSpace="";var popupOffHeight=this.popup.content.offsetHeight+hScrollAdj+30+2;var vScrollAdj=(popupOffHeight>this.maxheight)?18:0;contentWidth+=vScrollAdj;popupOffWidth+=vScrollAdj;popupContentHeading.style.width=(contentWidth-18)+"px";var titleDiv=popupContentHeading.childNodes[0];if(typeof(titleDiv.tagName)=='undefined')
{popupContentHeading.innerHTML="<div>"+this.title.innerHTML+"</div>";titleDiv=popupContentHeading.childNodes[0];}
titleDiv.style.display="inline";if((titleDiv.offsetWidth>(contentWidth-18))&&((contentWidth-18)>25))
{var titleString=stripHTMLTags(this.title.innerHTML);var titleStringWithHTML=titleDiv.innerHTML;for(var i=titleString.length;(titleDiv.offsetWidth>=(contentWidth-18)&&i>0);i--)
{titleDiv.innerHTML=getHTMLSubstring(titleStringWithHTML,i,"&nbsp;...");}}
popupOffHeight=this.popup.content.offsetHeight+hScrollAdj+30+2;popupOffHeight=(popupOffHeight>this.maxheight)?this.maxheight:popupOffHeight;var contentHeight=popupOffHeight-30+2;var noOfHElements=Math.ceil(contentWidth/600);var lastHElementWidth=contentWidth%600;var noOfVElements=Math.ceil(contentHeight/600);var lastVElementHeight=contentHeight%600;var fillerWidth,fillerHeight,totalWidth,totalHeight;var fillerWidthAdj,fillerHeightAdj;var fillerTopAdjust,fillerLeftAdjust;var marginLeft,marginTop,fillerLeft,fillerTop;var maxFillerDivWidth=600;var maxFillerDivHeight=600;for(var i=1;i<=noOfVElements;i++){for(var j=1;j<=noOfHElements;j++){if(i==1&&j==1)continue;fillerWidth=(j==noOfHElements&&lastHElementWidth!=0)?lastHElementWidth:maxFillerDivWidth;fillerHeight=(i==noOfVElements&&lastVElementHeight!=0)?lastVElementHeight:maxFillerDivHeight;fillerWidthAdj=(j==1)?15:0;fillerHeightAdj=(i==1)?15:0;fillerTopAdjust=(i==1)?0:15;fillerLeftAdjust=(j==1)?0:15;marginLeft=(-1*fillerLeftAdjust);marginTop=(-1*fillerTopAdjust);totalWidth=(fillerWidth+fillerWidthAdj);totalHeight=(fillerHeight+fillerHeightAdj);fillerLeft=(((j-1)*maxFillerDivWidth)+fillerLeftAdjust);fillerTop=(((i-1)*maxFillerDivHeight)+fillerTopAdjust);this.createFillerDiv(marginLeft,marginTop,totalWidth,totalHeight,fillerLeft,fillerTop);if(i==1){marginLeft=-15;marginTop=-630;totalWidth=(fillerWidth+fillerWidthAdj);totalHeight=15;fillerLeft=(((j-1)*maxFillerDivWidth)+fillerLeftAdjust);fillerTop=(contentHeight+15);this.createFillerDiv(marginLeft,marginTop,totalWidth,totalHeight,fillerLeft,fillerTop);}}
if(i>1){marginLeft=-630;marginTop=-15;totalWidth=20;totalHeight=(fillerHeight+fillerHeightAdj);fillerLeft=(contentWidth+15);fillerTop=(((i-1)*maxFillerDivHeight)+fillerTopAdjust);this.createFillerDiv(marginLeft,marginTop,totalWidth,totalHeight,fillerLeft,fillerTop);}}
var topLeftWidth=(contentWidth>maxFillerDivWidth)?maxFillerDivWidth:contentWidth;var topLeftHeight=(contentHeight>maxFillerDivHeight)?maxFillerDivHeight:contentHeight;this.popup.style.width=(popupOffWidth)+"px";this.popup.style.height=(popupOffHeight)+"px";this.popup.content.style.width=contentWidth+"px";this.popup.content.style.height=contentHeight+"px";poiclose.style.left=(popupOffWidth-38)+"px";poiclose.style.top="12px";popupContentHeading.style.width=(contentWidth-18)+"px";popupContentText.style.width=contentWidth+"px";popupContentText.style.height=(contentHeight-popupContentHeading.offsetHeight-5)+"px";popupContentText.style.overflow="auto";popupTopLeft.style.width=topLeftWidth+15+"px";popupTopLeft.style.height=topLeftHeight+15+"px";popupTopRight.style.left=contentWidth+15+"px";popupTopRight.style.height=topLeftHeight+15+"px";popupBottomLeft.style.top=contentHeight+15+"px";popupBottomLeft.style.width=topLeftWidth+15+"px";popupBottomRight.style.top=contentHeight+15+"px";popupBottomRight.style.left=contentWidth+15+"px";popupPointer.style.left="14px";popupPointer.style.top=contentHeight+15+"px";if(bContentChanged){this.popup.style.visibility="hidden";this.show();}}
MQInfoWindow.prototype.createFillerDiv=function(marginLeft,marginTop,elementWidth,elementHeight,fillerLeft,fillerTop){var popupFillerContainer=this.popup.childNodes[6];var fillerDiv=document.createElement("div");fillerDiv.style.position="absolute";fillerDiv.style.overflow="hidden";var str="<div style='width:650px;height:685px;'></div>";fillerDiv.innerHTML=str;popupFillerContainer.appendChild(fillerDiv);if((getBrowserInfo().name=='msie')&&(parseFloat(getBrowserInfo().version)<7.0)){fillerDiv.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";}
else{fillerDiv.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";}
fillerDiv.childNodes[0].style.marginLeft=marginLeft+"px";fillerDiv.childNodes[0].style.marginTop=marginTop+"px";fillerDiv.style.width=elementWidth+"px";fillerDiv.style.height=elementHeight+"px";fillerDiv.style.left=fillerLeft+"px";fillerDiv.style.top=fillerTop+"px";}
function MQRolloverWindow(map)
{this.map=map;this.enabled=true;this.point=null;this.title=null;this.content=null;this.offset=new MQPoint(0,0);this.opener=null;this.maxwidth=null;this.artUrl="http://img.mqcdn.com/mqtoolkit/";this.flipStateEnabled=false;this.leftRolloverSrc=this.artUrl+"rollover-left.png";this.rightRolloverSrc=this.artUrl+"rollover-right.png";this.minipopup=null;this.textLength=31;this.leftRolloverOffsetX=-25;this.rightRolloverOffsetX=-193;this.createRolloverWindow();this.rolloverOffsetY=13-this.minipopup.offsetHeight;}
MQRolloverWindow.prototype.onOpen=function(e)
{MQEventManager.trigger(this,"opened",e);}
MQRolloverWindow.prototype.onClose=function(e)
{MQEventManager.trigger(this,"closed",e);}
MQRolloverWindow.prototype.hide=function(evt)
{if(!this.isHidden())
{if(this.minipopup.style.visibility!="hidden")this.minipopup.style.visibility="hidden";if(this.opener!=null)
{this.opener.onRolloverClose(new MQEvent('MQPoi.rolloverClose'));this.opener=null;}
this.onClose(new MQEvent('MQRolloverWindow.close'));}}
MQRolloverWindow.prototype.setOpenerAndShow=function(opener)
{this.show();this.opener=opener;}
MQRolloverWindow.prototype.show=function()
{if(!this.isHidden())this.hide();var offsetY=this.offset.y;var offsetX=this.offset.x;var rolloverSrc=this.leftRolloverSrc;this.minipopup.style.top=(offsetY+this.rolloverOffsetY)+"px";this.minipopup.style.left=(offsetX+this.leftRolloverOffsetX)+"px";if(this.flipStateEnabled)
{var collisionOffset=this.getCollisionInfo(this.minipopup);if(collisionOffset.panX<0)
{rolloverSrc=this.rightRolloverSrc;this.minipopup.style.top=(offsetY+this.rolloverOffsetY)+"px";this.minipopup.style.left=(offsetX+this.rightRolloverOffsetX)+"px";}}
if(MQ.browser.name=="msie"&&(MQ.browser.version>5)&&(MQ.browser.version<7))
{this.minipopup.style.display="none";this.minipopup.style.visibility="visible";this.minipopup.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+rolloverSrc+"', sizingMethod='scale')";this.minipopup.style.display="block";}
else
{this.minipopup.style.background="";this.minipopup.style.background="url("+rolloverSrc+") left";}
this.minipopup.style.visibility="visible";this.onOpen(new MQEvent('MQRolloverWindow.open'));}
MQRolloverWindow.prototype.isHidden=function()
{return(this.minipopup.style.visibility=="hidden");}
MQRolloverWindow.prototype.modify=function(point,content,offset,mqpoi)
{if(point)this.point=point;if(content)this.content=content;if(offset)this.offset=offset;this.minipopup.style.position="absolute";this.minipopup.style.zIndex=9;var titleString=stripHTMLTags(this.content.innerHTML);if(mqpoi.infoWindowContent&&this.textLength==31)this.textLength-=2;if(mqpoi.infoWindowContent)
{titleString=(titleString.length>this.textLength)?getHTMLSubstring(this.content.innerHTML,this.textLength,"&nbsp;...&nbsp;&raquo;"):getHTMLSubstring(this.content.innerHTML,titleString.length,"&nbsp;&raquo;");}
else
{titleString=(titleString.length>this.textLength)?getHTMLSubstring(this.content.innerHTML,this.textLength,"&nbsp;..."):getHTMLSubstring(this.content.innerHTML,titleString.length,"");}
this.minipopup.innerHTML="<div class='mqminipopuphead'>"+titleString+"</div>";}
MQRolloverWindow.prototype.getMaxWidth=function()
{return this.maxWidth;}
MQRolloverWindow.prototype.setMaxWidth=function(width)
{this.maxWidth=width;}
MQRolloverWindow.prototype.getPointLL=function()
{return this.map.GetXYToLL(this.point);}
MQRolloverWindow.prototype.getPointXY=function()
{return this.point;}
MQRolloverWindow.prototype.getPixelOffset=function()
{return this.offset;}
MQRolloverWindow.prototype.setRolloverGraphic=function(leftImgSrc,rightImgSrc)
{if(typeof leftImgSrc=='undefined')
this.leftRolloverSrc=this.artUrl+"rollover-left.png";else
this.leftRolloverSrc=leftImgSrc;this.rightRolloverSrc=rightImgSrc;}
MQRolloverWindow.prototype.setDefaultRollover=function()
{this.leftRolloverSrc=this.artUrl+"rollover-left.png";this.rightRolloverSrc=this.artUrl+"rollover-right.png";this.setRolloverGraphic(this.leftRolloverSrc,this.rightRolloverSrc);}
MQRolloverWindow.prototype.setFlipStateEnabled=function(benable)
{if(typeof benable=='undefined'||typeof benable!='boolean')
this.flipStateEnabled=false;else
this.flipStateEnabled=benable;}
MQRolloverWindow.prototype.getFlipStateEnabled=function()
{return this.flipStateEnabled;}
MQRolloverWindow.prototype.getCollisionInfo=function(element,compassPresent,viewBtnsPresent)
{var mapElement=this.map.parent;var collisionInfo={panX:0,panY:0};var isCompassPresent=(compassPresent)?compassPresent:false;var isViewBtnsPresent=(viewBtnsPresent)?viewBtnsPresent:false;var mapLftTop=MQ.utils.getOffsetLftTop(mapElement);var elemPos=Position.cumulativeOffset(element);var leftTopPad=0;elemPos[0]=elemPos[0]-mapLftTop.left-leftTopPad;elemPos[1]=elemPos[1]-mapLftTop.top-leftTopPad;var compassDims=(isCompassPresent)?{width:37,height:300}:{width:0,height:0};var viewBtnDims=(isViewBtnsPresent)?{width:139,height:15}:{width:0,height:0};var leftBound=(elemPos[0]<compassDims.width&&elemPos[1]<compassDims.height+leftTopPad)?compassDims.width:0;var topBound=(elemPos[0]+element.clientWidth>mapElement.clientWidth-viewBtnDims.width&&elemPos[1]<viewBtnDims.height+leftTopPad)?viewBtnDims.height:0;if(element.clientWidth>0&&element.clientHeight>0){if(elemPos[0]<leftBound){collisionInfo.panX=Math.abs(elemPos[0]-leftBound);}
else if(elemPos[0]+leftTopPad+element.clientWidth>mapElement.clientWidth){collisionInfo.panX=-1*(element.clientWidth+elemPos[0]+leftTopPad-mapElement.clientWidth);}
if(elemPos[1]<topBound){collisionInfo.panY=Math.abs(elemPos[1]-topBound);}
else if(elemPos[1]+element.clientHeight>mapElement.clientHeight){collisionInfo.panY=mapElement.clientHeight-elemPos[1]-element.clientHeight;}}
return collisionInfo;}
MQRolloverWindow.prototype.createRolloverWindow=function()
{if(this.minipopup)this.minipopup.parentNode.removeChild(this.minipopup);this.minipopup=document.createElement("div");this.minipopup.id="minipopup";this.minipopup.className="mqminipopup";this.minipopup.currentElement=null;this.minipopup.style.left='-1000px';this.minipopup.style.top='-1000px';this.minipopup.oncontextmenu=function(){return false;};document.body.appendChild(this.minipopup);this.minipopup.style.position="absolute";this.minipopup.style.visibility="hidden";}
MQRolloverWindow.prototype.setTextLength=function(length)
{if(typeof length=='undefined'||isNaN(parseInt(length)))
this.textLength=31;else
this.textLength=parseInt(length);}
MQRolloverWindow.prototype.getTextLength=function()
{return this.textLength;}
MQRolloverWindow.prototype.setLeftRolloverOffsetX=function(offWidth)
{if(typeof offWidth=='undefined'||isNaN(parseInt(offWidth)))
this.leftRolloverOffsetX=-25;else
this.leftRolloverOffsetX=parseInt(offWidth);}
MQRolloverWindow.prototype.getLeftRolloverOffsetX=function()
{return this.leftRolloverOffsetX;}
MQRolloverWindow.prototype.setRightRolloverOffsetX=function(offWidth)
{if(typeof offWidth=='undefined'||isNaN(parseInt(offWidth)))
this.rightRolloverOffsetX=-193;else
this.rightRolloverOffsetX=parseInt(offWidth);}
MQRolloverWindow.prototype.getRightRolloverOffsetX=function()
{return this.rightRolloverOffsetX;}
MQRolloverWindow.prototype.setRolloverOffsetY=function(offHeight)
{if(typeof offHeight=='undefined'||isNaN(parseInt(offHeight)))
this.rolloverOffsetY=(13-this.minipopup.offsetHeight);else
this.rolloverOffsetY=parseInt(offHeight);}
MQRolloverWindow.prototype.getRolloverOffsetY=function()
{return this.rolloverOffsetY;}
function MQEvent()
{this.type="event";this.srcObject=null;if(arguments.length){this.eventName=arguments[0];}else{this.eventName="unnamed event";};}
var MQEventManager=new function()
{this.addListener=function(source,eventType,handler,target)
{if(!this.observers)this.observers=[];if(target==null)target=source;this.observers.push([source,eventType,handler,target]);}
this.removeListener=function(source,eventType,handler,target)
{if(this.observers)
{if(target==null)target=source;for(x=this.observers.length-1;x>=0;x--)
{var cache=this.observers[x];if(cache[0]==source&&cache[1]==eventType&&cache[2]==handler&&cache[3]==target)
this.observers.splice(x,1);}}}
this.clearListeners=function(source,eventType)
{if(this.observers)
{for(x=this.observers.length-1;x>=0;x--)
{var cache=this.observers[x];if(cache[0]==source)
{if(eventType&&cache[1]!=eventType)continue;this.observers.splice(x,1);}}}}
this.trigger=function(source,eventType,event)
{if(this.observers)
{event=event||{type:event};this.observers.each(function(cache){if(cache[0]==source&&cache[1]==eventType)
cache[2].call(cache[3],event);});}}}
function MQDeclutter(map)
{this.map=map;this.mode=0;this.declutterIcon=null;this.declutterAltIcon=null;this.declutterOverIcon=null;this.declutterOverAltIcon=null;this.dcCollection=null;this.pnCollection=null;this.nextPageIcon=null;this.prevPageIcon=null;this.pageBarIcon=null;this.pageMarkIcon=null;this.stackHeight=1;this.stackWidth=3;this.currentPage=1;this.keepRolloversOnDrag=true;this.leaderLineColor='#000000';this.leaderLineDotMode=1;this.leaderLineDotImage=null;this.poiCollection=null;this.cpCollection=null;};MQDeclutter.prototype.setDeclutterMode=function(declutterMode)
{if(declutterMode!=0)
{if(this.mode!=0)this.doDeclutter(0);if(!this.declutterIcon)this.setDeclutterIcon('http://img.mqcdn.com/mqtoolkit/declut_star.png',29,29);if(!this.declutterOverIcon)this.setDeclutterOverIcon('http://img.mqcdn.com/mqtoolkit/declut_star_over.png',29,29);if(!this.nextPageIcon)this.setNextPageIcon('http://img.mqcdn.com/mqtoolkit/page_right.png',29,19);if(!this.prevPageIcon)this.setPrevPageIcon('http://img.mqcdn.com/mqtoolkit/page_left.png',29,19);if(!this.pageBarIcon)this.pageBarIcon=new MQDeclutterIcon('http://img.mqcdn.com/mqtoolkit/page_bar.png',29,19);if(!this.pageMarkIcon)this.pageMarkIcon=new MQDeclutterIcon('http://img.mqcdn.com/mqtoolkit/page_mark.png',7,19);this.dcCollection=new Array;this.pnCollection=new Array;this.cpCollection=new Array;if(this.map)
{this.map.getInfoWindow().hide();this.doDeclutter(declutterMode);}}
else
{this.doDeclutter(0);}
this.mode=declutterMode;}
MQDeclutter.prototype.getDeclutterMode=function()
{return this.mode;}
MQDeclutter.prototype.setDeclutterIcon=function(url,width,height)
{var m=this.getDeclutterMode();if(m)this.setDeclutterMode(0);this.declutterIcon=new MQDeclutterIcon(url,width,height);if(m)this.setDeclutterMode(m);}
MQDeclutter.prototype.setDeclutterOverIcon=function(url,width,height)
{var m=this.getDeclutterMode();if(m)this.setDeclutterMode(0);this.declutterOverIcon=new MQDeclutterIcon(url,width,height);if(m)this.setDeclutterMode(m);}
MQDeclutter.prototype.getDeclutterIcon=function()
{return this.declutterIcon;}
MQDeclutter.prototype.setNextPageIcon=function(url,width,height)
{var m=this.getDeclutterMode();if(m)this.setDeclutterMode(0);this.nextPageIcon=new MQDeclutterIcon(url,width,height);if(m)this.setDeclutterMode(m);}
MQDeclutter.prototype.getNextPageIcon=function()
{return this.nextPageIcon;}
MQDeclutter.prototype.setPrevPageIcon=function(url,width,height)
{var m=this.getDeclutterMode();if(m)this.setDeclutterMode(0);this.prevPageIcon=new MQDeclutterIcon(url,width,height);if(m)this.setDeclutterMode(m);}
MQDeclutter.prototype.getPrevPageIcon=function()
{return this.prevPageIcon;}
MQDeclutter.prototype.setStackHeight=function(n)
{var m=this.getDeclutterMode();if(m)this.setDeclutterMode(0);this.stackHeight=(n<1?1:n);if(m)this.setDeclutterMode(m);}
MQDeclutter.prototype.getStackHeight=function()
{return this.stackHeight;}
MQDeclutter.prototype.setStackWidth=function(n)
{var m=this.getDeclutterMode();if(m)this.setDeclutterMode(0);this.stackWidth=(n<2?2:n);if(m)this.setDeclutterMode(m);}
MQDeclutter.prototype.getStackWidth=function()
{return this.stackWidth;}
MQDeclutter.prototype.setRolloverDrag=function(b)
{this.keepRolloversOnDrag=b;}
MQDeclutter.prototype.getRolloverDrag=function()
{return this.keepRolloversOnDrag;}
MQDeclutter.prototype.setLeaderLineColor=function(c)
{this.leaderLineColor=c;if(this.getDeclutterMode()==2)
{this.redrawLeaderLines();}}
MQDeclutter.prototype.getLeaderLineColor=function()
{return this.leaderLineColor;}
MQDeclutter.prototype.setLeaderLineDotMode=function(m)
{this.leaderLineDotMode=m;if(this.getDeclutterMode()==2)
{this.redrawLeaderLines();}}
MQDeclutter.prototype.getLeaderLineDotMode=function()
{return this.leaderLineDotMode;}
MQDeclutter.prototype.setLeaderLineDotImage=function(url,width,height)
{this.leaderLineDotImage=new MQLeaderLineDotImage(url,width,height);if(this.getDeclutterMode()==2)
{this.redrawLeaderLines();}}
MQDeclutter.prototype.getLeaderLineDotImage=function()
{return this.leaderLineDotImage;}
MQDeclutter.prototype.doDeclutter=function(dcmode)
{var i,j;var x=100;var y=50;var pageSize=this.stackHeight*this.stackWidth;var pageNum=1;var newPage=false;var xPos;var yPos;var origXPos;var origYPos;var dcSpacer=1;var dcVisible=true;dcmode=parseInt(dcmode);switch(dcmode)
{case 0:if(this.mode==1)
{for(var i=0,x=this.dcCollection.length;i<x;i++)
{for(var j=0,y=this.dcCollection[i].length;j<y;j++)
{this.dcCollection[i][j].poi.setVisible(true);this.dcCollection[i][j].setVisible(false);this.dcCollection[i][j]=null;}
this.dcCollection[i]=null;}
for(var i=0,x=this.pnCollection.length;i<x;i++)
{if(this.pnCollection[i]!=null)
{this.pnCollection[i][0].setVisible(false);this.pnCollection[i][1].setVisible(false);this.pnCollection[i][2].remove();this.pnCollection[i][0]=null;this.pnCollection[i][1]=null;this.pnCollection[i][2]=null;}}}
else if(this.mode==2)
{var poiCol=this.map.getPois();for(var i=0,x=poiCol.getSize();i<x;i++)
{this.removeLeaderLines();poiCol.getAt(i).setLatLng(poiCol.getAt(i).getLatLng());poiCol.getAt(i).dragLeft=null;poiCol.getAt(i).dragTop=null;poiCol.getAt(i).setAltStateFlag(false);}}
break;case 1:var poiWidth,poiHeight;var ptUL,ptLR;var currRect;var intersect;var b;var myCollection=this.map.getPois();var sortedArray=new Array;var declutterArray=new Array;for(var a=0,x=myCollection.getSize();a<x;a++)
{sortedArray[a]=new Array(myCollection.getAt(a).getLatLng().getLatitude(),myCollection.getAt(a).getLatLng().getLongitude(),a);}
sortedArray.sort(this.sortPoisRL);for(var a=0,e=sortedArray.length;a<e;a++)
{poiWidth=myCollection.getAt(sortedArray[a][2]).getIcon().getImage().width;poiHeight=myCollection.getAt(sortedArray[a][2]).getIcon().getImage().height;ptUL=this.map.GetLLToXY(new PointLL(sortedArray[a][0],sortedArray[a][1]));ptUL.x+=myCollection.getAt(sortedArray[a][2]).element.offset.x;ptUL.y+=myCollection.getAt(sortedArray[a][2]).element.offset.y;ptLR=new PointXY(ptUL.x+poiWidth,ptUL.y+poiHeight);if(this.declutterIcon.height>poiHeight)
{ptUL.y-=(this.declutterIcon.height-poiHeight);}
ptUL.y-=(this.nextPageIcon.height+dcSpacer);if(this.declutterIcon.width>poiWidth)
{ptLR.x-=(this.declutterIcon.width-poiWidth);}
currRect=new RectXY(ptUL,ptLR);intersect=false;for(b=0;!intersect&&b<declutterArray.length;b++)
{intersect=this.isIntersected(currRect,declutterArray[b][0]);}
if(intersect)
{b=b-1;declutterArray[b][1][declutterArray[b][1].length]=a;var clusterCnt=declutterArray[b][1].length;var clusterPag=parseInt((clusterCnt-1)%pageSize);var clusterRow=parseInt(clusterPag/this.stackWidth);var clusterCol=parseInt(clusterPag%this.stackWidth);xPos=declutterArray[b][3].x-(clusterCol+1)*(this.declutterIcon.width+dcSpacer);yPos=declutterArray[b][3].y-((clusterRow+1)*(this.declutterIcon.height+dcSpacer));dcVisible=(clusterCnt<=pageSize);if(clusterCnt<=this.stackWidth){declutterArray[b][0].ul.x-=(this.declutterIcon.width+dcSpacer);}
if(clusterCol==0&&clusterRow>0&&clusterRow<this.stackHeight){declutterArray[b][0].ul.y-=(this.declutterIcon.height+dcSpacer)+(this.pageMarkIcon.height+dcSpacer);}
this.addDeclutterPoi(xPos,yPos,myCollection.getAt(sortedArray[a][2]),dcVisible,b);if(clusterCnt>pageSize&&this.pnCollection[b]==null){this.pnCollection[b]=new Array();var declutterY=declutterArray[b][3].y-(this.stackHeight*(this.declutterIcon.height+dcSpacer)+(Math.max(this.nextPageIcon.height,this.pageBarIcon.height)+dcSpacer));this.pnCollection[b][0]=new MQPrevNextIcon(this.prevPageIcon,declutterArray[b][3].x-(this.nextPageIcon.width+this.pageBarIcon.width+this.prevPageIcon.width+(3*dcSpacer)),declutterY,this.map,false,-1,b);this.pnCollection[b][1]=new MQPrevNextIcon(this.nextPageIcon,declutterArray[b][3].x-(this.nextPageIcon.width+dcSpacer),declutterY,this.map,true,1,b);this.pnCollection[b][2]=new MQPageMarkIcon(this.pageBarIcon,this.pageMarkIcon,declutterArray[b][3].x-(this.nextPageIcon.width+this.pageBarIcon.width+(2*dcSpacer)),declutterY,this.map,b);}}
else
{if(this.declutterIcon.height>poiHeight)
{ptUL.y-=parseInt((this.declutterIcon.height-poiHeight)/2);}
ptUL.y+=(this.declutterIcon.height+dcSpacer);var declutterCluster=new Array();declutterCluster[0]=currRect;declutterCluster[1]=new Array();declutterCluster[2]=a;declutterCluster[3]=ptUL;declutterArray[declutterArray.length]=declutterCluster;this.pnCollection[this.pnCollection.length]=null;this.dcCollection[this.dcCollection.length]=new Array();this.cpCollection[this.cpCollection.length]=1;}}
break;case 2:this.getPOIDims();var declutPoiGrps=this.createDeclutterGrps();this.doDeclutterM2(declutPoiGrps);break;}}
MQDeclutter.prototype.getPOIDims=function()
{var poiCol=this.map.getPois();var poiCount=poiCol.getSize();this.poiCollection={length:poiCount};var sortedArray=new Array;for(var i=0;i<poiCount;i++)
{sortedArray[i]=new Array(poiCol.getAt(i).getLatLng().getLatitude(),poiCol.getAt(i).getLatLng().getLongitude(),i);}
sortedArray.sort(this.sortPois);for(var i=0,j=sortedArray.length;i<j;i++)
{tmpHW=poiCol.getAt(sortedArray[i][2]).getIcon().getImage();tmpXY=this.map.GetLLToXY(poiCol.getAt(sortedArray[i][2]).getLatLng());tmpXY.x-=Math.ceil(tmpHW.width/2);tmpXY.y-=Math.ceil(tmpHW.height/2);this.poiCollection[i]={ix:tmpXY.x,iy:tmpXY.y,x:tmpXY.x,y:tmpXY.y,h:tmpHW.height,w:tmpHW.width,indx:sortedArray[i][2]};}}
MQDeclutter.prototype.createDeclutterGrps=function()
{var excludeList=new Array();var declutPoiGrps=new Array;var nGrp=0;var groupCreated;for(var i=0,k=this.poiCollection.length;i<k;i++)
{if(excludeList.indexOf(i)>=0)continue;groupCreated=false;for(var j=i+1;j<k;j++)
{if(excludeList.indexOf(j)>=0)continue;if(this.isOverlapped(this.poiCollection[i],this.poiCollection[j]))
{if(!groupCreated)
{declutPoiGrps[nGrp]=new Array();declutPoiGrps[nGrp].push(i);excludeList.push(i);groupCreated=true;}
declutPoiGrps[nGrp].push(j);excludeList.push(j);}}
if(declutPoiGrps[nGrp]&&declutPoiGrps[nGrp].length>0)nGrp++;}
return declutPoiGrps;}
MQDeclutter.prototype.doDeclutterM2=function(declutpoigrps)
{var projPos={x:0,y:0,h:0,w:0};var PI=3.14;var theta,llFactor;var nx,ny;var n,centerPt;var nLoop;var thisPoi;var overlapped;var thePoi;var fullCircle=false;var indexOfM;if(declutpoigrps.length==1&&declutpoigrps[0].length==this.poiCollection.length)
{fullCircle=true;theta=360/declutpoigrps[0].length;llFactor=1350/theta;llFactor=(llFactor<75)?75:llFactor;}
else
{theta=10;llFactor=75;}
var templlFactor;var offsetX,offsetY;var mapDragOffsetXY=this.map.GetDragOffset();for(var i=0,p=declutpoigrps.length;i<p;i++)
{n=-180;centerPt=this.getDeclutCenterPt(declutpoigrps[i]);nLoop=1;templlFactor=llFactor;for(var k=0,q=declutpoigrps[i].length;k<q;k++)
{thisPoi=this.poiCollection[declutpoigrps[i][k]];offsetX=Math.ceil(thisPoi.w/2);offsetY=Math.ceil(thisPoi.h/2);for(var angle=n;;angle+=theta)
{if(angle>=180)
{++nLoop;angle-=360;if(nLoop>2)templlFactor+=30;}
if(nLoop>4)break;nx=Math.round(templlFactor*Math.cos(PI*angle/180));ny=Math.round(templlFactor*Math.sin(PI*angle/180));projPos.x=centerPt.x+nx-offsetX;projPos.y=centerPt.y+ny-offsetY;projPos.h=thisPoi.h;projPos.w=thisPoi.w;if(centerPt.x>0&&centerPt.y>0&&centerPt.x<this.map.width&&centerPt.y<this.map.height)
{if(projPos.x<=projPos.w||projPos.y<=projPos.h||projPos.x+projPos.w>=this.map.width||projPos.y+projPos.h>=this.map.height)continue;}
overlapped=false;for(var m=0,r=this.poiCollection.length;m<r;m++)
{indexOfM=declutpoigrps[i].indexOf(m);if((this.poiCollection[m].ix!=this.poiCollection[m].x)||(this.poiCollection[m].iy!=this.poiCollection[m].y))
{if(this.checkLLIntersection(this.poiCollection[m].ix+offsetX,this.poiCollection[m].iy+offsetY,this.poiCollection[m].x+offsetX,this.poiCollection[m].y+offsetY,thisPoi.ix+offsetX,thisPoi.iy+offsetY,projPos.x+offsetX,projPos.y+offsetY))
{overlapped=true;break;}}
if(indexOfM<0)
{if((this.isOverlapped(projPos,this.poiCollection[m]))||((nLoop<2)&&this.checkLPIntersection((thisPoi.ix+offsetX),(thisPoi.iy+offsetY),projPos.x+offsetX,projPos.y+offsetY,this.poiCollection[m]))){overlapped=true;break;}
else if((nLoop<2)&&((this.poiCollection[m].ix!=this.poiCollection[m].x)||(this.poiCollection[m].iy!=this.poiCollection[m].y)))
{if(this.checkLPIntersection(this.poiCollection[m].ix+(this.poiCollection[m].w/2),this.poiCollection[m].iy+(this.poiCollection[m].h/2),this.poiCollection[m].x+offsetX,this.poiCollection[m].y+offsetY,projPos))
{overlapped=true;break;}}}
else if((indexOfM>=0)&&(indexOfM<k)&&(this.isOverlapped(projPos,this.poiCollection[m])))
{overlapped=true;break;}}
if(overlapped)continue;n=angle+theta;thePoi=this.map.getPois().getAt(thisPoi.indx);thePoi.setAltStateFlag(true);thePoi.element.style.left=projPos.x-mapDragOffsetXY.x+'px';thePoi.element.style.top=projPos.y-mapDragOffsetXY.y+'px';this.drawLeaderLine(thePoi);theLatLngXY=this.map.llToPix(thePoi.getLatLng())
thePoi.dragLeft=theLatLngXY.x-projPos.x;thePoi.dragTop=theLatLngXY.y-projPos.y;thisPoi.x=projPos.x;thisPoi.y=projPos.y;break;}}}}
MQDeclutter.prototype.checkLPIntersection=function(x1,y1,x2,y2,poi)
{var m1=(x2-x1==0)?(y2-y1)/0.00000001:(y2-y1)/(x2-x1);var a1=y1-m1*x1;var hm2=0;var vm2=poi.h/0.00000001;var u1,v1,u2,v2;var a2,xi,yi;for(var i=1;i<=4;i++)
{switch(i)
{case 1:u1=poi.x;v1=poi.y;u2=poi.x+poi.w;v2=poi.y;break;case 2:u1=poi.x+poi.w;v1=poi.y;u2=poi.x+poi.w;v2=poi.y+poi.h;break;case 3:u1=poi.x;v1=poi.y+poi.h;u2=poi.x+poi.w;v2=poi.y+poi.h;break;case 4:u1=poi.x;v1=poi.y;u2=poi.x;v2=poi.y+poi.h;break;}
if(i%2==1)
{a2=v1;xi=Math.round(0-(a1-a2)/m1);yi=a2;}else{a2=v1-vm2*u1;xi=Math.round(0-(a1-a2)/(m1-vm2));yi=(Math.abs(m1)<Math.abs(vm2))?Math.round(a1+m1*xi):Math.round(a2+vm2*xi);}
if(((x1<=xi&&x2>=xi)||(x1>=xi&&x2<=xi))&&((u1<=xi&&u2>=xi)||(u1>=xi&&u2<=xi))&&((y1<=yi&&y2>=yi)||(y1>=yi&&y2<=yi))&&((v1<=yi&&v2>=yi)||(v1>=yi&&v2<=yi))){return(true);}}
return(false);}
MQDeclutter.prototype.checkLLIntersection=function(x1,y1,x2,y2,u1,v1,u2,v2)
{var m1=(x2-x1==0)?(y2-y1)/0.00000001:(y2-y1)/(x2-x1);var a1=y1-m1*x1;var m2=(u2-u1==0)?(v2-v1)/0.00000001:(v2-v1)/(u2-u1);var a2=v1-m2*u1;var xi,yi;xi=Math.round(0-(a1-a2)/(m1-m2));yi=(Math.abs(m1)<Math.abs(m2))?Math.round(a1+m1*xi):Math.round(a2+m2*xi);if(((x1<=xi&&x2>=xi)||(x1>=xi&&x2<=xi))&&((u1<=xi&&u2>=xi)||(u1>=xi&&u2<=xi))&&((y1<=yi&&y2>=yi)||(y1>=yi&&y2<=yi))&&((v1<=yi&&v2>=yi)||(v1>=yi&&v2<=yi)))
{var proxVal=3;if(((Math.abs(x1-xi)<=proxVal)&&(Math.abs(y1-yi)<=proxVal))||((Math.abs(u1-xi)<=proxVal)&&(Math.abs(v1-yi)<=proxVal))||((Math.abs(x2-xi)<=proxVal)&&(Math.abs(y2-yi)<=proxVal))||((Math.abs(u2-xi)<=proxVal)&&(Math.abs(v2-yi)<=proxVal)))
{return(false);}
return(true);}
return(false);}
MQDeclutter.prototype.getDeclutCenterPt=function(declutgrp)
{var centerPosX=0;var centerPosY=0;var poi;var poiCount=declutgrp.length;for(var i=0;i<poiCount;i++)
{poi=this.poiCollection[declutgrp[i]];centerPosX+=poi.ix+poi.w/2;centerPosY+=poi.iy+poi.h/2;}
return(new PointXY(Math.round(centerPosX/poiCount),Math.round(centerPosY/poiCount)));}
MQDeclutter.prototype.isOverlapped=function(poiobj1,poiobj2)
{var x1,x2,y1,y2,w1,w2,h1,h2;x1=poiobj1.x;y1=poiobj1.y;h1=poiobj1.h;w1=poiobj1.w;x2=poiobj2.x;y2=poiobj2.y;h2=poiobj2.h;w2=poiobj2.w;if((((x1<=x2)&&((x1+w1)>=x2))&&(((y1<=y2)&&((y1+h1)>=y2))||((y1>=y2)&&((y2+h2)>=y1))))||(((x1>=x2)&&((x2+w2)>=x1))&&(((y1>=y2)&&((y2+h2)>=y1))||((y1<=y2)&&((y1+h1)>=y2)))))
{return(true);}
return(false);}
MQDeclutter.prototype.sortPois=function(a,b)
{return(a[1]-b[1]);}
MQDeclutter.prototype.sortPoisRL=function(a,b)
{return(b[1]-a[1]);}
MQDeclutter.prototype.isIntersected=function(rect1,rect2)
{var intersect=(rect1.lr.x>rect2.ul.x)&&(rect1.ul.x<rect2.lr.x)&&(rect1.lr.y>rect2.ul.y)&&(rect1.ul.y<rect2.lr.y);return intersect;}
MQDeclutter.prototype.setMap=function(map)
{this.map=map;}
MQDeclutter.prototype.addDeclutterPoi=function(x,y,poi,isVisible,index)
{var dcpoi=new MQDeclutterPoi(this.map,poi,isVisible);this.dcCollection[index].push(dcpoi);var ll=this.map.pixToLL(new MQPoint(x,y));this.map.AddPOI(ll,new PointXY(0,0),dcpoi.div);}
MQDeclutter.prototype.turnPage=function(direction,index)
{var i;var pageSize=this.stackHeight*this.stackWidth;var dcIconArraySize=this.dcCollection[index].length;if(this.cpCollection[index]==1&&direction==-1)return;if(((this.cpCollection[index]*pageSize)>=dcIconArraySize)&&direction==1)return;this.cpCollection[index]=this.cpCollection[index]+direction;for(i=0;i<dcIconArraySize;i++)
{this.dcCollection[index][i].setVisible(false);}
var maxItemIndex=(this.cpCollection[index]*pageSize);if(maxItemIndex>dcIconArraySize)maxItemIndex=dcIconArraySize;var startItemIndex=(this.cpCollection[index]*pageSize)-pageSize;for(i=startItemIndex;i<maxItemIndex;i++)
{this.dcCollection[index][i].setVisible(true);}
if(startItemIndex>0)
{this.pnCollection[index][0].setVisible(true);}
else
{this.pnCollection[index][0].setVisible(false);}
if(maxItemIndex<dcIconArraySize)
{this.pnCollection[index][1].setVisible(true);}
else
{this.pnCollection[index][1].setVisible(false);}
var currentp=this.cpCollection[index]-1;var totalpag=parseInt(Math.ceil(dcIconArraySize/pageSize))-1;var widthbar=this.pageBarIcon.width-6;this.pnCollection[index][2].div.mar.style.left=parseInt(widthbar*(currentp/totalpag))+"px";}
MQDeclutter.prototype.adjustLeaderLineSurface=function()
{var returnVal=false;if(this.map.surface)
{if(this.map.GetDragOffset().x!=this.map.overlayOffsetX||this.map.GetDragOffset().y!=this.map.overlayOffsetY)
{this.map.overlayOffsetX=this.map.GetDragOffset().x;this.map.overlayOffsetY=this.map.GetDragOffset().y;if(this.map.overlaydiv)
{this.map.overlaydiv.style.left=-(this.map.SURFACE_OFFSET+this.map.overlayOffsetX)+'px';this.map.overlaydiv.style.top=-(this.map.SURFACE_OFFSET+this.map.overlayOffsetY)+'px';if(this.map.getOverlays())this.map.redrawOverlays();}
returnVal=true;}}
if(this.map.dcCanvasDiv)
{if(this.map.GetDragOffset().x!=this.map.canvasOffsetX||this.map.GetDragOffset().y!=this.map.canvasOffsetY)
{this.map.canvasOffsetX=this.map.GetDragOffset().x;this.map.canvasOffsetY=this.map.GetDragOffset().y;if(this.map.dcCanvasDiv)
{this.map.dcCanvasDiv.style.left=-(this.map.SURFACE_OFFSET+this.map.canvasOffsetX)+'px';this.map.dcCanvasDiv.style.top=-(this.map.SURFACE_OFFSET+this.map.canvasOffsetY)+'px';}
returnVal=true;}}
return returnVal;}
MQDeclutter.prototype.drawLeaderLine=function(poi)
{var xy=new Object;var safari=(getBrowserInfo().name=='safari');if(!safari)
{if(!this.map.surface)this.map.createDrawingSurface();}
else
{if(!this.map.dcCanvasDiv)this.map.createCanvas();}
if(!safari)
{if(!this.map.surface)throw('Leader line drawing surface does not exist.');}
else
{if(!this.map.dcCanvasDiv)throw('Leaderline drawing canvas does not exist.');}
if(!this.adjustLeaderLineSurface())
{var dragOffset=this.map.getDragOffset();var pnts=new Array();pnts[0]=new Object;pnts[0]=this.map.llToPix(poi.getLatLng());pnts[0].x+=(this.map.SURFACE_OFFSET);pnts[0].y+=(this.map.SURFACE_OFFSET);pnts[1]=new Object;var divOffsetX=parseInt(this.map.div1.style.left)+dragOffset.x;var divOffsetY=parseInt(this.map.div1.style.top)+dragOffset.y;if(poi.getAltStateFlag()){var iconOffsetX=poi.getAltIcon().getAnchorOffset().getX();var iconOffsetY=poi.getAltIcon().getAnchorOffset().getY();}else{var iconOffsetX=poi.getIcon().getAnchorOffset().getX();var iconOffsetY=poi.getIcon().getAnchorOffset().getY();};pnts[1].x=(parseInt(poi.element.style.left)+this.map.SURFACE_OFFSET)-iconOffsetX+divOffsetX;pnts[1].y=(parseInt(poi.element.style.top)+this.map.SURFACE_OFFSET)-iconOffsetY+divOffsetY;cpnts=new Array();if(isOverLimit(xy))
{if(!safari)
{var surfaceWidth=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));var surfaceHeight=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));}
else
{var surfaceWidth=parseInt(this.map.dcCanvasDiv.style.height.substr(0,(this.map.dcCanvasDiv.style.height.length)-2));var surfaceHeight=parseInt(this.map.dcCanvasDiv.style.width.substr(0,(this.map.dcCanvasDiv.style.width.length)-2));}
cpnts=MQClip(0,surfaceWidth,0,surfaceHeight,pnts,false);}
else
{cpnts=pnts;}
var leaderLineColor=(poi.leaderLineColor?poi.leaderLineColor:this.leaderLineColor);if(poi.leaderLineDotIcon)poi.leaderLineDotIcon.div.im.style.display='none';if(!safari)
{var s='M '+cpnts[1].x+','+cpnts[1].y+' L '+cpnts[0].x+','+cpnts[0].y;if(poi.leaderLine)poi.map.surface.remove(poi.leaderLine);if(poi.leaderLineDot)poi.map.surface.remove(poi.leaderLineDot);poi.leaderLine=this.map.surface.createPath(s).setFill(leaderLineColor).setStroke({color:leaderLineColor,width:2});poi.leaderLine.rawNode.style.zIndex=80;}
else
{this.map.dcCanvasContext.strokeStyle=leaderLineColor;this.map.dcCanvasContext.lineWidth=2;this.map.dcCanvasContext.beginPath();this.map.dcCanvasContext.moveTo(cpnts[1].x,cpnts[1].y);this.map.dcCanvasContext.lineTo(cpnts[0].x,cpnts[0].y);this.map.dcCanvasContext.stroke();}
var theMode=parseInt(this.getLeaderLineDotMode());switch(theMode){case 0:break;case 1:if(!safari)
{poi.leaderLineDot=this.map.surface.createCircle({cx:cpnts[0].x,cy:cpnts[0].y,r:3}).setFill(leaderLineColor).setStroke({color:leaderLineColor,width:1});poi.leaderLineDot.rawNode.style.zIndex=80;}
else
{this.map.dcCanvasContext.beginPath();this.map.dcCanvasContext.arc(cpnts[0].x,cpnts[0].y,3,0,Math.PI*2,true);this.map.dcCanvasContext.arc(cpnts[0].x,cpnts[0].y,2,0,Math.PI*2,true);this.map.dcCanvasContext.arc(cpnts[0].x,cpnts[0].y,1,0,Math.PI*2,true);this.map.dcCanvasContext.stroke();}
break;case 2:if(poi.getLeaderLineDotImage())
{poi.leaderLineDotIcon=new MQLeaderLineDotIcon(poi.getLeaderLineDotImage(),this.map,poi);}
else if(this.getLeaderLineDotImage())
{poi.leaderLineDotIcon=new MQLeaderLineDotIcon(this.getLeaderLineDotImage(),this.map,poi);}
break;default:break;};}else{this.redrawLeaderLines();}}
MQDeclutter.prototype.redrawLeaderLines=function()
{var skippedPoi=null;if(arguments.length>0)skippedPoi=arguments[0];if(this.map.dcCanvasContext)
{this.map.dcCanvasContext.clearRect(0,0,parseInt(this.map.dcCanvasDiv.style.width),parseInt(this.map.dcCanvasDiv.style.height));}
for(var i=0,x=this.map.mypois.getSize();i<x;i++)
{if(this.map.mypois.getAt(i).altStateFlag&&(this.map.mypois.getAt(i)!=skippedPoi))
{if(this.map.mypois.getAt(i).leaderLine)this.map.surface.remove(this.map.mypois.getAt(i).leaderLine);if(this.map.mypois.getAt(i).leaderLineDot)this.map.surface.remove(this.map.mypois.getAt(i).leaderLineDot);this.drawLeaderLine(this.map.mypois.getAt(i));}}}
MQDeclutter.prototype.removeLeaderLines=function()
{for(var i=0,x=this.map.mypois.getSize();i<x;i++)
{if(this.map.mypois.getAt(i).altStateFlag)
{if(this.map.mypois.getAt(i).leaderLine)this.map.surface.remove(this.map.mypois.getAt(i).leaderLine);if(this.map.mypois.getAt(i).leaderLineDot)this.map.surface.remove(this.map.mypois.getAt(i).leaderLineDot);if(this.map.mypois.getAt(i).leaderLineDotIcon)
{this.map.RemovePOI(this.map.mypois.getAt(i).leaderLineDotIcon.div);this.map.mypois.getAt(i).leaderLineDotIcon=null;}}}
if(getBrowserInfo().name=='safari')
{if(this.map.dcCanvasContext)
{this.map.dcCanvasContext.clearRect(0,0,parseInt(this.map.dcCanvasDiv.style.width),parseInt(this.map.dcCanvasDiv.style.height));}}}
MQDeclutter.prototype.resetDraggedPois=function()
{var thePoi;for(var i=0,j=this.map.getPois().getSize();i<j;i++)
{thePoi=this.map.getPois().getAt(i)
theLatLngXY=this.map.llToPix(thePoi.getLatLng());if(thePoi.dragLeft!=null)
{thePoi.element.style.left=theLatLngXY.x-thePoi.dragLeft+'px';thePoi.element.style.top=theLatLngXY.y-thePoi.dragTop+'px';}}}
function MQDeclutterPoi(map,poi,isVisible){this.map=map;this.poi=poi;this.div=document.createElement('div');this.div.id='dc_'+poi.getLabel();this.div.className="pois";this.div.im=document.createElement('img');var _declutterIcon;if(poi.getAltIcon()!=poi.getIcon())
{_declutterIcon=new MQDeclutterIcon(poi.getAltIcon()._getImgSrc(poi.getAltIcon().getImage()),this.map.mydeclutter.declutterIcon.width,this.map.mydeclutter.declutterIcon.height);}
else
{_declutterIcon=this.map.mydeclutter.declutterIcon;}
if((getBrowserInfo().name=="msie"&&getBrowserInfo().version<7.0)&&MQ.utils._hasPngExtention(this.map.mydeclutter.declutterOverIcon.url)&&MQ.utils._hasPngExtention(_declutterIcon.url))
{this.div.im.src="http://img.mqcdn.com/a/a";this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_declutterIcon.url+"', sizingMethod='image') ";}else{this.div.im.src=_declutterIcon.url;}
this.div.im.style.height=_declutterIcon.height+'px';this.div.im.style.width=_declutterIcon.width+'px';this.div.im.style.position='absolute';if(isVisible)
{this.div.im.style.display='block';}
else
{this.div.im.style.display='none';}
this.div.style.MozUserSelect="none";this.div.appendChild(this.div.im);Event.observe(this.div.im,"click",MQEventCallback(poi,"onClick"));Event.observe(this.div.im,"dblclick",MQEventCallback(poi,"onDoubleClick"));Event.observe(this.div.im,"mousedown",MQEventCallback(poi,"onMouseDown"));Event.observe(this.div.im,"mouseup",MQEventCallback(poi,"onMouseUp"));Event.observe(this.div.im,"mouseover",MQEventCallback(this,"onMouseOver"));Event.observe(this.div.im,"mouseout",MQEventCallback(this,"onMouseOut"));poi.setVisible(false);};MQDeclutterPoi.prototype={onMouseOut:function(e)
{if(this.poi.showingInfo!=true)
{this.poi.setVisible(false);this.poi.setLevel(90);}
this.poi.onMouseOut(e);var _declutterIcon;if(this.poi.getAltIcon()!=this.poi.getIcon())
{_declutterIcon=new MQDeclutterIcon(this.poi.getAltIcon()._getImgSrc(this.poi.getAltIcon().getImage()),this.map.mydeclutter.declutterIcon.width,this.map.mydeclutter.declutterIcon.height);}
else
{_declutterIcon=this.map.mydeclutter.declutterIcon;}
if((getBrowserInfo().name=="msie"&&getBrowserInfo().version<7.0)&&MQ.utils._hasPngExtention(this.map.mydeclutter.declutterOverIcon.url)&&MQ.utils._hasPngExtention(_declutterIcon.url))
{this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_declutterIcon.url+"', sizingMethod='image') ";}
else
{this.div.im.src=_declutterIcon.url;}},onMouseOver:function(e)
{this.poi.setLevel(100);this.poi.setVisible(true);this.poi.onMouseOver(e);var _declutterIcon;if(this.poi.getAltIcon()!=this.poi.getIcon())
{_declutterIcon=new MQDeclutterIcon(this.poi.getAltIcon()._getImgSrc(this.poi.getAltIcon().getImage()),this.map.mydeclutter.declutterIcon.width,this.map.mydeclutter.declutterIcon.height);}
else
{_declutterIcon=this.map.mydeclutter.declutterIcon;}
if((getBrowserInfo().name=="msie"&&getBrowserInfo().version<7.0)&&MQ.utils._hasPngExtention(this.map.mydeclutter.declutterOverIcon.url)&&MQ.utils._hasPngExtention(_declutterIcon.url))
{if(this.map.mydeclutter.declutterOverIcon)
{this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.map.mydeclutter.declutterOverIcon.url+"', sizingMethod='image') ";}}
else
{if(this.map.mydeclutter.declutterOverIcon)
{this.div.im.src=this.map.mydeclutter.declutterOverIcon.url;}}},setVisible:function(v)
{this.div.im.style.display=(v)?'block':'none';}}
function MQPageMarkIcon(bar,mark,x,y,map,index){this.map=map;this.index=index;this.div=document.createElement('div');this.div.className="pois";this.div.bar=document.createElement('img');if(getBrowserInfo().name=="msie"&&MQ.utils._hasPngExtention(bar.url))
{this.div.bar.src="http://img.mqcdn.com/a/a";this.div.bar.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bar.url+"', sizingMethod='image');";}
else
{this.div.bar.src=bar.url;}
this.div.bar.style.position='absolute';this.div.bar.style.display='block';this.div.bar.style.height=bar.height;this.div.bar.style.width=bar.width;this.div.mar=document.createElement('img');if(getBrowserInfo().name=="msie"&&MQ.utils._hasPngExtention(mark.url))
{this.div.mar.src="http://img.mqcdn.com/a/a";this.div.mar.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mark.url+"', sizingMethod='image');";}
else
{this.div.mar.src=mark.url;}
this.div.mar.style.position='absolute';this.div.mar.style.display='block';this.div.mar.style.height=mark.height;this.div.mar.style.width=mark.width;this.div.mar.style.left="0px";this.div.style.MozUserSelect="none";this.div.appendChild(this.div.bar);this.div.appendChild(this.div.mar);var ll=this.map.pixToLL(new MQPoint(x,y));this.map.AddPOI(ll,new PointXY(0,0),this.div);};MQPageMarkIcon.prototype={remove:function()
{this.div.bar.style.display='block';this.div.mar.style.display='block';this.div.removeChild(this.div.bar);this.div.removeChild(this.div.mar);this.div.bar=null;this.div.mar=null;this.map.RemovePOI(this.div);this.div=null;}}
function MQPrevNextIcon(ponIcon,x,y,map,isVisible,increment,index)
{this.map=map;this.increment=increment;this.index=index;this.div=document.createElement('div');this.div.className="pois";this.div.im=document.createElement('img');if(getBrowserInfo().name=="msie"&&MQ.utils._hasPngExtention(ponIcon.url))
{this.div.im.src="http://img.mqcdn.com/a/a";this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ponIcon.url+"', sizingMethod='image');";}
else
{this.div.im.src=ponIcon.url;}
this.div.im.style.position='absolute';if(isVisible)
{this.div.im.style.display='block';}
else
{this.div.im.style.display='none';}
this.div.im.style.height=ponIcon.height;this.div.im.style.width=ponIcon.width;this.div.style.MozUserSelect="none";this.div.appendChild(this.div.im);var ll=this.map.pixToLL(new MQPoint(x,y));this.map.AddPOI(ll,new PointXY(0,0),this.div);Event.observe(this.div.im,"click",MQEventCallback(this,"onClick"));Event.observe(this.div.im,"dblclick",MQEventCallback(this,"onDblClick"));}
MQPrevNextIcon.prototype={setVisible:function(v)
{this.div.im.style.display=(v)?'block':'none';},onClick:function(e)
{this.map.getDeclutter().turnPage(this.increment,this.index);},onDblClick:function(e)
{e.stop;}}
function MQDeclutterIcon(url,width,height)
{this.url=url;this.width=width;this.height=height;}
document.write('<script src="http://o.aolcdn.com/dojo/0.9.0beta/dojo/dojo.xd.js" type="text/javascript"><\/script>');var MLGlobalVar_ServiceURL='';var MLGlobalVar_GlobalImagePath='/publish/fa/images/MapQuest/icons/';var MLGlobalVar_BranchPageUrl=MLGlobalVar_ServiceURL+'/totalmerrill/system/viewbranchpage.aspx?branchcode=';var MLGlobalVar_FAPageUrl=MLGlobalVar_ServiceURL+'/totalmerrill/system/viewfapage.aspx?pageurl=';var MLGlobalVar_DrivingDirectionsURL=MLGlobalVar_ServiceURL+'/totalmerrill/system/DrivingDirections.aspx';var MLGlobalVar_GeoCodeServer="geocode.access.mapquest.com";var MLGlobalVar_mapServer="map.access.mapquest.com";var MLGlobalVar_routeServer="route.access.mapquest.com";var MLGlobalVar_spatialServer="spatial.access.mapquest.com";var MLGlobalVar_serverPath="mq";var MLGlobalVar_serverPort=80;var MLGlobalVar_proxyServer="";var MLGlobalVar_proxyPath="/MapQuestProxyPage/proxy.aspx";var MLGlobalVar_proxyPort="";var MLGlobalVar_JSKey="mjtd%7Clu6t2l6tnh%2C7g%3Do5-larxd";var MLGlobalVar_BranchTable="MQA.MQ_33435_MER_BRANCH_PROD"; var geocodeServer=MLGlobalVar_GeoCodeServer;var mapServer=MLGlobalVar_mapServer;var routeServer=MLGlobalVar_routeServer;var spatialServer=MLGlobalVar_spatialServer;var serverPath=MLGlobalVar_serverPath;var serverPort=MLGlobalVar_serverPort;var proxyServer=MLGlobalVar_proxyServer;var proxyPath=MLGlobalVar_proxyPath;var proxyPort=MLGlobalVar_proxyPort;var jsKey=MLGlobalVar_JSKey;var poiTable="MQA.NTPois";var hotelTable="MQA.HotelFinder";var branchTable=MLGlobalVar_BranchTable;var MAX_MATCHES=30;var DEFAULT_RADIUS=25.0;var DEFAULT_CORRIDOR_WIDTH=5.0;var DEFAULT_UNIT="Mi";var MAX_SHAPE_POINTS=25;var PAGE_SIZE=20;var SCROLL_DISTANCE=70;var CENTER_OF_THE_US_LATITUDE=39.82;var CENTER_OF_THE_US_LONGITUDE=-98.5575;var BranchExclusionList="0505TQ,05061M,0506RL,0502SD";function Querystring(qs){this.params=new Object()
this.get=Querystring_get
if(qs==null)
qs=location.search.substring(1,location.search.length)
if(qs.length==0)return
qs=qs.replace(/\+/g,' ')
var args=qs.split('&')
for(var i=0;i<args.length;i++){var value;var pair=args[i].split('=')
var name=unescape(pair[0])
if(pair.length==2)
value=unescape(pair[1])
else
value=name
this.params[name]=value}}
function Querystring_get(key,default_){if(default_==null)default_=null;var value=this.params[key]
if(value==null)value=default_;return value;}
function BrowserCheck(){var b=navigator.appName;if(b=="Netscape")this.b="ns";else if(b=="Microsoft Internet Explorer")this.b="ie";else this.b=b
this.v=parseInt(navigator.appVersion);this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns5=(this.b=="ns"&&this.v==5);this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(navigator.userAgent.indexOf('MSIE 4')>0);this.ie5=(navigator.userAgent.indexOf('MSIE 5')>0);this.ie6=(navigator.userAgent.indexOf('MSIE 6')>0);this.ie7=(navigator.userAgent.indexOf('MSIE 7')>0);if(this.ie5)this.v=5;if(this.ie6)this.v=6;if(this.ie7)this.v=7;this.min=(this.ns||this.ie);}
var browserCheck=new BrowserCheck();function getEventCurrentTarget(e){var targ
if(!e)var e=window.event
if(e.currentTarget)targ=e.currentTarget
else if(e.srcElement)targ=e.srcElement
if(targ.nodeType==3)
targ=targ.parentNode
return targ;}
function getEventElement(e){var targ
if(!e)var e=window.event
if(e.target)targ=e.target
else if(e.srcElement)targ=e.srcElement
if(targ.nodeType==3)
targ=targ.parentNode
return targ;}
function appendOptionToSelect(select,option){if(browserCheck.ie){var num=select.options.length;select.options[num]=option;}
else{select.appendChild(option);}
return select;}
function getSelectOption(value,text){var opt;if(browserCheck.ie){opt=new Option(text,value);}
else{opt=document.createElement("option");opt.value=value;opt.text=text;}
return opt;}
function removeAllChildren(node){if(!node){return;}
var len=node.childNodes.length;for(var i=0;i<len;i++){try{node.removeChild(node.childNodes[i]);}
catch(ex){}}
node.innerHTML="";}
function createInputElement(type,name,value){if(browserCheck.ie)
return document.createElement("<input type=\""+type+"\" name=\""+name+"\" value=\""+value+"\"/>");else{input=document.createElement("input");input.type=type;input.name=name;input.value=value;return input;}}
function StringFunct(){this.capitalize=function(str){var newVal='';var val=str.split(' ');for(var c=0;c<val.length;c++){newVal+=val[c].substring(0,1).toUpperCase()+
val[c].substring(1,val[c].length)+' ';}
return newVal;}
this.trim=function(st){var len=st.length;var begin=0,end=len-1;while(st.charAt(begin)==" "&&begin<len){begin++;};while(st.charAt(end)==" "&&begin<end){end--;};return st.substring(begin,end+1);};this.isBlank=function(str){str=this.trim(str);if(str==''){return true;};return false;};this.checkScript=function(obj){if(obj.toUpperCase().indexOf("<SCRIPT")>=0){return false}
else{return true;};};this.checkObj=function(obj){if(obj){return true;}
else{return false;};};this.checkObjString=function(str){var start=0;var sStr="";while(str.indexOf(".",start+1)!=-1){start=str.indexOf(".",start+1);sStr=str.substring(0,start);if(!this.checkObj(eval(sStr))){return false;};};if(!this.checkObj(eval(str))){return false;};return true;};this.checkEmail=function(str){if(str.indexOf("@")<3){return false;};if((str.lastIndexOf(".")<5)){return false;};if(str.lastIndexOf(".")!=4){return false;};return true;};this.checkInteger=function(str){if(!this.checkNumeric(str)){return false;};if(str.indexOf(".")>-1){return false;};return true;};this.checkPositiveInteger=function(str){if(!this.checkInteger(str)){return false;};var val=parseInt(str);return(val>=0);};this.checkMoney=function(str){if(str.lastIndexOf(".")<str.length&&(str.lastIndexOf(".")>=str.length-3)){if(!this.checkNumeric(str)){return false;};var val=parseFloat(str);return(val>=0)};return false;};this.checkPositiveNumeric=function(str){if(!this.checkNumeric(str)){return false;};var val=parseFloat(str);return(val>=0)};this.checkNumeric=function(str){var strLength=str.length;var isFloat=false;var error=false;var i=0;for(i;i<strLength;i++){if((str.charAt(i)<'0')||(str.charAt(i)>'9')){if(!isFloat&&(str.charAt(i)=='.')){isFloat=true;}
else if(i==0){if((str.charAt(i)!='-')){error=true;break;};}
else{error=true;break;};};};return!error;};this.checkPhone=function(str){if(this.checkPositiveNumeric(str)){if(str.length==10||str.length==7){return true;}
else{return false;};}
else{if(this.isBlank(str)){return false;};var x=0;if((this.checkNumeric(str.charAt(0)))&&((str.charAt(1)=='-')||(str.charAt(1)=='.'))){x=2;};if(!((str.charAt(x+3)=='-')&&(str.charAt(x+3)=='.'))&&!((str.charAt(x+7)=='-')||(str.charAt(x+7)=='.'))){return false;};var strLength=str.length;var error=false;if(strLength<12){return false;};for(i=x;i<strLength;i++){if((str.charAt(i)<'0')||(str.charAt(i)>'9')){if(!((i==(x+3))||(i==(x+7)))){error=true;break;};};};return!error;};};this.checkPostalCode=function(str){if(str.length==5||str.length==10){return true;}
else{return false;}}
this.checkZip=function(str){if(str.length<5){return false;};if(!this.checkNumeric(str.charAt(0)+str.charAt(1)+str.charAt(2)+str.charAt(3)+str.charAt(4))){return false;};if(str.length==5){return true;};if((str.charAt(5)!='-')||(str.length!=10)){return false;};if(!this.checkNumeric(str.charAt(6)+str.charAt(7)+str.charAt(8)+str.charAt(9))){return false;};return true;};this.checkTime=function(str){var i=0;if(!this.checkNumeric(str.charAt(0))){return false;};if(str.charAt(1)==":"){i=1;}
else if(!this.checkNumeric(str.charAt(1))){return false;}
else if((i!=1)&&(str.charAt(2)==":")){i=2;}
else if(!this.checkNumeric(str.charAt(2))){return false;};if((i==2)&&(str.charAt(0)!="1")){return false;};if(!this.checkNumeric(str.charAt(i+1))){return false;};if(!this.checkNumeric(str.charAt(i+2))){return false;};if(str.charAt(i+3)!=" "){return false;};if((str.charAt(i+4).toUpperCase()!="A")&&(str.charAt(i+4)!="P")){return false;};if(str.charAt(i+5).toUpperCase()!="M"){return false;};return true;};this.isLeapYear=function(intYear){if((((intYear%4)==0)&&((intYear%100)!=0))||(((intYear%100)==0)&&((intYear%400)==0))){return true;}
else{return false;};};this.y2k=function(number){return(number<1000)?number+1900:number;};this.checkDate=function(str){var firstSlash=str.indexOf("/");var secondSlash=str.indexOf("/",str.indexOf("/")+1);var month=str.substring(0,firstSlash);var day=str.substring(firstSlash+1,secondSlash);var year=str.substring(secondSlash+1,str.length);if(!this.checkPositiveNumeric(month)||!this.checkPositiveNumeric(day)||!this.checkPositiveNumeric(year)){return false;};var today=new Date();year=((!year)?this.y2k(today.getYear()):year);month=((!month)?today.getMonth():month-1);if(!day){return false;};var test=new Date(year,month,day);if((this.y2k(test.getYear())==year)&&(month==test.getMonth())&&(day==test.getDate())){return true;}
else{return false;};};};var StringFunctions=new StringFunct();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;this.isOpera=null;}
function mqGetBrowserInfo()
{var browser=new MQBrowser();browser.name=browser.version=browser.os="unknown";var userAgent=window.navigator.userAgent.toLowerCase();var appname=window.navigator.appName;var appVersion=window.navigator.appVersion;var browserListArray=new Array("firefox","msie","netscape","opera","safari");var osListArray=new Array("linux","mac","windows","x11");var browserListlength=browserListArray.length;var strPosition="";for(var i=0,n=browserListlength;i<n;i++)
{strPosition=userAgent.indexOf(browserListArray[i])+1;if(strPosition>0)
{browser.name=browserListArray[i];var versionPosition=strPosition+browser.name.length;var incr=((browser.name=="safari")||(userAgent.charAt(versionPosition+4)>0&&userAgent.charAt(versionPosition+4)<9))?5:3;browser.version=userAgent.substring(versionPosition,versionPosition+incr);}}
var osListArrayLength=osListArray.length;for(var j=0,m=osListArrayLength;j<m;j++)
{strPosition=userAgent.indexOf(osListArray[j])+1;if(strPosition>0)
{browser.os=osListArray[j];}}
if(appname=="Netscape")
browser.appname="ns";else if(appname=="Microsoft Internet Explorer")
browser.appname="ie";if(browser.appname===null&&appname=="Opera")
{browser.appname="opera";}
browser.appVersion=appVersion;browser.vMajor=parseInt(browser.appVersion);browser.isNS=(browser.appname=="ns"&&browser.vMajor>=4);browser.isNS4=(browser.appname=="ns"&&browser.vMajor==4);browser.isNS6=(browser.appname=="ns"&&browser.vMajor==5);browser.isIE=(browser.appname=="ie"&&browser.vMajor>=4);browser.isIE4=(browser.appVersion.indexOf('MSIE 4')>0);browser.isIE5=(browser.appVersion.indexOf('MSIE 5')>0);browser.isDOM=(document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;browser.isSafari=(browser.name=="safari");browser.isOpera=(browser.appname=="opera");if(userAgent.indexOf("win")>-1)
browser.platform="win";else if(userAgent.indexOf("mac")>-1)
browser.platform="mac";else
browser.platform="other";return browser;}
var mqBrowserInfo=mqGetBrowserInfo();function MQObject(){var m_xmlDoc=null;this.getM_XmlDoc=function(){return m_xmlDoc;};this.setM_XmlDoc=function(xmlDoc){m_xmlDoc=xmlDoc;};var m_xpath=null;this.getM_Xpath=function(){return m_xpath;};this.setM_Xpath=function(xpath){m_xpath=xpath;};}
MQObject.prototype.getClassName=function(){return"MQObject";};MQObject.prototype.getObjectVersion=function(){return 0;};MQObject.prototype.setProperty=function(strPropName,strPropValue){var strXPathExpression;if(strPropName!==null)
{strXPathExpression="/"+this.getM_Xpath()+"/"+strPropName;}
else strXPathExpression="/"+this.getM_Xpath();var ndNewProp=mqSetNodeText(this.getM_XmlDoc(),strXPathExpression,strPropValue);if(ndNewProp===null){var ndNewPropParent=this.getM_XmlDoc().createElement(strPropName);var ndRoot=this.getM_XmlDoc().documentElement.appendChild(ndNewPropParent);ndNewProp=mqSetNodeText(this.getM_XmlDoc(),strXPathExpression,strPropValue);}
return ndNewProp;};MQObject.prototype.getProperty=function(strPropName){var strXPathExpression;if(strPropName!==null)strXPathExpression="/"+this.getM_Xpath()+"/"+strPropName;else strXPathExpression="/"+this.getM_Xpath();return mqGetXPathNodeText(this.getM_XmlDoc(),strXPathExpression);};MQObject.prototype.copy=function(){var cp=new this.constructor;cp.loadXml(this.saveXml());return cp;};MQObject.prototype.internalCopy=function(obj){var strXml="<"+obj.getM_Xpath();if(this.getObjectVersion()>0){strXml=strXml+" Version=\""+this.getObjectVersion()+"\"";}
strXml=strXml+">";var root=this.getM_XmlDoc().documentElement;var nodes=root.childNodes;var maxCount=nodes.length;for(var count=0;count<maxCount;count++){strXml=strXml+mqXmlToStr(nodes[count]);}
strXml=strXml+"</"+obj.getM_Xpath()+">";var cp=new this.constructor;cp.loadXml(strXml);return cp;};MQPoint.prototype=new MQObject();MQPoint.prototype.constructor=MQPoint;function MQPoint(param1,param2){MQObject.call(this);this.x=0;this.y=0;this.setM_Xpath("Point");if(arguments.length==1){this.setM_Xpath(param1);}
else if(arguments.length==2){this.x=parseInt(param1);this.y=parseInt(param2);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(strXml){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(mqCreateXMLDoc(strXml));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(x){this.x=parseInt(x);if(isNaN(this.x))
throw new Error("MQPoint.setX called with invalid parameter");};MQPoint.prototype.getX=function(){return this.x;};MQPoint.prototype.setY=function(y){this.y=parseInt(y);if(isNaN(this.y))
throw new Error("MQPoint.setY called with invalid parameter");};MQPoint.prototype.getY=function(){return this.y;};MQPoint.prototype.setXY=function(x,y){this.x=parseInt(x);this.y=parseInt(y);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(pt){if(pt){return(this.x===pt.x&&this.y===pt.y);}
return false;};MQPoint.prototype.toString=function(){return this.x+","+this.y;};MQLatLng.prototype=new MQObject();MQLatLng.prototype.constructor=MQLatLng;function MQLatLng(param1,param2){MQObject.call(this);this.lat=0.0;this.lng=0.0;this.setM_Xpath("LatLng");if(arguments.length==1){this.setM_Xpath(param1);}
else if(arguments.length==2){this.lat=parseFloat(param1);this.lng=parseFloat(param2);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(strXml){if("undefined"!==typeof(mqutils)){this.setM_XmlDoc(mqCreateXMLDoc(strXml));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(fLatitude){this.lat=parseFloat(fLatitude);if(isNaN(this.lat))
throw new Error("MQLatLng.setLatitude called with invalid parameter");};MQLatLng.prototype.getLatitude=function(){return this.lat;};MQLatLng.prototype.setLongitude=function(fLongitude){this.lng=parseFloat(fLongitude);if(isNaN(this.lng))
throw new Error("MQLatLng.setLongitude called with invalid parameter");};MQLatLng.prototype.getLongitude=function(){return this.lng;};MQLatLng.prototype.setLatLng=function(fLatitude,fLongitude){this.lat=parseFloat(fLatitude);this.lng=parseFloat(fLongitude);if(isNaN(this.lat)||isNaN(this.lng))
throw new Error("MQLatLng.setLatLng called with invalid parameter");};MQLatLng.prototype.arcDistance=function(ll2,lUnits){if("undefined"!==typeof(mqutils)){if(ll2){if(ll2.getClassName()!=="MQLatLng"){alert("failure in arcDistance");throw"failure in arcDistance";}}else{alert("failure in arcDistance");throw"failure in arcDistance";}
if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(this.getLatitude()==ll2.getLatitude()&&this.getLongitude()==ll2.getLongitude()){return 0.0;}
var dLon=ll2.getLongitude()-this.getLongitude();var a=MQCONSTANT.MQLATLNG_RADIANS*(90.0-this.getLatitude());var c=MQCONSTANT.MQLATLNG_RADIANS*(90.0-ll2.getLatitude());var cosB=(Math.cos(a)*Math.cos(c))+(Math.sin(a)*Math.sin(c)*Math.cos(MQCONSTANT.MQLATLNG_RADIANS*(dLon)));var radius=(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_MILES)?3963.205:6378.160187;if(cosB<-1.0)
return MQCONSTANT.PI*radius;else if(cosB>=1.0)
return 0;else
return Math.acos(cosB)*radius;}
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(ll){if(ll!==null){return(this.getLongitude()===ll.getLongitude()&&this.getLatitude()===ll.getLatitude());}
return false;};MQLatLng.prototype.toString=function(){return this.lat+","+this.lng;};function mqCreateXMLDoc(strXML){var newDoc;if(document.implementation.createDocument){var parser=new window.DOMParser();if(mqBrowserInfo.isSafari)
strXML=strXML.replace(/&/g,'&amp;');newDoc=parser.parseFromString(strXML,"text/xml");}else if(window.ActiveXObject){newDoc=new window.ActiveXObject("Microsoft.XMLDOM");newDoc.async="false";newDoc.loadXML(strXML);}
return newDoc;}
function mqCreateXMLDocFromNode(ndNewRoot){var newDoc;ndNewRoot=ndNewRoot.documentElement;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 MQXMLDOC(){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=mqCreateXMLDoc("<AutoGeocodeCovSwitch/>");return this.AUTOGEOCODECOVSWITCH;}
this.getAUTOROUTECOVSWITCH=function(){if(this.AUTOROUTECOVSWITCH===null)
this.AUTOROUTECOVSWITCH=mqCreateXMLDoc("<AutoRouteCovSwitch><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></AutoRouteCovSwitch>");return this.AUTOROUTECOVSWITCH;}
this.getAUTOMAPCOVSWITCH=function(){if(this.AUTOMAPCOVSWITCH===null)
this.AUTOMAPCOVSWITCH=mqCreateXMLDoc("<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=mqCreateXMLDoc("<DBLayerQuery/>");return this.DBLAYERQUERY;}
this.getLINEPRIMITIVE=function(){if(this.LINEPRIMITIVE===null)
this.LINEPRIMITIVE=mqCreateXMLDoc("<LinePrimitive Version=\"2\"/>");return this.LINEPRIMITIVE;}
this.getPOLYGONPRIMITIVE=function(){if(this.POLYGONPRIMITIVE===null)
this.POLYGONPRIMITIVE=mqCreateXMLDoc("<PolygonPrimitive Version=\"2\"/>");return this.POLYGONPRIMITIVE;}
this.getRECTANGLEPRIMITIVE=function(){if(this.RECTANGLEPRIMITIVE===null)
this.RECTANGLEPRIMITIVE=mqCreateXMLDoc("<RectanglePrimitive Version=\"2\"/>");return this.RECTANGLEPRIMITIVE;}
this.getELLIPSEPRIMITIVE=function(){if(this.ELLIPSEPRIMITIVE===null)
this.ELLIPSEPRIMITIVE=mqCreateXMLDoc("<EllipsePrimitive Version=\"2\"/>");return this.ELLIPSEPRIMITIVE;}
this.getTEXTPRIMITIVE=function(){if(this.TEXTPRIMITIVE===null)
this.TEXTPRIMITIVE=mqCreateXMLDoc("<TextPrimitive Version=\"2\"/>");return this.TEXTPRIMITIVE;}
this.getSYMBOLPRIMITIVE=function(){if(this.SYMBOLPRIMITIVE===null)
this.SYMBOLPRIMITIVE=mqCreateXMLDoc("<SymbolPrimitive Version=\"2\"/>");return this.SYMBOLPRIMITIVE;}
this.getLATLNG=function(){if(this.LATLNG===null)
this.LATLNG=mqCreateXMLDoc("<LatLng/>");return this.LATLNG;}
this.getPOINT=function(){if(this.POINT===null)
this.POINT=mqCreateXMLDoc("<Point/>");return this.POINT;}
this.getPOINTFEATURE=function(){if(this.POINTFEATURE===null)
this.POINTFEATURE=mqCreateXMLDoc("<PointFeature/>");return this.POINTFEATURE;}
this.getLINEFEATURE=function(){if(this.LINEFEATURE===null)
this.LINEFEATURE=mqCreateXMLDoc("<LineFeature/>");return this.LINEFEATURE;}
this.getPOLYGONFEATURE=function(){if(this.POLYGONFEATURE===null)
this.POLYGONFEATURE=mqCreateXMLDoc("<PolygonFeature/>");return this.POLYGONFEATURE;}
this.getLOCATION=function(){if(this.LOCATION===null)
this.LOCATION=mqCreateXMLDoc("<Location/>");return this.LOCATION;}
this.getADDRESS=function(){if(this.ADDRESS===null)
this.ADDRESS=mqCreateXMLDoc("<Address/>");return this.ADDRESS;}
this.getSINGLELINEADDRESS=function(){if(this.SINGLELINEADDRESS===null)
this.SINGLELINEADDRESS=mqCreateXMLDoc("<SingleLineAddress/>");return this.SINGLELINEADDRESS;}
this.getGEOADDRESS=function(){if(this.GEOADDRESS===null)
this.GEOADDRESS=mqCreateXMLDoc("<GeoAddress/>");return this.GEOADDRESS;}
this.getGEOCODEOPTIONS=function(){if(this.GEOCODEOPTIONS===null)
this.GEOCODEOPTIONS=mqCreateXMLDoc("<GeocodeOptions/>");return this.GEOCODEOPTIONS;}
this.getMANEUVER=function(){if(this.MANEUVER===null)
this.MANEUVER=mqCreateXMLDoc("<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=mqCreateXMLDoc("<RouteOptions Version=\"3\"><RouteType>0</RouteType><NarrativeType>1</NarrativeType><NarrativeDistanceUnitType>0</NarrativeDistanceUnitType><MaxShape>0</MaxShape><MaxGEFID>0</MaxGEFID><Language>English</Language><CoverageName>navt_r</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=mqCreateXMLDoc("<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=mqCreateXMLDoc("<RouteMatrixResults/>");return this.ROUTEMATRIXRESULTS;}
this.getRADIUSSEARCHCRITERIA=function(){if(this.RADIUSSEARCHCRITERIA===null)
this.RADIUSSEARCHCRITERIA=mqCreateXMLDoc("<RadiusSearchCriteria/>");return this.RADIUSSEARCHCRITERIA;}
this.getRECTSEARCHCRITERIA=function(){if(this.RECTSEARCHCRITERIA===null)
this.RECTSEARCHCRITERIA=mqCreateXMLDoc("<RectSearchCriteria/>");return this.RECTSEARCHCRITERIA;}
this.getPOLYSEARCHCRITERIA=function(){if(this.POLYSEARCHCRITERIA===null)
this.POLYSEARCHCRITERIA=mqCreateXMLDoc("<PolySearchCriteria/>");return this.POLYSEARCHCRITERIA;}
this.getCORRIDORSEARCHCRITERIA=function(){if(this.CORRIDORSEARCHCRITERIA===null)
this.CORRIDORSEARCHCRITERIA=mqCreateXMLDoc("<CorridorSearchCriteria/>");return this.CORRIDORSEARCHCRITERIA;}
this.getSIGN=function(){if(this.SIGN===null)
this.SIGN=mqCreateXMLDoc("<Sign><Type>0</Type><Text></Text><ExtraText></ExtraText><Direction>0</Direction></Sign>");return this.SIGN;}
this.getTREKROUTE=function(){if(this.TREKROUTE===null)
this.TREKROUTE=mqCreateXMLDoc("<TrekRoute><Maneuvers Count=\"0\"/></TrekRoute>");return this.TREKROUTE;}
this.getINTCOLLECTION=function(){if(this.INTCOLLECTION===null)
this.INTCOLLECTION=mqCreateXMLDoc("<IntCollection Count=\"0\"/>");return this.INTCOLLECTION;}
this.getDTCOLLECTION=function(){if(this.DTCOLLECTION===null)
this.DTCOLLECTION=mqCreateXMLDoc("<DTCollection Version=\"1\" Count=\"0\"/>");return this.DTCOLLECTION;}
this.getLATLNGCOLLECTION=function(){if(this.LATLNGCOLLECTION===null)
this.LATLNGCOLLECTION=mqCreateXMLDoc("<LatLngCollection Version=\"1\" Count=\"0\"/>");return this.LATLNGCOLLECTION;}
this.getLOCATIONCOLLECTION=function(){if(this.LOCATIONCOLLECTION===null)
this.LOCATIONCOLLECTION=mqCreateXMLDoc("<LocationCollection Count=\"0\"/>");return this.LOCATIONCOLLECTION;}
this.getLOCATIONCOLLECTIONCOLLECTION=function(){if(this.LOCATIONCOLLECTIONCOLLECTION===null)
this.LOCATIONCOLLECTIONCOLLECTION=mqCreateXMLDoc("<LocationCollectionCollection Count=\"0\"/>");return this.LOCATIONCOLLECTIONCOLLECTION;}
this.getMANEUVERCOLLECTION=function(){if(this.MANEUVERCOLLECTION===null)
this.MANEUVERCOLLECTION=mqCreateXMLDoc("<ManeuverCollection Count=\"0\"/>");return this.MANEUVERCOLLECTION;}
this.getSIGNCOLLECTION=function(){if(this.SIGNCOLLECTION===null)
this.SIGNCOLLECTION=mqCreateXMLDoc("<SignCollection Count=\"0\"/>");return this.SIGNCOLLECTION;}
this.getSTRINGCOLLECTION=function(){if(this.STRINGCOLLECTION===null)
this.STRINGCOLLECTION=mqCreateXMLDoc("<StringCollection Count=\"0\"/>");return this.STRINGCOLLECTION;}
this.getSTRCOLCOLLECTION=function(){if(this.STRCOLCOLLECTION===null)
this.STRCOLCOLLECTION=mqCreateXMLDoc("<StrColCollectin/>");return this.STRCOLCOLLECTION;}
this.getFEATURECOLLECTION=function(){if(this.FEATURECOLLECTION===null)
this.FEATURECOLLECTION=mqCreateXMLDoc("<FeatureCollection Count=\"0\"/>");return this.FEATURECOLLECTION;}
this.getPRIMITIVECOLLECTION=function(){if(this.PRIMITIVECOLLECTION===null)
this.PRIMITIVECOLLECTION=mqCreateXMLDoc("<PrimitiveCollection Count=\"0\"/>");return this.PRIMITIVECOLLECTION;}
this.getPOINTCOLLECTION=function(){if(this.POINTCOLLECTION===null)
this.POINTCOLLECTION=mqCreateXMLDoc("<PointCollection Count=\"0\"/>");return this.POINTCOLLECTION;}
this.getTREKROUTECOLLECTION=function(){if(this.TREKROUTECOLLECTION===null)
this.TREKROUTECOLLECTION=mqCreateXMLDoc("<TrekRouteCollection Count=\"0\"/>");return this.TREKROUTECOLLECTION;}
this.getFEATURESPECIFIERCOLLECTION=function(){if(this.FEATURESPECIFIERCOLLECTION===null)
this.FEATURESPECIFIERCOLLECTION=mqCreateXMLDoc("<FeatureSpecifierCollection Count=\"0\"/>");return this.FEATURESPECIFIERCOLLECTION;}
this.getGEOCODEOPTIONSCOLLECTION=function(){if(this.GEOCODEOPTIONSCOLLECTION===null)
this.GEOCODEOPTIONSCOLLECTION=mqCreateXMLDoc("<GeocodeOptionsCollection Count=\"0\"/>");return this.GEOCODEOPTIONSCOLLECTION;}
this.getCOVERAGESTYLE=function(){if(this.COVERAGESTYLE===null)
this.COVERAGESTYLE=mqCreateXMLDoc("<CoverageStyle/>");return this.COVERAGESTYLE;}
this.getRECORDSET=function(){if(this.RECORDSET===null)
this.RECORDSET=mqCreateXMLDoc("<RecordSet/>");return this.RECORDSET;}
this.getMAPSTATE=function(){if(this.MAPSTATE===null)
this.MAPSTATE=mqCreateXMLDoc("<MapState/>");return this.MAPSTATE;}
this.getSESSION=function(){if(this.SESSION===null)
this.SESSION=mqCreateXMLDoc("<Session Count=\"0\"/>");return this.SESSION;}
this.getSESSIONID=function(){if(this.SESSIONID===null)
this.SESSIONID=mqCreateXMLDoc("<SessionID/>");return this.SESSIONID;}
this.getDTSTYLE=function(){if(this.DTSTYLE===null)
this.DTSTYLE=mqCreateXMLDoc("<DTStyle/>");return this.DTSTYLE;}
this.getDTSTYLEEX=function(){if(this.DTSTYLEEX===null)
this.DTSTYLEEX=mqCreateXMLDoc("<DTStyleEx/>");return this.DTSTYLEEX;}
this.getDTFEATURESTYLEEX=function(){if(this.DTFEATURESTYLEEX===null)
this.DTFEATURESTYLEEX=mqCreateXMLDoc("<DTFeatureStyleEx/>");return this.DTFEATURESTYLEEX;}
this.getFEATURESPECIFIER=function(){if(this.FEATURESPECIFIER===null)
this.FEATURESPECIFIER=mqCreateXMLDoc("<FeatureSpecifier/>");return this.FEATURESPECIFIER;}
this.getBESTFIT=function(){if(this.BESTFIT===null)
this.BESTFIT=mqCreateXMLDoc("<BestFit Version=\"2\"/>");return this.BESTFIT;}
this.getBESTFITLL=function(){if(this.BESTFITLL===null)
this.BESTFITLL=mqCreateXMLDoc("<BestFitLL Version=\"2\"/>");return this.BESTFITLL;}
this.getCENTER=function(){if(this.CENTER===null)
this.CENTER=mqCreateXMLDoc("<Center/>");return this.CENTER;}
this.getCENTERLATLNG=function(){if(this.CENTERLATLNG===null)
this.CENTERLATLNG=mqCreateXMLDoc("<CenterLatLng/>");return this.CENTERLATLNG;}
this.getPAN=function(){if(this.PAN===null)
this.PAN=mqCreateXMLDoc("<Pan/>");return this.PAN;}
this.getZOOMIN=function(){if(this.ZOOMIN===null)
this.ZOOMIN=mqCreateXMLDoc("<ZoomIn/>");return this.ZOOMIN;}
this.getZOOMOUT=function(){if(this.ZOOMOUT===null)
this.ZOOMOUT=mqCreateXMLDoc("<ZoomOut/>");return this.ZOOMOUT;}
this.getZOOMTO=function(){if(this.ZOOMTO===null)
this.ZOOMTO=mqCreateXMLDoc("<ZoomTo/>");return this.ZOOMTO;}
this.getZOOMTORECT=function(){if(this.ZOOMTORECT===null)
this.ZOOMTORECT=mqCreateXMLDoc("<ZoomToRect/>");return this.ZOOMTORECT;}
this.getZOOMTORECTLATLNG=function(){if(this.ZOOMTORECTLATLNG===null)
this.ZOOMTORECTLATLNG=mqCreateXMLDoc("<ZoomToRectLatLng/>");return this.ZOOMTORECTLATLNG;}}
var MQXML=new MQXMLDOC();MQObjectCollection.prototype=new MQObject();MQObjectCollection.prototype.constructor=MQObjectCollection;function MQObjectCollection(max){MQObject.call(this);var m_items=new Array();this.getM_Items=function(){return m_items;};var m_maxItems=(max!==null)?max:-1;var validClassName="MQObject";this.getValidClassName=function(){return validClassName;};this.setValidClassName=function(className){validClassName=className;};this.add=function(obj){if(this.isValidObject(obj)){if(m_maxItems!==-1&&m_items.length===max)return;m_items.push(obj);return m_items.length;}
return;};this.getSize=function(){return m_items.length;};this.get=function(i){return m_items[i];};this.remove=function(iIndex){return m_items.splice(iIndex,1);};this.removeAll=function(){m_items=null;m_items=new Array();};this.contains=function(item){var size=this.getSize();for(var count=0;count<size;count++){if(m_items[count]===item){return true;}}
return false;};this.append=function(collection){if(this.getClassName()===collection.getClassName()){m_items=m_items.concat(collection.getM_Items());}else{alert("Invalid attempt to append "+this.getClassName()+" to "+collection.getClassName()+"!");throw"Invalid attempt to append "+this.getClassName()+" to "+collection.getClassName()+"!";}};this.set=function(i,newO){var oldO=get(i);m_items[i]=newO;return oldO;};this.isValidObject=function(obj){if(obj!==null){if(validClassName==="ALL"){return true;}else if(validClassName==="MQObject"){return true;}else if(validClassName==="String"){return true;}else if(validClassName==="int"){if(isNaN(obj)){return false;}else if(obj===Math.floor(obj)){return true;}}else if(obj.getClassName()===validClassName){return true;}}
return false;};var m_itemXpath="Item";this.getM_itemXpath=function(){return m_itemXpath;};this.setM_itemXpath=function(itemXpath){m_itemXpath=itemXpath;};this.getById=function(strId){try{for(var count=0;count<this.getSize();count++){if(m_items[count].getId()==strId){return m_items[count];}}}catch(Error){}
return null;};this.removeItem=function(item){for(var i=0;i<m_items.length;i++)
{if(m_items[i]==item)
{this.remove(i);i=m_items.length;}}};}
MQObjectCollection.prototype.getClassName=function(){return"MQObjectCollection";};MQObjectCollection.prototype.getObjectVersion=function(){return 0;};MQObjectCollection.prototype.getAt=function(i){return this.get(i);};MQLatLngCollection.prototype=new MQObjectCollection(32678);MQLatLngCollection.prototype.constructor=MQLatLngCollection;function MQLatLngCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQLatLng");this.setM_Xpath("LatLngCollection");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getLATLNGCOLLECTION()));}
MQLatLngCollection.prototype.getClassName=function(){return"MQLatLngCollection";};MQLatLngCollection.prototype.getObjectVersion=function(){return 1;};MQLatLngCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){this._loadCollection(xmlDoc);}};MQLatLngCollection.prototype.loadXmlFromNode=function(xmlNode){this.removeAll();var xmlDoc=mqCreateXMLDocImportNode(xmlNode);this.setM_XmlDoc(xmlDoc);if(xmlDoc!==null){this._loadCollection(xmlDoc);}};MQLatLngCollection.prototype._loadCollection=function(xmlDoc){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var prevLat=0;var prevLng=0;var currentLat=0;var currentLng=0;var latlng=null;if(this.getValidClassName()==="MQLatLng"){for(var count=0;count<maxCount;count++){if(count==0){if(nodes[count].firstChild!==null){currentLat=nodes[count].firstChild.nodeValue/1000000;}
count++;if(nodes[count].firstChild!==null){currentLng=nodes[count].firstChild.nodeValue/1000000;}}else{if(nodes[count].firstChild!==null){currentLat=prevLat+(nodes[count].firstChild.nodeValue/1000000);}
count++;if(nodes[count].firstChild!==null){currentLng=prevLng+(nodes[count].firstChild.nodeValue/1000000);}}
prevLat=currentLat;prevLng=currentLng;latlng=new MQLatLng(currentLat,currentLng);this.add(latlng);}}};MQLatLngCollection.prototype.saveXml=function(){var strRet="<"+this.getM_Xpath()+" Version=\""+this.getObjectVersion()+"\" Count=\""+this.getSize()+"\">";var size=parseInt(this.getSize());if(size>=1){var nLat=nLng=nPrevLat=nPrevLng=nDeltaLat=nDeltaLng=0;var latLng=null;for(var i=0;i<size;i++){latLng=this.getAt(i);nLat=parseInt(latLng.getLatitude()*1000000);nLng=parseInt(latLng.getLongitude()*1000000);nDeltaLat=nLat-nPrevLat;nDeltaLng=nLng-nPrevLng;strRet+="<Lat>"+nDeltaLat+"</Lat>";strRet+="<Lng>"+nDeltaLng+"</Lng>";nPrevLat=nLat;nPrevLng=nLng;}}
strRet=strRet+"</"+this.getM_Xpath()+">";return strRet;};MQLatLngCollection.prototype.generalize=function(dDeviance){var SOrigPoint=function()
{this.pLL=null;this.dSegmentLength=0.0;this.dPriorLength=0.0;};var SDerivedPoint=function()
{this.pLL=null;this.ulOriginalPoint=0;};mqllAnchor=null;var ulAnchor;var i;var dAccumLength=0.0;var nPoints=this.getSize();var pOrigPoints=new Array(nPoints);var pDerivedPoints=new Array(nPoints);var nDerivedPoints=0;if(nPoints<2)
return;for(i=0;i<nPoints;i++)
{pOrigPoints[i]=new SOrigPoint();pDerivedPoints[i]=new SDerivedPoint();pOrigPoints[i].pLL=this.getAt(i);}
for(i=0;i<nPoints-1;i++)
{pOrigPoints[i].dSegmentLength=pOrigPoints[i].pLL.arcDistance(pOrigPoints[(i+1)].pLL);if(i==0)
pOrigPoints[i].dPriorLength=0.0;else
pOrigPoints[i].dPriorLength=dAccumLength;dAccumLength+=pOrigPoints[i].dSegmentLength;}
mqllAnchor=pOrigPoints[0].pLL;ulAnchor=0;pDerivedPoints[0].pLL=mqllAnchor;pDerivedPoints[0].ulOriginalPoint=0;nDerivedPoints=1;for(i=2;i<nPoints;i++)
{if(!this.isEverybodyWithinDeviation(pOrigPoints,ulAnchor,i,dDeviance))
{mqllAnchor=pOrigPoints[(i-1)].pLL;ulAnchor=(i-1);pDerivedPoints[nDerivedPoints].pLL=mqllAnchor;pDerivedPoints[nDerivedPoints].ulOriginalPoint=(i-1);nDerivedPoints++;}}
pDerivedPoints[nDerivedPoints].pLL=pOrigPoints[nPoints-1].pLL;pDerivedPoints[nDerivedPoints].ulOriginalPoint=nPoints-1;nDerivedPoints++;var nPrev=nPoints;var nCount;for(nCount=(nDerivedPoints-1);nCount>=0;nCount--)
{if((nPrev-1)!=pDerivedPoints[nCount].ulOriginalPoint)
{for(var x=(nPrev-1);x>pDerivedPoints[nCount].ulOriginalPoint;x--)
{try
{this.remove(x);}
catch(e)
{}}
nPrev=pDerivedPoints[nCount].ulOriginalPoint;}
else
{nPrev--;}}
pOrigPoints=null;pDerivedPoints=null;};MQLatLngCollection.prototype.isEverybodyWithinDeviation=function(pOrigPoints,ulOrigStartPoint,ulOrigEndPoint,dMaxDeviation)
{var dMilesPerLng=0.0;var dMaxDeviationSquared=0.0;var mqllStartPoint=null;var mqllEndPoint=null;var dLineLatMiles=0.0;var dLineLngMiles=0.0;var dLineLengthSquared=0.0;var i;var mqllPoint=null;var dPointLatMiles=0.0;var dPointLngMiles=0.0;var dPointLengthSquared=0.0;var dRatio=0.0;var dNumerator=0.0;var dDenominator=0.0;var dProjectionLengthSquared=0.0;var dDeviationLengthSquared=0.0;dMilesPerLng=DistanceApproximation.getMilesPerLngDeg(pOrigPoints[ulOrigStartPoint].pLL.getLatitude());dMaxDeviationSquared=dMaxDeviation*dMaxDeviation;mqllStartPoint=pOrigPoints[ulOrigStartPoint].pLL;mqllEndPoint=pOrigPoints[ulOrigEndPoint].pLL;dLineLatMiles=(mqllEndPoint.getLatitude()-mqllStartPoint.getLatitude())*DistanceApproximation.MILES_PER_LATITUDE;dLineLngMiles=(mqllEndPoint.getLongitude()-mqllStartPoint.getLongitude())*dMilesPerLng;dLineLengthSquared=dLineLatMiles*dLineLatMiles+dLineLngMiles*dLineLngMiles;for(i=ulOrigStartPoint+1;i<ulOrigEndPoint;i++)
{mqllPoint=pOrigPoints[i].pLL;dPointLatMiles=(mqllPoint.getLatitude()-mqllStartPoint.getLatitude())*DistanceApproximation.MILES_PER_LATITUDE;;dPointLngMiles=(mqllPoint.getLongitude()-mqllStartPoint.getLongitude())*dMilesPerLng;dPointLengthSquared=dPointLatMiles*dPointLatMiles+dPointLngMiles*dPointLngMiles;dNumerator=dLineLatMiles*dPointLatMiles+dLineLngMiles*dPointLngMiles;dDenominator=dLineLatMiles*dLineLatMiles+dLineLngMiles*dLineLngMiles;if(dDenominator==0)
dRatio=0;else
dRatio=dNumerator/dDenominator;dProjectionLengthSquared=dRatio*dRatio*dLineLengthSquared;dDeviationLengthSquared=dPointLengthSquared-dProjectionLengthSquared;if(dDeviationLengthSquared>dMaxDeviationSquared)
return false;}
return true;};var 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.170310,61.631630,61.074176,60.498118,59.903632,59.290899,58.660106,58.011443,57.345111,56.661310,55.960250,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.585570,41.627796,40.657342,39.674504,38.679582,37.672877,36.654698,35.625354,34.585159,33.534429,32.473485,31.402650,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.381280,13.198283,12.011266,10.820591,9.626619,8.429716,7.230245,6.028572,4.825062,3.620083,2.414002,1.207185,1.000000);this.MILES_PER_LATITUDE=69.170976;this.KILOMETERS_PER_MILE=1.609347;this.getMilesPerLngDeg=function(lat)
{return(Math.abs(lat)<=90.0)?this.m_milesPerLngDeg[parseInt(Math.abs(lat)+0.5)]:69.170976;}};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 mqBuildUrl(strQueryData)
{var mqServer=_mqServerPort.replace(/mapquest.com:?\d*/,'mapquest.com');return(_reqPrefix+mqServer+"/oapi/transaction?"+strQueryData+"&key="+_mqKey);}
function mqUrlLimit()
{var maxLength=2048;if(mqBrowserInfo.isNS){maxLength=7168;}
return maxLength;}
function mqLimitDisplay()
{var dispLength=2;if(mqBrowserInfo.isNS){dispLength=7;}
return dispLength;}
function mqDoRemote(strQueryData,strDivName,strParentTagName,mqObj)
{var parent=document.getElementsByTagName(strParentTagName).item(0);var scMQRemote=mqGetElementById(strDivName);if(scMQRemote)
{parent.removeChild(scMQRemote);}
scMQRemote=document.createElement("script");var srcString=mqBuildUrl(strQueryData);if(strQueryData.substring(0,4)=="http")
{srcString=strQueryData;}
if(srcString.length>mqUrlLimit())
{alert("The request query exceeds the limit ("+mqLimitDisplay()+" Kb) allowed for your browser type. Please reduce the amount of data in the request query!");return;}
scMQRemote.src=srcString;scMQRemote.type="text/javascript";scMQRemote.id=strDivName;parent.appendChild(scMQRemote);}
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(mqBrowserInfo.isNS){serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);}else if(mqBrowserInfo.isIE){strXml=xmlDoc.xml;}
if(mqBrowserInfo.isSafari)
{serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);strXml=strXml||"";strXml=strXml.replace(/#38;/g,'&');}else if(mqBrowserInfo.isOpera){serializer=new window.XMLSerializer();strXml=serializer.serializeToString(xmlDoc);}
return strXml;}
function mqCreateNSManager(namespace){var nsmgr={normalResolver:xmlDoc.createNSResolver(xmlDoc.documentElement),lookupNamespaceURI:function(prefix){switch(prefix){case"_mq":return namespace;default:return this.normalResolver.lookupNamespaceURI(prefix);}}}
return nsmgr;}
function mqGetNode(xmlDoc,strPath){var node;if(mqBrowserInfo.isSafari)
{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 if(mqBrowserInfo.isIE){node=xmlDoc.selectSingleNode(strPath);return node;}else if(mqBrowserInfo.isNS){node=xmlDoc.evaluate(strPath,xmlDoc,null,9,null);return node.singleNodeValue;}else if(mqBrowserInfo.isOpera)
{node=xmlDoc.evaluate(strPath,xmlDoc,null,9,null);return node.singleNodeValue;}
return null;}
function mqGetNodeText(domNode){var elemText="";if(mqBrowserInfo.isIE){elemText=domNode.text;}else if(mqBrowserInfo.isNS&&domNode.firstChild){elemText=domNode.firstChild.nodeValue;}
if(mqBrowserInfo.isSafari&&domNode.firstChild){elemText=domNode.firstChild.nodeValue;elemText=(elemText?elemText:"");elemText=elemText.replace(/#38;/g,'&');}
return elemText;}
function mqGetXPathNodeText(xmlDoc,strPath){var node;if(mqBrowserInfo.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(mqBrowserInfo.isIE){node=xmlDoc.selectSingleNode(strPath);return(node==null?"":node.text);}else if(mqBrowserInfo.isNS){try{node=xmlDoc.evaluate(strPath,xmlDoc,null,2,null);}catch(error){alert(strPath);alert(error);}
return node.stringValue;}else if(mqBrowserInfo.isOpera)
{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(mqBrowserInfo.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 mqTransformXMLFromString(strXml,strXsl,dvParent){var xmlDoc=mqCreateXMLDoc(strXml);var xslDoc=mqCreateXMLDoc(strXsl);var newFragment;if(mqBrowserInfo.isNS){var xsltProcessor=new XSLTProcessor();xsltProcessor.importStylesheet(xslDoc);newFragment=xsltProcessor.transformToFragment(xmlDoc,document);dvParent.appendChild(newFragment);}else if(mqBrowserInfo.isIE){var newFragment=new ActiveXObject("Msxml2.DOMDocument.5.0");newFragment=xmlDoc.transformNode(xslDoc);dvParent.innerHTML+=newFragment;}}
function mqTransformXMLFromNode(ndXml,strXsl,dvParent){var xslDoc=mqCreateXMLDoc(strXsl);var newFragment;if(mqBrowserInfo.isNS){var xsltProcessor=new XSLTProcessor();xsltProcessor.importStylesheet(xslDoc);newFragment=xsltProcessor.transformToFragment(ndXml,document);dvParent.appendChild(newFragment);}else if(mqBrowserInfo.isIE){var newFragment=new ActiveXObject("Msxml2.DOMDocument.5.0");newFragment=ndXml.transformNode(xslDoc);dvParent.innerHTML+=newFragment;}}
mqAddEvent(window,"load",alphaBackgrounds);function alphaBackgrounds(){if(navigator.platform=="Win32"&&navigator.appName=="Microsoft Internet Explorer"&&window.attachEvent){var rslt=navigator.appVersion.match(/MSIE (\d+\.\d+)/,'');var itsAllGood=(rslt!=null&&Number(rslt[1])>=5.5);for(i=0;i<document.all.length;i++){var bg=document.all[i].currentStyle.backgroundImage;if(itsAllGood&&bg){if(bg.match(/\.png/i)!=null){var mypng=bg.substring(5,bg.length-2);document.all[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";document.all[i].style.backgroundImage="url(/images/background-form-button.gif)";}}}}}
function mqFormatNumber(num,dec){return Math.floor(num*Math.pow(10,dec))/Math.pow(10,dec);}
function mq_display_time(totalTime){var newTime;if(totalTime>3600)
{newTime=totalTime/3600;var result=(" "+Math.floor(newTime)+" hours,");newTime=(totalTime/60)%60;result+=(" "+mqFormatNumber(newTime,2)+" minutes");return result;}
if(totalTime>60)
{newTime=totalTime/60;return(" "+mqFormatNumber(newTime,2)+" minutes");}}
function mq_display_distance(totalDistance){return(" "+mqFormatNumber(totalDistance.value,2)+(totalDistance.units=="mi"?" miles":" kilometers"));}
var isIE5Mac=(navigator.userAgent.indexOf('MSIE 5')!=-1&&navigator.userAgent.indexOf('Mac')!=-1);function mqCreateFormInput(container,id,spanClass,labelTxt,type,name,value,size,maxLength){var div=container.appendChild(document.createElement('div'));div.className='row';var label=div.appendChild(document.createElement('label'));label.htmlFor=id;label.appendChild(document.createTextNode(labelTxt));div.appendChild(document.createElement('br'));var input=document.createElement('input');input.id=id;input.type=type;input.name=name;if(size!=""){input.size=size;}
if(!isNaN(parseInt(maxLength))){input.maxLength=parseInt(maxLength);}
if(value!=""){input.value=value;}
if(spanClass!=""){var span=div.appendChild(document.createElement('span'));span.className=spanClass;span.appendChild(input);}else{div.appendChild(input);}}
function mqCreateInput(container,id,type,name,value,size,maxLength){var input=document.createElement('input');input.id=id;input.type=type;input.name=name;if(size!=""){input.size=size;}
if(!isNaN(parseInt(maxLength))){input.maxLength=parseInt(maxLength);}
if(value!=""){input.value=value;}
container.appendChild(input);}
function mqCreateHiddenInput(form,id,name,value){var input;if(isIE5Mac){input=document.createElement('input type=hidden');}else{input=document.createElement('input');input.type='hidden';}
input.name=name;if(id!=''){input.id=id;}
if(value!=''){input.value=value;}
form.appendChild(input);}
function mqCreateFormSelect(container,id,spanClass,labelTxt,name,elements,node){var div=container.appendChild(document.createElement('div'));div.className='row';var label=div.appendChild(document.createElement('label'));label.htmlFor=id;label.appendChild(document.createTextNode(labelTxt));div.appendChild(document.createElement('br'));if(spanClass!=""){var span=div.appendChild(document.createElement('span'));span.className=spanClass;var select=span.appendChild(document.createElement('select'));}else{var select=div.appendChild(document.createElement('select'));}
select.id=id;select.name=name;length=elements.length;for(x=0;x<length;x++){var option=select.appendChild(document.createElement('option'));eval("option.value = elements[x]."+node);eval("option.appendChild (document.createTextNode (elements[x]."+node+"))");}
return select;}
function mqCreateDiv(container,className,id){var div=container.appendChild(document.createElement('div'));if(className!=""){div.className=className;}
if(id!=""){div.id=id;}
return div;}
function mqCreateA(container,href,title){var a=container.appendChild(document.createElement('a'));a.href=href;if(title!=""){a.title=title;}
return a;}
function mqCreateSpan(container,className,id){var span=container.appendChild(document.createElement('span'));if(className!=""){span.className=className;}
if(id!=""){span.id=id;}
return span;}
function mqCreateImg(container,src,width,height,id,name,alt){var img=container.appendChild(document.createElement('img'));if(src!=""){img.src=src;}
if(!isNaN(parseInt(width))){img.width=parseInt(width);}
if(!isNaN(parseInt(height))){img.height=parseInt(height);}
if(id!=""){img.id=id;}
if(name!=""){img.name=name;}
if(alt!=""){img.alt=alt;}
return img;}
function mqCreateImgDiv(container,src,width,height,id,name,alt){var div=container.appendChild(document.createElement('div'));if(id!=""){div.id=id;}
if(!isNaN(parseInt(width))){div.style.width=parseInt(width)+"px";}
if(!isNaN(parseInt(height))){div.style.height=parseInt(height)+"px";}
if(name!=""){div.name=name;}
if(alt!=""){div.alt=alt;}
return div;}
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;}
function mqAddEvent(fObj,fEvent,fn)
{if(window.opera&&mqBrowserInfo.version<8)
{var r=fObj.attachEvent("on"+fEvent,fn);return r;}
else if(fObj.addEventListener)
{((window.opera)&&(mqBrowserInfo.version>=8))?fObj.addEventListener(fEvent,fn,false):fObj.addEventListener(fEvent,fn,true);return true;}
else if(fObj.attachEvent)
{var r=fObj.attachEvent("on"+fEvent,fn);return r;}
else
{fObj["on"+fEvent]=fn;}}
function mqRemoveEvent(fObj,fEvent,fn)
{if(window.opera)
{eval("fObj.on"+fEvent+" = null");}
if(fObj.removeEventListener)
{((window.opera)&&(mqBrowserInfo.version>=8))?fObj.removeEventListener(fEvent,fn,false):fObj.removeEventListener(fEvent,fn,true);}
else if(fObj.detachEvent)
{fObj.detachEvent("on"+fEvent,fn);}
else
{fObj["on"+fEvent]=null;}}
function mqGetEventData(evt)
{fEventData=new Object();if(document.addEventListener)
{fEventData.id=evt.target.id;fEventData.type=evt.type;fEventData.element=evt.target;}
else if(window.event)
{fEventData.id=window.event.srcElement.id;fEventData.type=window.event.type;fEventData.element=window.event.srcElement;}
else
{return null;}
return fEventData;}
function mqGetXY(evt)
{xyData=new Object();if(!document.createElement||!document.getElementsByTagName)return;if(!document.createElementNS)
{document.createElementNS=function(ns,elt)
{return document.createElement(elt);}}
if(document.addEventListener&&typeof evt.pageX=="number")
{var Element=evt.target;var CalculatedTotalOffsetLeft=CalculatedTotalOffsetTop=0;while(Element.offsetParent)
{CalculatedTotalOffsetLeft+=Element.offsetLeft;CalculatedTotalOffsetTop+=Element.offsetTop;Element=Element.offsetParent;}
var OffsetXForNS6=evt.pageX-CalculatedTotalOffsetLeft;var OffsetYForNS6=evt.pageY-CalculatedTotalOffsetTop;xyData.elementId=evt.target.id;xyData.elementX=OffsetXForNS6;xyData.elementY=OffsetYForNS6;xyData.pageX=evt.pageX;xyData.pageY=evt.pageY;}
else if(window.event&&typeof window.event.offsetX=="number")
{xyData.elementId=window.event.srcElement.id;xyData.elementX=event.offsetX;xyData.elementY=event.offsetY;xyData.pageX=0;xyData.pageY=0;var element=mqGetElementById(xyData.elementId);while(element)
{xyData.pageX+=element.offsetLeft;xyData.pageY+=element.offsetTop;element=element.offsetParent;}
xyData.pageX+=xyData.elementX;xyData.pageY+=xyData.elementY;}
return xyData;}
function mqGetPDivSize(pMQMapObject)
{size=new MQSize();if(pMQMapObject.parent.style.width.length==0)
pMQMapObject.parent.style.width="800px";if(pMQMapObject.parent.style.height.length==0)
pMQMapObject.parent.style.height="600px";size.setWidth(parseInt(pMQMapObject.parent.style.width)-4);size.setHeight(parseInt(pMQMapObject.parent.style.height)-4);return size;}
function mqSetPDivSize(pMQMapObject,size)
{pMQMapObject.parent.style.width=size.getWidth()+"px";pMQMapObject.parent.style.height=size.getHeight()+"px";}
function mqurlencode(strVal)
{var strEncode;strEncode=strVal.replace(/%/g,"%25");strEncode=strEncode.replace(/&/g,"%26");strEncode=strEncode.replace(/#/g,"%23");strEncode=strEncode.replace(/\//g,"%2F");strEncode=strEncode.replace(/:/g,"%3A");strEncode=strEncode.replace(/;/g,"%3B");strEncode=strEncode.replace(/=/g,"%3D");strEncode=strEncode.replace(/\?/g,"%3F");strEncode=strEncode.replace(/@/g,"%40");strEncode=strEncode.replace(/\$/g,"%24");strEncode=strEncode.replace(/,/g,"%2C");strEncode=strEncode.replace(/\+/g,"%2B");return strEncode;}
function mqGetGuid()
{var org=new Date(2006,0,1);var now=new Date();do{var cur=new Date();}while(cur-now<1);var diff=cur.getTime()-org.getTime();return(Math.ceil(diff));}
function mqPause(numberMillis)
{var now=new Date();var exitTime=now.getTime()+numberMillis;while(true)
{now=new Date();if(now.getTime()>exitTime)
return;}}
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 mqResetTimeLogs()
{if(mqGetElementById("mqTimeLogs"))
{var logtext=mqGetElementById("mqTimeLogs");var mqTimeLogger=new Date();logtext.value="Time(ms) Difference\t Message\n";_mqLogStartTime=mqTimeLogger.getTime();_mqLogprevTime=_mqLogStartTime;}}
function mqGetAdvantageResultPath(transaction){var resultsPath;if(transaction=="poiMap")
resultsPath="poiResults";else if(transaction=="locMap")
resultsPath="locations";else if(transaction=="search")
resultsPath="searchResults";return resultsPath;}
function mqGetAdvantageMapPath(transaction){var mapPath;if(transaction=="locMap")
mapPath="/advantage/"+transaction+"/locations/location/map";else
mapPath="/advantage/"+transaction+"/map";return mapPath;}
function mqPrepareMapUrl(strmapUrl){var mapUrl="";mapUrl=strmapUrl.replace(/https?:\/\//,_reqPrefix);mapUrl=mapUrl.replace(/mapquest.com:?\d*/,'mapquest.com');mapUrl=mapUrl.replace(/iwebsys.aol.com:?\d*/,'iwebsys.aol.com');return mapUrl;}
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(mqCreateXMLDocFromNode(MQXML.getSIGN()));}
MQSign.prototype.getClassName=function(){return"MQSign";};MQSign.prototype.getObjectVersion=function(){return 0;};MQSign.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(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");};MQFeature.prototype=new MQObject();MQFeature.prototype.constructor=MQFeature;function MQFeature(){MQObject.call(this);}
MQFeature.prototype.getClassName=function(){return"MQFeature";};MQFeature.prototype.getObjectVersion=function(){return 0;};MQFeature.prototype.getDistance=function(){return this.getProperty("Distance");};MQFeature.prototype.setDistance=function(dblDistance){this.setProperty("Distance",dblDistance);};MQFeature.prototype.getName=function(){return this.getProperty("Name");};MQFeature.prototype.setName=function(strName){this.setProperty("Name",strName);};MQFeature.prototype.getSourceLayerName=function(){return this.getProperty("SourceLayerName");};MQFeature.prototype.setSourceLayerName=function(strSourceLayerName){this.setProperty("SourceLayerName",strSourceLayerName);};MQFeature.prototype.getKey=function(){return this.getProperty("Key");};MQFeature.prototype.setKey=function(strKey){this.setProperty("Key",strKey);};MQFeature.prototype.setGEFID=function(intGEFID){this.setProperty("GEFID",intGEFID);};MQFeature.prototype.getGEFID=function(){return this.getProperty("GEFID");};MQFeature.prototype.setDT=function(intDT){this.setProperty("DT",intDT);};MQFeature.prototype.getDT=function(){return this.getProperty("DT");};MQPointFeature.prototype=new MQFeature();MQPointFeature.prototype.constructor=MQPointFeature;function MQPointFeature(){MQObject.call(this);this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPOINTFEATURE()));this.setM_Xpath("PointFeature");this.m_CenterLatLng=new MQLatLng("CenterLatLng");this.m_CenterPoint=new MQPoint("CenterPoint");}
MQPointFeature.prototype.getClassName=function(){return"MQPointFeature";};MQPointFeature.prototype.getObjectVersion=function(){return 0;};MQPointFeature.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlng=this.getCenterLatLng();var point=this.getCenterPoint();var lnode=mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng");var pnode=mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint");if(lnode!==null)
latlng.loadXmlFromNode(lnode);if(pnode!==null)
point.loadXmlFromNode(pnode);};MQPointFeature.prototype.loadXmlFromNode=function(node){this.setM_XmlDoc(mqCreateXMLDocImportNode(node));this.getCenterLatLng().setLatLng(this.getProperty("CenterLatLng/Lat"),this.getProperty("CenterLatLng/Lng"));var x=this.getProperty("CenterPoint/X");if(x!=="")
this.getCenterPoint().setXY(x,this.getProperty("CenterPoint/Y"));};MQPointFeature.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=mqCreateXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQPointFeature.prototype.getCenterLatLng=function(){return this.m_CenterLatLng;};MQPointFeature.prototype.setCenterLatLng=function(latLng){this.m_CenterLatLng.setLatLng(latLng.getLatitude(),latLng.getLongitude());};MQPointFeature.prototype.getCenterPoint=function(){return this.m_CenterPoint;};MQPointFeature.prototype.setCenterPoint=function(Point){this.m_CenterPoint.setXY(Point.getX(),Point.getY());};MQPolygonFeature.prototype=new MQPointFeature();MQPolygonFeature.prototype.constructor=MQPolygonFeature;function MQPolygonFeature(){MQPointFeature.call(this);this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPOLYGONFEATURE()));this.setM_Xpath("PolygonFeature");var m_LatLngs=new MQLatLngCollection();m_LatLngs.setM_Xpath("LatLngs");this.getLatLngs=function(){return m_LatLngs;};this.setLatLngs=function(latLngs){if(latLngs.getClassName()==="MQLatLngCollection"){m_LatLngs.removeAll();m_LatLngs.append(latLngs);}else{alert("failure in setLatLngs");throw"failure in setLatLngs";}};var m_Points=new MQPointCollection();m_Points.setM_Xpath("Points");this.getPoints=function(){return m_Points;};this.setPoints=function(pts){m_Points.removeAll();m_Points.append(pts);};}
MQPolygonFeature.prototype.getClassName=function(){return"MQPolygonFeature";};MQPolygonFeature.prototype.getObjectVersion=function(){return 0;};MQPolygonFeature.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlng=this.getCenterLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));var point=this.getCenterPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));var latlngs=this.getLatLngs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
latlngs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));var points=this.getPoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
points.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));};MQPolygonFeature.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=mqCreateXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));newNode=mqCreateXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=mqCreateXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));return mqXmlToStr(this.getM_XmlDoc());};MQLineFeature.prototype=new MQPolygonFeature();MQLineFeature.prototype.constructor=MQLineFeature;function MQLineFeature(){MQPolygonFeature.call(this);this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getLINEFEATURE()));this.setM_Xpath("LineFeature");}
MQLineFeature.prototype.getClassName=function(){return"MQLineFeature";};MQLineFeature.prototype.getObjectVersion=function(){return 0;};MQLineFeature.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlng=this.getCenterLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));var point=this.getCenterPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));var latlngs=this.getLatLngs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
latlngs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));var points=this.getPoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
points.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));};MQLineFeature.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=mqCreateXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));newNode=mqCreateXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=mqCreateXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));return mqXmlToStr(this.getM_XmlDoc());};MQLineFeature.prototype.getLeftPostalCode=function(){return this.getProperty("LeftPostalCode");};MQLineFeature.prototype.setLeftPostalCode=function(strVal){this.setProperty("LeftPostalCode",strVal);};MQLineFeature.prototype.getRightPostalCode=function(){return this.getProperty("RightPostalCode");};MQLineFeature.prototype.setRightPostalCode=function(strVal){this.setProperty("RightPostalCode",strVal);};MQLineFeature.prototype.getLeftAddressHi=function(){return this.getProperty("LeftAddressHi");};MQLineFeature.prototype.setLeftAddressHi=function(strVal){this.setProperty("LeftAddressHi",strVal);};MQLineFeature.prototype.getRightAddressHi=function(){return this.getProperty("RightAddressHi");};MQLineFeature.prototype.setRightAddressHi=function(strVal){this.setProperty("RightAddressHi",strVal);};MQLineFeature.prototype.getLeftAddressLo=function(){return this.getProperty("LeftAddressLo");};MQLineFeature.prototype.setLeftAddressLo=function(strVal){this.setProperty("LeftAddressLo",strVal);};MQLineFeature.prototype.getRightAddressLo=function(){return this.getProperty("RightAddressLo");};MQLineFeature.prototype.setRightAddressLo=function(strVal){this.setProperty("RightAddressLo",strVal);};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(mqCreateXMLDoc(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(mqCreateXMLDocFromNode(MQXML.getADDRESS()));}}
MQAddress.prototype.getClassName=function(){return"MQAddress";};MQAddress.prototype.getObjectVersion=function(){return 0;};MQAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(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(mqCreateXMLDocFromNode(MQXML.getSINGLELINEADDRESS()));}}
MQSingleLineAddress.prototype.getClassName=function(){return"MQSingleLineAddress";};MQSingleLineAddress.prototype.getObjectVersion=function(){return 0;};MQSingleLineAddress.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(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(mqCreateXMLDocFromNode(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(mqCreateXMLDoc(strXml));var lat=this.getProperty("LatLng/Lat");var lng=this.getProperty("LatLng/Lng");this.getMQLatLng().setLatLng(lat,lng);};MQGeoAddress.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(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(mqCreateXMLDocFromNode(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(mqCreateXMLDoc(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=mqCreateXMLDoc(this.getStreets().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Streets"));newNode=mqCreateXMLDoc(this.getShapePoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"ShapePoints"));newNode=mqCreateXMLDoc(this.getGEFIDs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"GEFIDs"));newNode=mqCreateXMLDoc(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(mqCreateXMLDocFromNode(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(mqCreateXMLDoc(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=mqCreateXMLDoc(this.getManeuvers().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Maneuvers"));return mqXmlToStr(this.getM_XmlDoc());};MQGeocodeOptions.prototype=new MQObject();MQGeocodeOptions.prototype.constructor=MQGeocodeOptions;function MQGeocodeOptions(){MQObject.call(this);this.setM_Xpath("GeocodeOptions");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getGEOCODEOPTIONS()));var m_MatchType=new MQMatchType(0);this.getMatchType=function(){return m_MatchType;};this.setMatchType=function(MatchType){m_MatchType=MatchType;};var m_QualityType=new MQQualityType(0);this.getQualityType=function(){return m_QualityType;};this.setQualityType=function(QualityType){m_QualityType=QualityType;};};MQGeocodeOptions.prototype.getClassName=function(){return"MQGeocodeOptions";};MQGeocodeOptions.prototype.getObjectVersion=function(){return 0;};MQGeocodeOptions.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));this.setMatchType(new MQMatchType(Math.floor(this.getProperty("MatchType"))));this.getQualityType(new MQQualityType(Math.floor(this.getProperty("QualityType"))));};MQGeocodeOptions.prototype.saveXml=function(){this.setProperty("MatchType",this.getMatchType().intValue());this.setProperty("QualityType",this.getQualityType().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQGeocodeOptions.prototype.setCoverageName=function(newCoverageName){this.setProperty("CoverageName",newCoverageName);};MQGeocodeOptions.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQGeocodeOptions.prototype.setMaxMatches=function(nMax){this.setProperty("MaxMatches",nMax);};MQGeocodeOptions.prototype.getMaxMatches=function(){return this.getProperty("MaxMatches");};MQRouteOptions.prototype=new MQObject();MQRouteOptions.prototype.constructor=MQRouteOptions;function MQRouteOptions(){MQObject.call(this);this.setM_Xpath("RouteOptions");this.setM_XmlDoc(mqCreateXMLDocFromNode(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(mqCreateXMLDoc(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=mqCreateXMLDoc(this.getAutoRouteCovSwitch().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CovSwitcher"));newNode=mqCreateXMLDoc(this.getAvoidAttrList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidAttributeList"));newNode=mqCreateXMLDoc(this.getAvoidGefIdList().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"AvoidGefIdList"));newNode=mqCreateXMLDoc(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(mqCreateXMLDocFromNode(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(mqCreateXMLDoc(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");};MQRouteMatrixResults.prototype=new MQObject();MQRouteMatrixResults.prototype.constructor=MQRouteMatrixResults;function MQRouteMatrixResults(){MQObject.call(this);this.setM_Xpath("RouteMatrixResults");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getROUTEMATRIXRESULTS()));var m_LocationCount=-1;var m_Distance=null;this.setDistance=function(col){if(col){if(col.getClassName()==="MQIntCollection"){if(m_Distance!==null){m_Distance.removeAll();m_Distance.append(col);}else{m_Distance=col;}}else{alert("failure in setDistance -- col is not MQIntCollection type");throw"failure in setDistance -- col is not MQIntCollection type";}}else{alert("failure in setDistance -- col is null");throw"failure in setDistance -- col is null";}};this.getDistance=function(from,to){if(m_LocationCount===-1){m_LocationCount=this.getProperty("LocationCount");}
var pos=((from*m_LocationCount)+to);return(m_Distance.get(pos)/1000.0).toFixed(6);};var m_Time=null;this.setTime=function(col){if(col){if(col.getClassName()==="MQIntCollection"){if(m_Time!==null){m_Time.removeAll();m_Time.append(col);}else{m_Time=col;}}else{alert("failure in setTime -- col is not MQIntCollection type");throw"failure in setTime -- col is not MQIntCollection type";}}else{alert("failure in setTime -- col is null");throw"failure in setTime -- col is null";}};this.getTime=function(from,to){if(m_LocationCount===-1){m_LocationCount=this.getProperty("LocationCount");}
var pos=((from*m_LocationCount)+to);return m_Time.get(pos);};var m_ResultCode=new MQRouteMatrixResultsCode(MQCONSTANT.MQROUTEMATRIXRESULTSCODE_NOT_SPECIFIED);this.getResultCode=function(){return m_ResultCode;};this.setResultCode=function(rc){if(rc){if(rc.getClassName()==="MQRouteMatrixResultsCode"){m_ResultCode=rc;}else{alert("failure in setResultsCode -- rc is not MQRouteMatrixResultsCode type");throw"failure in setResultsCode -- rc is not MQRouteMatrixResultsCode type";}}else{alert("failure in setResultsCode -- rc is null");throw"failure in setResultsCode -- rc is null";}};var m_ResultMessages=null;this.setResultMessages=function(col){if(col){if(col.getClassName()==="MQStringCollection"){if(m_ResultMessages!==null){m_ResultMessages.removeAll();m_ResultMessages.append(col);}else{m_ResultMessages=col;}}else{alert("failure in setResultMessages -- col is not MQStringCollection type");throw"failure in setResultMessages -- col is not MQStringCollection type";}}else{alert("failure in setResultMessages -- col is null");throw"failure in setResultMessages -- col is null";}};this.getResultsMessages=function(){return m_ResultMessages;};}
MQRouteMatrixResults.prototype.getClassName=function(){return"MQRouteMatrixResults";};MQRouteMatrixResults.prototype.getObjectVersion=function(){return 0;};MQRouteMatrixResults.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var dis=new MQIntCollection();dis.setM_Xpath("DistanceMatrix");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DistanceMatrix")!==null)
dis.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DistanceMatrix")));this.setDistance(dis);var tim=new MQIntCollection();tim.setM_Xpath("TimeMatrix");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TimeMatrix")!==null)
tim.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/TimeMatrix")));this.setTime(tim);var mes=new MQStringCollection();mes.setM_Xpath("ResultMessages");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")!==null)
mes.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/ResultMessages")));this.setResultMessages(mes);this.setResultCode(new MQRouteMatrixResultsCode(Math.floor(this.getProperty("ResultCode"))));};MQRouteMatrixResults.prototype.saveXml=function(){this.setProperty("ResultCode",this.getResultCode().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRouteMatrixResults.prototype.setCoverageName=function(newCoverageName){this.setProperty("CoverageName",newCoverageName);};MQRouteMatrixResults.prototype.getCoverageName=function(){return this.getProperty("CoverageName");};MQRouteMatrixResults.prototype.getAllToAllFlag=function(){return(this.getProperty("AllToAll")==1)?true:false;}
MQRecordSet.prototype=new MQObject();MQRecordSet.prototype.constructor=MQRecordSet;function MQRecordSet(){MQObject.call(this);this.setM_Xpath("RecordSet");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getRECORDSET()));var m_EOF=true;var m_BOF=true;var m_recCnt=0;var m_curRec=-1;var m_Fields=new MQStringCollection();m_Fields.setM_Xpath("Fields");var m_Records=new MQStrColCollection("Record");m_Records.setM_Xpath("Records");m_Records.setValidClassName("MQStringCollection");this.moveFirst=function(){if(m_Records.getSize()!==0){m_EOF=false;m_BOF=false;m_curRec=0;}else{alert(MQERROR.RECORDSET_MOVEFIRST_1);throw MQERROR.RECORDSET_MOVEFIRST_1;}};this.moveLast=function(){if(m_Records.getSize()!==0){m_EOF=false;m_BOF=false;m_curRec=m_Records.getSize()-1;}else{alert(MQERROR.RECORDSET_MOVELAST_1);throw MQERROR.RECORDSET_MOVELAST_1;}};this.moveNext=function(){var numRecs=m_Records.getSize();if(numRecs!==0){if(m_curRec<numRecs-1){m_curRec++;m_BOF=false;m_EOF=false;}else if(m_curRec===numRecs-1){m_curRec++;m_BOF=false;m_EOF=true;}else if(m_EOF){alert(MQERROR.RECORDSET_MOVENEXT_1);throw MQERROR.RECORDSET_MOVENEXT_1;}else{alert(MQERROR.RECORDSET_MOVENEXT_2);throw MQERROR.RECORDSET_MOVENEXT_2;}}else{alert(MQERROR.RECORDSET_MOVENEXT_3);throw MQERROR.RECORDSET_MOVENEXT_3;}};this.isBOF=function(){return m_BOF;};this.isEOF=function(){return m_EOF;};this.getFieldNames=function(){return m_Fields;};this.getField=function(strFieldName){if(!(0<=m_curRec&&m_curRec<m_recCnt)){alert(MQERROR.RECORDSET_GETFIELD_1);throw MQERROR.RECORDSET_GETFIELD_1;}
var pos=-1;for(var i=0;i<m_Fields.getSize();i++){if(m_Fields.get(i)===strFieldName){pos=i;break;}}
if(pos===-1){alert(MQERROR.RECORDSET_GETFIELD_2);throw MQERROR.RECORDSET_GETFIELD_2;}
return m_Records.get(m_curRec).get(pos);};this.loadXml=function(strXml){var xmlDoc=mqCreateXMLDoc(strXml);this.setM_XmlDoc(xmlDoc);m_Fields.loadXml(mqXmlToStr(mqGetNode(xmlDoc,"/"+this.getM_Xpath()+"/Fields")));if(xmlDoc!==null){var root=xmlDoc.documentElement;var nodes=root.childNodes;var maxCount=nodes.length;maxCount=(maxCount<32678)?maxCount:32678;var minCount=0;var col=null;m_Records.removeAll();for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="Record"){col=new MQStringCollection();col.setM_Xpath("Record");col.loadXml(mqXmlToStr(nodes[count]));m_Records.add(col);}}}
m_recCnt=this.getProperty("RecordCount");if(m_recCnt>0){m_curRec=0;m_BOF=false;m_EOF=false;}};};MQRecordSet.prototype.getClassName=function(){return"MQRecordSet";};MQRecordSet.prototype.getObjectVersion=function(){return 0;};MQRecordSet.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQMapState.prototype=new MQObject();MQMapState.prototype.constructor=MQMapState;function MQMapState(){MQObject.call(this);this.setM_Xpath("MapState");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getMAPSTATE()));var m_MQLatLng=new MQLatLng("Center");this.getCenter=function(){return m_MQLatLng;};this.setCenter=function(latLng){m_MQLatLng.setLatLng(latLng.getLatitude(),latLng.getLongitude());};}
MQMapState.prototype.getClassName=function(){return"MQMapState";};MQMapState.prototype.getObjectVersion=function(){return 0;};MQMapState.prototype.initObject=function(){this.setProperty("Scale",0);this.setCenter(new MQLatLng(0,0));this.setProperty("Width",-1.0);this.setProperty("Height",-1.0);this.setProperty("MapName","");this.setProperty("CoverageName","");}
MQMapState.prototype.equals=function(comparator){if(comparator){try{if(comparator.getClassName()==="MQMapState"){return m_nScale==other.m_nScale&&m_strMapName===other.m_strMapName&&m_strCoverageName===other.m_strCoverageName&&m_llCenter.equals(other.m_llCenter)&&m_dMapWidth===other.m_dMapWidth&&m_dMapHeight===other.m_dMapHeight;}}catch(error){}}
return false;};MQMapState.prototype.setMapName=function(strName){this.setProperty("MapName",strName);}
MQMapState.prototype.getMapName=function(){this.getProperty("MapName");}
MQMapState.prototype.setCoverageName=function(strCovId){this.setProperty("CoverageName",strCovId);}
MQMapState.prototype.getCoverageName=function(){this.getProperty("CoverageName");}
MQMapState.prototype.setWidthInches=function(dWidth){this.setProperty("Width",dWidth);}
MQMapState.prototype.getWidthInches=function(){return this.getProperty("Width");}
MQMapState.prototype.setHeightInches=function(dHeight){this.setProperty("Height",dHeight);}
MQMapState.prototype.getHeightInches=function(){return this.getProperty("Height");}
MQMapState.prototype.setWidthPixels=function(iWidth,dpi){if(dpi){this.setProperty("Width",parseFloat(iWidth)/parseFloat(dpi));}else{this.setProperty("Width",parseFloat(iWidth)/parseFloat(72));}}
MQMapState.prototype.getWidthPixels=function(dpi){if(dpi){return Math.ceil(this.getProperty("Width")*dpi);}else{return Math.ceil(this.getProperty("Width")*72);}}
MQMapState.prototype.setHeightPixels=function(iHeight,dpi){if(dpi){this.setProperty("Height",parseFloat(iHeight)/parseFloat(dpi));}else{this.setProperty("Height",parseFloat(iHeight)/parseFloat(72));}}
MQMapState.prototype.getHeightPixels=function(dpi){if(dpi){return Math.ceil(this.getProperty("Height")*dpi);}else{return Math.ceil(this.getProperty("Height")*72);}}
MQMapState.prototype.setMapScale=function(nNewScale){this.setProperty("Scale",nNewScale);}
MQMapState.prototype.getMapScale=function(){return this.getProperty("Scale");}
MQMapState.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var lat=this.getProperty("Center/Lat");var lng=this.getProperty("Center/Lng");this.getCenter().setLatLng(lat,lng);};MQMapState.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Center"));return mqXmlToStr(this.getM_XmlDoc());};MQSearchCriteria.prototype=new MQObject();MQSearchCriteria.prototype.constructor=MQSearchCriteria;function MQSearchCriteria(){MQObject.call(this);}
MQSearchCriteria.prototype.getClassName=function(){return"MQSearchCriteria";};MQSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQSearchCriteria.prototype.setMaxMatches=function(nMax){this.setProperty("MaxMatches",nMax);};MQSearchCriteria.prototype.getMaxMatches=function(){return this.getProperty("MaxMatches");};MQRadiusSearchCriteria.prototype=new MQSearchCriteria();MQRadiusSearchCriteria.prototype.constructor=MQRadiusSearchCriteria;function MQRadiusSearchCriteria(){MQObject.call(this);this.setM_Xpath("RadiusSearchCriteria");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getRADIUSSEARCHCRITERIA()));var m_MQLatLng=new MQLatLng("CenterLatLng");this.getCenter=function(){return m_MQLatLng;};this.setCenter=function(latLng){m_MQLatLng.setLatLng(latLng.getLatitude(),latLng.getLongitude());};}
MQRadiusSearchCriteria.prototype.getClassName=function(){return"MQRadiusSearchCriteria";};MQRadiusSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQRadiusSearchCriteria.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var lat=this.getProperty("CenterLatLng/Lat");var lng=this.getProperty("CenterLatLng/Lng");this.getCenter().setLatLng(lat,lng);};MQRadiusSearchCriteria.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQRadiusSearchCriteria.prototype.setRadius=function(radius,lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
radius=radius/MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;this.setProperty("Radius",radius);};MQRadiusSearchCriteria.prototype.getRadius=function(lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
var radius=this.getProperty("Radius");if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
radius=radius*MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;return radius;};MQRectSearchCriteria.prototype=new MQSearchCriteria();MQRectSearchCriteria.prototype.constructor=MQRectSearchCriteria;function MQRectSearchCriteria(mqRectLL){MQObject.call(this);this.setM_Xpath("RectSearchCriteria");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getRECTSEARCHCRITERIA()));var m_UpperLeft=new MQLatLng("UpperLeftLatLng");this.getUpperLeft=function(){return m_UpperLeft;};this.setUpperLeft=function(latLng){m_UpperLeft.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_LowerRight=new MQLatLng("LowerRightLatLng");this.getLowerRight=function(){return m_LowerRight;};this.setLowerRight=function(latLng){m_LowerRight.setLatLng(latLng.getLatitude(),latLng.getLongitude());};if(mqRectLL){m_UpperLeft.setLatLng(mqRectLL.getUpperLeft().getLat(),mqRectLL.getUpperLeft().getLng());m_LowerRight.setLatLng(mqRectLL.getLowerRight().getLat(),mqRectLL.getLowerRight().getLng());}}
MQRectSearchCriteria.prototype.getClassName=function(){return"MQRectSearchCriteria";};MQRectSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQRectSearchCriteria.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var lat=this.getProperty("UpperLeftLatLng/Lat");var lng=this.getProperty("UpperLeftLatLng/Lng");this.getUpperLeft().setLatLng(lat,lng);lat=this.getProperty("LowerRightLatLng/Lat");lng=this.getProperty("LowerRightLatLng/Lng");this.getLowerRight().setLatLng(lat,lng);};MQRectSearchCriteria.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getUpperLeft().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=mqCreateXMLDoc(this.getLowerRight().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightLatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQPolySearchCriteria.prototype=new MQSearchCriteria();MQPolySearchCriteria.prototype.constructor=MQPolySearchCriteria;function MQPolySearchCriteria(){MQObject.call(this);this.setM_Xpath("PolySearchCriteria");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPOLYSEARCHCRITERIA()));var m_LatLngs=new MQLatLngCollection();m_LatLngs.setM_Xpath("LatLngs");this.getShapePoints=function(){return m_LatLngs;};this.setShapePoints=function(latLngs){if(latLngs.getClassName()==="MQLatLngCollection"){m_LatLngs.removeAll();m_LatLngs.append(latLngs);}
else{alert("failure in setShapePoints");throw"failure in setShapePoints";}};}
MQPolySearchCriteria.prototype.getClassName=function(){return"MQPolySearchCriteria";};MQPolySearchCriteria.prototype.getObjectVersion=function(){return 0;};MQPolySearchCriteria.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlngs=this.getShapePoints();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
latlngs.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));};MQPolySearchCriteria.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getShapePoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));return mqXmlToStr(this.getM_XmlDoc());};MQCorridorSearchCriteria.prototype=new MQPolySearchCriteria();MQCorridorSearchCriteria.prototype.constructor=MQCorridorSearchCriteria;function MQCorridorSearchCriteria(){MQPolySearchCriteria.call(this);this.setM_Xpath("CorridorSearchCriteria");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getCORRIDORSEARCHCRITERIA()));}
MQCorridorSearchCriteria.prototype.getClassName=function(){return"MQCorridorSearchCriteria";};MQCorridorSearchCriteria.prototype.getObjectVersion=function(){return 0;};MQCorridorSearchCriteria.prototype.setCorrExactLinks=function(bExactLinks){this.setProperty("ExactLinks",(bExactLinks===true)?1:0);};MQCorridorSearchCriteria.prototype.getCorrExactLinks=function(){return(this.getProperty("ExactLinks")==1)?true:false;};MQCorridorSearchCriteria.prototype.setCorridorWidth=function(dCorrWidth,lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
dCorrWidth=dCorrWidth/MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;this.setProperty("CorridorWidth",dCorrWidth);};MQCorridorSearchCriteria.prototype.getCorridorWidth=function(lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
var width=this.getProperty("CorridorWidth");if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
width=width*MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;return width;};MQCorridorSearchCriteria.prototype.setCorridorBufferWidth=function(dBufferWidth,lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
dBufferWidth=dBufferWidth/MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;this.setProperty("CorridorBufferWidth",dBufferWidth);};MQCorridorSearchCriteria.prototype.getCorridorBufferWidth=function(lUnits){if(lUnits){mqIsClass("MQDistanceUnits",lUnits,false);}else{lUnits=new MQDistanceUnits(MQCONSTANT.MQDISTANCEUNITS_MILES);}
var width=this.getProperty("CorridorBufferWidth");if(lUnits.getValue()===MQCONSTANT.MQDISTANCEUNITS_KILOMETERS)
width=width*MQCONSTANT.DISTANCEAPPROX_KILOMETERS_PER_MILE;return width;};MQDBLayerQuery.prototype=new MQObject();MQDBLayerQuery.prototype.constructor=MQDBLayerQuery;function MQDBLayerQuery(){MQObject.call(this);this.setM_Xpath("DBLayerQuery");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getDBLAYERQUERY()));};MQDBLayerQuery.prototype.getClassName=function(){return"MQDBLayerQuery";};MQDBLayerQuery.prototype.getObjectVersion=function(){return 0;};MQDBLayerQuery.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));};MQDBLayerQuery.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQDBLayerQuery.prototype.setDBLayerName=function(strName){this.setProperty("LayerName",strName);};MQDBLayerQuery.prototype.getDBLayerName=function(){return this.getProperty("LayerName");};MQDBLayerQuery.prototype.setExtraCriteria=function(strQuery){this.setProperty("ExtraCriteria",strQuery);};MQDBLayerQuery.prototype.getExtraCriteria=function(){return this.getProperty("ExtraCriteria");};MQPrimitive.prototype=new MQObject();MQPrimitive.prototype.constructor=MQPrimitive;function MQPrimitive(){MQObject.call(this);var m_DrawTrigger=new MQDrawTrigger(MQCONSTANT.MQDRAWTRIGGER_AFTER_TEXT);this.getDrawTrigger=function(){return m_DrawTrigger;};this.setDrawTrigger=function(dt){if(dt){if(dt.getClassName()==="MQDrawTrigger"){m_DrawTrigger=dt;}}};var m_CoordinateType=new MQCoordinateType(MQCONSTANT.MQCOORDINATETYPE_GEOGRAPHIC);this.getCoordinateType=function(){return m_CoordinateType;};this.setCoordinateType=function(dt){if(dt){if(dt.getClassName()==="MQCoordinateType"){m_CoordinateType=dt;}}};};MQPrimitive.prototype.getClassName=function(){return"MQPrimitive";};MQPrimitive.prototype.getObjectVersion=function(){return 2;};MQPrimitive.prototype.setKey=function(strKey){this.setProperty("Key",strKey);};MQPrimitive.prototype.getKey=function(){return this.getProperty("Key");}
MQPrimitive.prototype.setOpacity=function(strOpacity){this.setProperty("Opacity",strOpacity);};MQPrimitive.prototype.getOpacity=function(){return this.getProperty("Opacity");}
MQLinePrimitive.prototype=new MQPrimitive();MQLinePrimitive.prototype.constructor=MQLinePrimitive;function MQLinePrimitive(){MQPrimitive.call(this);this.setM_Xpath("LinePrimitive");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getLINEPRIMITIVE()));var m_Color=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_BLACK);this.getColor=function(){return m_Color;};this.setColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_Color=obj;}}};var m_Style=new MQPenStyle(MQCONSTANT.MQPENSTYLE_SOLID);this.getStyle=function(){return m_Style;};this.setStyle=function(obj){if(obj){if(obj.getClassName()==="MQPenStyle"){m_Style=obj;}}};var m_XYArray=new MQPointCollection();m_XYArray.setM_Xpath("Points");this.getPoints=function(){return m_XYArray;};var m_LLArray=new MQLatLngCollection();m_LLArray.setM_Xpath("LatLngs");this.getLatLngs=function(){return m_LLArray;};this.setLatLngs=function(obj){if(obj){if(obj.getClassName()==="MQLatLngCollection"){m_LLArray.removeAll();m_LLArray.append(obj);}}};};MQLinePrimitive.prototype.getClassName=function(){return"MQLinePrimitive";};MQLinePrimitive.prototype.getObjectVersion=function(){return 0;};MQLinePrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var ll=new MQLatLngCollection();ll.setM_Xpath("LatLngs");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
ll.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));this.setLatLngs(ll);var pt=new MQPointCollection();pt.setM_Xpath("Points");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
pt.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));this.setPoints(ll);this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQPenStyle(Math.floor(this.getProperty("Style"))));};MQLinePrimitive.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=mqCreateXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQLinePrimitive.prototype.setWidth=function(width){this.setProperty("Width",width);};MQLinePrimitive.prototype.getWidth=function(){return this.getProperty("Width");}
MQPolygonPrimitive.prototype=new MQLinePrimitive();MQPolygonPrimitive.prototype.constructor=MQPolygonPrimitive;function MQPolygonPrimitive(){MQLinePrimitive.call(this);this.setM_Xpath("LinePrimitive");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPOLYGONPRIMITIVE()));var m_FillColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_RED);this.getFillColor=function(){return m_FillColor;};this.setFillColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FillColor=obj;}}};var m_FillStyle=new MQFillStyle(MQCONSTANT.MQFILLSTYLE_SOLID);this.getFillStyle=function(){return m_FillStyle;};this.setFillStyle=function(obj){if(obj){if(obj.getClassName()==="MQFillStyle"){m_FillStyle=obj;}}};};MQPolygonPrimitive.prototype.getClassName=function(){return"MQPolygonPrimitive";};MQPolygonPrimitive.prototype.getObjectVersion=function(){return 0;};MQPolygonPrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var ll=new MQLatLngCollection();ll.setM_Xpath("LatLngs");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
ll.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));this.setLatLngs(ll);var pt=new MQPointCollection();pt.setM_Xpath("Points");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")!==null)
pt.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/Points")));this.setPoints(ll);this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQPenStyle(Math.floor(this.getProperty("Style"))));this.setFillColor(new MQColorStyle(Math.floor(this.getProperty("FillColor"))));this.setFillStyle(new MQFillStyle(Math.floor(this.getProperty("FillStyle"))));};MQPolygonPrimitive.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));newNode=mqCreateXMLDoc(this.getPoints().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"Points"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());this.setProperty("FillColor",this.getFillColor().intValue());this.setProperty("FillStyle",this.getFillStyle().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRectanglePrimitive.prototype=new MQPrimitive();MQRectanglePrimitive.prototype.constructor=MQRectanglePrimitive;function MQRectanglePrimitive(){MQPrimitive.call(this);this.setM_Xpath("RectanglePrimitive");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getRECTANGLEPRIMITIVE()));var m_Color=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_BLACK);this.getColor=function(){return m_Color;};this.setColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_Color=obj;}}};var m_Style=new MQPenStyle(MQCONSTANT.MQPENSTYLE_SOLID);this.getStyle=function(){return m_Style;};this.setStyle=function(obj){if(obj){if(obj.getClassName()==="MQPenStyle"){m_Style=obj;}}};var m_FillColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_RED);this.getFillColor=function(){return m_FillColor;};this.setFillColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FillColor=obj;}}};var m_FillStyle=new MQFillStyle(MQCONSTANT.MQFILLSTYLE_SOLID);this.getFillStyle=function(){return m_FillStyle;};this.setFillStyle=function(obj){if(obj){if(obj.getClassName()==="MQFillStyle"){m_FillStyle=obj;}}};var m_UpperLeftLL=new MQLatLng("UpperLeftLatLng");this.getUpperLeftLatLng=function(){return m_UpperLeftLL;};this.setUpperLeftLatLng=function(latLng){m_UpperLeftLL.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_LowerRightLL=new MQLatLng("LowerRightLatLng");this.getLowerRightLatLng=function(){return m_LowerRightLL;};this.setLowerRightLatLng=function(latLng){m_LowerRightLL.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_UpperLeftPT=new MQPoint("UpperLeftPoint");this.getUpperLeftPoint=function(){return m_UpperLeftPT;};this.setUpperLeftPoint=function(point){m_UpperLeftPT.setXY(point.getX(),point.getY());};var m_LowerRightPT=new MQPoint("LowerRightPoint");this.getLowerRightPoint=function(){return m_LowerRightPT;};this.setLowerRightPoint=function(point){m_LowerRightPT.setXY(point.getX(),point.getY());};};MQRectanglePrimitive.prototype.getClassName=function(){return"MQRectanglePrimitive";};MQRectanglePrimitive.prototype.getObjectVersion=function(){return 0;};MQRectanglePrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlng=this.getUpperLeftLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")));latlng=this.getLowerRightLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")));var point=this.getUpperLeftPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")));point=this.getLowerRightPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")));this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQPenStyle(Math.floor(this.getProperty("Style"))));this.setFillColor(new MQColorStyle(Math.floor(this.getProperty("FillColor"))));this.setFillStyle(new MQFillStyle(Math.floor(this.getProperty("FillStyle"))));};MQRectanglePrimitive.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getUpperLeftLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=mqCreateXMLDoc(this.getLowerRightLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightLatLng"));newNode=mqCreateXMLDoc(this.getUpperLeftPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftPoint"));newNode=mqCreateXMLDoc(this.getLowerRightPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightPoint"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());this.setProperty("FillColor",this.getFillColor().intValue());this.setProperty("FillStyle",this.getFillStyle().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQRectanglePrimitive.prototype.setWidth=function(width){this.setProperty("Width",width);};MQRectanglePrimitive.prototype.getWidth=function(){return this.getProperty("Width");}
MQEllipsePrimitive.prototype=new MQRectanglePrimitive();MQEllipsePrimitive.prototype.constructor=MQEllipsePrimitive;function MQEllipsePrimitive(){MQRectanglePrimitive.call(this);this.setM_Xpath("EllipsePrimitive");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getELLIPSEPRIMITIVE()));}
MQEllipsePrimitive.prototype.getClassName=function(){return"MQEllipsePrimitive";};MQEllipsePrimitive.prototype.getObjectVersion=function(){return 0;};MQSymbolPrimitive.prototype=new MQPrimitive();MQSymbolPrimitive.prototype.constructor=MQSymbolPrimitive;function MQSymbolPrimitive(){MQPrimitive.call(this);this.setM_Xpath("SymbolPrimitive");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getSYMBOLPRIMITIVE()));var m_pt=new MQPoint("CenterPoint");this.getCenterPoint=function(){return m_pt;};this.setCenterPoint=function(point){m_pt.setXY(point.getX(),point.getY());};var m_ll=new MQLatLng("CenterLatLng");this.getCenterLatLng=function(){return m_ll;};this.setCenterLatLng=function(latLng){m_ll.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_SymbolType=new MQSymbolType(MQCONSTANT.MQSYMBOLTYPE_RASTER);this.getSymbolType=function(){return m_SymbolType;};this.setSymbolType=function(obj){if(obj){if(obj.getClassName()==="MQSymbolType"){m_SymbolType=obj;}}};}
MQSymbolPrimitive.prototype.getClassName=function(){return"MQSymbolPrimitive";};MQSymbolPrimitive.prototype.getObjectVersion=function(){return 0;};MQSymbolPrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlng=this.getCenterLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));var point=this.getCenterPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setSymbolType(new MQSymbolType(Math.floor(this.getProperty("SymbolType"))));};MQSymbolPrimitive.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenterLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));newNode=mqCreateXMLDoc(this.getCenterPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("SymbolType",this.getSymbolType().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQSymbolPrimitive.prototype.setSymbolName=function(symbolName){this.setProperty("SymbolName",symbolName);};MQSymbolPrimitive.prototype.getSymbolName=function(){return this.getProperty("SymbolName");}
MQTextPrimitive.prototype=new MQPrimitive();MQTextPrimitive.prototype.constructor=MQTextPrimitive;function MQTextPrimitive(){MQPrimitive.call(this);this.setM_Xpath("TextPrimitive");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getTEXTPRIMITIVE()));var m_pt=new MQPoint("UpperLeftPoint");this.getUpperLeftPoint=function(){return m_pt;};this.setUpperLeftPoint=function(point){m_pt.setXY(point.getX(),point.getY());};var m_ll=new MQLatLng("UpperLeftLatLng");this.getUpperLeftLatLng=function(){return m_ll;};this.setUpperLeftLatLng=function(latLng){m_ll.setLatLng(latLng.getLatitude(),latLng.getLongitude());};var m_color=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_BLACK);this.getColor=function(){return m_color;};this.setColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_color=obj;}}};var m_nStyle=new MQFontStyle(MQCONSTANT.MQFONTSTYLE_BOXED);this.getStyle=function(){return m_nStyle;};this.setStyle=function(obj){if(obj){if(obj.getClassName()==="MQFontStyle"){m_nStyle=obj;}}};var m_bgdColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_WHITE);this.getBkgdColor=function(){return m_bgdColor;};this.setBkgdColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_bgdColor=obj;}}};var m_lBoxOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getBoxOutlineColor=function(){return m_lBoxOutlineColor;};this.setBoxOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_lBoxOutlineColor=obj;}}};var m_lOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getOutlineColor=function(){return m_lOutlineColor;};this.setOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_lOutlineColor=obj;}}};}
MQTextPrimitive.prototype.getClassName=function(){return"MQTextPrimitive";};MQTextPrimitive.prototype.getObjectVersion=function(){return 0;};MQTextPrimitive.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var latlng=this.getUpperLeftLatLng();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")!==null)
latlng.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")));var point=this.getUpperLeftPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")!==null)
point.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")));this.setDrawTrigger(new MQDrawTrigger(Math.floor(this.getProperty("DrawTrigger"))));this.setCoordinateType(new MQCoordinateType(Math.floor(this.getProperty("CoordinateType"))));this.setColor(new MQColorStyle(Math.floor(this.getProperty("Color"))));this.setStyle(new MQFontStyle(Math.floor(this.getProperty("Style"))));this.setBkgdColor(new MQColorStyle(Math.floor(this.getProperty("BkgdColor"))));this.setBoxOutlineColor(new MQColorStyle(Math.floor(this.getProperty("BoxOutlineColor"))));this.setOutlineColor(new MQColorStyle(Math.floor(this.getProperty("OutlineColor"))));};MQTextPrimitive.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getUpperLeftLatLng().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=mqCreateXMLDoc(this.getUpperLeftPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftPoint"));this.setProperty("DrawTrigger",this.getDrawTrigger().intValue());this.setProperty("CoordinateType",this.getCoordinateType().intValue());this.setProperty("Color",this.getColor().intValue());this.setProperty("Style",this.getStyle().intValue());this.setProperty("BkgdColor",this.getBkgdColor().intValue());this.setProperty("BoxOutlineColor",this.getBoxOutlineColor().intValue());this.setProperty("OutlineColor",this.getOutlineColor().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQTextPrimitive.prototype.setText=function(str){this.setProperty("Text",str);};MQTextPrimitive.prototype.getText=function(){return this.getProperty("Text");}
MQTextPrimitive.prototype.setFontName=function(str){this.setProperty("FontName",str);};MQTextPrimitive.prototype.getFontName=function(){return this.getProperty("FontName");}
MQTextPrimitive.prototype.setWidth=function(val){this.setProperty("Width",val);};MQTextPrimitive.prototype.getWidth=function(){return this.getProperty("Width");}
MQTextPrimitive.prototype.setFontSize=function(val){this.setProperty("FontSize",val);};MQTextPrimitive.prototype.getFontSize=function(){return this.getProperty("FontSize");}
MQTextPrimitive.prototype.setMargin=function(val){this.setProperty("Margin",val);};MQTextPrimitive.prototype.getMargin=function(){return this.getProperty("Margin");}
MQTextPrimitive.prototype.setTextAlignment=function(val){this.setProperty("TextAlignment",val);};MQTextPrimitive.prototype.getTextAlignment=function(){return this.getProperty("TextAlignment");}
MQFeatureSpecifier.prototype=new MQObject();MQFeatureSpecifier.prototype.constructor=MQFeatureSpecifier;function MQFeatureSpecifier(){MQObject.call(this);this.setM_Xpath("FeatureSpecifier");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getFEATURESPECIFIER()));var m_Type=new MQFeatureSpeciferAttributeType(MQCONSTANT.MQFEATURESPECIFERATTRIBUTETYPE_GEFID);this.getAttributeType=function(){return m_Type;};this.setAttributeType=function(obj){if(obj){if(obj.getClassName()==="MQFeatureSpeciferAttributeType"){m_Type=obj;}}};};MQFeatureSpecifier.prototype.getClassName=function(){return"MQFeatureSpecifier";};MQFeatureSpecifier.prototype.getObjectVersion=function(){return 0;};MQFeatureSpecifier.prototype.setAttributeValue=function(val){this.setProperty("AttributeValue",val);};MQFeatureSpecifier.prototype.getAttributeValue=function(){return this.getProperty("AttributeValue");};MQBaseDTStyle.prototype=new MQObject();MQBaseDTStyle.prototype.constructor=MQBaseDTStyle;function MQBaseDTStyle(){MQObject.call(this);};MQBaseDTStyle.prototype.getClassName=function(){return"MQBaseDTStyle";};MQBaseDTStyle.prototype.getObjectVersion=function(){return 0;};MQBaseDTStyle.prototype.setDT=function(val){this.setProperty("DT",val);};MQBaseDTStyle.prototype.getDT=function(){return this.getProperty("DT");}
MQBaseDTStyle.prototype.setHighScale=function(val){this.setProperty("HighScale",val);};MQBaseDTStyle.prototype.getHighScale=function(){return this.getProperty("HighScale");}
MQBaseDTStyle.prototype.setLowScale=function(val){this.setProperty("LowScale",val);};MQBaseDTStyle.prototype.getLowScale=function(){return this.getProperty("LowScale");};MQBaseDTStyle.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.getDT()===type.getDT()&&this.getHighScale()===type.getHighScale()&&this.getLowScale()===type.getLowScale());}else{alert("Invalid type for this function!");throw"Invalid type for this function!";}}else{alert("An MQBaseDTStyle parameter must be provided for this function!");throw"An MQBaseDTStyle parameter must be provided for this function!";}};MQDTStyle.prototype=new MQBaseDTStyle();MQDTStyle.prototype.constructor=MQDTStyle;function MQDTStyle(){MQBaseDTStyle.call(this);this.setM_Xpath("DTStyle");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getDTSTYLE()));var m_FontColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontColor=function(){return m_FontColor;};this.setFontColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontColor=obj;}}};var m_FontOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontOutlineColor=function(){return m_FontOutlineColor;};this.setFontOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontOutlineColor=obj;}}};var m_FontBoxBkgdColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontBoxBkgdColor=function(){return m_FontBoxBkgdColor;};this.setFontBoxBkgdColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontBoxBkgdColor=obj;}}};var m_FontBoxOutlineColor=new MQColorStyle(MQCONSTANT.MQCOLORSTYLE_INVALID);this.getFontBoxOutlineColor=function(){return m_FontBoxOutlineColor;};this.setFontBoxOutlineColor=function(obj){if(obj){if(obj.getClassName()==="MQColorStyle"){m_FontBoxOutlineColor=obj;}}};var m_FontStyle=new MQFontStyle(MQCONSTANT.MQFONTSTYLE_INVALID);this.getFontStyle=function(){return m_FontStyle;};this.setFontStyle=function(obj){if(obj){if(obj.getClassName()==="MQFontStyle"){m_FontStyle=obj;}}};var m_SymbolType=new MQSymbolType(MQCONSTANT.MQSYMBOLTYPE_RASTER);this.getSymbolType=function(){return m_SymbolType;};this.setSymbolType=function(obj){if(obj){if(obj.getClassName()==="MQSymbolType"){m_SymbolType=obj;}}};};MQDTStyle.prototype.getClassName=function(){return"MQDTStyle";};MQDTStyle.prototype.getObjectVersion=function(){return 0;};MQDTStyle.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));this.setFontColor(new MQColorStyle(Math.floor(this.getProperty("FontColor"))));this.setFontOutlineColor(new MQColorStyle(Math.floor(this.getProperty("FontOutlineColor"))));this.setFontBoxBkgdColor(new MQColorStyle(Math.floor(this.getProperty("FontBoxBkgdColor"))));this.setFontBoxOutlineColor(new MQColorStyle(Math.floor(this.getProperty("FontBoxOutlineColor"))));this.setFontStyle(new MQFontStyle(Math.floor(this.getProperty("FeatureSpeciferAttributeType"))));this.setSymbolType(new MQSymbolType(Math.floor(this.getProperty("SymbolType"))));};MQDTStyle.prototype.saveXml=function(){this.setProperty("FontColor",this.getFontColor().intValue());this.setProperty("FontOutlineColor",this.getFontOutlineColor().intValue());this.setProperty("FontBoxBkgdColor",this.getFontBoxBkgdColor().intValue());this.setProperty("FontBoxOutlineColor",this.getFontBoxOutlineColor().intValue());this.setProperty("FontStyle",this.getFontStyle().intValue());this.setProperty("SymbolType",this.getSymbolType().intValue());return mqXmlToStr(this.getM_XmlDoc());};MQDTStyle.prototype.setSymbolName=function(val){this.setProperty("SymbolName",val);};MQDTStyle.prototype.getSymbolName=function(){return this.getProperty("SymbolName");};MQDTStyle.prototype.setFontName=function(val){this.setProperty("FontName",val);};MQDTStyle.prototype.getFontName=function(){return this.getProperty("FontName");};MQDTStyle.prototype.setVisible=function(bFlag){this.setProperty("Visible",(bFlag===true)?1:0);};MQDTStyle.prototype.getVisible=function(){return(this.getProperty("Visible")==1)?true:false;};MQDTStyle.prototype.setLabelVisible=function(bFlag){this.setProperty("LabelVisible",(bFlag===true)?1:0);};MQDTStyle.prototype.getLabelVisible=function(){return(this.getProperty("LabelVisible")==1)?true:false;};MQDTStyle.prototype.setFontSize=function(val){this.setProperty("FontSize",val);};MQDTStyle.prototype.getFontSize=function(){return this.getProperty("FontSize");}
MQDTStyle.prototype.setFontBoxMargin=function(val){this.setProperty("FontBoxMargin",val);};MQDTStyle.prototype.getFontBoxMargin=function(){return this.getProperty("FontBoxMargin");}
MQDTStyleEx.prototype=new MQBaseDTStyle();MQDTStyleEx.prototype.constructor=MQDTStyleEx;function MQDTStyleEx(){MQBaseDTStyle.call(this);this.setM_Xpath("DTStyleEx");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getDTSTYLEEX()));};MQDTStyleEx.prototype.getClassName=function(){return"MQDTStyleEx";};MQDTStyleEx.prototype.getObjectVersion=function(){return 0;};MQDTStyleEx.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));};MQDTStyleEx.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQDTStyleEx.prototype.setStyleString=function(val){this.setProperty("StyleString",val);};MQDTStyleEx.prototype.getStyleString=function(){return this.getProperty("StyleString");};MQDTFeatureStyleEx.prototype=new MQDTStyleEx();MQDTFeatureStyleEx.prototype.constructor=MQDTFeatureStyleEx;function MQDTFeatureStyleEx(){MQBaseDTStyle.call(this);this.setM_Xpath("DTStyleEx");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getDTFEATURESTYLEEX()));var m_Col=new MQFeatureSpecifierCollection("FeatureSpecifier");m_Col.setM_Xpath("FeatureSpecifierCollection");this.getFeatureSpecifiers=function(){return m_Col;};this.setFeatureSpecifiers=function(col){if(mqIsClass(m_Col.getClassName(),col,false)){m_Col.removeAll();m_Col.append(col);}};};MQDTFeatureStyleEx.prototype.getClassName=function(){return"MQDTFeatureStyleEx";};MQDTFeatureStyleEx.prototype.getObjectVersion=function(){return 0;};MQDTFeatureStyleEx.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));};MQDTFeatureStyleEx.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQMapCommand.prototype=new MQObject();MQMapCommand.prototype.constructor=MQMapCommand;function MQMapCommand(){MQObject.call(this);this.setM_Xpath("DTStyleEx");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getDTFEATURESTYLEEX()));var m_Col=new MQFeatureSpecifierCollection("FeatureSpecifier");m_Col.setM_Xpath("FeatureSpecifierCollection");this.getFeatureSpecifiers=function(){return m_Col;};this.setFeatureSpecifiers=function(col){if(col.getClassName()==="MQFeatureSpecifierCollection")
m_Col=col;else{alert("failure in setFeatureSpecifiers");throw"failure in setFeatureSpecifiers";}};}
MQMapCommand.prototype.getClassName=function(){return"MQMapCommand";};MQMapCommand.prototype.getObjectVersion=function(){return 0;};MQBestFit.prototype=new MQMapCommand();MQBestFit.prototype.constructor=MQBestFit;function MQBestFit(){MQMapCommand.call(this);this.setM_Xpath("BestFit");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getBESTFIT()));var m_DisplayTypes=new MQDTCollection();m_DisplayTypes.setM_Xpath("DisplayTypes");this.getDisplayTypes=function(){return m_DisplayTypes;};this.setDisplayTypes=function(col){m_DisplayTypes.removeAll();m_DisplayTypes.append(col);};}
MQBestFit.prototype.getClassName=function(){return"MQBestFit";};MQBestFit.prototype.getObjectVersion=function(){return 2;};MQBestFit.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getDisplayTypes();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DisplayTypes")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DisplayTypes")));};MQBestFit.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getDisplayTypes().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DisplayTypes"));return mqXmlToStr(this.getM_XmlDoc());};MQBestFit.prototype.setIncludePrimitives=function(bFlag){this.setProperty("IncludePrimitives",(bFlag===true)?1:0);};MQBestFit.prototype.getIncludePrimitives=function(){return(this.getProperty("IncludePrimitives")==1)?true:false;};MQBestFit.prototype.setKeepCenter=function(bFlag){this.setProperty("KeepCenter",(bFlag===true)?1:0);};MQBestFit.prototype.getKeepCenter=function(){return(this.getProperty("KeepCenter")==1)?true:false;};MQBestFit.prototype.setSnapToZoomLevel=function(bFlag){this.setProperty("SnapToZoomLevel",(bFlag===true)?1:0);};MQBestFit.prototype.getSnapToZoomLevel=function(){return(this.getProperty("SnapToZoomLevel")==1)?true:false;};MQBestFit.prototype.setScaleAdjustmentFactor=function(val){this.setProperty("ScaleAdjFactor",val);};MQBestFit.prototype.getScaleAdjustmentFactor=function(){return this.getProperty("ScaleAdjFactor");}
MQBestFitLL.prototype=new MQMapCommand();MQBestFitLL.prototype.constructor=MQBestFitLL;function MQBestFitLL(){MQMapCommand.call(this);this.setM_Xpath("BestFitLL");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getBESTFITLL()));var m_LatLng=new MQLatLngCollection();m_LatLng.setM_Xpath("LatLngs");this.getLatLngs=function(){return m_LatLng;};this.setLatLngs=function(col){m_LatLng.removeAll();m_LatLng.append(col);};}
MQBestFitLL.prototype.getClassName=function(){return"MQBestFitLL";};MQBestFitLL.prototype.getObjectVersion=function(){return 0;};MQBestFitLL.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getLatLngs();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LatLngs")));};MQBestFitLL.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getLatLngs().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LatLngs"));return mqXmlToStr(this.getM_XmlDoc());};MQBestFitLL.prototype.setKeepCenter=function(bFlag){this.setProperty("KeepCenter",(bFlag===true)?1:0);};MQBestFitLL.prototype.getKeepCenter=function(){return(this.getProperty("KeepCenter")==1)?true:false;};MQBestFitLL.prototype.setSnapToZoomLevel=function(bFlag){this.setProperty("SnapToZoomLevel",(bFlag===true)?1:0);};MQBestFitLL.prototype.getSnapToZoomLevel=function(){return(this.getProperty("SnapToZoomLevel")==1)?true:false;};MQBestFitLL.prototype.setScaleAdjustmentFactor=function(val){this.setProperty("ScaleAdjFactor",val);};MQBestFitLL.prototype.getScaleAdjustmentFactor=function(){return this.getProperty("ScaleAdjFactor");}
MQCenter.prototype=new MQMapCommand();MQCenter.prototype.constructor=MQCenter;function MQCenter(){MQMapCommand.call(this);this.setM_Xpath("Center");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getCENTER()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){if(mqIsClass(m_Center.getClassName(),pt,false)){m_Center=pt.internalCopy(m_Center);}};}
MQCenter.prototype.getClassName=function(){return"MQCenter";};MQCenter.prototype.getObjectVersion=function(){return 0;};MQCenter.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQCenter.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQCenterLatLng.prototype=new MQMapCommand();MQCenterLatLng.prototype.constructor=MQCenterLatLng;function MQCenterLatLng(){MQMapCommand.call(this);this.setM_Xpath("CenterLatLng");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getCENTERLATLNG()));var m_Center=new MQLatLng("CenterLatLng");this.getCenter=function(){return m_Center;};this.setCenter=function(ll){if(mqIsClass(m_Center.getClassName(),ll,false)){m_Center=ll.internalCopy(m_Center);}};}
MQCenterLatLng.prototype.getClassName=function(){return"MQCenterLatLng";};MQCenterLatLng.prototype.getObjectVersion=function(){return 0;};MQCenterLatLng.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterLatLng")));};MQCenterLatLng.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterLatLng"));return mqXmlToStr(this.getM_XmlDoc());};MQPan.prototype=new MQMapCommand();MQPan.prototype.constructor=MQPan;function MQPan(){MQMapCommand.call(this);this.setM_Xpath("Pan");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPAN()));var m_Point=new MQPoint("DeltaPoint");this.getPoint=function(){return m_Point;};this.setDeltaXY=function(dblX,dblY){m_Point.setXY(dblX,dblY);};this.setDeltaY=function(dblY){m_Point.setY(dblY);};this.setDeltaX=function(dblX){m_Point.setX(dblX);};}
MQPan.prototype.getClassName=function(){return"MQPan";};MQPan.prototype.getObjectVersion=function(){return 0;};MQPan.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getPoint();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DeltaPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/DeltaPoint")));};MQPan.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getPoint().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DeltaPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomIn.prototype=new MQMapCommand();MQZoomIn.prototype.constructor=MQZoomIn;function MQZoomIn(){MQMapCommand.call(this);this.setM_Xpath("ZoomIn");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getZOOMIN()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){m_Center=pt;};}
MQZoomIn.prototype.getClassName=function(){return"MQZoomIn";};MQZoomIn.prototype.getObjectVersion=function(){return 0;};MQZoomIn.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQZoomIn.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomOut.prototype=new MQMapCommand();MQZoomOut.prototype.constructor=MQZoomOut;function MQZoomOut(){MQMapCommand.call(this);this.setM_Xpath("ZoomOut");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getZOOMOUT()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){m_Center=pt;};}
MQZoomOut.prototype.getClassName=function(){return"MQZoomOut";};MQZoomOut.prototype.getObjectVersion=function(){return 0;};MQZoomOut.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQZoomOut.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomTo.prototype=new MQMapCommand();MQZoomTo.prototype.constructor=MQZoomTo;function MQZoomTo(){MQMapCommand.call(this);this.setM_Xpath("ZoomTo");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getZOOMTO()));var m_Center=new MQPoint("CenterPoint");this.getCenter=function(){return m_Center;};this.setCenter=function(pt){m_Center=pt;};}
MQZoomTo.prototype.getClassName=function(){return"MQZoomTo";};MQZoomTo.prototype.getObjectVersion=function(){return 0;};MQZoomTo.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var obj=this.getCenter();if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")!==null)
obj.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/CenterPoint")));};MQZoomTo.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getCenter().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"CenterPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomTo.prototype.getZoomLevel=function(){return this.getProperty("ZoomLevel");};MQZoomTo.prototype.setZoomLevel=function(val){this.setProperty("ZoomLevel",val);};MQZoomToRect.prototype=new MQMapCommand();MQZoomToRect.prototype.constructor=MQZoomToRect;function MQZoomToRect(){MQMapCommand.call(this);this.setM_Xpath("ZoomToRect");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getZOOMTORECT()));var m_UpperLeft=new MQPoint("UpperLeftPoint");var m_LowerRight=new MQPoint("LowerRightPoint");this.getRect=function(ulpt,lrpt){ulpt.loadXml(m_UpperLeft.copy().saveXml());lrpt.loadXml(m_LowerRight.copy().saveXml());};this.setRect=function(ulpt,lrpt){if(mqIsClass(m_UpperLeft.getClassName(),ulpt,false)&&mqIsClass(m_LowerRight.getClassName(),lrpt,false)){m_UpperLeft=ulpt.internalCopy(m_UpperLeft);m_LowerRight=lrpt.internalCopy(m_LowerRight);}};}
MQZoomToRect.prototype.getClassName=function(){return"MQZoomToRect";};MQZoomToRect.prototype.getObjectVersion=function(){return 0;};MQZoomToRect.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var ul=new MQPoint("UpperLeftPoint"),lr=new MQPoint("LowerRightPoint");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")!==null)
ul.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftPoint")));if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")!==null)
lr.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightPoint")));this.setRect(ul,lr);};MQZoomToRect.prototype.saveXml=function(){var ul=new MQPoint("UpperLeftPoint"),lr=new MQPoint("LowerRightPoint");this.getRect(ul,lr);var newNode=mqCreateXMLDoc(ul.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftPoint"));newNode=mqCreateXMLDoc(lr.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightPoint"));return mqXmlToStr(this.getM_XmlDoc());};MQZoomToRectLatLng.prototype=new MQMapCommand();MQZoomToRectLatLng.prototype.constructor=MQZoomToRectLatLng;function MQZoomToRectLatLng(){MQMapCommand.call(this);this.setM_Xpath("ZoomToRectLatLng");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getZOOMTORECTLATLNG()));var m_UpperLeft=new MQLatLng("UpperLeftLatLng");var m_LowerRight=new MQLatLng("LowerRightLatLng");this.getRect=function(ulll,lrll){ulll.loadXml(m_UpperLeft.copy().saveXml());lrll.loadXml(m_LowerRight.copy().saveXml());};this.setRect=function(ulll,lrll){if(mqIsClass(m_UpperLeft.getClassName(),ulll,false)&&mqIsClass(m_LowerRight.getClassName(),lrll,false)){m_UpperLeft=ulll.internalCopy(m_UpperLeft);m_LowerRight=lrll.internalCopy(m_LowerRight);}};}
MQZoomToRectLatLng.prototype.getClassName=function(){return"MQZoomToRectLatLng";};MQZoomToRectLatLng.prototype.getObjectVersion=function(){return 0;};MQZoomToRectLatLng.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));var ul=new MQLatLng("UpperLeftLatLng"),lr=new MQLatLng("LowerRightLatLng");if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")!==null)
ul.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/UpperLeftLatLng")));if(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")!==null)
lr.loadXml(mqXmlToStr(mqGetNode(this.getM_XmlDoc(),"/"+this.getM_Xpath()+"/LowerRightLatLng")));this.setRect(ul,lr);};MQZoomToRectLatLng.prototype.saveXml=function(){var ul=new MQLatLng("UpperLeftLatLng"),lr=new MQLatLng("LowerRightLatLng");this.getRect(ul,lr);var newNode=mqCreateXMLDoc(ul.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"UpperLeftLatLng"));newNode=mqCreateXMLDoc(lr.saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"LowerRightLatLng"));return mqXmlToStr(this.getM_XmlDoc());};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;};MQCoordinateType.prototype=new MQType();MQCoordinateType.prototype.constructor=MQCoordinateType;function MQCoordinateType(val){var value=-2;switch(val)
{case MQCONSTANT.MQCOORDINATETYPE_DISPLAY:value=val;break;case MQCONSTANT.MQCOORDINATETYPE_GEOGRAPHIC:value=val;break;default:alert(val+" is an invalid value for MQCoordinateType!");throw val+" invalid value for MQCoordinateType!";};this.intValue=function(){return value;};}
MQCoordinateType.prototype.getClassName=function(){return"MQCoordinateType";};MQCoordinateType.prototype.getObjectVersion=function(){return 0;};MQFeatureSpeciferAttributeType.prototype=new MQType();MQFeatureSpeciferAttributeType.prototype.constructor=MQFeatureSpeciferAttributeType;function MQFeatureSpeciferAttributeType(val){var value=-1;switch(val)
{case MQCONSTANT.MQFEATURESPECIFERATTRIBUTETYPE_GEFID:value=val;break;case MQCONSTANT.MQFEATURESPECIFERATTRIBUTETYPE_NAME:value=val;break;default:alert(val+" is an invalid value for MQFeatureSpeciferAttributeType!");throw val+" invalid value for MQFeatureSpeciferAttributeType!";};this.intValue=function(){return value;};}
MQFeatureSpeciferAttributeType.prototype.getClassName=function(){return"MQFeatureSpeciferAttributeType";};MQFeatureSpeciferAttributeType.prototype.getObjectVersion=function(){return 0;};MQSymbolType.prototype=new MQType();MQSymbolType.prototype.constructor=MQSymbolType;function MQSymbolType(val){var value=-1;switch(val)
{case MQCONSTANT.MQSYMBOLTYPE_RASTER:value=val;break;case MQCONSTANT.MQSYMBOLTYPE_VECTOR:value=val;break;default:alert(val+" is an invalid value for MQSymbolType!");throw val+" invalid value for MQSymbolType!";};this.intValue=function(){return value;};}
MQSymbolType.prototype.getClassName=function(){return"MQSymbolType";};MQSymbolType.prototype.getObjectVersion=function(){return 0;};MQMatchType.prototype=new MQType();MQMatchType.prototype.constructor=MQMatchType;function MQMatchType(val){var value=-1;switch(val)
{case MQCONSTANT.MQMATCHTYPE_LOC:value=val;break;case MQCONSTANT.MQMATCHTYPE_INTR:value=val;break;case MQCONSTANT.MQMATCHTYPE_NEARBLK:value=val;break;case MQCONSTANT.MQMATCHTYPE_REPBLK:value=val;break;case MQCONSTANT.MQMATCHTYPE_BLOCK:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA1:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA2:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA3:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA4:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA5:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA6:value=val;break;case MQCONSTANT.MQMATCHTYPE_AA7:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC1:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC2:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC3:value=val;break;case MQCONSTANT.MQMATCHTYPE_PC4:value=val;break;case MQCONSTANT.MQMATCHTYPE_POI:value=val;break;default:alert(val+" is an invalid value for MQMatchType!");throw val+" invalid value for MQMatchType!";};this.intValue=function(){return value;};}
MQMatchType.prototype.getClassName=function(){return"MQMatchType";};MQMatchType.prototype.getObjectVersion=function(){return 0;};MQQualityType.prototype=new MQType();MQQualityType.prototype.constructor=MQQualityType;function MQQualityType(val){var value=-1;switch(val)
{case MQCONSTANT.MQQUALITYTYPE_EXACT:value=val;break;case MQCONSTANT.MQQUALITYTYPE_GOOD:value=val;break;case MQCONSTANT.MQQUALITYTYPE_APPROX:value=val;break;default:alert(val+" is an invalid value for MQQualityType!");throw val+" invalid value for MQQualityType!";};this.intValue=function(){return value;};}
MQQualityType.prototype.getClassName=function(){return"MQQualityType";};MQQualityType.prototype.getObjectVersion=function(){return 0;};MQDrawTrigger.prototype=new MQType();MQDrawTrigger.prototype.constructor=MQDrawTrigger;function MQDrawTrigger(val){var value=-1;switch(val)
{case MQCONSTANT.MQDRAWTRIGGER_AFTER_POLYGONS:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_AFTER_ROUTE_HIGHLIGHT:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_AFTER_TEXT:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_BEFORE_POLYGONS:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_BEFORE_ROUTE_HIGHLIGHT:value=val;break;case MQCONSTANT.MQDRAWTRIGGER_BEFORE_TEXT:value=val;break;default:alert(val+" is an invalid value for MQDrawTrigger!");throw val+" invalid value for MQDrawTrigger!";};this.intValue=function(){return value;};}
MQDrawTrigger.prototype.getClassName=function(){return"MQDrawTrigger";};MQDrawTrigger.prototype.getObjectVersion=function(){return 0;};MQPenStyle.prototype=new MQType();MQPenStyle.prototype.constructor=MQPenStyle;function MQPenStyle(val){var value=-1;switch(val)
{case MQCONSTANT.MQPENSTYLE_DASH:value=val;break;case MQCONSTANT.MQPENSTYLE_DASH_DOT:value=val;break;case MQCONSTANT.MQPENSTYLE_DASH_DOT_DOT:value=val;break;case MQCONSTANT.MQPENSTYLE_SOLID:value=val;break;case MQCONSTANT.MQPENSTYLE_DOT:value=val;break;case MQCONSTANT.MQPENSTYLE_NONE:value=val;break;default:alert(val+" is an invalid value for MQPenStyle!");throw val+" invalid value for MQPenStyle!";};this.intValue=function(){return value;};}
MQPenStyle.prototype.getClassName=function(){return"MQPenStyle";};MQPenStyle.prototype.getObjectVersion=function(){return 0;};MQFontStyle.prototype=new MQType();MQFontStyle.prototype.constructor=MQFontStyle;function MQFontStyle(val){var value=-2;switch(val)
{case MQCONSTANT.MQFONTSTYLE_BOLD:value=val;break;case MQCONSTANT.MQFONTSTYLE_BOXED:value=val;break;case MQCONSTANT.MQFONTSTYLE_DOT:value=val;break;case MQCONSTANT.MQFONTSTYLE_ITALICS:value=val;break;case MQCONSTANT.MQFONTSTYLE_MAX_VALUE:value=val;break;case MQCONSTANT.MQFONTSTYLE_NORMAL:value=val;break;case MQCONSTANT.MQFONTSTYLE_OUTLINED:value=val;break;case MQCONSTANT.MQFONTSTYLE_SEMIBOLD:value=val;break;case MQCONSTANT.MQFONTSTYLE_STRIKEOUT:value=val;break;case MQCONSTANT.MQFONTSTYLE_THIN:value=val;break;case MQCONSTANT.MQFONTSTYLE_UNDERLINE:value=val;break;case MQCONSTANT.MQFONTSTYLE_INVALID:value=val;break;default:alert(val+" is an invalid value for MQFontStyle!");throw val+" invalid value for MQFontStyle!";};this.intValue=function(){return value;};}
MQFontStyle.prototype.getClassName=function(){return"MQFontStyle";};MQFontStyle.prototype.getObjectVersion=function(){return 0;};MQColorStyle.prototype=new MQType();MQColorStyle.prototype.constructor=MQColorStyle;function MQColorStyle(val){var value=MQCONSTANT.MQCOLORSTYLE_INVALID;if(val!==null){value=val;}
this.intValue=function(){return value;};}
MQColorStyle.prototype.getClassName=function(){return"MQColorStyle";};MQColorStyle.prototype.getObjectVersion=function(){return 0;};MQColorStyle.prototype.getRGB=function(){var rgb=-16777216;var a=parseInt(parseInt(this.intValue()/65536)%256);var b=parseInt(parseInt(parseInt(this.intValue()/256)%256)*256);var c=parseInt(parseInt(this.intValue()%256)*65536);return rgb+a+b+c;}
MQFillStyle.prototype=new MQType();MQFillStyle.prototype.constructor=MQFillStyle;function MQFillStyle(val){var value=-1;switch(val)
{case MQCONSTANT.MQFILLSTYLE_SOLID:value=val;break;case MQCONSTANT.MQFILLSTYLE_BDIAGONAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_CROSS:value=val;break;case MQCONSTANT.MQFILLSTYLE_DIAG_CROSS:value=val;break;case MQCONSTANT.MQFILLSTYLE_FDIAGONAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_HORIZONTAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_VERTICAL:value=val;break;case MQCONSTANT.MQFILLSTYLE_NONE:value=val;break;default:alert(val+" is an invalid value for MQFillStyle!");throw val+" invalid value for MQFillStyle!";};this.intValue=function(){return value;};}
MQFillStyle.prototype.getClassName=function(){return"MQFillStyle";};MQFillStyle.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;};MQRouteMatrixResultsCode.prototype=new MQType();MQRouteMatrixResultsCode.prototype.constructor=MQRouteMatrixResultsCode;function MQRouteMatrixResultsCode(val){var value=-2;switch(val)
{case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_NOT_SPECIFIED:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_SUCCESS:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_INVALID_LOCATION:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_ROUTE_FAILURE:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_NO_DATASET_FOUND:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_INVALID_OPTION:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_PARTIAL_SUCCESS:value=val;break;case MQCONSTANT.MQROUTEMATRIXRESULTSCODE_EXCEEDED_MAX_LOCATIONS:value=val;break;default:alert(val+" is an invalid value for MQRouteMatrixResultsCode!");throw val+" invalid value for MQRouteMatrixResultsCode!";};this.intValue=function(){return value;};}
MQRouteMatrixResultsCode.prototype.getClassName=function(){return"MQRouteMatrixResultsCode";};MQRouteMatrixResultsCode.prototype.getObjectVersion=function(){return 0;};MQLocationCollection.prototype=new MQObjectCollection(32678);MQLocationCollection.prototype.constructor=MQLocationCollection;function MQLocationCollection(){MQObjectCollection.call(this,32678);this.setM_XmlDoc(mqCreateXMLDocFromNode(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=mqCreateXMLDoc(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;};MQLocationCollectionCollection.prototype=new MQObjectCollection(32678);MQLocationCollectionCollection.prototype.constructor=MQLocationCollectionCollection;function MQLocationCollectionCollection(){MQObjectCollection.call(this,32678);this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getLOCATIONCOLLECTIONCOLLECTION()));this.setM_Xpath("LocationCollectionCollection");}
MQLocationCollectionCollection.prototype.getClassName=function(){return"MQLocationCollectionCollection";};MQLocationCollectionCollection.prototype.getObjectVersion=function(){return 0;};MQLocationCollectionCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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++){loc=new MQLocationCollection();loc.loadXml(mqXmlToStr(nodes[count]));this.add(loc);}}};MQLocationCollectionCollection.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;};MQLocationCollectionCollection.prototype.isValidObject=function(obj){if(obj){if(obj.getClassName()==="MQLocationCollection"){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(mqCreateXMLDocFromNode(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=mqCreateXMLDoc(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;};MQPointCollection.prototype=new MQObjectCollection(32678);MQPointCollection.prototype.constructor=MQPointCollection;function MQPointCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQPoint");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPOINTCOLLECTION()));this.setM_Xpath("PointCollection");}
MQPointCollection.prototype.getClassName=function(){return"MQPointCollection";};MQPointCollection.prototype.getObjectVersion=function(){return 0;};MQPointCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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 pnt=null;if(this.getValidClassName()==="MQPoint"){for(var count=minCount;count<maxCount;count++){var x;var y;if(nodes[count].firstChild!==null){x=nodes[count].firstChild.nodeValue;}
count++;if(nodes[count].firstChild!==null){y=nodes[count].firstChild.nodeValue;}
pnt=new MQPoint(x,y);this.add(pnt);}}}};MQPointCollection.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;};MQDBLayerQueryCollection.prototype=new MQObjectCollection(32678);MQDBLayerQueryCollection.prototype.constructor=MQDBLayerQueryCollection;function MQDBLayerQueryCollection(itemXpath){MQObjectCollection.call(this,32678);if(itemXpath){this.setM_itemXpath(itemXpath);}
this.setValidClassName("MQDBLayerQuery");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getSIGNCOLLECTION()));this.setM_Xpath("DBLayerQueryCollection");}
MQDBLayerQueryCollection.prototype.getClassName=function(){return"MQDBLayerQueryCollection";};MQDBLayerQueryCollection.prototype.getObjectVersion=function(){return 0;};MQDBLayerQueryCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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()==="MQDBLayerQuery"){for(var count=minCount;count<maxCount;count++){sign=new MQDBLayerQuery();sign.setM_Xpath(this.getM_itemXpath());sign.loadXml(mqXmlToStr(nodes[count]));this.add(sign);}}}};MQDBLayerQueryCollection.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(mqCreateXMLDocFromNode(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=mqCreateXMLDoc(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(mqCreateXMLDocFromNode(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=mqCreateXMLDoc(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(mqCreateXMLDocFromNode(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=mqCreateXMLDoc(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;};MQDTCollection.prototype=new MQIntCollection("Item");MQDTCollection.prototype.constructor=MQDTCollection;function MQDTCollection(itemXpath){MQIntCollection.call(this,itemXpath);this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getDTCOLLECTION()));this.setM_Xpath("DTCollection");};MQDTCollection.prototype.getClassName=function(){return"MQDTCollection";};MQDTCollection.prototype.getObjectVersion=function(){return 1;};MQFeatureCollection.prototype=new MQObjectCollection(32678);MQFeatureCollection.prototype.constructor=MQFeatureCollection;function MQFeatureCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("ALL");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getFEATURECOLLECTION()));this.setM_Xpath("FeatureCollection");}
MQFeatureCollection.prototype.getClassName=function(){return"MQFeatureCollection";};MQFeatureCollection.prototype.getObjectVersion=function(){return 0;};MQFeatureCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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 feat=null;var nodeName="";for(var count=minCount;count<maxCount;count++){nodeName=nodes[count].nodeName;if(nodeName==="LineFeature"){feat=new MQLineFeature();feat.loadXml(mqXmlToStr(nodes[count]));}else if(nodeName==="PointFeature"){feat=new MQPointFeature();feat.loadXmlFromNode(nodes[count]);}else if(nodeName==="PolygonFeature"){feat=new MQPolygonFeature();feat.loadXml(mqXmlToStr(nodes[count]));}
this.add(feat);}}};MQFeatureCollection.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<"+this.getM_Xpath()+" Version=\""+this.getObjectVersion()+"\" 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;};MQFeatureSpecifierCollection.prototype=new MQObjectCollection(32678);MQFeatureSpecifierCollection.prototype.constructor=MQFeatureSpecifierCollection;function MQFeatureSpecifierCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQFeatureSpecifier");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getFEATURESPECIFIERCOLLECTION()));this.setM_Xpath("FeatureCollection");}
MQFeatureSpecifierCollection.prototype.getClassName=function(){return"MQFeatureSpecifierCollection";};MQFeatureSpecifierCollection.prototype.getObjectVersion=function(){return 0;};MQFeatureSpecifierCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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 feat=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="FeatureSpecifier"){feat=new MQFeatureSpecifier();feat.loadXml(mqXmlToStr(nodes[count]));}
this.add(feat);}}};MQFeatureSpecifierCollection.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;};MQGeocodeOptionsCollection.prototype=new MQObjectCollection(32678);MQGeocodeOptionsCollection.prototype.constructor=MQGeocodeOptionsCollection;function MQGeocodeOptionsCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQGeocodeOptions");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getGEOCODEOPTIONSCOLLECTION()));this.setM_Xpath("GeocodeOptionsCollection");}
MQGeocodeOptionsCollection.prototype.getClassName=function(){return"MQGeocodeOptionsCollection";};MQGeocodeOptionsCollection.prototype.getObjectVersion=function(){return 0;};MQGeocodeOptionsCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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 geoO=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="GeocodeOptions"){geoO=new MQGeocodeOptions();geoO.loadXml(mqXmlToStr(nodes[count]));}
this.add(geoO);}}};MQGeocodeOptionsCollection.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;};MQCoverageStyle.prototype=new MQObjectCollection(32678);MQCoverageStyle.prototype.constructor=MQCoverageStyle;function MQCoverageStyle(){MQObjectCollection.call(this,32678);this.setValidClassName("ALL");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getCOVERAGESTYLE()));this.setM_Xpath("CoverageStyle");}
MQCoverageStyle.prototype.getClassName=function(){return"MQCoverageStyle";};MQCoverageStyle.prototype.getObjectVersion=function(){return 0;};MQCoverageStyle.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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 dt=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="DTStyle"){dt=new MQDTStyle();dt.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="DTStyleEx"){dt=new MQDTStyleEx();dt.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="DTFeatureStyleEx"){dt=new MQDTFeatureStyleEx();dt.loadXml(mqXmlToStr(nodes[count]));}
if(dt!==null){this.add(dt);}
dt=null;}}};MQCoverageStyle.prototype.saveXml=function(){var strRetArray=new Array();strRetArray[strRetArray.length]="<CoverageStyle Count=\""+this.getSize()+"\">";var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRetArray[strRetArray.length]="<Name>"+this.getProperty("Name")+"</Name>";strRetArray[strRetArray.length]="</CoverageStyle>";var strRet=strRetArray.join("");return strRet;};MQCoverageStyle.prototype.setName=function(strName){this.setProperty("Name",strName);};MQCoverageStyle.prototype.getName=function(){return this.getProperty("Name");};MQPrimitiveCollection.prototype=new MQObjectCollection(32678);MQPrimitiveCollection.prototype.constructor=MQPrimitiveCollection;function MQPrimitiveCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("ALL");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getPRIMITIVECOLLECTION()));this.setM_Xpath("PrimitiveCollection");}
MQPrimitiveCollection.prototype.getClassName=function(){return"MQPrimitiveCollection";};MQPrimitiveCollection.prototype.getObjectVersion=function(){return 0;};MQPrimitiveCollection.prototype.loadXml=function(strXml){this.removeAll();var xmlDoc=mqCreateXMLDoc(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 prim=null;for(var count=minCount;count<maxCount;count++){if(nodes[count].nodeName==="EllipsePrimitive"){prim=new MQEllipsePrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="LinePrimitive"){prim=new MQLinePrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="PolygonPrimitive"){prim=new MQPolygonPrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="RectanglePrimitive"){prim=new MQRectanglePrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="TextPrimitive"){prim=new MQTextPrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}else if(nodes[count].nodeName==="SymbolPrimitive"){prim=new MQSymbolPrimitive();prim.loadXml(mqXmlToStr(nodes[count]));}
this.add(prim);}}};MQPrimitiveCollection.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;};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(mqCreateXMLDocFromNode(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=mqCreateXMLDoc(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;};MQStrColCollection.prototype=new MQObjectCollection(32678);MQStrColCollection.prototype.constructor=MQStrColCollection;function MQStrColCollection(){MQObjectCollection.call(this,32678);this.setValidClassName("MQStringCollection");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getSTRCOLCOLLECTION()));}
MQStrColCollection.prototype.getClassName=function(){return"MQStrColCollection";};MQStrColCollection.prototype.getObjectVersion=function(){return 0;};MQStrColCollection.prototype.saveXml=function(){var strRetArray=new Array();var size=this.getSize();for(var i=0;i<size;i++){strRetArray[strRetArray.length]=this.get(i).saveXml();}
strRet=strRetArray.join("");return strRet;};MQAutoGeocodeCovSwitch.prototype=new MQObject();MQAutoGeocodeCovSwitch.prototype.constructor=MQAutoGeocodeCovSwitch;function MQAutoGeocodeCovSwitch(){MQObject.call(this);this.setM_Xpath("AutoGeocodeCovSwitch");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getAUTOGEOCODECOVSWITCH()));}
MQAutoGeocodeCovSwitch.prototype.getClassName=function(){return"MQAutoGeocodeCovSwitch";};MQAutoGeocodeCovSwitch.prototype.getObjectVersion=function(){return 0;};MQAutoGeocodeCovSwitch.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(strXml));};MQAutoGeocodeCovSwitch.prototype.saveXml=function(){return mqXmlToStr(this.getM_XmlDoc());};MQAutoGeocodeCovSwitch.prototype.setName=function(strName){this.setProperty("Name",strName);};MQAutoGeocodeCovSwitch.prototype.getName=function(){return this.getProperty("Name");};MQAutoGeocodeCovSwitch.prototype.setMaxMatches=function(lMaxMatches){this.setProperty("MaxMatches",lMaxMatches);};MQAutoGeocodeCovSwitch.prototype.getMaxMatches=function(){return this.getProperty("MaxMatches");};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(mqCreateXMLDoc("<"+strXpath+"><Name/><DataVendorCodeUsage>0</DataVendorCodeUsage><DataVendorCodes Count=\"0\"/></"+strXpath+">"));}else{this.setM_Xpath("AutoRouteCovSwitch");this.setM_XmlDoc(mqCreateXMLDocFromNode(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(mqCreateXMLDoc(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=mqCreateXMLDoc(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");};MQAutoMapCovSwitch.prototype=new MQAutoRouteCovSwitch();MQAutoMapCovSwitch.prototype.constructor=MQAutoMapCovSwitch;function MQAutoMapCovSwitch(strXpath){MQAutoRouteCovSwitch.call(this);if(strXpath){this.setM_Xpath(strXpath);this.setM_XmlDoc(mqCreateXMLDoc("<"+strXpath+"><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></"+strXpath+">"));}else{this.setM_Xpath("AutoMapCovSwitch");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getAUTOMAPCOVSWITCH()));}
var m_ZoomLevels=new MQIntCollection();m_ZoomLevels.setM_Xpath("ZoomLevels");m_ZoomLevels.add(6000);m_ZoomLevels.add(12000);m_ZoomLevels.add(24000);m_ZoomLevels.add(48000);m_ZoomLevels.add(96000);m_ZoomLevels.add(192000);m_ZoomLevels.add(400000);m_ZoomLevels.add(800000);m_ZoomLevels.add(1600000);m_ZoomLevels.add(3000000);m_ZoomLevels.add(6000000);m_ZoomLevels.add(12000000);m_ZoomLevels.add(24000000);m_ZoomLevels.add(48000000);this.getZoomLevels=function(){return m_ZoomLevels;};}
MQAutoMapCovSwitch.prototype.getClassName=function(){return"MQAutoMapCovSwitch";};MQAutoMapCovSwitch.prototype.getObjectVersion=function(){return 0;};MQAutoMapCovSwitch.prototype.loadXml=function(strXml){this.setM_XmlDoc(mqCreateXMLDoc(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")));};MQAutoMapCovSwitch.prototype.saveXml=function(){var newNode=mqCreateXMLDoc(this.getDataVendorCodes().saveXml());this.setM_XmlDoc(mqReplaceElementNode(this.getM_XmlDoc(),newNode,"DataVendorCodes"));return mqXmlToStr(this.getM_XmlDoc());};MQAutoMapCovSwitch.prototype.setStyle=function(strStyle){this.setProperty("Style",strStyle);};MQAutoMapCovSwitch.prototype.getStyle=function(){return this.getProperty("Style");};MQSession.prototype=new MQObjectCollection(32678);MQSession.prototype.constructor=MQSession;function MQSession(){MQObjectCollection.call(this,32678);this.setM_Xpath("Session");this.setM_XmlDoc(mqCreateXMLDocFromNode(MQXML.getSESSION()));}
MQSession.prototype.getClassName=function(){return"MQSession";};MQSession.prototype.getObjectVersion=function(){return 0;};MQSession.prototype.loadXml=function(strXml){var xmlDoc=mqCreateXMLDoc(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);if(mqBrowserInfo.isOpera)
{do
{strReqXml=strReqXml.replace('<?xml version="1.0"?>','');}
while(strReqXml.indexOf('<?xml version="1.0"?>')!=-1);}
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;};function validateResultCode(rCode){var granularity="",streetConfidence="",adminAreaConfidence="",postalCodeConfidence="";if(rCode.length<5)
return false;granularity=rCode.substring(0,2);streetConfidence=rCode.charAt(2);adminAreaConfidence=rCode.charAt(3);postalCodeConfidence=rCode.charAt(4);if(granularity.indexOf("L")>=0||granularity.indexOf("I")>=0||granularity.indexOf("B")>=0||granularity.indexOf("Z")>=0||granularity.indexOf("A5")>=0){if((adminAreaConfidence=="A"&&postalCodeConfidence=="A")||(adminAreaConfidence=="A"&&postalCodeConfidence=="X")){return true;}}
return false;}
function appendHiddenFields(frm,address,addParams){var input;input=createInputElement("hidden","hdnAddress",address.getStreet());frm.appendChild(input);input=createInputElement("hidden","hdnCity",address.getCity());frm.appendChild(input);input=createInputElement("hidden","hdnStateProvince",address.getState());frm.appendChild(input);input=createInputElement("hidden","hdnPostalcode",address.getPostalCode());frm.appendChild(input);if(address.getMQLatLng){input=createInputElement("hidden","hdnLatitude",address.getMQLatLng().getLatitude());frm.appendChild(input);input=createInputElement("hidden","hdnLongitude",address.getMQLatLng().getLongitude());frm.appendChild(input);}
if(addParams){for(var i=0;i<addParams.length;i++){input=createInputElement("hidden",addParams[i][0],addParams[i][1]);frm.appendChild(input);}}}
function addressToString(loc,node){var b;if(loc.getStreet()!=""){node.appendChild(document.createTextNode(loc.getStreet()));node.appendChild(document.createElement("br"));}
addSp=false;if(loc.getCity()!=""){node.appendChild(document.createTextNode(loc.getCity()));addSp=true;}
if(loc.getState()!=""){if(addSp)
node.appendChild(document.createTextNode(", "));node.appendChild(document.createTextNode(loc.getState()));addSp=true;}
if(loc.getPostalCode()!=""){if(addSp)
node.appendChild(document.createTextNode(" "));node.appendChild(document.createTextNode(loc.getPostalCode()));addSp=true;}
if(loc.getCounty()!=""){if(addSp)
node.appendChild(document.createElement("br"));node.appendChild(document.createTextNode("("+loc.getCounty()+")"));}}
function addressToStringHTML(loc){var b,html="";if(loc.getStreet()!=""){html+=loc.getStreet();html+="<br/>";}
var addSp=false;if(loc.getCity()!=""){html+=loc.getCity();addSp=true;}
if(loc.getState()!=""){if(addSp)
html+=", ";html+=loc.getState();addSp=true;}
if(loc.getPostalCode()!=""){if(addSp)
html+=" ";html+=loc.getPostalCode();addSp=true;}
if(loc.getCounty()!=""){if(addSp)
html+="<br/>";html+="("+loc.getCounty()+")";}
return html;}
function buildGeocodeResultTable(parentid,locationcollection,page,addParams){var tbl=document.createElement("table");tbl.className="ambgeocode";tbl.cellPadding=4;tbl.cellSpacing=0;tbl.border=0;var qs=new Querystring();var pageType='';if(null!=qs.get("ddwnSearchType"))
pageType=qs.get("ddwnSearchType");var tr,td,br,th,a,frm,href,ind,val;var loc;for(var i=0;i<locationcollection.getSize();i++){loc=locationcollection.getAt(i);tr=document.createElement("tr");br=document.createElement("br");td=document.createElement("td");td.className="ambgeocode";a=document.createElement("a");frm=document.createElement("form");frm.action=page;frm.id="frm"+i;frm.method="get";appendHiddenFields(frm,loc,addParams);td.appendChild(frm);if(page.indexOf("javascript:")<0){href="javascript:document.getElementById('"+frm.id+"').submit();"}
else{href=page;ind=href.lastIndexOf(")");if(href.charAt(ind-1)=="(")
val="'"+frm.id+"'";else
val=",'"+frm.id+"'";href=href.substring(0,ind)+val+href.substring(ind);}
a.href=href;addressToString(loc,a);td.appendChild(a);tr.appendChild(td);tbl.appendChild(tr);tbl.appendChild(br);}
var iFrameObj;switch(pageType)
{case"BRANCH":iFrameObj=parent.mapquestresultsbranch;break;case"FA":iFrameObj=parent.mapquestresultsfa;break;}
var parentDiv=document.getElementById(parentid);if(!browserCheck.ie){if(null==iFrameObj)
{parentDiv.appendChild(tbl);}
else
{iFrameObj.document.body.innerHTML=tbl.innerHTML;}}
else{if(!iFrameObj)
{var tmpDiv=document.createElement("div");tmpDiv.innerHTML=tbl.outerHTML;parentDiv.appendChild(tmpDiv);}
else
{iFrameObj.document.body.innerHTML=tbl.outerHTML;}}}
function buildGeocodeResultTableJS(parentid,locationcollection,fnct,additionalFields){var tbl=document.createElement("table");tbl.cellPadding=4;tbl.cellSpacing=0;tbl.border=0;var tr,td,th,a,frm;tr=document.createElement("tr");td=document.createElement("td");td.appendChild(document.createTextNode("Geocode Result"));td.className="ambgeocode";tr.appendChild(td);tbl.appendChild(tr);var loc,href;for(var i=0;i<locationcollection.getSize();i++){loc=locationcollection.getAt(i);tr=document.createElement("tr");td=document.createElement("td");td.className="ambgeocode";a=document.createElement("a");href="javascript:"+fnct+"("
href+="\""+loc.getStreet()+"\",";href+="\""+loc.getCity()+"\",";href+="\""+loc.getState()+"\",";href+="\""+loc.getPostalCode()+"\",";href+="\""+loc.getCounty()+"\",";href+="\""+loc.getCountry()+"\",";href+=loc.getMQLatLng().getLatitude()+",";href+=loc.getMQLatLng().getLongitude();if(additionalFields){if(additionalFields!=""){href+=",";href+=additionalFields;}}
href+=");";a.href=href;addressToString(loc,a);td.appendChild(a);tr.appendChild(td);tbl.appendChild(tr);}
var node=document.getElementById(parentid);removeAllChildren(node);node.appendChild(tbl);}
DataManagerRecord.prototype=new MQGeoAddress();DataManagerRecord.prototype.constructor=DataManagerRecord;function DataManagerRecord(recordset){MQGeoAddress.call(this);this.branchId="";this.id="";this.name="";this.phone="";this.distance=null;this.time=null;this.rDistance=null;this.fieldValues=new Array();this.setBranchId=function(b){this.branchId=b;};this.setId=function(i){this.id=i;};this.setName=function(n){this.name=n;};this.setDistance=function(d){this.distance=d;};this.setRouteTime=function(t){this.time=t;};this.setRouteDistance=function(rd){this.rDistance=rd;};this.setPhone=function(p){this.phone=p;};this.getBranchId=function(){return this.branchId;};this.getId=function(){return this.id;};this.getName=function(){return this.name;};this.getDistance=function(){return this.distance;};this.getRouteTime=function(){return this.time;};this.getRouteDistance=function(){return this.rDistance;};this.getPhone=function(){return this.phone;};var pDoc=parent.document;var mqfrm,searchType;var qs=new Querystring();this.getInfoTitleHTML=function(){var title="";if(this.getName()==""&&this.getStreet()=="")
title=this.getCityStatePostalCodeString();else if(this.getName()=="")
title=this.getStreet();else
title=this.getName();return StringFunctions.capitalize(title);}
this.getInfoTitleElement=function(){var htmlElement=document.createElement("div");htmlElement.appendChild(document.createTextNode(this.getInfoTitleHTML()));return htmlElement;}
this.getCityStatePostalCodeString=function(){var str="";var spacer=false;if(this.getCity()!=""){str+=StringFunctions.capitalize(this.getCity());spacer=true;}
if(this.getState()!=""){if(spacer){str+=", ";}
str+=this.getState();spacer=true;}
if(this.getPostalCode()!=""){if(spacer){str+=" ";}
str+=this.getPostalCode();spacer=true;}
return str;}
this.getInfoContentHTML=function(num,isPoiSearch){return this.getInfoContentElement(num,isPoiSearch).outerHTML;}
this.getInfoContentElement=function(num,isPoiSearch){var htmlElement=document.createElement("div");if(this.getName()!=""){htmlElement.appendChild(document.createTextNode(this.getStreet()));htmlElement.appendChild(document.createElement("br"));}
if(this.getStreet()!=""||this.getName()!=""){htmlElement.appendChild(document.createTextNode(this.getCityStatePostalCodeString()));}
if(this.getPhone()!=""){htmlElement.appendChild(document.createElement("br"));htmlElement.appendChild(document.createTextNode("Phone: "+this.getPhone()));}
if(this.getRouteTime()!=null){htmlElement.appendChild(document.createElement("br"));var distance=formatDistance(this.getRouteDistance());htmlElement.appendChild(document.createTextNode("Distance: "+distance+" Miles"));if(this.getRouteTime()>=3600)
var time=formatTime(this.getRouteTime(),"%h hr %m min %s sec");else
var time=formatTime(this.getRouteTime(),"%m min %s sec");htmlElement.appendChild(document.createElement("br"));htmlElement.appendChild(document.createTextNode("Time: "+time));}
else if(this.getDistance()!=null){htmlElement.appendChild(document.createElement("br"));htmlElement.appendChild(document.createTextNode("Distance: "+formatDistance(this.getDistance())+" Miles"));}
if(num>=0){htmlElement.appendChild(document.createElement("br"));if(!isPoiSearch){htmlElement.appendChild(document.createElement("br"));var a=document.createElement("a");a.href=MLGlobalVar_BranchPageUrl+this.getBranchId();a.onclick="javascript:return CheckSrcItemForOnclick();";a.target="_top";
if(parent.location.search.indexOf('fabrcriteria')>0)
{a.target="_blank";}
if(parent.location.search.toLowerCase().indexOf('branchlocator')!=-1 && parent.location.search.indexOf('fabrcriteria')!=-1)
{a.target = "_top";}
a.appendChild(document.createTextNode("Branch Details"));htmlElement.appendChild(a);}}
return htmlElement;}
this.getSingleLineHTML=function(){var str="";var spacer=false;if(this.getStreet()!=""){str+=StringFunctions.capitalize(this.getStreet());str+=" ";}
str+=this.getCityStatePostalCodeString();return str;}
this.getResultForm=function(i){var frm,input;frm=document.createElement("form");frm.method="get";frm.action="";frm.id="frm"+i;input=createInputElement("hidden","txtName",this.getName());frm.appendChild(input);input=createInputElement("hidden","txtAddress",this.getStreet());frm.appendChild(input);input=createInputElement("hidden","txtCity",this.getCity());frm.appendChild(input);input=createInputElement("hidden","selStateProvince",this.getState());frm.appendChild(input);input=createInputElement("hidden","txtPostalCode",this.getPostalCode());frm.appendChild(input);input=createInputElement("hidden","hdnLatitude",this.getMQLatLng().getLatitude());frm.appendChild(input);input=createInputElement("hidden","hdnLongitude",this.getMQLatLng().getLongitude());frm.appendChild(input);input=createInputElement("hidden","hdnType",type);frm.appendChild(input);input=createInputElement("hidden","rdoUnit",DEFAULT_UNIT);frm.appendChild(input);input=createInputElement("hidden","ddwnDistance",DEFAULT_RADIUS);frm.appendChild(input);return frm;}
this.getField=function(name){for(var i=0;i<this.fieldValues.length;i++){if(this.fieldValues[i][0]==name){return this.fieldValues[i][1];}}
return null;}
if(recordset){var fields=recordset.getFieldNames();var field;for(var i=0;i<fields.getSize();i++){field=fields.getAt(i);this.fieldValues.push(new Array(field.toUpperCase(),recordset.getField(field)));}
this.setBranchId(this.getField("RECORDID"));this.setId(this.getField("I"));this.setName(this.getField("N"));if(this.getField("PHONE")!=null)
this.setPhone(this.getField("PHONE"));this.setStreet(this.getField("ADDRESS"));this.setCity(this.getField("CITY"));this.setState(this.getField("STATE"));var postal=this.getField("ZIP");if(postal==null)
postal=this.getField("POSTAL");if(postal!=null)
this.setPostalCode(postal);var lat=this.getField("LAT");var lng=this.getField("LNG");this.setMQLatLng(new MQLatLng(lat,lng));}}
function formatDistance(dist){dist=parseFloat(dist);if(dist<.01&&dist>0)
return.01;else{var d=parseInt(parseFloat(dist)*100);return parseFloat(d)/100;}}
function formatTime(time,format){if(!format){format="%h:%m:%s";}
time=parseFloat(time);var h=parseInt(time/(60*60));time=parseFloat(time%(60*60));var m=parseInt(time/60);var s=parseFloat(time%60);if(format.indexOf("%h")>=0){format=format.replace("%h",h);}
if(format.indexOf("%m")>=0){format=format.replace("%m",m);}
if(format.indexOf("%s")>=0){format=format.replace("%s",s);}
return format;}
function getRouteDirections(routeResult,showCount,showText,showDistance,showTime,headers){var tbl,tr,td;tbl=document.createElement("table");tbl.className="routeresults"
tbl.cellSpacing=0;tbl.cellPadding=4;tbl.border=0;if(headers){tr=document.createElement("tr");var cnt=0;if(showCount||showText){td=document.createElement("td");td.className="hdrrouteresults"
td.appendChild(document.createTextNode(headers[cnt++]));tr.appendChild(td);}
if(showDistance){td=document.createElement("td");td.className="hdrrouteresults"
if(headers.length>cnt){td.appendChild(document.createTextNode(headers[cnt++]));}
else{td.appendChild(document.createTextNode(" "));}
tr.appendChild(td);}
if(showTime){td=document.createElement("td");td.className="hdrrouteresults"
if(headers.length>cnt){td.appendChild(document.createTextNode(headers[cnt++]));}
else{td.appendChild(document.createTextNode(" "));}
tr.appendChild(td);}
tbl.appendChild(tr);}
var trek,treks,maneuvers,maneuver,text;treks=routeResult.getTrekRoutes();for(var i=0;i<treks.getSize();i++){trek=treks.getAt(i);maneuvers=trek.getManeuvers();for(var j=0;j<maneuvers.getSize();j++){maneuver=maneuvers.getAt(j);tr=document.createElement("tr");tr.className="trrouteresults"+(j%2);if(showCount||showText){td=document.createElement("td");text="";if(showCount){text+=(j+1)+".";}
if(showCount&&showText){text+=" ";}
if(showText){text+=maneuver.getNarrative();}
td.appendChild(document.createTextNode(text));tr.appendChild(td);}
if(showDistance){td=document.createElement("td");td.appendChild(document.createTextNode(formatDistance(maneuver.getDistance())+" mi"));tr.appendChild(td);}
if(showTime){td=document.createElement("td");td.appendChild(document.createTextNode(formatTime(maneuver.getTime())));tr.appendChild(td);}
tbl.appendChild(tr);}}
return tbl;}
function mqAddressToSingleLineString(mqAddress){var element=mqAddressToSingleLineHTMLElement(mqAddress,document.createElement("div"));return element.innerHTML;}
function mqAddressToSingleLineHTMLElement(mqAddress,element){if(!element)
element=document.createElement("span");if(mqAddress.getName){if(mqAddress.getName()!=""){var b=document.createElement("b");b.appendChild(document.createTextNode(mqAddress.getName()));element.appendChild(b);element.appendChild(document.createTextNode(" "));}}
if(mqAddress.getStreet()!=""){element.appendChild(document.createTextNode(mqAddress.getStreet()));element.appendChild(document.createTextNode(" "));}
var spacer=false;if(mqAddress.getCity()){element.appendChild(document.createTextNode(mqAddress.getCity()));spacer=true;}
if(mqAddress.getState()){if(spacer){element.appendChild(document.createTextNode(", "));}
element.appendChild(document.createTextNode(mqAddress.getState()));spacer=true;}
if(mqAddress.getPostalCode()){if(spacer){element.appendChild(document.createTextNode(" "));}
element.appendChild(document.createTextNode(mqAddress.getPostalCode()));spacer=true;}
return element;}
function mqAddressToString(mqAddress){var element=mqAddressToHTMLElement(mqAddress,document.createElement("div"));return element.innerHTML;}
function mqAddressToHTMLElement(mqAddress,element){if(!element)
element=document.createElement("span");if(mqAddress.getName){if(mqAddress.getName()!=""){var b=document.createElement("b");b.appendChild(document.createTextNode(mqAddress.getName()));element.appendChild(b);element.appendChild(document.createElement("br"));}}
if(mqAddress.getStreet()!=""){element.appendChild(document.createTextNode(mqAddress.getStreet()));element.appendChild(document.createElement("br"));}
var spacer=false;if(mqAddress.getCity()){element.appendChild(document.createTextNode(mqAddress.getCity()));spacer=true;}
if(mqAddress.getState()){if(spacer){element.appendChild(document.createTextNode(", "));}
element.appendChild(document.createTextNode(mqAddress.getState()));spacer=true;}
if(mqAddress.getPostalCode()){if(spacer){element.appendChild(document.createTextNode(" "));}
element.appendChild(document.createTextNode(mqAddress.getPostalCode()));spacer=true;}
return element;}
function getContentString(recordset){var str="";str+=recordset.getField("Address")+"<br/>";str+=recordset.getField("City")+", ";str+=recordset.getField("State")+" ";str+=recordset.getField("ZIP");return str;}
function getContentStringSingleLine(recordset){var str="";str+=recordset.getField("Address")+" ";str+=recordset.getField("City")+", ";str+=recordset.getField("State")+" ";str+=recordset.getField("ZIP");return str;}
function getResultForm(recordset,i){var frm,input;frm=document.createElement("form");frm.method="get";frm.action="";frm.id="frm"+i;input=createInputElement("hidden","txtName",recordset.getField("N"));frm.appendChild(input);input=createInputElement("hidden","txtAddress",recordset.getField("Address"));frm.appendChild(input);input=createInputElement("hidden","txtCity",recordset.getField("City"));frm.appendChild(input);input=createInputElement("hidden","selStateProvince",recordset.getField("State"));frm.appendChild(input);input=createInputElement("hidden","txtPostalCode",recordset.getField("ZIP"));frm.appendChild(input);input=createInputElement("hidden","hdnLatitude",recordset.getField("Lat"));frm.appendChild(input);input=createInputElement("hidden","hdnLongitude",recordset.getField("Lng"));frm.appendChild(input);input=createInputElement("hidden","hdnType",type);frm.appendChild(input);input=createInputElement("hidden","rdoUnit",DEFAULT_UNIT);frm.appendChild(input);input=createInputElement("hidden","ddwnDistance",DEFAULT_RADIUS);frm.appendChild(input);return frm;}
function submitForm(id,action){var frm=document.getElementById(id);frm.action=action;frm.submit();}
function onPoiClick(e){var poiid=false;var poi=null;if(this.getKey){poiid=this.getKey();poi=map.getPoiByKey(poiid);if(poi!=null){poi.showInfoWindow();}}
else{var obj=getEventCurrentTarget(e);poiid=obj.id;poiid=poiid.substring(poiid.lastIndexOf("_")+1);poi=map.getPoiByKey(poiid);if(poi!=null){poi.showInfoWindow();}}}
function onPoiMouseover(e){var poiid=false;var poi=null;var infowindow=map.getInfoWindow();if(this.getKey){if(this!=infowindow.getOpener()){if(!infowindow.isHidden()){}}
poiid=this.getKey();var tr1=document.getElementById("tr1_"+poiid);var tr2=document.getElementById("tr2_"+poiid);if(tr1.className.indexOf("_over")==-1){tr1.className=tr1.className+"_over";}
if(tr2.className.indexOf("_over")==-1){tr2.className=tr2.className+"_over";}
if(!e.supressScroll){scrollToSearchResult(poiid);}}
else{if(!infowindow.isHidden()){}
var obj=getEventCurrentTarget(e);poiid=obj.id;poiid=poiid.substring(poiid.lastIndexOf("_")+1);poi=map.getPoiByKey(poiid);if(poi!=null){var event=new Object();event.type="mouseover";event.supressScroll=true;poi.onMouseOver(event);}}}
function onPoiMouseout(e){var poiid=false;var poi=null;if(this.getKey){poiid=this.getKey();var tr1=document.getElementById("tr1_"+poiid);var tr2=document.getElementById("tr2_"+poiid);var cn=tr1.className;if(cn.indexOf("_over")>-1){cn=cn.substring(0,cn.indexOf("_over"));tr1.className=cn;}
var cn=tr2.className;if(cn.indexOf("_over")>-1){cn=cn.substring(0,cn.indexOf("_over"));tr2.className=cn;}}
else{var obj=getEventCurrentTarget(e);poiid=obj.id;poiid=poiid.substring(poiid.lastIndexOf("_")+1);poi=map.getPoiByKey(poiid);if(poi!=null){var event=new Object();event.type="mouseout";poi.onMouseOut(event);}}}
function sortDataManagerResults(dm1,dm2){var d1=dm1.getDistance();var d2=dm2.getDistance();if(d1==null&&d2==null)
return 0;else if(d1==null){return 1;}
else if(d2==null){return-1;}
else{return parseFloat(d1)-parseFloat(d2);}}
function sortDataManagerResultsTime(dm1,dm2){var t1=dm1.getRouteTime();var t2=dm2.getRouteTime();if(t1==null&&t2==null)
return 0;else if(t1==null){return 1;}
else if(t2==null){return-1;}
else{return parseFloat(t1)-parseFloat(t2);}}
function getResultsAsArray(recordSet,featureCollection,time){var results=new Array();var dmRecord;while(!recordSet.isEOF()){dmRecord=new DataManagerRecord(recordSet);if(featureCollection){for(var i=0;i<featureCollection.getSize();i++){if(dmRecord.getId()==featureCollection.getAt(i).getKey()){if(featureCollection.getAt(i).getDistance()=='')
dmRecord.setDistance(0);else
dmRecord.setDistance(featureCollection.getAt(i).getDistance());break;}}}
results.push(dmRecord);recordSet.moveNext();}
if(featureCollection){results.sort(sortDataManagerResults);}
return results;}
var currentPage=0;var currentResults=new Array();function changePage(pageNum){currentPage=pageNum;showResults()}
function scrollToSearchResult(key){var div=document.getElementById("divResults");if(div){var cnt=0;for(var i=currentPage*PAGE_SIZE;i<currentResults.length&&i<=MAX_MATCHES&&i<(currentPage*PAGE_SIZE+PAGE_SIZE);i++){if(currentResults[i].getId()==key){break;}
cnt++;}
div.scrollTop=cnt*SCROLL_DISTANCE;}}
function CheckSrcItemForOnclick(e){var winEvent;onPoiClick(e);if(e)
winEvent=e.target.tagName;else
winEvent=window.event.srcElement.tagName;if(winEvent=="A")
{var pDoc=parent.document;var mqfrm,searchType;var qs=new Querystring();if(null!=qs.get("ddwnSearchType"))
{searchType=qs.get("ddwnSearchType");if(searchType=='FA')
{mqfrm=pDoc.getElementById('mapquestfa');mqfrm.contentWindow.ShowMsgDiv("<p class=\"error\"><img src=\"/publish/tm/images/progress.gif\" width=\"20px\" height=\"20px\" alt=\"Progress\">Loading page in progress...</p>");}
else
{mqfrm=pDoc.getElementById('mapquestbranch');if(parent.location.search.indexOf('fabrcriteria')==-1)
{mqfrm.contentWindow.ShowMsgDiv("<p class=\"error\"><img src=\"/publish/tm/images/progress.gif\" width=\"20px\" height=\"20px\" alt=\"Progress\">Loading Branch page in progress...</p>");}}}}}
function showResults(results,origLatLng,isPoiSearch){var icon,poi,latlng;var qs=new Querystring();var origGeoAddress=new MQGeoAddress();var orgTxtCity,orgTxtState,orgTxtZip,hndInput;var showErrMsg=false;
//Locator
	 var faType = qs.get("fatype");
	//Digvijoy
	//Remove this in the next build
	var getsearchType = qs.get("ddwnSearchType");
	/*Code for Dart BOA JS*/
	//var script = '';
	var objIframe = document.createElement('iframe');
	var frameSrc = 'http://fls.doubleclick.net/activityi;src=1359940;type=sdlpb511;cat=';
	var axel = Math.random()+"";
	var a = axel * 10000000000000;
	objIframe.width = "1";
	objIframe.height="1"
	objIframe.frameBorder="0";
	
    if (null != getsearchType)
    {
        if ( getsearchType == 'BRANCH' )
        {
            objIframe.src = frameSrc + 'mlfin137;ord=1;num='+ a + '?';
            //objIframe.src = fls.doubleclick.net/activityi;src=1359940;type=sdlpb511;cat=mlfin137;ord=1;num=\'+ a + \'?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>\');';
        }
        else if ( getsearchType == 'FA' )
        {
            objIframe.src = frameSrc + 'mlfin407;ord=1;num='+ a + '?';  
            //script = 'var axel = Math.random()+"";a = axel * 10000000000000;document.write(\'<IFRAME SRC="http://fls.doubleclick.net/activityi;src=1359940;type=sdlpb511;cat=mlfin407;ord=1;num=\'+ a + \'?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>\');';
        }
    }
   

	//objScript.createTextNode(script);
	document.body.appendChild(objIframe);
	 /*Code ends here Dart BOA JS*/
var dvResult=document.getElementById("divResults");dvResult.style.display="block";var pDoc=parent.document;var mqfrm;orgTxtCity=qs.get("txtCity");orgTxtState=qs.get("selStateProvince");orgTxtZip=qs.get("txtPostalCode");orgLatitude=qs.get("hdnLatitude");orgLongitude=qs.get("hdnLongitude");if(orgTxtCity)
origGeoAddress.setCity(orgTxtCity);if(orgTxtState)
origGeoAddress.setState(orgTxtState);if(orgTxtZip)
origGeoAddress.setPostalCode(orgTxtZip);if(orgLatitude&&orgLongitude)
origGeoAddress.setMQLatLng(new MQLatLng(orgLatitude,orgLongitude));if(results){currentResults=results;}
else{results=currentResults;}
var pois=map.getPois();for(var i=pois.getSize()-1;i>=0;i--){poi=pois.getAt(i);if(poi.getKey()!="origin"&&poi.getKey()!="start"&&poi.getKey()!="end"){map.removePoi(poi);}}
var tbl=document.createElement("table");tbl.cellPadding=4;tbl.cellSpacing=0;tbl.border=0;tbl.width=465;tbl.className="resultstable";var tr,td,th,img,a,b,distance,time,imgSrc,inPutHidden;var spacer;var rowItt=0;var cellItt=0;var rowNum=2;var searchType=qs.get("ddwnSearchType");if(null!=searchType)
{if(searchType=='FA')
mqfrm=pDoc.getElementById('mapquestfa');else
mqfrm=pDoc.getElementById('mapquestbranch');}
if(searchType=='FA')
{if(BranchFinderNameSearchResults.length==0)
{tr=tbl.insertRow(rowItt++);cellItt=0;td=tr.insertCell(cellItt++);td.className="noresult";td.colSpan=5;b=document.createElement("b");td.appendChild(b);mqfrm.contentWindow.ShowMsgDiv("<p class=\"error\">No Results Found.  Please refine your search criteria and try again.</p>")
showErrMsg=true;var _parent=document.getElementById("divResults");removeAllChildren(_parent);_parent.appendChild(tbl);var _parentContent=document.getElementById("divContent");removeAllChildren(_parentContent);if(!showErrMsg)
{mqfrm.contentWindow.ShowMsgDiv('');}
return;}}
if(results.length>=MAX_MATCHES)
{tr=tbl.insertRow(rowItt++);cellItt=0;td=tr.insertCell(cellItt++);td.className="noresult";td.colSpan=5;b=document.createElement("b");td.appendChild(b);mqfrm.contentWindow.ShowMsgDiv("<p class=\"error\">Your search has returned the maximum allowed results.  Please refine your search and try again.</p>");showErrMsg=true;}
var resultCount=0;if(results.length>0){for(var i=currentPage*PAGE_SIZE;i<results.length&&i<=MAX_MATCHES&&i<(currentPage*PAGE_SIZE+PAGE_SIZE);i++){var NameList=new Array();var finderResult=new Array();finderResult=BranchFinderNameSearchResults.split('%');if(finderResult.length>1)
{for(x=0;x<finderResult.length;x++)
{NameList=finderResult[x].split('|');if(results[i].getBranchId()==NameList[0])
{if(NameList[2].length==0)
continue;else
resultCount++;icon=new MQMapIcon();if(isPoiSearch){imgSrc=MLGlobalVar_GlobalImagePath+results[i].getField("T")+".gif";icon.setImage(imgSrc,20,20,true,false);}
else{imgSrc=MLGlobalVar_GlobalImagePath+(i+1)+".gif";icon.setImage(imgSrc,16,16,true,false);}
latlng=results[i].getMQLatLng();poi=new MQPoi(latlng,icon);poi.setInfoTitleHTML(results[i].getInfoTitleHTML());poi.setInfoContentElement(results[i].getInfoContentElement(i,isPoiSearch));poi.setRolloverEnabled(true);poi.setKey(results[i].getId());MQEventManager.addListener(poi,"mouseover",onPoiMouseover);MQEventManager.addListener(poi,"mouseout",onPoiMouseout);MQEventManager.addListener(poi,"click",onPoiClick);map.addPoi(poi);tr=tbl.insertRow(rowItt++);cellItt=0;tr.vAlign="top";tr.className="resultstablerow"+rowNum;tr.id="tr1_"+results[i].getId();frm=results[i].getResultForm(i);hndInput=createInputElement("hidden","branchCode",results[i].getBranchId());frm.appendChild(hndInput);hndInput=createInputElement("hidden","branchName",results[i].getName());frm.appendChild(hndInput);hndInput=createInputElement("hidden","hdnCity",origGeoAddress.getCity());frm.appendChild(hndInput);hndInput=createInputElement("hidden","hdnStateProvince",origGeoAddress.getState());frm.appendChild(hndInput);hndInput=createInputElement("hidden","hdnPostalCode",origGeoAddress.getPostalCode());frm.appendChild(hndInput);if(origGeoAddress.getMQLatLng()){hndInput=createInputElement("hidden","orgLatitude",origGeoAddress.getMQLatLng().getLatitude());frm.appendChild(hndInput);hndInput=createInputElement("hidden","orgLongitude",origGeoAddress.getMQLatLng().getLongitude());frm.appendChild(hndInput);}
tr.appendChild(frm);td=tr.insertCell(cellItt++);td.rowSpan=2;td.onclick=CheckSrcItemForOnclick;td.id="td1_"+results[i].getId();img=document.createElement("img");img.src=imgSrc
img.id="img_"+results[i].getId();td.appendChild(img);td=tr.insertCell(cellItt++);td.id="td2_"+results[i].getId();td.onclick=CheckSrcItemForOnclick;a=document.createElement("a");a.id="a9_"+results[i].getId();b=document.createElement("b");b.id="b9_"+results[i].getId();if(NameList[3]=='FA')
{if(NameList[2].length>0)
{a.href=MLGlobalVar_FAPageUrl+NameList[2]+"&locator=2C8C74AC-04AB-4D14-95D4-50E05906016C";a.target="_top";a.appendChild(document.createTextNode(NameList[1]));}
else
{a.href=MLGlobalVar_BranchPageUrl+results[i].getBranchId()+"&locator=2C8C74AC-04AB-4D14-95D4-50E05906016C";a.target="_top";a.appendChild(document.createTextNode(NameList[1]));}}
else if(NameList[3]=='BRANCH')
{a.href=MLGlobalVar_BranchPageUrl+results[i].getBranchId()+"&locator=2C8C74AC-04AB-4D14-95D4-50E05906016C";a.target="_top";a.appendChild(document.createTextNode(NameList[1]));}
b.appendChild(a);td.appendChild(b);td=tr.insertCell(cellItt++);td.id="td3_"+results[i].getId();td=tr.insertCell(cellItt++);td.id="tdx_"+results[i].getId();td=tr.insertCell(cellItt++);td.id="tdy_"+results[i].getId();td.appendChild(document.createTextNode(" "));tr=tbl.insertRow(rowItt++);cellItt=0;tr.id="tr2_"+results[i].getId();tr.className="resultstablerow"+rowNum;td=tr.insertCell(cellItt++);td.onclick=CheckSrcItemForOnclick;td.id="td6_"+results[i].getId();td.appendChild(document.createTextNode(results[i].getStreet()));td.appendChild(document.createElement("br"));td.appendChild(document.createTextNode(results[i].getCityStatePostalCodeString()));td.appendChild(document.createElement("br"));if(document.location.search.indexOf('FA')!=-1)
{var phoneNo=document.createTextNode(results[i].getPhone());phoneNo.data="Office Number: "+phoneNo.data;td.appendChild(phoneNo);}
else
{td.appendChild(document.createTextNode(results[i].getPhone()));}
td=tr.insertCell(cellItt++);td.id="td4_"+results[i].getId();if(isPoiSearch){td.onclick=CheckSrcItemForOnclick;td.appendChild(document.createTextNode(" "));}
else{}
td=tr.insertCell(cellItt++);td.id="td7_"+results[i].getId();if(results[i].getDistance()!=null||results[i].getRouteTime()!=null){td=tr.insertCell(cellItt++);td.onclick=CheckSrcItemForOnclick;td.rowSpan=1;td.id="td5_"+results[i].getId();spacer=false;if(orgLatitude!=CENTER_OF_THE_US_LATITUDE&&orgLongitude!=CENTER_OF_THE_US_LONGITUDE){if(results[i].getRouteTime()!=null){b=document.createElement("b");b.id="b1_"+results[i].getId();distance=formatDistance(results[i].getRouteDistance());b.appendChild(document.createTextNode(distance+" Miles"));td.appendChild(b);td.appendChild(document.createElement("br"));b=document.createElement("b");b.id="a2_"+results[i].getId();b.onmouseover=onPoiMouseover;b.onmouseout=onPoiMouseout;if(results[i].getRouteTime()>=3600)
time=formatTime(results[i].getRouteTime(),"%h hr %m min %s sec");else
time=formatTime(results[i].getRouteTime(),"%m min %s sec");b.appendChild(document.createTextNode(time));td.appendChild(b);spacer=true;}
else{b=document.createElement("b");b.id="a1_"+results[i].getId();distance=formatDistance(results[i].getDistance());b.appendChild(document.createTextNode(distance+" Miles"));td.appendChild(b);}}}
if(rowNum=='1')
rowNum='2';else
rowNum='1';}}}
else
{icon=new MQMapIcon();if(isPoiSearch){imgSrc=MLGlobalVar_GlobalImagePath+results[i].getField("T")+".gif";icon.setImage(imgSrc,20,20,true,false);}
else{imgSrc=MLGlobalVar_GlobalImagePath+(i+1)+".gif";icon.setImage(imgSrc,16,16,true,false);}
latlng=results[i].getMQLatLng();poi=new MQPoi(latlng,icon);poi.setInfoTitleHTML(results[i].getInfoTitleHTML());poi.setInfoContentElement(results[i].getInfoContentElement(i,isPoiSearch));poi.setRolloverEnabled(false);poi.setKey(results[i].getId());MQEventManager.addListener(poi,"mouseover",onPoiMouseover);MQEventManager.addListener(poi,"mouseout",onPoiMouseout);MQEventManager.addListener(poi,"click",onPoiClick);map.addPoi(poi);tr=tbl.insertRow(rowItt++);cellItt=0;tr.vAlign="top";tr.className="resultstablerow"+rowNum;tr.id="tr1_"+results[i].getId();frm=results[i].getResultForm(i);hndInput=createInputElement("hidden","branchCode",results[i].getBranchId());frm.appendChild(hndInput);hndInput=createInputElement("hidden","branchName",results[i].getName());frm.appendChild(hndInput);hndInput=createInputElement("hidden","hdnCity",origGeoAddress.getCity());frm.appendChild(hndInput);hndInput=createInputElement("hidden","hdnStateProvince",origGeoAddress.getState());frm.appendChild(hndInput);hndInput=createInputElement("hidden","hdnPostalCode",origGeoAddress.getPostalCode());frm.appendChild(hndInput);if(origGeoAddress.getMQLatLng()){hndInput=createInputElement("hidden","orgLatitude",origGeoAddress.getMQLatLng().getLatitude());frm.appendChild(hndInput);hndInput=createInputElement("hidden","orgLongitude",origGeoAddress.getMQLatLng().getLongitude());frm.appendChild(hndInput);}
tr.appendChild(frm);td=tr.insertCell(cellItt++);td.rowSpan=2;td.onclick=CheckSrcItemForOnclick;td.id="td1_"+results[i].getId();img=document.createElement("img");img.src=imgSrc
img.id="img_"+results[i].getId();td.appendChild(img);td=tr.insertCell(cellItt++);td.id="td2_"+results[i].getId();td.onclick=CheckSrcItemForOnclick;a=document.createElement("a");a.id="a9_"+results[i].getId();b=document.createElement("b");b.id="b9_"+results[i].getId();a.href=MLGlobalVar_BranchPageUrl+results[i].getBranchId()+"&locator=2C8C74AC-04AB-4D14-95D4-50E05906016C";a.target="_top";a.appendChild(document.createTextNode(results[i].getName()));if(parent.location.search.indexOf('fabrcriteria')>0)
{a.target="_blank";}
if(parent.location.search.toLowerCase().indexOf('branchlocator')!=-1 && parent.location.search.indexOf('fabrcriteria')!=-1)
{a.target = "_top";}
b.appendChild(a);td.appendChild(b);td=tr.insertCell(cellItt++);td.id="td3_"+results[i].getId();td=tr.insertCell(cellItt++);td.id="tdx_"+results[i].getId();td=tr.insertCell(cellItt++);td.id="tdy_"+results[i].getId();td.appendChild(document.createTextNode(" "));tr=tbl.insertRow(rowItt++);cellItt=0;tr.id="tr2_"+results[i].getId();tr.className="resultstablerow"+rowNum;td=tr.insertCell(cellItt++);td.onclick=CheckSrcItemForOnclick;td.id="td6_"+results[i].getId();td.appendChild(document.createTextNode(results[i].getStreet()));td.appendChild(document.createElement("br"));td.appendChild(document.createTextNode(results[i].getCityStatePostalCodeString()));td.appendChild(document.createElement("br"));td.appendChild(document.createTextNode(results[i].getPhone()));td=tr.insertCell(cellItt++);td.id="td4_"+results[i].getId();if(isPoiSearch){td.onclick=CheckSrcItemForOnclick;td.appendChild(document.createTextNode(" "));}
else{}
td=tr.insertCell(cellItt++);td.id="td7_"+results[i].getId();if(results[i].getDistance()!=null||results[i].getRouteTime()!=null){td=tr.insertCell(cellItt++);td.onclick=CheckSrcItemForOnclick;td.rowSpan=1;td.id="td5_"+results[i].getId();spacer=false;if(orgLatitude!=CENTER_OF_THE_US_LATITUDE&&orgLongitude!=CENTER_OF_THE_US_LONGITUDE){if(results[i].getRouteTime()!=null){b=document.createElement("b");b.id="b1_"+results[i].getId();distance=formatDistance(results[i].getRouteDistance());b.appendChild(document.createTextNode(distance+" Miles"));td.appendChild(b);td.appendChild(document.createElement("br"));b=document.createElement("b");b.id="a2_"+results[i].getId();if(results[i].getRouteTime()>=3600)
time=formatTime(results[i].getRouteTime(),"%h hr %m min %s sec");else
time=formatTime(results[i].getRouteTime(),"%m min %s sec");b.appendChild(document.createTextNode(time));td.appendChild(b);spacer=true;}
else{b=document.createElement("b");b.id="a1_"+results[i].getId();distance=formatDistance(results[i].getDistance());b.appendChild(document.createTextNode(distance+" Miles"));td.appendChild(b);}}}
if(rowNum=='1')
rowNum='2';else
rowNum='1';}}
if(results.length>PAGE_SIZE){var pages=Math.ceil(results.length/PAGE_SIZE);if(pages*PAGE_SIZE>MAX_MATCHES){pages=Math.ceil(MAX_MATCHES/PAGE_SIZE);}
tr=tbl.insertRow(rowItt++);cellItt=0;td=tr.insertCell(cellItt++);td.className="paged";td.colSpan=5;if(currentPage>0){a=document.createElement("a");a.href="javascript:changePage(0);"
a.appendChild(document.createTextNode("<<<"));td.appendChild(a);sp_blank=document.createTextNode(' ');td.appendChild(sp_blank);a=document.createElement("a");a.href="javascript:changePage("+(currentPage-1)+");"
a.appendChild(document.createTextNode("<"));td.appendChild(a);}
sp_blank=document.createTextNode(' ');td.appendChild(sp_blank);for(var i=0;i<pages;i++){if(currentPage==i){b=document.createElement("b");b.appendChild(document.createTextNode(i+1));td.appendChild(b);}
else{a=document.createElement("a");a.href="javascript:changePage("+i+");"
a.appendChild(document.createTextNode(i+1));td.appendChild(a);}
sp_blank=document.createTextNode(' ');td.appendChild(sp_blank);}
sp_blank=document.createTextNode(' ');td.appendChild(sp_blank);if(currentPage<pages-1){a=document.createElement("a");a.href="javascript:changePage("+(currentPage+1)+");"
a.appendChild(document.createTextNode(">"));td.appendChild(a);sp_blank=document.createTextNode(' ');td.appendChild(sp_blank);a=document.createElement("a");a.href="javascript:changePage("+(pages-1)+");"
a.appendChild(document.createTextNode(">>>"));td.appendChild(a);}}}
else{tr=tbl.insertRow(rowItt++);cellItt=0;td=tr.insertCell(cellItt++);td.className="noresult";td.colSpan=5;b=document.createElement("b");td.appendChild(b);mqfrm.contentWindow.ShowMsgDiv("<p class=\"error\">No Results Found.  Please refine your search criteria and try again.</p>")
showErrMsg=true;}
if(resultCount==0&&searchType=='FA')
{if(results.length>0)
{tr=tbl.insertRow(rowItt++);cellItt=0;td=tr.insertCell(cellItt++);td.className="noresult";td.colSpan=5;b=document.createElement("b");td.appendChild(b);mqfrm.contentWindow.ShowMsgDiv("<p class=\"error\">No Results Found.  Please refine your search criteria and try again.</p>")
showErrMsg=true;}}
var _parent=document.getElementById("divResults");removeAllChildren(_parent);_parent.appendChild(tbl);if(!showErrMsg)
{mqfrm.contentWindow.ShowMsgDiv('');}
if(results.length>0)
{if(resultCount==0&&searchType=='FA')
{var _parent=document.getElementById("divContent");removeAllChildren(_parent);}
else
{map.bestFit(false,1,11);}}
else
{var _parent=document.getElementById("divContent");removeAllChildren(_parent);}
if(mqBrowserInfo.isOpera)
{document.getElementById('divResults').innerHTML=document.getElementById('divResults').innerHTML;for(i=0;i<document.getElementById('divResults').getElementsByTagName('td').length;i++)
{document.getElementById('divResults').getElementsByTagName('td')[i].style.color="#666666";document.getElementById('divResults').getElementsByTagName('td')[i].style.fontSize="8.85pt";}
for(i=0;i<document.getElementById('divResults').getElementsByTagName('a').length;i++)
{document.getElementById('divResults').getElementsByTagName('a')[i].style.fontSize="8.85pt";}
for(i=0;i<document.getElementById('divResults').getElementsByTagName('b').length;i++)
{document.getElementById('divResults').getElementsByTagName('b')[i].style.color="#666666";document.getElementById('divResults').getElementsByTagName('b')[i].style.fontSize="8.85pt";}
document.getElementById('divResults').style.color="#666666";document.getElementById('divResults').style.backgroundColor="#F8F8F8";}}
function getRouteDistanceTime(originLatLng,dataManagerRecordArray,searchtime){if(dataManagerRecordArray.length>=0){var routeExec=new MQExec(routeServer,serverPath,serverPort,proxyServer,proxyPath,proxyPort);var origAddress=new MQGeoAddress();origAddress.setStreet("origin");origAddress.setMQLatLng(originLatLng);var destAddresses=new MQLocationCollection();destAddresses.add(origAddress);for(var i=0;i<dataManagerRecordArray.length;i++){destAddresses.add(dataManagerRecordArray[i]);}
var rOptions=new MQRouteOptions();var rmResults=new MQRouteMatrixResults();routeExec.doRouteMatrix(destAddresses,false,rOptions,rmResults);var newList=new Array()
var maxtime=parseInt(searchtime)*60;for(var i=0;i<dataManagerRecordArray.length;i++){if(maxtime>=parseInt(rmResults.getTime(0,i+1))){var obj=dataManagerRecordArray[i]
obj.setRouteTime(rmResults.getTime(0,i+1));obj.setRouteDistance(rmResults.getDistance(0,i+1));newList.push(obj);}}
newList.sort(sortDataManagerResultsTime);return newList;}
else{return dataManagerRecordArray;}}
MQPoi.prototype.onClick=function(e)
{if(Event.element(e).id=="poiclose")return;if(this.mqiw!=null&&this.mqiw.opener==this)return;this.showInfoWindow();MQEventManager.trigger(this,"click",e);e.poi=this;this.map.onClick(e);Event.stop(e);}
MQTileMap.prototype.removePoiByKey=function(key){var pois=this.getPois();for(var i=0;i<pois.getSize();i++){if(pois.getAt(i).getKey()==key){this.removePoi(pois.getAt(i));}}}
MQTileMap.prototype.getPoiByKey=function(key){var pois=this.getPois();for(var i=0;i<pois.getSize();i++){if(pois.getAt(i).getKey()==key){return pois.getAt(i);}}
return null;}
MQPoi.prototype.getInfoWindow=function(){return this.mqiw;};MQInfoWindow.prototype.getOpener=function(){return this.opener;};function geocode(addr,frm,multiResultsHTMLElementParentId,multiResultsSubmtPage){var locationcollection=new MQLocationCollection();var geoExec=new MQExec(geocodeServer,serverPath,serverPort,proxyServer,proxyPath,proxyPort);geoExec.geocode(addr,locationcollection,null);if(locationcollection.getSize()==0){document.getElementById("Message").innerHTML="<p class=\"error\">Address couldn't be geocoded!</p>";return false;}
else if(locationcollection.getSize()==1){var location=locationcollection.getAt(0);if(validateResultCode(location.getResultCode())){return location;}
else{document.getElementById("Message").innerHTML="<p class=\"error\">Address couldn't be geocoded!</p>";return false;}}
else{if(multiResultsHTMLElementParentId){buildGeocodeResultTable(multiResultsHTMLElementParentId,locationcollection,multiResultsSubmtPage,getAdditionalParameters(frm));}
return false;}}
function onFormSubmit(frmid,zipcode){var frm=document.getElementById(frmid);var addr,geoAddress,name,city,state,province,postalcode;switch(frm.hdnType.value){case"ByLocation":document.getElementById("Message").innerHTML="";addr=new MQAddress();addr.setCity(frm.txtCity.value);addr.setState(frm.selStateProvince.options[frm.selStateProvince.selectedIndex].value);if(zipcode)
addr.setPostalCode(zipcode);else
addr.setPostalCode(frm.txtPostalCode.value);addr.setCountry("US");if(!StringFunctions.isBlank(addr.getPostalCode()))
ga=geocode(addr,frm,"divFrmInput","/totalmerrill/system/searchlocation.aspx");else if(StringFunctions.isBlank(addr.getState())&&StringFunctions.isBlank(addr.getPostalCode()))
{if(frm.txtName.value.length>0)
{var ga=new MQGeoAddress();ga.setMQLatLng(new MQLatLng(CENTER_OF_THE_US_LATITUDE,CENTER_OF_THE_US_LONGITUDE));frm.ddwnDistance.selectedIndex=0;}
else
{if(document.getElementById("txtFirstName"))
document.getElementById("Message").innerHTML="<p class=\"error\">Please enter a last name with at least one character.</p>"
else
document.getElementById("Message").innerHTML="<p class=\"error\">State or Zip required.</p>"
return false;}}
else if(StringFunctions.isBlank(addr.getCity())&&!StringFunctions.isBlank(addr.getState())&&StringFunctions.isBlank(addr.getPostalCode()))
{var ga=new MQGeoAddress();ga.setMQLatLng(new MQLatLng(CENTER_OF_THE_US_LATITUDE,CENTER_OF_THE_US_LONGITUDE));frm.ddwnDistance.selectedIndex=0;}
else
ga=geocode(addr,frm,"divFrmInput","/totalmerrill/system/searchlocation.aspx");if(ga)
{document.getElementById("Message").innerHTML="<p class=\"error\"><img src=\"/publish/tm/images/progress.gif\" width=\"20px\" height=\"20px\" alt=\"Progress\">Search in progress...</p>"
DoSearch(ga);return false;}
break;case"ByPOIName":name=frm.txtPOIName.value;if(StringFunctions.isBlank(name)){alert("Please enter a Point of Interest (Name)!");return false;}
else{frm.submit();return true;}
case"ByPOICategory":city=frm.txtCity.value;state=frm.selStateProvince.options[frm.selStateProvince.selectedIndex].value;postalcode=frm.txtPostalCode.value;if(frm.selCategory.selectedIndex==0){alert("Please Select a POI Category!");return false;}
else{addr=new MQAddress();addr.setCity(city);addr.setState(state);addr.setPostalCode(postalcode);addr.setCountry("US");if((StringFunctions.isBlank(addr.getCity())||StringFunctions.isBlank(addr.getState()))&&StringFunctions.isBlank(addr.getPostalCode())){alert("City & State or Zip required!")
return false;}
ga=geocode(addr,frm,"divFrmInput","/totalmerrill/system/searchlocation.aspx");break;}
case"ByRoute":var city=frm.txtOriginCity.value;var state=frm.selOriginStateProvince.options[frm.selOriginStateProvince.selectedIndex].value;var postalcode=frm.txtOriginPostalCode.value;if((StringFunctions.isBlank(city)||StringFunctions.isBlank(state))&&StringFunctions.isBlank(postalcode)){alert("Origin City & State or Zip required!")
return false;}
var city=frm.txtDestCity.value;var state=frm.selDestStateProvince.options[frm.selDestStateProvince.selectedIndex].value;var postalcode=frm.txtDestPostalCode.value;if((StringFunctions.isBlank(city)||StringFunctions.isBlank(state))&&StringFunctions.isBlank(postalcode)){alert("Destination City & State or Zip required!")
return false;}
frm.submit();return true;default:alert("Undefined Action");return false;}
if(ga){processMap(frm,ga);return true;}
else{return false;}}
function getAdditionalParameters(frm){var params=new Array();switch(frm.hdnType.value){case"ByLocation":var qs=new Querystring();var searchType='';if(null!=qs.get("ddwnSearchType"))
searchType=qs.get("ddwnSearchType");params.push(new Array("txtCity",frm.txtCity.value));params.push(new Array("selStateProvince",frm.selStateProvince.options[frm.selStateProvince.selectedIndex].value));params.push(new Array("txtPostalCode",frm.txtPostalCode.value));params.push(new Array("ddwnSearchType",searchType));params.push(new Array("txtName",frm.txtName.value));params.push(new Array("ddwnDistance",frm.ddwnDistance.options[frm.ddwnDistance.selectedIndex].value));if(document.getElementById("rdoUnitMi").checked){params.push(new Array("rdoUnit","mi"));}
else{params.push(new Array("rdoUnit","min"));}
params.push(new Array("hdnType","ByLocation"));break;case"ByPOICategory":params.push(new Array("selCategory",frm.selCategory.options[frm.selCategory.selectedIndex].value));params.push(new Array("hdnType","ByPOICategory"));break;}
return params;}
function processMap(frm,ga){switch(frm.hdnType.value){case"ByLocation":case"ByPOICategory":frm.hdnLatitude.value=ga.getMQLatLng().getLatitude();frm.hdnLongitude.value=ga.getMQLatLng().getLongitude();frm.submit();break;}}