if(dwr==null){
var dwr={};
}
if(dwr.engine==null){
dwr.engine={};
}
if(DWREngine==null){
var DWREngine=dwr.engine;
}
if(AdServiceProxy==null){
var AdServiceProxy={};
}
AdServiceProxy._path="/dwr";
AdServiceProxy.makeAdCall=function(p0,_2){
dwr.engine._execute(AdServiceProxy._path,"AdServiceProxy","makeAdCall",p0,false,_2);
};

if(dwr==null){
var dwr={};
}
if(dwr.engine==null){
dwr.engine={};
}
if(DWREngine==null){
var DWREngine=dwr.engine;
}
dwr.engine.setErrorHandler=function(_1){
dwr.engine._errorHandler=_1;
};
dwr.engine.setWarningHandler=function(_2){
dwr.engine._warningHandler=_2;
};
dwr.engine.setTextHtmlHandler=function(_3){
dwr.engine._textHtmlHandler=_3;
};
dwr.engine.setTimeout=function(_4){
dwr.engine._timeout=_4;
};
dwr.engine.setPreHook=function(_5){
dwr.engine._preHook=_5;
};
dwr.engine.setPostHook=function(_6){
dwr.engine._postHook=_6;
};
dwr.engine.setHeaders=function(_7){
dwr.engine._headers=_7;
};
dwr.engine.setParameters=function(_8){
dwr.engine._parameters=_8;
};
dwr.engine.XMLHttpRequest=1;
dwr.engine.IFrame=2;
dwr.engine.ScriptTag=3;
dwr.engine.setRpcType=function(_9){
if(_9!=dwr.engine.XMLHttpRequest&&_9!=dwr.engine.IFrame&&_9!=dwr.engine.ScriptTag){
dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});
return;
}
dwr.engine._rpcType=_9;
};
dwr.engine.setHttpMethod=function(_a){
if(_a!="GET"&&_a!="POST"){
dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});
return;
}
dwr.engine._httpMethod=_a;
};
dwr.engine.setOrdered=function(_b){
dwr.engine._ordered=_b;
};
dwr.engine.setAsync=function(_c){
dwr.engine._async=_c;
};
dwr.engine.setActiveReverseAjax=function(_d){
if(_d){
if(dwr.engine._activeReverseAjax){
return;
}
dwr.engine._activeReverseAjax=true;
dwr.engine._poll();
}else{
if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq){
dwr.engine._pollReq.abort();
}
dwr.engine._activeReverseAjax=false;
}
};
dwr.engine.setPollType=function(_e){
if(_e!=dwr.engine.XMLHttpRequest&&_e!=dwr.engine.IFrame){
dwr.engine._handleError(null,{name:"dwr.engine.invalidPollType",message:"PollType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame"});
return;
}
dwr.engine._pollType=_e;
};
dwr.engine.defaultErrorHandler=function(_f,ex){
dwr.engine._debug("Error: "+ex.name+", "+ex.message,true);
if(_f==null||_f==""){
alert("A server error has occured. More information may be available in the console.");
}else{
if(_f.indexOf("0x80040111")!=-1){
dwr.engine._debug(_f);
}else{
alert(_f);
}
}
};
dwr.engine.defaultWarningHandler=function(_11,ex){
dwr.engine._debug(_11);
};
dwr.engine.beginBatch=function(){
if(dwr.engine._batch){
dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});
return;
}
dwr.engine._batch=dwr.engine._createBatch();
};
dwr.engine.endBatch=function(_13){
var _14=dwr.engine._batch;
if(_14==null){
dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});
return;
}
dwr.engine._batch=null;
if(_14.map.callCount==0){
return;
}
if(_13){
dwr.engine._mergeBatch(_14,_13);
}
if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){
dwr.engine._batchQueue[dwr.engine._batchQueue.length]=_14;
}else{
dwr.engine._sendData(_14);
}
};
dwr.engine.setPollMethod=function(_15){
dwr.engine.setPollType(_15);
};
dwr.engine.setMethod=function(_16){
dwr.engine.setRpcType(_16);
};
dwr.engine.setVerb=function(_17){
dwr.engine.setHttpMethod(_17);
};
dwr.engine._origScriptSessionId="sessionId";
dwr.engine._sessionCookieName="JSESSIONID";
dwr.engine._allowGetForSafariButMakeForgeryEasier="false";
dwr.engine._scriptTagProtection="throw 'allowScriptTagRemoting is false.';";
dwr.engine._defaultPath="/dwr";
dwr.engine._scriptSessionId=null;
dwr.engine._getScriptSessionId=function(){
if(dwr.engine._scriptSessionId==null){
dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000);
}
return dwr.engine._scriptSessionId;
};
dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;
dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;
dwr.engine._preHook=null;
dwr.engine._postHook=null;
dwr.engine._batches={};
dwr.engine._batchesLength=0;
dwr.engine._batchQueue=[];
dwr.engine._rpcType=dwr.engine.XMLHttpRequest;
dwr.engine._httpMethod="POST";
dwr.engine._ordered=false;
dwr.engine._async=true;
dwr.engine._batch=null;
dwr.engine._timeout=0;
dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];
dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
dwr.engine._activeReverseAjax=false;
dwr.engine._pollType=dwr.engine.XMLHttpRequest;
dwr.engine._outstandingIFrames=[];
dwr.engine._pollReq=null;
dwr.engine._pollCometInterval=200;
dwr.engine._pollRetries=0;
dwr.engine._maxPollRetries=0;
dwr.engine._textHtmlHandler=null;
dwr.engine._headers=null;
dwr.engine._parameters=null;
dwr.engine._postSeperator="\n";
dwr.engine._defaultInterceptor=function(_18){
return _18;
};
dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;
dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;
dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;
dwr.engine._nextBatchId=0;
dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];
dwr.engine._partialResponseNo=0;
dwr.engine._partialResponseYes=1;
dwr.engine._partialResponseFlush=2;
dwr.engine._execute=function(_19,_1a,_1b,_1c){
var _1d=false;
if(dwr.engine._batch==null){
dwr.engine.beginBatch();
_1d=true;
}
var _1e=dwr.engine._batch;
var _1f=[];
for(var i=0;i<arguments.length-3;i++){
_1f[i]=arguments[i+3];
}
if(_1e.path==null){
_1e.path=_19;
}else{
if(_1e.path!=_19){
dwr.engine._handleError(_1e,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});
return;
}
}
var _21;
var _22=_1f[_1f.length-1];
if(typeof _22=="function"||_22==null){
_21={callback:_1f.pop()};
}else{
_21=_1f.pop();
}
dwr.engine._mergeBatch(_1e,_21);
_1e.handlers[_1e.map.callCount]={exceptionHandler:_21.exceptionHandler,callback:_21.callback};
var _23="c"+_1e.map.callCount+"-";
_1e.map[_23+"scriptName"]=_1a;
_1e.map[_23+"methodName"]=_1b;
_1e.map[_23+"id"]=_1e.map.callCount;
for(i=0;i<_1f.length;i++){
dwr.engine._serializeAll(_1e,[],_1f[i],_23+"param"+i);
}
_1e.map.callCount++;
if(_1d){
dwr.engine.endBatch();
}
};
dwr.engine._poll=function(_24){
if(!dwr.engine._activeReverseAjax){
return;
}
var _25=dwr.engine._createBatch();
_25.map.id=0;
_25.map.callCount=1;
_25.isPoll=true;
if(navigator.userAgent.indexOf("Gecko/")!=-1){
_25.rpcType=dwr.engine._pollType;
_25.map.partialResponse=dwr.engine._partialResponseYes;
}else{
if(document.all){
_25.rpcType=dwr.engine.IFrame;
_25.map.partialResponse=dwr.engine._partialResponseFlush;
}else{
_25.rpcType=dwr.engine._pollType;
_25.map.partialResponse=dwr.engine._partialResponseNo;
}
}
_25.httpMethod="POST";
_25.async=true;
_25.timeout=0;
_25.path=(_24)?_24:dwr.engine._defaultPath;
_25.preHooks=[];
_25.postHooks=[];
_25.errorHandler=dwr.engine._pollErrorHandler;
_25.warningHandler=dwr.engine._pollErrorHandler;
_25.handlers[0]={callback:function(_26){
dwr.engine._pollRetries=0;
setTimeout("dwr.engine._poll()",_26);
}};
dwr.engine._sendData(_25);
if(_25.rpcType==dwr.engine.XMLHttpRequest){
dwr.engine._checkCometPoll();
}
};
dwr.engine._pollErrorHandler=function(msg,ex){
dwr.engine._pollRetries++;
dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+ex.name+" : "+ex.message);
if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){
setTimeout("dwr.engine._poll()",10000);
}else{
dwr.engine._debug("Giving up.");
}
};
dwr.engine._createBatch=function(){
var _29={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,headers:[],parameters:[],isPoll:false,headers:{},handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};
if(dwr.engine._preHook){
_29.preHooks.push(dwr.engine._preHook);
}
if(dwr.engine._postHook){
_29.postHooks.push(dwr.engine._postHook);
}
var _2a,_2b;
if(dwr.engine._headers){
for(_2a in dwr.engine._headers){
_2b=dwr.engine._headers[_2a];
if(typeof _2b!="function"){
_29.headers[_2a]=_2b;
}
}
}
if(dwr.engine._parameters){
for(_2a in dwr.engine._parameters){
_2b=dwr.engine._parameters[_2a];
if(typeof _2b!="function"){
_29.parameters[_2a]=_2b;
}
}
}
return _29;
};
dwr.engine._mergeBatch=function(_2c,_2d){
var _2e,_2f;
for(var i=0;i<dwr.engine._propnames.length;i++){
_2e=dwr.engine._propnames[i];
if(_2d[_2e]!=null){
_2c[_2e]=_2d[_2e];
}
}
if(_2d.preHook!=null){
_2c.preHooks.unshift(_2d.preHook);
}
if(_2d.postHook!=null){
_2c.postHooks.push(_2d.postHook);
}
if(_2d.headers){
for(_2e in _2d.headers){
_2f=_2d.headers[_2e];
if(typeof _2f!="function"){
_2c.headers[_2e]=_2f;
}
}
}
if(_2d.parameters){
for(_2e in _2d.parameters){
_2f=_2d.parameters[_2e];
if(typeof _2f!="function"){
_2c.map["p-"+_2e]=""+_2f;
}
}
}
};
dwr.engine._getJSessionId=function(){
var _31=document.cookie.split(";");
for(var i=0;i<_31.length;i++){
var _33=_31[i];
while(_33.charAt(0)==" "){
_33=_33.substring(1,_33.length);
}
if(_33.indexOf(dwr.engine._sessionCookieName+"=")==0){
return _33.substring(11,_33.length);
}
}
return "";
};
dwr.engine._checkCometPoll=function(){
for(var i=0;i<dwr.engine._outstandingIFrames.length;i++){
var _35="";
var _36=dwr.engine._outstandingIFrames[i];
try{
_35=dwr.engine._getTextFromCometIFrame(_36);
}
catch(ex){
dwr.engine._handleWarning(_36.batch,ex);
}
if(_35!=""){
dwr.engine._processCometResponse(_35,_36.batch);
}
}
if(dwr.engine._pollReq){
var req=dwr.engine._pollReq;
var _35=req.responseText;
dwr.engine._processCometResponse(_35,req.batch);
}
if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){
setTimeout("dwr.engine._checkCometPoll()",dwr.engine._pollCometInterval);
}
};
dwr.engine._getTextFromCometIFrame=function(_38){
var _39=_38.contentWindow.document.body;
if(_39==null){
return "";
}
var _3a=_39.innerHTML;
if(_3a.indexOf("<PRE>")==0||_3a.indexOf("<pre>")==0){
_3a=_3a.substring(5,_3a.length-7);
}
return _3a;
};
dwr.engine._processCometResponse=function(_3b,_3c){
if(_3c.charsProcessed==_3b.length){
return;
}
if(_3b.length==0){
_3c.charsProcessed=0;
return;
}
var _3d=_3b.indexOf("//#DWR-START#",_3c.charsProcessed);
if(_3d==-1){
_3c.charsProcessed=_3b.length;
return;
}
var _3e=_3b.lastIndexOf("//#DWR-END#");
if(_3e==-1){
return;
}
if(_3b.charCodeAt(_3e+11)==13&&_3b.charCodeAt(_3e+12)==10){
_3c.charsProcessed=_3e+13;
}else{
_3c.charsProcessed=_3e+11;
}
var _3f=_3b.substring(_3d+13,_3e);
dwr.engine._receivedBatch=_3c;
dwr.engine._eval(_3f);
dwr.engine._receivedBatch=null;
};
dwr.engine._sendData=function(_40){
_40.map.batchId=dwr.engine._nextBatchId++;
dwr.engine._batches[_40.map.batchId]=_40;
dwr.engine._batchesLength++;
_40.completed=false;
for(var i=0;i<_40.preHooks.length;i++){
_40.preHooks[i]();
}
_40.preHooks=null;
if(_40.timeout&&_40.timeout!=0){
_40.interval=setInterval(function(){
dwr.engine._abortRequest(_40);
},_40.timeout);
}
if(_40.rpcType==dwr.engine.XMLHttpRequest){
if(window.XMLHttpRequest){
_40.req=new XMLHttpRequest();
}else{
if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){
_40.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP);
}
}
}
var _42,_43;
if(_40.req){
if(_40.async){
_40.req.onreadystatechange=function(){
dwr.engine._stateChange(_40);
};
}
if(_40.isPoll){
dwr.engine._pollReq=_40.req;
_40.req.batch=_40;
}
var _44=navigator.userAgent.indexOf("Safari/");
if(_44>=0){
var _45=navigator.userAgent.substring(_44+7);
if(parseInt(_45,10)<400){
if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true"){
_40.httpMethod="GET";
}else{
dwr.engine._handleWarning(_40,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."});
}
}
}
_40.mode=_40.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;
_43=dwr.engine._constructRequest(_40);
try{
_40.req.open(_40.httpMethod,_43.url,_40.async);
try{
for(_42 in _40.headers){
var _46=_40.headers[_42];
if(typeof _46=="string"){
_40.req.setRequestHeader(_42,_46);
}
}
if(!_40.headers["Content-Type"]){
_40.req.setRequestHeader("Content-Type","text/plain");
}
}
catch(ex){
dwr.engine._handleWarning(_40,ex);
}
_40.req.send(_43.body);
if(!_40.async){
dwr.engine._stateChange(_40);
}
}
catch(ex){
dwr.engine._handleError(_40,ex);
}
}else{
if(_40.rpcType!=dwr.engine.ScriptTag){
var _47=_40.isPoll?"dwr-if-poll-"+_40.map.batchId:"dwr-if-"+_40.map["c0-id"];
_40.div=document.createElement("div");
_40.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+_47+"' name='"+_47+"'></iframe>";
document.body.appendChild(_40.div);
_40.iframe=document.getElementById(_47);
_40.iframe.batch=_40;
_40.mode=_40.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;
if(_40.isPoll){
dwr.engine._outstandingIFrames.push(_40.iframe);
}
_43=dwr.engine._constructRequest(_40);
if(_40.httpMethod=="GET"){
_40.iframe.setAttribute("src",_43.url);
}else{
_40.form=document.createElement("form");
_40.form.setAttribute("id","dwr-form");
_40.form.setAttribute("action",_43.url);
_40.form.setAttribute("target",_47);
_40.form.target=_47;
_40.form.setAttribute("method",_40.httpMethod);
for(_42 in _40.map){
var _46=_40.map[_42];
if(typeof _46!="function"){
var _48=document.createElement("input");
_48.setAttribute("type","hidden");
_48.setAttribute("name",_42);
_48.setAttribute("value",_46);
_40.form.appendChild(_48);
}
}
document.body.appendChild(_40.form);
_40.form.submit();
}
}else{
_40.httpMethod="GET";
_40.mode=_40.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;
_43=dwr.engine._constructRequest(_40);
_40.script=document.createElement("script");
_40.script.id="dwr-st-"+_40.map["c0-id"];
_40.script.src=_43.url;
document.body.appendChild(_40.script);
}
}
};
dwr.engine._ModePlainCall="/call/plaincall/";
dwr.engine._ModeHtmlCall="/call/htmlcall/";
dwr.engine._ModePlainPoll="/call/plainpoll/";
dwr.engine._ModeHtmlPoll="/call/htmlpoll/";
dwr.engine._constructRequest=function(_49){
var _4a={url:_49.path+_49.mode,body:null};
if(_49.isPoll==true){
_4a.url+="ReverseAjax.dwr";
}else{
if(_49.map.callCount==1){
_4a.url+=_49.map["c0-scriptName"]+"."+_49.map["c0-methodName"]+".dwr";
}else{
_4a.url+="Multiple."+_49.map.callCount+".dwr";
}
}
var _4b=location.href.match(/jsessionid=([^?]+)/);
if(_4b!=null){
_4a.url+=";jsessionid="+_4b[1];
}
var _4c;
if(_49.httpMethod=="GET"){
_49.map.callCount=""+_49.map.callCount;
_4a.url+="?";
for(_4c in _49.map){
if(typeof _49.map[_4c]!="function"){
_4a.url+=encodeURIComponent(_4c)+"="+encodeURIComponent(_49.map[_4c])+"&";
}
}
_4a.url=_4a.url.substring(0,_4a.url.length-1);
}else{
_4a.body="";
for(_4c in _49.map){
if(typeof _49.map[_4c]!="function"){
_4a.body+=_4c+"="+_49.map[_4c]+dwr.engine._postSeperator;
}
}
_4a.body=dwr.engine._contentRewriteHandler(_4a.body);
}
_4a.url=dwr.engine._urlRewriteHandler(_4a.url);
return _4a;
};
dwr.engine._stateChange=function(_4d){
var _4e;
if(_4d.completed){
dwr.engine._debug("Error: _stateChange() with batch.completed");
return;
}
var req=_4d.req;
try{
if(req.readyState!=4){
return;
}
}
catch(ex){
dwr.engine._handleWarning(_4d,ex);
dwr.engine._clearUp(_4d);
return;
}
try{
var _50=req.responseText;
_50=dwr.engine._replyRewriteHandler(_50);
var _51=req.status;
if(_50==null||_50==""){
dwr.engine._handleWarning(_4d,{name:"dwr.engine.missingData",message:"No data received from server"});
}else{
if(_51!=200){
dwr.engine._handleError(_4d,{name:"dwr.engine.http."+_51,message:req.statusText});
}else{
var _52=req.getResponseHeader("Content-Type");
if(!_52.match(/^text\/plain/)&&!_52.match(/^text\/javascript/)){
if(_52.match(/^text\/html/)&&typeof _4d.textHtmlHandler=="function"){
_4d.textHtmlHandler();
}else{
dwr.engine._handleWarning(_4d,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+_52+"'"});
}
}else{
if(_4d.isPoll&&_4d.map.partialResponse==dwr.engine._partialResponseYes){
dwr.engine._processCometResponse(_50,_4d);
}else{
if(_50.search("//#DWR")==-1){
dwr.engine._handleWarning(_4d,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"});
}else{
_4e=_50;
}
}
}
}
}
}
catch(ex){
dwr.engine._handleWarning(_4d,ex);
}
dwr.engine._callPostHooks(_4d);
dwr.engine._receivedBatch=_4d;
if(_4e!=null){
_4e=_4e.replace(dwr.engine._scriptTagProtection,"");
}
dwr.engine._eval(_4e);
dwr.engine._receivedBatch=null;
dwr.engine._clearUp(_4d);
};
dwr.engine._remoteHandleCallback=function(_53,_54,_55){
var _56=dwr.engine._batches[_53];
if(_56==null){
dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+_53,true);
return;
}
try{
var _57=_56.handlers[_54];
if(!_57){
dwr.engine._debug("Warning: Missing handlers. callId="+_54,true);
}else{
if(typeof _57.callback=="function"){
_57.callback(_55);
}
}
}
catch(ex){
dwr.engine._handleError(_56,ex);
}
};
dwr.engine._remoteHandleException=function(_58,_59,ex){
var _5b=dwr.engine._batches[_58];
if(_5b==null){
dwr.engine._debug("Warning: null batch in remoteHandleException",true);
return;
}
var _5c=_5b.handlers[_59];
if(_5c==null){
dwr.engine._debug("Warning: null handlers in remoteHandleException",true);
return;
}
if(ex.message==undefined){
ex.message="";
}
if(typeof _5c.exceptionHandler=="function"){
_5c.exceptionHandler(ex.message,ex);
}else{
if(typeof _5b.errorHandler=="function"){
_5b.errorHandler(ex.message,ex);
}
}
};
dwr.engine._remoteHandleBatchException=function(ex,_5e){
var _5f=(dwr.engine._receivedBatch==null&&_5e!=null);
if(_5f){
dwr.engine._receivedBatch=dwr.engine._batches[_5e];
}
if(ex.message==undefined){
ex.message="";
}
dwr.engine._handleError(dwr.engine._receivedBatch,ex);
if(_5f){
dwr.engine._receivedBatch=null;
dwr.engine._clearUp(dwr.engine._batches[_5e]);
}
};
dwr.engine._remotePollCometDisabled=function(ex,_61){
dwr.engine.setActiveReverseAjax(false);
var _62=(dwr.engine._receivedBatch==null&&_61!=null);
if(_62){
dwr.engine._receivedBatch=dwr.engine._batches[_61];
}
if(ex.message==undefined){
ex.message="";
}
dwr.engine._handleError(dwr.engine._receivedBatch,ex);
if(_62){
dwr.engine._receivedBatch=null;
dwr.engine._clearUp(dwr.engine._batches[_61]);
}
};
dwr.engine._remoteBeginIFrameResponse=function(_63,_64){
if(_63!=null){
dwr.engine._receivedBatch=_63.batch;
}
dwr.engine._callPostHooks(dwr.engine._receivedBatch);
};
dwr.engine._remoteEndIFrameResponse=function(_65){
dwr.engine._clearUp(dwr.engine._receivedBatch);
dwr.engine._receivedBatch=null;
};
dwr.engine._eval=function(_66){
if(_66==null){
return null;
}
if(_66==""){
dwr.engine._debug("Warning: blank script",true);
return null;
}
return eval(_66);
};
dwr.engine._abortRequest=function(_67){
if(_67&&!_67.completed){
clearInterval(_67.interval);
dwr.engine._clearUp(_67);
if(_67.req){
_67.req.abort();
}
dwr.engine._handleError(_67,{name:"dwr.engine.timeout",message:"Timeout"});
}
};
dwr.engine._callPostHooks=function(_68){
if(_68.postHooks){
for(var i=0;i<_68.postHooks.length;i++){
_68.postHooks[i]();
}
_68.postHooks=null;
}
};
dwr.engine._clearUp=function(_6a){
if(!_6a){
dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);
return;
}
if(_6a.completed=="true"){
dwr.engine._debug("Warning: Double complete",true);
return;
}
if(_6a.div){
_6a.div.parentNode.removeChild(_6a.div);
}
if(_6a.iframe){
for(var i=0;i<dwr.engine._outstandingIFrames.length;i++){
if(dwr.engine._outstandingIFrames[i]==_6a.iframe){
dwr.engine._outstandingIFrames.splice(i,1);
}
}
_6a.iframe.parentNode.removeChild(_6a.iframe);
}
if(_6a.form){
_6a.form.parentNode.removeChild(_6a.form);
}
if(_6a.req){
if(_6a.req==dwr.engine._pollReq){
dwr.engine._pollReq=null;
}
delete _6a.req;
}
if(_6a.map&&_6a.map.batchId){
delete dwr.engine._batches[_6a.map.batchId];
dwr.engine._batchesLength--;
}
_6a.completed=true;
if(dwr.engine._batchQueue.length!=0){
var _6c=dwr.engine._batchQueue.shift();
dwr.engine._sendData(_6c);
}
};
dwr.engine._handleError=function(_6d,ex){
if(typeof ex=="string"){
ex={name:"unknown",message:ex};
}
if(ex.message==null){
ex.message="";
}
if(ex.name==null){
ex.name="unknown";
}
if(_6d&&typeof _6d.errorHandler=="function"){
_6d.errorHandler(ex.message,ex);
}else{
if(dwr.engine._errorHandler){
dwr.engine._errorHandler(ex.message,ex);
}
}
dwr.engine._clearUp(_6d);
};
dwr.engine._handleWarning=function(_6f,ex){
if(typeof ex=="string"){
ex={name:"unknown",message:ex};
}
if(ex.message==null){
ex.message="";
}
if(ex.name==null){
ex.name="unknown";
}
if(_6f&&typeof _6f.warningHandler=="function"){
_6f.warningHandler(ex.message,ex);
}else{
if(dwr.engine._warningHandler){
dwr.engine._warningHandler(ex.message,ex);
}
}
dwr.engine._clearUp(_6f);
};
dwr.engine._serializeAll=function(_71,_72,_73,_74){
if(_73==null){
_71.map[_74]="null:null";
return;
}
switch(typeof _73){
case "boolean":
_71.map[_74]="boolean:"+_73;
break;
case "number":
_71.map[_74]="number:"+_73;
break;
case "string":
_71.map[_74]="string:"+encodeURIComponent(_73);
break;
case "object":
if(_73 instanceof String){
_71.map[_74]="String:"+encodeURIComponent(_73);
}else{
if(_73 instanceof Boolean){
_71.map[_74]="Boolean:"+_73;
}else{
if(_73 instanceof Number){
_71.map[_74]="Number:"+_73;
}else{
if(_73 instanceof Date){
_71.map[_74]="Date:"+_73.getTime();
}else{
if(_73&&_73.join){
_71.map[_74]=dwr.engine._serializeArray(_71,_72,_73,_74);
}else{
_71.map[_74]=dwr.engine._serializeObject(_71,_72,_73,_74);
}
}
}
}
}
break;
case "function":
break;
default:
dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof _73+", attempting default converter."});
_71.map[_74]="default:"+_73;
break;
}
};
dwr.engine._lookup=function(_75,_76,_77){
var _78;
for(var i=0;i<_75.length;i++){
if(_75[i].data==_76){
_78=_75[i];
break;
}
}
if(_78){
return "reference:"+_78.name;
}
_75.push({data:_76,name:_77});
return null;
};
dwr.engine._serializeObject=function(_7a,_7b,_7c,_7d){
var ref=dwr.engine._lookup(_7b,_7c,_7d);
if(ref){
return ref;
}
if(_7c.nodeName&&_7c.nodeType){
return dwr.engine._serializeXml(_7a,_7b,_7c,_7d);
}
var _7f="Object_"+dwr.engine._getObjectClassName(_7c)+":{";
var _80;
for(_80 in _7c){
if(typeof _7c[_80]!="function"){
_7a.paramCount++;
var _81="c"+dwr.engine._batch.map.callCount+"-e"+_7a.paramCount;
dwr.engine._serializeAll(_7a,_7b,_7c[_80],_81);
_7f+=encodeURIComponent(_80)+":reference:"+_81+", ";
}
}
if(_7f.substring(_7f.length-2)==", "){
_7f=_7f.substring(0,_7f.length-2);
}
_7f+="}";
return _7f;
};
dwr.engine._errorClasses={"Error":Error,"EvalError":EvalError,"RangeError":RangeError,"ReferenceError":ReferenceError,"SyntaxError":SyntaxError,"TypeError":TypeError,"URIError":URIError};
dwr.engine._getObjectClassName=function(obj){
if(obj&&obj.constructor&&obj.constructor.toString){
var str=obj.constructor.toString();
var _84=str.match(/function\s+(\w+)/);
if(_84&&_84.length==2){
return _84[1];
}
}
if(obj&&obj.constructor){
for(var _85 in dwr.engine._errorClasses){
if(obj.constructor==dwr.engine._errorClasses[_85]){
return _85;
}
}
}
if(obj){
var str=Object.prototype.toString.call(obj);
var _84=str.match(/\[object\s+(\w+)/);
if(_84&&_84.length==2){
return _84[1];
}
}
return "Object";
};
dwr.engine._serializeXml=function(_86,_87,_88,_89){
var ref=dwr.engine._lookup(_87,_88,_89);
if(ref){
return ref;
}
var _8b;
if(window.XMLSerializer){
_8b=new XMLSerializer().serializeToString(_88);
}else{
if(_88.toXml){
_8b=_88.toXml;
}else{
_8b=_88.innerHTML;
}
}
return "XML:"+encodeURIComponent(_8b);
};
dwr.engine._serializeArray=function(_8c,_8d,_8e,_8f){
var ref=dwr.engine._lookup(_8d,_8e,_8f);
if(ref){
return ref;
}
var _91="Array:[";
for(var i=0;i<_8e.length;i++){
if(i!=0){
_91+=",";
}
_8c.paramCount++;
var _93="c"+dwr.engine._batch.map.callCount+"-e"+_8c.paramCount;
dwr.engine._serializeAll(_8c,_8d,_8e[i],_93);
_91+="reference:";
_91+=_93;
}
_91+="]";
return _91;
};
dwr.engine._unserializeDocument=function(xml){
var dom;
if(window.DOMParser){
var _96=new DOMParser();
dom=_96.parseFromString(xml,"text/xml");
if(!dom.documentElement||dom.documentElement.tagName=="parsererror"){
var _97=dom.documentElement.firstChild.data;
_97+="\n"+dom.documentElement.firstChild.nextSibling.firstChild.data;
throw _97;
}
return dom;
}else{
if(window.ActiveXObject){
dom=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);
dom.loadXML(xml);
return dom;
}else{
var div=document.createElement("div");
div.innerHTML=xml;
return div;
}
}
};
dwr.engine._newActiveXObject=function(_99){
var _9a;
for(var i=0;i<_99.length;i++){
try{
_9a=new ActiveXObject(_99[i]);
break;
}
catch(ex){
}
}
return _9a;
};
dwr.engine._debug=function(_9c,_9d){
var _9e=false;
try{
if(window.console){
if(_9d&&window.console.trace){
window.console.trace();
}
window.console.log(_9c);
_9e=true;
}else{
if(window.opera&&window.opera.postError){
window.opera.postError(_9c);
_9e=true;
}
}
}
catch(ex){
}
if(!_9e){
var _9f=document.getElementById("dwr-debug");
if(_9f){
var _a0=_9c+"<br/>"+_9f.innerHTML;
if(_a0.length>2048){
_a0=_a0.substring(0,2048);
}
_9f.innerHTML=_a0;
}
}
};

dojo._xdResourceLoaded({depends:[["provide","dijit.Menu"],["provide","dijit.form._FormWidget"],["provide","dijit.form.Button"],["provide","mq.widget.LocationListItem"],["provide","mq.widget.SendEmail"],["provide","mq.widget.LinkToPage"],["provide","mq.widget.SendToGPS"],["provide","mq.uicontroller"],["provide","mq.tabview"],["provide","mq.comscore"],["provide","mq.maptabview"],["provide","mq.widget.SearchResults"],["provide","mq.searchtabview"],["provide","dojo.number"],["provide","dojox.data.dom"],["provide","mq.widget.RecentSearches"],["provide","mq.mytabview"],["provide","mq.uiview"],["provide","mq.ad"],["provide","mq.ua"],["provide","mq.weather"],["provide","mq.searcheditform"],["provide","mq.addnextlocationform"],["provide","mq.editlocationform"],["provide","mq.printview"],["i18n._preloadLocalizations","dojo.nls.results",["xx","ROOT","en","en-us"]]],defineResource:function(_1){
if(!_1._hasResource["dijit.Menu"]){
_1._hasResource["dijit.Menu"]=true;
_1.provide("dijit.Menu");
_1.declare("dijit.Menu",[dijit._Widget,dijit._Templated,dijit._KeyNavContainer],{constructor:function(){
this._bindings=[];
},templateString:"<table class=\"dijit dijitMenu dijitReset dijitMenuTable\" waiRole=\"menu\" dojoAttachEvent=\"onkeypress:_onKeyPress\">"+"<tbody class=\"dijitReset\" dojoAttachPoint=\"containerNode\"></tbody>"+"</table>",targetNodeIds:[],contextMenuForWindow:false,parentMenu:null,popupDelay:500,_contextMenuWithMouse:false,postCreate:function(){
if(this.contextMenuForWindow){
this.bindDomNode(_1.body());
}else{
_1.forEach(this.targetNodeIds,this.bindDomNode,this);
}
this.connectKeyNavHandlers([_1.keys.UP_ARROW],[_1.keys.DOWN_ARROW]);
},startup:function(){
_1.forEach(this.getChildren(),function(_2){
_2.startup();
});
this.startupKeyNavChildren();
},onExecute:function(){
},onCancel:function(_3){
},_moveToPopup:function(_4){
if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled){
this.focusedChild._onClick(_4);
}
},_onKeyPress:function(_5){
if(_5.ctrlKey||_5.altKey){
return;
}
switch(_5.keyCode){
case _1.keys.RIGHT_ARROW:
this._moveToPopup(_5);
_1.stopEvent(_5);
break;
case _1.keys.LEFT_ARROW:
if(this.parentMenu){
this.onCancel(false);
}else{
_1.stopEvent(_5);
}
break;
}
},onItemHover:function(_6){
this.focusChild(_6);
if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer){
this.hover_timer=setTimeout(_1.hitch(this,"_openPopup"),this.popupDelay);
}
},_onChildBlur:function(_7){
dijit.popup.close(_7.popup);
_7._blur();
this._stopPopupTimer();
},onItemUnhover:function(_8){
},_stopPopupTimer:function(){
if(this.hover_timer){
clearTimeout(this.hover_timer);
this.hover_timer=null;
}
},_getTopMenu:function(){
for(var _9=this;_9.parentMenu;_9=_9.parentMenu){
}
return _9;
},onItemClick:function(_a){
if(_a.disabled){
return false;
}
if(_a.popup){
if(!this.is_open){
this._openPopup();
}
}else{
this.onExecute();
_a.onClick();
}
},_iframeContentWindow:function(_b){
var _c=dijit.getDocumentWindow(dijit.Menu._iframeContentDocument(_b))||dijit.Menu._iframeContentDocument(_b)["__parent__"]||(_b.name&&document.frames[_b.name])||null;
return _c;
},_iframeContentDocument:function(_d){
var _e=_d.contentDocument||(_d.contentWindow&&_d.contentWindow.document)||(_d.name&&document.frames[_d.name]&&document.frames[_d.name].document)||null;
return _e;
},bindDomNode:function(_f){
_f=_1.byId(_f);
var win=dijit.getDocumentWindow(_f.ownerDocument);
if(_f.tagName.toLowerCase()=="iframe"){
win=this._iframeContentWindow(_f);
_f=_1.withGlobal(win,_1.body);
}
var cn=(_f==_1.body()?_1.doc:_f);
_f[this.id]=this._bindings.push([_1.connect(cn,"oncontextmenu",this,"_openMyself"),_1.connect(cn,"onkeydown",this,"_contextKey"),_1.connect(cn,"onmousedown",this,"_contextMouse")]);
},unBindDomNode:function(_12){
var _13=_1.byId(_12);
var bid=_13[this.id]-1,b=this._bindings[bid];
_1.forEach(b,_1.disconnect);
delete this._bindings[bid];
},_contextKey:function(e){
this._contextMenuWithMouse=false;
if(e.keyCode==_1.keys.F10){
_1.stopEvent(e);
if(e.shiftKey&&e.type=="keydown"){
var _e={target:e.target,pageX:e.pageX,pageY:e.pageY};
_e.preventDefault=_e.stopPropagation=function(){
};
window.setTimeout(_1.hitch(this,function(){
this._openMyself(_e);
}),1);
}
}
},_contextMouse:function(e){
this._contextMenuWithMouse=true;
},_openMyself:function(e){
_1.stopEvent(e);
var x,y;
if(_1.isSafari||this._contextMenuWithMouse){
x=e.pageX;
y=e.pageY;
}else{
var _1c=_1.coords(e.target,true);
x=_1c.x+10;
y=_1c.y+10;
}
var _1d=this;
var _1e=dijit.getFocus(this);
function closeAndRestoreFocus(){
dijit.focus(_1e);
dijit.popup.close(_1d);
};
dijit.popup.open({popup:this,x:x,y:y,onExecute:closeAndRestoreFocus,onCancel:closeAndRestoreFocus,orient:this.isLeftToRight()?"L":"R"});
this.focus();
this._onBlur=function(){
dijit.popup.close(this);
};
},onOpen:function(e){
this.isShowingNow=true;
},onClose:function(){
this._stopPopupTimer();
this.parentMenu=null;
this.isShowingNow=false;
this.currentPopup=null;
if(this.focusedChild){
this._onChildBlur(this.focusedChild);
this.focusedChild=null;
}
},_openPopup:function(){
this._stopPopupTimer();
var _20=this.focusedChild;
var _21=_20.popup;
if(_21.isShowingNow){
return;
}
_21.parentMenu=this;
var _22=this;
dijit.popup.open({parent:this,popup:_21,around:_20.arrowCell,orient:this.isLeftToRight()?{"TR":"TL","TL":"TR"}:{"TL":"TR","TR":"TL"},onCancel:function(){
dijit.popup.close(_21);
_20.focus();
_22.currentPopup=null;
}});
this.currentPopup=_21;
if(_21.focus){
_21.focus();
}
}});
_1.declare("dijit.MenuItem",[dijit._Widget,dijit._Templated,dijit._Contained],{templateString:"<tr class=\"dijitReset dijitMenuItem\""+"dojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">"+"<td class=\"dijitReset\"><div class=\"dijitMenuItemIcon ${iconClass}\" dojoAttachPoint=\"iconNode\" ></div></td>"+"<td tabIndex=\"-1\" class=\"dijitReset dijitMenuItemLabel\" dojoAttachPoint=\"containerNode\" waiRole=\"menuitem\"></td>"+"<td class=\"dijitReset\" dojoAttachPoint=\"arrowCell\">"+"<div class=\"dijitMenuExpand\" dojoAttachPoint=\"expand\" style=\"display:none\">"+"<span class=\"dijitInline dijitArrowNode dijitMenuExpandInner\">+</span>"+"</div>"+"</td>"+"</tr>",label:"",iconClass:"",disabled:false,postCreate:function(){
_1.setSelectable(this.domNode,false);
this.setDisabled(this.disabled);
if(this.label){
this.containerNode.innerHTML=this.label;
}
},_onHover:function(){
this.getParent().onItemHover(this);
},_onUnhover:function(){
this.getParent().onItemUnhover(this);
},_onClick:function(evt){
this.getParent().onItemClick(this);
_1.stopEvent(evt);
},onClick:function(){
},focus:function(){
_1.addClass(this.domNode,"dijitMenuItemHover");
try{
dijit.focus(this.containerNode);
}
catch(e){
}
},_blur:function(){
_1.removeClass(this.domNode,"dijitMenuItemHover");
},setDisabled:function(_24){
this.disabled=_24;
_1[_24?"addClass":"removeClass"](this.domNode,"dijitMenuItemDisabled");
dijit.setWaiState(this.containerNode,"disabled",_24?"true":"false");
}});
_1.declare("dijit.PopupMenuItem",dijit.MenuItem,{_fillContent:function(){
if(this.srcNodeRef){
var _25=_1.query("*",this.srcNodeRef);
dijit.PopupMenuItem.superclass._fillContent.call(this,_25[0]);
this.dropDownContainer=this.srcNodeRef;
}
},startup:function(){
if(!this.popup){
var _26=_1.query("[widgetId]",this.dropDownContainer)[0];
this.popup=dijit.byNode(_26);
}
_1.body().appendChild(this.popup.domNode);
this.popup.domNode.style.display="none";
_1.addClass(this.expand,"dijitMenuExpandEnabled");
_1.style(this.expand,"display","");
dijit.setWaiState(this.containerNode,"haspopup","true");
}});
_1.declare("dijit.MenuSeparator",[dijit._Widget,dijit._Templated,dijit._Contained],{templateString:"<tr class=\"dijitMenuSeparator\"><td colspan=3>"+"<div class=\"dijitMenuSeparatorTop\"></div>"+"<div class=\"dijitMenuSeparatorBottom\"></div>"+"</td></tr>",postCreate:function(){
_1.setSelectable(this.domNode,false);
},isFocusable:function(){
return false;
}});
}
if(!_1._hasResource["dijit.form._FormWidget"]){
_1._hasResource["dijit.form._FormWidget"]=true;
_1.provide("dijit.form._FormWidget");
_1.declare("dijit.form._FormWidget",[dijit._Widget,dijit._Templated],{baseClass:"",value:"",name:"",id:"",alt:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,attributeMap:_1.mixin(_1.clone(dijit._Widget.prototype.attributeMap),{id:"focusNode",tabIndex:"focusNode",alt:"focusNode"}),setDisabled:function(_27){
this.domNode.disabled=this.disabled=_27;
if(this.focusNode){
this.focusNode.disabled=_27;
}
if(_27){
this._hovering=false;
this._active=false;
}
dijit.setWaiState(this.focusNode||this.domNode,"disabled",_27);
this._setStateClass();
},_onMouse:function(_28){
var _29=_28.target;
if(_29&&_29.getAttribute){
this.stateModifier=_29.getAttribute("stateModifier")||"";
}
if(!this.disabled){
switch(_28.type){
case "mouseenter":
case "mouseover":
this._hovering=true;
break;
case "mouseout":
case "mouseleave":
this._hovering=false;
break;
case "mousedown":
this._active=true;
var _2a=this;
var _2b=this.connect(_1.body(),"onmouseup",function(){
_2a._active=false;
_2a._setStateClass();
_2a.disconnect(_2b);
});
break;
}
this._setStateClass();
}
},isFocusable:function(){
return !this.disabled&&(_1.style(this.domNode,"display")!="none");
},focus:function(){
dijit.focus(this.focusNode);
},_setStateClass:function(){
if(!("staticClass" in this)){
this.staticClass=(this.stateNode||this.domNode).className;
}
var _2c=[this.baseClass];
function multiply(_2d){
_2c=_2c.concat(_1.map(_2c,function(c){
return c+_2d;
}));
};
if(this.checked){
multiply("Checked");
}
if(this.state){
multiply(this.state);
}
if(this.selected){
multiply("Selected");
}
if(this.disabled){
multiply("Disabled");
}else{
if(this._active){
multiply(this.stateModifier+"Active");
}else{
if(this._focused){
multiply("Focused");
}
if((this.stateModifier||!this._focused)&&this._hovering){
multiply(this.stateModifier+"Hover");
}
}
}
(this.stateNode||this.domNode).className=this.staticClass+" "+_2c.join(" ");
},onChange:function(_2f){
},postCreate:function(){
this.setValue(this.value,null);
this.setDisabled(this.disabled);
this._setStateClass();
},setValue:function(_30,_31){
this._lastValue=_30;
dijit.setWaiState(this.focusNode||this.domNode,"valuenow",this.forWaiValuenow());
if(_31===undefined){
_31=true;
}
if(this._lastValueReported==undefined&&_31===null){
this._lastValueReported=_30;
}
if((this.intermediateChanges||_31)&&((_30&&_30.toString)?_30.toString():_30)!==((this._lastValueReported&&this._lastValueReported.toString)?this._lastValueReported.toString():this._lastValueReported)){
this._lastValueReported=_30;
this.onChange(_30);
}
},getValue:function(){
return this._lastValue;
},undo:function(){
this.setValue(this._lastValueReported,false);
},_onKeyPress:function(e){
if(e.keyCode==_1.keys.ESCAPE&&!e.shiftKey&&!e.ctrlKey&&!e.altKey){
var v=this.getValue();
var lv=this._lastValueReported;
if((typeof lv!="undefined")&&((v!==null&&v.toString)?v.toString():null)!==lv.toString()){
this.undo();
_1.stopEvent(e);
return false;
}
}
return true;
},forWaiValuenow:function(){
return this.getValue();
}});
}
if(!_1._hasResource["dijit.form.Button"]){
_1._hasResource["dijit.form.Button"]=true;
_1.provide("dijit.form.Button");
_1.declare("dijit.form.Button",dijit.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:"<div class=\"dijit dijitLeft dijitInline dijitButton\"\n\tdojoAttachEvent=\"onclick:_onButtonClick,onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\"\n\t><div class='dijitRight'\n\t\t><button class=\"dijitStretch dijitButtonNode dijitButtonContents\" dojoAttachPoint=\"focusNode,titleNode\"\n\t\t\ttype=\"${type}\" waiRole=\"button\" waiState=\"labelledby-${id}_label\"\n\t\t\t><span class=\"dijitInline ${iconClass}\" dojoAttachPoint=\"iconNode\" \n \t\t\t\t><span class=\"dijitToggleButtonIconChar\">&#10003</span \n\t\t\t></span\n\t\t\t><span class=\"dijitButtonText\" id=\"${id}_label\" dojoAttachPoint=\"containerNode\">${label}</span\n\t\t></button\n\t></div\n></div>\n",_onClick:function(e){
if(this.disabled){
return false;
}
this._clicked();
return this.onClick(e);
},_onButtonClick:function(e){
_1.stopEvent(e);
var _37=this._onClick(e)!==false;
if(this.type=="submit"&&_37){
for(var _38=this.domNode;_38;_38=_38.parentNode){
var _39=dijit.byNode(_38);
if(_39&&_39._onSubmit){
_39._onSubmit(e);
break;
}
if(_38.tagName.toLowerCase()=="form"){
if(!_38.onsubmit||_38.onsubmit()){
_38.submit();
}
break;
}
}
}
},postCreate:function(){
if(this.showLabel==false){
var _3a="";
this.label=this.containerNode.innerHTML;
_3a=_1.trim(this.containerNode.innerText||this.containerNode.textContent);
this.titleNode.title=_3a;
_1.addClass(this.containerNode,"dijitDisplayNone");
}
this.inherited(arguments);
},onClick:function(e){
return true;
},_clicked:function(e){
},setLabel:function(_3d){
this.containerNode.innerHTML=this.label=_3d;
if(_1.isMozilla){
var _3e=_1.getComputedStyle(this.domNode).display;
this.domNode.style.display="none";
var _3f=this;
setTimeout(function(){
_3f.domNode.style.display=_3e;
},1);
}
if(this.showLabel==false){
this.titleNode.title=_1.trim(this.containerNode.innerText||this.containerNode.textContent);
}
}});
_1.declare("dijit.form.DropDownButton",[dijit.form.Button,dijit._Container],{baseClass:"dijitDropDownButton",templateString:"<div class=\"dijit dijitLeft dijitInline\"\n\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse,onclick:_onDropDownClick,onkeydown:_onDropDownKeydown,onblur:_onDropDownBlur,onkeypress:_onKey\"\n\t><div class='dijitRight'>\n\t<button class=\"dijitStretch dijitButtonNode dijitButtonContents\" type=\"${type}\"\n\t\tdojoAttachPoint=\"focusNode,titleNode\" waiRole=\"button\" waiState=\"haspopup-true,labelledby-${id}_label\"\n\t\t><div class=\"dijitInline ${iconClass}\" dojoAttachPoint=\"iconNode\"></div\n\t\t><span class=\"dijitButtonText\" \tdojoAttachPoint=\"containerNode,popupStateNode\"\n\t\tid=\"${id}_label\">${label}</span\n\t\t><span class='dijitA11yDownArrow'>&#9660;</span>\n\t</button>\n</div></div>\n",_fillContent:function(){
if(this.srcNodeRef){
var _40=_1.query("*",this.srcNodeRef);
dijit.form.DropDownButton.superclass._fillContent.call(this,_40[0]);
this.dropDownContainer=this.srcNodeRef;
}
},startup:function(){
if(!this.dropDown){
var _41=_1.query("[widgetId]",this.dropDownContainer)[0];
this.dropDown=dijit.byNode(_41);
delete this.dropDownContainer;
}
_1.body().appendChild(this.dropDown.domNode);
this.dropDown.domNode.style.display="none";
},_onArrowClick:function(e){
if(this.disabled){
return;
}
this._toggleDropDown();
},_onDropDownClick:function(e){
var _44=_1.isFF&&_1.isFF<3&&navigator.appVersion.indexOf("Macintosh")!=-1;
if(!_44||e.detail!=0||this._seenKeydown){
this._onArrowClick(e);
}
this._seenKeydown=false;
},_onDropDownKeydown:function(e){
this._seenKeydown=true;
},_onDropDownBlur:function(e){
this._seenKeydown=false;
},_onKey:function(e){
if(this.disabled){
return;
}
if(e.keyCode==_1.keys.DOWN_ARROW){
if(!this.dropDown||this.dropDown.domNode.style.display=="none"){
_1.stopEvent(e);
return this._toggleDropDown();
}
}
},_onBlur:function(){
this._closeDropDown();
},_toggleDropDown:function(){
if(this.disabled){
return;
}
dijit.focus(this.popupStateNode);
var _48=this.dropDown;
if(!_48){
return false;
}
if(!_48.isShowingNow){
if(_48.href&&!_48.isLoaded){
var _49=this;
var _4a=_1.connect(_48,"onLoad",function(){
_1.disconnect(_4a);
_49._openDropDown();
});
_48._loadCheck(true);
return;
}else{
this._openDropDown();
}
}else{
this._closeDropDown();
}
},_openDropDown:function(){
var _4b=this.dropDown;
var _4c=_4b.domNode.style.width;
var _4d=this;
dijit.popup.open({parent:this,popup:_4b,around:this.domNode,orient:this.isLeftToRight()?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"},onExecute:function(){
_4d._closeDropDown(true);
},onCancel:function(){
_4d._closeDropDown(true);
},onClose:function(){
_4b.domNode.style.width=_4c;
_4d.popupStateNode.removeAttribute("popupActive");
this._opened=false;
}});
if(this.domNode.offsetWidth>_4b.domNode.offsetWidth){
var _4e=null;
if(!this.isLeftToRight()){
_4e=_4b.domNode.parentNode;
var _4f=_4e.offsetLeft+_4e.offsetWidth;
}
_1.marginBox(_4b.domNode,{w:this.domNode.offsetWidth});
if(_4e){
_4e.style.left=_4f-this.domNode.offsetWidth+"px";
}
}
this.popupStateNode.setAttribute("popupActive","true");
this._opened=true;
if(_4b.focus){
_4b.focus();
}
},_closeDropDown:function(_50){
if(this._opened){
dijit.popup.close(this.dropDown);
if(_50){
this.focus();
}
this._opened=false;
}
}});
_1.declare("dijit.form.ComboButton",dijit.form.DropDownButton,{templateString:"<table class='dijit dijitReset dijitInline dijitLeft'\n\tcellspacing='0' cellpadding='0'\n\tdojoAttachEvent=\"onmouseenter:_onMouse,onmouseleave:_onMouse,onmousedown:_onMouse\">\n\t<tr>\n\t\t<td\tclass=\"dijitStretch dijitButtonContents dijitButtonNode\"\n\t\t\ttabIndex=\"${tabIndex}\"\n\t\t\tdojoAttachEvent=\"ondijitclick:_onButtonClick\"  dojoAttachPoint=\"titleNode\"\n\t\t\twaiRole=\"button\" waiState=\"labelledby-${id}_label\">\n\t\t\t<div class=\"dijitInline ${iconClass}\" dojoAttachPoint=\"iconNode\"></div>\n\t\t\t<span class=\"dijitButtonText\" id=\"${id}_label\" dojoAttachPoint=\"containerNode\">${label}</span>\n\t\t</td>\n\t\t<td class='dijitReset dijitRight dijitButtonNode dijitDownArrowButton'\n\t\t\tdojoAttachPoint=\"popupStateNode,focusNode\"\n\t\t\tdojoAttachEvent=\"ondijitclick:_onArrowClick, onkeypress:_onKey\"\n\t\t\tstateModifier=\"DownArrow\"\n\t\t\ttitle=\"${optionsTitle}\" name=\"${name}\"\n\t\t\twaiRole=\"button\" waiState=\"haspopup-true\"\n\t\t><div waiRole=\"presentation\">&#9660;</div>\n\t</td></tr>\n</table>\n",attributeMap:_1.mixin(_1.clone(dijit.form._FormWidget.prototype.attributeMap),{id:"",name:""}),optionsTitle:"",baseClass:"dijitComboButton",_focusedNode:null,postCreate:function(){
this.inherited(arguments);
this._focalNodes=[this.titleNode,this.popupStateNode];
_1.forEach(this._focalNodes,_1.hitch(this,function(_51){
if(_1.isIE){
this.connect(_51,"onactivate",this._onNodeFocus);
}else{
this.connect(_51,"onfocus",this._onNodeFocus);
}
}));
},focusFocalNode:function(_52){
this._focusedNode=_52;
dijit.focus(_52);
},hasNextFocalNode:function(){
return this._focusedNode!==this.getFocalNodes()[1];
},focusNext:function(){
this._focusedNode=this.getFocalNodes()[this._focusedNode?1:0];
dijit.focus(this._focusedNode);
},hasPrevFocalNode:function(){
return this._focusedNode!==this.getFocalNodes()[0];
},focusPrev:function(){
this._focusedNode=this.getFocalNodes()[this._focusedNode?0:1];
dijit.focus(this._focusedNode);
},getFocalNodes:function(){
return this._focalNodes;
},_onNodeFocus:function(evt){
this._focusedNode=evt.currentTarget;
},_onBlur:function(evt){
this.inherited(arguments);
this._focusedNode=null;
}});
_1.declare("dijit.form.ToggleButton",dijit.form.Button,{baseClass:"dijitToggleButton",checked:false,_clicked:function(evt){
this.setChecked(!this.checked);
},setChecked:function(_56){
this.checked=_56;
dijit.setWaiState(this.focusNode||this.domNode,"pressed",this.checked);
this._setStateClass();
this.onChange(_56);
}});
}
if(!_1._hasResource["mq.widget.LocationListItem"]){
_1._hasResource["mq.widget.LocationListItem"]=true;
_1.provide("mq.widget.LocationListItem");
_1.declare("mq.widget.LocationListItem",[dijit._Widget,dijit._Templated],{templateString:"<div class=\"locationListItem\" id=\"location${strIndex}\" haslayout=\"true\">\n\t<div class=\"locDiv\" id=\"locDiv${strIndex}\">\n\t\t<div class=\"dirIcons\">\n\t\t\t${iconImage}\n\t\t</div>\n\t\t<div class=\"dirTextRt\">\n\t\t\t<span dojoAttachPoint=\"addressText\" class=\"h5\"></span>\n\t\t\t<ul class=\"gLinks\">\n\t\t\t\t<li dojoAttachPoint=\"websiteContainer\" class=\"firstli disn\"><a dojoAttachEvent=\"onclick: websiteHandler\">Website</a></li><li dojoAttachPoint=\"searchNearbyLi\"><a dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li><a dojoAttachEvent=\"onclick: zoomToStreetHandler\">Zoom to Street</a></li><li class=\"lastli\"><a dojoAttachEvent=\"onclick: sendToCellHandler\">Send to Cell</a></li><!--<li class=\"lastli\"><a dojoAttachEvent=\"onclick: sendToOnstarHandler\">Send to OnStar</a></li>-->\n\t\t\t</ul>\n\t\t</div>\n\t\t<div class=\"locAlterDiv\">\n\t\t\t<div>\n\t\t\t\t<button class=\"btnSm\" alt=\"remove\" title=\"Edit this Location\" dojoAttachEvent=\"onclick: editHandler\">\n\t\t\t\t\t<div>Edit</div>\n\t\t\t\t</button>\n\t\t\t\t<button class=\"btnSm\" alt=\"remove\" title=\"Remove this Location\" dojoAttachPoint=\"removeImage\" dojoAttachEvent=\"onclick: removeHandler\">\n\t\t\t\t\t<div>Remove <img height=\"8\" width=\"8\" src=\"${imagePath}/btn-x.png\"/></div>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div class=\"padt4\">\n\t\t\t\t<button class=\"btnSm\" alt=\"move up\" title=\"Move Location Up\" dojoAttachPoint=\"upImage\" dojoAttachEvent=\"\">\n\t\t\t\t\t<div>Move Up <img height=\"5\" width=\"8\" src=\"${imagePath}/btn-arw_up_on.png\"/></div>\n\t\t\t\t</button>\n\t\t\t\t<button class=\"btnSm\" alt=\"move down\" title=\"Move Location Down\" dojoAttachPoint=\"downImage\" dojoAttachEvent=\"\">\n\t\t\t\t\t<div>Move Down <img height=\"5\" width=\"8\" src=\"${imagePath}/btn-arw_dwn_on.png\"/></div>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"clearb\"></div>\n\t</div>\n\t<div id=\"locEditDiv${strIndex}\"></div>\n\t<div id=\"routeNarrative${strIndex}\"></div>\n</div>\n",strIndex:"0",position:0,listSize:0,location:null,imagePath:mqPrefix+"/cdn/images",iconPattern:"stop_{VAR}.png",postMixInProperties:function(){
this.strIndex=""+(this.position);
icon=this.iconPattern.replace("{VAR}",this.position);
this.iconImage=mq.util.setImagePng(this.imagePath+"/icons/"+icon,29,29);
debug("iconImage: "+this.iconImage);
},postCreate:function(){
var sb=[];
if(this.location.name){
sb.push(this.location.name+"&nbsp;");
}
if(this.location.title){
sb.push(this.location.title+"&nbsp;");
}
if(this.location.addressLine1){
sb.push(this.location.addressLine1+",&nbsp;");
}
if(this.location.county){
if(!this.location.city&&!this.location.postalCode){
sb.push(this.location.county+"&nbsp;");
}
}
var sb2=[];
if(this.location.city){
sb2.push(this.location.city);
}
if(this.location.state){
if(this.location.city||this.location.county){
sb2.push(", ");
}
sb2.push(this.location.state+"&nbsp;");
}
if(this.location.postalCode){
if(this.location.city||this.location.state){
sb.push("  ");
}
sb2.push(this.location.postalCode+"&nbsp;");
}else{
if(this.location.city||this.location.state){
}
}
if(sb2.join("").length==0){
sb2.push(this.location.country+"&nbsp;");
}
sb.push(sb2.join(""));
if(sb.length>1&&sb[0]!="  "&&sb[0]!=""&&sb[1]!=""){
for(var i=1;i<sb.length;i++){
if(sb[i]!=""){
sb[i]="<span class=\"n\">"+sb[i]+"</span>";
}
}
}
if(this.location.phoneNumber){
sb.push("&nbsp;<span class=\"nowrap\">-&nbsp;"+mq.util.formatPhoneNumber(this.location.phoneNumber)+"&nbsp;</span>");
}
if(this.location.website){
this.websiteContainer.style.display="inline";
}else{
this.websiteContainer.style.display="none";
this.searchNearbyLi.className="firstli";
}
var sbS=sb.join("");
if(sbS.substring(sbS.length-5,sbS.length)=="<br/>"){
sbS=sbS.substring(0,sbS.length-5);
}
this.addressText.innerHTML=sbS;
this.handleListEvent();
},handleListEvent:function(){
if(this.listSize<2){
this.disableMoveButton(this.upImage);
this.disableMoveButton(this.downImage);
return;
}
if(this.position==0){
_1.connect(this.downImage,"onclick",this,"moveDownHandler");
this.disableMoveButton(this.upImage);
}
if(this.position>0&&this.position<this.listSize-1){
_1.connect(this.upImage,"onclick",this,"moveUpHandler");
_1.connect(this.downImage,"onclick",this,"moveDownHandler");
}
if(this.position==(this.listSize-1)){
_1.connect(this.upImage,"onclick",this,"moveUpHandler");
this.disableMoveButton(this.downImage);
}
},disableMoveButton:function(_5b){
_5b.style.filter="alpha(opacity=30)";
_5b.style.opacity=".30";
_5b.style.cursor="default";
},removeHandler:function(evt){
debug("Remove Location: "+this.position);
ua.a(":MQ08Delete");
this.onRemove(this.position);
},editHandler:function(evt){
this.onEdit(this.position);
},moveUpHandler:function(evt){
mq.showLoadingImage();
ua.a(":MQ08ReorderUp");
this.onMoveUp(this.position);
},moveDownHandler:function(evt){
mq.showLoadingImage();
ua.a(":MQ08ReorderDown");
this.onMoveDown(this.position);
},searchNearbyHandler:function(evt){
controller.clearBusinessLocator();
mq.showSearchNearby(evt.currentTarget,this.location);
},websiteHandler:function(evt){
ua.a(":MQ08Website");
var _62=this.location.website;
if(_62.indexOf("http:")==-1){
_62="http://"+_62;
}
mq.fullWindow(_62,"locationWebsite");
},zoomToStreetHandler:function(evt){
this.onZoomToStreet(this.location);
},sendToCellHandler:function(evt){
ua.a(":MQ08LOCS2C");
mq.showSTC(this.location);
},sendToOnstarHandler:function(evt){
ua.a(":MQ08LOCS2O");
alert("Send to OnStar: not implemented yet");
},setLocation:function(loc){
this.location=loc;
}});
}
if(!_1._hasResource["mq.widget.SendEmail"]){
_1._hasResource["mq.widget.SendEmail"]=true;
_1.provide("mq.widget.SendEmail");
_1.declare("mq.widget.SendEmail",[dijit._Widget,dijit._Templated],{templateString:"<div id=\"${id}\" class=\"emailPopupWidth\" dojoattachpoint=\"wrapper\">\n  <div id=\"${id}DispContent\" style=\"display:block;\">\n\t<div class=\"popHead\">\n       <div class=\"fltl\"><h2>E-Mail</h2></div>\n      <div class=\"fltr\"><button class=\"btnClose\" dojoAttachEvent='onclick:handleCancel'><span>close</span></button></div>\n    </div>  \n    <br/>\n\n\t<div style=\"display: none; background-image: none; background-color: transparent;\"\n    \t class=\"alert-warning\" id=\"mqpopup-errmsg\">\n\t  <img width=\"22\" height=\"22\" alt=\"warning\" src=\"http://img.mqcdn.com/mqsite2/icon-alert-expoint.gif\"/>\n\t\tInvalid Email Address\n\t</div>\n    \n    <div class=\"fltl\"><span class=\"b\">*To:</span><br/><br/><br/><span class=\"b\">*From:</span></div>\n    <div class=\"fltr\"><input type=\"text\" id=\"sendEmailTo\" style=\"width:175px;\" />\n        <br/><span class=\"caption\">Separate multiple emails with a space</span>\n        <br/><br/><input type=\"text\" id=\"sendEmailFrom\" style=\"width:175px;\" />\n\t       <br/><span class=\"caption\">Your email address (required)</span>\n   \t</div>\n\n    <div class=\"clearb\">\n\t        <span class=\"b\">Subject:</span><br/>\n\t        <input style=\"width:228px;\" type=\"text\" id=\"sendEmailSubject\" /><br/><br/>\n\t        <span class=\"b\">Comments:</span><br/>\n\t        <textarea style=\"width:228px;\" id=\"sendEmailComments\">${pageURL}</textarea><br/><br/>\n\t\t    <div style=\"text-align:center;\"><input type=\"button\" class=\"btn\" value=\"Send\"  dojoAttachEvent='onclick: handleAccept'/></div>\n    </div>\n      <br/>\n      <hr/>\n      <span class=\"b\">* = required fields</span><br/>\n  \t<div id=\"sendEmailPromo\" class=\"textc\" style=\"height:65px;\"></div>\n  </div> \n  <div id=\"${id}Confirmation\" style=\"display:none;\">\n   <div class=\"emailPopupWidth\">\n\t<div class=\"popHead\">\n\t\t<div class=\"fltl\"><h2>E-Mail</h2></div>\n\t\t<div class=\"fltr\"><img src=\"${imagePath}/btn-close.png\" id=\"${id}XIcon\" alt=\"Close\" height=\"16\" width=\"16\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t</div>\n\t<br/>\n\t<div class=\"b\">Congratulations!<br/><br/>\n      \tYour map and comments have been sent.<br/><br/>\n       Thank you for taking a moment to email a MapQuest map. We will make every effort to ensure that your map is received at the e-mail addresses you provided.\n       <br/><br/>\n\t   <div class=\"textc\"><input type=\"button\" class=\"btn\" id=\"${id}CloseButton\" value=\"Close\" dojoAttachEvent='onclick: handleCancel'/></div>    \n\t</div>\n   </div>\n  </div>\n</div>\n",imagePath:mqPrefix+"/cdn/images",pageURL:"",handleAccept:function(){
this.acceptCallback();
},handleCancel:function(){
ua.a(":MQ08EmailClose");
},postCreate:function(){
var _67=_1.hitch(this,"handlePromoPopupCallback");
UIService.generatePromo("mainui-email-popup",_67);
this.inherited("postCreate",arguments);
},handlePromoPopupCallback:function(_68){
if($d("sendEmailPromo")){
$d("sendEmailPromo").innerHTML=_68;
}else{
debug("coulndt load promo");
}
}});
}
if(!_1._hasResource["mq.widget.LinkToPage"]){
_1._hasResource["mq.widget.LinkToPage"]=true;
_1.provide("mq.widget.LinkToPage");
_1.declare("mq.widget.LinkToPage",[dijit._Widget,dijit._Templated],{templateString:"<div id=\"${id}\" class=\"linktothis\" widgetId=\"${id}\">\n\t&nbsp;&nbsp;Link to this Page:\n\t<input type=\"text\" value=\"${defaultMessage}\" class=\"lttpInput\"\n\tdojoAttachEvent=\"onfocus: update, onblur: blur, click: cancelEvent\" dojoAttachPoint=\"node\"/>\n</div>\n",defaultMessage:location.protocol+"//"+location.host+"/mq/...",imagePath:mqPrefix+"/cdn/images",postCreate:function(){
var my=this;
window.setTimeout(function(){
my.listenForPanZoom();
my.resize();
},1000);
},lttpState:false,initialState:true,update:function(){
if(this.lttpState!=controller._model){
var mv=view.mapView;
var my=this;
mv.saveTinyURL(function(_6c,_6d){
my.lttpState=controller._model;
my.lttpLastValue=my.node.value=mv.getTinyUrl(_6c);
my.resize();
my.select();
});
}else{
this.node.value=this.lttpLastValue;
}
this.resize();
this.select();
ua.a(":MQ08LTTP");
},blur:function(){
this.node.value=this.defaultMessage;
this.resize();
},resize:function(){
if(_1.isSafari){
this.node.style.width="";
this.node.style.width=this.node.scrollWidth+"px";
return;
}
this.node.size=this.node.value.length;
if(this.node.value.match(/\.$/)){
this.node.size-=5;
}
},select:function(){
this.node.select();
},cancelEvent:function(evt){
return evt.returnValue=false;
},listenForPanZoom:function(){
if(this.listening){
return;
}
this.listening=true;
var my=this;
_1.connect(controller,"panZoomChange",function(){
my.lttpLastValue=my.lttpState=my.initialState=false;
my.node.blur();
});
}});
}
if(!_1._hasResource["mq.widget.SendToGPS"]){
_1._hasResource["mq.widget.SendToGPS"]=true;
_1.provide("mq.widget.SendToGPS");
_1.declare("mq.widget.SendToGPS",[dijit._Widget,dijit._Templated],{templateString:"<div id=\"${id}\" class=\"stgPopupWidth\" dojoattachpoint=\"wrapper\">\n  <div id=\"${id}DispContent\" class=\"\" style=\"display:block;\">\n\t<div class=\"popHead\">\n\t\t<div class=\"fltl\"><h2>Send to Garmin<span class=\"tm\">TM</span> GPS <span class=\"red\">Beta!</span></h2></div>\n\t    <div class=\"fltr\"><img src=\"${imagePath}/btn-close.png\" alt=\"Close\" height=\"16\" width=\"16\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t</div>\n\t<div class=\"clearb\">\n\t   <div style=\"display:${noPluginFoundDisplay}\" class=\"stgPopupWidth\">\n\t   \t\t<span id=\"errorMessage\">${errorMessage}</span>\n\t\t   \t<div class=\"textc\"><input type=\"button\" class=\"btn\" value=\"Close\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t   </div>\n\t   <div style=\"display:${noDevicesFoundDisplay}\" class=\"stgPopupWidth\">\n\t\t  \tThere were no gps devices found, please connect your device, turn it on and try again.<br/><br/>\n\t\t   \t<div class=\"textc\"><input type=\"button\" class=\"btn\" value=\"Close\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t   </div>\n\t   <div style=\"display:${detailsDisplay};\" class=\"stgPopupWidth\">\n\t\t\t\n\t   \t   <form action=\"\" id=\"STGDevice\" name=\"STGDevice\">\n\t   \t\t<div id=\"devices\"><span class=\"b\">Device:</span> ${devices}</div>\n\t   \t\t<div id=\"userInput\" style=\"text-align:center;valign:center;display:${inputDisplay}\">\n\t   \t\t\t<div id=\"fn\">Filename:<input type=\"text\" id=\"fileName\"/></div>\n\t   \t\t\t<div id=\"route\" style=\";margin-left:44px;padding-top:8px;\">\n\t   \t\t\t\t<input type=\"radio\" name=\"ro\" value=\"route\" checked>&nbsp;&nbsp;Route\n\t   \t\t\t\t<input type=\"radio\" name=\"ro\" value=\"waypoints\">&nbsp;&nbsp;Waypoints Only\n\t   \t\t\t</div>\n\t   \t\t</div>\n\t   \t\t<br/>\n\t   \t\t<br/>\n\t   \t\t<div id=\"stcDetails\" style=\"height:${addrSummaryHeight}px; overflow-Y:${addrSummaryOverflowY};overflow-X:hidden;\">${details}</div>\n\t\t   \t<br/>\n\t\t   \t<div class=\"textc\"><input type=\"button\" class=\"btn\" id=\"STGSendButton\" value=\"Send\" dojoAttachEvent='onclick: handleSend'/></div>\n\t\t   </form>\n\t\t   <br/>\n\t\t   <div style=\"text-align:center;valign:center\">\n\t\t   \t\t<img src=\"${imagePath}/gps/Garmin-logo.png\" height=\"26\" width=\"96\"/><br/>\n\t\t   \t\tPowered by <a href=\"http://www.garmin.com/products/communicator/\">Garmin Communicator</a></span>\n\t\t   </div>\n\t\t   \n\t   \t</div>\n \t</div><br/>\n  </div>\n  \n  <div id=\"${id}ConfirmationSuccess\" style=\"display:none;\">\n     <div class=\"stgPopupWidth\">\n\t   <div class=\"popHead\">\n\t       <div class=\"fltl\"><h2>Send to GPS <span class=\"red\">Beta!</span></h2></div>\n\t       <div class=\"fltr\"><img src=\"${imagePath}/btn-close.png\" alt=\"Close\" height=\"16\" width=\"16\" id=\"xicon\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t   </div>\n\t   <br/>\n\t   <div class=\"b\">\n\t   \t\t<div class=\"stgPopupWidth\">\n\t         Congratulations!<br/><br/>\n\t         Your GPS device has been updated.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    \n\t        </div>\n\t        <br/><br/>\n\t        <div class=\"textc\"><input type=\"button\" value=\"Close\" id=\"closeButton\" class=\"btn\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t        <br/><br/>\t\n      </div>\n    </div> \n  </div>\n  \n  <div id=\"${id}ConfirmationFailure\" style=\"display:none;\">\n     <div class=\"stgPopupWidth\">\n\t   <div class=\"popHead\">\n\t       <div class=\"fltl\"><h2>Send to GPS <span class=\"red\">Beta!</span></h2></div>\n\t       <div class=\"fltr\"><img src=\"${imagePath}/btn-close.png\" alt=\"Close\" height=\"16\" width=\"16\" id=\"xicon\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t   </div>\n\t   <br/>\n\t   <div class=\"b\">\n\t   \t\t<div class=\"stgPopupWidth\">\n\t         Failure<br/><br/>\n\t         We were unable to update your GPS.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\t         <div id=\"stgError\"></div>   \n\t        </div>\n\t        <br/><br/>\n\t        <div class=\"textc\"><input type=\"button\" value=\"Close\" id=\"closeButton\" class=\"btn\" dojoAttachEvent='onclick: handleCancel'/></div>\n\t        <br/><br/>\t\n      </div>\n    </div>\n\n</div>\n\n\n",imagePath:mqPrefix+"/cdn/images",location:null,details:"",gps:"",devices:"",errorMessage:"",detailsDisplay:"none",noPluginFoundDisplay:"none",noDevicesFoundDisplay:"none",inputDisplay:"none",addrSummaryHeight:0,addrSummaryOverflowY:"hidden",postCreate:function(){
this.inherited("postCreate",arguments);
},formatLocation:function(loc,_71){
var sb=new dojox.string.Builder();
sb.append("<div class='stcLoc' style='visibility:none;'>").append(mq.util.setImagePng(this.imagePath+"/icons/stop_"+_71+".png",29,29)).append("<p class='stcLocSum'>").append(mq.util.formatLocationSummary(loc)).append("</p>").append("</div><br/>");
return sb.toString();
},postMixInProperties:function(){
if(this.gps.result&&this.gps.result.loadError){
this.noPluginFoundDisplay="";
this.errorMessage=this.gps.result.msg;
}else{
if(this.gps.gpsController.getDevicesCount()==0){
this.noDevicesFoundDisplay="";
}else{
var _73=controller._model.locations;
this.detailsDisplay="";
if(this.gps.supportsRoutes(0)&&(_73&&_73.length>1)){
this.inputDisplay="";
}
var d=this.gps.gpsController.getDevices();
var _75="";
if(d.length==1){
_75+=d[0].getDisplayName()+"<br/>";
_75+="<select id='deviceSelector' style='display:none'>";
}else{
_75+="<select id='deviceSelector'>";
}
for(i=0;i<d.length;i++){
_75+="<option name=\""+i+"\">"+d[i].getDisplayName()+"</option>";
}
_75+="</select><br/><br/>";
this.devices=_75;
if(this.location&&this.location.postalCode){
var _77=this.formatLocation(this.location,0);
this.details=_77;
this.addrSummaryHeight=mq.getPopupContentWidthHeight(this.details).height;
}else{
if(_73!=undefined&&_73.length>0){
var sb=new dojox.string.Builder();
for(var i=0;i<_73.length;i++){
sb.append(this.formatLocation(_73[i].location,i));
}
this.details=sb.toString();
this.addrSummaryHeight=mq.getPopupContentWidthHeight(this.details).height;
if(this.addrSummaryHeight>100){
this.addrSummaryHeight=100;
this.addrSummaryOverflowY="scroll";
}
}
}
}
}
},handleSend:function(){
var _79=$d("deviceSelector").selectedIndex;
if($d("fileName").value!=""){
this.gps.fileName=$d("fileName").value;
}
var _7a=this.gps.supportsRoutes(_79);
if(!_7a){
this.gps.waypointsOnly=true;
}else{
if(document.STGDevice.ro[0].checked){
this.gps.waypointsOnly=false;
}else{
this.gps.waypointsOnly=true;
}
}
if(this.location||!_7a){
if(this.location){
this.writeData([this.location],_79);
}else{
var _7b=[];
for(var i=0;i<controller._model.locations.length;i++){
_7b[i]=controller._model.locations[i].location;
}
this.writeData(_7b,_79);
}
}else{
var _7b=[];
for(var i=0;i<controller._model.locations.length;i++){
_7b[i]=controller._model.locations[i].location;
}
this.writeData(_7b,_79,controller._model.routeOptions);
}
},handleDetails:function(_7d){
if(_7d&&_7d.resultCode==0){
var _7e=[];
for(var i=0;i<controller._model.locations.length;i++){
_7e[i]=controller._model.locations[i].location;
}
var _80=$d("deviceSelector").selectedIndex;
this.writeData(_7e,_80,_7d);
}
},writeData:function(_81,_82,_83){
this.gps.writePOIs(_81,_82,_83);
},handleAccept:function(){
},handleCancel:function(){
},hide:function(){
}});
}
if(!_1._hasResource["mq.uicontroller"]){
_1._hasResource["mq.uicontroller"]=true;
_1.provide("mq.uicontroller");
_1.declare("mq.UIController",null,{constructor:function(_84){
debug("Initialize: "+_84);
if(_84==null){
this._model={showRoute:false,mode:"MAPS"};
}else{
debug("2. "+_84.showRoute);
this._model=_84;
if(_84.locations){
for(var i=0;i<_84.locations.length;i++){
mq.savedandrecent.addRecentLocation(_84.locations[i].location);
}
}
if(!_84.routeResults){
this.calculateRoute();
}
}
var c=this;
window.historyTimer=setInterval(function(){
if(!c.delaySaveState){
var _87=window.location.hash.substring(1);
c.handleNavigation(_87);
}
},this.stateUpdateInterval);
var _88=(_1.isSafari)?16:4;
window.setTimeout(function(){
c.origModelStr=mq.util.modelToString(window.model);
},this.stateUpdateInterval*_88);
if(_1.isSafari==2){
this.delaySaveState=true;
}
},origServerResults:window.serverResults,origModelStr:false,winLoc:location.protocol+"//"+location.host+location.pathname+location.search,defaultLocation:null,delimiter:":",autoHashed:false,stateUpdateInterval:500,exportModel:function(){
return mq.util.modelToString(this._model);
},importModel:function(str){
debug("UIController.importModel");
this._model=window.model=mq.util.hashToModel(str.substring(2));
if(this._model.showRoute){
this.calculateRoute();
}else{
this.onModelUpdate(this._model);
}
},onResetSearchAttributes:function(){
},addLocation:function(loc,_8b){
debug("UIController.addLocation: "+_8b);
this._model.mode="MAPS";
this.resetMap();
if(this._model.locations==null){
this._model.locations=[];
}
if(_8b==null){
_8b=this._model.locations.length;
}
if(this._model.locations.length==1){
this._model.showRoute=true;
}
var _8c={};
_8c.location=loc;
_8c.mapOrder=_8b;
this._model.locations[_8b]=_8c;
this.calculateRoute();
this.saveState();
this.updateCookie(loc);
},addLocations:function(_8d){
debug("UIController.addLocations: "+_8d.length);
this._model.mode="MAPS";
this.resetMap();
this._model.locations=null;
this._model.locations=[];
for(var i=0;i<_8d.length;i++){
var loc=_8d[i];
var _90={};
_90.location=loc;
_90.mapOrder=i;
this._model.locations.push(_90);
this.updateCookie(loc);
}
this.showRoute(_8d.length>1);
this.calculateRoute();
this.saveState();
},removeLocation:function(_91){
this._model.locations.splice(_91,1);
if(this._model.locations.length==0){
this._model.locations=null;
}
this.resetMap();
this.calculateRoute();
this.saveState();
},moveUp:function(_92){
this.resetMap();
var l1=this._model.locations[_92];
l1.mapOrder--;
var l2=this._model.locations[_92-1];
l2.mapOrder++;
this._model.locations.splice(_92-1,2,l1,l2);
this.calculateRoute();
this.saveState();
},moveDown:function(_95){
this.resetMap();
var l1=this._model.locations[_95];
l1.mapOrder++;
var l2=this._model.locations[parseInt(_95)+1];
l2.mapOrder--;
this._model.locations.splice(_95,2,l2,l1);
this.calculateRoute();
this.saveState();
},reorder:function(_98){
this.resetMap();
for(i=0;i<_98.length;i++){
var _99={};
_99.location=_98[i];
_99.mapOrder=i;
this._model.locations[i]=_99;
}
this.calculateRoute();
this.saveState();
},showRoute:function(_9a){
this._model.showRoute=_9a;
},toggleRoute:function(){
debug("UIController.toggleRoute");
if(this._model.showRoute){
ua.a(":MQ08RouteOff");
this._model.showRoute=false;
this._model.routeResults=null;
}else{
ua.a(":MQ08RouteOn");
this._model.showRoute=true;
}
this.calculateRoute();
this.saveState();
},togglePrint:function(_9b){
this._model.printerFriendly=_9b;
this.saveState();
},calculateRoute:function(){
debug("UIController.calculateRoute: "+this._model.showRoute);
var _9c=_1.clone(this._model);
if(this._model.showRoute==false){
this.handleRoute(_9c,null);
return;
}
if(this._model.locations==null||this._model.locations.length<2){
this._model.routeResults=null;
this.handleRoute(_9c,null);
return;
}
var _9d=_1.hitch(this,"handleRoute",_9c);
var _9e=[];
for(var i=0;i<this._model.locations.length;i++){
_9e[i]=this._model.locations[i].location;
}
if(this._model.routeOptions==null){
this._model.routeOptions={};
this._model.routeOptions.routeType="FASTEST";
}
var _a0="";
if(this._model.routeResults!=null&&this._model.routeResults.sessionId!=null){
_a0=this._model.routeResults.sessionId;
}
try{
UIService.route(_9e,this._model.routeOptions,_a0,_9d);
}
catch(e){
console.error("Error contacting route server.");
}
},handleRoute:function(_a1,_a2){
debug("UIController.handleRoute");
if(_a2&&_a2.resultCode!=0){
debug("Route Failed: "+_a1);
this._model=_a1;
if(!this._model.routeResults){
this._model.routeResults={};
}
this._model.routeResults.resultMessages=_a2.resultMessages;
this._model.routeResults.resultCode=_a2.resultCode;
if(_a1.routeOptions){
var _a3=_a1.routeOptions.lastRequestedAvoidGEFS;
if(_a3){
if(!this._model.routeResults.unavoidableGEFIDs){
this._model.routeResults.unavoidableGEFIDs=[];
}
for(var i=0;i<_a3.length;i++){
this._model.routeResults.unavoidableGEFIDs.push(_a3[i]);
this._model.routeOptions.avoidGEFIDList=mq.util.removeFromArray(this._model.routeOptions.avoidGEFIDList,_a3[i]);
}
if(this._model.routeOptions.lastRequestedAvoidTrekAndMan){
var _a5=this._model.routeResults.treks[this._model.routeOptions.lastRequestedAvoidTrekAndMan[0]];
var man=_a5.maneuvers[this._model.routeOptions.lastRequestedAvoidTrekAndMan[1]];
man.message="MSG_UNABLE_TO_AVOID";
this._model.routeResults.wasAvoidError=true;
}
}
}
this.saveState();
}else{
this._model.routeResults=_a2;
}
this.onModelUpdate(this._model);
},showAvoidsRestoreLink:function(){
var _a7=false;
if(this._model.routeOptions&&this._model.routeOptions.avoidGEFIDList){
if(this._model.routeResults&&this._model.routeResults.unavoidableGEFIDs){
if(this._model.routeResults.unavoidableGEFIDs.toString()!=this._model.routeOptions.avoidGEFIDList.toString()&&this._model.routeOptions.avoidGEFIDList.length>0){
_a7=true;
}
}else{
if(this._model.routeOptions.avoidGEFIDList&&this._model.routeOptions.avoidGEFIDList.length>0){
_a7=true;
}
}
}
return _a7;
},reverseRoute:function(){
debug("UIController.reverseRoute");
ua.a(":MQ08ReverseRoute");
this.resetMap();
if(this._model.locations!=null){
this._model.locations.reverse();
this.calculateRoute();
this.saveState();
}
},avoidRouteSegment:function(_a8,_a9){
debug("UIController.avoidRouteSegment:"+_a8+"-"+_a9);
var man=this._model.routeResults.treks[_a8].maneuvers[_a9];
if(this._model.routeOptions==null){
this._model.routeOptions={};
}
if(this._model.routeOptions.avoidGEFIDList==null){
this._model.routeOptions.avoidGEFIDList=[];
}
this._model.routeOptions.lastRequestedAvoidGEFS=[];
this._model.routeOptions.lastRequestedAvoidTrekAndMan=[_a8,_a9];
for(var i=0;i<man.GEFIDs.length;i++){
this._model.routeOptions.avoidGEFIDList.push(man.GEFIDs[i]);
this._model.routeOptions.lastRequestedAvoidGEFS.push(man.GEFIDs[i]);
}
debug("UIController.avoidRouteSegment: "+this._model.routeOptions.avoidGEFIDList.length);
this.calculateRoute();
this.saveState();
},removeAvoidSegments:function(){
ua.a(":MQ08RestoreAvoid");
this._model.routeOptions.avoidGEFIDList=null;
this._model.showRoute=true;
this.calculateRoute();
this.saveState();
if($d("avoidRestore")){
$d("avoidRestore").style.display="none";
}
},clearAllLocations:function(){
debug("UIConroller.clearAllLocations()!");
this.clearAllLocationObjects();
this.calculateRoute();
this.saveState();
},clearAllLocationObjects:function(){
this._model.locations=null;
this._model.routeResults=null;
this._model.centerLatitude=this._model.centerLongitude=null;
},modeChange:function(_ac){
debug("UIController.modeChange: "+_ac);
this._model.mode=_ac;
this.saveState();
},viewTypeChange:function(_ad){
debug("UIController.viewTypeChange");
this._model.viewType=_ad;
this.saveState();
},panZoomChange:function(_ae,_af){
debug("UIController.panZoomChange: "+_ae);
this._model.zoomLevel=_ae;
this._model.centerLatitude=_af.getLatitude();
this._model.centerLongitude=_af.getLongitude();
},resetMap:function(){
debug("UIController.resetMap");
this._model.centerLatitude=null;
this._model.centerLongitude=null;
this._model.zoomLevel=null;
},updateSearch:function(loc,_b1,_b2){
debug("UIController.updateSearch");
this.resetMap();
this._model.mode="SEARCH";
this._model.searchLocation=loc;
this._model.searchResults=_b1;
this._model.searchOptions=_b2;
this.saveState();
this.onModelUpdate(this._model);
},onModelUpdate:function(_b3){
debug("UIController.onModelUpdate");
},onGutterUpdate:function(){
debug("UIController.onGutterUpdate");
},rerunRoute:function(){
this.resetMap();
if(this._model.locations!=null){
if(this._model.routeOptions&&this._model.routeOptions.reverseRoute){
this._model.locations.reverse();
this._model.routeOptions.reverseRoute=false;
}
}
this.calculateRoute();
this.saveState();
},onSearchResults:function(_b4,_b5){
},delaySaveState:false,saveState:function(){
if(!this.delaySaveState){
var c=this;
c.delaySaveState=setTimeout(function(){
c.delaySaveState=false;
c.saveHistory();
},this.stateUpdateInterval);
}
},createState:function(){
var _b7=this._model!=null?mq.util.modelToString(this._model):"a/maps/io:0/e";
return _b7;
},saveMapGutterState:function(_b8){
},setMapGutterState:function(_b9){
this._model.mapGutterState=_b9;
},saveSearchGutterState:function(_ba){
},setSearchGutterState:function(_bb){
this._model.searchGutterState=_bb;
},syncGutterState:function(_bc){
this.setMapGutterState(_bc);
this.setSearchGutterState(_bc);
this.saveState();
},updateCookie:function(loc){
mq.savedandrecent.addRecentLocation(loc);
},maxUrlLength:2045,saveHistory:function(){
var _be=_1.isIE||_1.isSafari==2;
var _bf=this.createState();
debug("Model State: "+_bf);
if(_bf.indexOf("a//")==0){
return;
}
if((this.winLoc+_bf).length<this.maxUrlLength){
window.location.hash=_bf;
}else{
this.origModelStr=_bf;
_be=true;
}
this.modelStrCache=_bf;
if(_be){
$d("iframe_history").contentWindow.location.search="state="+_bf;
}
},handleNavigation:function(_c0){
if(!_c0){
if(serverResults){
if(!_1.isSafari){
window.history.go(-1);
}
return;
}
_c0=this.origModelStr;
}
if(_c0!=this.modelStrCache&&this.modelStrCache){
if((_1.isIE||_1.isSafari==2)&&(this.winLoc+_c0).length<this.maxUrlLength){
window.location.hash=_c0;
}
this.importModel(this.modelStrCache=_c0);
}
},numLocs:function(){
var val=0;
try{
if(this._model&&this._model.locations){
val=this._model.locations.length;
}
}
catch(e){
}
return val;
},adUserStateFromModel:function(){
var m=this._model,i,loc,_c5=[],_c6=[],_c7=[];
var vp=dijit.getViewport();
var us={locations:_c5,searches:_c6,treks:_c7,routeDistance:m.routeResults?m.routeResults.distance:null,mainUiShowRouting:!!m.showRoute,mapViewType:m.viewType,mapZoomLevel:m.zoomLevel,viewport:{left:vp.l,top:vp.t,width:vp.w,height:vp.h},url:document.URL,referrer:document.referrer,useragent:window.navigator.userAgent};
if(m.locations){
for(i=0;i<m.locations.length;i++){
loc=m.locations[i];
if(loc){
loc=loc.location;
}
if(!loc){
continue;
}
var _ca=loc.sicCodesCommaNames;
var cat="";
try{
if(_ca){
cat=_ca.split(/,/)[1].split(/#/)[0].replace("(All) ","");
}
}
catch(e){
console.warn("Error parsing category: "+_ca);
}
_c5.push({role:"stop",stopNumber:i+1,city:loc.city,state:loc.state,country:loc.country,postalCode:loc.postalCode,lattitude:loc.latitude||NaN,longitude:loc.longitude||NaN,category:cat});
}
}
if(m.routeResults&&m.routeResults.treks){
for(i=0;i<m.routeResults.treks.length;i++){
_c7.push(m.routeResults.treks[i].distance);
}
}
_c5.push({role:"mapcenter",lattitude:m.centerLatitude||NaN,longitude:m.centerLongitude||NaN});
if(m.searchLocation){
loc=m.searchLocation;
_c6.push({searchText:loc.query,searchCategory:m.searchCategory,searchRelativeTo:{role:"search",city:loc.city,state:loc.state,country:loc.country,postalCode:loc.postalCode,lattitude:loc.latitude||NaN,longitude:loc.longitude||NaN}});
}
return us;
},clearBusinessLocator:function(){
this._model.blId=null;
this._model.blColor=null;
},clearSearchObjects:function(){
debug("UIConroller.clearSearchObjects()!");
this._model.searchLocation=null;
this._model.searchOptions=null;
this._model.searchResults=null;
},clearSearch:function(){
debug("UIConroller.clearSearch()!");
this.clearSearchObjects();
this.calculateRoute();
this.saveState();
},sendToCell:function(){
debug("sendToCell called");
},addGPSData:function(_cc){
if(_cc&&_cc.length>0){
this._model.locations=[];
for(i=0;i<_cc.length;i++){
var _cd={};
_cd.mapOrder=i;
_cd.location=_cc[i];
this._model.locations[i]=_cd;
}
this.saveState();
this.onModelUpdate(this._model);
}
}});
}
if(!_1._hasResource["mq.tabview"]){
_1._hasResource["mq.tabview"]=true;
_1.provide("mq.tabview");
_1.declare("mq.TabView",null,{constructor:function(_ce,_cf){
this._controller=_ce;
this._idList=_cf;
},alphabet:["A","B","C","D","E","F","G","H","I","J"],zoomLevels:{"MAX":14,"MIN":2,"ADDRESS":12,"INTERSECTION":12,"STREET":12,"ZIP":10,"CITY":7,"COUNTY":6,"STATE":4,"COUNTRY":2},tabState:{map:"MAP",normal:"NORMAL",text:"TEXT"},imagePath:"/cdn/images",iconPattern:"",iconWidth:29,iconHeight:29,iconOffsetX:-16,iconOffsetY:-16,initMap:function(loc,_d1,_d2){
if(_d1==null){
_d1="map";
}
if(_d2==null){
_d2=this.zoomLevels[loc.geocodeQuality];
}
this._tileMap=new MQA.TileMap($d(this._idList["mapDiv"]),_d2,new MQLatLng(loc.latitude,loc.longitude),_d1);
var _d3=new MQA.LargeZoomControl2(this._tileMap);
this._tileMap.addControl(_d3,new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(0,0)));
var _d4=new MQA.ViewControl2(this._tileMap);
this._tileMap.addControl(_d4,new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT,new MQA.Size(0,0)));
var tc=mq.traffic.makeTrafficControl();
if(tc){
this._tileMap.addControl(tc);
}
this._tileMap.setLogoPlacement(MQA.MapLogo.MAPQUEST,new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_LEFT,new MQA.Size(1,1)));
this._tileMap.setLogoPlacement(MQA.MapLogo.MAPQUEST_COPYRIGHT,new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_RIGHT,new MQA.Size(190,0)));
this._tileMap.setLogoPlacement(MQA.MapLogo.SCALES,new MQA.MapCornerPlacement(MQA.MapCorner.BOTTOM_RIGHT,new MQA.Size(0,20)));
this._tileMap.getDeclutter().setLeaderLineDotMode(1);
this._tileMap.getDeclutter().setDeclutterMode(2);
MQA.EventManager.addListener(this._tileMap,"click",_1.hitch(this,"recenterMap"));
this._tileMap.getRolloverWindow().setFlipStateEnabled(true);
this._tileMap.getRolloverWindow().setTextLength(35);
this._tileMap.setBestFitMargin(25);
},setDefaultMap:function(loc){
this._tileMap.setCenter(new MQLatLng(loc.latitude,loc.longitude));
this._tileMap.setZoomLevel(this.zoomLevels[loc.geocodeQuality]);
},changeMapType:function(evt){
debug("TabView.mapTypeChange: "+evt.mapType);
var _d8=null;
if(evt.mapType=="sat"){
_d8=":MQ08Aerial";
}else{
if(evt.mapType=="hyb"){
_d8=":MQ08Hybrid";
}else{
if(evt.mapType=="map"){
_d8=":MQ08Street";
}
}
}
ua.a(_d8);
this.onMapTypeChange(evt.mapType);
},onMapTypeChange:function(_d9){
},onPanZoomChange:function(_da,_db){
},onRecenter:function(_dc){
},changeZoom:function(evt){
debug("TabView.changeZoom: "+evt.zoom);
this.onPanZoomChange(evt.zoom,this._tileMap.getCenter());
},panMap:function(evt){
debug("TabView.panMap: "+evt.eventName);
pt=new MQA.Point(evt.clientX,evt.clientY);
this.onPanZoomChange(this._tileMap.getZoomLevel(),this._tileMap.getCenter());
},recenterMap:function(evt){
if(!evt.srcObject){
debug("Recenter map");
this._tileMap.slideMapToPoint(evt.xy);
this.onPanZoomChange(this._tileMap.getZoomLevel(),evt.ll);
}
},addPoisToMap:function(_e0){
debug("TabView.addPoisToMap: "+_e0.length);
var _e1=new MQA.PoiCollection();
for(var i=0;i<_e0.length;i++){
var loc=_e0[i].location;
var _e4=new MQA.MapIcon();
icon=this.iconPattern.replace("{VAR}",i);
_e4.setImage(this.imagePath+"/icons/"+icon,this.iconWidth,this.iconHeight,false,false);
_e4.setAnchorOffset(new MQA.Point(this.iconOffsetX,this.iconOffsetY));
var pt=new MQA.Poi(new MQLatLng(loc.latitude,loc.longitude));
pt.setIcon(_e4);
pt.setInfoTitleHTML(mq.util.getMiniPopupContent(loc));
pt.setInfoContentHTML(mq.util.getInfoPopupContent(loc,i,false,true));
pt.setKey("stops-"+unescape("%"+(i+65).toString(16)));
MQA.EventManager.addListener(pt,"infowindowopen",_1.hitch(this,"openInfoWindow"));
_e1.add(pt);
}
this._tileMap.replacePois(_e1);
},addLocationForm:function(_e6,_e7,_e8){
debug("TabView.addLocationForm");
if(!_e6){
_e6=0;
}
_e7="loc"+_e6;
window[_e7+"Form"]=new mq.addnextlocationform({template:"addNextLocation",jsId:_e7+"Form",prefix:_e7,formType:"add",mode:"ajax",parentElem:$d("locationWindowNarr"),searchBoxStartId:_e7+"0-query",locationBoxStartId:_e7+"0-addressInput",locNum:_e6});
},resizeMap:function(){
var _e9=$d(this._idList["mapDiv"]);
var _ea=_1.contentBox(_e9).h;
var _eb=_1.contentBox(_e9).w;
if((_ea!=this._tileMap.getSize().height||_eb!=this._tileMap.getSize().width)&&(!isNaN(_ea)&&!isNaN(_eb))){
_eb=(_eb<0)?(-1*_eb):_eb;
_ea=(_ea<0)?(-1*_ea):_ea;
debug("TabView.resizeMap: "+_eb+","+_ea);
this._tileMap.setSize(new MQA.Size(_eb,_ea));
if(controller._model["trafficEnabled"]){
debug("Refreshing Traffic because of resize");
this._tileMap.controls[MQA.CONTROL_TRAFFIC].getTraffic().refresh();
}
}
},initGutterView:function(){
debug("TabView.initGutterView");
var _ec,_ed;
debug("Mode: "+controller._model.mode);
if(controller._model.mode=="MAPS"){
_ec=controller._model.mapGutterState;
_ed=$d("gutter");
}else{
if(controller._model.mode=="SEARCH"){
debug("initGutterView: SEARCH");
_ec=controller._model.searchGutterState;
_ed=$d("gutterS");
}
}
if(_ec=="NORMAL"){
this._toSplitView(_ed,true);
}else{
if(_ec=="TEXT"){
this._toTextView(_ed,true);
}else{
if(_ec=="MAP"){
this._toMapView(_ed,true);
}else{
this._toSplitView(_ed);
}
}
}
},toggleView:function(evt){
debug("Tabview.toggleView: "+evt.pageY);
gutterHeight=_1.marginBox(evt.currentTarget).h;
gutterTop=_1.coords(evt.currentTarget,true).y;
var _ef=evt.pageY-gutterTop;
var _f0=null;
switch(this.tabView){
case this.tabState.normal:
_f0=(_ef>(gutterHeight/2))?"MAP":"TEXT";
break;
case this.tabState.map:
_f0=(_ef>(gutterHeight/2))?"NORMAL":"TEXT";
break;
case this.tabState.text:
_f0=(_ef>(gutterHeight/2))?"MAP":"NORMAL";
break;
}
this.processChangeView(_f0);
this.gutterUserToggleLogging(_f0,"gutterImage");
},gutterUserToggleLogging:function(_f1,_f2){
(_f2=="gutterTextLink")?_f2="Link":_f2="Gutter";
var _f3;
if(_f1=="NORMAL"){
_f3="Split";
}else{
if(_f1=="TEXT"){
_f3="Exp";
}else{
if(_f1=="MAP"){
_f3="Map";
}
}
}
ua.a(":MQ08"+_f3+_f2);
},processChangeView:function(_f4){
var _f5=this._controller._model;
var _f6;
if(_f5.mode=="MAPS"){
this._controller.saveMapGutterState(_f4);
_f6=$d("gutter");
}else{
if(_f5.mode=="SEARCH"){
this._controller.saveSearchGutterState(_f4);
_f6=$d("gutterS");
}
}
if(_f4=="MAP"){
this._toMapView(_f6,true);
}else{
if(_f4=="NORMAL"){
this._toSplitView(_f6,true);
}else{
if(_f4=="TEXT"){
this._toTextView(_f6,true);
}
}
}
},_toMapView:function(_f7,_f8){
if(this.tabView!=this.tabState.map){
this.hoverOutElem(_f7);
var _f9=mq.util.getPreviousSiblingElement(_f7);
_f9.style.width="";
_1.removeClass(_f9,"leftTab");
_1.removeClass(_f9,"leftTabExpanded");
_1.addClass(_f9,"leftTabClosed");
_1.removeClass(_f7,"gutterExpanded");
_1.addClass(_f7,"gutter");
mq.util.getNextSiblingElement(_f7).style.display="block";
this.tabView=this.tabState.map;
_1.removeClass(_f7,"gutterText");
_1.removeClass(_f7,"gutterNormal");
_1.removeClass(_f7,"gutterNormalMap");
_1.removeClass(_f7,"gutterTextMap");
_1.addClass(_f7,"gutterMap");
if(_f8){
this.mapView();
if(view){
view.resizeLayout();
}
}else{
this.resizeMap();
}
}
},_toTextView:function(_fa,_fb){
if(this.tabView!=this.tabState.text){
this.hoverOutElem(_fa);
var _fc=mq.util.getPreviousSiblingElement(_fa);
_fc.style.width="";
_1.removeClass(_fc,"leftTab");
_1.removeClass(_fc,"leftTabClosed");
_1.addClass(_fc,"leftTabExpanded");
_1.removeClass(_fa,"gutter");
_1.addClass(_fa,"gutterExpanded");
mq.util.getNextSiblingElement(_fa).style.display="none";
this.tabView=this.tabState.text;
_1.removeClass(_fa,"gutterNormal");
_1.removeClass(_fa,"gutterMap");
_1.removeClass(_fa,"gutterNormalRes");
_1.removeClass(_fa,"gutterMapRes");
_1.addClass(_fa,"gutterText");
if(_fb){
if(controller.showAvoidsRestoreLink()){
if($d("avoidRestore")){
$d("avoidRestore").style.display="";
}
}
this.textView();
}
if(view){
view.resizeLayout();
}
}
},_toSplitView:function(_fd,_fe){
debug("TabView._toSplitView: "+_fe);
if(this.tabView!=this.tabState.normal){
this.hoverOutElem(_fd);
if($d("remEditExp")){
$d("remEditExp").style.display="none";
}
if($d("remEditCol")){
$d("remEditCol").style.display="block";
}
var _ff=mq.util.getPreviousSiblingElement(_fd);
_ff.style.width="";
_1.removeClass(_ff,"leftTabClosed");
_1.removeClass(_ff,"leftTabExpanded");
_1.addClass(_ff,"leftTab");
_1.removeClass(_fd,"gutterExpanded");
_1.addClass(_fd,"gutter");
mq.util.getNextSiblingElement(_fd).style.display="block";
this.tabView=this.tabState.normal;
_1.removeClass(_fd,"gutterText");
_1.removeClass(_fd,"gutterMap");
_1.removeClass(_fd,"gutterMapView");
_1.removeClass(_fd,"gutterTextView");
_1.addClass(_fd,"gutterNormal");
if(_fe){
if($d("avoidRestore")){
$d("avoidRestore").style.display="none";
}
this.splitView();
}
}
if(view){
view.resizeLayout();
}
},getDefaultMapLocation:function(){
if(this._controller._model.mode=="MAPS"&&this._controller._model.centerLatitude&&this._controller._model.centerLongitude){
loc={geocodeQuality:"COUNTRY",latitude:this._controller._model.centerLatitude,longitude:this._controller._model.centerLongitude};
}else{
loc=mq.savedandrecent.getDefaultMapLocation();
if(loc&&loc.latitude&&loc.longitude){
loc.geocodeQuality="CITY";
}else{
loc={geocodeQuality:"COUNTRY",latitude:39.527596,longitude:-99.141968};
}
}
return loc;
},validateAddLocation:function(loc){
var _101=true;
if(this._controller._model.locations!=null){
var _102=this._controller._model.locations[this._controller._model.locations.length-1].location;
if(this._controller._model.locations.length>9){
var _103=new dojox.string.Builder();
_103.append("<div class=\"alert-warning\" style=\"display: block;width: 220px;\">");
_103.append("<img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">");
_103.append(mq.getMessage("ERROR_MAX_STOPS")+"<br/><br/>");
_103.append("</div>");
_103=_103.toString();
mq.handleFormErrorPopups(null,_103);
ua.a(":MQ08MaxStops");
_101=false;
}else{
if(_102.latitude==loc.latitude&&_102.longitude==loc.longitude&&_102.name==loc.name){
mq.showErrorPopupForSameAddr(null,mq.getMessage("ERROR_DUPLICATE_PREVIOUS_STOP"));
_101=false;
}
}
}else{
if(serverResults&&serverResults.length==2){
var _104;
if(serverResults[0].locationResult&&(!serverResults[0].availableResultCount||serverResults[0].availableResultCount==0)){
_104=serverResults[0].locationResult;
}else{
_104=serverResults[1].locationResult;
}
if(_104.latitude==loc.latitude&&_104.longitude==loc.longitude&&_104.name==loc.name){
mq.showErrorPopupForSameAddr(null,mq.getMessage("ERROR_DUPLICATE_START_END"));
_101=false;
}
}
}
return _101;
},zoomToStreet:function(loc){
debug("SearchTabView.zoomToStreet");
ua.a(":MQ08ZoomStreetLevel");
this._tileMap.setCenter(new MQLatLng(loc.latitude,loc.longitude));
this._tileMap.setZoomLevel(this.zoomLevels["MAX"]);
if(view.getCurrentMode()=="MAPS"){
mq.util.scrollToElem($d("mapWindow"),500);
}
var _106=window.setTimeout("ua.commit();",800);
},updateRGForm:function(){
debug("TabView.updateRGForm");
if(this._controller._model&&$d("rgform")){
var _107=view.getSelectedRGFormTab();
var _108=(this._controller._model.locations)?this._controller._model.locations:null;
if(_107=="Map"){
this.updateMapForm(_108);
if($d("maps0-query").value!=""&&_1.trim($d("maps0-query").value)!=""){
this.resetDirectionForm();
}
}else{
if(_107=="Directions"){
this.updateDirectionsForm(_108);
}
}
}
},updateDirectionsForm:function(locs){
var _10a=$d("dir0-addressInput");
var _10b=$d("dir0-query");
var _10c=$d("dir1-addressInput");
var _10d=$d("dir1-query");
var _10e=view.getSelectedRGFormTab();
var _10f=view.getCurrentMode();
var _110=(_10b.value!=dirForm.getDefaultQuery());
var _111=(_10d.value!=dirForm.getDefaultQuery());
var _112=(_1.trim(_10a.value)!=""||_10a.value!=dirForm.getDefaultAddress());
var _113=(_1.trim(_10c.value)!=""||_10c.value!=dirForm.getDefaultAddress());
var _114;
var _115=(locs&&locs.length>0)?locs[0].location:null;
var _116=(this._controller._model.searchLocation)?this._controller._model.searchLocation:null;
if(locs&&locs.length>1){
_114=locs[locs.length-1].location;
}
if(_115||_114){
if(_10e=="Directions"&&locs.length==1&&(!_112&&_113)){
_114=_115;
_115=null;
}
if(_115){
_10a.value=mq.formatLocationSingleLine(_115);
_10a.style.color="#000";
if(_115.name){
_10b.value=(mq.startsWith((_115.name).toUpperCase(),"SOURCEVENDOR:"))?dirForm.getDefaultQuery():_115.name;
_10b.style.color="#000";
}else{
_10b.value=dirForm.getDefaultQuery();
_10b.style.color="#666";
}
}else{
_10a.value=dirForm.getDefaultAddress();
}
if(_114){
_10c.value=mq.formatLocationSingleLine(_114);
_10c.style.color="#000";
if(_114.name){
_10d.value=(mq.startsWith((_114.name).toUpperCase(),"SOURCEVENDOR:"))?dirForm.getDefaultQuery():_114.name;
_10d.style.color="#000";
}else{
_10d.value=dirForm.getDefaultQuery();
_10d.style.color="#666";
}
}else{
_10c.value=dirForm.getDefaultAddress();
}
}
if(_116&&_10f=="SEARCH"&&locs==null){
var _117=false;
if(_110&&dirForm&&dirForm.results&&dirForm.results[0]){
var _118=dirForm.results[0].locationResult;
if(_10a){
_10a.value=mq.formatLocationSingleLine(_118);
_10a.style.color="#000";
}
if(_10b){
_10b.value=(_118.query)?_118.query:((_118.name)?_118.name:dirForm.getDefaultQuery());
_10b.style.color="#000";
}
_117=true;
}
if(_111){
var _119=(dirForm.results[1])?dirForm.results[1].locationResult:dirForm.results[0].locationResult;
if(_10c){
_10c.value=mq.formatLocationSingleLine(_119);
_10c.style.color="#000";
}
if(_10d){
_10d.value=_119.query;
_10d.style.color="#000";
}
_117=true;
}
}
debug("updateDirectionsForm end");
},updateMapForm:function(locs){
var _11b=$d("maps0-addressInput");
var _11c=$d("maps0-query");
var _11d=(this._controller._model.searchLocation)?this._controller._model.searchLocation:null;
var _11e=view.getCurrentMode();
if(locs&&locs.length==1){
var loc=locs[0].location;
_11b.value=mq.formatLocationSingleLine(locs[0].location);
_11b.style.color="#000";
if(loc.name){
_11c.value=(mq.startsWith((loc.name).toUpperCase(),"SOURCEVENDOR:"))?mapsForm.getDefaultQuery():loc.name;
_11c.style.color="#000";
}else{
_11c.value=mapsForm.getDefaultQuery();
_11c.style.color="#666";
}
}
if(_11d&&_11e=="SEARCH"&&locs==null){
_11b.value=mq.formatLocationSingleLine(_11d);
_11c.value=(mq.startsWith((_11d.query).toUpperCase(),"SOURCEVENDOR:"))?mapsForm.getDefaultQuery():_11d.query;
_11c.style.color="#000";
}
},updateSearchForm:function(_120,_121){
var _122=$d("search-query");
var _123=$d("search-addressInput");
if(_120){
_123.value=(_120.code)?_120.code:mq.formatLocationSingleLine(_120);
_123.style.color="#000";
if(!_121){
_122.value=_120-query;
_122.style.color="#000";
}
}
},resetRGForm:function(){
this.resetDirectionForm();
this.resetMapForm();
},resetDirectionForm:function(){
var _124=$d("dir0-addressInput");
var _125=$d("dir1-addressInput");
var _126=$d("dir0-query");
var _127=$d("dir1-query");
var _128=dirForm.getDefaultAddress();
_124.value=_128;
_124.style.color="#666";
_125.value=_128;
_125.style.color="#666";
_126.value=dirForm.getDefaultQuery();
_126.style.color="#666";
_127.value=dirForm.getDefaultQuery();
_127.style.color="#666";
},resetMapForm:function(){
var _129=$d("maps0-addressInput");
_129.value=mapsForm.getDefaultAddress();
_129.style.color="#666";
},resetSearchForm:function(){
var _12a=$d("search-query");
var _12b=$d("search-addressInput");
}});
}
if(!_1._hasResource["mq.comscore"]){
_1._hasResource["mq.comscore"]=true;
_1.provide("mq.comscore");
_1.declare("mq.ComScore",null,{constructor:function(_12c,_12d,_12e){
debug("comscore:createobject");
this.tileMap=_12d;
this.mapWindow=_12e;
},tileMap:null,mapWindow:null,x:0,y:0,type:"",startxy:null,dragStarted:false,monitor1:function(evt){
if(this.dragStarted){
this.dragStarted=false;
var _130=this.tileMap.getCenterLatLng();
var _131=this.tileMap.llToPix(_130);
_131.x=_131.x-mq.getScrollBarPosition().ptOffsetX;
_131.y=_131.y-mq.getScrollBarPosition().ptOffsetY;
this.type="click";
debug("click");
var _132=this.tileMap.percentage(this.startxy.x,this.startxy.y,_131.x,_131.y,true);
this.dragTracker(this.startxy.x,this.startxy.y,_131.x,_131.y);
}
},monitor:function(evt){
if(evt.eventName=="MQA.TileMap.mouseDown"){
debug("comscore:monitor ");
this.dragStarted=true;
this.startxy=this.tileMap.startDragPoint;
debug("mousedown");
_1.disconnect(this.tileMap.parent,"click",this,"monitor1");
_1.connect(this.tileMap.parent,"click",this,"monitor1");
}
if(evt.eventName=="MQA.TileMap.dragEnd"){
this.dragStarted=false;
debug("drag");
this.type="drag";
this.dragTracker(this.startxy.x,this.startxy.y,this.tileMap.endDragPoint.x,this.tileMap.endDragPoint.y);
}
},dragTracker:function(_134,_135,_136,_137){
this.x=(this.x)+(_136-_134);
this.y=(this.y)+(_137-_135);
var _138=this.tileMap.percentage(0,0,this.x,this.y,false);
var diag=Math.round(Math.sqrt(_138.shiftX*_138.shiftX+_138.shiftY*_138.shiftY));
if(diag>=40){
var _13a=this.tileMap.direction(0,0,this.x,this.y);
var _13b;
if(this.type=="click"){
_13b=("Action = "+this.type);
ua.a(":MQ08Recenter");
}else{
_13b=("Action = "+this.type+": direction = "+_13a);
ua.a(":MQ08Drag"+this.dragDirToPanDir(_13a).toUpperCase());
}
this.x=0;
this.y=0;
this.type="";
}
},dragDirToPanDir:function(_13c){
var _13d;
switch(_13c){
case "n":
_13d="s";
break;
case "e":
_13d="w";
break;
case "w":
_13d="e";
break;
case "s":
_13d="n";
break;
case "ne":
_13d="sw";
break;
case "nw":
_13d="se";
break;
case "se":
_13d="nw";
break;
case "sw":
_13d="ne";
break;
default:
_13d="error";
}
return _13d;
}});
}
if(!_1._hasResource["mq.maptabview"]){
_1._hasResource["mq.maptabview"]=true;
_1.provide("mq.maptabview");
_1.declare("mq.MapTabView",mq.TabView,{constructor:function(_13e,_13f){
debug("MapTabView.constructor");
this.manMapList={};
this._locationListId=this._idList["locationList"];
var _140=_13e._model.viewType;
if(!_140){
_140=mq.savedandrecent.getDefaultMapType();
}
debug(">> "+this.getDefaultMapLocation()+", "+_140+", "+_13e._model.zoomLevel);
this.initMap(this.getDefaultMapLocation(),_140,_13e._model.zoomLevel);
MQA.EventManager.addListener(this._tileMap,"maptypechanged",_1.hitch(this,"changeMapType"));
MQA.EventManager.addListener(this._tileMap,"zoomend",_1.hitch(this,"changeZoom"));
MQA.EventManager.addListener(this._tileMap,"dragend",_1.hitch(this,"panMap"));
this.comscoreTracker=new mq.ComScore(this._controller,this._tileMap,"mapWindow");
MQA.EventManager.addListener(this._tileMap,"mousedown",_1.hitch(this.comscoreTracker,"monitor"));
MQA.EventManager.addListener(this._tileMap,"dragend",_1.hitch(this.comscoreTracker,"monitor"));
_1.connect(this,"onMapTypeChange",this._controller,"viewTypeChange");
_1.connect(this,"onPanZoomChange",this._controller,"panZoomChange");
this.tabView=this.tabState.map;
if(_13e._model.locations){
var _141=false;
if(_13e._model.printerFriendly){
_141=true;
_13e._model.printerFriendly=false;
}
this.updateView(_13e._model);
if(_141){
_13e._model.printerFriendly=true;
}
}
if(window.IsTrafficEnabled=="true"){
if(window["trafficPopupContent"]){
window.initTrafficPopup("mapTrafficHelp");
}
}
},imagePath:mqPrefix+"/cdn/images",iconPattern:"stop_{VAR}.png",VARIANCE_LIMIT:0.1,updateView:function(_142){
debug("MapTabView.updateView");
mq.hideLoadingImage();
if(!!(view)){
if(_142.mode){
view.contentModeHandler(_142.mode);
}else{
if(view.getCurrentMode()!="MAPS"){
view.contentModeHandler("MAPS");
}
}
}
if(!_142.printerFriendly&&mq.isShowing($d("printDisplay"))){
window.backToMap();
}
var _143="";
var _144="";
if(_142.routeResults!=null&&_142.routeResults.resultMessages!=null&&!_142.routeResults.wasAvoidError){
var _145=_142.routeResults.resultMessages;
debug("Route messages found: "+_145.length);
for(var i=0;i<_145.length;i++){
debug("Message "+i+": "+_145[i]);
var tmp=mq.getMessage(_145[i].match(/^[A-Z,_]*/));
(mq.startsWith(_145[i],"WARN"))?_144+=(tmp+"<br/>"):_143+=(tmp+"<br/>");
}
_143=(_143!="")?_143.substring(0,_143.lastIndexOf("<br/>")):_143;
_144=(_144!="")?_144.substring(0,_144.lastIndexOf("<br/>")):_144;
}
if(_143.length<=0){
if(_142.routeResults){
_142.routeResults.wasAvoidError=null;
}
ua.a(":pv");
this.updateShowHideRoutingLnk(_142.showRoute);
(_142.viewType!=null)?this._tileMap.setMapType(_142.viewType):this._tileMap.setMapType(mq.savedandrecent.getDefaultMapType());
var locs=_142.locations;
var _149=$d("mapWindow");
if(locs!=null&&locs.length>0){
mq.show($d("itin"));
_149.style.borderTopWidth="1px";
this.addPoisToMap(locs);
if(_1.isSafari){
this._tileMap.getDeclutter().redrawLeaderLines();
}
debug("MapTabView: removing route highlight");
this._tileMap.removeRouteHighlight();
if(_142.zoomLevel!=null&&_142.zoomLevel){
debug("MapTabView.updateView: restoring map center and zoom level");
if(_142.showRoute){
if(!_142.routeResults){
controller.rerunRoute();
}else{
this.addRouteHighlight(_142,false);
}
}
this._tileMap.setCenter(new MQA.LatLng(_142.centerLatitude,_142.centerLongitude),_142.zoomLevel);
}else{
if(_142.showRoute&&_142.routeResults!=null){
debug("MapTabView.updateView: adding route with best fit");
this.addRouteHighlight(_142,true);
}else{
if(locs.length==1){
var loc=locs[0].location;
if(loc.geocodeQuality){
debug("MapTabView.updateView: setting zoom based on geocode quality");
var _14b=this._tileMap.getZoomLevel();
this._tileMap.setCenter(new MQA.LatLng(loc.latitude,loc.longitude),this.zoomLevels[loc.geocodeQuality]);
if(this._tileMap.getZoomLevel()==_14b){
controller.panZoomChange(_14b,this._tileMap.getCenter());
}
}else{
debug("Geocoder did not return a geocodeQuality");
this._tileMap.bestFit(false,this.zoomLevels["MIN"],this.zoomLevels["MAX"]);
}
}else{
debug("MapTabView.updateView: calling best fit");
this._tileMap.bestFit(false,this.zoomLevels["MIN"],this.zoomLevels["MAX"]);
}
}
}
if(locs.length==1){
mq.hide($d("routingOptions"));
_1.removeClass("MAPSborder","routeWin");
mq.hide($d("infoMessage"));
}else{
mq.show($d("dirSummary"));
mq.show($d("routingOptions"));
_1.addClass("MAPSborder","routeWin");
}
if(!!(view)){
view.resizeLayout();
}
}else{
mq.hide($d("itin"));
_149.style.borderTopWidth="0px";
this._tileMap.removeRouteHighlight();
this._tileMap.removeAllPois();
this.setDefaultMap(this.getDefaultMapLocation());
mq.hide($d("dirSummary"));
mq.hide($d("routingOptions"));
mq.hide($d("routingOptions2"));
}
debug("Calling tileMap.saveState");
this._tileMap.saveState();
this.cleanLocationList();
if(_142.locations&&_142.locations.length>1){
this.drawLocations(_142);
}
if(_142.locations!=null&&_142.locations.length>0){
len=_142.locations.length;
this.addLocationForm(len,"loc",this._locationListId);
}
this.updateDirSummary();
this.updateRGForm();
mq.util.updateBrowserTitle();
var ro=controller._model.routeOptions;
$d("aoh").checked=ro&&ro.avoidHighways;
$d("aot").checked=ro&&ro.avoidTollRoads;
$d("aos").checked=ro&&ro.avoidSeasonal;
try{
$d(ro.routeType.toLowerCase()).checked=true;
}
catch(e){
$d("fastest").checked=true;
}
if(ro&&(ro.avoidHighways||ro.avoidTollRoads||ro.avoidSeasonal)){
controller.saveState();
}
if(serverResults&&view.mapView){
serverResults=null;
}
if(dirForm&&dirForm.results){
dirForm.results=null;
}
(_144.length>0)?this.showRouteWarningMessage(_144):this.hideRouteWarningMessage();
this.scrollIntoView();
view.scrollToElement=null;
ua.commit();
}else{
this.updateShowHideRoutingLnk(_142.showRoute);
this.showGenericPopup(_143);
}
view.adjustItineraryHeight();
debug("Before showPrint");
if(_142.printerFriendly){
window.showPrint();
}
},scrollIntoView:function(){
var _14d=controller._model;
var _14e;
if((typeof (view.scrollToElement)!="undefined")&&view.scrollToElement!=null){
if(view.scrollToElement==0){
window.scrollTo(0,0);
view.scrollToElement=null;
return;
}
_14e=$d(view.scrollToElement);
view.scrollToElement=null;
}
if(_14e){
var _14f=dijit.getViewport();
if(!mq.util.isElementInView(_14e)){
mq.util.scrollElemToView(_14e,_14f.h-200);
}
}
},staticSizeAndScrollGutterAd:function(){
var _150=$d("mqar-bottom-left-itin");
_150.innerHTML="";
_150.style.height=(controller._model.mapGutterState=="NORMAL")?131+"px":77+"px";
var _151=(_1.isIE>0)?1000:0;
var _152=window.setTimeout(function(){
$d("leftScroll").scrollTop=99999;
},_151);
},addRouteHighlight:function(_153,_154){
var ul=_153.routeResults.upperLeft;
var lr=_153.routeResults.lowerRight;
var box=new MQA.RectLL(new MQA.LatLng(ul.latitude,ul.longitude),new MQA.LatLng(lr.latitude,lr.longitude));
debug("SessionId: "+_153.routeResults.sessionId+", "+_154);
debug("Box: "+box.ul.lat+","+box.ul.lng+": "+box.lr.lat+","+box.lr.lng);
debug("MapSize: "+this._tileMap.getSize());
this._tileMap.addRouteHighlight(box,_153.routeResults.mapServerUrl,_153.routeResults.sessionId,_154);
debug("MapTabView.addRouteHighlight: after highlight added");
},showGenericPopup:function(_158){
debug("MapTabView.showGenericPopup: "+_158);
var sb=new dojox.string.Builder();
sb.append("<div class=\"alert-warning\" style=\"width: 220px\">").append("<img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">").append("<div class=\"avoid\">"+_158+"</div></div>");
var _15a=new mq.widget.MQPopup({id:"mqErrorPopup",position:"center",popupImage:"sprt-pop-ylw.png",popupContent:sb.toString(),closeButtonRequired:true});
},cleanLocationList:function(){
debug("MapTabView.cleanLocationList");
for(var i=0;i<11;i++){
if(window["loc"+i+"Form"]){
mq.destroyForm(window["loc"+i+"Form"]);
}
}
dijit.registry.byClass("mq.widget.LocationListItem").forEach(function(w){
w.destroyRecursive();
dijit.registry.remove(w.id);
});
$d(this._locationListId).innerHTML="";
if(this.manMapList){
for(var i in this.manMapList){
var map=this.manMapList[i];
if(!_1.isSafari){
map.dispose();
}
map=null;
delete this.manMapList[i];
}
}
},drawLocations:function(_15e){
if(_15e.locations!=null){
debug("MapTabView.drawLocations: "+_15e.locations.length);
var ul=document.createElement("div");
ul.setAttribute("id","locationList");
ul.setAttribute("class","locationList");
$d(this._locationListId).appendChild(ul);
if(_15e.showRoute&&_15e.routeResults!=null&&_15e.locations.length>1){
var div=document.createElement("div");
_1.addClass(div,"dirTitle");
var _161=new dojox.string.Builder();
_161.append("Directions");
_161.append("<div id=\"avoidRestore\" style=\"display:none;\">");
_161.append("<div class=\"fltl\"><img src=\""+mqPrefix+"/cdn/images/icons/icon-alert-info.gif\" height=\"15\" width=\"15\"></div>");
_161.append("<a title=\"Click to restore avoided maneuvers\" id=\"restoreAvoidsLnk\" onclick=\"controller.removeAvoidSegments();\">Click to restore avoided maneuvers</a>");
_161.append("</div>");
_161.append("<div class=\"clearb\"></div>");
div.innerHTML=_161.toString();
$d(this._locationListId).appendChild(div);
}
for(i=0;i<_15e.locations.length;i++){
loc=_15e.locations[i].location;
this.showLocationListItem(loc,i,_15e.locations.length,ul);
this.showNarrative(_15e,i);
}
$d(this._locationListId).appendChild(ul);
if(_15e.showRoute&&_15e.routeResults!=null&&_15e.locations.length>1){
debug("Show Total Time and Distance");
var div=document.createElement("div");
_1.addClass(div,"routeResults");
var rbuf=new dojox.string.Builder();
rbuf.append("<div class=\"narrTotal\">");
rbuf.append("Total Estimated Time: <span class=\"timeSpan\">"+_15e.routeResults.time+"</span>");
rbuf.append("Total Estimated Distance: <span>"+_15e.routeResults.distance+"</span>");
rbuf.append("</div>");
div.innerHTML=rbuf.toString();
$d(this._locationListId).appendChild(div);
if(_15e.routeResults.infoMessage||_15e.routeResults.infoTitle){
var msg=new dojox.string.Builder();
msg.append("<div class=\"infoicon\"><img src=\""+mqPrefix+"/cdn/images/icon-info.gif\" height=\"18\" width=\"18\"></div>");
msg.append("<div class=\"infomsg\"><span>"+_15e.routeResults.infoTitle+"</span><br/>");
msg.append(_15e.routeResults.infoMessage);
msg.append("</div>");
msg.append("<div class=\"clearb\"></div>");
$d("infoMessage").innerHTML=msg.toString();
mq.show($d("infoMessage"));
}else{
$d("infoMessage").innerHTML="";
mq.hide($d("infoMessage"));
}
}
}
},reorder:function(){
var locs=[];
var _165=$d("locationList").childNodes;
for(i=0;i<_165.length;i++){
id=_165[i].id;
index=id[id.length-1];
locs[i]=$w("listItem"+index).location;
}
this._controller.reorder(locs);
},showNarrative:function(_166,_167){
debug("MapTabView.showNarrative: "+_167);
if(_166.routeResults==null||!_166.routeResults.treks||_166.routeResults.treks.length==0||(_167>(_166.routeResults.treks.length-1))){
return;
}
var _168=$d("routeNarrative"+_167);
if(_168){
if($d("dirHide"+_167)){
_1.disconnect($d("dirHide"+_167),"onclick",this,"toggleNarrative");
}
var sb=new dojox.string.Builder();
sb.append("<div class=\"routeNarrative\"><div class=\"narrHeader\"><img class=\"alignm\" title=\"Hide/Show Route\" alt=\"Hide/Show Route\" id=\"dirHide"+_167+"\" src=\""+this.imagePath+"/arw-dir_open.png\">&nbsp;&nbsp;Directions from ");
sb.append(this.alphabet[_167]+" to "+this.alphabet[_167+1]+":</div>");
var trek=_166.routeResults.treks[_167];
if(this.tabView==this.tabState.normal){
sb.append(this.createNarrativeTableNormal(trek,_167,_166.routeResults.variance));
}else{
sb.append(this.createNarrativeTableExpand(trek,_167,_166.routeResults.variance));
}
sb.append("<div class=\"narrTotalEst\">Estimated Time: "+trek.time+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
sb.append("Estimated Distance: "+trek.distance+"</b></div></div>");
_168.innerHTML=sb.toString();
_1.connect($d("dirHide"+_167),"onclick",this,"toggleNarrative");
if(this.tabView==this.tabState.text){
for(var i=0;i<trek.maneuvers.length;i++){
var man=trek.maneuvers[i];
if(man.showMap){
this.showManeuverMap(_167,i);
}
}
}
}
debug("Index at end of showNarrative: "+_167);
},createNarrativeTableNormal:function(trek,_16e,_16f){
debug("MapTabView.createNarrativeTableNormal");
var sb=new dojox.string.Builder();
sb.append("<table border=\"0\" id=\"narrative"+_16e+"\" style=\"display:block;\" cellspacing=\"0\">");
if(_16f[_16e]>this.VARIANCE_LIMIT){
sb.append("<tr class=\"evenRow\"><td colspan=3 class=\"error\">");
sb.append(this.displayVarianceMessage(_16f[_16e],0));
sb.append("</td></tr>");
}
for(var k=0;k<trek.maneuvers.length;k++){
var man=trek.maneuvers[k];
((k%2)==0)?sb.append("<tr class=\"evenRow alignt\">"):sb.append("<tr class=\"oddRow alignt\">");
sb.append("<td class=\"narrCol1\">"+(k+1)+":&nbsp;</td>");
sb.append("<td class=\"narrCol2\">"+man.narrative.replace(/\//g,"/<span class=\"sm\"> </span>")+"</td>");
(man.distance!=null)?sb.append("<td class=\"narrCol3\" nowrap>"+man.distance+"</td>"):sb.append("<td></td>");
sb.append("</tr>");
}
if(_16f[_16e+1]>this.VARIANCE_LIMIT){
sb.append("<tr class=\"evenRow\"><td colspan=3 class=\"error\">");
sb.append(this.displayVarianceMessage(_16f[_16e+1],1));
sb.append("</td></tr>");
}
sb.append("</table>");
return sb.toString();
},hasVariance:function(loc){
flag=false;
if(loc.distance!=null&&loc.distance>this.VARIANCE_LIMIT){
flag=true;
}
return flag;
},displayVarianceMessage:function(_174,_175){
var unit=controller._model.routeOptions.distanceUnit;
var msg=(_175==0)?mq.getMessage("VARIANCE_BEGIN",[mq.util.formatDistance(_174,unit)]):mq.getMessage("VARIANCE_END",[mq.util.formatDistance(_174,unit)]);
return msg;
},createNarrativeTableExpand:function(trek,_179,_17a){
debug("MapTabView.createNarrativeTableExpand");
var sb=new dojox.string.Builder();
sb.append("<div id=\"narrative"+_179+"\">");
if(_17a[_179]>this.VARIANCE_LIMIT){
sb.append("<div class=\"evenRow error\">");
sb.append(this.displayVarianceMessage(_17a[_179],0));
sb.append("</div>");
}
for(k=0;k<trek.maneuvers.length;k++){
var man=trek.maneuvers[k];
sb.append("<div class=\"expColCont\" id=\"maneuver"+_179+"-"+k+"\">");
sb.append("<div class=\"expColumn1\">");
sb.append("<div class=\"expCol1\"><img src=\""+man.roadSignUrl+"\"/></div>");
sb.append("<div class=\"expCol2\">"+(k+1)+":&nbsp;</div>");
sb.append("<div class=\"expCol3Cont\">");
sb.append("<div class=\"expCol3\">").append(man.narrative.replace(/\//g,"/<span class=\"sm\"> </span>"));
if(man.message!=null&&man.message!=""){
sb.append("<div class=\"red\">(").append(mq.getMessage(man.message)).append(")</div>");
}
sb.append("</div>");
sb.append("</div>");
sb.append("</div>");
sb.append("<div class=\"expColumn2\">");
sb.append("<div class=\"expCol4\">&nbsp;");
if(man.distance!=null){
sb.append(man.distance);
}
sb.append("</div>");
sb.append("<div class=\"expCol5\"><ul class=\"bLinks\">");
if(k>0&&k<trek.maneuvers.length-1){
if(man.message&&man.message=="MSG_UNABLE_TO_AVOID"){
sb.append("<li class=\"lastli\" id=\"manMapLink"+_179+"-"+k+"\"><a href=\"javascript:view.mapView.showManeuverMap("+_179+","+k+");\">"+mq.getMessage("MAP")+"</a></li>");
}else{
sb.append("<li id=\"manMapLink"+_179+"-"+k+"\"><a href=\"javascript:view.mapView.showManeuverMap("+_179+","+k+");\">"+mq.getMessage("MAP")+"</a></li>");
sb.append("<li class=\"lastli\">&nbsp;<a href=\"javascript:view.mapView.avoidSegmentPopup("+_179+","+k+");\">"+mq.getMessage("AVOID")+"</a></li>");
}
}else{
sb.append("<li class=\"lastli\" id=\"manMapLink"+_179+"-"+k+"\"><a href=\"javascript:view.mapView.showManeuverMap("+_179+","+k+");\">"+mq.getMessage("MAP")+"</a></li>");
}
sb.append("</ul></div>");
sb.append("</div>");
sb.append("<div style=\"width:400px;height:200px;\" class=\"manMapHide\" id=\"manMap"+_179+"-"+k+"\"></div>");
sb.append("<div class=\"clearb\"></div>");
sb.append("</div>");
}
if(_17a[_179+1]>this.VARIANCE_LIMIT){
sb.append("<div class=\"evenRow error\">");
sb.append(this.displayVarianceMessage(_17a[_179+1],1));
sb.append("</div>");
}
sb.append("</div>");
return sb.toString();
},toggleNarrative:function(evt){
debug("toggleNarrative: "+evt.currentTarget.id);
id=evt.currentTarget.id.substring(7);
if($d("narrative"+id).style.display=="none"){
ua.a(":MQ08MaxRouteMan");
$d("narrative"+id).style.display="block";
document.getElementById("dirHide"+id).src=this.imagePath+"/arw-dir_open.png";
}else{
ua.a(":MQ08MinRouteMan");
$d("narrative"+id).style.display="none";
document.getElementById("dirHide"+id).src=this.imagePath+"/arw-dir_clsd.png";
}
},chooseAmbigLocation:function(_17e){
debug("MapTabView.chooseAmbigLocation: "+_17e);
var widg=$w("ambigWin");
var loc=widg.resultList[_17e];
debug("loc-addressInput: "+loc.addressInput);
if(loc.query!=null&&loc.query!=""){
this._controller._model.searchLocation=loc;
this._controller.search(loc,widg.position);
}else{
this._controller.addLocation(loc,widg.position);
}
widg.close();
},clearAllLocations:function(){
debug("MapTabView.clearAllLocations");
var _181=new dojox.string.Builder();
_181.append("<div class=\"alert-warning\">");
_181.append("<img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">");
_181.append("<span>"+mq.getMessage("MSG_CLEAR_ALL_LOCATIONS")+"</span><br/><br/>");
_181.append("<div class=\"textc\">");
_181.append("<input type=\"button\" value=\"OK\" onclick=\"Javascript:view.mapView.confirmClearAllLocations();\" class=\"btn\" id=\"routeClearOk\"/>&nbsp;&nbsp;&nbsp;");
_181.append("<input type=\"button\" value=\"Cancel\" onclick=\"Javascript:$w('confirmClearAll').handleCancel();\" class=\"btn\" id=\"routeClearCancel\"/>");
_181.append("</div>");
_181.append("</div>");
_181=_181.toString();
var _182=new mq.widget.MQPopup({id:"confirmClearAll",position:"center",popupContent:_181});
ua.a(":MQ08RemoveAll");
},confirmClearAllLocations:function(){
if($w("confirmClearAll")){
$w("confirmClearAll").handleAccept();
}
view.scrollToElement="contentWrapper";
this.cleanLocationList();
controller.clearAllLocations();
},removeLocation:function(_183){
debug("MapTabView.removeLocation: "+_183);
var _184=new dojox.string.Builder();
_184.append("<div class=\"alert-warning\">");
_184.append("<img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">");
_184.append("<span>"+mq.getMessage("MSG_CLEAR_LOCATION")+"</span><br/><br/>");
_184.append("<div class=\"textc\">");
_184.append("<input type=\"button\" value=\"OK\" onclick=\"Javascript:view.mapView.confirmRemoveLocation("+_183+");\" class=\"btn\" id=\"locationClearOk\"/>&nbsp;&nbsp;&nbsp;");
_184.append("<input type=\"button\" value=\"Cancel\" onclick=\"Javascript:$w('removeLocation').handleCancel();\" class=\"btn\" id=\"locationClearCancel\"/>");
_184.append("</div>");
_184.append("</div>");
_184=_184.toString();
var _185=new mq.widget.MQPopup({id:"removeLocation",position:"center",popupContent:_184});
},confirmRemoveLocation:function(_186){
$w("removeLocation").handleAccept();
this.cleanLocationList();
mq.showLoadingImage();
controller.removeLocation(_186);
if(!controller._model.locations||controller._model.locations.length==0){
this.resetRGForm();
}
},acceptHandler:function(evt){
var _188=this._controller._model.routeOptions;
if(_188==null){
_188={routeType:"FASTEST"};
}
($d("aoh")&&$d("aoh").checked)?_188.avoidHighways=true:_188.avoidHighways=false;
($d("aot")&&$d("aot").checked)?_188.avoidTollRoads=true:_188.avoidTollRoads=false;
($d("aos")&&$d("aos").checked)?_188.avoidSeasonal=true:_188.avoidSeasonal=false;
($d("fastest").checked)?_188.routeType="FASTEST":_188.routeType="SHORTEST";
if($d("rev")&&($d("rev").value=="true")){
_188.reverseRoute=true;
$d("rev").value=false;
}else{
_188.reverseRoute=false;
}
this.setAdvancedRoutingOptions();
},reverseRoute:function(evt){
$d("rev").value=true;
this.acceptHandler();
},editLocation:function(_18a){
debug("MapTabView.editLocation: "+_18a);
ua.a(":MQ08Edit");
var _18b=$d("location"+_18a);
mq.hide($d("locDiv"+_18a));
var _18c="loc"+_18a;
window[_18c+"Form"]=new mq.editlocationform({template:"editLocation",jsId:_18c+"Form",prefix:_18c,formType:"edit",mode:"ajax",tmpStartLocation:$w("listItem"+_18a).location,parentElem:$d("locEditDiv"+_18a),searchBoxStartId:_18c+"0-query",locationBoxStartId:_18c+"0-addressInput",locNum:_18a});
},showLocationListItem:function(loc,_18e,_18f,_190){
debug("MapTabView.showLocationList: "+_18e);
loc.addressInput=mq.formatLocationSingleLine(loc);
var w=new mq.widget.LocationListItem({id:"listItem"+_18e,position:_18e,listSize:_18f,location:loc});
_1.connect(w,"onRemove",this,"removeLocation");
_1.connect(w,"onMoveUp",this._controller,"moveUp");
_1.connect(w,"onMoveDown",this._controller,"moveDown");
_1.connect(w,"onEdit",this,"editLocation");
_1.connect(w,"onZoomToStreet",this,"zoomToStreet");
_190.appendChild(w.domNode);
},chooseSavedRecent:function(_192,_193){
var widg=$w("savedRecent"+_192);
widg.close();
var hist=_1.cookie.getCookie("locationhistory");
var locs=mq.util.parseLocations(hist);
var loc=locs[_193].location;
this._controller.addLocation(loc,_192);
},textView:function(){
debug("MapTabView.textView");
if(controller._model.locations&&controller._model.locations.length>0){
if(this.isShowRoute()){
for(i=0;i<controller._model.locations.length;i++){
this.showNarrative(controller._model,i);
}
}
dijit.registry.byClass("mq.widget.TwoLineForm").forEach(function(_198){
$w(_198).expandAddNextLoc("text");
});
}
},splitView:function(){
debug("MapTabView.splitView");
if(this.isShowRoute()&&controller._model.locations){
for(i=0;i<controller._model.locations.length;i++){
this.showNarrative(controller._model,i);
}
}
if(controller._model.locations&&controller._model.locations.length>1){
setTimeout("view.mapView._tileMap.bestFit()",500);
}
dijit.registry.byClass("mq.widget.TwoLineForm").forEach(function(_199){
$w(_199).expandAddNextLoc("split");
});
},mapView:function(){
if(controller._model.locations!=null&&controller._model.locations.length>1){
setTimeout("view.mapView._tileMap.bestFit()",500);
}
},changeView:function(_19a){
this.processChangeView(_19a);
this.gutterUserToggleLogging(_19a,"gutterTextLink");
},showManeuverMap:function(_19b,_19c){
debug("Showing maneuver map: "+_19b+","+_19c);
ua.a(":MQ08ManMap");
var _19d=$d("manMap"+_19b+"-"+_19c);
var _19e=new MQA.TileMap(_19d);
var _19f=new MQA.ZoomControl(_19e);
_19e.addControl(_19f,new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(10,15)));
routeResults=this._controller._model.routeResults;
var man=routeResults.treks[_19b].maneuvers[_19c];
var l1=man.shapePoints[0];
man.showMap=true;
var _1a2=-3;
var _1a3=-27;
var _1a4=new MQA.MapIcon();
_1a4.setImage(this.imagePath+"/icons/mapPin-purple-"+(_19c+1)+".png",26,27,true,false);
_1a4.setAnchorOffset(new MQA.Point(_1a2,_1a3));
var pt1=new MQA.Poi(new MQA.LatLng(l1.latitude,l1.longitude));
pt1.setIcon(_1a4);
pt1.setKey("pois-"+(_19c+1));
_19e.addPoi(pt1);
if(_19c<routeResults.treks[_19b].maneuvers.length-1){
var l2=man.shapePoints[1];
var _1a7=new MQA.MapIcon();
_1a7.setImage(this.imagePath+"/icons/mapPin-purple-"+(_19c+2)+".png",26,27,true,false);
_1a7.setAnchorOffset(new MQA.Point(_1a2,_1a3));
var pt2=new MQA.Poi(new MQA.LatLng(l2.latitude,l2.longitude));
pt2.setIcon(_1a7);
pt2.setKey("pois-"+(_19c+2));
_19e.addPoi(pt2);
}
_19e.bestFit(false,2,14);
for(var i=0;i<controller._model.locations.length;i++){
var icon=new MQA.MapIcon();
icon.setImage(this.imagePath+"/icons/stop_"+i+".png",27,27,true,false);
var l=controller._model.locations[i].location;
var pt=new MQA.Poi(new MQA.LatLng(l.latitude,l.longitude));
pt.setKey("stops-"+unescape("%"+(i+65).toString(16)));
pt.setIcon(icon);
_19e.addPoi(pt);
}
MQA.EventManager.addListener(_19e,"dragend",_1.hitch(this,"dragManeuverMap"));
var ul=controller._model.routeResults.upperLeft;
var lr=controller._model.routeResults.lowerRight;
var rect=new MQA.RectLL(new MQA.LatLng(ul.latitude,ul.longitude),new MQA.LatLng(lr.latitude,lr.longitude));
debug("Maneuver map session id: "+routeResults.sessionId);
_19e.addRouteHighlight(rect,routeResults.mapServerUrl,this._controller._model.routeResults.sessionId,false);
this.manMapList["manMap"+_19b+"-"+_19c]=_19e;
_1.removeClass(_19d,"manMapHide");
_1.addClass(_19d,"manMapShow");
var _1b0=$d("manMapLink"+_19b+"-"+_19c);
_1b0.innerHTML="<a href=\"javascript:view.mapView.hideManeuverMap("+_19b+","+_19c+");\">"+mq.getMessage("HIDE")+"</a>";
},saveTinyURL:function(_1b1){
debug("maptabview.js saveTinyURL Start...");
var _1b2;
if(controller._model.routeResults){
_1b2={};
for(prop in controller._model){
if(prop!="routeResults"&&prop){
_1b2[prop]=controller._model[prop];
}
}
}else{
_1b2=controller._model;
}
debug("maptabview.js saveTinyURL Calling UIService.saveTinyURL");
UIService.saveTinyURL(_1b2,_1b1);
},getTinyUrl:function(key){
var l=window.location;
return l.protocol+"//"+l.hostname+(l.port?":"+l.port:"")+"/mq/"+encodeURIComponent(key);
},handleEmailClick:function(){
ua.a(":MQ08Email");
this.showEmailPopup();
},showEmailPopup:function(){
debug("maptabview.js showEmailPopup Start....");
var _1b5=$w("mqEmail");
var my=this;
this.saveTinyURL(function(_1b7,_1b8){
debug("maptabview.js showEmailPopup saveTinyURL function.  Start...");
var _1b9=new mq.widget.SendEmail({id:"mqEmail"});
_1.connect(_1b9,"acceptCallback",null,function(){
debug("maptabview.js showEmailPopup saveTinyURL Dojo connect");
my.submitEmail(my.getTinyUrl(_1b7));
});
var _1ba=new mq.widget.MQPopup({id:"mqEmailPopup",position:"center",popupWidget:_1b9,onClose:_1.hitch(_1b9,"destroy")});
_1.connect(_1b9,"handleCancel",_1ba,"handleCancel");
});
},submitEmail:function(_1bb){
var _1bc={};
_1bc.to=($d("sendEmailTo").value.replace(/,/g," ")).split(" ");
debug(_1bc.to);
_1bc.from=$d("sendEmailFrom").value;
_1bc.subject=$d("sendEmailSubject").value;
_1bc.body=$d("sendEmailComments").value;
var _1bd=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var _1be=true;
for(var i=0;i<_1bc.to.length;i++){
if(_1bc.to[i].length>0&&!_1bd.test(_1bc.to[i])){
_1be=false;
break;
}
}
if(!_1be||!(_1bc.from!=null&&_1bd.test(_1bc.from))){
$d("mqpopup-errmsg").style.display="block";
}else{
var _1c0=_1.hitch(this,"handleEmailSubmit");
var _1c1={};
if(serverResults){
_1c1=serverResults;
}
var _1c2;
if(controller._model.routeResults){
_1c2={};
for(prop in controller._model){
if(prop!="routeResults"&&prop){
_1c2[prop]=controller._model[prop];
}else{
_1c2["routeResults"]=this.sendEmailGetMinRouteResults();
}
}
}else{
_1c2=this._controller._model;
}
UIService.sendEmail(_1c2,null,_1bc,_1bb,_1c2.mode,_1c0);
}
},sendEmailGetMinRouteResults:function(){
var _1c3=controller._model.routeResults;
var _1c4={};
for(prop in _1c3){
if(prop!="treks"){
_1c4[prop]=_1c3[prop];
}else{
_1c4["treks"]=this.sendEmailGetMinTreks(_1c3["treks"]);
}
}
return _1c4;
},sendEmailGetMinTreks:function(_1c5){
var _1c5=controller._model.routeResults.treks;
var _1c6=new Array();
if(_1c5&&_1c5.length>0){
var trek;
for(var i=0;i<_1c5.length;i++){
trek=_1c5[i];
var _1c9={};
for(prop in trek){
if(prop!="maneuvers"){
_1c9[prop]=trek[prop];
}else{
_1c9["maneuvers"]=this.sendEmailGetMinManeuvers(trek.maneuvers);
}
}
_1c6[i]=_1c9;
}
}
return _1c6;
},sendEmailGetMinManeuvers:function(_1ca){
var _1cb=new Array();
if(_1ca&&_1ca.length>0){
var _1ca;
for(var i=0;i<_1ca.length;i++){
maneuver=_1ca[i];
var _1cd={};
for(prop in maneuver){
if(prop=="narrative"||prop=="distance"){
_1cd[prop]=maneuver[prop];
}
}
_1cb[i]=_1cd;
}
}
return _1cb;
},handleEmailSubmit:function(_1ce){
ua.a(":MQ08EmailSend");
$w("mqEmailPopup").changeContent($d("mqEmailConfirmation").innerHTML);
_1.connect($d("mqEmailCloseButton"),"onclick",$w("mqEmail").handleCancel);
_1.connect($d("mqEmailXIcon"),"onclick",$w("mqEmail").handleCancel);
},handleSTOClick:function(){
ua.a(":MQ08S2O");
},handleSTGClick:function(){
ua.a(":MQ08S2G");
$d("gps").innerHTML="<iframe name=\"iframe_gps\" id=\"iframe_gps\" src=\"/controller/mainui/gps?popup\" style=\"width:0;height:0;visibility:hidden;\"></iframe>";
},showSTG:function(_1cf,loc){
var _1d1=$w("mqSTG");
var _1d1=new mq.widget.SendToGPS({id:"mqSTG",location:loc,gps:_1cf});
var _1d2=new mq.widget.MQPopup({id:"mqSTGPopup",popupWidget:_1d1,position:"center",onClose:_1.hitch(_1d1,"destroy")});
_1.connect(_1d1,"handleCancel",_1d2,"handleCancel");
},completeSTG:function(_1d3){
if(_1d3&&_1d3.success){
$w("mqSTGPopup").changeContent($d("mqSTGConfirmationSuccess").innerHTML);
}else{
if(_1d3.msg){
$d("stgError").innerHTML="<br/>"+_1d3.msg;
}
$w("mqSTGPopup").changeContent($d("mqSTGConfirmationFailure").innerHTML);
}
_1.connect($d("closeButton"),"onclick",$w("mqSTG").handleCancel);
_1.connect($d("xicon"),"onclick",$w("mqSTG").handleCancel);
},hideManeuverMap:function(_1d4,_1d5){
ua.a(":MQ08ManMapHide");
var _1d6=$d("manMap"+_1d4+"-"+_1d5);
_1d6.innerHTML="";
_1.removeClass(_1d6,"manMapShow");
_1.addClass(_1d6,"manMapHide");
var _1d7=$d("manMapLink"+_1d4+"-"+_1d5);
_1d7.innerHTML="<a href=\"javascript:view.mapView.showManeuverMap("+_1d4+","+_1d5+");\">"+mq.getMessage("MAP")+"</a>";
var man=routeResults.treks[_1d4].maneuvers[_1d5];
man.showMap=false;
var _1d9="manMap"+_1d4+"-"+_1d5;
var map=this.manMapList[_1d9];
map.dispose();
map=null;
delete this.manMapList[_1d9];
},avoidSegmentPopup:function(_1db,_1dc){
var _1dd=new dojox.string.Builder();
_1dd.append("<div class=\"alert-warning\">");
_1dd.append(" <img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">");
_1dd.append(" <span>"+mq.getMessage("MSG_AVOID_AND_RECALC")+"</span><br/><br/>");
_1dd.append(" <div class=\"textc\">");
_1dd.append("  <input type=\"button\" value=\"OK\" onclick=\"Javascript:view.mapView.avoidSegment("+_1db+","+_1dc+");\" class=\"btn\" id=\"routeClearOk\"/>&nbsp;&nbsp;&nbsp;");
_1dd.append("  <input type=\"button\" value=\"Cancel\" onclick=\"Javascript:$w('confirmAvoidAndRecalculate').handleCancel();\" class=\"btn\" id=\"routeClearCancel\"/>");
_1dd.append(" </div>");
_1dd.append("</div>");
_1dd=_1dd.toString();
var _1de=new mq.widget.MQPopup({id:"confirmAvoidAndRecalculate",position:"center",popupContent:_1dd});
},avoidSegment:function(_1df,_1e0){
$w("confirmAvoidAndRecalculate").close();
debug("MapTabView.avoidSegment");
ua.a(":MQ08AvoidMan");
this._controller.avoidRouteSegment(_1df,_1e0);
},setAdvancedRoutingOptions:function(){
debug("MapTabView.setAdvancedRoutingOptions");
if(this._controller._model.routeOptions.reverseRoute==false){
ua.a(":MQ08RouteOptionsGo");
}else{
ua.a(":MQ08ReverseRoute");
}
mq.showLoadingImage();
this._controller.rerunRoute();
},showRouteWarningMessage:function(_1e1){
var _1e2=$d("routeWarningMsg");
var _1e3=$d("routeWarningMsg2");
var _1e4=new dojox.string.Builder();
var _1e5=_1e1.split("<br/>");
_1e4.append("<div class='alert-warning' style='width:auto;height:auto;'>");
_1e4.append("<img width='24' height='25' src='"+this.imagePath+"/icon-warn.gif' />");
if(_1e5.length==1){
_1e4.append("<div style='padding-top:4px;color:#990000;font-weight:bold;float:left;'>"+_1e1+"</div>");
}else{
_1e4.append("<div style='padding-top:4px;color:#990000;font-weight:bold;float:left;'>Some Road Types cannot be avoided in order to build your route.</div>");
_1e4.append("<div class='red clearb' style='text-align:left;padding-top:0px;'><ul class='list clearb' style='list-style-position:inside;padding:0px 0px 0px 30px'>");
for(var i=0;i<_1e5.length;i++){
_1e4.append("<li style='maring-left:0px;'>"+_1e5[i]+"</li>");
}
_1e4.append("</ul></div>");
}
_1e4.append("</div>");
var _1e7=mq.getPopupContentWidthHeight(_1e4);
_1e2.innerHTML=_1e4.toString();
_1e2.style.display="block";
_1e3.innerHTML=_1e4.toString();
_1e3.style.display="block";
},hideRouteWarningMessage:function(){
$d("routeWarningMsg").style.display="none";
$d("routeWarningMsg2").style.display="none";
},updateShowHideRoutingLnk:function(_1e8){
var _1e9=$d("routeShowHideLnk");
if(_1e8){
_1e9.innerHTML="<div>"+mq.getMessage("HIDE_ROUTING")+"</div>";
_1e9.title=mq.getMessage("HIDE_ROUTING");
}else{
_1e9.innerHTML="<div>"+mq.getMessage("SHOW_ROUTING")+"</div>";
_1e9.title=mq.getMessage("SHOW_ROUTING");
}
},isShowRoute:function(){
var _1ea=$d("routeShowHideLnk");
var _1eb=false;
if(_1ea.title==mq.getMessage("HIDE_ROUTING")){
_1eb=true;
}
return _1eb;
},toggleRoute:function(){
mq.showLoadingImage();
this._controller.toggleRoute();
},openInfoWindow:function(evt){
mq.util.storeFrontInfoBubble($d("infoPhotoItin"));
ua.a(":MQ08BUBLocDetails");
},dragManeuverMap:function(evt){
ua.a(":MQ08ManMapDrag");
},updateDirSummary:function(){
var _1ee=this._controller._model;
var locs=_1ee.locations;
if(locs&&locs.length==1){
var _1f0=$d("dirStartAddrSummary");
$d("dirStartAddrSummary").innerHTML=(_1ee.name&&_1ee.name!="null")?"<div class='addrLine'>"+_1ee.name+"</div>":mq.util.formatLocationSummary(locs[0].location);
_1.query(".narrTopTotal",$d("dirSummary")).style("display","block");
mq.show($d("dirSummary"));
mq.hide($d("dirEndBlock"));
mq.hide($d("dirTimeSumm"));
mq.hide($d("dirDistSumm"));
mq.show($d("mapAddrSummaryLnks"));
var _1f1=locs[0].location.website;
if(_1f1&&_1f1!=""){
mq.show($d("locSumWebUl"));
if(_1f1.indexOf("http:")==-1){
_1f1="http://"+_1f1;
}
$d("locSumWebHref").href=_1f1.toLowerCase();
}else{
mq.hide($d("locSumWebUl"));
$d("locSumWebHref").href="#";
}
mq.show($d("mapA"));
mq.hide($d("contentTabBar2"));
mq.hide($d("dirStart"));
}else{
if(locs&&locs.length>=2){
$d("dirStartAddrSummary").innerHTML=mq.util.formatLocationSummary(locs[0].location);
mq.show($d("dirEndBlock"));
$d("dirEndAddrSummary").innerHTML=mq.util.formatLocationSummary(locs[locs.length-1].location);
if(_1ee.routeResults){
mq.show($d("dirTimeSumm"));
mq.show($d("dirDistSumm"));
mq.hide($d("mapA"));
mq.show($d("contentTabBar2"));
mq.show($d("dirStart"));
$d("dirTimeSummary").innerHTML=_1ee.routeResults.time;
$d("dirDistanceSummary").innerHTML=_1ee.routeResults.distance;
}
_1.query(".narrTotalTop",$d("dirSummary")).style("display","block");
mq.hide($d("mapAddrSummaryLnks"));
mq.hide($d("locSumWebUl"));
$d("locSumWebHref").href="#";
}else{
mq.hide($d("dirSummary"));
_1.query(".narrTotalTop",$d("dirSummary")).style("display","block");
}
}
},popularSearch:function(_1f2,_1f3,pos){
debug("MapView.popularSearch");
var loc=controller._model.locations[_1f3].location;
mq.executeSearchNearby(loc,_1f2,pos);
}});
}
if(!_1._hasResource["mq.widget.SearchResults"]){
_1._hasResource["mq.widget.SearchResults"]=true;
_1.provide("mq.widget.SearchResults");
_1.declare("mq.widget.SearchResults",[dijit._Widget,dijit._Templated],{templateString:"<div id=\"${id}\" class=\"searchResults\" dojoattachpoint=\"wrapper\">\n\t<div id=\"searchResultsContent\" class=\"srContentSplt\">\n\t   \t<div id=\"searchSummary\">\n\t   \t\t<div id=\"didYouMean\">\n\t\t\t\t<div id=\"didYouMeanIcon\" class=\"warningIcon\"></div>\n\t\t\t\t<div id=\"didYouMeanText\">\t\n\t\t\t\t  \t<span class=\"red b\">Did you mean:</span><br />\n\t\t\t\t\t<div dojoattachpoint=\"didYouMeanSummary\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"clearb\"></div>\n\t   \t\t</div>\n\t   \t\t\n\t   \t\t<!--\n\t\t\t<div class=\"gutterLnk\">\n\t\t\t\t<a title=\"Expand Results\" id=\"sGutterLnkExp\" class=\"disn\" onclick=\"view.searchView.changeView('TEXT');\">Expand Results &#187;</a>\n\t\t\t\t<a title=\"View Results and Map\" id=\"sGutterLnkSplit\" class=\"disn\" onclick=\"view.searchView.changeView('NORMAL');\">&#171; View Results and Map</a>\n\t\t\t</div>\n\t\t\t-->\n\t\t\t<div id=\"searchSumResults\">\n\t\t   \t\t<div id=\"searchSumDiv\" class=\"disb\">\n\t\t   \t\t\t<div id=\"searchSumResultsFor\">${heading}</div>\n\t\t   \t\t\t<div id=\"resultQuery\" dojoattachpoint=\"summary\" class=\"b\"></div>\n\t\t   \t\t\t<div class=\"clearb\"></div>\n\t\t   \t\t</div>\n\t\t   \t\t<div id=\"bizLocatorSelect\" class=\"disb\">\n\t\t   \t\t\t<div id=\"bizLocatorResults\">\n\t\t   \t\t\t\t<div id=\"bizLocResultsFor\">Results for:&nbsp;</div>  \n\t\t\t\t\t\t<div id=\"mqar-bl-selected-logo\" class=\"mqar\">\n\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t</div>\t \n\t\t   \t\t\t</div>\n\t\t   \t\t\t<div id=\"bizLocatorSelBox\">\n\t\t\t   \t\t\t<span class=\"alignm\">&nbsp;near&nbsp;</span>\n\t\t\t   \t\t\t<select class=\"alignm\" id=\"bizLocatorOptions\" dojoAttachEvent=\"onchange: blSelectHandler\">\n\t\t\t   \t\t\t\t<option>map center</option>\n\t\t\t   \t\t\t</select>\n\t\t\t   \t\t</div>\n\t\t\t   \t\t<div class=\"clearb\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div id=\"yellowarrowdowncontainer\" >\n\t\t\t\t<img src=\"${imagePath}/arw-ylwSrch.gif\" id=\"yellowarrowdown\" />\n\t\t\t</div>\n\t\t\t<div id=\"srchControls\">\t\n\t\t\t\t<div class=\"refineoptions showhide\" id=\"mqshowhide-search\">\n\t\t\t    \t<dt class=\"show\">\n\t\t\t\t\t\t<ul class=\"bLinksExt\">\n\t\t\t\t\t\t    <li class=\"firstli\" id=\"editSearchLnk\"><a onclick=\"view.searchView.showHideEditSearch();\">Edit Search</a></li>\n\t\t\t\t\t\t    <li id=\"refineSearchLnk\"><a onclick=\"view.searchView.showHideRefineSearch();return false;\">Refine Search</a></li>\n\t\t\t\t\t   \t\t<li class=\"lastli\"><a onclick=\"view.searchView.clearSearchResults();return false;\">Cancel</a></li>\n\t\t\t\t\t    </ul>\n\t\t\t\t\t</dt>\n\t\t    \t</div>\n\t\t\t\t<div id=\"mqrefinecont\">\n\t\t\t\t\t<dd>\n\t\t\t\t\t\t<div class=\"clear\" id=\"mqrefinesearch\">\n\t\t\t\t           <!-- <div dojoType=\"mq.widget.TwoLineSearchForm\" prefix=\"srch\" id=\"srchform\">\n\t\t\t\t            </div> -->\n\t\t\t\t         </div>\n\t\t\t\t\t</dd>\n\t\t\t\t</div>\t    \t\n\t\t    \t<div id=\"mqshowhide-refine\">\n\t\t    \t \t<div>\n\t\t    \t \t\t<div class=\"fltl\"><label>Refine Search</label></div>\n\t\t    \t \t\t<div class=\"fltr\"><img src=\"${imagePath}/btn-close.png\" class=\"\" alt=\"Close\" width=\"16\" height=\"16\" onclick=\"javascript:view.searchView.showHideRefineSearch();return false;\"/></div>\n\t\t    \t \t</div>\n\t\t    \t \t<div id=\"refinecont\">\n\t\t\t\t\t\t<div class=\"refine-radius\">\n\t\t\t\t\t\t\t<label for=\"mqrefine-radius\">Radius</label><br/>\n\t\t\t\t\t\t\t<select id=\"refine-distance\" onchange=\"javascript:view.searchView.refineSearch(this, 'distance')\">\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div name=\"refine-city\" class=\"refine-city\">\n\t\t\t\t\t\t\t<label for=\"mqrefine-city\">City</label><br/>\n\t\t\t\t\t\t\t<select onchange=\"javascript:view.searchView.refineSearch(this, 'city')\" id=\"mqrefine-city\">\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div name=\"refine-cat\" class=\"refine-cat\">\n\t\t\t\t\t\t\t<label for=\"mqrefine-cat\">Category</label><br/>\n\t\t\t\t\t\t\t<select onchange=\"javascript:view.searchView.refineSearch(this, 'category')\" id=\"mqrefine-cat\">\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clearb\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"sortbytab\" class=\"sortbytabwidget\" style=\"display:block;\">\n\t\t\t\t\t<ul class=\"sortby\">\n\t\t\t\t\t    <li id=\"distancesort\" class=\"current\">\n\t\t\t\t\t\t\t<span dojoAttachEvent=\"onclick: onSortDistanceHandler\">Distance</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"relevancesort\">\n\t\t\t\t\t\t\t<span dojoAttachEvent=\"onclick: onSortRelevanceHandler\">Relevance</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"alphasort\">\n\t\t\t\t\t\t\t<span dojoAttachEvent=\"onclick: onSortAlphaHandler\">A to Z</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\t\n\t\t\t\t<div id=\"pageSummaryTop\">\n\t\t\t\t\t<div dojoattachpoint=\"paginationSummary\" style=\"display:inline;\">\n\t\t\t\t\t\t${start}-${end} of ${tmpAvailable}\n\t\t\t\t\t</div>\n\t\t\t\t\t<a dojoAttachPoint=\"previousLinkExp\" dojoAttachEvent=\"onclick: onPreviousHandler\">&laquo; previous</a>&nbsp;&nbsp;\n\t\t\t\t\t<a dojoAttachPoint=\"nextLinkExp\" dojoAttachEvent=\"onclick: onNextHandler\">next &raquo;</a>\n\t\t\t\t</div>\t\n\t\t\t</div>\n\t\t\t<div id=\"srchControlLine\">&nbsp;</div>\n\t\t\t<div id=\"placesCont\">\n\t\t\t\t<div id=\"resultContainer\">\n\t\t\t\t\t<ul id=\"mqsortnav\" style=\"display:none;\">\n\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\n\t\t\t\t\t<ul id=\"resultList\" class=\"results\">\n\t\t\t\t\t\t<li id=\"resultItem0\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\"> \n\t\t\t\t\t\t\t<div id=\"spt0\" class=\"resultNumber\"><span>1</span></div>\n\t\t\t\t\t\t\t<div id=\"pane0\" class=\"resultDetail\"></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button0\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem1\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt1\" class=\"resultNumber\"><span>2</span></div>\n\t\t\t\t\t\t\t<div id=\"pane1\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button1\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem2\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt2\" class=\"resultNumber\"><span>3</span></div>\n\t\t\t\t\t\t\t<div id=\"pane2\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button2\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem3\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt3\" class=\"resultNumber\"><span>4</span></div>\n\t\t\t\t\t\t\t<div id=\"pane3\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button3\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem4\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt4\" class=\"resultNumber\"><span>5</span></div>\n\t\t\t\t\t\t\t<div id=\"pane4\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button4\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem5\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt5\" class=\"resultNumber\"><span>6</span></div>\n\t\t\t\t\t\t\t<div id=\"pane5\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button5\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem6\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt6\" class=\"resultNumber\"><span>7</span></div>\n\t\t\t\t\t\t\t<div id=\"pane6\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button6\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem7\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt7\" class=\"resultNumber\"><span>8</span></div>\n\t\t\t\t\t\t\t<div id=\"pane7\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button7\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem8\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt8\" class=\"resultNumber\"><span>9</span></div>\n\t\t\t\t\t\t\t<div id=\"pane8\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button8\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li id=\"resultItem9\" dojoAttachEvent=\"onmouseover: rolloverHandler\" class=\"resultItemClass clear\">\n\t\t\t\t\t\t\t<div id=\"spt9\" class=\"resultNumber\"><span>10</span></div>\n\t\t\t\t\t\t\t<div id=\"pane9\" class=\"resultDetail\" ></div>\n\t\t\t\t\t\t\t<div class=\"resultBtn\"><input type=\"button\" id=\"button9\" class=\"btn\" dojoAttachEvent=\"onclick: selectionHandler\" value=\"${buttonLabel}\"/></div>\n\t\t\t\t\t\t</li>\t\t\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"pageSummary\">\n\t\t\t\t\t<div dojoattachpoint=\"paginationSummary\" style=\"display:inline;\">\n\t\t\t\t\t\t${start}-${end} of ${tmpAvailable}\n\t\t\t\t\t</div>\n\t\t\t\t\t<a dojoAttachPoint=\"previousLink\" dojoAttachEvent=\"onclick: onPreviousHandler\">&laquo; previous</a>&nbsp;&nbsp;\n\t\t\t\t\t<a dojoAttachPoint=\"nextLink\" dojoAttachEvent=\"onclick: onNextHandler\">next &raquo;</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n   </div>\t\n</div>\n",widgetsInTemplate:true,searchResults:null,searchGutterState:null,map:null,location:null,position:0,sortType:"distance",imagePath:mqPrefix+"/cdn/images",sortTabs:[{distance:"distanceSort",alpha:"alphaSort",relevance:"relevanceSort"}],defaultDistanceList:["1","5","10","25","50"],alphabetList:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0"],initialSearchAlphaList:null,sortByChar:null,refineRadius:25,refineCity:null,refineCategory:null,filterState:null,tmpAvailable:0,bizLocatorSelection:-1,heading:"Select one:",buttonLabel:"Select",showRefineSearchLnk:false,showEditSearch:false,postMixInProperties:function(){
debug("SearchResults.postMixInProperties");
this.initParameters();
},initParameters:function(){
debug("SearchResults.initParameters");
if(this.searchResults!=null){
debug("SearchResults.initParameters  Search Results not null");
this.available=this.searchResults.availableResultCount;
this.tmpAvailable=this.available;
if(this.available>150){
this.tmpAvailable=150+"+";
}
this.sortType=this.searchResults.searchOptions.sortType;
debug("SearchResults.initParameters()  Initial Sort Type = "+this.sortType);
if(this.sortType){
var _1f6=this.sortType.charAt(0);
if(_1f6=="a"||_1f6=="alpha"){
this.sortType="alpha";
}else{
if(_1f6=="r"||_1f6=="relevance"){
this.sortType="relevance";
}else{
this.sortType="distance";
}
}
}
this.sortByChar=this.searchResults.searchOptions.sortByChar;
this.skip=this.searchResults.searchOptions.pageSkip;
this.hits=this.searchResults.searchResults.length;
this.start=this.skip+1;
this.end=this.skip+this.hits;
this.nextStart=this.skip+this.hits+1;
this.nextEnd=this.skip+this.hits+this.hits;
this.previousStart=this.skip-this.hits+1;
this.filterState=this.searchResults.filterState;
this.updateHeading();
}else{
debug("SearchResults.initParameters  Search Results is null");
this.available=0;
this.tmpAvailable=this.available;
this.skip=0;
this.hits=10;
}
debug("Search results not null4");
},getHeading:function(){
if(controller._model){
if(controller._model.blId&&controller._model.blId>0){
}else{
if(dirForm&&dirForm.results){
if(dirForm.results.length==2){
if(dirForm.results[0].availableResultCount){
return ("Select a <span class='green'>Starting</span> location:");
}else{
if(dirForm.results[1].availableResultCount){
return ("Select an <span class='red'>Ending</span> location:");
}
}
}
}
}
}
return ("Select one:");
},updateHeading:function(){
this.heading=this.getHeading();
if($d("searchSumResultsFor")){
$d("searchSumResultsFor").innerHTML=this.heading;
}
},postCreate:function(){
debug("SearchResults.postCreate");
},render:function(_1f7){
debug("SearchResults.render");
mq.hideLoadingImage();
if(this.searchResults!=null){
results=this.searchResults.searchResults;
var _1f8=this.imagePath+"/icons/";
for(i=0;i<10;i++){
if(results[i]==null){
$d("resultItem"+i).style.display="none";
}else{
$d("resultItem"+i).style.display="block";
var _1f9=$d("spt"+i);
if((this.start+i)<100){
_1f9.innerHTML="<span>"+Number(this.start+i)+"</span>";
}else{
_1f9.innerHTML="<span>"+Number(this.start+i)+"</span>";
_1.addClass(_1f9,"resultNumberBig");
}
var sb=new dojox.string.Builder();
var pane=$d("pane"+i);
sb.append("<div class=\"srchDet\">");
sb.append("<div id=\"txtTitle"+i+"\" class=\"txtTitleClass b\">"+results[i].name+"</div>");
sb.append("<div id=\"spltTitle"+i+"\" class=\"spltTitleClass\"><b onclick=\"javascript:view.searchView.paneClickHandler('pane"+i+"')\">"+results[i].name+"</b></div>").append("<div id=\"paneDetail"+i+"\" style=\"display:none\">");
if(results[i].geocodeQuality=="ADDRESS"){
sb.append(this.formatLocationNoName(results[i],i,true));
$d("button"+i).style.display="block";
}else{
sb.append(this.formatLocationNoName(results[i],i,false));
$d("button"+i).style.display="none";
}
sb.append("</div></div>");
pane.innerHTML=sb.toString();
}
}
var _1fc=_1f8+"listPin_"+_1f7+"_wide.png";
_1.query("div.resultNumber",this.domNode).forEach(function(elt){
mq.setBackgroundPng(elt,_1fc);
});
debug("Done looping");
this.changeSortTabStatus();
debug("SearchResults.render() Done changing sort tab status.");
debug("SearchResults.render() sort Type = "+this.sortType);
(this.sortType=="alpha")?this.showAlphabets():this.resetSortAttributes(this.sortType);
this.populateRefineSearchOptions();
if(this.previousStart<=0){
this.previousLink.style.display="none";
this.previousLinkExp.style.display="none";
}else{
this.previousLink.style.display="inline";
this.previousLinkExp.style.display="inline";
}
if(this.nextStart>this.available||this.nextStart>=150){
this.nextLink.style.display="none";
this.nextLinkExp.style.display="none";
}else{
this.nextLink.style.display="inline";
this.nextLinkExp.style.display="inline";
}
}
this.displaySummary();
debug("SearchResults.render() End.");
},changeSortTabStatus:function(){
var _1fe=this.location.geocodeQuality;
debug("GeocodeQuality: "+this.location.geocodeQuality);
if(this.sortType=="relevance"){
if(_1fe!=null&&_1fe!="STATE"){
$d("distancesort").className="";
}else{
$d("distancesort").className="disabled";
}
$d("alphasort").className="";
$d("relevancesort").className="current";
mq.hide($d("mqsortnav"));
}else{
if(this.sortType=="alpha"){
if(_1fe!=null&&_1fe!="STATE"){
$d("distancesort").className="";
}else{
$d("distancesort").className="disabled";
}
$d("alphasort").className="current";
$d("relevancesort").className="";
mq.show($d("mqsortnav"));
}else{
$d("distancesort").className="current";
$d("alphasort").className="";
$d("relevancesort").className="";
mq.hide($d("mqsortnav"));
}
}
debug("SearchResults.changeSortTabStatus() End ");
},showAlphabets:function(){
debug("SearchResults.showAlphabets()  start ");
if(this.searchResults!=null){
if(this.initialSearchAlphaList==null){
this.initialSearchAlphaList=[];
if(this.searchResults!=null&&this.searchResults.navigators!=null&&this.searchResults.navigators.alphaNavigators!=null){
var _1ff=this.searchResults.navigators.alphaNavigators;
var _200=0;
for(var prop in _1ff){
this.initialSearchAlphaList[_200]=prop;
_200++;
}
}
}
var _202=$d("mqsortnav");
mq.show(_202);
_202.innerHTML="";
_202.innerHTML=this.formatAlphabets(this.initialSearchAlphaList,this.alphabetList,this.sortByChar);
}
debug("SearchResults.showAlphabets()  end. ");
},populateRefineSearchOptions:function(){
if(this.searchResults!=null){
this.populateRefineDistanceOption();
this.populateRefineCityOption();
this.populateRefineCategoryOption();
this.showRevertLink(true);
}
debug("End populateRefineSearchOptions");
},populateRefineDistanceOption:function(){
debug("SearchResults: popuplateRefineDistanceOption");
this.formatRefineDistanceOption(this.defaultDistanceList,this.searchResults.searchOptions.refineRadius);
},populateRefineCityOption:function(){
debug("SearchResults.populateRefineCityOption() Start");
if(this.searchResults!=null&&this.searchResults.navigators!=null&&this.searchResults.navigators.geoNavigators!=null){
var _203=this.searchResults.navigators.geoNavigators;
if(this.searchResults.searchOptions!=null){
this.formatRefineCityOption(_203,this.searchResults.searchOptions.refineCity);
}
}
debug("SearchResults.populateRefineCityOption() End");
},populateRefineCategoryOption:function(){
if(this.searchResults!=null&&this.searchResults.navigators!=null&&this.searchResults.navigators.formatedSicsNavigators!=null){
var _204=this.searchResults.navigators.formatedSicsNavigators;
this.formatRefineCategoryOption(_204,this.searchResults.searchOptions.refineCategory);
}
},showRevertLink:function(_205){
debug("SearchResults.showRevertLink");
if(!this.showRefineSearchLnk&&!this.showEditSearch){
this.showRefineSearchLnk=true;
this.showEditSearchLnk=true;
$d("mqshowhide-search").style.display="block";
$d("mqshowhide-refine").style.display="none";
$d("mqrefinecont").style.display="none";
}
},rolloverHandler:function(evt){
var divs=evt.currentTarget.getElementsByTagName("div");
var id=divs[0].id.substring(3);
this.onRollover(parseInt(id)+this.start);
},toggleDetail:function(node){
var _20a=node.replace("pane","paneDetail");
var _20b=$d(_20a);
if(mq.isShowing(_20b)){
mq.hide(_20b);
}else{
ua.a(":MQ08LocDetails");
mq.show(_20b);
}
},onRollover:function(_20c){
},selectionHandler:function(evt){
this.onChooseLocation(evt.currentTarget.id.substring(6));
},onChooseLocation:function(_20e){
},displaySummary:function(){
if(this.searchResults!=null){
var _20f=this.start+"-"+this.end+" of "+this.tmpAvailable;
var sb=new dojox.string.Builder();
var _211=new dojox.string.Builder();
if(controller._model.searchOptions.filterState){
sb.append(this.searchResults.locationResult.query);
sb.append(" <span class=\"n\">in</span> "+this.location.state);
_211.append("<span class=\"n\">in</span> <span class=\"b\">"+this.location.state+"?</span>");
}else{
if(!this.location.state){
sb.append(this.searchResults.locationResult.query);
_211.append("?");
}else{
sb.append(" <div class=\"clearb\"></div><div class=\"fltl\">"+this.searchResults.locationResult.query+"&nbsp;</div>");
sb.append(" <div id=\"resultLoc\"><span class=\"n black\">near</span> "+mq.formatLocationSingleLine(this.location)+"</div>");
_211.append(" <span class=\"n black\">near</span> <span class=\"b\">"+mq.formatLocationSingleLine(this.location)+"?</span>");
}
}
this.summary.innerHTML=sb.toString();
this.paginationSummary.innerHTML=_20f;
if(this.searchResults.query&&this.searchResults.query.didYouMean){
$d("didYouMean").style.display="block";
mq.setBackgroundPng($d("didYouMeanIcon"),(mqPrefix+"/cdn/images/icon-warn.png"));
this.didYouMeanSummary.innerHTML="<a href='Javascript:void(0);' onclick='Javascript:view.searchView.didYouMeanSearch("+this.position+");'>"+this.searchResults.query.didYouMean+"</a> "+_211.toString();
}else{
$d("didYouMean").style.display="none";
this.didYouMeanSummary.innerHTML="";
}
if(controller._model.blId){
this.populateBLSelectList($d("bizLocatorOptions"));
mq.show($d("bizLocatorSelect"));
if(this.searchResults.query&&this.searchResults.query.originalQuery.match("sourcevendor")){
mq.hide($d("searchSumDiv"));
mq.show($d("bizLocatorResults"));
mq.hide($d("infoUSA"));
}else{
mq.show($d("searchSumDiv"));
mq.hide($d("bizLocatorResults"));
mq.show($d("infoUSA"));
if($d("resultLoc")){
mq.hide($d("resultLoc"));
}
}
}else{
mq.show($d("infoUSA"));
mq.show($d("searchSumDiv"));
mq.hide($d("bizLocatorSelect"));
}
}else{
this.summary.innerHTML="";
}
},setSearchResults:function(_212,_213){
this.searchResults=_212;
this.initParameters();
this.displaySummary();
this.render(_213);
},setLocation:function(loc){
this.location=loc;
},setPosition:function(pos){
this.position=pos;
},onPreviousHandler:function(evt){
debug("searchResults:onPreviousHandler");
ua.a(":MQ08Previous");
if(this.hits<10){
this.hits=10;
}
this.skip-=this.hits;
var _217=(controller._model.searchOptions)?controller._model.searchOptions:{};
_217.pageSkip-=this.hits;
this.onSearch(this.location,this.position,_217);
},onNextHandler:function(evt){
debug("searchResults:onNextHandler");
ua.a(":MQ08Next");
this.skip+=this.hits;
var _219=(controller._model.searchOptions)?controller._model.searchOptions:{};
_219.pageSkip+=this.hits;
debug("pageSkip: "+_219.pageSkip);
this.onSearch(this.location,this.position,_219);
},onSortDistanceHandler:function(evt){
if(_1.hasClass($d("distancesort"),"disabled")){
return;
}
ua.a(":MQ08Distance");
if(typeof (this.location.geocodeQuality)!="undefined"&&this.location.geocodeQuality!="STATE"){
this.sortType="distance";
this.resetSortAttributes(this.sortType);
var _21b=(controller._model.searchOptions)?controller._model.searchOptions:{};
_21b.sortType="distance";
_21b.pageSkip=0;
_21b.sortByChar=this.sortByChar;
this.onSearch(this.location,this.position,_21b);
}
},onSortAlphaHandler:function(evt){
ua.a(":MQ08Alpha");
this.sortType="alpha";
this.resetSortAttributes(this.sortType);
var _21d=(controller._model.searchOptions)?controller._model.searchOptions:{};
_21d.sortType="alpha";
_21d.sortByChar=this.sortByChar;
_21d.pageSkip=0;
this.onSearch(this.location,this.position,_21d);
},onSortRelevanceHandler:function(evt){
debug("SearchResults.onSortRelevanceHandler");
ua.a(":MQ08Relevance");
this.sortType="relevance";
this.resetSortAttributes(this.sortType);
var _21f=(controller._model.searchOptions)?controller._model.searchOptions:{};
_21f.sortType="relevance";
_21f.pageSkip=0;
_21f.sortByChar=this.sortByChar;
this.onSearch(this.location,this.position,_21f);
},resetSearchAttributes:function(){
debug("SearchResults.resetSearchAttributes");
this.resetSearchFilters();
this.resetSortAttributes();
},resetSearchFilters:function(){
this.refineRadius=25;
this.refineCity=this.refineCategory=this.filterState=null;
},resetSortAttributes:function(_220){
debug("SearchResults.resetSortAttributes");
this.initialSearchAlphaList=null;
this.sortByChar=null;
this.sortType=(_220==null)?"distance":_220;
},onSearch:function(loc,_222,_223){
debug("SearchResults:onSearch "+_222);
loc.formName="";
},formatLocationNoName:function(loc,_225,_226){
var str=new dojox.string.Builder();
str.append("<div id=\"resultAddrSummary"+_225+"\" class=\"resultAddrSummary\">");
str.append("<span>");
if(loc.title){
str.append(loc.title+"<br/>");
}
if(loc.addressLine1){
str.append(loc.addressLine1+"<br />");
}
if(loc.city){
str.append(loc.city);
}
if(loc.state){
(loc.city)?str.append(", "+loc.state):str.append(loc.state);
}
str.append("<div>");
if(loc.phoneNumber){
str.append(mq.util.formatPhoneNumber(loc.phoneNumber));
}
debug("Website: "+loc.website);
if(loc.website){
str.append(" | <a href=\"");
if(!mq.startsWith(loc.website,"http://")){
str.append("http://");
}
str.append(loc.website+"\" onclick=\"ua.a(':MQ08Website');return true;\" target=\"MQPlaces\">Website</a>");
}
str.append("</div></span><div class=\"distance\">");
if(loc.distance){
str.append(" ("+loc.distance+" miles away)");
}
str.append("</div>");
if(loc.sicCodes){
str.append("<div class=\"categoryLnk\" id=\"srchCategory"+_225+"\" >Category:&nbsp;");
var _228=(loc.sicCodesCommaNames).split("#");
var _229="";
for(var i=0;i<_228.length;i++){
var _22b=_228[i].split(",");
if(_22b[0]&&_22b[0].length==6){
_229+="<a class=\"categoryLnk\" onclick=\"view.searchView.onCategorySearch('"+_22b[0]+"');return false;\">"+_22b[1]+"</a>, ";
}
}
str.append(_229.substring(0,_229.length-2));
str.append("</div>");
}
if(_226){
str.append("<ul class=\"gLinks\">").append("<li class=\"firstli\"><a onClick=\"view.searchNearbyHandler(this,"+_225+", true,"+this.position+");return false;\" >Search Nearby</a></li><br/>").append("<li class=\"firstli\"><a onClick=\"view.zoomToStreetHandler("+_225+", true);return false;\">Zoom to Street</a></li>").append("<li style=\"padding-left:3px\" class=\"lastli\"><a onClick=\"view.showSTC("+_225+",true);return false;\">Send to Cell</a></li>").append("</ul>");
}
str.append("</div>");
return str.toString();
},formatAlphabets:function(_22c,_22d,_22e){
var _22f=new dojox.string.Builder();
var _230=false;
var _231=false;
_22f.append("");
var _232=new dojox.string.Builder();
for(i=0;i<27;i++){
if(_22d[i]=="O"&&this.searchGutterState!="TEXT"){
_232.append("<br/>");
}
if(_22d[i]==_22e){
_232.append("<li><b>("+((_22d[i]!="0")?_22d[i]:"#")+")</b></li>&nbsp;");
_230=true;
}else{
_231=mq.util.inArray(_22c,_22d[i]);
if(_231){
_232.append("<li><a href=\"javascript:view.searchView.onAlphaSort('"+_22d[i]+"');\">"+((_22d[i]!="0")?_22d[i]:"#")+"</a></li>&nbsp;");
}else{
_232.append("<li><b>"+((_22d[i]!="0")?_22d[i]:"#")+"</b></li>&nbsp;");
}
}
}
if(_230){
_22f.append("<li class='all'><a href=\"javascript:view.searchView.onAlphaSort('All');\">(ALL)</a>&nbsp;</li>");
}else{
_22f.append("<li class='all'><b>(ALL)</b>&nbsp;</li>");
}
_22f.append(_232.toString());
_22f.append("");
return _22f.toString();
},formatRefineDistanceOption:function(_233,_234){
var _235=$d("refine-distance");
var _236=this.location.geocodeQuality;
if(!_236||_236=="STATE"){
mq.hide(_235.parentNode);
return;
}
_235.options.length=1;
for(var _237=0;_237<_233.length;_237++){
_235.options[_237]=new Option((_233[_237]+" mi."),_233[_237]);
if(_233[_237]==_234){
_235.selectedIndex=_237;
}
}
if(_234==null){
_235.selectedIndex=3;
}
},formatRefineCityOption:function(_238,_239){
debug("SearchResults.formatRefineCityOption");
var _23a=$d("mqrefine-city");
_23a.options.length=1;
_23a.options[0]=new Option("ALL","ALL");
if(_239==null){
_23a.selectedIndex=0;
}
var _23b=1;
for(var prop in _238){
if(prop!="eventCallback"){
_23a.options[_23b]=new Option(prop+" ("+_238[prop]+")",prop.replace(", ","_").replace(" ","."));
if(_239&&(prop.replace(", ","_").replace(" ",".")).indexOf(_239)==0){
_23a.selectedIndex=_23b;
}
_23b++;
}
}
},formatRefineCategoryOption:function(_23d,_23e){
var _23f=$d("mqrefine-cat");
_23f.options.length=1;
_23f.options[0]=new Option("ALL","ALL");
var _240=1;
var _241;
var _242=false;
for(var prop in _23d){
_241=_23d[prop].split(":");
_23f.options[_240]=new Option(_241[0].replace("null ",""),_241[1]);
if(_241.length==3){
_23f.selectedIndex=_241[2].split("=")[1];
_242=true;
}
_240++;
}
if(!_242){
_23f.selectedIndex=0;
}
},blSelectHandler:function(evt){
var node=evt.currentTarget;
this.bizLocatorSelection=node.selectedIndex;
this.onBLSelect(this.bizLocatorSelection);
ua.a(":MQ08ResultsNear");
},onBLSelect:function(ind){
},populateBLSelectList:function(node){
debug("SearchResults.populateBLSelectList");
node.options.length=1;
node.options[0]=new Option("Map Center","Map Center");
debug("Added first option");
if(controller._model.locations){
var len=controller._model.locations.length;
for(var i=0;i<len;i++){
debug("Adding option: "+i);
var loc=controller._model.locations[i].location;
var text=this.alphabetList[i]+": "+mq.formatLocationSingleLine(loc);
node.options[i+1]=new Option(text,"1");
}
node.selectedIndex=(this.bizLocatorSelection<0)?len:this.bizLocatorSelection;
}
},setSearchGutterState:function(_24c){
this.searchGutterState=_24c;
}});
}
if(!_1._hasResource["mq.searchtabview"]){
_1._hasResource["mq.searchtabview"]=true;
_1.provide("mq.searchtabview");
_1.declare("mq.SearchTabView",mq.TabView,{constructor:function(_24d,_24e){
debug("SearchTabView.constructor");
this.initMap(this.getDefaultMapLocation(),mq.savedandrecent.getDefaultMapType());
debug("After connects");
MQA.EventManager.addListener(this._tileMap,"maptypechanged",_1.hitch(this,"changeMapType"));
MQA.EventManager.addListener(this._tileMap,"zoomend",_1.hitch(this,"changeZoom"));
MQA.EventManager.addListener(this._tileMap,"dragend",_1.hitch(this,"panMap"));
this.searchComScoreTracker=new mq.ComScore(this._controller,this._tileMap,"mapWindowS");
MQA.EventManager.addListener(this._tileMap,"mousedown",_1.hitch(this.searchComScoreTracker,"monitor"));
MQA.EventManager.addListener(this._tileMap,"dragend",_1.hitch(this.searchComScoreTracker,"monitor"));
debug("SearchTabView.before gutter");
this.tabView=this.tabState.normal;
this.initGutterView();
_1.connect(this,"onMapTypeChange",this._controller,"viewTypeChange");
_1.connect(this,"onPanZoomChange",this._controller,"panZoomChange");
debug("SearchTabView.after gutter");
if(window.IsTrafficEnabled=="true"){
if(window["trafficPopupContent"]){
window.initTrafficPopup("searchTrafficHelp");
}
}
debug("end of searchTabView constructor");
},imagePath:mqPrefix+"/cdn/images",iconPattern:"mapPin-{COLOR}-{VAR}.png",iconWidth:26,iconHeight:27,iconOffsetX:-3,iconOffsetY:-27,altIconWidth:25,altIconHeight:22,altIconOffsetX:-12,altIconOffsetY:-11,processSearchResults:function(_24f){
(_24f.printerFriendly)?window.showPrint():window.backToMap();
ua.a(":pv");
var _250=_24f.searchResults;
var loc=_24f.searchLocation;
var _252=_24f.searchOptions.position;
debug("searchtabview:processSearchResults "+_253);
var _253=(_24f.blColor)?_24f.blColor:"purple";
if(_250.searchResults){
var cat="";
var _255=_250.searchResults[0].sicCodesCommaNames;
try{
cat=_255.split(/,/)[1].split(/#/)[0].replace("(All) ","");
debug("Search Category: "+cat);
controller._model.searchCategory=cat;
}
catch(e){
console.warn("Error parsing category: "+_255);
}
controller._model.searchCategory=cat;
}
var w=$w("searchResults");
if(w==null){
debug("Creating search results widget.");
w=new mq.widget.SearchResults({id:"searchResults",searchResults:_250,location:loc,position:_252});
debug("Finished creating search results widget");
$d("searchWindow").appendChild(w.domNode);
w.render(_253);
_1.connect(w,"onSearch",mq,"search");
_1.connect(w,"onChooseLocation",this,"chooseLocation");
_1.connect(w,"onRollover",this,"rollover");
_1.connect(w,"onBLSelect",view,"chooseBLLocation");
}else{
w.setPosition(_252);
w.setLocation(loc);
w.setSearchResults(_250,_253);
w.updateHeading();
}
debug("Done drawing search results widget");
mq.show($d("searchResults"));
this.showSearchResults(_250.searchResults,_252,_253,loc);
if(_1.isSafari){
this._tileMap.getDeclutter().redrawLeaderLines();
}
if(window["searchForm"]){
debug("Resetting searchForm");
searchForm.locNum=_252;
}
$w("printButton").setDisabled(false);
debug("SearchTabView.processSearchResults: end");
this.updateRGForm();
mq.util.updateBrowserTitle();
this.resetYellowArrowColors();
$d("leftS").scrollTop=0;
window.setTimeout("view.searchView.fadeYellowArrow()",3000);
ua.commit();
},showSearchResults:function(_257,_258,_259,loc){
debug("SearchTabView.showSearchResults: start");
mq.hide($d("defaultSearch"));
var coll=this.getSearchPois(_257,_258,_259);
var _25c=coll.getSize();
mq.util.batchMapOps(this._tileMap,function(tm){
tm.removeAllPois();
if(_25c>0){
tm.replacePois(coll);
tm.bestFit(false,1,15);
}else{
debug("No mappable locations: "+loc);
if(loc.latitude&&loc.longitude){
tm.setCenter(new MQLatLng(loc.latitude,loc.longitude),view.searchView.zoomLevels[loc.geocodeQuality]);
}else{
if(_257&&_257.length>0&&_257[0].latitude&&_257[0].longitude){
tm.setCenter(new MQLatLng(_257[0].latitude,_257[0].longitude),view.searchView.zoomLevels[_257[0].geocodeQuality]);
}
}
}
});
debug("Calling tileMap.saveState");
this._tileMap.saveState();
debug("SearchTabView.showSearchResults: end");
},getSearchPois:function(_25e,_25f,_260){
var coll=new MQA.PoiCollection();
if(_25e!=null&&_25e.length>0){
var w=$w("searchResults");
for(var i=0;i<_25e.length;i++){
var l=_25e[i];
if(l.geocodeQuality=="ADDRESS"){
var icon=this.iconPattern.replace("{COLOR}",_260);
icon=icon.replace("{VAR}",w.start+i);
coll.add(this.createSearchPoi(l,_25f,i,icon));
}
}
}
return coll;
},openInfoWindow:function(evt){
mq.util.storeFrontInfoBubble($d("infoPhotoSearch"));
ua.a(":MQ08BUBLocDetails");
},rollover:function(_267){
var pois=this._tileMap.getPois();
for(i=0;i<pois.getSize();i++){
poi=pois.getAt(i);
if(poi.getKey().substring(5)==_267){
poi.showRolloverWindow();
break;
}
}
},clearSearchResults:function(){
if((controller._model.locations&&controller._model.locations.length>0)||(!serverResults)){
var me=this;
mq.util.batchMapOps(this._tileMap,function(tm){
tm.removeAllPois();
me.resetSearchMap();
});
var sw=$w("searchResults");
if(sw!=null){
sw.setSearchResults(null);
sw.resetSearchAttributes();
mq.hide($d("searchResults"));
mq.show($d("defaultSearch"));
}
this._controller.clearSearchObjects();
view.contentModeHandler("MAPS");
view.processModeChange(model);
ua.a(":MQ08CancelSearch");
}else{
if(serverResults){
ua.a(":MQ08CancelSearchAO");
var sb=new dojox.string.Builder();
var _26d=false;
if(serverResults.length==1){
var l=serverResults[0].locationResult;
var page="";
if(document.referrer.indexOf(mqPrefix+"/maps")>=0){
page="maps";
}else{
if(document.referrer.indexOf(mqPrefix+"/directions")>=0){
_26d=true;
}
}
if(!_26d){
sb.append("/").append(page).append("?form=maps");
if(serverResults[0].query&&serverResults[0].query.originalQuery&&serverResults[0].query.originalQuery!=""){
sb.append("&cat=").append(encodeURIComponent(serverResults[0].query.originalQuery));
}else{
if(l.name&&l.name!=""){
sb.append("&cat=").append(encodeURIComponent(l.name));
}
}
sb.append("&address=").append((l.addressLine1)?encodeURIComponent(l.addressLine1):"").append("&city=").append((l.city)?encodeURIComponent(l.city):"").append("&state=").append((l.state)?encodeURIComponent(l.state):"").append("&zipcode=").append((l.postalCode)?encodeURIComponent(l.postalCode):"").append("&country=").append((l.country)?encodeURIComponent(l.country):"");
document.location.href=sb.toString();
}
}else{
_26d=true;
}
if(_26d){
var page=(document.referrer.indexOf(mqPrefix+"/directions")==-1)?"":"directions";
sb.append("/").append(page).append("?form=directions");
for(var i=0;i<serverResults.length;i++){
var l=serverResults[i].locationResult;
var amp="&"+(i+1);
if(serverResults[i].query&&serverResults[i].query.originalQuery&&serverResults[i].query.originalQuery!=""){
sb.append(amp).append("pn=").append(encodeURIComponent(serverResults[i].query.originalQuery));
}else{
if(l.name&&l.name!=""){
sb.append(amp).append("pn=").append(encodeURIComponent(l.name));
}
}
sb.append(amp).append("a=").append(encodeURIComponent(l.addressLine1)).append(amp).append("c=").append(encodeURIComponent(l.city)).append(amp).append("s=").append(encodeURIComponent(l.state)).append(amp).append("z=").append(encodeURIComponent(l.postalCode)).append(amp).append("y=").append(encodeURIComponent(l.country)).append(amp).append("l=").append(encodeURIComponent(l.latitude)).append(amp).append("g=").append(encodeURIComponent(l.longitude));
}
document.location.href=sb.toString();
}
}
}
},chooseLocation:function(_272,_273){
debug("SearchViewTab:chooseLocation: index "+_272);
results=$w("searchResults").searchResults;
loc=results.searchResults[_272];
if(this.validateAddLocation(loc)){
if(_273){
ua.a(":MQ08BUBAddSearch");
}else{
ua.a(":MQ08AddSearch");
}
mq.showLoadingImage();
loc.geocoded=true;
if(mq.isShowing($d("mqrefinecont"))){
debug("Edit Search is open, closing...");
this.showHideEditSearch();
}
if(dirForm.results&&dirForm.results.length>0){
dirForm.results[$w("searchResults").position]={locationResult:loc};
$w("searchResults").position=null;
dirForm.handleGeocodeAjax(dirForm.idList,dirForm.results);
}else{
if(typeof (loc1Form)!="undefined"&&loc1Form.results&&loc1Form.results.length>1){
loc1Form.results[$w("searchResults").position]={locationResult:loc};
$w("searchResults").position=null;
loc1Form.handleGeocodeAjax(loc1Form.idList,loc1Form.results);
}else{
var _274=$w("searchResults").position;
debug("SearchViewTab:chooseLocation, copying object "+_274);
this._controller.addLocation(loc,_274);
$w("searchResults").position=null;
view.contentModeHandler("MAPS");
$w("send").setDisabled(false);
$w("stcButton").setDisabled(false);
}
}
}
},createSearchPoi:function(loc,_276,ind,icon){
debug("SearchTabView.createSearchPoi: "+icon);
if(_1.isSafari){
if(!this._tileMap.dcCanvasContext){
this._tileMap.createCanvas();
}
}
var _279=new MQA.MapIcon();
var _27a=new MQA.MapIcon();
_279.setImage(this.imagePath+"/icons/"+icon,this.iconWidth,this.iconHeight,false,false);
_279.setAnchorOffset(new MQA.Point(this.iconOffsetX,this.iconOffsetY));
_279.setShadow("http://img.mqcdn.com/mqtoolkit/shadow.png",0,23,23,7,true);
_27a.setImage(this.imagePath+"/icons/"+icon.replace("-","_coll-"),this.altIconWidth,this.altIconHeight,false,false);
_27a.setAnchorOffset(new MQA.Point(this.altIconOffsetX,this.altIconOffsetY));
var _27b=new MQA.LatLng(loc.latitude,loc.longitude);
var pt=new MQA.Poi(_27b);
MQA.EventManager.addListener(pt,"infowindowopen",_1.hitch(this,"openInfoWindow"));
pt.setKey("pois-"+($w("searchResults").start+ind));
pt.setIcon(_279);
pt.setAltIcon(_27a);
pt.setInfoTitleHTML(mq.util.getMiniPopupContent(loc));
var _27d="";
if(loc.geocodeQuality=="ADDRESS"){
_27d+=mq.util.getInfoPopupContent(loc,ind,true,true);
}else{
_27d+=mq.util.getInfoPopupContent(loc,ind,true,false);
}
pt.setInfoContentHTML(_27d);
return pt;
},textView:function(){
var _27e=$w("searchResults");
var _27f=true;
if(_27e!=null&&_27e.searchResults!=null){
var _280="";
if(_27f){
}
_1.removeClass($d("searchResultsContent"),"srContentSplt");
_1.addClass($d("searchResultsContent"),"srContentTxt");
var _281=(_27e.searchResults.availableResultCount>=10)?10:_27e.searchResults.availableResultCount;
for(i=0;i<_281;i++){
$d("paneDetail"+i).style.display="block";
var _282=controller._model.searchResults.searchResults;
if(_282&&controller._model.searchGutterState==this.tabState.text&&_282[i].photoURL){
if($d("sPhoto"+i).innerHTML.indexOf("img")==-1){
var _283="<img src='"+_282[i].photoURL+"' class='resultPhoto'/>";
$d("sPhoto"+i).innerHTML=_283;
}else{
$d("sPhoto"+i).style.display="";
}
}
}
}
},onAlphaSort:function(_284){
debug("SearchTabView.onAlphaSort: "+_284);
var _285=$w("searchResults");
_285.sortByChar=(_284!="All")?_284:null;
var _286=(controller._model.searchOptions)?controller._model.searchOptions:{};
_286.sortByChar=(_284!="All")?_284:null;
_286.pageSkip=0;
_285.onSearch(_285.location,_285.position,_286);
},createEditSearchForm:function(){
var _287="search";
if(!window[_287+"Form"]){
window[_287+"Form"]=new mq.searcheditform({template:"editSearch",jsId:_287+"Form",prefix:_287,formType:"editSearch",mode:"ajax",template:"editSearch",parentElem:$d("mqrefinesearch"),searchBoxStartId:_287+"-query",locationBoxStartId:_287+"-addressInput",locNum:$w("searchResults").position});
}
},showHideEditSearch:function(){
this.showHideToggle("mqrefinecont");
this.createEditSearchForm();
if($d("mqrefinecont").style.display=="block"){
ua.a(":MQ08EditSearch");
var _288=controller._model.searchLocation.query;
var _289=searchForm.getDefaultQuery();
var _28a=searchForm.getDefaultAddress();
searchForm.tmpStartLocation=$w("searchResults").location;
$d(searchForm.prefix+"0-query").value=(mq.startsWith(_288.toUpperCase(),"SOURCEVENDOR:"))?searchForm.getDefaultQuery():_288;
$d(searchForm.prefix+"0-addressInput").value=mq.formatLocationSingleLine(controller._model.searchLocation);
mq.util.helperTextOnBlurOnChange($d(searchForm.prefix+"0-query"),searchForm.getDefaultQuery());
mq.util.helperTextOnBlurOnChange($d(searchForm.prefix+"0-addressInput"),_28a);
}
this.showHideToggle("mqshowhide-search");
},showHideRefineSearch:function(){
this.showHideToggle("mqshowhide-refine");
this.showHideToggle("mqshowhide-search");
if(mq.isShowing($d("mqshowhide-refine"))){
ua.a(":MQ08RefineSearch");
}
},showHideToggle:function(fId){
var _28c=$d(fId);
if(_28c){
_28c.style.display=mq.isShowing(_28c)?"none":"block";
}
},refineSearch:function(_28d,_28e){
var _28f=$w("searchResults");
_28f.refineFilter=_28e;
var _290=(controller._model.searchOptions)?controller._model.searchOptions:{};
if(_28e=="distance"){
ua.a(":MQ08RefineRadius");
_290.refineRadius=_28d.value;
}else{
if(_28e=="city"){
ua.a(":MQ08RefineCity");
if(_28d.value=="ALL"){
_290.refineCity=null;
}else{
_290.refineCity=_28d.value;
}
}else{
if(_28e=="category"){
ua.a(":MQ08RefineCategory");
if(_28d.value=="ALL"){
_290.refineCategory=null;
}else{
_290.refineCategory=_28d.value;
}
}
}
}
_290.pageSkip=0;
_28f.onSearch(_28f.location,_28f.position,_290);
},revertRefineSearch:function(){
var _291=$w("searchResults");
_291.resetSearchFilters();
var _292=(controller._model.searchOptions)?controller._model.searchOptions:{};
_292.pageSkip=0;
_291.onSearch(_291.location,_291.position,_292);
_291.showRevertLink(false);
},didYouMeanSearch:function(_293){
var _294=$w("searchResults");
var _295=(controller._model.searchOptions)?controller._model.searchOptions:{};
var _296=_294.searchResults;
if(_296.query&&_296.query.didYouMean){
var loc=_296.locationResult;
debug("DidYouMean: "+loc.city);
loc.query=_296.query.didYouMean;
_295.filterState=(loc.geocodeQuality=="STATE")?loc.state:null;
if(dirForm.results&&dirForm.results.length>0){
dirForm.results[_293]={locationResult:loc};
dirForm.handleGeocodeAjax(dirForm.idList,dirForm.results);
}else{
_294.onSearch(loc,_293,_295);
}
}
},onCategorySearch:function(_298){
debug("SearchTabView.onCategorySearch: "+_298);
var _299=(controller._model.searchOptions)?controller._model.searchOptions:{};
_299.pageSkip=0;
var _29a=$w("searchResults");
_29a.refineFilter="category";
_299.refineCategory=_298;
_29a.onSearch(_29a.location,_29a.position,_299);
},paneClickHandler:function(id){
debug("SearchTabView.paneClickHandler: "+id);
var _29c=id.replace("pane","paneDetail");
if(!mq.isShowing($d(_29c))){
ua.a(":MQ08LocDetails");
}
this.showHideToggle(_29c);
},splitView:function(){
var _29d=$w("searchResults");
if(_29d!=null&&_29d.searchResults!=null){
_1.removeClass($d("searchResultsContent"),"srContentTxt");
_1.addClass($d("searchResultsContent"),"srContentSplt");
var _29e="";
var _29f=(_29d.searchResults.availableResultCount>=10)?10:_29d.searchResults.availableResultCount;
for(i=0;i<_29f;i++){
$d("paneDetail"+i).style.display="none";
_29e=$d("resultAddrSummary"+i);
if(_29e){
if($d("sPhoto"+i)){
$d("sPhoto"+i).style.display="none";
}
$d("resultAddrSummary"+i).parentNode.style.display="none";
}
}
$d("searchResultsContent").style.width="auto";
}
},mapView:function(){
debug("searchView.mapView: not implemented yet");
},resetSearchMap:function(){
var _2a0=controller._model.viewType;
if(_2a0==null){
_2a0=mq.savedandrecent.getDefaultMapType();
}
console.log("this");
console.log(this);
this.setDefaultMap(this.getDefaultMapLocation());
},showSTC:function(_2a1){
ua.a(":MQ08LOCS2C");
loc=results[_2a1];
var _2a2=$w("mqSTC");
if(_2a2!=null){
_2a2.hide();
_2a2.close();
}
debug(loc);
var _2a2=new mq.widget.SendToCell({id:"mqSTC",location:loc});
_1.connect(_2a2,"acceptCallback",this);
var _2a3=new mq.widget.MQPopup({id:"mqSTCPopup",position:"center",popupWidget:_2a2});
_1.connect(_2a2,"handleCancel",_2a3,"handleCancel");
},popularSearch:function(_2a4,_2a5,pos){
debug("SearchView.popularSearch");
var loc=$w("searchResults").searchResults.searchResults[_2a5];
mq.executeSearchNearby(loc,_2a4,pos);
},resetYellowArrowColors:function(){
var _2a8=$d("searchSumResults");
var _2a9=$d("yellowarrowdowncontainer");
var _2aa=$d("yellowarrowdown");
if(_2a9){
if(_2a9.filters){
try{
_2a9.filters["alpha"].opacity=1*100;
}
catch(e){
}
}else{
if(_2a9.style.opacity){
_2a9.style.opacity=1;
}
}
}
if(_2aa){
if(_2aa.filters){
try{
_2aa.filters["alpha"].opacity=1*100;
}
catch(e){
}
}else{
if(_2aa.style.opacity){
_2aa.style.opacity=1;
}
}
}
if(_2a8){
_1.style(_2a8,"backgroundColor","#fff263");
_1.style(_2a8,"borderColor","#ff7800");
}
if(_2aa&&!mq.isShowing($d("mqshowhide-refine"))&&!mq.isShowing($d("mqrefinecont"))){
_2aa.style.display="inline";
}
},fadeYellowArrow:function(){
var _2ab=$d("searchSumResults");
var _2ac=$d("yellowarrowdowncontainer");
var _2ad=$d("yellowarrowdown");
_1.animateProperty({node:_2ab,duration:2000,properties:{backgroundColor:{start:"#fff263",end:"#FFFFFF"},borderColor:{start:"#ff7800",end:"#FFFFFF"}}}).play();
if(_1.isIE==6||_1.isIE==5){
_1.animateProperty({node:_2ad,duration:2000,properties:{opacity:{start:"1",end:"0"}}}).play();
}
_1.animateProperty({node:_2ac,duration:2000,properties:{opacity:{start:"1",end:"0"}},onEnd:function(){
if(_2ad){
_2ad.style.display="none";
}
}}).play();
}});
}
if(!_1._hasResource["dojo.number"]){
_1._hasResource["dojo.number"]=true;
_1.provide("dojo.number");
_1.number.format=function(_2ae,_2af){
_2af=_1.mixin({},_2af||{});
var _2b0=_1.i18n.normalizeLocale(_2af.locale);
var _2b1=_1.i18n.getLocalization("dojo.cldr","number",_2b0);
_2af.customs=_2b1;
var _2b2=_2af.pattern||_2b1[(_2af.type||"decimal")+"Format"];
if(isNaN(_2ae)){
return null;
}
return _1.number._applyPattern(_2ae,_2b2,_2af);
};
_1.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;
_1.number._applyPattern=function(_2b3,_2b4,_2b5){
_2b5=_2b5||{};
var _2b6=_2b5.customs.group;
var _2b7=_2b5.customs.decimal;
var _2b8=_2b4.split(";");
var _2b9=_2b8[0];
_2b4=_2b8[(_2b3<0)?1:0]||("-"+_2b9);
if(_2b4.indexOf("%")!=-1){
_2b3*=100;
}else{
if(_2b4.indexOf("\u2030")!=-1){
_2b3*=1000;
}else{
if(_2b4.indexOf("\xa4")!=-1){
_2b6=_2b5.customs.currencyGroup||_2b6;
_2b7=_2b5.customs.currencyDecimal||_2b7;
_2b4=_2b4.replace(/\u00a4{1,3}/,function(_2ba){
var prop=["symbol","currency","displayName"][_2ba.length-1];
return _2b5[prop]||_2b5.currency||"";
});
}else{
if(_2b4.indexOf("E")!=-1){
throw new Error("exponential notation not supported");
}
}
}
}
var _2bc=_1.number._numberPatternRE;
var _2bd=_2b9.match(_2bc);
if(!_2bd){
throw new Error("unable to find a number expression in pattern: "+_2b4);
}
return _2b4.replace(_2bc,_1.number._formatAbsolute(_2b3,_2bd[0],{decimal:_2b7,group:_2b6,places:_2b5.places}));
};
_1.number.round=function(_2be,_2bf,_2c0){
var _2c1=String(_2be).split(".");
var _2c2=(_2c1[1]&&_2c1[1].length)||0;
if(_2c2>_2bf){
var _2c3=Math.pow(10,_2bf);
if(_2c0>0){
_2c3*=10/_2c0;
_2bf++;
}
_2be=Math.round(_2be*_2c3)/_2c3;
_2c1=String(_2be).split(".");
_2c2=(_2c1[1]&&_2c1[1].length)||0;
if(_2c2>_2bf){
_2c1[1]=_2c1[1].substr(0,_2bf);
_2be=Number(_2c1.join("."));
}
}
return _2be;
};
_1.number._formatAbsolute=function(_2c4,_2c5,_2c6){
_2c6=_2c6||{};
if(_2c6.places===true){
_2c6.places=0;
}
if(_2c6.places===Infinity){
_2c6.places=6;
}
var _2c7=_2c5.split(".");
var _2c8=(_2c6.places>=0)?_2c6.places:(_2c7[1]&&_2c7[1].length)||0;
if(!(_2c6.round<0)){
_2c4=_1.number.round(_2c4,_2c8,_2c6.round);
}
var _2c9=String(Math.abs(_2c4)).split(".");
var _2ca=_2c9[1]||"";
if(_2c6.places){
_2c9[1]=_1.string.pad(_2ca.substr(0,_2c6.places),_2c6.places,"0",true);
}else{
if(_2c7[1]&&_2c6.places!==0){
var pad=_2c7[1].lastIndexOf("0")+1;
if(pad>_2ca.length){
_2c9[1]=_1.string.pad(_2ca,pad,"0",true);
}
var _2cc=_2c7[1].length;
if(_2cc<_2ca.length){
_2c9[1]=_2ca.substr(0,_2cc);
}
}else{
if(_2c9[1]){
_2c9.pop();
}
}
}
var _2cd=_2c7[0].replace(",","");
pad=_2cd.indexOf("0");
if(pad!=-1){
pad=_2cd.length-pad;
if(pad>_2c9[0].length){
_2c9[0]=_1.string.pad(_2c9[0],pad);
}
if(_2cd.indexOf("#")==-1){
_2c9[0]=_2c9[0].substr(_2c9[0].length-pad);
}
}
var _2ce=_2c7[0].lastIndexOf(",");
var _2cf,_2d0;
if(_2ce!=-1){
_2cf=_2c7[0].length-_2ce-1;
var _2d1=_2c7[0].substr(0,_2ce);
_2ce=_2d1.lastIndexOf(",");
if(_2ce!=-1){
_2d0=_2d1.length-_2ce-1;
}
}
var _2d2=[];
for(var _2d3=_2c9[0];_2d3;){
var off=_2d3.length-_2cf;
_2d2.push((off>0)?_2d3.substr(off):_2d3);
_2d3=(off>0)?_2d3.slice(0,off):"";
if(_2d0){
_2cf=_2d0;
delete _2d0;
}
}
_2c9[0]=_2d2.reverse().join(_2c6.group||",");
return _2c9.join(_2c6.decimal||".");
};
_1.number.regexp=function(_2d5){
return _1.number._parseInfo(_2d5).regexp;
};
_1.number._parseInfo=function(_2d6){
_2d6=_2d6||{};
var _2d7=_1.i18n.normalizeLocale(_2d6.locale);
var _2d8=_1.i18n.getLocalization("dojo.cldr","number",_2d7);
var _2d9=_2d6.pattern||_2d8[(_2d6.type||"decimal")+"Format"];
var _2da=_2d8.group;
var _2db=_2d8.decimal;
var _2dc=1;
if(_2d9.indexOf("%")!=-1){
_2dc/=100;
}else{
if(_2d9.indexOf("\u2030")!=-1){
_2dc/=1000;
}else{
var _2dd=_2d9.indexOf("\xa4")!=-1;
if(_2dd){
_2da=_2d8.currencyGroup||_2da;
_2db=_2d8.currencyDecimal||_2db;
}
}
}
var _2de=_2d9.split(";");
if(_2de.length==1){
_2de.push("-"+_2de[0]);
}
var re=_1.regexp.buildGroupRE(_2de,function(_2e0){
_2e0="(?:"+_1.regexp.escapeString(_2e0,".")+")";
return _2e0.replace(_1.number._numberPatternRE,function(_2e1){
var _2e2={signed:false,separator:_2d6.strict?_2da:[_2da,""],fractional:_2d6.fractional,decimal:_2db,exponent:false};
var _2e3=_2e1.split(".");
var _2e4=_2d6.places;
if(_2e3.length==1||_2e4===0){
_2e2.fractional=false;
}else{
if(typeof _2e4=="undefined"){
_2e4=_2e3[1].lastIndexOf("0")+1;
}
if(_2e4&&_2d6.fractional==undefined){
_2e2.fractional=true;
}
if(!_2d6.places&&(_2e4<_2e3[1].length)){
_2e4+=","+_2e3[1].length;
}
_2e2.places=_2e4;
}
var _2e5=_2e3[0].split(",");
if(_2e5.length>1){
_2e2.groupSize=_2e5.pop().length;
if(_2e5.length>1){
_2e2.groupSize2=_2e5.pop().length;
}
}
return "("+_1.number._realNumberRegexp(_2e2)+")";
});
},true);
if(_2dd){
re=re.replace(/(\s*)(\u00a4{1,3})(\s*)/g,function(_2e6,_2e7,_2e8,_2e9){
var prop=["symbol","currency","displayName"][_2e8.length-1];
var _2eb=_1.regexp.escapeString(_2d6[prop]||_2d6.currency||"");
_2e7=_2e7?"\\s":"";
_2e9=_2e9?"\\s":"";
if(!_2d6.strict){
if(_2e7){
_2e7+="*";
}
if(_2e9){
_2e9+="*";
}
return "(?:"+_2e7+_2eb+_2e9+")?";
}
return _2e7+_2eb+_2e9;
});
}
return {regexp:re.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:_2da,decimal:_2db,factor:_2dc};
};
_1.number.parse=function(_2ec,_2ed){
var info=_1.number._parseInfo(_2ed);
var _2ef=(new RegExp("^"+info.regexp+"$")).exec(_2ec);
if(!_2ef){
return NaN;
}
var _2f0=_2ef[1];
if(!_2ef[1]){
if(!_2ef[2]){
return NaN;
}
_2f0=_2ef[2];
info.factor*=-1;
}
_2f0=_2f0.replace(new RegExp("["+info.group+"\\s\\xa0"+"]","g"),"").replace(info.decimal,".");
return Number(_2f0)*info.factor;
};
_1.number._realNumberRegexp=function(_2f1){
_2f1=_2f1||{};
if(typeof _2f1.places=="undefined"){
_2f1.places=Infinity;
}
if(typeof _2f1.decimal!="string"){
_2f1.decimal=".";
}
if(typeof _2f1.fractional=="undefined"||/^0/.test(_2f1.places)){
_2f1.fractional=[true,false];
}
if(typeof _2f1.exponent=="undefined"){
_2f1.exponent=[true,false];
}
if(typeof _2f1.eSigned=="undefined"){
_2f1.eSigned=[true,false];
}
var _2f2=_1.number._integerRegexp(_2f1);
var _2f3=_1.regexp.buildGroupRE(_2f1.fractional,function(q){
var re="";
if(q&&(_2f1.places!==0)){
re="\\"+_2f1.decimal;
if(_2f1.places==Infinity){
re="(?:"+re+"\\d+)?";
}else{
re+="\\d{"+_2f1.places+"}";
}
}
return re;
},true);
var _2f6=_1.regexp.buildGroupRE(_2f1.exponent,function(q){
if(q){
return "([eE]"+_1.number._integerRegexp({signed:_2f1.eSigned})+")";
}
return "";
});
var _2f8=_2f2+_2f3;
if(_2f3){
_2f8="(?:(?:"+_2f8+")|(?:"+_2f3+"))";
}
return _2f8+_2f6;
};
_1.number._integerRegexp=function(_2f9){
_2f9=_2f9||{};
if(typeof _2f9.signed=="undefined"){
_2f9.signed=[true,false];
}
if(typeof _2f9.separator=="undefined"){
_2f9.separator="";
}else{
if(typeof _2f9.groupSize=="undefined"){
_2f9.groupSize=3;
}
}
var _2fa=_1.regexp.buildGroupRE(_2f9.signed,function(q){
return q?"[-+]":"";
},true);
var _2fc=_1.regexp.buildGroupRE(_2f9.separator,function(sep){
if(!sep){
return "(?:0|[1-9]\\d*)";
}
sep=_1.regexp.escapeString(sep);
if(sep==" "){
sep="\\s";
}else{
if(sep=="\xa0"){
sep="\\s\\xa0";
}
}
var grp=_2f9.groupSize,grp2=_2f9.groupSize2;
if(grp2){
var _300="(?:0|[1-9]\\d{0,"+(grp2-1)+"}(?:["+sep+"]\\d{"+grp2+"})*["+sep+"]\\d{"+grp+"})";
return ((grp-grp2)>0)?"(?:"+_300+"|(?:0|[1-9]\\d{0,"+(grp-1)+"}))":_300;
}
return "(?:0|[1-9]\\d{0,"+(grp-1)+"}(?:["+sep+"]\\d{"+grp+"})*)";
},true);
return _2fa+_2fc;
};
}
if(!_1._hasResource["dojox.data.dom"]){
_1._hasResource["dojox.data.dom"]=true;
_1.provide("dojox.data.dom");
_1.experimental("dojox.data.dom");
dojox.data.dom.createDocument=function(str,_302){
var _303=_1.doc;
if(!_302){
_302="text/xml";
}
if(str&&(typeof _1.global["DOMParser"])!=="undefined"){
var _304=new DOMParser();
return _304.parseFromString(str,_302);
}else{
if((typeof _1.global["ActiveXObject"])!=="undefined"){
var _305=["MSXML2","Microsoft","MSXML","MSXML3"];
for(var i=0;i<_305.length;i++){
try{
var doc=new ActiveXObject(_305[i]+".XMLDOM");
if(str){
if(doc){
doc.async=false;
doc.loadXML(str);
return doc;
}else{
console.log("loadXML didn't work?");
}
}else{
if(doc){
return doc;
}
}
}
catch(e){
}
}
}else{
if((_303.implementation)&&(_303.implementation.createDocument)){
if(str){
if(_303.createElement){
var tmp=_303.createElement("xml");
tmp.innerHTML=str;
var _309=_303.implementation.createDocument("foo","",null);
for(var i=0;i<tmp.childNodes.length;i++){
_309.importNode(tmp.childNodes.item(i),true);
}
return _309;
}
}else{
return _303.implementation.createDocument("","",null);
}
}
}
}
return null;
};
dojox.data.dom.textContent=function(node,text){
if(arguments.length>1){
var _30c=node.ownerDocument||_1.doc;
dojox.data.dom.replaceChildren(node,_30c.createTextNode(text));
return text;
}else{
if(node.textContent!==undefined){
return node.textContent;
}
var _30d="";
if(node==null){
return _30d;
}
for(var i=0;i<node.childNodes.length;i++){
switch(node.childNodes[i].nodeType){
case 1:
case 5:
_30d+=dojox.data.dom.textContent(node.childNodes[i]);
break;
case 3:
case 2:
case 4:
_30d+=node.childNodes[i].nodeValue;
break;
default:
break;
}
}
return _30d;
}
};
dojox.data.dom.replaceChildren=function(node,_310){
var _311=[];
if(_1.isIE){
for(var i=0;i<node.childNodes.length;i++){
_311.push(node.childNodes[i]);
}
}
dojox.data.dom.removeChildren(node);
for(var i=0;i<_311.length;i++){
_1._destroyElement(_311[i]);
}
if(!_1.isArray(_310)){
node.appendChild(_310);
}else{
for(var i=0;i<_310.length;i++){
node.appendChild(_310[i]);
}
}
};
dojox.data.dom.removeChildren=function(node){
var _314=node.childNodes.length;
while(node.hasChildNodes()){
node.removeChild(node.firstChild);
}
return _314;
};
dojox.data.dom.innerXML=function(node){
if(node.innerXML){
return node.innerXML;
}else{
if(node.xml){
return node.xml;
}else{
if(typeof XMLSerializer!="undefined"){
return (new XMLSerializer()).serializeToString(node);
}
}
}
};
}
if(!_1._hasResource["mq.widget.RecentSearches"]){
_1._hasResource["mq.widget.RecentSearches"]=true;
_1.provide("mq.widget.RecentSearches");
_1.declare("mq.widget.RecentSearches",[dijit._Widget,dijit._Templated],{templateString:"<div id=\"${id}\"  dojoattachpoint=\"wrapper\">\n\t<!--start repeat-->\n\t<div id=\"${id}RecentSearchesRow0\">\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch0\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation0\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\n\t\t\t\t<div id=\"${id}RecentSearchLocation0\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap0\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT0\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF0\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\t\t\t\t\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN0\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC0\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!-- <li class='lastli' ><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE0\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\n\t\t</div>\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch1\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation1\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\n\t\t\t\t<div id=\"${id}RecentSearchLocation1\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap1\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT1\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF1\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\t\t\t\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN1\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC1\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE1\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"clearb spacer\">&nbsp;</div>\n\t</div>\n\t<!--end repeat-->\n\t<!--start repeat-->\n\t<div id=\"${id}RecentSearchesRow1\">\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch2\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation2\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\n\t\t\t\t<div id=\"${id}RecentSearchLocation2\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap2\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT2\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF2\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN2\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC2\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE2\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\n\t\t</div>\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch3\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation3\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\t\t\t\n\t\t\t\t<div id=\"${id}RecentSearchLocation3\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap3\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT3\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF3\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN3\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC3\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE3\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\t\t\t\t\n\t\t</div>\n\t\t<div class=\"clearb spacer\"></div>\n\t</div>\t\n\t<!--end repeat-->\n\t<!--start repeat-->\n\t<div id=\"${id}RecentSearchesRow2\">\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch4\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation4\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\t\t\t\n\t\t\t\t<div id=\"${id}RecentSearchLocation4\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap4\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT4\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF4\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN4\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC4\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE4\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\t\t\t\t\n\t\t</div>\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch5\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation5\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\t\t\t\n\t\t\t\t<div id=\"${id}RecentSearchLocation5\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap5\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT5\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF5\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN5\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC5\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li>\t<!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE5\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\n\t\t</div>\n\t\t<div class=\"clearb spacer\">&nbsp;</div>\n\t</div>\n\t<!--end repeat-->\n\t<!--start repeat-->\n\t<div id=\"${id}RecentSearchesRow3\">\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch6\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation6\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\t\t\t\n\t\t\t\t<div id=\"${id}RecentSearchLocation6\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap6\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT6\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF6\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN6\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC6\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE6\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch7\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation7\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\t\t\t\n\t\t\t\t<div id=\"${id}RecentSearchLocation7\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap7\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT7\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF7\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN7\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC7\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE7\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"clearb spacer\"></div>\n\t</div>\t\n\t<!--end repeat-->\n\t<!--start repeat-->\n\t<div id=\"${id}RecentSearchesRow4\">\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch8\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation8\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\n\t\t\t\t<div id=\"${id}RecentSearchLocation8\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap8\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT8\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF8\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN8\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC8\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE8\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"myRecent\" id=\"${id}RecentSearch9\">\n\t\t\t<div class=\"myRecentCheckDiv\"><input type=\"checkbox\" class=\"radio\" id=\"${id}DeleteLocation9\" /></div>\n\t\t\t<div class=\"myRecentLinks\">\t\t\t\n\t\t\t\t<div id=\"${id}RecentSearchLocation9\">\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<ul class=\"bLinks\">\n\t\t\t\t\t\t<li class='firstli'><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchMap9\" dojoAttachEvent=\"onclick: mapHandler\">Map</a></li><li><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDT9\" dojoAttachEvent=\"onclick: directionsTo\">Directions To</a></li><li class=\"lastli\"><a href onclick='Javascript:void(0);' id=\"${id}RecentSearchDF9\" dojoAttachEvent=\"onclick: directionsFrom\">Directions From</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<ul class='gLinks'>\n\t\t\t\t\t\t<li class='firstli'><a href='Javascript:void(0);' id=\"${id}RecentSearchPN9\" dojoAttachEvent=\"onclick: searchNearbyHandler\">Search Nearby</a></li><li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTC9\" dojoAttachEvent=\"onclick: showSTC\">Send to Cell</a></li><!--<li class='lastli'><a href='Javascript:void(0);' id=\"${id}RecentSearchSTE9\" dojoAttachEvent=\"onclick: showSTE\">Email</a></li> -->\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"clearb spacer\">&nbsp;</div>\n\t</div>\n\t<!--end repeat-->\n</div>\n",id:null,handleAccept:function(){
},handleCancel:function(){
},hide:function(){
debug("RecentSearchesWidget:hide");
_1.style(this.domNode,"display","none");
},clear:function(){
debug("RecentSearchesWidget:destroy");
_1._destroyElement(this.domNode);
},mapHandler:function(evt){
evt.preventDefault();
var _317=parseInt(evt.currentTarget.id.substring(evt.currentTarget.id.length-1));
var loc=mq.savedandrecent.getRecentArray(_317);
var locs=[];
locs[0]=loc;
ua.a(":MQ08LOCMap");
controller.addLocations(locs);
},directionsTo:function(evt){
evt.preventDefault();
var _31b=parseInt(evt.currentTarget.id.substring(evt.currentTarget.id.length-1));
var loc=mq.savedandrecent.getRecentArray(_31b);
mq.directionsTo(loc.name,loc.addressLine1,loc.city,loc.state,loc.postalCode,loc.country,loc.latitude,loc.longitude);
},directionsFrom:function(evt){
evt.preventDefault();
var _31e=parseInt(evt.currentTarget.id.substring(evt.currentTarget.id.length-1));
var loc=mq.savedandrecent.getRecentArray(_31e);
mq.directionsFrom(loc.name,loc.addressLine1,loc.city,loc.state,loc.postalCode,loc.country,loc.latitude,loc.longitude);
},searchNearbyHandler:function(evt){
debug("RecentSearches:searchNearbyHandler");
controller.clearBusinessLocator();
var _321=parseInt(evt.currentTarget.id.substring(evt.currentTarget.id.length-1));
var loc=mq.savedandrecent.getRecentArray(_321);
mq.showSearchNearby(evt.currentTarget,loc);
},showSTC:function(evt){
ua.a(":MQ08LOCS2C");
var _324=parseInt(evt.currentTarget.id.substring(evt.currentTarget.id.length-1));
var loc=mq.savedandrecent.getRecentArray(_324);
mq.showSTC(loc);
}});
}
if(!_1._hasResource["mq.mytabview"]){
_1._hasResource["mq.mytabview"]=true;
_1.provide("mq.mytabview");
_1.declare("mq.MyTabView",mq.TabView,{constructor:function(_326){
},updateSettingsPage:function(){
debug("mytabview:updateSettingsPage");
this.destroyRecentSearchesWidget();
this.settingsObj=mq.savedandrecent.getSettingsObj();
this.updateRecentSearchesView();
this.updateMapDirectionSettingsView();
this.updateMobileSettingsView();
this.updateHomeWorkAddrView();
if(view.homeEditInProgress){
this.editHomeAddr();
view.homeEditInProgress=false;
}
if(view.workEditInProgress){
this.editWorkAddr();
view.workEditInProgress=false;
}
},settingsObj:null,mobileHelperText:"e.g., 111-222-3333",updateRecentSearchesView:function(){
debug("mytabview:updateRecentSearchesView");
var _327=mq.savedandrecent.getRecentArray();
var _328=new mq.widget.RecentSearches({id:"recentSearch"});
$d("recentSearchesContainer").appendChild(_328.domNode);
if(_327!=null){
for(var i=0;i<_327.length;i++){
_1.style($d(_328.id+"RecentSearch"+(i)),"display","block");
$d(_328.id+"RecentSearchLocation"+(i)).innerHTML=mq.util.formatLocationSummary(_327[i]);
}
for(var i=Math.round(_327.length/2);i<5;i++){
_1.style($d(_328.id+"RecentSearchesRow"+(i)),"display","none");
}
}
},deleteSelectedRecentSearchItems:function(){
ua.a(":MQ08RecentDelete");
var _32a=mq.savedandrecent.getRecentArray();
var _32b=[];
var _32c=0;
if(_32a!=null){
var _32d=$w("recentSearch");
for(var i=0;i<_32a.length;i++){
if($d(_32d.id+"DeleteLocation"+(i)).checked){
_32b[_32c]=mq.savedandrecent.getRecentArray()[i];
_32c++;
}
}
for(var i=0;i<_32c;i++){
mq.savedandrecent.removeRecentLocation(_32b[i]);
}
this.destroyRecentSearchesWidget();
this.updateRecentSearchesView();
}
},selectAllRecentSearches:function(){
var _32f=mq.savedandrecent.getRecentArray();
if(_32f!=null){
var _330=$w("recentSearch");
for(var i=0;i<_32f.length;i++){
$d(_330.id+"DeleteLocation"+(i)).checked=true;
}
ua.a(":MQ08SelectAll");
}
},destroyRecentSearchesWidget:function(){
var _332=$w("recentSearch");
if(_332!=null){
_332.destroy();
}
},updateMapDirectionSettingsView:function(){
this.updateRLSettingsView();
this.updateDUSettingsView();
this.updateDVSettingsView();
},updateRLSettingsView:function(){
var _333=this.settingsObj.routeLanguage;
var _334=$d("mqLangSettings");
for(var i=0;i<_334.options.length;i++){
if(_334.options[i].value==_333){
_334.selectedIndex=i;
}
}
},updateDUSettingsView:function(){
var _336=this.settingsObj.distanceUnit;
var _337=$d("mqDistanceUnitsSettings");
for(var i=0;i<_337.options.length;i++){
if(_337.options[i].value==_336){
_337.selectedIndex=i;
}
}
},updateDVSettingsView:function(){
var _339=this.settingsObj.mapView;
var _33a=$d("streetmap");
var _33b=$d("aerialmap");
if(_33a.value==_339){
_33a.checked="checked";
}else{
_33b.checked="checked";
}
controller._model.viewType=null;
},updateMobileSettingsView:function(){
var _33c=this.settingsObj.sendToPhone;
var _33d=$d("mqDefaultPhNum");
_33d.value=_33c;
mq.util.helperTextOnBlurOnChange(_33d,this.mobileHelperText,12);
},updateDefaultAddrSettingsView:function(){
this.popuplateDefaultStartAddrList();
var _33e=this.settingsObj.defaultHomeWork;
var _33f=$d("mqDefaultStartAddr");
for(var i=0;i<_33f.options.length;i++){
if(_33f.options[i].value==_33e){
_33f.selectedIndex=i;
}
}
view.resizeLayout();
},popuplateDefaultStartAddrList:function(){
var _341=mq.savedandrecent.getHome();
var _342=mq.savedandrecent.getWork();
var _343=$d("mqDefaultStartAddr");
var _344=0;
_343.options.length=1;
_343.options[_344]=new Option("None","None");
_344++;
if(_341!=null&&_341.latitude&&_341.longitude){
_343.options[_344]=new Option("Home","Home");
_344++;
}
if(_342!=null&&_342.latitude&&_342.longitude){
_343.options[_344]=new Option("Work","Work");
_344++;
}
},updateHomeWorkAddrView:function(){
var _345=mq.savedandrecent.getHome();
var _346=mq.savedandrecent.getWork();
var _347=$d("homeEdit");
var _348=$d("homeAdd");
var _349=$d("workEdit");
var _34a=$d("workAdd");
var _34b=$d("homeEditAddrSummary");
var _34c=$d("workEditAddrSummary");
if(_345!=null){
_34b.innerHTML=mq.util.getLocationSummaryBody(_345,true,true);
mq.hide(_348);
mq.show(_347);
}else{
mq.hide(_347);
mq.show(_348);
}
if(_346!=null){
_34c.innerHTML=mq.util.getLocationSummaryBody(_346,true,true);
mq.hide(_34a);
mq.show(_349);
}else{
mq.hide(_349);
mq.show(_34a);
}
this.updateDefaultAddrSettingsView();
},modifyMapDirectionSettings:function(){
var _34d=$d("mqLangSettings");
var _34e=$d("mqDistanceUnitsSettings");
var _34f=$d("streetmap");
var _350=$d("aerialmap");
if(this.tmpSelectedLanguage!=null&&this.settingsObj.routeLanguage!=this.tmpSelectedLanguage){
ua.a(":MQ08"+_34d.options[_34d.selectedIndex].text);
}
if(this.tmpSelectedDU!=null&&this.settingsObj.distanceUnit!=this.tmpSelectedDU){
ua.a(":MQ08"+_34e.options[_34e.selectedIndex].text);
}
if(this.tmpSelectedView!=null&&this.settingsObj.mapView!=this.tmpSelectedView){
if(_34f.checked){
ua.a(":MQ08StreetDefault");
}else{
if(_350.checked){
ua.a(":MQ08AerialDefault");
}
}
}
this.tmpSelectedLanguage=null;
this.tmpSelectedDU=null;
this.tmpSelectedView=null;
this.settingsObj.routeLanguage=_34d.value;
this.settingsObj.distanceUnit=_34e.value;
this.settingsObj.mapView=(_34f.checked)?_34f.value:_350.value;
mq.savedandrecent.saveSettings(this.settingsObj);
this.showConfirmationMessage("myMapDirSettSaveConfirm");
},modifyMobileSettings:function(){
ua.a(":MQ08Mobile");
var _351=$d("mqDefaultPhNum").value;
var _352=mq.util.isValidPhoneNumber(_351);
if(_352){
if(_351.length==12){
_351=_351.substring(0,3)+"-"+_351.substring(4,7)+"-"+_351.substring(8,12);
}else{
if(_351.length==10){
_351=_351.substring(0,3)+"-"+_351.substring(3,6)+"-"+_351.substring(6,10);
}
}
$d("mqDefaultPhNum").value=_351;
this.settingsObj.sendToPhone=_351;
mq.savedandrecent.saveSettings(this.settingsObj);
this.showConfirmationMessage("myMobileSaveConfirm");
}else{
if(_351==""||_351=="e.g., 111-222-3333"){
this.settingsObj.sendToPhone="";
mq.savedandrecent.saveSettings(this.settingsObj);
$d("saveMobileButton").focus();
$d("mqDefaultPhNum").style.color="#666";
this.showConfirmationMessage("myMobileSaveConfirm");
}else{
var _353=new dojox.string.Builder();
_353.append("<div class=\"alert-warning\">");
_353.append("<img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">");
_353.append("<span class=\"redavoid\">"+mq.getMessage("ERROR_INVALID_PHONE")+"</span><br/><br/>");
_353.append("<div class=\"textc\">");
_353.append("<input type=\"button\" value=\"OK\" onclick=\"Javascript:$d('mqDefaultPhNum').select();$d('mqDefaultPhNum').focus();$w('confirmInvalidMobileNumber').handleAccept();\" class=\"btn\" id=\"invalidMobileNumberOk\"/>");
_353.append("</div>");
_353.append("</div>");
_353=_353.toString();
var _354=new mq.widget.MQPopup({id:"confirmInvalidMobileNumber",position:"center",popupContent:_353});
$d("invalidMobileNumberOk").focus();
}
}
return false;
},modifyDefaultAddr:function(){
var _355=$d("mqDefaultStartAddr");
if(_355.value!="None"&&_355.value!=this.settingsObj.defaultHomeWork){
ua.a(":MQ08"+_355.value+"Default");
}
this.settingsObj.defaultHomeWork=_355.value;
mq.savedandrecent.saveSettings(this.settingsObj);
this.showConfirmationMessage("myHomeWorkSaveConfirm");
view.resizeLayout();
},editHomeAddr:function(){
if(view.getCurrentMode()=="MY"&&view.homeEditInProgress!=true){
ua.a(":MQ08EditHome");
}
var _356=$d("homeEdit");
var _357=$d("homeAdd");
var _358=$d("cancelsettingsHomeAddrEdit");
var _359=mq.savedandrecent.getHome();
mq.hide(_356);
mq.show(_357);
_358.style.display="inline";
$d("settingsHome-addressInput").value=(_359==null)?$d("settingsHome-addressInput").value:mq.util.getLocationSummaryBody(_359,false,true);
$d("settingsHome-addressInput").style.color="#000";
view.resizeLayout();
},editWorkAddr:function(){
if(view.getCurrentMode()=="MY"&&view.workEditInProgress!=true){
ua.a(":MQ08EditWork");
}
var _35a=$d("workEdit");
var _35b=$d("workAdd");
var _35c=$d("cancelsettingsWorkAddrEdit");
var _35d=mq.savedandrecent.getWork();
mq.hide(_35a);
mq.show(_35b);
_35c.style.display="inline";
$d("settingsWork-addressInput").value=(_35d==null)?$d("settingsWork-addressInput").value:mq.util.getLocationSummaryBody(_35d,false,true);
$d("settingsWork-addressInput").style.color="#000";
view.resizeLayout();
},saveHomeAddr:function(id,loc){
ua.a(":MQ08AddHome");
var _360=$d("homeEdit");
var _361=$d("homeAdd");
var _362=$d("homeEditAddrSummary");
mq.savedandrecent.saveHome(loc);
mq.show(_360);
mq.hide(_361);
this.showConfirmationMessage("myHomeWorkSaveConfirm");
_362.innerHTML=mq.util.getLocationSummaryBody(loc,true,true);
this.updateDefaultAddrSettingsView();
},saveWorkAddr:function(id,loc){
ua.a(":MQ08AddWork");
var _365=$d("workEdit");
var _366=$d("workAdd");
var _367=$d("workEditAddrSummary");
mq.savedandrecent.saveWork(loc);
mq.show(_365);
mq.hide(_366);
this.showConfirmationMessage("myHomeWorkSaveConfirm");
_367.innerHTML=mq.util.getLocationSummaryBody(loc,true,true);
this.updateDefaultAddrSettingsView();
},cancelAddrEdit:function(_368){
if(_368.indexOf("Home")>=0){
this.cancelHomeAddrEdit();
}else{
if(_368.indexOf("Work")>=0){
this.cancelWorkAddrEdit();
}
}
view.resizeLayout();
},cancelHomeAddrEdit:function(){
var _369=$d("homeEdit");
var _36a=$d("homeAdd");
var _36b=$d("cancelsettingsHomeAddrEdit");
mq.show(_369);
mq.hide(_36a);
mq.hide(_36b);
view.resizeLayout();
},cancelWorkAddrEdit:function(){
var _36c=$d("workEdit");
var _36d=$d("workAdd");
var _36e=$d("cancelsettingsWorkAddrEdit");
mq.show(_36c);
mq.hide(_36d);
mq.hide(_36e);
view.resizeLayout();
},confirmClearHomeWorkAddr:function(_36f){
debug("mytabview.confirmClearHomeWorkAddr");
var _370="Home";
if(_36f.indexOf("Work")>=0){
_370="Work";
}
var _371=new dojox.string.Builder();
_371.append("<div class=\"alert-warning\">");
_371.append("<img src=\""+mqPrefix+"/cdn/images/icon-warn.gif\" height=\"25\" width=\"24\">");
_371.append("<span class=\"red\">Are you sure you would like to remove "+_370+" location?</span><br/><br/>");
_371.append("<div class=\"textc\">");
_371.append("<input type=\"button\" value=\"OK\" onclick=\"Javascript:view.myView.clear"+_370+"Addr();$w('confirmClearHomeWorkAddr').handleAccept();\" class=\"btn\" id=\"homeworkClearOk\"/>&nbsp;&nbsp;&nbsp;");
_371.append("<input type=\"button\" value=\"Cancel\" onclick=\"Javascript:$w('confirmClearHomeWorkAddr').handleCancel();\" class=\"btn\" id=\"homeworkClearCancel\"/>");
_371.append("</div>");
_371.append("</div>");
_371=_371.toString();
var _372=new mq.widget.MQPopup({id:"confirmClearHomeWorkAddr",position:"center",popupContent:_371});
},clearHomeAddr:function(){
ua.a(":MQ08ClearHome");
var _373=$d("homeEdit");
var _374=$d("homeAdd");
mq.savedandrecent.removeHome();
if(this.settingsObj.defaultHomeWork=="Home"){
this.settingsObj.defaultHomeWork="None";
mq.savedandrecent.saveSettings(this.settingsObj);
}
dojox.data.dom.removeChildren($d("homeEditAddrSummary"));
mq.hide(_373);
mq.show(_374);
var ai=$d("settingsHome-addressInput");
ai.style.color="#666";
ai.style.width="187px";
ai.value="";
this.updateDefaultAddrSettingsView();
view.resizeLayout();
},clearWorkAddr:function(){
ua.a(":MQ08ClearWork");
var _376=$d("workEdit");
var _377=$d("workAdd");
mq.savedandrecent.removeWork();
if(this.settingsObj.defaultHomeWork=="Work"){
this.settingsObj.defaultHomeWork="None";
mq.savedandrecent.saveSettings(this.settingsObj);
}
dojox.data.dom.removeChildren($d("workEditAddrSummary"));
mq.hide(_376);
mq.show(_377);
var ai=$d("settingsWork-addressInput");
ai.style.color="#666";
ai.style.width="187px";
ai.value="";
this.updateDefaultAddrSettingsView();
view.resizeLayout();
},showConfirmationMessage:function(_379,_37a){
var _37b=$d(_379);
(!!_37a)?_37b.innerHTML=_37a:_37b.innerHTML="Saved";
var _37c=[];
var _37d={node:_37b,duration:400,properties:{opacity:{start:0,end:1},backgroundColor:{start:"#F7F4E8",end:"#FFFF00"}}};
var _37e={node:_37b,duration:2000,properties:{backgroundColor:{start:"#FFFF00",end:"#F7F4E8"}}};
var _37f={node:_37b,duration:3000,properties:{opacity:{start:1,end:1}}};
var _380={node:_37b,duration:600,properties:{opacity:{start:1,end:0}}};
var _381=_1.animateProperty(_37d);
_1.connect(_381,"beforeBegin",_381,function(){
_37b.style.display="block";
});
var _382=_1.animateProperty(_380);
_1.connect(_382,"onEnd",_382,function(){
_37b.style.display="none";
});
_37c.push(_381);
_37c.push(_1.animateProperty(_37e));
_37c.push(_1.animateProperty(_37f));
_37c.push(_382);
var _383=_1.fx.chain(_37c);
_383.play();
},splitView:function(){
},tmpSelectedLanguage:null,tmpSelectedDU:null,tmpSelectedView:null,onLanguageChange:function(_384){
this.tmpSelectedLanguage=_384.value;
},onDistanceUnitsChange:function(_385){
this.tmpSelectedDU=_385.value;
},onDefaultViewChange:function(_386){
this.tmpSelectedView=_386.value;
}});
}
if(!_1._hasResource["mq.uiview"]){
_1._hasResource["mq.uiview"]=true;
_1.provide("mq.uiview");
_1.declare("mq.UIView",null,{constructor:function(_387,_388){
debug("UIView.constructor");
this._controller=_387;
_1.connect(this._controller,"onSearchResults",this,"processSearch");
var my=this;
window.setTimeout(function(){
_1.connect(window,"onresize",my,"resizeLayout");
},1000);
mq.hideLoadingImage();
_1.connect(this._controller,"onModelUpdate",this,"updateView");
_1.query("#tabList li").forEach(function(_38a){
_1.connect(_38a,"onclick",my,"tabHandler");
});
dwr.engine.setPostHook(mq.hideLoadingImage);
dwr.engine.setErrorHandler(this.errorHandler);
dwr.engine._lookup=function(){
return null;
};
},searchView:null,mapView:null,myView:null,ranFirst:false,homeEditInProgress:false,workEditInProgress:false,reloadPage:function(){
window.location.href="/";
if(_1.isSafari){
window.location.href="/";
}
return false;
},errorHandler:function(msg){
console.error("DWR Error Handler: "+msg);
UIService.log("ERROR",(model.fromClassic?"classic":"general"),window.location.href,mq.getBrowser()+": "+msg);
mq.handleFormErrorPopups(null,"<span class=\"redavoid\">"+mq.getMessage("ERROR_GENERIC")+"</span>");
},updateView:function(_38c){
debug("UIView.updateView: ");
if(!_38c.searchGutterState||_38c.searchGutterState==""){
_38c.searchGutterState="NORMAL";
}
if(_38c.mode){
_1.removeClass($d("content"),"MAPS");
_1.removeClass($d("content"),"SEARCH");
_1.removeClass($d("content"),"MY");
_1.addClass($d("content"),_38c.mode+"");
}
if(_38c.mode=="SEARCH"){
if(_38c.searchLocation&&_38c.searchResults==null){
var _38d=_38c.searchOptions;
var skip=(parseInt(_38d.pageSkip))?parseInt(_38d.pageSkip):0;
if(_38c.blId&&parseInt(_38c.blId)){
_38c.searchLocation.query="sourcevendor:"+_38c.blId;
}
mq.search(_38c.searchLocation,0,_38d);
return;
}
this.contentModeHandler("SEARCH");
this.processModeChange(_38c);
}else{
if(_38c.mode=="MY"){
this.contentModeHandler("MY");
this.processModeChange(_38c);
}else{
if(!_38c.mode){
_38c.mode="MAPS";
}
(this.mapView==null)?this.initMapView():this.mapView.updateView(_38c);
this.contentModeHandler("MAPS");
this.processModeChange(_38c);
if(controller.showAvoidsRestoreLink()){
if($d("avoidRestore")){
$d("avoidRestore").style.display="block";
}
}else{
if($d("avoidRestore")){
$d("avoidRestore").style.display="none";
}
}
mq.traffic.enable(view.mapView._tileMap,_38c.trafficEnabled);
}
}
},contentModeHandler:function(mode,flag){
debug("UIView.contentModeHandler: "+mode+","+flag);
if(mq.isShowing($d(mode))){
return;
}
var _391=$d(mode);
var _392=_391.parentNode;
var lis=_392.childNodes;
var dv;
debug(_391);
for(var x=0;x<lis.length;x++){
dv=lis[x];
(_391!==dv)?_1.removeClass($d("content"),dv.id):_1.addClass($d("content"),dv.id);
if(_391!==dv&&_1.hasClass(dv,"contentPane")){
mq.hide(dv);
}
}
mq.show(_391);
this._controller.modeChange(mode);
},processModeChange:function(_396){
var _397=this.getCurrentMode();
debug("UIView.processModeChange: "+_397);
_1.removeClass($d("content"),"MAPS");
_1.removeClass($d("content"),"SEARCH");
_1.removeClass($d("content"),"MY");
_1.addClass($d("content"),_397+"");
if(_397=="MAPS"){
var locs=controller._model.locations;
if(locs){
(locs.length>0)?mq.show($d("itin")):mq.hide($d("itin"));
}
if(this.mapView==null){
debug("Initializing mapView");
this.initMapView();
}else{
this.resizeLayout();
}
mq.show($d("contentBizLocArea"));
mq.show($d("menuBarPane"));
mq.show($d("linktothis"));
mq.hide($d("infoUSA"));
$w("stcButton").setDisabled(false);
}else{
if(_397=="MY"){
mq.hide($d("itin"));
if(this.myView==null){
$w(_397).onLoad=function(e){
view.initMyView();
$d("mqLangSettings").focus();
};
$w(_397).setHref("/controller/mainui/my");
}else{
this.myView.updateSettingsPage();
}
mq.hide($d("contentBizLocArea"));
mq.hide($d("menuBarPane"));
mq.hide($d("linktothis"));
this.resizeLayout();
}else{
if(_397=="SEARCH"){
if($d("top-header-container")){
mq.util.scrollElemToView($d("top-header-container"));
}
mq.hide($d("itin"));
if(this.searchView==null){
debug("Initializing searchView");
this.initSearchView(_396);
}else{
debug("searchView already initialized");
this.processSearch(_396);
this.searchView.initGutterView();
}
mq.show($d("contentBizLocArea"));
mq.show($d("menuBarPane"));
mq.show($d("linktothis"));
$w("stcButton").setDisabled(true);
}
}
}
},getCurrentMode:function(){
return controller._model.mode;
},processSearch:function(_39a){
debug("UIView:processSearch ");
if(_39a&&_39a.searchResults){
this.searchView.processSearchResults(_39a);
}
mq.traffic.enable(view.searchView._tileMap,_39a.trafficEnabled);
debug("UIView: processSearch: end");
},initMapView:function(){
debug("UIView.initMapView");
this.mapView=new mq.MapTabView(controller,{"mapDiv":"mapWindow","locationList":"locationWindowNarr","clearAllButton":"clearAllButton","showRouteToggle":"routeShowHideLnk"});
this.resizeLayout();
if(controller._model.locations&&controller._model.locations.length>1){
view.mapView._tileMap.bestFit(false,view.mapView.zoomLevels["MIN"],view.mapView.zoomLevels["MAX"]);
}
},initSearchView:function(_39b){
debug("UIView.initSearchView");
mq.showLoadingImage();
debug("Search onLoad event fired");
view.searchView=new mq.SearchTabView(controller,{"mapDiv":"mapWindowS","searchList":"searchWindow"});
if(!controller._model.searchResults){
mq.hideLoadingImage();
}
view.processSearch(_39b);
mq.traffic.enable(view.searchView._tileMap,_39b.trafficEnabled);
if(_39b.showPrint){
showPrint();
}
view.resizeLayout();
debug("UIView.initSearchView end");
},initMyView:function(){
if(this.myView==null){
debug("uiview.initMyView:create myView object");
this.myView=new mq.MyTabView(this._controller);
this.myView.updateSettingsPage();
}
},executeBizLocator:function(loc,sort,_39e){
var _39f={sortType:sort,filterState:_39e};
var w=$w("searchResults");
if(w){
w.showRefineSearchLnk=false;
w.showEditSearch=false;
}
mq.search(loc,null,_39f);
},chooseBLLocation:function(ind){
debug("SearchTabView.chooseBLLocation: "+ind);
var tab=controller._model.mode;
var loc,sort,_3a5;
if(tab=="MAPS"||tab=="MY"||ind>0){
if(controller._model.locations&&ind>0){
loc=controller._model.locations[ind-1].location;
if(loc.geocodeQuality=="STATE"){
_3a5=loc.state;
sort="relevance";
}
}else{
if(!view.mapView){
loc=mq.savedandrecent.getDefaultMapLocation();
if(loc&&loc.latitude&&loc.longitude){
loc.geocodeQuality="CITY";
}else{
loc={geocodeQuality:"COUNTRY",latitude:39.527596,longitude:-99.141968};
}
}else{
if(view.mapView._tileMap.getZoomLevel()<5){
sort="relevance";
loc={};
}else{
loc={latitude:view.mapView._tileMap.getCenter().lat,longitude:view.mapView._tileMap.getCenter().lng,geocodeQuality:"CITY"};
}
}
}
}else{
if(controller._model.searchLocation){
loc=controller._model.searchLocation;
}else{
if(view.searchView._tileMap.getZoomLevel()){
sort="relevance";
loc={};
}else{
loc={latitude:view.searchView._tileMap.getCenter().lat,longitude:view.searchView._tileMap.getCenter().lng,geocodeQuality:"CITY"};
}
}
}
var id=controller._model.blId;
var _3a7={};
for(prop in loc){
_3a7[prop]=loc[prop];
}
_3a7.formName="bizLocator";
_3a7.query=(parseInt(id))?"sourcevendor:"+id:id;
this.executeBizLocator(_3a7,sort,_3a5);
},settings:function(){
document.title=settingsTitle;
this.contentModeHandler("MY");
this.processModeChange(model);
ua.a(":MQ08SettingsLink");
return false;
},resizeLayout:function(){
debug("View.resizeLayout");
var _3a8=dijit.getViewport();
var _3a9=(_3a8.h>848)?Number((_3a8.h)-848+600):600;
var _3aa=this.getCurrentMode();
var _3ab=$d("contentMainWrap");
var _3ac=$d("contentContainer");
var _3ad=256;
var _3ae=779;
if(mq.isSafari3()){
_3a8.w=_3a8.w-15;
}
if(_1.isFF>0){
_3ac.style.width=(_3a8.w)+"px";
}
var _3af=null;
if(_3a8.w<_3ae){
document.body.style.width=(_3ae)+"px";
_3af=_3ae;
_3ac.style.width=_3af+"px";
_3ab.style.width=(_3af-10)+"px";
}else{
document.body.style.width="auto";
_3af=_3a8.w;
_3ac.style.width=_3af+"px";
_3ab.style.width=(_3af-10)+"px";
}
var _3b0=$d("rightrailad");
_3b0.style.width="187px";
if(_1.isSafari){
_3b0.style.cssFloat="right";
}
if(_3aa=="MAPS"){
var _3b1=$d("mapWindow");
$d("content").style.height="auto";
_3b1.style.height=(_3a9-60)+"px";
var _3b2=(_3a8.w>_3ae)?(_3a8.w-_3b0.clientWidth-31):(_3ae-_3b0.clientWidth-31);
_3b1.style.width=(_3b2-1)+"px";
$d("MAPS").style.width=(_3b2)+"px";
if(this.mapView){
this.mapView.resizeMap();
}
if(this.mapView&&!controller._model.showRoute&&this.mapView._tileMap.rtehighlight){
this.mapView._tileMap.removeRouteHighlight();
}
}else{
if(_3aa=="SEARCH"){
var _3b3=$d("SEARCH");
var _3b4=$d("mapWindowS");
var _3b5=$d("leftS");
if(_3b3&&_3b4&&_3b5){
$d("content").style.height=_3a9+"px";
_3b3.style.height=_3b4.style.height=_3b5.style.height=(_3a9-62)+"px";
var _3b6=(_3a8.w>_3ae)?(_3a8.w-_3b0.clientWidth-30):(_3ae-_3b0.clientWidth-30);
_3b4.style.width=(_3b6-265-3)+"px";
_3b3.style.width=(_3b6)+"px";
if(this.searchView){
this.searchView.resizeMap();
}
}
}else{
if(_3aa=="MY"){
if($d("recentSearchesContainer")){
if(_3a9>200){
$d("MY").style.height=(_3a9-15)+"px";
$d("recentSearchesContainer").style.height=(_3a9-($d("homeAndWork").offsetHeight)-65)+"px";
}
}
}
}
}
debug("end resizeLayout");
},adjustItineraryHeight:function(_3b7){
if(!_3b7){
var vph=dijit.getViewport().h;
_3b7=(vph>715)?_3b7=Number(vph-715+467):467;
}
},searchNearbyHandler:function(node,_3ba,_3bb,pos){
var _3bd=controller._model;
controller.clearBusinessLocator();
var loc;
if(_3bb){
loc=results[_3ba];
}else{
loc=this._controller._model.locations[_3ba].location;
}
mq.showSearchNearby(node,loc,pos);
},popularSearch:function(_3bf,_3c0,pos,_3c2,_3c3){
debug("View.popularSearch");
(_3c3)?ua.a(":MQ08BUBPopSearch"+_3c2):ua.a(":MQ08PopSearch"+_3c2);
(controller._model.mode=="MAPS")?this.mapView.popularSearch(_3bf,_3c0):this.searchView.popularSearch(_3bf,_3c0,pos);
},searchNearby:function(_3c4,pos){
debug("View.searchNearby");
var _3c6=$d("srchNrby"+_3c4).value;
(controller._model.mode=="MAPS")?this.mapView.popularSearch(_3c6,_3c4,pos):this.searchView.popularSearch(_3c6,_3c4,pos);
},zoomToStreetHandler:function(_3c7,_3c8){
var loc;
if(_3c8){
loc=results[_3c7];
this.searchView.zoomToStreet(loc);
}else{
loc=this._controller._model.locations[_3c7].location;
this.mapView.zoomToStreet(loc);
}
},onZoomToStreet:function(loc){
this.mapView.zoomToStreet(loc);
},showSTC:function(_3cb,_3cc){
ua.a(":MQ08LOCS2C");
var loc;
if(_3cc){
loc=model.searchResults.searchResults[_3cb];
}else{
loc=this._controller._model.locations[_3cb].location;
}
mq.showSTC(loc);
},adCallBack:function(){
},tabHandler:function(evt){
var id=evt.currentTarget.id.substring(3);
debug("UIView.tabHandler: "+id);
var _3d0=null;
var _3d1=null;
if(id=="Map"){
_3d0=":MQ08MapTop";
_3d1="maps0-addressInput";
}else{
if(id=="Directions"){
_3d0=":MQ08DirTop";
_3d1="dir0-addressInput";
}else{
if(id=="Web"){
_3d0=":MQ08WebTop";
_3d1="web-button";
}
}
}
if(mq.isShowing($d(id))){
$d(_3d1).focus();
return;
}else{
this.switchTabs(evt.currentTarget);
$d(_3d1).focus();
ua.a(_3d0);
}
},switchTabs:function(elem){
if(!$d("rgform")){
return;
}
_1.query("#tabList li.current").forEach(function(_3d3){
_1.removeClass(_3d3,"current");
});
_1.addClass(elem,"current");
_1.query("#rgform .topForm").forEach(function(_3d4){
if(mq.isShowing(_3d4)){
mq.hide(_3d4);
}
});
mq.show($d(elem.id.substring(3)));
},getSelectedRGFormTab:function(){
var _3d5=$d("tabList").getElementsByTagName("li");
for(var i=0;i<_3d5.length;i++){
if(_3d5[i].className=="current"){
return _3d5[i].id.substring(3);
}
}
},directionsTo:function(_3d7){
var _3d8=controller._model.locations;
if(_3d8&&_3d8.length>_3d7){
var loc=_3d8[_3d7].location;
mq.directionsTo(loc.name,loc.addressLine1,loc.city,loc.state,loc.postalCode,loc.country,loc.latitude,loc.longitude);
}
},directionsFrom:function(_3da){
var _3db=controller._model.locations;
if(_3db&&_3db.length>_3da){
var loc=_3db[_3da].location;
mq.directionsFrom(loc.name,loc.addressLine1,loc.city,loc.state,loc.postalCode,loc.country,loc.latitude,loc.longitude);
}
}});
}
if(!_1._hasResource["mq.ad"]){
_1._hasResource["mq.ad"]=true;
_1.provide("mq.ad");
mq.ad=new (function(){
var _3dd=true;
var _3de=false;
var _3df;
function _chainContinuation(){
var next=_3df;
_3df=null;
if(next){
next();
}
};
function isVisible(dv){
while(dv){
if(dv.style.display.toLowerCase()=="none"||dv.style.visibility=="hidden"){
return false;
}
dv=dv.parentNode;
if(dv.nodeName.toLowerCase()=="body"){
break;
}
}
return true;
};
function clearUacStyle(dv){
with(dv.style){
width="";
height="";
overflow="";
}
};
var _3e3={HTML:function(div,_3e5){
clearUacStyle(div);
div.innerHTML=_3e5.htmlText;
},RETAIN:function(div,_3e7){
},UAC:function(div,_3e9){
div.innerHTML="";
var _3ea="";
if(_3e9.othDclk){
_3ea=_3e9.othDclk;
}
if(div.className.match(/\bmqar-print\b/)){
_3ea+="abr=!ec;";
}
if(_3ea){
adsDOth="";
adSetOthDclk(_3ea);
}
htmlAdWH(_3e9.magicNumber,String(_3e9.width),String(_3e9.height),"AJAX",div);
with(div.style){
height=_3e9.height+"px";
width=_3e9.width+"px";
}
},NONE:function(div,_3ec){
clearUacStyle(div);
div.innerHTML="";
}};
function _extractRegionId(div){
if(!div.id){
return null;
}
var res=/^mqar\-(.+)$/.exec(div.id);
if(res){
return res[1].toLowerCase();
}
};
function _adRequest(_3ef,_3f0){
_3de=true;
AdServiceProxy.makeAdCall(_3ef,{timeout:15000,errorHandler:function(){
debug("AdServiceProxy.makeAdCall failed.  Check server logs.");
_3de=false;
_chainContinuation();
},callback:function(_3f1){
if(_3f1.report){
mq.diagnostics.diagWindowAdd("Ad_Report",_3f1.report);
}
try{
adsResetPg();
}
catch(e){
}
var _3f3=_3f1.parameters,_3f4=_3f1.report,i,e;
_3de=false;
try{
for(i in _3f3){
var _3f6=_3f3[i];
if(typeof _3f6!="object"){
continue;
}
var div=_3f0[i];
if(!div){
debug("WARN: Ad div no longer exists.");
continue;
}
var pt=_3f6.adParametersTypeString,p=_3e3[pt];
if(!p){
debug("WARN: Unexpected processor type '"+pt+"'");
continue;
}
debug("REFRESH id="+div.id+" -> "+pt);
p.call(null,div,_3f6);
}
}
finally{
_chainContinuation();
if(view&&view.adCallBack){
view.adCallBack();
}
}
}});
};
this.requestTemplate={pageView:"initial",userLocale:"en_US",userAction:"load"};
this.selectCurrentRegions=function(){
var cs,dv,rt=[],i,da=_1.query("div.mqar");
for(i=0;i<da.length;i++){
dv=da[i];
cs=dv.className||"";
if(cs.match(/\bmqar-norefresh\b/)){
continue;
}
if(!isVisible(dv)){
continue;
}
rt.push(dv);
}
return rt;
};
this.refreshRegions=function(_3ff,_400){
debug("refresh regions");
_3dd=false;
if(_3ff.length==0){
return;
}
var _401=[];
var _402={};
if(!_3ff){
_3ff=this._selectCurrentRegions();
}
var div,id,i,_406={},_407={request:_406,reportRequested:mq.diagnostics.hasDiagWindow("Ad_Report")};
_1.mixin(_406,this.requestTemplate);
if(_400){
_1.mixin(_406,_400);
}
_406.adRegionList=_401;
for(i=0;i<_3ff.length;i++){
div=_3ff[i];
id=_extractRegionId(div);
if(id){
var _408=_1.coords("mqar-"+id,false);
_401.push({adRegionId:id,left:_408.l,top:_408.t,width:_408.w,height:_408.h,x:_408.x,y:_408.y});
_402[id]=div;
}
}
this.isAdRefreshInProgress=function(){
return _3de;
};
function continuation(){
_adRequest(_407,_402);
};
if(_3de){
_3df=continuation;
}else{
_3df=null;
continuation();
}
};
})();
}
if(!_1._hasResource["mq.ua"]){
_1._hasResource["mq.ua"]=true;
_1.provide("mq.ua");
_1.declare("mq.UA",null,{_userAction:null,_userActionMapping:{":pv":{omn:{pv:true},cs:true,ad:true},":pvNoAd":{omn:{pv:true},cs:true,ad:false},":pvForced":{omn:{pv:true},cs:true,ad:true,forced:true},":pvNoAdForced":{omn:{pv:true},cs:true,ad:false,forced:true},":MQ08OffersDrop":{omn:{pv:true,an:"MQ08OffersDrop"},cs:true,ad:false},":MQ08OffersRight":{omn:{pv:true,an:"MQ08OffersRight"},cs:true,ad:false},":MQ08SettingsLink":{omn:{pv:true,an:"MQ08SettingsLink"},cs:true,ad:true,forced:true},":MQ08OffersClose":{omn:{pv:true,an:"MQ08OffersClose"},cs:true,ad:true,forced:true},":MQ08PFPrint":{omn:{an:"MQ08PFPrint"},cs:false},":MQ08PFTextMap":{omn:{pv:true,an:"MQ08PFTextMap"},cs:true,ad:true,forced:true},":MQ08PFTextOnly":{omn:{pv:true,an:"MQ08PFTextOnly"},cs:true,ad:true,forced:true},":MQ08PFReturn":{omn:{pv:true,an:"MQ08PFReturn"},cs:true,ad:true,forced:true},":MQ08PFMyMap":{omn:{pv:true,an:"MQ08PFMyMap"},cs:true,ad:true,forced:true},":MQ08PFDefaultMap":{omn:{pv:true,an:"MQ08PFDefaultMap"},cs:true,ad:true,forced:true},":MQ08PFMyView":{omn:{pv:true,an:"MQ08PFMyView"},cs:true,ad:true,forced:true},":MQ08PFShowAll":{omn:{pv:true,an:"MQ08PFShowAll"},cs:true,ad:true,forced:true},":MQ08PFTextBox":{omn:{an:"MQ08PFTextBox"},cs:false},":MQ08SettingsEdit":{omn:{pv:true,an:"MQ08SettingsEdit"},cs:true,ad:true,forced:true},":MQ08SettingsEditAO":{omn:{pv:true,an:"MQ08SettingsEdit"},cs:false,ad:false,forced:true},":MQ08SavedRecent":{omn:{an:"MQ08SavedRecent"},cs:false},":MQ08SRHome":{omn:{an:"MQ08SRHome"},cs:false},":MQ08SRWork":{omn:{an:"MQ08SRWork"},cs:false},":MQ08ClearAll":{omn:{an:"MQ08ClearAll"},cs:false},":MQ08GeoDiff":{omn:{an:"MQ08GeoDiff"},cs:false,forced:true},":MQ08Amb":{omn:{an:"MQ08Amb"},cs:false,forced:true},":MQ08Hybrid":{omn:{pv:true,an:"MQ08Hybrid"},cs:true,ad:true,forced:true},":MQ08Aerial":{omn:{pv:true,an:"MQ08Aerial"},cs:true,ad:true,forced:true},":MQ08Street":{omn:{pv:true,an:"MQ08Street"},cs:true,ad:true,forced:true},":MQ08CompassC":{omn:{pv:true,an:"MQ08CompassC"},cs:true,ad:true,forced:true},":MQ08CompassE":{omn:{pv:true,an:"MQ08CompassE"},cs:true,ad:true,forced:true},":MQ08CompassN":{omn:{pv:true,an:"MQ08CompassN"},cs:true,ad:true,forced:true},":MQ08CompassS":{omn:{pv:true,an:"MQ08CompassS"},cs:true,ad:true,forced:true},":MQ08CompassW":{omn:{pv:true,an:"MQ08CompassW"},cs:true,ad:true,forced:true},":MQ08CompassOptions":{omn:{pv:true,an:"MQ08CompassOptions"},cs:true,ad:true,forced:true},":MQ08DragE":{omn:{pv:true,an:"MQ08DragE"},cs:true,ad:true,forced:true},":MQ08DragN":{omn:{pv:true,an:"MQ08DragN"},cs:true,ad:true,forced:true},":MQ08DragNE":{omn:{pv:true,an:"MQ08DragNE"},cs:true,ad:true,forced:true},":MQ08DragNW":{omn:{pv:true,an:"MQ08DragNW"},cs:true,ad:true,forced:true},":MQ08DragS":{omn:{pv:true,an:"MQ08DragS"},cs:true,ad:true,forced:true},":MQ08DragSE":{omn:{pv:true,an:"MQ08DragSE"},cs:true,ad:true,forced:true},":MQ08DragSW":{omn:{pv:true,an:"MQ08DragSW"},cs:true,ad:true,forced:true},":MQ08DragW":{omn:{pv:true,an:"MQ08DragW"},cs:true,ad:true,forced:true},":MQ08Recenter":{omn:{pv:true,an:"MQ08Recenter"},cs:true,ad:true,forced:true},":MQ08Zoom1":{omn:{pv:true,an:"MQ08Zoom1"},cs:true,ad:true,forced:true},":MQ08Zoom10":{omn:{pv:true,an:"MQ08Zoom10"},cs:true,ad:true,forced:true},":MQ08Zoom11":{omn:{pv:true,an:"MQ08Zoom11"},cs:true,ad:true,forced:true},":MQ08Zoom12":{omn:{pv:true,an:"MQ08Zoom12"},cs:true,ad:true,forced:true},":MQ08Zoom13":{omn:{pv:true,an:"MQ08Zoom13"},cs:true,ad:true,forced:true},":MQ08Zoom14":{omn:{pv:true,an:"MQ08Zoom14"},cs:true,ad:true,forced:true},":MQ08Zoom15":{omn:{pv:true,an:"MQ08Zoom15"},cs:true,ad:true,forced:true},":MQ08Zoom16":{omn:{pv:true,an:"MQ08Zoom16"},cs:true,ad:true,forced:true},":MQ08Zoom2":{omn:{pv:true,an:"MQ08Zoom2"},cs:true,ad:true,forced:true},":MQ08Zoom20":{omn:{pv:true,an:"MQ08Zoom20"},cs:true,ad:true,forced:true},":MQ08Zoom3":{omn:{pv:true,an:"MQ08Zoom3"},cs:true,ad:true,forced:true},":MQ08Zoom4":{omn:{pv:true,an:"MQ08Zoom4"},cs:true,ad:true,forced:true},":MQ08Zoom5":{omn:{pv:true,an:"MQ08Zoom5"},cs:true,ad:true,forced:true},":MQ08Zoom6":{omn:{pv:true,an:"MQ08Zoom6"},cs:true,ad:true,forced:true},":MQ08Zoom7":{omn:{pv:true,an:"MQ08Zoom7"},cs:true,ad:true,forced:true},":MQ08Zoom8":{omn:{pv:true,an:"MQ08Zoom8"},cs:true,ad:true,forced:true},":MQ08Zoom9":{omn:{pv:true,an:"MQ08Zoom9"},cs:true,ad:true,forced:true},":MQ08Reset":{omn:{pv:true,an:"MQ08Reset"},cs:true,ad:true,forced:true},":MQ08ZoomIN":{omn:{pv:true,an:"MQ08ZoomIN"},cs:true,ad:true,forced:true},":MQ08ZoomOUT":{omn:{pv:true,an:"MQ08ZoomOUT"},cs:true,ad:true,forced:true},":MQ08ZoomStreetLevel":{omn:{pv:true,an:"MQ08ZoomStreetLevel"},cs:true,ad:true},":MQ08TrafficOn":{omn:{pv:true,an:"MQ08TrafficOn"},cs:true,ad:true,forced:true},":MQ08TrafficOff":{omn:{pv:true,an:"MQ08TrafficOff"},cs:true,ad:true,forced:true},":MQ08TRFIncidentsOn":{omn:{an:"MQ08TRFIncidentsOn"},cs:false},":MQ08TRFIncidentsOff":{omn:{an:"MQ08TRFIncidentsOff"},cs:false},":MQ08TRFConstructionOn":{omn:{an:"MQ08TRFConstructionOn"},cs:false},":MQ08TRFConstructionOff":{omn:{an:"MQ08TRFConstructionOff"},cs:false},":MQ08TrafficRefresh":{omn:{pv:true,an:"MQ08TrafficRefresh"},cs:true,ad:true,forced:true},":MQ08TRFMinLegend":{omn:{an:"MQ08TRFMinLegend"},cs:false},":MQ08TRFMaxLegend":{omn:{an:"MQ08TRFMaxLegend"},cs:false},":MQ08TRFAlertDetails":{omn:{an:"MQ08TRFAlertDetails"},cs:false},":MQ08Revise":{omn:{an:"MQ08Revise"},cs:false},":MQ08MapGutter":{omn:{pv:true,an:"MQ08MapGutter"},cs:true,ad:true,forced:true},":MQ08SplitGutter":{omn:{pv:true,an:"MQ08SplitGutter"},cs:true,ad:true,forced:true},":MQ08ExpGutter":{omn:{pv:true,an:"MQ08ExpGutter"},cs:true,ad:true,forced:true},":MQ08MapLink":{omn:{pv:true,an:"MQ08MapLink"},cs:true,ad:true,forced:true},":MQ08SplitLink":{omn:{pv:true,an:"MQ08SplitLink"},cs:true,ad:true,forced:true},":MQ08ExpLink":{omn:{pv:true,an:"MQ08ExpLink"},cs:true,ad:true,forced:true},":MQ08Edit":{omn:{an:"MQ08Edit"},cs:false},":MQ08ReorderUp":{omn:{pv:true,an:"MQ08ReorderUp"},cs:true,ad:true},":MQ08ReorderDown":{omn:{pv:true,an:"MQ08ReorderDown"},cs:true,ad:true},":MQ08DragStop":{omn:{pv:true,an:"MQ08DragStop"},cs:true,ad:true},":MQ08Find":{omn:{an:"MQ08Find"},cs:false},":MQ08MaxStops":{omn:{an:"MQ08MaxStops"},cs:false},":MQ08MinRouteMan":{omn:{an:"MQ08MinRouteMan"},cs:false},":MQ08MaxRouteMan":{omn:{an:"MQ08MaxRouteMan"},cs:false},":MQ08AvoidMan":{omn:{pv:true,an:"MQ08AvoidMan"},cs:true,ad:true},":MQ08ManMap":{omn:{an:"MQ08ManMap"},cs:false},":MQ08Hide":{omn:{an:"MQ08Hide"},cs:false},":MQ08RouteOptions":{omn:{an:"MQ08RouteOptions"},cs:false},":MQ08AvoidHigh":{omn:{pv:true,an:"MQ08AvoidHigh"},cs:true,ad:true},":MQ08AvoidSeason":{omn:{pv:true,an:"MQ08AvoidSeason"},cs:true,ad:true},":MQ08AvoidToll":{omn:{pv:true,an:"MQ08AvoidToll"},cs:true,ad:true},":MQ08ShortTime":{omn:{pv:true,an:"MQ08ShortTime"},cs:true,ad:true},":MQ08ShortDistance":{omn:{pv:true,an:"MQ08ShortDistance"},cs:true,ad:true},":MQ08ReverseRoute":{omn:{pv:true,an:"MQ08ReverseRoute"},cs:true,ad:true},":MQ08RestoreAvoid":{omn:{pv:true,an:"MQ08RestoreAvoid"},cs:true,ad:true},":MQ08SearchNearby":{omn:{an:"MQ08SearchNearby"},cs:false},":MQ08SearchNearbyClose":{omn:{an:"MQ08SearchNearbyClose"},cs:false},":MQ08PopSearch1":{omn:{pv:true,an:"MQ08PopSearch1"},cs:true,ad:true},":MQ08PopSearch2":{omn:{pv:true,an:"MQ08PopSearch2"},cs:true,ad:true},":MQ08PopSearch3":{omn:{pv:true,an:"MQ08PopSearch3"},cs:true,ad:true},":MQ08PopSearch4":{omn:{pv:true,an:"MQ08PopSearch4"},cs:true,ad:true},":MQ08PopSearch5":{omn:{pv:true,an:"MQ08PopSearch5"},cs:true,ad:true},":MQ08PopSearch6":{omn:{pv:true,an:"MQ08PopSearch6"},cs:true,ad:true},":MQ08BUBPopSearch1":{omn:{pv:true,an:"MQ08BUBPopSearch1"},cs:true,ad:true},":MQ08BUBPopSearch2":{omn:{pv:true,an:"MQ08BUBPopSearch2"},cs:true,ad:true},":MQ08BUBPopSearch3":{omn:{pv:true,an:"MQ08BUBPopSearch3"},cs:true,ad:true},":MQ08BUBPopSearch4":{omn:{pv:true,an:"MQ08BUBPopSearch4"},cs:true,ad:true},":MQ08BUBPopSearch5":{omn:{pv:true,an:"MQ08BUBPopSearch5"},cs:true,ad:true},":MQ08BUBPopSearch6":{omn:{pv:true,an:"MQ08BUBPopSearch6"},cs:true,ad:true},":MQ08SearchNearbyGo":{omn:{pv:true,an:"MQ08SearchNearbyGo"},cs:true,ad:true},":MQ08Website":{omn:{an:"MQ08Website"},cs:false},":MQ08RouteOn":{omn:{pv:true,an:"MQ08RouteOn"},cs:true,ad:true},":MQ08RouteOff":{omn:{pv:true,an:"MQ08RouteOff"},cs:true,ad:true},":MQ08Delete":{omn:{an:"MQ08Delete"},cs:false},":MQ08RemoveAll":{omn:{an:"MQ08RemoveAll"},cs:false},":MQ08AddNextLink":{omn:{an:"MQ08AddNextLink"},cs:false},":MQ08AddNextGo":{omn:{pv:true,an:"MQ08AddNextGo"},cs:true,ad:true},":MQ08DirToFromLink":{omn:{an:"MQ08DirToFromLink"},cs:false},":MQ08DirFromGo":{omn:{pv:true,an:"MQ08DirFromGo"},cs:true,ad:true},":MQ08DirToGo":{omn:{pv:true,an:"MQ08DirToGo"},cs:true,ad:true},":MQ08RouteOptions":{omn:{an:"MQ08RouteOptions"},cs:false},":MQ08RouteOptionsGo":{omn:{pv:true,an:"MQ08RouteOptionsGo"},cs:true,ad:true},":MQ08ManMap":{omn:{an:"MQ08ManMap"},cs:false},":MQ08ManMapDrag":{omn:{an:"MQ08ManMapDrag"},cs:false},":MQ08ManMapZoomIn":{omn:{an:"MQ08ManMapZoomIn"},cs:false},":MQ08ManMapZoomOut":{omn:{an:"MQ08ManMapZoomOut"},cs:false},":MQ08ManMapHide":{omn:{an:"MQ08ManMapHide"},cs:false},":MQ08PlacesForm":{omn:{pv:true,an:"MQ08PlacesForm"},cs:true},":MQ08Distance":{omn:{pv:true,an:"MQ08Distance"},cs:true,ad:true},":MQ08Alpha":{omn:{pv:true,an:"MQ08Alpha"},cs:true,ad:true},":MQ08Relevance":{omn:{pv:true,an:"MQ08Relevance"},cs:true,ad:true},":MQ08RefineSearch":{omn:{an:"MQ08RefineSearch"},cs:false},":MQ08RefineRadius":{omn:{pv:true,an:"MQ08RefineRadius"},cs:true},":MQ08RefineCity":{omn:{pv:true,an:"MQ08RefineCity"},cs:true},":MQ08RefineCategory":{omn:{pv:true,an:"MQ08RefineCategory"},cs:true},":MQ08Next":{omn:{pv:true,an:"MQ08Next"},cs:true,ad:true},":MQ08Previous":{omn:{pv:true,an:"MQ08Previous"},cs:true,ad:true},":MQ08AddSearch":{omn:{pv:true,an:"MQ08AddSearch"},cs:true,ad:true},":MQ08BUBAddSearch":{omn:{pv:true,an:"MQ08BUBAddSearch"},cs:true,ad:true},":MQ08LocDetails":{omn:{an:"MQ08LocDetails"},cs:false},":MQ08BUBLocDetails":{omn:{an:"MQ08BUBLocDetails"},cs:false},":MQ08CancelSearchAO":{omn:{an:"MQ08CancelSearch",pause:250},cs:false},":MQ08CancelSearch":{omn:{pv:true,an:"MQ08CancelSearch"},cs:true,ad:true,forced:true},":MQ08EditSearch":{omn:{an:"MQ08EditSearch"},cs:false},":MQ08EditGo":{omn:{pv:true,an:"MQ08EditGo"},cs:true,ad:true},":MQ08ResultsNear":{omn:{pv:true,an:"MQ08ResultsNear"},cs:true,ad:true},":MQ08S2OSend":{omn:{an:"MQ08S2OSend"},cs:false,ad:false},":MQ08Send":{omn:{an:"MQ08Send"},cs:false,ad:false},":MQ08LTTP":{omn:{an:"MQ08LTTP"},cs:false,ad:false},":MQ08S2C":{omn:{an:"MQ08S2C"},cs:false,ad:false},":MQ08S2O":{omn:{an:"MQ08S2O"},cs:false,ad:false},":MQ08LOCS2C":{omn:{an:"MQ08LOCS2C"},cs:false,ad:false},":MQ08LOCS2O":{omn:{an:"MQ08LOCS2O"},cs:false,ad:true},":MQ08LOCEmail":{omn:{an:"MQ08LOCEmail"},cs:false,ad:true},":MQ08Email":{omn:{an:"MQ08Email"},cs:false,ad:false},":MQ08EmailSend":{omn:{an:"MQ08EmailSend"},cs:false,ad:false},":MQ08EmailClose":{omn:{an:"MQ08EmailClose"},cs:false,ad:true},":MQ08S2CSend":{omn:{an:"MQ08S2CSend"},cs:false,ad:false},":MQ08S2CMobile":{omn:{an:"MQ08S2CMobile"},cs:false,ad:false},":MQ08S2CWAP":{omn:{an:"MQ08S2CWAP"},cs:false,ad:false},":MQ08S2CNav":{omn:{an:"MQ08S2CNav"},cs:false,ad:false},":MQ08S2CInvalidError":{omn:{an:"MQ08S2CInvalidError"},cs:false,ad:false},":MQ08S2CFailedError":{omn:{an:"MQ08S2CFailedError"},cs:false,ad:false},":MQ08S2CExceedError":{omn:{an:"MQ08S2CExceedError"},cs:false,ad:false},":MQ08S2CClose":{omn:{an:"MQ08S2CClose"},cs:false,ad:true},":MQ08DirTop":{omn:{an:"MQ08DirTop"},cs:false},":MQ08MapTop":{omn:{an:"MQ08MapTop"},cs:false},":MQ08PlaceTop":{omn:{an:"MQ08PlaceTop"},cs:false},":MQ08WebTop":{omn:{an:"MQ08WebTop"},cs:false},":MQ08WebTopGo":{omn:{an:"MQ08WebTopGo",pause:250},cs:false},":MQ08GasLink":{omn:{an:"MQ08GasLink"},cs:false},":MQ08BlogLink":{omn:{an:"MQ08BlogLink"},cs:false},":MQ08HelpLink":{omn:{an:"MQ08HelpLink"},cs:false},":MQ08BSLink":{omn:{an:"MQ08BSLink"},cs:false},":MQ08FindHelp":{omn:{an:"MQ08FindHelp"},cs:false},":MQ08LocationHelp":{omn:{an:"MQ08LocationHelp"},cs:false},":MQ08TopTabGo":{omn:{pv:true,an:"MQ08TopTabGo"},cs:true,ad:true},":MQ08Danish":{omn:{an:"MQ08Danish"},cs:false},":MQ08English":{omn:{an:"MQ08English"},cs:false},":MQ08Dutch":{omn:{an:"MQ08Dutch"},cs:false},":MQ08French":{omn:{an:"MQ08French"},cs:false},":MQ08German":{omn:{an:"MQ08German"},cs:false},":MQ08Italian":{omn:{an:"MQ08Italian"},cs:false},":MQ08Norwegian":{omn:{an:"MQ08Norwegian"},cs:false},":MQ08Spanish":{omn:{an:"MQ08Spanish"},cs:false},":MQ08Swedish":{omn:{an:"MQ08Swedish"},cs:false},":MQ08Miles":{omn:{an:"MQ08Miles"},cs:false},":MQ08Kilometers":{omn:{an:"MQ08Kilometers"},cs:false},":MQ08StreetDefault":{omn:{an:"MQ08StreetDefault"},cs:false},":MQ08AerialDefault":{omn:{an:"MQ08AerialDefault"},cs:false},":MQ08Mobile":{omn:{an:"MQ08Mobile"},cs:false},":MQ08HomeDefault":{omn:{an:"MQ08HomeDefault"},cs:false},":MQ08WorkDefault":{omn:{an:"MQ08WorkDefault"},cs:false},":MQ08AddHome":{omn:{an:"MQ08AddHome"},cs:false},":MQ08AddWork":{omn:{an:"MQ08AddWork"},cs:false},":MQ08EditHome":{omn:{an:"MQ08EditHome"},cs:false},":MQ08EditWork":{omn:{an:"MQ08EditWork"},cs:false},":MQ08ClearHome":{omn:{an:"MQ08ClearHome"},cs:false},":MQ08ClearWork":{omn:{an:"MQ08ClearWork"},cs:false},":MQ08RecentDelete":{omn:{an:"MQ08RecentDelete"},cs:false},":MQ08AddRecent":{omn:{pv:true,an:"MQ08AddRecent"},cs:true,ad:true},":MQ08LOCMap":{omn:{pv:true,an:"MQ08LOCMap"},cs:true,ad:true},":MQ08LOCDirTo":{omn:{an:"MQ08LOCDirTo",pause:250},cs:false},":MQ08LOCDirFrom":{omn:{an:"MQ08LOCDirFrom",pause:250},cs:false},":MQ08SelectAll":{omn:{an:"MQ08SelectAll"},cs:false},":MQ08Classic2":{omn:{an:"MQ08Classic2"},cs:false},":MQ08Classic3":{omn:{an:"MQ08Classic3"},cs:false},":MQ08Classic4":{omn:{an:"MQ08Classic4"},cs:false},":MQ08Classic5":{omn:{an:"MQ08Classic5"},cs:false},":MQ08ItinBlog":{omn:{an:"MQ08ItinBlog "},cs:false},":MQ08ItinLoc1":{omn:{pv:true,an:"MQ08ItinLoc1"},cs:true,ad:true},":MQ08ItinLoc2":{omn:{pv:true,an:"MQ08ItinLoc2"},cs:true,ad:true},":MQ08ItinLoc3":{omn:{pv:true,an:"MQ08ItinLoc3"},cs:true,ad:true},":MQ08ItinLoc4":{omn:{pv:true,an:"MQ08ItinLoc4"},cs:true,ad:true},":MQ08ItinLoc5":{omn:{pv:true,an:"MQ08ItinLoc5"},cs:true,ad:true},":MQ08ItinLoc6":{omn:{pv:true,an:"MQ08ItinLoc6"},cs:true,ad:true},":MQ08ItinLoc7":{omn:{pv:true,an:"MQ08ItinLoc7"},cs:true,ad:true},":MQ08ItinLoc8":{omn:{pv:true,an:"MQ08ItinLoc8"},cs:true,ad:true},":MQ08ItinLoc9":{omn:{pv:true,an:"MQ08ItinLoc9"},cs:true,ad:true},":MQ08ItinLoc10":{omn:{pv:true,an:"MQ08ItinLoc10"},cs:true,ad:true},":MQ08ItinSearch1":{omn:{pv:true,an:"MQ08ItinSearch1"},cs:true,ad:true},":MQ08ItinSearch2":{omn:{pv:true,an:"MQ08ItinSearch2"},cs:true,ad:true},":MQ08ItinSearch3":{omn:{pv:true,an:"MQ08ItinSearch3"},cs:true,ad:true},":MQ08ItinSearch4":{omn:{pv:true,an:"MQ08ItinSearch4"},cs:true,ad:true},":MQ08ItinSearch5":{omn:{pv:true,an:"MQ08ItinSearch5"},cs:true,ad:true},":MQ08ItinSearch6":{omn:{pv:true,an:"MQ08ItinSearch6"},cs:true,ad:true},":MQ08ItinSearch7":{omn:{pv:true,an:"MQ08ItinSearch7"},cs:true,ad:true},":MQ08ItinSearch8":{omn:{pv:true,an:"MQ08ItinSearch8"},cs:true,ad:true},":MQ08ItinSearch9":{omn:{pv:true,an:"MQ08ItinSearch9"},cs:true,ad:true},":MQ08ItinSearch10":{omn:{pv:true,an:"MQ08ItinSearch10"},cs:true,ad:true},":MQ08PlacesAirport1":{omn:{pv:true,an:"MQ08PlacesAirport1"},cs:true,ad:true},":MQ08PlacesAirport2":{omn:{pv:true,an:"MQ08PlacesAirport2"},cs:true,ad:true},":MQ08PlacesAirport3":{omn:{pv:true,an:"MQ08PlacesAirport3"},cs:true,ad:true},":MQ08PlacesAirport4":{omn:{pv:true,an:"MQ08PlacesAirport4"},cs:true,ad:true},":MQ08PlacesAirport5":{omn:{pv:true,an:"MQ08PlacesAirport5"},cs:true,ad:true},":MQ08PlacesSearch1":{omn:{pv:true,an:"MQ08PlacesSearch1"},cs:true,ad:true},":MQ08PlacesSearch2":{omn:{pv:true,an:"MQ08PlacesSearch2"},cs:true,ad:true},":MQ08PlacesSearch3":{omn:{pv:true,an:"MQ08PlacesSearch3"},cs:true,ad:true},":MQ08PlacesSearch4":{omn:{pv:true,an:"MQ08PlacesSearch4"},cs:true,ad:true},":MQ08PlacesSearch5":{omn:{pv:true,an:"MQ08PlacesSearch5"},cs:true,ad:true},":MQ08PlacesSearch6":{omn:{pv:true,an:"MQ08PlacesSearch6"},cs:true,ad:true},":MQ08PlacesSearch7":{omn:{pv:true,an:"MQ08PlacesSearch7"},cs:true,ad:true},":MQ08PlacesSearch8":{omn:{pv:true,an:"MQ08PlacesSearch8"},cs:true,ad:true},":MQ08PlacesSearch9":{omn:{pv:true,an:"MQ08PlacesSearch9"},cs:true,ad:true},":MQ08PlacesSearch10":{omn:{pv:true,an:"MQ08PlacesSearch10"},cs:true,ad:true},":MQ08Temporary1":{omn:{pv:true,an:"MQ08Temporary1"},cs:true,ad:true},":MQ08Temporary2":{omn:{pv:true,an:"MQ08Temporary2"},cs:true,ad:true},":MQ08Temporary3":{omn:{pv:true,an:"MQ08Temporary3"},cs:true,ad:true},":MQ08Temporary4":{omn:{pv:true,an:"MQ08Temporary4"},cs:true,ad:true},":MQ08Temporary5":{omn:{pv:true,an:"MQ08Temporary5"},cs:true,ad:true},":MQ08Temporary6":{omn:{pv:true,an:"MQ08Temporary6"},cs:true,ad:true},":MQ08Temporary7":{omn:{pv:true,an:"MQ08Temporary7"},cs:true,ad:true},":MQ08Temporary8":{omn:{pv:true,an:"MQ08Temporary8"},cs:true,ad:true},":MQ08Temporary9":{omn:{pv:true,an:"MQ08Temporary9"},cs:true,ad:true},":MQ08Temporary10":{omn:{pv:true,an:"MQ08Temporary10"},cs:true,ad:true},":MQ08TemporaryA1":{omn:{an:"MQ08TemporaryA1"},cs:false},":MQ08TemporaryA2":{omn:{an:"MQ08TemporaryA2"},cs:false},":MQ08TemporaryA3":{omn:{an:"MQ08TemporaryA3"},cs:false},":MQ08TemporaryA4":{omn:{an:"MQ08TemporaryA4"},cs:false},":dummy":{omn:{pv:false,an:"dummy"},cs:false}},_getAction:function(_409){
return this._userActionMapping[_409]||this._userActionMapping[":"];
},_getUserActionMappingType:function(_40a){
var uam=this._getAction(_40a);
if(uam){
if(uam["forced"]){
return "forced";
}else{
if(uam["omn"]){
if(uam["omn"].pv){
if(uam["omn"].an){
return "pageviewAction";
}else{
return "pageview";
}
}else{
if(uam["omn"].an){
return "action";
}
}
}
}
}else{
this.debug("Error: There was no Type mapping for User Action: '"+_40a+"'");
}
},a:function(uam){
var _40d=this._getUserActionMappingType(uam);
if(_40d=="forced"){
this._userAction=uam;
debug("Forced PV for action: "+uam);
this.commit();
}else{
if(_40d=="action"&&!this._userAction){
this._userAction=uam;
this.commit();
}else{
if(_40d=="pageviewAction"&&!this._userAction){
this._userAction=uam;
}else{
if(_40d=="pageview"&&!this._userAction){
this._userAction=uam;
}
}
}
}
},promo:function(_40e){
this._invokeOmniture({an:_40e,pause:250});
},commit:function(){
if(this._userAction){
this._fire(this._userAction);
this._userAction=null;
}
},_fire:function(name){
var _410=this._getAction(name);
if(_410){
if(_410["omn"]){
this._invokeOmniture(_410["omn"]);
}
if(_410["cs"]){
this._comScore(_410["cs"],_410["omn"]);
}
if(_410["ad"]){
var jtn=name.indexOf(":")>=0?name.substring(name.indexOf(":")+1):name;
this._invokeAd(jtn,{});
}
}else{
this.debug("Error: There was no mapping for User Action: '"+name+"'");
}
if(logOmnQueryParams){
this.debug("=======================================================================");
}
},_invokeOmniture:function(_412){
s_265.prop20=null;
s_265.prop21=null;
s_265.prop2="";
s_265.pageName="";
var _413=this._generatePageViewName();
s_265.prop22=String(mq.getScrollBarPosition().ptOffsetY);
var pv=_412.pv;
if(typeof (pv)=="boolean"){
pv=_413;
}
if(_412.pv){
var _415=this._generateProp2(pv);
s_265.prop2=s_265.pfxID+" : "+_415;
s_265.pageName=s_265.pfxID+" : "+pv;
var _416="";
if(_412.an){
s_265.prop20=_412.an;
_416=", an(prop20): "+_412.an;
}else{
s_265.prop20="none";
}
s_account=s_accountCL+",aolsvc";
this._getLogger(s_account).t();
this.debug("[omniture] pv: "+pv+", sd(prop2): '"+_415+"'"+_416);
this.debugSelenium();
}else{
s_265.prop21=_413;
s_accountCL;
this._getLogger(s_accountCL).tl(true,"o",_412.an);
if(_412.pause){
var now=new Date();
var _418=now.getTime()+_412.pause;
var _419=true;
while(_419){
now=new Date();
if(now.getTime()>_418){
_419=false;
}
}
}
s_265.sa(s_account);
this.debug("[omniture] an: "+_412.an+", pv(prop21): '"+_413+"'");
}
if(logOmnQueryParams){
this._logOmnitureQueryParams();
}
s_265.prop20=null;
s_265.prop21=null;
s_265.prop2="";
s_265.pageName="";
if(s_265.prop16){
s_265.prop16=null;
}
},_logOmnitureQueryParams:function(){
var _41a=s_265.d.images;
var _41b=null;
if(_41a&&_41a.length>0&&_41a[_41a.length-1].name&&_41a[_41a.length-1].name.indexOf(s_accountCL)>=0){
_41b=_41a[_41a.length-1];
}else{
if(_41a&&_41a.length>0){
for(var i=_41a.length-1;i>=0;i--){
var img=_41a[i];
if(img&&img.name&&img.name.indexOf(s_accountCL)>=0){
_41b=img;
break;
}
}
}
}
if(_41b){
try{
var _41e=_41b.src;
var _41f=_41e.substring(_41e.indexOf("?")+1,_41e.length);
var host=_41e.substring(0,_41e.indexOf("?"));
var _421=_41f.split("&");
var _422="";
for(var i=0;i<_421.length;i++){
var tmp=_421[i].split("=");
if(tmp.length==2){
_422+=(tmp[0]+" = "+unescape(tmp[1])+"; ");
}
}
this.debug("[omniture] URL-QueryParams: host = "+host+"; "+_422.substring(0,_422.length-2));
}
catch(e){
this.debug("[omniture] URL-QueryParams: Error in parsing Omniture query information.");
}
}else{
this.debug("[omniture] URL-QueryParams: Not able to find omniture query.");
}
},_initialAdSuppressionComplete:false,_invokeAd:function(_424,_425){
if(this._initialAdSuppressionComplete){
var pv=this._generatePageViewName(),e,_428;
if(typeof _425=="object"){
_428=_425.an;
}
if(!_428){
_428=_424;
}
try{
var us=controller.adUserStateFromModel();
var _42a=mq.ad.selectCurrentRegions();
mq.ad.refreshRegions(_42a,{userAction:_424,pageView:pv,userState:us,promotionalBrandingId:controller._model.blId});
this.debug("[ad] true");
}
catch(e){
debug("[ad] Error in ad call: ",e);
this.debug("[ad] Error in ad call.");
}
}else{
this._initialAdSuppressionComplete=true;
}
},_getLogger:function(acct){
var s=s_gi(acct);
if(!s){
return;
}
(acct==s_accountCL)?s.linkTrackVars="prop21":s.linkTrackVars="None";
s.linkTrackEvents="None";
return s;
},_initialComScoreSuppressionComplete:false,_comScore:function(fire,omn){
if(fire){
if(this._initialComScoreSuppressionComplete){
var pv="?pv="+this._generatePageViewName();
var _430="";
if(omn){
if(omn.an){
_430="&an="+omn.an;
}
}
var r="&r="+Math.round((Math.random()*10000))+"&h=2";
var _432="/mqrequest.html"+pv+_430+r;
var req=({url:_432,handleAs:"text",timeout:10000,handle:function(_434,_435){
if(_434 instanceof Error){
ua.debug("[comScore] something went horribly, horribly wrong.");
}
}});
try{
_1.xhrGet(req);
ua.debug("[comScore] pv: "+_432);
}
catch(e){
ua.debug("[comScore] something went horribly, horribly wrong. Error: "+e);
}
}else{
ua.debug("[comScore] pv: false");
this._initialComScoreSuppressionComplete=true;
}
}
if(!fire){
ua.debug("[comScore] pv: false");
}
},_generatePageViewName:function(){
if(controller&&controller._model){
var sb=new dojox.string.Builder();
var _437=controller._model;
var _438=$d("printDisplay").style.display;
if(addressPopup&&!addressPopup.closed){
return (addressPopup.name=="airports")?"address.airport":"address.category";
}
if(_437.mode=="MY"){
if($d("offersWrapper")){
sb.append("setting.offers");
}else{
sb.append("settings.default");
}
return sb.toString();
}else{
if(_437.mode=="MAPS"){
var _439=0;
if(_437.locations){
var _439=_437.locations.length;
}
var _43a=null;
if(_439>1){
sb.append("dir.results");
}else{
if(_439==1){
sb.append("map.results");
}else{
return (_438=="block")?"home.form.print":"home.form.map";
}
}
if(_438=="block"){
sb.append(".print");
}else{
if($d("offersWrapper")){
sb.append(".offers");
}else{
sb.append(".scroll");
}
}
}else{
if(_437.mode=="SEARCH"){
var _43b=0;
if($w("searchResults")){
if($w("searchResults").available){
_43b=$w("searchResults").available;
}
}
var _43c="search.results";
if(_43b==0){
return (_438=="block")?"home.form.print":"home.form.split";
}else{
if(mq.isShowing($d("bizLocatorSelect"))){
_43c="bl.results";
}
}
sb.append(_43c);
if(_438=="block"){
sb.append(".print");
}else{
if($d("offersWrapper")){
sb.append(".offers");
}else{
sb.append(".split");
}
}
}
}
return sb.toString();
}
}
return sb.toString();
},_generateProp2:function(_43d){
s_265.prop2="";
var sb=new dojox.string.Builder();
if(_43d.indexOf("print")>=0){
return "printer friendly";
}
var _43f=_43d.split(".");
if(_43f[_43f.length-1]=="offers"){
return "offers";
}
if(_43f.length>1){
if(_43f[0]=="dir"){
sb.append("directions ");
}else{
if(_43f[0]=="map"){
sb.append("map ");
}else{
if(_43f[0]=="search"){
sb.append("search ");
}else{
if(_43f[0]=="bl"){
return "business locator";
}else{
if(_43f[0]=="settings"){
return "settings";
}else{
if(_43f[0]=="address"){
return "address";
}
}
}
}
}
}
if(_43f[1]=="form"){
return "home form";
}else{
if(_43f[1]=="results"){
sb.append("results");
}
}
return sb.toString();
}else{
this.debug("Error: there was a problem generating prop2 based on pagename: >>"+_43d+"<<");
return "";
}
},debug:function(_440){
var dbgr=$d("userActionDebugger");
if(dbgr){
var _442=dbgr.value;
dbgr.value=_442+"\n"+_440;
debug(_440);
dbgr.value=dbgr.value;
dbgr.scrollTop=dbgr.scrollHeight;
}
},debugSelenium:function(){
var _443=$d("seleniumDebugger");
if(_443){
var _444=_443.value;
_443.value=_444+"\nok";
}
},showDebugger:function(){
_1.removeClass($d("userActionDebugger").parentNode,"hiddenButPresent");
$d("clearLogger").style.visibility="visible";
$d("closeLogger").style.visibility="visible";
},clear:function(){
$d("userActionDebugger").value="";
}});
}
if(!_1._hasResource["mq.weather"]){
_1._hasResource["mq.weather"]=true;
_1.provide("mq.weather");
mq.weather.show=function(node){
var _446="<div id='weatherDiv' dojoType='dijit.layout.ContentPane' style='width: 250px;height: 200px;'></div>";
var _447=_1.coords(node,true);
var _448=new mq.widget.MQPopup({id:"mqWeatherPopup",xoffset:_447.x+65,yoffset:_447.y-30,popupContent:_446,closeButtonRequired:true,closeOnBackGroundClick:true,widgetsInTemplate:true,closeAll:true,popupArrowPlacement:11,onClose:mq.weather.close});
var sb=new dojox.string.Builder();
var loc=controller._model.locations[0].location;
sb.append("/controller/weather?latitude=").append(loc.latitude).append("&longitude=").append(loc.longitude);
$w("weatherDiv").setHref(sb.toString());
};
mq.weather.close=function(){
debug("Close weather");
$w("weatherDiv").destroy();
$w("mqWeatherPopup").close();
};
}
if(!_1._hasResource["mq.searcheditform"]){
_1._hasResource["mq.searcheditform"]=true;
_1.provide("mq.searcheditform");
_1.declare("mq.searcheditform",mq.form,{createTemplate:function(){
var d=new dojox.string.Builder();
d.append("\t<div class=\"lcEditNext\">");
d.append("\t<form id=\""+this.prefix+"-form\" action=\"/search\" method=\"get\" autocomplete=\"off\">");
d.append("\t\t<fieldset><div>");
d.append("\t\t\t<div class=\"searchTitle\"><h5>Edit Search</h5></div>");
d.append("\t\t</div>");
d.append("\t\t<div class=\"lcAddNextExtDiv\" id=\"editLocBus\">");
d.append("\t\t\t<span class=\"b\">Find a Business</span> <span class=\"gray\">(optional)</span>&nbsp;<a id=\""+this.prefix+"0-helpBubbleLinkSearch\" href=\"javascript:;\"><img src=\""+mqPrefix+"/cdn/images/icon-help.png\" class=\"alignt\" alt=\"Help\" height=\"13\" width=\"11\"/></a><br/>");
d.append("\t\t\t<div class=\"inputAlign topinputalt\">");
d.append("\t\t\t\t<div class=\"fltl\"><input type=\"text\" id=\""+this.prefix+"0-query\" tabindex=\"6\" value=\"Enter Search Term\" autocomplete=\"off\" class=\"nochev\"/></div>");
d.append("\t\t\t</div>");
d.append("\t\t</div>");
d.append("\t\t<div>");
d.append("\t\t\t<span class=\"b\">Location</span><span class=\"gray\"> (Address, City, State and/or ZIP)</span>&nbsp;<a id=\""+this.prefix+"0-helpBubbleLinkLocation\" href=\"javascript:;\"><img src=\""+mqPrefix+"/cdn/images/icon-help.png\" class=\"alignt\" alt=\"Help\" height=\"13\" width=\"11\"/></a><br/>");
d.append("\t\t\t<div class=\"inputAlign topinputaltlong fltl\">");
d.append("\t\t\t\t<div class=\"fltl\"><input tabindex=\"7\" id=\""+this.prefix+"0-addressInput\" type=\"text\" value=\"\" autocomplete=\"off\"/></div>");
d.append("\t\t\t\t<div class=\"chevron\">");
d.append("\t\t\t\t\t<a id=\""+this.prefix+"0-sr\">&nbsp;</a>");
d.append("\t\t\t\t</div>");
d.append("\t\t\t</div>");
d.append("\t\t</div>");
d.append("\t\t<div class=\"fltr\">");
d.append("\t\t\t<button id=\""+this.prefix+"0-button\" tabindex=\"8\" class=\"btn\" type=\"submit\" value=\"Go\">Go</button> ");
d.append("\t\t\t<button id=\""+this.prefix+"0-cancel\" tabindex=\"9\" class=\"btn\" type=\"button\" onclick=\"view.searchView.showHideEditSearch();\" value=\"Cancel\">Cancel</button>");
d.append("\t\t</div></fieldset>");
d.append("\t\t<div class=\"clearb\"></div>");
d.append("\t</form>");
d.append("\t</div>");
var _44c=document.createElement("div");
_44c.setAttribute("id",this.jsId);
_44c.innerHTML=d.toString();
this.parentElem.parentNode.insertBefore(_44c,this.parentElem.nextSibling);
}});
}
if(!_1._hasResource["mq.addnextlocationform"]){
_1._hasResource["mq.addnextlocationform"]=true;
_1.provide("mq.addnextlocationform");
_1.declare("mq.addnextlocationform",mq.form,{createTemplate:function(){
var _44d,_44e,_44f;
_44d="minus";
_44e="block";
if(controller._model.locations.length==1){
_44f="none";
}else{
_44f="block";
}
var d=new dojox.string.Builder();
d.append("");
if(this.locNum==1){
d.append("<div class=\"lcAddNext\">");
}else{
d.append("<div class=\"lcAddNext\" id=\"lcAddNextDir\">");
}
d.append("\t<form id=\""+this.prefix+"-form\" class=\"locationForm\" action=\"/search\" method=\"get\" autocomplete=\"off\">");
d.append("\t\t<div id=\"addNextLocationToggle\" class=\"lcAddNextInd\">");
d.append("\t\t\t<a class=\"optshowhide\"><img id=\"addNextLocationIcon\" width=\"14\" height=\"14\" border=\"0\" src=\""+mqPrefix+"/cdn/images/icon-"+_44d+".png\" alt=\"Open\"/></a>");
if(this.locNum==1){
d.append("\t\t<a id=\"toggleAddLink\" style=\"display:"+_44f+";\">Directions To / From Above Location</a>");
d.append("\t\t<span id=\"toggleAddLinkExp\">");
d.append("\t\t\tDirections ");
d.append("\t\t\t<select id=\"addLocationSelect\">");
d.append("\t\t\t\t<option value=\"From\">From</option>");
d.append("\t\t\t\t<option value=\"To\">To</option>");
d.append("\t\t\t</select>");
d.append("\t\t\t Above Location");
d.append("\t\t</span>");
d.append("\t</div>");
}else{
d.append("\t\t<a id=\"toggleAddLink\" class=\"b\">Add Another Stop to Your Route</a>");
d.append("\t</div>");
}
if(this.locNum>1){
d.append("\t\t<div id=\"addNextDir\">");
}else{
d.append("\t\t<div id=\"addNextMap\">");
}
d.append("\t\t<div id=\"addNextLocationFields\" style=\"display:"+_44e+";\">");
d.append("\t\t\t<div class=\"fltl\" id=\"addNextLoc\">");
if(this.locNum==1){
d.append("\t<img id=\"dirToFromIcon\" src=\""+mqPrefix+"/cdn/images/icon-end.png\"/>");
}
d.append("\t\t\t\t<div class=\"fltl lcAddNextExtDiv\">");
d.append("\t\t\t\t\t<label>Find a Business</label> <span class=\"gray\">(optional)</span>&nbsp;<a id=\""+this.prefix+"0-helpBubbleLinkSearch\" href=\"javascript:;\"><img src=\""+mqPrefix+"/cdn/images/icon-help.png\" class=\"alignt\" alt=\"Help\" height=\"13\" width=\"11\"/></a><br/>");
d.append("\t\t\t\t\t<div class=\"inputAlign topinputalt\">");
d.append("\t\t\t\t\t\t<div class=\"fltl\"><input type=\"text\" tabindex=\""+(10+(this.locNum*4))+"\" id=\""+this.prefix+"0-query\" value=\"Enter Search Term\" autocomplete=\"off\" class=\"nochev\"/></div>");
d.append("\t\t\t\t\t</div>");
d.append("\t\t\t\t</div>");
d.append("\t\t\t\t<div class=\"fltl\">");
d.append("\t\t\t\t\t<label>Location</label><span class=\"gray\"> (Address, City, State and/or ZIP)</span>&nbsp;<a id=\""+this.prefix+"0-helpBubbleLinkLocation\" href=\"javascript:;\"><img src=\""+mqPrefix+"/cdn/images/icon-help.png\" class=\"alignt\" alt=\"Help\" height=\"13\" width=\"11\"/></a><br/>");
d.append("\t\t\t\t\t<div class=\"inputAlign topinputaltlong fltl\">");
d.append("\t\t\t\t\t\t<div class=\"fltl\"><input  tabindex=\""+(11+(this.locNum*4))+"\" id=\""+this.prefix+"0-addressInput\" type=\"text\" value=\"\" autocomplete=\"off\"/></div>");
d.append("\t\t\t\t\t\t<div class=\"chevron\">");
d.append("\t\t\t\t\t\t\t<a id=\""+this.prefix+"0-sr\">&nbsp;</a>");
d.append("\t\t\t\t\t\t</div>");
d.append("\t\t\t\t\t</div>");
d.append("\t\t\t\t</div>");
d.append("\t\t\t\t<button id=\""+this.prefix+"-button\" tabindex=\""+(12+(this.locNum*4))+"\" class=\"btn\" type=\"submit\" value=\"Go\">Go</button> ");
d.append("\t\t\t\t<div class=\"clearb\"></div>");
d.append("\t\t\t</div>");
d.append("\t\t</div>");
if(this.locNum>1){
d.append("\t\t</div>");
}
d.append("\t\t<div class=\"clearb\"></div>");
d.append("\t</form>");
d.append("</div>");
var _451=document.createElement("div");
_451.setAttribute("id",this.jsId);
_451.innerHTML=d.toString();
this.parentElem.parentNode.insertBefore(_451,this.parentElem.nextSibling);
},toggleAdd:function(){
if(mq.isShowing($d("addNextLocationFields"))){
$d("addNextLocationIcon").src=mqPrefix+"/cdn/images/icon-plus.png";
mq.hide($d("addNextLocationFields"));
if(this.locNum==1){
$d("toggleAddLinkExp").style.display="none";
$d("toggleAddLink").style.display="inline";
$d("dirToFromIcon").style.display="none";
}
}else{
$d("addNextLocationIcon").src=mqPrefix+"/cdn/images/icon-minus.png";
mq.show($d("addNextLocationFields"));
if(this.locNum==1){
$d("toggleAddLinkExp").style.display="inline";
$d("toggleAddLink").style.display="none";
$d("dirToFromIcon").style.display="block";
}
}
if(this.locNum==1){
ua.a(":MQ08DirToFromLink");
}else{
ua.a(":MQ08AddNextLink");
}
},clickSelect:function(evt){
evt.cancelBubble=true;
},changeSelect:function(evt){
$d("dirToFromIcon").src=($d("addLocationSelect")[$d("addLocationSelect").selectedIndex].innerHTML=="From")?mqPrefix+"/cdn/images/icon-end.png":mqPrefix+"/cdn/images/icon-start.png";
}});
}
if(!_1._hasResource["mq.editlocationform"]){
_1._hasResource["mq.editlocationform"]=true;
_1.provide("mq.editlocationform");
_1.declare("mq.editlocationform",mq.form,{createTemplate:function(){
var d=new dojox.string.Builder();
d.append("<div class=\"lcEditNext\">");
d.append("\t<form id=\""+this.prefix+"-form\" action=\"/search\" method=\"get\" autocomplete=\"off\">");
d.append("\t\t<div class=\"fltl\">");
d.append("\t\t\t<div class=\"fltl\">");
d.append(mq.util.setImagePng(mqPrefix+"/cdn/images/icons/stop_"+this.locNum+".png",29,29));
d.append("\t\t\t</div>");
d.append("\t\t\t<div class=\"editTitle\"><h5>Edit Location</h5></div>");
d.append("\t\t</div>");
d.append("\t\t<div class=\"fltl lcAddNextExtDiv\">");
d.append("\t\t\t<span class=\"b\">Find a Business</span> <span class=\"gray\">(optional)</span>&nbsp;<a id=\""+this.prefix+"0-helpBubbleLinkSearch\" href=\"javascript:;\"><img src=\""+mqPrefix+"/cdn/images/icon-help.png\" class=\"alignt\" alt=\"Help\" height=\"13\" width=\"11\"/></a><br/>");
d.append("\t\t\t<div class=\"inputAlign topinputalt\">");
d.append("\t\t\t\t<div class=\"fltl\"><input type=\"text\" tabindex=\""+(6+(this.locNum*4))+"\" id=\""+this.prefix+"0-query\" value=\"Enter Search Term\" autocomplete=\"off\" class=\"nochev\"/></div>");
d.append("\t\t\t</div>");
d.append("\t\t</div>");
d.append("\t\t<div class=\"fltl\">");
d.append("\t\t\t<span class=\"b\">Location</span><span class=\"gray\"> (Address, City, State and/or ZIP)</span>&nbsp;<a id=\""+this.prefix+"0-helpBubbleLinkLocation\" href=\"javascript:;\"><img src=\""+mqPrefix+"/cdn/images/icon-help.png\" class=\"alignt\" alt=\"Help\" height=\"13\" width=\"11\"/></a><br/>");
d.append("\t\t\t<div class=\"inputAlign topinputaltlong fltl\">");
d.append("\t\t\t\t<div class=\"fltl\"><input tabindex=\""+(7+(this.locNum*4))+"\" id=\""+this.prefix+"0-addressInput\" type=\"text\" value=\"\" autocomplete=\"off\"/></div>");
d.append("\t\t\t\t<div class=\"chevron\">");
d.append("\t\t\t\t\t<a id=\""+this.prefix+"0-sr\">&nbsp;</a>");
d.append("\t\t\t\t</div>");
d.append("\t\t\t</div>");
d.append("\t\t</div>");
d.append("\t\t<div class=\"fltl\">");
d.append("\t\t\t<button id=\""+this.prefix+"-button\" tabindex=\""+(8+(this.locNum*4))+"\" class=\"btn\" type=\"submit\" value=\"Go\">Go</button> ");
d.append("\t\t\t<button id=\""+this.prefix+"-cancel\" tabindex=\""+(9+(this.locNum*4))+"\" class=\"btn\" type=\"button\" onclick=\"mq.destroyForm("+this.jsId+", $d('locDiv"+this.locNum+"'));\" value=\"Cancel\">Cancel</button>");
d.append("\t\t</div>");
d.append("\t\t<div class=\"clearb\"></div>");
d.append("\t</form>");
d.append("</div>");
var _455=document.createElement("div");
_455.setAttribute("id",this.jsId);
_455.innerHTML=d.toString();
this.parentElem.parentNode.insertBefore(_455,this.parentElem.nextSibling);
this.populateInputTextField(true,controller._model.locations[this.locNum].location);
}});
}
if(!_1._hasResource["mq.printview"]){
_1._hasResource["mq.printview"]=true;
_1.provide("mq.printview");
_1.declare("mq.PrintView",null,{printSize:false,constructor:function(_456){
debug("PrintView.constructor");
this._controller=_456;
this.initPrintMap();
notesHelperText=mq.getMessage("PF_NOTES_TEXT");
$d("notes").value=notesHelperText;
},toggleView:function(){
debug("PrintView.toggleView");
var _457=$d("printHdr").pfView;
var _458=$d("pfAd");
var _459=$d("pfPromoLft");
var _45a=$d("pfPromoBtm");
var _45b=$d("pfPromoTop");
var _45c=$d("notes");
var _45d=$d("pfNotes");
var _45e=$d("mapWindowPrint");
var _45f=_1.query(".roadShield");
var _460=_1.query(".expCol2");
for(var i=0;i<_457.length;i++){
if(_457[i].checked){
if(_457[i].value=="text"){
if(_45e.style.display=="none"){
return;
}
_45e.style.display="none";
_458.style.display="none";
_459.style.display="none";
_45a.style.display="none";
_45b.style.display="none";
_45c.className="noteText";
_45d.className="pfNotesDivAlt";
if(_45c.value==notesHelperText){
_1.removeClass(_45c,"printThis");
_1.addClass(_45c,"screen");
}
for(var x=0;x<_45f.length;x++){
_45f[x].style.display="none";
_460[x].style.width="12px";
}
var _463=_1.query(".pfSrchPic");
for(ph=0;ph<_463.length;ph++){
_463[ph].style.display="none";
}
_1.query(".manMapShow",$d("locationListPrint")).forEach(function(node){
_1.removeClass(node,"manMapShow");
_1.addClass(node,"manMapHide");
});
ua.a(":MQ08PFTextOnly");
}else{
if(_45e.style.display!="none"){
return;
}
_45e.style.display="block";
_458.style.display="block";
_459.style.display="block";
_45a.style.display="block";
_45b.style.display="block";
_45c.className="noteMap";
if(_45c.value==notesHelperText){
_1.removeClass(_45c,"printThis");
_1.addClass(_45c,"screen");
}
_45d.className="pfNotesDiv";
for(var x=0;x<_45f.length;x++){
_45f[x].style.display="block";
_460[x].style.width="24px";
}
var _463=_1.query(".pfSrchPic");
for(ph=0;ph<_463.length;ph++){
_463[ph].style.display="";
}
_1.query(".manMapHide",$d("locationListPrint")).forEach(function(node){
_1.removeClass(node,"manMapHide");
_1.addClass(node,"manMapShow");
});
ua.a(":MQ08PFTextMap");
}
}
}
},initPrintMap:function(){
debug("PrintView.initPrintMap");
$d("pfView_map").disabled="";
$d("pfView_text").disabled="";
},checkForBlankMap:function(_466){
var _467=false;
var _468=controller._model;
if(_466=="MAPS"){
if(!_468.locations){
_467=true;
}else{
if(_468.locations.length==0){
_467=true;
}
}
}else{
if(_466=="SEARCH"){
if(!$w("searchResults")){
_467=true;
}else{
if($w("searchResults").available==0){
_467=true;
}
}
}
}
if(_467){
if($d("mapWindowPrint").style.display=="none"){
$d("mapWindowPrint").style.display="block";
$d("pfAd").style.display="block";
$d("pfPromoLft").style.display="block";
$d("pfPromoBtm").style.display="block";
$d("pfPromoTop").style.display="block";
$d("notes").className="noteMap";
$d("pfNotes").className="pfNotesDiv";
$d("pfView_map").checked="checked";
}
$d("pfView_map").disabled="disabled";
$d("pfView_text").disabled="disabled";
}
return _467;
},getViewableMap:function(){
return window.view.getCurrentMode()=="SEARCH"?tileMap=window.view.searchView._tileMap:window.view.mapView._tileMap;
},updateMap:function(){
this.clearAll();
this.initPrintMap();
var _469=this.getViewableMap();
var _46a=window.view.getCurrentMode();
if(_46a=="SEARCH"){
if(!this.checkForBlankMap(_46a)){
this.drawSearches();
}
}else{
if(!this.checkForBlankMap(_46a)){
this.drawLocations();
}
}
this.originalUrl=_469.generatePFUrl(this.printSize);
$d("map-static").src=this.originalUrl;
scroll(0,0);
$d("bestFitPF_false").checked=true;
this.bestFitUrl=false;
},bestFitMap:function(_46b){
var _46c=this.getViewableMap();
var _46d=view.getCurrentMode();
if(_46b===true){
if(!this.bestFitUrl){
_46c.setSize(this.printSize);
_46c.getPois().getSize()>1?_46c.bestFit():_46c.restoreState();
this.bestFitUrl=_46c.generatePFUrl(this.printSize);
}
$d("map-static").src=this.bestFitUrl;
if(_46d=="MAPS"){
ua.a(":MQ08PFDefaultMap");
}else{
if(_46d=="SEARCH"){
ua.a(":MQ08PFShowAll");
}
}
}else{
$d("map-static").src=this.originalUrl;
if(_46d=="MAPS"){
ua.a(":MQ08PFMyMap");
}else{
if(_46d=="SEARCH"){
ua.a(":MQ08PFMyView");
}
}
}
},createNarrativeTablePrint:function(trek,_46f){
debug("PrintView.createNarrativeTablePrint");
sb=new dojox.string.Builder();
sb.append("<div id=\"narrative"+_46f+"\" class=\"narrativeTable\">");
for(var k=0;k<trek.maneuvers.length;k++){
var man=trek.maneuvers[k];
sb.append("<div class=\"PFexpColCont\" id=\"pfmaneuver"+_46f+"-"+k+"\">");
sb.append("<div class=\"expColumn1\">");
sb.append("<div class=\"expCol1\"><img src=\""+man.roadSignUrlPrint+"\"/></div>");
sb.append("<div class=\"expCol2\">"+(k+1)+":&nbsp;</div>");
sb.append("<div class=\"expCol3Cont\">");
sb.append("<div class=\"expCol3\">").append(man.narrative);
if(man.message!=null&&man.message!=""){
sb.append("<div class=\"red\">(").append(mq.getMessage(man.message)).append(")</div>");
}
sb.append("</div>");
sb.append("</div>");
sb.append("</div>");
sb.append("<div class=\"expColumn2\">");
sb.append("<div class=\"expCol4\">");
if(man.distance!=null){
sb.append(man.distance);
}
sb.append("</div>");
sb.append("</div>");
if(man.showMap){
sb.append("<div style=\"width:400px;height:200px\" class=\"manMapShow\" id=\"manMap"+_46f+"-"+k+"\">");
var _472="manMap"+_46f+"-"+k;
var map=view.mapView.manMapList[_472];
sb.append("<img src=\""+map.generatePFUrl()+"\"/>");
sb.append("</div>");
}
sb.append("<div style=\"clear:both\"></div>");
sb.append("</div>");
}
sb.append("<div class='PFexpColCont' style='text-align:center'>").append("Estimated Time: "+trek.time+"<span class='estDist'>Estimated Distance: "+trek.distance+"</span>");
sb.append("</div>");
sb.append("</div>");
return sb.toString();
},drawLocations:function(){
var _474=this._controller._model;
if(_474.locations!=null){
debug("MapTabView.drawLocations: "+_474.locations.length);
$d("locationWindowPrint").innerHTML="";
var ul=document.createElement("div");
ul.setAttribute("id","locationListPrint");
ul.setAttribute("class","locationList");
$d("locationWindowPrint").appendChild(ul);
for(i=0;i<_474.locations.length;i++){
loc=_474.locations[i].location;
var item=new dojox.string.Builder();
var uli=document.createElement("div");
item.append("<div class=\"locStop\">");
item.append(unescape("%"+(i+65).toString(16))+": ");
item.append(mq.util.formatLocationPF(loc));
item.append("<div>");
uli.innerHTML=item.toString();
ul.appendChild(uli);
if(_474.routeResults!=null){
var rn=document.createElement("div");
rn.setAttribute("id","routeNarrative"+i);
uli.appendChild(rn);
var trek=_474.routeResults.treks[i];
var sb=new dojox.string.Builder();
if(trek!=null){
sb.append(this.createNarrativeTablePrint(trek,i));
}
rn.innerHTML=sb.toString();
}
}
$d("locationWindowPrint").appendChild(ul);
if(_474.showRoute&&_474.routeResults!=null&&_474.locations.length>1){
debug("Show Total Time and Distance");
var div=document.createElement("div");
_1.addClass(div,"routeResults");
var rbuf=new dojox.string.Builder();
rbuf.append("<div class=\"narrTotal\">");
rbuf.append("Total Time: "+_474.routeResults.time);
rbuf.append("<span class=\"distance\">");
rbuf.append("Total Distance: "+_474.routeResults.distance+"</span>");
rbuf.append("</div>");
div.innerHTML=rbuf.toString();
$d("locationWindowPrint").appendChild(div);
var _47e=new dojox.string.Builder();
_47e.append("&nbsp;My View");
$d("currentView").innerHTML=_47e.toString();
var _47f=new dojox.string.Builder();
_47f.append("&nbsp;Show Entire Route on Map");
$d("bestFit").innerHTML=_47f.toString();
mq.show($d("printView"));
}else{
mq.hide($d("printView"));
var _47e=new dojox.string.Builder();
_47e.append("&nbsp;My Map");
$d("currentView").innerHTML=_47e.toString();
var _47f=new dojox.string.Builder();
_47f.append("&nbsp;Revert to Default Map");
$d("bestFit").innerHTML=_47f.toString();
}
var _480=mq.util.routeWarnMessages(_474);
var _481=new dojox.string.Builder();
if(_480.length>0){
_481.append("<img width='24' height='25' src='"+mqPrefix+"/cdn/images/icon-warn.gif' />");
if(_480.length==1){
_481.append("<div class='redwarn'>"+_480[0]+"</div>");
}else{
_481.append("<div class='redwarn'>").append(mq.getMessage("WARN_ROUTE_MULTIPLE")).append("</div>").append("<div class='red clearb' style='text-align:left;'><ul class='list clearb' style='list-style-position:inside;padding:0px 0px 0px 15px'>");
for(var i=0;i<_480.length;i++){
_481.append("<li style='margin-left:0px;'>"+_480[i]+"</li>");
}
_481.append("</ul></div>");
}
var _482=$d("pfRouteWarning");
mq.show(_482);
_482.style.height="auto";
}else{
mq.hide($d("pfRouteWarning"));
}
$d("pfRouteWarning").innerHTML=_481.toString();
if(_474.routeResults!=null){
if(_474.routeResults.infoMessage||_474.routeResults.infoTitle){
var _483=new dojox.string.Builder();
_483.append("<div class=\"infoicon\"><img src=\""+mqPrefix+"/cdn/images/icon-info.gif\" height=\"18\" width=\"18\"></div>");
_483.append("<div class=\"infomsg\"><span>"+_474.routeResults.infoTitle+"</span><br/>");
_483.append(_474.routeResults.infoMessage);
_483.append("</div>");
_483.append("<div class=\"clearb\"></div>");
$d("pfInfoMessage").innerHTML=_483.toString();
mq.show($d("pfInfoMessage"));
}else{
$d("pfInfoMessage").innerHTML="";
mq.hide($d("pfInfoMessage"));
}
}
}
},drawSearches:function(){
mq.show($d("infoUSA"));
var _484=$w("searchResults");
if(_484){
var _485=$d("pageSummary").getElementsByTagName("*")[0].innerHTML;
var _486=new dojox.string.Builder();
var _487=$d("resultQuery").innerHTML.replace(/sourcevendor:[0-9]*/,"places");
_486.append("<div id='pfSrchHdr'>Results "+_485+" for "+_487+"</div>");
mq.show($d("printView"));
var _488=0;
if(_484.searchResults){
_488=_484.searchResults.searchResults;
}
for(var cols=2,c=0,r=0;c<cols;c++){
_486.append("<div id='pfSrchCol'>");
for(var i=0;i<_488.length/cols&&r<_488.length;i++,r++){
var item=_488[r];
_486.append("<div class='pfSrchClr'>").append("<div class='pfSrchNum'>").append(r+_484.skip+1).append(".</div>").append("<div class='pfSrchItem'");
if(controller._model.searchGutterState=="TEXT"){
_486.append(" style='height:65px;");
}
_486.append(">");
_486.append("<span class='b'>"+item.name+"</span><br/>").append(item.addressLine1).append("<br/>");
_486.append(item.city).append(", ").append(item.state).append("<br/>").append(mq.util.formatPhoneNumber(item.phoneNumber)).append("</div></div>");
if(controller._model.searchGutterState=="TEXT"){
_486.append("<div>");
if(item.photoURL){
_486.append("<img class='pfSrchPic' src='").append(item.photoURL).append("'/>");
}
_486.append("</div>");
}
}
_486.append("</div>");
}
}
$d("searchWindowPrint").innerHTML=_486;
var _48e=new dojox.string.Builder();
_48e.append("&nbsp;My View");
$d("currentView").innerHTML=_48e.toString();
var _48f=new dojox.string.Builder();
_48f.append("&nbsp;Show All Points on Map");
$d("bestFit").innerHTML=_48f.toString();
},clearAll:function(){
$d("map-static").src="http://www.aolcdn.com/a/a";
$d("locationWindowPrint").innerHTML="";
$d("searchWindowPrint").innerHTML="";
$d("notes").value=notesHelperText;
},print:function(){
ua.a(":MQ08PFPrint");
window.print();
},backToMap:function(){
backToMap();
ua.a(":MQ08PFReturn");
},showStatus:function(msg){
window.status=msg;
}});
}
}});

Key="GsX";
if(typeof (MQA)=="undefined"){
MQA=new Object();
}
MQA={PIXERSPERLATDEGREE:315552459.661917,PIXERSPERLNGDEGREE:250344597.90989706,TILESIZE:256,SLIDESTEPS:9,SLIDEDELAY:11,SCALES:new Array(0,88011773,29337258,9779086,3520471,1504475,701289,324767,154950,74999,36000,18000,9000,4700,2500,1500,1000),MODS:new Array(0,4,12,36,100,234,502,1084,2272,4694,9778,19558,39116,74900,140818,234698,352047),VENDORLIST:new Array("","mz1copy.gif","mz4copy.gif","mz7copy.gif","mz0copy.gif"),MAPVENDORS:new Array(0,1,1,1,2,2,2,3,3,3,4,4,4,4,4,4,4),RESOURCES:"http://"+RESSERVER+"/res/",STATICRESOURCES:"http://"+STATICSERVER+"/tileprint.php",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,MAXMAPHEIGHT:7168,MAXMAPWIDTH:7168,BUTTON_MQ_LEFT:0,BUTTON_MQ_MIDDLE:1,BUTTON_MQ_RIGHT:2,MASTER_BROKER:null,SAFARI_BROWSER:(navigator.userAgent.indexOf("Safari")>=0),PAN_NORTH:0,PAN_SOUTH:1,PAN_EAST:2,PAN_WEST:3,CONTROL_PANZOOM:0,CONTROL_PAN:1,CONTROL_ZOOM:2,CONTROL_TYPE:3,CONTROL_TRAFFIC:4,TRAFFIC_NONE:0,TRAFFIC_CONSTRUCTION:1,TRAFFIC_INCIDENTS:4,TRAFFIC_ALL:5};
MQA.SURFACE_OFFSET=2*MQA.TILESIZE;
MQA.NOTHING=MQA.RESOURCES+"nothing.gif";

MQA.Control=function(){
};
MQA.Control.prototype={initialize:function(_1){
this.map=_1;
},getPosition:function(){
return this.position;
},getHeight:function(){
return this.getHeightInternal(this.elem);
},getHeightInternal:function(_2){
var _3=_2.childNodes;
var _4=0;
for(var i=0,j=_3.length;i<j;i++){
if(_3[i].childNodes.length>0&&_3[i].style.overflow!="hidden"){
childHeight=this.getHeightInternal(_3[i]);
if(childHeight>_4){
_4=childHeight;
}
}
if(_3[i].offsetHeight>_4){
_4=_3[i].offsetHeight;
}
}
return _4;
},getWidth:function(){
return this.getWidthInternal(this.elem);
},getWidthInternal:function(_7){
var _8=_7.childNodes;
var _9=0;
for(var i=0,j=_8.length;i<j;i++){
if(_8[i].childNodes.length>0&&_8[i].style.overflow!="hidden"){
childWidth=this.getWidthInternal(_8[i]);
if(childWidth>_9){
_9=childWidth;
}
}
if(_8[i].offsetWidth>_9){
_9=_8[i].offsetWidth;
}
}
return _9;
}};
MQA.LargeZoomControl=function(){
browser=MQA.browser;
this.pan=new Array();
this.zoombar=new Array();
this.map=null;
this.position=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(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;
temp3.appendChild(MQA.Util.createArea("poly","14,21,16,16,21,14,25,16,27,21,25,25,21,27,16,25,14,21,14,21","#center"));
temp4=MQA.Util.createArea("rect","11,1,29,12","#north","Pan North","Pan North");
temp3.appendChild(temp4);
this.pan[MQA.PAN_NORTH]=temp4;
temp4=MQA.Util.createArea("rect","27,13,40,28","#east","Pan East","Pan East");
temp3.appendChild(temp4);
this.pan[MQA.PAN_EAST]=temp4;
temp4=MQA.Util.createArea("rect","1,13,14,28","#west","Pan West","Pan West");
temp3.appendChild(temp4);
this.pan[MQA.PAN_WEST]=temp4;
temp4=MQA.Util.createArea("rect","11,29,29,40","#south","Pan South","Pan South");
temp3.appendChild(temp4);
this.pan[MQA.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 _c=document.createElement("div");
_c.className="map-zoombox";
var _d=document.createElement("img");
_d.border=0;
if(browser.name=="msie"&&browser.version<7){
_d.src="http://img.mqcdn.com/a/a";
_d.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqmaptiled/zoombar.png', sizingMethod='image')";
}else{
_d.src="http://img.mqcdn.com/mqmaptiled/zoombar.png";
}
_c.appendChild(_d);
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 _e=1;
var _f=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, "+(_e+i*12)+", 22, "+(_f+i*12)+"' />";
}
strHtm+="</map>";
_c.innerHTML+=strHtm;
this.zoombox=_c;
this.zoomarea=_c.childNodes[3].childNodes;
temp1.appendChild(_c);
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);
};
MQA.LargeZoomControl.prototype=new MQA.Control();
MQA.LargeZoomControl.prototype.constructor=MQA.LargeZoomControl;
MQA.LargeZoomControl.prototype.destructor=function(){
for(var i=0;i<4;i++){
MQA._prEvent.stopObserving(this.pan[i],"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.pan[i],"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.pan[i],"mouseout",this.MQEventCallbackObserver);
}
MQA._prEvent.stopObserving(this.zoomin,"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.zoomout,"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.zoomin,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.zoomout,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.zoomin,"mouseout",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.zoomout,"mouseout",this.MQEventCallbackObserver);
for(var i=0;i<16;i++){
MQA._prEvent.stopObserving(this.zoomarea[i],"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.zoomarea[i],"mouseover",this.MQEventCallbackObserver);
}
MQA._prEvent.stopObserving(this.zoombox,"mouseout",this.MQEventCallbackObserver);
};
MQA.LargeZoomControl.prototype.initialize=function(map){
this.map=map;
this.type=MQA.CONTROL_PANZOOM;
this.setZoom(this.map.getZoomLevel());
this.MQEventCallbackObserver=MQA._prEvent.EventCallback(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++){
MQA._prEvent.observe(this.pan[i],"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.pan[i],"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.pan[i],"mouseout",this.MQEventCallbackObserver);
}
MQA._prEvent.observe(this.zoomin,"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.zoomout,"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.zoomin,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.zoomout,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.zoomin,"mouseout",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.zoomout,"mouseout",this.MQEventCallbackObserver);
for(var i=0;i<16;i++){
MQA._prEvent.observe(this.zoomarea[i],"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.zoomarea[i],"mouseover",this.MQEventCallbackObserver);
}
MQA._prEvent.observe(this.zoombox,"mouseout",this.MQEventCallbackObserver);
};
MQA.LargeZoomControl.prototype.eventmonitor=function(evt){
if(MQA._prEvent.element(evt)==this.pan[MQA.PAN_NORTH]){
eventId="n";
}
if(MQA._prEvent.element(evt)==this.pan[MQA.PAN_SOUTH]){
eventId="s";
}
if(MQA._prEvent.element(evt)==this.pan[MQA.PAN_EAST]){
eventId="e";
}
if(MQA._prEvent.element(evt)==this.pan[MQA.PAN_WEST]){
eventId="w";
}
if(MQA._prEvent.element(evt)==this.zoomin){
eventId="in";
}
if(MQA._prEvent.element(evt)==this.zoomout){
eventId="out";
}
if(MQA._prEvent.element(evt)==this.zoombox.childNodes[1]){
return;
}
for(var i=0;i<16;i++){
if(MQA._prEvent.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":
MQA._prEvent.element(evt).className="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(MQA._prEvent.element(evt).className!="o"){
return;
}
MQA._prEvent.element(evt).className="";
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;
}
};
MQA.LargeZoomControl.prototype.setZoom=function(_16){
var z=this.zoombox.childNodes[2];
z.style.top=((16-_16)*12+1)+"px";
z.alt="Zoom to level "+(_16);
z.title="Zoom to level "+(_16);
};
MQA.LargeZoomControl.prototype.selectZoom=function(_18){
this.zoombox.childNodes[0].style.left=0-((17-_18)*25)+"px";
};
MQA.LargeZoomControl.prototype.unselectZoom=function(_19){
this.zoombox.childNodes[0].style.left="0";
};
MQA.LargeZoomControl.prototype.getHeight=function(){
return 298;
};
MQA.LargeZoomControl.prototype.getWidth=function(){
return 45;
};
MQA.PanControl=function(){
browser=MQA.browser;
this.pans=new Array();
this.map=null;
this.position=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(0,30));
this.elem=document.createElement("div");
this.elem.style.position="absolute";
this.elem.style.overflow="visible";
var _1a,_1b,_1c,_1d,_1e;
_1a=document.createElement("div");
_1a.className="map-controls-bg screen";
this.elem.appendChild(_1a);
_1b=document.createElement("div");
_1b.style.position="relative";
_1b.style.width="48px";
_1b.style.height="52px";
_1b.style.margin="0";
_1b.style.padding="0 3px";
if(browser.name=="msie"&&browser.version<7){
_1b.style.backgroundImage="none";
_1b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-controls-box-bg.png', sizingMethod='image')";
}else{
_1b.style.backgroundColor="transparent";
_1b.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/map-controls-box-bg.png)";
_1b.style.backgroundPosition="0 0";
_1b.style.backgroundRepeat="no-repeat";
}
_1a.appendChild(_1b);
_1a=document.createElement("ul");
_1a.className="map-controls screen";
this.elem.appendChild(_1a);
_1b=document.createElement("li");
_1b.className="map-box-wrapper";
_1a.appendChild(_1b);
_1c=document.createElement("div");
_1c.className="map-compass";
_1b.appendChild(_1c);
_1d=document.createElement("img");
_1d.border=0;
if(browser.name=="msie"&&browser.version<7){
_1d.src="http://img.mqcdn.com/a/a";
_1d.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/map-compassrose.png', sizingMethod='image')";
}else{
_1d.src="http://img.mqcdn.com/mqtoolkit/map-compassrose.png";
}
_1d.alt="compass rose";
_1d.className="";
_1c.appendChild(_1d);
this.compassrose=_1d;
_1d=document.createElement("img");
_1d.border=0;
_1d.src="http://img.mqcdn.com/a/a";
_1d.className="map-compass-links";
_1d.useMap="#mq-pancontrol-linkmap";
_1c.appendChild(_1d);
_1d=document.createElement("map");
_1d.id="mq-pancontrol-linkmap";
_1d.name="mq-pancontrol-linkmap";
_1c.appendChild(_1d);
_1e=MQA.Util.createArea("poly","14,21,16,16,21,14,25,16,27,21,25,25,21,27,16,25,14,21,14,21","#center");
_1d.appendChild(_1e);
_1e=MQA.Util.createArea("rect","11,1,29,12","#north","Pan North","Pan North");
_1d.appendChild(_1e);
this.pans[MQA.PAN_NORTH]=_1e;
_1e=MQA.Util.createArea("rect","27,13,40,28","#east","Pan East","Pan East");
_1d.appendChild(_1e);
this.pans[MQA.PAN_EAST]=_1e;
_1e=MQA.Util.createArea("rect","1,13,14,28","#west","Pan West","Pan West");
_1d.appendChild(_1e);
this.pans[MQA.PAN_WEST]=_1e;
_1e=MQA.Util.createArea("rect","11,29,29,40","#south","Pan South","Pan South");
_1d.appendChild(_1e);
this.pans[MQA.PAN_SOUTH]=_1e;
_1a=null;
_1b=null;
_1c=null;
_1d=null;
_1e=null;
};
MQA.PanControl.prototype=new MQA.Control();
MQA.PanControl.prototype.constructor=MQA.PanControl;
MQA.PanControl.prototype.dispose=function(){
this.map=null;
MQA._prEvent.stopObserving(this.pans[MQA.PAN_NORTH],"click",this.ePanNorthClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_NORTH],"mouseover",this.ePanNorthMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_NORTH],"mouseout",this.ePanNorthMouseOut);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_SOUTH],"click",this.ePanSouthClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_SOUTH],"mouseover",this.ePanSouthMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_SOUTH],"mouseout",this.ePanSouthMouseOut);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_EAST],"click",this.ePanEastClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_EAST],"mouseover",this.ePanEastMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_EAST],"mouseout",this.ePanEastMouseOut);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_WEST],"click",this.ePanWestClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_WEST],"mouseover",this.ePanWestMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_WEST],"mouseout",this.ePanWestMouseOut);
this.pans[MQA.PAN_NORTH]=null;
this.pans[MQA.PAN_SOUTH]=null;
this.pans[MQA.PAN_EAST]=null;
this.pans[MQA.PAN_WEST]=null;
this.pans=null;
MQA.Util._deleteDOMObject(this.compassrose);
this.compassrose=null;
this.elem.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.elem);
MQA.Util._deleteDOMObject(this.elem);
this.elem="";
};
MQA.PanControl.prototype.destructor=function(){
MQA._prEvent.stopObserving(this.pans[MQA.PAN_NORTH],"click",this.ePanNorthClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_NORTH],"mouseover",this.ePanNorthMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_NORTH],"mouseout",this.ePanNorthMouseOut);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_SOUTH],"click",this.ePanSouthClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_SOUTH],"mouseover",this.ePanSouthMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_SOUTH],"mouseout",this.ePanSouthMouseOut);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_EAST],"click",this.ePanEastClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_EAST],"mouseover",this.ePanEastMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_EAST],"mouseout",this.ePanEastMouseOut);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_WEST],"click",this.ePanWestClick);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_WEST],"mouseover",this.ePanWestMouseOver);
MQA._prEvent.stopObserving(this.pans[MQA.PAN_WEST],"mouseout",this.ePanWestMouseOut);
};
MQA.PanControl.prototype.initialize=function(map){
this.map=map;
this.type=MQA.CONTROL_PAN;
this.ePanNorthClick=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanNorthMouseOver=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanNorthMouseOut=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanSouthClick=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanSouthMouseOver=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanSouthMouseOut=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanEastClick=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanEastMouseOver=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanEastMouseOut=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanWestClick=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanWestMouseOver=MQA._prEvent.EventCallback(this,"eventmonitors");
this.ePanWestMouseOut=MQA._prEvent.EventCallback(this,"eventmonitors");
MQA._prEvent.observe(this.pans[MQA.PAN_NORTH],"click",this.ePanNorthClick);
MQA._prEvent.observe(this.pans[MQA.PAN_NORTH],"mouseover",this.ePanNorthMouseOver);
MQA._prEvent.observe(this.pans[MQA.PAN_NORTH],"mouseout",this.ePanNorthMouseOut);
MQA._prEvent.observe(this.pans[MQA.PAN_SOUTH],"click",this.ePanSouthClick);
MQA._prEvent.observe(this.pans[MQA.PAN_SOUTH],"mouseover",this.ePanSouthMouseOver);
MQA._prEvent.observe(this.pans[MQA.PAN_SOUTH],"mouseout",this.ePanSouthMouseOut);
MQA._prEvent.observe(this.pans[MQA.PAN_EAST],"click",this.ePanEastClick);
MQA._prEvent.observe(this.pans[MQA.PAN_EAST],"mouseover",this.ePanEastMouseOver);
MQA._prEvent.observe(this.pans[MQA.PAN_EAST],"mouseout",this.ePanEastMouseOut);
MQA._prEvent.observe(this.pans[MQA.PAN_WEST],"click",this.ePanWestClick);
MQA._prEvent.observe(this.pans[MQA.PAN_WEST],"mouseover",this.ePanWestMouseOver);
MQA._prEvent.observe(this.pans[MQA.PAN_WEST],"mouseout",this.ePanWestMouseOut);
};
MQA.PanControl.prototype.eventmonitors=function(evt){
if(MQA._prEvent.element(evt)==this.pans[MQA.PAN_NORTH]){
eventId="n";
}
if(MQA._prEvent.element(evt)==this.pans[MQA.PAN_SOUTH]){
eventId="s";
}
if(MQA._prEvent.element(evt)==this.pans[MQA.PAN_EAST]){
eventId="e";
}
if(MQA._prEvent.element(evt)==this.pans[MQA.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;
}
};
MQA.PanControl.prototype.getHeight=function(){
return 48;
};
MQA.PanControl.prototype.getWidth=function(){
return 47;
};
MQA.ZoomControl=function(){
browser=MQA.browser;
this.map=null;
this.position=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(0,30));
this.elem=document.createElement("div");
this.elem.style.position="absolute";
this.elem.style.overflow="visible";
this.mapcontrolbg=document.createElement("div");
this.mapcontrolbg.className="map-controls-bg screen";
this.mapcontrolbg.style.width="60px";
this.elem.appendChild(this.mapcontrolbg);
this.tilemappng=document.createElement("div");
this.tilemappng.style.position="relative";
this.tilemappng.style.width="60px";
this.tilemappng.style.height="45px";
this.tilemappng.style.margin="0";
this.tilemappng.style.padding="0";
if(browser.name=="msie"&&browser.version<7){
this.tilemappng.style.backgroundImage="none";
this.tilemappng.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://img.mqcdn.com/mqtoolkit/zoom-bg-tilemap.png', sizingMethod='image')";
}else{
this.tilemappng.style.backgroundColor="transparent";
this.tilemappng.style.backgroundImage="url(http://img.mqcdn.com/mqtoolkit/zoom-bg-tilemap.png)";
this.tilemappng.style.backgroundPosition="0 0";
this.tilemappng.style.backgroundRepeat="no-repeat";
}
this.mapcontrolbg.appendChild(this.tilemappng);
this.ul=document.createElement("ul");
this.ul.className="map-controls screen";
this.elem.appendChild(this.ul);
this.li1=document.createElement("li");
this.li1.className="map-zoom";
this.li1.style.width="60px";
this.li1.style.height="50px";
this.ul.appendChild(this.li1);
this.mapzoomin=document.createElement("div");
this.mapzoomin.style.position="absolute";
this.mapzoomin.style.left="6px";
this.mapzoomin.style.top="8px";
this.mapzoomin.style.width="22px";
this.mapzoomin.className="io map-zoom-in";
this.li1.appendChild(this.mapzoomin);
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";
}
this.mapzoomin.appendChild(this.zoomin);
this.mapzoomout=document.createElement("div");
this.mapzoomout.style.position="absolute";
this.mapzoomout.style.left="29px";
this.mapzoomout.style.top="6px";
this.mapzoomout.style.width="22px";
this.mapzoomout.className="io map-zoom-out";
this.li1.appendChild(this.mapzoomout);
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";
}
this.mapzoomout.appendChild(this.zoomout);
};
MQA.ZoomControl.prototype=new MQA.Control();
MQA.ZoomControl.prototype.constructor=MQA.ZoomControl;
MQA.ZoomControl.prototype.dispose=function(){
this.map=null;
this.type=null;
MQA._prEvent.stopObserving(this.zoomin,"click",this.zoomin_click);
MQA._prEvent.stopObserving(this.zoomin,"mouseover",this.zoomin_mouseover);
MQA._prEvent.stopObserving(this.zoomin,"mouseout",this.zoomin_mouseout);
MQA._prEvent.stopObserving(this.zoomout,"click",this.zoomout_click);
MQA._prEvent.stopObserving(this.zoomout,"mouseover",this.zoomout_mouseover);
MQA._prEvent.stopObserving(this.zoomout,"mouseout",this.zoomout_mouseout);
this.mapcontrolbg.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.mapcontrolbg);
MQA.Util._deleteDOMObject(this.mapcontrolbg);
this.mapcontrolbg=null;
this.tilemappng.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.tilemappng);
MQA.Util._deleteDOMObject(this.tilemappng);
this.tilemappng=null;
this.mapzoomout.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.mapzoomout);
MQA.Util._deleteDOMObject(this.mapzoomout);
this.mapzoomout=null;
this.mapzoomin.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.mapzoomin);
MQA.Util._deleteDOMObject(this.mapzoomin);
this.mapzoomin=null;
MQA.Util._deleteDOMObject(this.li1);
this.li1=null;
MQA.Util._deleteDOMObject(this.ul);
this.ul=null;
this.zoomout.style.filter="";
MQA.Util._deleteDOMObject(this.zoomout);
this.zoomout=null;
MQA.Util._deleteDOMObject(this.zoomin);
this.zoomin=null;
this.elem.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.elem);
MQA.Util._deleteDOMObject(this.elem);
this.elem="";
};
MQA.ZoomControl.prototype.destructor=function(){
MQA._prEvent.stopObserving(this.zoomin,"click",this.zoomin_click);
MQA._prEvent.stopObserving(this.zoomin,"mouseover",this.zoomin_mouseover);
MQA._prEvent.stopObserving(this.zoomin,"mouseout",this.zoomin_mouseout);
MQA._prEvent.stopObserving(this.zoomout,"click",this.zoomout_click);
MQA._prEvent.stopObserving(this.zoomout,"mouseover",this.zoomout_mouseover);
MQA._prEvent.stopObserving(this.zoomout,"mouseout",this.zoomout_mouseout);
};
MQA.ZoomControl.prototype.initialize=function(map){
this.map=map;
this.type=MQA.CONTROL_ZOOM;
this.zoomin_click=MQA._prEvent.EventCallback(this,"eventmonitor");
this.zoomin_mouseover=MQA._prEvent.EventCallback(this,"eventmonitor");
this.zoomin_mouseout=MQA._prEvent.EventCallback(this,"eventmonitor");
this.zoomout_click=MQA._prEvent.EventCallback(this,"eventmonitor");
this.zoomout_mouseover=MQA._prEvent.EventCallback(this,"eventmonitor");
this.zoomout_mouseout=MQA._prEvent.EventCallback(this,"eventmonitor");
MQA._prEvent.observe(this.zoomin,"click",this.zoomin_click);
MQA._prEvent.observe(this.zoomin,"mouseover",this.zoomin_mouseover);
MQA._prEvent.observe(this.zoomin,"mouseout",this.zoomin_mouseout);
MQA._prEvent.observe(this.zoomout,"click",this.zoomout_click);
MQA._prEvent.observe(this.zoomout,"mouseover",this.zoomout_mouseover);
MQA._prEvent.observe(this.zoomout,"mouseout",this.zoomout_mouseout);
};
MQA.ZoomControl.prototype.eventmonitor=function(evt){
if(MQA._prEvent.element(evt)==this.zoomin){
eventId="in";
}
if(MQA._prEvent.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":
MQA._prEvent.element(evt).className="o";
break;
default:
MQA._prEvent.element(evt).src="http://img.mqcdn.com/mqmaptiled/z-on.png";
}
break;
case "mouseout":
switch(eventId){
case "in":
case "out":
MQA._prEvent.element(evt).className="";
break;
default:
if(parseFloat(eventId)!=this.map.getZoomLevel()){
MQA._prEvent.element(evt).src="http://img.mqcdn.com/mqmaptiled/z-"+eventId+".png";
}
}
break;
}
};
MQA.ZoomControl.prototype.getHeight=function(){
return 40;
};
MQA.ZoomControl.prototype.getWidth=function(){
return 62;
};
MQA.ViewControl=function(){
browser=MQA.browser;
this.map=null;
this.position=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT,new MQA.Size(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);
};
MQA.ViewControl.prototype=new MQA.Control();
MQA.ViewControl.prototype.constructor=MQA.ViewControl;
MQA.ViewControl.prototype.destructor=function(){
MQA._prEvent.stopObserving(this.streetview,"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.streetview,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.streetview,"mouseout",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.aerialview,"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.aerialview,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.aerialview,"mouseout",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.hybridview,"click",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.hybridview,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.stopObserving(this.hybridview,"mouseout",this.MQEventCallbackObserver);
};
MQA.ViewControl.prototype.initialize=function(map){
this.map=map;
this.type=MQA.CONTROL_TYPE;
this.MQEventCallbackObserver=MQA._prEvent.EventCallback(this,"eventmonitor");
MQA._prEvent.observe(this.streetview,"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.streetview,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.streetview,"mouseout",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.aerialview,"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.aerialview,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.aerialview,"mouseout",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.hybridview,"click",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.hybridview,"mouseover",this.MQEventCallbackObserver);
MQA._prEvent.observe(this.hybridview,"mouseout",this.MQEventCallbackObserver);
if(this.map.getMapType()=="map"){
this.streetview.className="a";
}
if(this.map.getMapType()=="sat"){
this.aerialview.className="a";
}
if(this.map.getMapType()=="hyb"){
this.hybridview.className="a";
}
};
MQA.ViewControl.prototype.eventmonitor=function(evt){
var _25=MQA._prEvent.element(evt);
switch(evt.type){
case "click":
if(_25==this.streetview){
this.selectMode("street");
}
if(_25==this.aerialview){
this.selectMode("aerial");
}
if(_25==this.hybridview){
this.selectMode("hybrid");
}
break;
case "mouseover":
if(_25.className!="a"){
_25.className="o";
}
break;
case "mouseout":
if(_25.className!="a"){
_25.className="";
}
break;
}
};
MQA.ViewControl.prototype.updateControl=function(_26){
switch(_26){
case "map":
this.aerialview.className="";
this.hybridview.className="";
this.streetview.className="a";
break;
case "sat":
this.hybridview.className="";
this.streetview.className="";
this.aerialview.className="a";
break;
case "hyb":
this.aerialview.className="";
this.streetview.className="";
this.hybridview.className="a";
break;
}
};
MQA.ViewControl.prototype.selectMode=function(_27){
var _28=this.map.getMapType();
var _29="noChange";
if(_27=="street"&&_28!="map"){
_29="map";
}
if(_27=="aerial"&&_28!="sat"){
_29="sat";
}
if(_27=="hybrid"&&_28!="hyb"){
_29="hyb";
}
if(_29!="noChange"){
this.map.setMapType(_29);
}
};
MQA.ViewControl.prototype.getHeight=function(){
return 22;
};
MQA.ViewControl.prototype.getWidth=function(){
return 209;
};

MQA.Declutter=function(_1){
this.map=_1;
this.mode=0;
this.declutterCleared=true;
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;
};
MQA.Declutter.prototype.setDeclutterMode=function(_2){
if(_2!=0&&this.map.batchCount==0){
if(this.mode!=0&&!this.declutterCleared){
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 MQA.DeclutterIcon("http://img.mqcdn.com/mqtoolkit/page_bar.png",29,19);
}
if(!this.pageMarkIcon){
this.pageMarkIcon=new MQA.DeclutterIcon("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(_2);
}
}else{
if(!this.declutterCleared){
this.doDeclutter(0);
}
}
this.mode=_2;
};
MQA.Declutter.prototype.getDeclutterMode=function(){
return this.mode;
};
MQA.Declutter.prototype.setDeclutterIcon=function(_3,_4,_5){
var m=this.getDeclutterMode();
if(m){
this.setDeclutterMode(0);
}
this.declutterIcon=new MQA.DeclutterIcon(_3,_4,_5);
if(m){
this.setDeclutterMode(m);
}
};
MQA.Declutter.prototype.setDeclutterOverIcon=function(_7,_8,_9){
var m=this.getDeclutterMode();
if(m){
this.setDeclutterMode(0);
}
this.declutterOverIcon=new MQA.DeclutterIcon(_7,_8,_9);
if(m){
this.setDeclutterMode(m);
}
};
MQA.Declutter.prototype.getDeclutterIcon=function(){
return this.declutterIcon;
};
MQA.Declutter.prototype.setNextPageIcon=function(_b,_c,_d){
var m=this.getDeclutterMode();
if(m){
this.setDeclutterMode(0);
}
this.nextPageIcon=new MQA.DeclutterIcon(_b,_c,_d);
if(m){
this.setDeclutterMode(m);
}
};
MQA.Declutter.prototype.getNextPageIcon=function(){
return this.nextPageIcon;
};
MQA.Declutter.prototype.setPrevPageIcon=function(_f,_10,_11){
var m=this.getDeclutterMode();
if(m){
this.setDeclutterMode(0);
}
this.prevPageIcon=new MQA.DeclutterIcon(_f,_10,_11);
if(m){
this.setDeclutterMode(m);
}
};
MQA.Declutter.prototype.getPrevPageIcon=function(){
return this.prevPageIcon;
};
MQA.Declutter.prototype.setStackHeight=function(n){
var m=this.getDeclutterMode();
if(m){
this.setDeclutterMode(0);
}
this.stackHeight=(n<1?1:n);
if(m){
this.setDeclutterMode(m);
}
};
MQA.Declutter.prototype.getStackHeight=function(){
return this.stackHeight;
};
MQA.Declutter.prototype.setStackWidth=function(n){
var m=this.getDeclutterMode();
if(m){
this.setDeclutterMode(0);
}
this.stackWidth=(n<2?2:n);
if(m){
this.setDeclutterMode(m);
}
};
MQA.Declutter.prototype.getStackWidth=function(){
return this.stackWidth;
};
MQA.Declutter.prototype.setRolloverDrag=function(b){
this.keepRolloversOnDrag=b;
};
MQA.Declutter.prototype.getRolloverDrag=function(){
return this.keepRolloversOnDrag;
};
MQA.Declutter.prototype.setLeaderLineColor=function(c){
this.leaderLineColor=c;
if(this.getDeclutterMode()==2){
this.redrawLeaderLines();
}
};
MQA.Declutter.prototype.getLeaderLineColor=function(){
return this.leaderLineColor;
};
MQA.Declutter.prototype.setLeaderLineDotMode=function(m){
this.leaderLineDotMode=m;
if(this.getDeclutterMode()==2){
this.redrawLeaderLines();
}
};
MQA.Declutter.prototype.getLeaderLineDotMode=function(){
return this.leaderLineDotMode;
};
MQA.Declutter.prototype.setLeaderLineDotImage=function(url,_1b,_1c){
this.leaderLineDotImage=new MQA.LeaderLineDotImage(url,_1b,_1c);
if(this.getDeclutterMode()==2){
this.redrawLeaderLines();
}
};
MQA.Declutter.prototype.getLeaderLineDotImage=function(){
return this.leaderLineDotImage;
};
MQA.Declutter.prototype.doDeclutter=function(_1d){
var i,j;
var x=100;
var y=50;
var _22=this.stackHeight*this.stackWidth;
var _23=1;
var _24=false;
var _25;
var _26;
var _27;
var _28;
var _29=1;
var _2a=true;
_1d=parseInt(_1d);
switch(_1d){
case 0:
this.declutterCleared=true;
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].poi.isDecluttered=false;
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){
this.removeLeaderLines();
var _2b=this.map.getPois();
for(var i=0,x=_2b.getSize();i<x;i++){
_2b.getAt(i).setLatLng(_2b.getAt(i).getLatLng());
_2b.getAt(i).dragLeft=null;
_2b.getAt(i).dragTop=null;
_2b.getAt(i).setAltStateFlag(false);
_2b.getAt(i).isDecluttered=false;
}
}
}
break;
case 1:
this.declutterCleared=false;
var _2c,_2d;
var _2e,_2f;
var _30;
var _31;
var b;
var _33=this.map.getPois();
var _34=new Array;
var _35=new Array;
for(var a=0,x=_33.getSize();a<x;a++){
_34[a]=new Array(_33.getAt(a).getLatLng().getLatitude(),_33.getAt(a).getLatLng().getLongitude(),a);
}
_34.sort(this.sortPoisRL);
for(var a=0,e=_34.length;a<e;a++){
_2c=_33.getAt(_34[a][2]).getIcon().getImage().width;
_2d=_33.getAt(_34[a][2]).getIcon().getImage().height;
_2e=this.map.getLLToXY(new MQA.PointLL(_34[a][0],_34[a][1]));
_2e.x+=_33.getAt(_34[a][2]).element.offset.x;
_2e.y+=_33.getAt(_34[a][2]).element.offset.y;
_2f=new MQA.PointXY(_2e.x+_2c,_2e.y+_2d);
if(this.declutterIcon.height>_2d){
_2e.y-=(this.declutterIcon.height-_2d);
}
_2e.y-=(this.nextPageIcon.height+_29);
if(this.declutterIcon.width>_2c){
_2f.x-=(this.declutterIcon.width-_2c);
}
_30=new MQA.RectXY(_2e,_2f);
_31=false;
for(b=0;!_31&&b<_35.length;b++){
_31=this.isIntersected(_30,_35[b][0]);
}
if(_31){
b=b-1;
_35[b][1][_35[b][1].length]=a;
var _38=_35[b][1].length;
var _39=parseInt((_38-1)%_22);
var _3a=parseInt(_39/this.stackWidth);
var _3b=parseInt(_39%this.stackWidth);
_25=_35[b][3].x-(_3b+1)*(this.declutterIcon.width+_29);
_26=_35[b][3].y-((_3a+1)*(this.declutterIcon.height+_29));
_2a=(_38<=_22);
if(_38<=this.stackWidth){
_35[b][0].ul.x-=(this.declutterIcon.width+_29);
}
if(_3b==0&&_3a>0&&_3a<this.stackHeight){
_35[b][0].ul.y-=(this.declutterIcon.height+_29)+(this.pageMarkIcon.height+_29);
}
this.addDeclutterPoi(_25,_26,_33.getAt(_34[a][2]),_2a,b);
if(_38>_22&&this.pnCollection[b]==null){
this.pnCollection[b]=new Array();
var _3c=_35[b][3].y-(this.stackHeight*(this.declutterIcon.height+_29)+(Math.max(this.nextPageIcon.height,this.pageBarIcon.height)+_29));
this.pnCollection[b][0]=new MQA.PrevNextIcon(this.prevPageIcon,_35[b][3].x-(this.nextPageIcon.width+this.pageBarIcon.width+this.prevPageIcon.width+(3*_29)),_3c,this.map,false,-1,b);
this.pnCollection[b][1]=new MQA.PrevNextIcon(this.nextPageIcon,_35[b][3].x-(this.nextPageIcon.width+_29),_3c,this.map,true,1,b);
this.pnCollection[b][2]=new MQA.PageMarkIcon(this.pageBarIcon,this.pageMarkIcon,_35[b][3].x-(this.nextPageIcon.width+this.pageBarIcon.width+(2*_29)),_3c,this.map,b);
}
}else{
if(this.declutterIcon.height>_2d){
_2e.y-=parseInt((this.declutterIcon.height-_2d)/2);
}
_2e.y+=(this.declutterIcon.height+_29);
var _3d=new Array();
_3d[0]=_30;
_3d[1]=new Array();
_3d[2]=a;
_3d[3]=_2e;
_35[_35.length]=_3d;
this.pnCollection[this.pnCollection.length]=null;
this.dcCollection[this.dcCollection.length]=new Array();
this.cpCollection[this.cpCollection.length]=1;
}
}
break;
case 2:
this.declutterCleared=false;
this.getPoiDims();
var _3e=this.createDeclutterGrps();
this.doDeclutterM2(_3e);
break;
}
};
MQA.Declutter.prototype.getPoiDims=function(){
var _3f=this.map.getPois();
var _40=_3f.getSize();
this.poiCollection={length:_40};
var _41=new Array;
for(var i=0;i<_40;i++){
_41[i]=new Array(_3f.getAt(i).getLatLng().getLatitude(),_3f.getAt(i).getLatLng().getLongitude(),i);
}
_41.sort(this.sortPois);
for(var i=0,j=_41.length;i<j;i++){
tmpHW=_3f.getAt(_41[i][2]).getIcon().getImage();
tmpXY=this.map.getLLToXY(_3f.getAt(_41[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:_41[i][2]};
}
};
MQA.Declutter.prototype.createDeclutterGrps=function(){
var _44=new Array();
var _45=new Array;
var _46=0;
var _47;
for(var i=0,k=this.poiCollection.length;i<k;i++){
if(MQA.Util.indexOf(_44,i)>=0){
continue;
}
_47=false;
for(var j=i+1;j<k;j++){
if(MQA.Util.indexOf(_44,j)>=0){
continue;
}
if(this.isOverlapped(this.poiCollection[i],this.poiCollection[j])){
if(!_47){
_45[_46]=new Array();
_45[_46].push(i);
_44.push(i);
_47=true;
}
_45[_46].push(j);
_44.push(j);
}
}
if(_45[_46]&&_45[_46].length>0){
_46++;
}
}
return _45;
};
MQA.Declutter.prototype.doDeclutterM2=function(_4b){
var _4c={x:0,y:0,h:0,w:0};
var PI=3.14;
var _4e,_4f;
var nx,ny;
var n,_53;
var _54;
var _55;
var _56;
var _57;
var _58=false;
var _59;
if(_4b.length==1&&_4b[0].length==this.poiCollection.length){
_58=true;
_4e=360/_4b[0].length;
_4f=1350/_4e;
_4f=(_4f<75)?75:_4f;
}else{
_4e=10;
_4f=75;
}
var _5a;
var _5b,_5c;
var _5d=this.map.getDragOffset();
for(var i=0,p=_4b.length;i<p;i++){
n=-180;
_53=this.getDeclutCenterPt(_4b[i]);
_54=1;
_5a=_4f;
for(var k=0,q=_4b[i].length;k<q;k++){
_55=this.poiCollection[_4b[i][k]];
_5b=Math.ceil(_55.w/2);
_5c=Math.ceil(_55.h/2);
for(var _62=n;;_62+=_4e){
if(_62>=180){
++_54;
_62-=360;
if(_54>2){
_5a+=30;
}
}
if(_54>4){
break;
}
nx=Math.round(_5a*Math.cos(PI*_62/180));
ny=Math.round(_5a*Math.sin(PI*_62/180));
_4c.x=_53.x+nx-_5b;
_4c.y=_53.y+ny-_5c;
_4c.h=_55.h;
_4c.w=_55.w;
if(_53.x>0&&_53.y>0&&_53.x<this.map.width&&_53.y<this.map.height){
if(_4c.x<=_4c.w||_4c.y<=_4c.h||_4c.x+_4c.w>=this.map.width||_4c.y+_4c.h>=this.map.height){
continue;
}
}
_56=false;
for(var m=0,r=this.poiCollection.length;m<r;m++){
_59=MQA.Util.indexOf(_4b[i],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+_5b,this.poiCollection[m].iy+_5c,this.poiCollection[m].x+_5b,this.poiCollection[m].y+_5c,_55.ix+_5b,_55.iy+_5c,_4c.x+_5b,_4c.y+_5c)){
_56=true;
break;
}
}
if(_59<0){
if((this.isOverlapped(_4c,this.poiCollection[m]))||((_54<2)&&this.checkLPIntersection((_55.ix+_5b),(_55.iy+_5c),_4c.x+_5b,_4c.y+_5c,this.poiCollection[m]))){
_56=true;
break;
}else{
if((_54<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+_5b,this.poiCollection[m].y+_5c,_4c)){
_56=true;
break;
}
}
}
}else{
if((_59>=0)&&(_59<k)&&(this.isOverlapped(_4c,this.poiCollection[m]))){
_56=true;
break;
}
}
}
if(_56){
continue;
}
n=_62+_4e;
_57=this.map.getPois().getAt(_55.indx);
_57.setAltStateFlag(true);
_57.isDecluttered=true;
_57.element.style.left=_4c.x-_5d.x+"px";
_57.element.style.top=_4c.y-_5d.y+"px";
this.drawLeaderLine(_57);
theLatLngXY=this.map.llToPix(_57.getLatLng());
_57.dragLeft=theLatLngXY.x-_4c.x;
_57.dragTop=theLatLngXY.y-_4c.y;
_55.x=_4c.x;
_55.y=_4c.y;
break;
}
}
}
};
MQA.Declutter.prototype.checkLPIntersection=function(x1,y1,x2,y2,poi){
var m1=(x2-x1==0)?(y2-y1)/1e-8:(y2-y1)/(x2-x1);
var a1=y1-m1*x1;
var hm2=0;
var vm2=poi.h/1e-8;
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);
};
MQA.Declutter.prototype.checkLLIntersection=function(x1,y1,x2,y2,u1,v1,u2,v2){
var m1=(x2-x1==0)?(y2-y1)/1e-8:(y2-y1)/(x2-x1);
var a1=y1-m1*x1;
var m2=(u2-u1==0)?(v2-v1)/1e-8:(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 _84=3;
if(((Math.abs(x1-xi)<=_84)&&(Math.abs(y1-yi)<=_84))||((Math.abs(u1-xi)<=_84)&&(Math.abs(v1-yi)<=_84))||((Math.abs(x2-xi)<=_84)&&(Math.abs(y2-yi)<=_84))||((Math.abs(u2-xi)<=_84)&&(Math.abs(v2-yi)<=_84))){
return (false);
}
return (true);
}
return (false);
};
MQA.Declutter.prototype.getDeclutCenterPt=function(_85){
var _86=0;
var _87=0;
var poi;
var _89=_85.length;
for(var i=0;i<_89;i++){
poi=this.poiCollection[_85[i]];
_86+=poi.ix+poi.w/2;
_87+=poi.iy+poi.h/2;
}
return (new MQA.PointXY(Math.round(_86/_89),Math.round(_87/_89)));
};
MQA.Declutter.prototype.isOverlapped=function(_8b,_8c){
var x1,x2,y1,y2,w1,w2,h1,h2;
x1=_8b.x;
y1=_8b.y;
h1=_8b.h;
w1=_8b.w;
x2=_8c.x;
y2=_8c.y;
h2=_8c.h;
w2=_8c.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);
};
MQA.Declutter.prototype.sortPois=function(a,b){
return (a[1]-b[1]);
};
MQA.Declutter.prototype.sortPoisRL=function(a,b){
return (b[1]-a[1]);
};
MQA.Declutter.prototype.isIntersected=function(_99,_9a){
var _9b=(_99.lr.x>_9a.ul.x)&&(_99.ul.x<_9a.lr.x)&&(_99.lr.y>_9a.ul.y)&&(_99.ul.y<_9a.lr.y);
return _9b;
};
MQA.Declutter.prototype.setMap=function(map){
this.map=map;
};
MQA.Declutter.prototype.addDeclutterPoi=function(x,y,poi,_a0,_a1){
var _a2=new MQA.DeclutterPoi(this.map,poi,_a0);
this.dcCollection[_a1].push(_a2);
poi.isDecluttered=true;
var ll=this.map.pixToLL(new MQA.Point(x,y));
this.map._addPoi(ll,new MQA.PointXY(0,0),_a2.div);
};
MQA.Declutter.prototype.turnPage=function(_a4,_a5){
var i;
var _a7=this.stackHeight*this.stackWidth;
var _a8=this.dcCollection[_a5].length;
if(this.cpCollection[_a5]==1&&_a4==-1){
return;
}
if(((this.cpCollection[_a5]*_a7)>=_a8)&&_a4==1){
return;
}
this.cpCollection[_a5]=this.cpCollection[_a5]+_a4;
for(i=0;i<_a8;i++){
this.dcCollection[_a5][i].setVisible(false);
}
var _a9=(this.cpCollection[_a5]*_a7);
if(_a9>_a8){
_a9=_a8;
}
var _aa=(this.cpCollection[_a5]*_a7)-_a7;
for(i=_aa;i<_a9;i++){
this.dcCollection[_a5][i].setVisible(true);
}
if(_aa>0){
this.pnCollection[_a5][0].setVisible(true);
}else{
this.pnCollection[_a5][0].setVisible(false);
}
if(_a9<_a8){
this.pnCollection[_a5][1].setVisible(true);
}else{
this.pnCollection[_a5][1].setVisible(false);
}
var _ab=this.cpCollection[_a5]-1;
var _ac=parseInt(Math.ceil(_a8/_a7))-1;
var _ad=this.pageBarIcon.width-6;
this.pnCollection[_a5][2].div.mar.style.left=parseInt(_ad*(_ab/_ac))+"px";
};
MQA.Declutter.prototype.adjustLeaderLineSurface=function(){
var _ae=false;
if(this.map.poisurface){
if(this.map.getDragOffset().x!=this.map.poiLineOffsetX||this.map.getDragOffset().y!=this.map.poiLineOffsetY){
this.map.poiLineOffsetX=this.map.getDragOffset().x;
this.map.poiLineOffsetY=this.map.getDragOffset().y;
if(this.map.poilinediv){
this.map.poilinediv.style.left=-(MQA.SURFACE_OFFSET+this.map.poiLineOffsetX)+"px";
this.map.poilinediv.style.top=-(MQA.SURFACE_OFFSET+this.map.poiLineOffsetY)+"px";
}
_ae=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=-(MQA.SURFACE_OFFSET+this.map.canvasOffsetX)+"px";
this.map.dcCanvasDiv.style.top=-(MQA.SURFACE_OFFSET+this.map.canvasOffsetY)+"px";
}
_ae=true;
}
}
return _ae;
};
MQA.Declutter.prototype.drawLeaderLine=function(poi){
var xy=new Object;
var _b1=(MQA.browser.name=="safari");
if(!_b1){
if(!this.map.poisurface){
this.map.createPoiDrawingSurface();
}
}else{
if(!this.map.dcCanvasDiv){
this.map.createCanvas();
}
}
if(!_b1){
if(!poi.map.poisurface){
throw ("Leader line drawing surface does not exist.");
}
}else{
if(!this.map.dcCanvasDiv){
throw ("Leaderline drawing canvas does not exist.");
}
}
if(!this.adjustLeaderLineSurface()){
var _b2=this.map.getDragOffset();
var _b3=new Array();
_b3[0]=new Object;
_b3[0]=this.map.llToPix(poi.getLatLng());
_b3[0].x+=(MQA.SURFACE_OFFSET);
_b3[0].y+=(MQA.SURFACE_OFFSET);
_b3[1]=new Object;
var _b4=parseInt(this.map.div1.style.left)+_b2.x;
var _b5=parseInt(this.map.div1.style.top)+_b2.y;
if(poi.getAltStateFlag()){
var _b6=poi.getAltIcon().getAnchorOffset().getX();
var _b7=poi.getAltIcon().getAnchorOffset().getY();
}else{
var _b6=poi.getIcon().getAnchorOffset().getX();
var _b7=poi.getIcon().getAnchorOffset().getY();
}
_b3[1].x=(parseInt(poi.element.style.left)+MQA.SURFACE_OFFSET)-_b6+_b4;
_b3[1].y=(parseInt(poi.element.style.top)+MQA.SURFACE_OFFSET)-_b7+_b5;
cpnts=new Array();
if(MQA.Util.isOverLimit(xy)){
if(!_b1){
var _b8=parseInt(this.map.poilinediv.style.height.substr(0,(this.map.poilinediv.style.height.length)-2));
var _b9=parseInt(this.map.poilinediv.style.width.substr(0,(this.map.poilinediv.style.width.length)-2));
}else{
var _b8=parseInt(this.map.dcCanvasDiv.style.height.substr(0,(this.map.dcCanvasDiv.style.height.length)-2));
var _b9=parseInt(this.map.dcCanvasDiv.style.width.substr(0,(this.map.dcCanvasDiv.style.width.length)-2));
}
cpnts=MQA.Clip(0,_b8,0,_b9,_b3,false);
}else{
cpnts=_b3;
}
var _ba=(poi.leaderLineColor?poi.leaderLineColor:this.leaderLineColor);
if(poi.leaderLineDotIcon){
poi.leaderLineDotIcon.div.im.style.display="none";
}
if(!_b1){
if(poi.leaderLine){
poi.leaderLine=MQA.Graphics.remove(this.map.poisurface,poi.leaderLine);
}
if(poi.leaderLineDot){
poi.leaderLineDot=MQA.Graphics.remove(this.map.poisurface,poi.leaderLineDot);
}
poi.leaderLine=MQA.Graphics.drawPolygon(cpnts,_ba,1,2,_ba,1,true);
this.map.poisurface.appendChild(poi.leaderLine);
poi.leaderLine.setAttribute("zIndex",80);
}else{
this.map.dcCanvasContext.strokeStyle=_ba;
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 _bb=parseInt(this.getLeaderLineDotMode());
switch(_bb){
case 0:
break;
case 1:
if(!_b1){
var c=new Array({x:cpnts[0].x-3,y:cpnts[0].y-3},{x:cpnts[0].x+3,y:cpnts[0].y+3});
var _bd=this.map.llToPix(poi.getLatLng()).x;
var _be=this.map.llToPix(poi.getLatLng()).y;
var _bf=-MQA.SURFACE_OFFSET;
var _c0=-MQA.SURFACE_OFFSET;
if(!((_bd<_bf)||(_bd>_bf+MQA.Graphics.surfaceWidth)||(_be<_c0)||(_be>_c0+MQA.Graphics.surfaceHeight))){
poi.leaderLineDot=MQA.Graphics.drawEllipse(c,_ba,1,1,_ba,1,true);
this.map.poisurface.appendChild(poi.leaderLineDot);
poi.leaderLineDot.setAttribute("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 MQA.LeaderLineDotIcon(poi.getLeaderLineDotImage(),this.map,poi);
}else{
if(this.getLeaderLineDotImage()){
poi.leaderLineDotIcon=new MQA.LeaderLineDotIcon(this.getLeaderLineDotImage(),this.map,poi);
}
}
break;
default:
break;
}
}else{
this.redrawLeaderLines();
}
};
MQA.Declutter.prototype.redrawLeaderLines=function(){
var _c1=null;
if(arguments.length>0){
_c1=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++){
var _c4=this.map.mypois.getAt(i);
if(_c4.altStateFlag&&(_c4!=_c1)){
if(_c4.leaderLine){
_c4.leaderLine=MQA.Graphics.remove(this.map.poisurface,_c4.leaderLine);
}
if(_c4.leaderLineDot){
_c4.leaderLineDot=MQA.Graphics.remove(this.map.poisurface,_c4.leaderLineDot);
}
this.drawLeaderLine(_c4);
}
}
};
MQA.Declutter.prototype.removeLeaderLines=function(){
for(var i=0,x=this.map.mypois.getSize();i<x;i++){
var _c7=this.map.mypois.getAt(i);
if(_c7.altStateFlag){
if(_c7.leaderLine){
_c7.leaderLine=MQA.Graphics.remove(this.map.poisurface,_c7.leaderLine);
}
if(_c7.leaderLineDot){
_c7.leaderLineDot=MQA.Graphics.remove(this.map.poisurface,_c7.leaderLineDot);
}
if(_c7.leaderLineDotIcon){
this.map._removePoi(_c7.leaderLineDotIcon.div);
_c7.leaderLineDotIcon=null;
}
}
}
if(MQA.browser.name=="safari"){
if(this.map.dcCanvasContext){
this.map.dcCanvasContext.clearRect(0,0,parseInt(this.map.dcCanvasDiv.style.width),parseInt(this.map.dcCanvasDiv.style.height));
}
}
};
MQA.Declutter.prototype.resetDraggedPois=function(){
var _c8;
for(var i=0,j=this.map.getPois().getSize();i<j;i++){
_c8=this.map.getPois().getAt(i);
theLatLngXY=this.map.llToPix(_c8.getLatLng());
if(_c8.dragLeft!=null){
_c8.element.style.left=theLatLngXY.x-_c8.dragLeft+"px";
_c8.element.style.top=theLatLngXY.y-_c8.dragTop+"px";
}
}
};
MQA.DeclutterPoi=function(map,poi,_cd){
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 _ce;
if(poi.getAltIcon()!=poi.getIcon()){
_ce=new MQA.DeclutterIcon(poi.getAltIcon()._getImgSrc(poi.getAltIcon().getImage()),this.map.mydeclutter.declutterIcon.width,this.map.mydeclutter.declutterIcon.height);
}else{
_ce=this.map.mydeclutter.declutterIcon;
}
if((MQA.browser.name=="msie"&&MQA.browser.version<7)&&MQA.Util._hasPngExtention(this.map.mydeclutter.declutterOverIcon.url)&&MQA.Util._hasPngExtention(_ce.url)){
this.div.im.src="http://img.mqcdn.com/a/a";
this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_ce.url+"', sizingMethod='image') ";
}else{
this.div.im.src=_ce.url;
}
this.div.im.style.height=_ce.height+"px";
this.div.im.style.width=_ce.width+"px";
this.div.im.style.position="absolute";
if(_cd){
this.div.im.style.display="block";
}else{
this.div.im.style.display="none";
}
this.div.style.MozUserSelect="none";
this.div.appendChild(this.div.im);
MQA._prEvent.observe(this.div.im,"click",MQA._prEvent.EventCallback(poi,"onClick"));
MQA._prEvent.observe(this.div.im,"dblclick",MQA._prEvent.EventCallback(poi,"onDoubleClick"));
MQA._prEvent.observe(this.div.im,"mousedown",MQA._prEvent.EventCallback(poi,"onMouseDown"));
MQA._prEvent.observe(this.div.im,"mouseup",MQA._prEvent.EventCallback(poi,"onMouseUp"));
MQA._prEvent.observe(this.div.im,"mouseover",MQA._prEvent.EventCallback(this,"onMouseOver"));
MQA._prEvent.observe(this.div.im,"mouseout",MQA._prEvent.EventCallback(this,"onMouseOut"));
poi.setVisible(false);
};
MQA.DeclutterPoi.prototype={onMouseOut:function(e){
if(this.poi.showingInfo!=true){
this.poi.setVisible(false);
this.poi.setLevel(90);
}
this.poi.onMouseOut(e);
var _d0;
if(this.poi.getAltIcon()!=this.poi.getIcon()){
_d0=new MQA.DeclutterIcon(this.poi.getAltIcon()._getImgSrc(this.poi.getAltIcon().getImage()),this.map.mydeclutter.declutterIcon.width,this.map.mydeclutter.declutterIcon.height);
}else{
_d0=this.map.mydeclutter.declutterIcon;
}
if((MQA.browser.name=="msie"&&MQA.browser.version<7)&&MQA.Util._hasPngExtention(this.map.mydeclutter.declutterOverIcon.url)&&MQA.Util._hasPngExtention(_d0.url)){
this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_d0.url+"', sizingMethod='image') ";
}else{
this.div.im.src=_d0.url;
}
},onMouseOver:function(e){
this.poi.setLevel(100);
this.poi.setVisible(true);
this.poi.onMouseOver(e);
var _d2;
if(this.poi.getAltIcon()!=this.poi.getIcon()){
_d2=new MQA.DeclutterIcon(this.poi.getAltIcon()._getImgSrc(this.poi.getAltIcon().getImage()),this.map.mydeclutter.declutterIcon.width,this.map.mydeclutter.declutterIcon.height);
}else{
_d2=this.map.mydeclutter.declutterIcon;
}
if((MQA.browser.name=="msie"&&MQA.browser.version<7)&&MQA.Util._hasPngExtention(this.map.mydeclutter.declutterOverIcon.url)&&MQA.Util._hasPngExtention(_d2.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";
}};
MQA.PageMarkIcon=function(bar,_d5,x,y,map,_d9){
this.map=map;
this.index=_d9;
this.div=document.createElement("div");
this.div.className="pois";
this.div.bar=document.createElement("img");
if(MQA.browser.name=="msie"&&MQA.Util._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(MQA.browser.name=="msie"&&MQA.Util._hasPngExtention(_d5.url)){
this.div.mar.src="http://img.mqcdn.com/a/a";
this.div.mar.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_d5.url+"', sizingMethod='image');";
}else{
this.div.mar.src=_d5.url;
}
this.div.mar.style.position="absolute";
this.div.mar.style.display="block";
this.div.mar.style.height=_d5.height;
this.div.mar.style.width=_d5.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 MQA.Point(x,y));
this.map._addPoi(ll,new MQA.PointXY(0,0),this.div);
};
MQA.PageMarkIcon.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;
}};
MQA.PrevNextIcon=function(_db,x,y,map,_df,_e0,_e1){
this.map=map;
this.increment=_e0;
this.index=_e1;
this.div=document.createElement("div");
this.div.className="pois";
this.div.im=document.createElement("img");
if(MQA.browser.name=="msie"&&MQA.Util._hasPngExtention(_db.url)){
this.div.im.src="http://img.mqcdn.com/a/a";
this.div.im.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_db.url+"', sizingMethod='image');";
}else{
this.div.im.src=_db.url;
}
this.div.im.style.position="absolute";
if(_df){
this.div.im.style.display="block";
}else{
this.div.im.style.display="none";
}
this.div.im.style.height=_db.height;
this.div.im.style.width=_db.width;
this.div.style.MozUserSelect="none";
this.div.appendChild(this.div.im);
var ll=this.map.pixToLL(new MQA.Point(x,y));
this.map._addPoi(ll,new MQA.PointXY(0,0),this.div);
MQA._prEvent.observe(this.div.im,"click",MQA._prEvent.EventCallback(this,"onClick"));
MQA._prEvent.observe(this.div.im,"dblclick",MQA._prEvent.EventCallback(this,"onDblClick"));
};
MQA.PrevNextIcon.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;
}};
MQA.DeclutterIcon=function(url,_e7,_e8){
this.url=url;
this.width=_e7;
this.height=_e8;
};

MQA._prEvent=new function(){
var _1=false,_2=false,_3=[],_4=[],_5=false;
function _checkUnlReg(){
if(!_5&&document.body){
_5=true;
if(document.body.attachEvent){
document.body.attachEvent("onunload",_onUnload);
}else{
document.body.addEventListener("onunload",_onUnload,false);
}
}
};
function _onLoad(){
_1=true;
_checkUnlReg();
for(var i=0;i<_3.length;i++){
_3[i]();
}
};
function _onUnload(){
};
this._onUnload=function(){
if(_2){
return;
}
if(window.detachEvent){
window.detachEvent("onload",_onLoad);
window.detachEvent("onunload",_onUnload);
if(document.body){
document.body.detachEvent("onunload",_onUnload);
}
}
for(var i=0;i<_4.length;i++){
var l=_4[i];
try{
_4[i]();
if(l){
_4[i]();
}
}
catch(e){
}
}
_2=true;
};
this.addOnUnload=function(_9){
_4.push(_9);
};
this.observe=function(_a,_b,_c){
if(typeof _a=="string"){
_a=document.getElementById(_a);
}
if(_b=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_a.attachEvent)){
_b="keydown";
}
this._observe(_a,_b,_c);
};
this.stopObserving=function(_d,_e,_f){
if(typeof _d=="string"){
_d=document.getElementById(_d);
}
if(_e=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_d.attachEvent)){
_e="keydown";
}
this._stopObserving(_d,_e,_f);
};
var dav=navigator.appVersion;
var _11;
if(dav.match(/\bMSIE\b/)&&window.attachEvent){
_11=parseFloat(dav.split("MSIE ")[1].split(";")[0]);
if(_11){
var _12=[];
this._observe=function(_13,_14,_15){
_13.attachEvent("on"+_14,_15);
var _16=_12.length;
_12[_16]=[_13,_14,_15];
_15["__ie6_"+_14]=_16;
};
this._stopObserving=function(_17,_18,_19){
_17.detachEvent("on"+_18,_19);
var _1a=_19["__ie6_"+_18];
if(_1a){
delete _12[_1a];
}
};
this.addOnUnload(this._evUnloadFcn=function(){
for(var k in _12){
var v=_12[k];
if(typeof v=="object"&&v.length==3){
delete _12[k];
try{
v[0].detachEvent("on"+v[1],v[2]);
}
catch(e){
}
}
}
});
}else{
this._observe=function(_1d,_1e,_1f){
_1d.attachEvent("on"+_1e,_1f);
};
this._stopObserving=function(_20,_21,_22){
_20.detachEvent("on"+_21,_22);
};
}
}else{
_11=false;
this._observe=function(_23,_24,_25){
_23.addEventListener(_24,_25,false);
};
this._stopObserving=function(_26,_27,_28){
_26.removeEventListener(_27,_28,false);
};
}
var _29=[];
this.addDtor=function(obj,_2b){
var _2c=_29.length,v;
if(arguments.length>1){
v=[obj,_2b];
}else{
v=[obj];
}
_29[_2c]=v;
return _2c;
};
this.delDtor=function(_2e){
delete _29[_2e];
};
this._dtorHandler=function(){
var k,v;
for(k in _29){
v=_29[k];
if(v&&(typeof v=="object")&&v.length){
try{
if(v.length==1){
v[0].call(null);
}else{
v[0][v[1]].call(v[0]);
}
}
catch(e){
}
try{
delete _29[k];
}
catch(e){
}
}
}
};
this.observe(window,"unload",this._onUnload);
this.addOnUnload(this._dtorHandler);
};
MQA._prEvent.element=function(_31){
return _31.target||_31.srcElement;
};
MQA._prEvent.isLeftClick=function(_32){
return ((_32.which&&(_32.which==1))||(_32.button&&(_32.button==1)));
};
MQA._prEvent.stop=function(_33){
if(_33.preventDefault){
_33.preventDefault();
_33.stopPropagation();
}else{
_33.returnValue=false;
_33.cancelBubble=true;
}
};
MQA._prEvent.falseFunction=function(){
return false;
};
MQA._prEvent.emptyFunction=function(){
};
MQA._prEvent.hitch=function(_34,_35){
var _36=[];
for(var i=2;i<arguments.length;i++){
_36.push(arguments[i]);
}
return function(){
return _34[_35].apply(_34,_36);
};
};
MQA._prEvent.EventCallback=function(_38,_39){
var _3a=_38;
return function(_3b){
if(_3a.turnEventsOff||(_3a.map&&_3a.map.turnEventsOff)){
return;
}
if(!_3b){
_3b=window.event;
}
_3a[_39](_3b);
};
};
MQA.Event=function(){
this.type="event";
this.srcObject=null;
if(arguments.length){
this.eventName=arguments[0];
}else{
this.eventName="unnamed event";
}
};
MQA.EventManager=new function(){
this.addListener=function(_3c,_3d,_3e,_3f){
if(!this.observers){
this.observers=[];
}
if(_3f==null){
_3f=_3c;
}
this.observers.push([_3c,_3d,_3e,_3f]);
};
this.removeListener=function(_40,_41,_42,_43){
if(this.observers){
if(_43==null){
_43=_40;
}
for(x=this.observers.length-1;x>=0;x--){
var _44=this.observers[x];
if(_44[0]==_40&&_44[1]==_41&&_44[2]==_42&&_44[3]==_43){
this.observers.splice(x,1);
}
}
}
};
this.clearListeners=function(_45,_46){
if(this.observers){
for(x=this.observers.length-1;x>=0;x--){
var _47=this.observers[x];
if(_47[0]==_45){
if(_46&&_47[1]!=_46){
continue;
}
this.observers.splice(x,1);
}
}
}
};
this.trigger=function(_48,_49,_4a){
if(this.observers){
_4a=_4a||{type:_4a};
for(var i=0,j=this.observers.length;i<j;i++){
var _4d=this.observers[i];
if(_4d[0]==_48&&_4d[1]==_49){
_4d[2].call(_4d[3],_4a);
}
}
}
};
};

MQA.tileMapCount=0;
MQA.getMapResources=function(){
return MQA.RESOURCES;
};
MQA.getStaticMapResources=function(){
return MQA.STATICRESOURCES;
};
MQA.incrTileMapCount=function(){
MQA.tileMapCount=MQA.tileMapCount+1;
return MQA.tileMapCount;
};
MQA.getTileMapCount=function(){
return MQA.tileMapCount;
};
MQA.getRowTile=function(_1,_2){
var y=(_1+90)*(MQA.PIXERSPERLATDEGREE/_2);
var RW=parseInt(y/MQA.TILESIZE);
return RW;
};
MQA.getRowTileOffset=function(_5,_6){
var y=(_5+90)*(MQA.PIXERSPERLATDEGREE/_6);
var RW=parseInt(y/MQA.TILESIZE);
return (y-RW*MQA.TILESIZE);
};
MQA.getLatTileRowOffset=function(TL,_a,_b){
var y=TL*MQA.TILESIZE+_a;
var _d=y/(MQA.PIXERSPERLATDEGREE/_b)-90;
_d=parseInt(_d*1000000)/1000000;
return _d;
};
MQA.getColTile=function(_e,_f){
var x=(_e+180)*(MQA.PIXERSPERLNGDEGREE/_f);
var _11=parseInt(x/MQA.TILESIZE);
return _11;
};
MQA.getColTileOffset=function(LNG,_13){
var x=(LNG+180)*(MQA.PIXERSPERLNGDEGREE/_13);
var _15=parseInt(x/MQA.TILESIZE);
return (x-_15*MQA.TILESIZE);
};
MQA.getLngTileColOffset=function(TL,_17,_18){
var x=TL*MQA.TILESIZE+_17;
var LNG=x/(MQA.PIXERSPERLNGDEGREE/_18)-180;
LNG=parseInt(LNG*1000000)/1000000;
while(LNG>180){
LNG-=360;
}
while(LNG<-180){
LNG+=360;
}
return LNG;
};

MQA.Util={isMouseLeaveOrEnter:function(e,_2){
if(e.type!="mouseout"&&e.type!="mouseover"){
return false;
}
var _3=e.relatedTarget?e.relatedTarget:e.type=="mouseout"?e.toElement:e.fromElement;
while(_3&&_3!=_2){
_3=_3.parentNode;
}
return (_3!=_2);
},getTop:function(_4){
var _5=0;
while(_4){
_5+=parseInt(_4.offsetTop);
_4=_4.offsetParent;
}
return (_5);
},centreElement:function(_6){
_6.style.left=(MQA.browser.size().width-_6.offsetWidth)/2+"px";
_6.style.top=(MQA.browser.size().height-_6.offsetHeight)/2+"px";
},deleteChildElements:function(_7){
if(_7&&_7.childNodes.length>0){
for(var i=(_7.childNodes.length-1);i>=0;i--){
_7.removeChild(_7.childNodes[i]);
}
}
},deleteElement:function(_9){
if(_9){
_9.parentNode.removeChild(_9);
}
},pngFilter:function(_a){
if(!document.getElementsByTagName){
return;
}
if(MQA.browser.info.name=="msie"&&((MQA.browser.info.version<7)&&MQA.browser.info.version>5)){
var _b=(_a)?_a:document.images;
for(var i=0,l=_b.length;i<l;i++){
var _e=_b[i];
var _f=_e.src;
if(_f){
var _10=_f.length;
if(_f.toLowerCase().substring(_10-4,_10)==".png"){
if(!_e.title){
_e.title=(_e.alt)?_e.alt:"";
}
_e.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_e.src+"');";
_e.src=MQ.art.spacer;
}
}
}
}
},getSuperRect:function(_11,_12){
var _13=new MQA.RectLL(new MQA.PointLL(0,0),new MQA.PointLL(0,0));
_13.ul.lat=Math.max(_11.ul.lat,_12.ul.lat);
_13.ul.lng=Math.min(_11.ul.lng,_12.ul.lng);
_13.lr.lat=Math.min(_11.lr.lat,_12.lr.lat);
_13.lr.lng=Math.max(_11.lr.lng,_12.lr.lng);
return _13;
},_hasPngExtention:function(url){
var _15=url.toLowerCase();
var _16=_15.lastIndexOf(".png");
if((_16!=-1)&&(_16==(_15.length-4))){
return true;
}
return false;
},_createImage:function(url,_18,top,_1a,_1b,_1c){
var img;
img=document.createElement("img");
if(_1c==null){
_1c=false;
}
if(_1c){
img.isPng=_1c;
}else{
img.isPng=this._hasPngExtention(url);
}
if(!img.isPng){
img.src=url;
}else{
if(MQA.browser.name=="msie"&&((MQA.browser.version<7)&&MQA.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=_18+"px";
img.style.top=top+"px";
img.style.width=_1a+"px";
img.style.height=_1b+"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=MQA._prEvent.falseFunction;
img.oncontextmenu=MQA._prEvent.falseFunction;
if(_1c==null){
_1c=false;
}
if(_1c){
img.isPng=_1c;
}else{
img.isPng=this._hasPngExtention(url);
}
return img;
},createImage:function(URL,_1f,TOP,_21,_22,_23){
var _24;
_24=document.createElement("IMG");
_24.galleryimg="no";
_24.lt=_1f;
_24.tp=TOP;
var _25=_24.style;
_25.width=MQA.Util.asPix(_21);
_25.height=MQA.Util.asPix(_22);
_25.position="absolute";
_25.left=MQA.Util.asPix(_1f);
_25.top=MQA.Util.asPix(TOP);
_25.zIndex=_23;
_25.MozUserSelect="none";
_25.display="block";
_25.border="0";
if(URL.length==0){
_25.visibility="hidden";
}else{
_25.visibility="visible";
_24.src=URL;
}
_24.unselectable="on";
_24.onselectstart=MQA._prEvent.falseFunction;
_24.oncontextmenu=MQA._prEvent.falseFunction;
return _24;
},pause:function(_26){
var now=new Date();
var _28=now.getTime()+_26;
while(true){
now=new Date();
if(now.getTime()>_28){
return;
}
}
},asPix:function(X){
return X+"px";
},calcPercentage:function(_2a,_2b){
return Math.round((_2a/_2b)*100);
},stripHTMLTags:function(s){
return s.replace(/<\/?[^>]+>/gi,"");
},panAngle:function(_2d,_2e,_2f,_30){
var b=(_30-_2e);
var c=(_2f-_2d);
if(b<0){
b=b*-1;
}
if(c<0){
c=c*-1;
}
var a=Math.round(Math.sqrt(b*b+c*c));
var _34=Math.round((Math.asin(b/a)*360)/(2*3.14));
return _34;
},isOverLimit:function(_35){
var _36=false;
var _37=16000;
for(var i=0;i<_35.length;i++){
if(_35[i].x>_37||_35[i].x<-_37||_35[i].y>_37||_35[i].y<-_37){
_36=true;
break;
}
}
return _36;
},InitDojo:function(_39){
window.onload=_39;
},getWindowScrollXY:function(){
var _3a=new MQA.Point(0,0);
if(typeof (window.pageYOffset)=="number"){
_3a.setX(window.pageXOffset);
_3a.setY(window.pageYOffset);
}else{
if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
_3a.setX(document.body.scrollLeft);
_3a.setY(document.body.scrollTop);
}else{
if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
_3a.setX(document.documentElement.scrollLeft);
_3a.setY(document.documentElement.scrollTop);
}
}
}
return (_3a);
},getHTMLSubstring:function(_3b,_3c,_3d){
var _3e=/<\/?[^>]+>/ig;
var _3f=new Array();
var _40=_3b.replace(_3e,"|");
var _41=_40.split("|");
_3f=_3b.match(_3e);
var _42="";
var _43=false;
for(var i=charCount=0;i<_41.length;i++){
charCount+=_41[i].length;
if(charCount>=_3c&&_43==false){
charCount-=_41[i].length;
_41[i]=_41[i].substr(0,(_3c-charCount))+_3d;
_43=true;
continue;
}
if(_43==true){
_41[i]="";
}
}
for(var i=0;i<_41.length;i++){
_42+=_41[i];
if(_3f&&(_3f.length>0)&&(i<_3f.length)){
_42+=_3f[i];
}
}
return (_42);
},getBrowserSize:function(){
size=new MQA.Size(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;
},isSupportedBrowser:function(){
browser=MQA.browser;
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;
},getParentOffset:function(_45){
var _46=0,_47=0;
do{
_46+=_45.offsetTop||0;
_47+=_45.offsetLeft||0;
_45=_45.offsetParent;
}while(_45);
return (new MQA.Point(_47,_46));
},indexOf:function(_48,_49){
for(var i=0,_4b=_48.length;i<_4b;i++){
if(_48[i]==_49){
return i;
}
}
return -1;
},getBrowserInfo:function(){
browser=new Object();
browser.name=browser.version=browser.os="unknown";
var _4c=navigator.userAgent.toLowerCase();
var _4d=new Array("firefox","msie","netscape","opera","safari");
var _4e=new Array("linux","mac","windows","x11");
for(var i=0,n=_4d.length;i<n;i++){
var _51=_4c.indexOf(_4d[i])+1;
if(_51>0){
browser.name=_4d[i];
var _52=_51+browser.name.length;
var _53=((browser.name=="safari")||(_4c.charAt(_52+4)>0&&_4c.charAt(_52+4)<9))?5:3;
browser.version=_4c.substring(_52,_52+_53);
}
}
for(var i=0,n=_4e.length;i<n;i++){
var _51=_4c.indexOf(_4e[i])+1;
if(_51>0){
browser.os=_4e[i];
}
}
return browser;
},createParentDiv:function(id,lt,tp,_57,top,_59,_5a,_5b,_5c){
var _5d=document.createElement("div");
_5d.id=id;
_5d.lt=lt;
_5d.tp=tp;
_5d.style.position=_57;
_5d.style.top=top+"px";
_5d.style.left=_59+"px";
if(_5a!=null){
_5d.style.zIndex=_5a;
}
if(_5b!=null){
_5d.style.width=_5b+"px";
}
if(_5c!=null){
_5d.style.height=_5c+"px";
}
return _5d;
},createImgHolder:function(src,_5f,_60,_61,_62){
var _63=document.createElement("img");
if(src!=null){
_63.src=src;
}
_63.unselectable=_5f;
_63.style.MozUserSelect=_60;
_63.style.display=_61;
if(_62!=null){
_63.style.zIndex=_62;
}
return _63;
},createImgLogo:function(_64,_65,_66,_67,_68,_69,_6a,src,_6c,_6d){
var _6e=document.createElement("img");
_6e.style.MozUserSelect=_64;
_6e.unselectable=_65;
_6e.corner=_66;
_6e.offset=_67;
_6e.style.position=_68;
_6e.style.display=_69;
_6e.style.zIndex=_6a;
if(_6c!=null){
_6e.width=_6c;
}
if(_6d!=null){
_6e.height=_6d;
}
return _6e;
},createArea:function(_6f,_70,_71,_72,alt){
var tmp=document.createElement("area");
if(_6f!=null){
tmp.shape=_6f;
}
if(_70!=null){
tmp.coords=_70;
}
if(_71!=null){
tmp.href=_71;
}
if(_72!=null){
tmp.title=_72;
}
if(alt!=null){
tmp.alt=alt;
}
return tmp;
},_getRandomGUID:function(n){
var p;
var _77="";
var _78="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for(var i=0;i<n;i++){
p=Math.floor(Math.random()*_78.length);
_77+=_78.substr(p,1);
}
return _77;
},_nukeChildren:function(obj){
var c,s;
while(obj.hasChildNodes()){
c=obj.firstChild;
if(c.hasChildNodes){
this._nukeChildren(c);
}
if(c.innerHTML){
c.innerHTML=null;
}
if(c.outerHTML){
this._setOuterHTMLToEmptyString(c);
}
this._purge(c);
obj.removeChild(c);
delete c;
}
},_purge:function(d){
var a=d.attributes,i,l,n;
if(a){
l=a.length;
for(i=0;i<l;i+=1){
n=a[i].name;
if(typeof d[n]==="function"){
d[n]=null;
}
}
}
a=d.childNodes;
if(a){
l=a.length;
for(i=0;i<l;i+=1){
this._purge(d.childNodes[i]);
}
}
},_deleteDOMObject:function(obj){
this._purge(obj);
this._nukeChildren(obj);
if(obj.innerHTML){
obj.innerHTML=null;
}
if(obj.outerHTML){
this._setOuterHTMLToEmptyString(obj);
}
if(obj.parentNode){
obj.parentNode.removeChild(obj);
}
return null;
},_setOuterHTMLToEmptyString:function(obj){
if(this.getBrowserInfo().name!="safari"){
obj.outerHTML="";
}
}};
MQA.browser=MQA.Util.getBrowserInfo();

MQA.Graphics={setDrawMethod:function(){
var _1=MQA.browser.name;
if(_1=="msie"){
this.drawMethod="vml";
this.eventsActive=true;
}else{
if(_1=="safari"){
this.drawMethod="canvas";
this.eventsActive=false;
}else{
this.drawMethod="svg";
this.eventsActive=true;
}
}
},normalizeColor:function(c){
function toHex(n){
var _4=n.toString(16).toUpperCase();
return (_4.length==1?"0"+_4:_4);
};
var p=new Object();
if(c.constructor.toString().indexOf("Array")!=-1){
p.rgb=c;
p.hex="#"+toHex(c[0])+toHex(c[1])+toHex(c[2]);
}else{
if(c.substring(0,1)=="#"){
p.rgb=new Array();
p.rgb[0]=parseInt("0x"+c.substring(1,3));
p.rgb[1]=parseInt("0x"+c.substring(3,5));
p.rgb[2]=parseInt("0x"+c.substring(5,7));
p.hex=c;
}else{
throw new Error("Invalid color value. Use hex or 3-value RGB array");
}
}
return p;
},createSurface:function(_6,_7,_8){
var _9;
switch(this.drawMethod){
case "svg":
_9=document.createElementNS("http://www.w3.org/2000/svg","svg");
_9.setAttribute("height",_8);
_9.setAttribute("width",_7);
_9.setAttribute("xmlns","http://www.w3.org/2000/svg");
_9.setAttribute("version","1.1");
_9.setAttribute("viewBox","0 0 "+_7+" "+_8);
var _a=document.createElement("defs");
_9.appendChild(_a);
break;
case "vml":
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
var _b=document.createStyleSheet();
_b.addRule("v\\:*","behavior: url(#default#VML);display: inline-block;");
_9=document.createElement("v:group");
_9.setAttribute("coordsize",_7+" "+_8);
_9.setAttribute("coordorigin","0 0");
_9.style.position="absolute";
_9.style.width=_7+"px";
_9.style.height=_8+"px";
_9.style.visibility="visible";
break;
case "canvas":
_9=document.createElement("div");
_9.style.left="0px";
_9.style.top="0px";
_9.style.position="relative";
_9.style.width=_7+"px";
_9.style.height=_8+"px";
_9.style.visibility="visible";
break;
}
this.surfaceWidth=_7;
this.surfaceHeight=_8;
_6.appendChild(_9);
return _9;
},remove:function(_c,_d){
_c.removeChild(_d);
return null;
},drawPolygon:function(_e,_f,_10,_11,_12,_13,_14){
var bc=this.normalizeColor(_f);
var fc=this.normalizeColor(_12);
var s="M "+_e[0].x+" "+_e[0].y;
if(this.drawMethod=="svg"){
for(var i=1;i<_e.length;i++){
s+=" L "+_e[i].x+" "+_e[i].y;
}
s+=" z";
}else{
s+=" l ";
for(var i=1;i<_e.length;i++){
s+=_e[i].x+","+_e[i].y+" ";
}
s+=" x e";
}
switch(this.drawMethod){
case "svg":
var _19=document.createElementNS("http://www.w3.org/2000/svg","path");
_19.setAttribute("d",s);
_19.setAttribute("stroke",bc.hex);
_19.setAttribute("stroke-width",_11);
_19.setAttribute("stroke-opacity",_10);
_19.setAttribute("fill",fc.hex);
_19.setAttribute("fill-opacity",_13);
break;
case "vml":
var _19=document.createElement("v:shape");
_19.style.width=this.surfaceWidth+"px";
_19.style.height=this.surfaceHeight+"px";
_19.style.position="absolute";
_19.setAttribute("stroked","true");
_19.setAttribute("coordsize",this.surfaceWidth+" "+this.surfaceHeight);
_19.setAttribute("coordorigin","0 0");
_19.fill=document.createElement("v:fill");
_19.fill.setAttribute("opacity",_13);
_19.fill.setAttribute("color",fc.hex);
_19.appendChild(_19.fill);
_19.stroke=document.createElement("v:stroke");
_19.stroke.setAttribute("miterlimit","8.0");
_19.stroke.setAttribute("joinstyle","miter");
_19.stroke.setAttribute("endcap","flat");
_19.stroke.setAttribute("opacity",_10);
_19.stroke.setAttribute("color",bc.hex);
_19.stroke.setAttribute("weight",_11);
_19.appendChild(_19.stroke);
_19.path=document.createElement("v:path");
_19.path.setAttribute("v",s);
_19.appendChild(_19.path);
break;
case "canvas":
var _19=document.createElement("canvas");
_19.setAttribute("width",this.surfaceWidth);
_19.setAttribute("height",this.surfaceHeight);
_19.style.position="absolute";
_19.style.left="0px";
_19.style.top="0px";
var ctx=_19.getContext("2d");
ctx.fillStyle="rgba("+fc.rgb[0]+","+fc.rgb[1]+","+fc.rgb[2]+","+_13+")";
ctx.strokeStyle="rgba("+bc.rgb[0]+","+bc.rgb[1]+","+bc.rgb[2]+","+_10+")";
ctx.lineWidth=_11;
ctx.beginPath();
ctx.moveTo(_e[0].x,_e[0].y);
for(var i=1;i<_e.length;i++){
ctx.lineTo(_e[i].x,_e[i].y);
}
ctx.closePath();
ctx.fill();
ctx.stroke();
break;
}
_19.style.display=(_14?"inline":"none");
return _19;
},drawRectangle:function(_1b,_1c,_1d,_1e,_1f,_20,_21){
var bc=this.normalizeColor(_1c);
var fc=this.normalizeColor(_1f);
switch(this.drawMethod){
case "svg":
_24=document.createElementNS("http://www.w3.org/2000/svg","rect");
_24.setAttribute("x",_1b[0].x);
_24.setAttribute("y",_1b[0].y);
_24.setAttribute("width",_1b[1].x-_1b[0].x);
_24.setAttribute("height",_1b[1].y-_1b[0].y);
_24.setAttribute("stroke",bc.hex);
_24.setAttribute("stroke-width",_1e);
_24.setAttribute("stroke-opacity",_1d);
_24.setAttribute("fill",fc.hex);
_24.setAttribute("fill-opacity",_20);
break;
case "vml":
_24=document.createElement("v:rect");
_24.style.left=_1b[0].x+"px";
_24.style.top=_1b[0].y+"px";
_24.style.width=_1b[1].x-_1b[0].x+"px";
_24.style.height=_1b[1].y-_1b[0].y+"px";
_24.style.position="absolute";
_24.setAttribute("stroked","true");
_24.fill=document.createElement("v:fill");
_24.fill.setAttribute("opacity",_20);
_24.fill.setAttribute("color",fc.hex);
_24.appendChild(_24.fill);
_24.stroke=document.createElement("v:stroke");
_24.stroke.setAttribute("miterlimit","8.0");
_24.stroke.setAttribute("joinstyle","miter");
_24.stroke.setAttribute("endcap","flat");
_24.stroke.setAttribute("opacity",_1d);
_24.stroke.setAttribute("color",bc.hex);
_24.stroke.setAttribute("weight",_1e);
_24.appendChild(_24.stroke);
break;
case "canvas":
var _24=document.createElement("canvas");
_24.setAttribute("width",this.surfaceWidth);
_24.setAttribute("height",this.surfaceHeight);
_24.style.position="absolute";
_24.style.left="0px";
_24.style.top="0px";
var ctx=_24.getContext("2d");
ctx.fillStyle="rgba("+fc.rgb[0]+","+fc.rgb[1]+","+fc.rgb[2]+","+_20+")";
ctx.strokeStyle="rgba("+bc.rgb[0]+","+bc.rgb[1]+","+bc.rgb[2]+","+_1d+")";
ctx.lineWidth=_1e;
ctx.fillRect(_1b[0].x,_1b[0].y,_1b[1].x-_1b[0].x,_1b[1].y-_1b[0].y);
ctx.strokeRect(_1b[0].x,_1b[0].y,_1b[1].x-_1b[0].x,_1b[1].y-_1b[0].y);
break;
}
_24.style.display=(_21?"inline":"none");
return _24;
},drawEllipse:function(_26,_27,_28,_29,_2a,_2b,_2c){
var bc=this.normalizeColor(_27);
var fc=this.normalizeColor(_2a);
var _2f=_26[1].x-_26[0].x;
var _30=_26[1].y-_26[0].y;
var _31=parseInt(_2f/2);
var _32=parseInt(_30/2);
var _33=_26[1].x-_31;
var _34=_26[1].y-_32;
switch(this.drawMethod){
case "svg":
_35=document.createElementNS("http://www.w3.org/2000/svg","ellipse");
_35.setAttribute("cx",_33);
_35.setAttribute("cy",_34);
_35.setAttribute("rx",_31);
_35.setAttribute("ry",_32);
_35.setAttribute("stroke",bc.hex);
_35.setAttribute("stroke-width",_29);
_35.setAttribute("stroke-opacity",_28);
_35.setAttribute("fill",fc.hex);
_35.setAttribute("fill-opacity",_2b);
break;
case "vml":
_35=document.createElement("v:oval");
_35.style.left=_26[0].x+"px";
_35.style.top=_26[0].y+"px";
_35.style.width=_2f+"px";
_35.style.height=_30+"px";
_35.style.position="absolute";
_35.setAttribute("stroked","true");
_35.fill=document.createElement("v:fill");
_35.fill.setAttribute("opacity",_2b);
_35.fill.setAttribute("color",fc.hex);
_35.appendChild(_35.fill);
_35.stroke=document.createElement("v:stroke");
_35.stroke.setAttribute("miterlimit","8.0");
_35.stroke.setAttribute("joinstyle","miter");
_35.stroke.setAttribute("endcap","flat");
_35.stroke.setAttribute("opacity",_28);
_35.stroke.setAttribute("color",bc.hex);
_35.stroke.setAttribute("weight",_29);
_35.appendChild(_35.stroke);
break;
case "canvas":
var _35=document.createElement("canvas");
_35.setAttribute("width",this.surfaceWidth);
_35.setAttribute("height",this.surfaceHeight);
_35.style.position="absolute";
_35.style.left="0px";
_35.style.top="0px";
var ctx=_35.getContext("2d");
ctx.fillStyle="rgba("+fc.rgb[0]+","+fc.rgb[1]+","+fc.rgb[2]+","+_2b+")";
ctx.strokeStyle="rgba("+bc.rgb[0]+","+bc.rgb[1]+","+bc.rgb[2]+","+_28+")";
ctx.lineWidth=_29;
if((_26[1].x-_26[0].x)!=(_26[1].y-_26[0].y)){
var _37=Math.round((_26[1].y-_26[0].y)/4);
var _38=Math.round((_26[1].x-_26[0].x)/4);
ctx.moveTo(_26[0].x,_26[0].y+(2*_37));
ctx.bezierCurveTo(_26[0].x,_26[0].y+_37,_26[0].x+_38,_26[0].y,_26[0].x+(2*_38),_26[0].y);
ctx.bezierCurveTo(_26[0].x+(3*_38),_26[0].y,_26[1].x,_26[0].y+_37,_26[1].x,_26[0].y+(2*_37));
ctx.bezierCurveTo(_26[1].x,_26[1].y-_37,_26[1].x-_38,_26[1].y,_26[0].x+(2*_38),_26[1].y);
ctx.bezierCurveTo(_26[0].x+_38,_26[1].y,_26[0].x,_26[1].y-_37,_26[0].x,_26[0].y+(2*_37));
}else{
var _39=_26[0].x+Math.round((_26[1].x-_26[0].x)/2);
var _3a=_26[0].y+Math.round((_26[1].y-_26[0].y)/2);
ctx.arc(_39,_3a,Math.round((_26[1].x-_26[0].x)/2),0,360,false);
}
ctx.fill();
ctx.stroke();
break;
}
_35.style.display=(_2c?"inline":"none");
return _35;
},drawLine:function(_3b,_3c,_3d,_3e,_3f){
var bc=this.normalizeColor(_3c);
var s="";
for(var i=0;i<_3b.length;i++){
s+=_3b[i].x+","+_3b[i].y+" ";
}
switch(this.drawMethod){
case "svg":
_43=document.createElementNS("http://www.w3.org/2000/svg","polyline");
_43.setAttribute("points",s);
_43.setAttribute("stroke",bc.hex);
_43.setAttribute("stroke-width",_3e);
_43.setAttribute("stroke-opacity",_3d);
_43.setAttribute("fill","none");
break;
case "vml":
_43=document.createElement("v:polyline");
_43.style.height=this.surfaceWidth+"px";
_43.style.width=this.surfaceHeight+"px";
_43.style.position="absolute";
_43.setAttribute("stroked","true");
_43.setAttribute("coordsize",this.surfaceWidth+" "+this.surfaceHeight);
_43.setAttribute("points",s);
_43.setAttribute("fill","false");
_43.fill=document.createElement("v:fill");
_43.fill.setAttribute("opacity",0);
_43.appendChild(_43.fill);
_43.stroke=document.createElement("v:stroke");
_43.stroke.setAttribute("miterlimit","8.0");
_43.stroke.setAttribute("joinstyle","miter");
_43.stroke.setAttribute("endcap","flat");
_43.stroke.setAttribute("opacity",_3d);
_43.stroke.setAttribute("color",bc.hex);
_43.stroke.setAttribute("weight",_3e);
_43.appendChild(_43.stroke);
break;
case "canvas":
var _43=document.createElement("canvas");
_43.setAttribute("width",this.surfaceWidth);
_43.setAttribute("height",this.surfaceHeight);
_43.style.position="absolute";
_43.style.left="0px";
_43.style.top="0px";
var ctx=_43.getContext("2d");
ctx.strokeStyle="rgba("+bc.rgb[0]+","+bc.rgb[1]+","+bc.rgb[2]+","+_3d+")";
ctx.lineWidth=_3e;
ctx.beginPath();
ctx.moveTo(_3b[0].x,_3b[0].y);
for(var i=1;i<_3b.length;i++){
ctx.lineTo(_3b[i].x,_3b[i].y);
}
ctx.stroke();
break;
}
_43.style.display=(_3f?"inline":"none");
return _43;
}};
MQA.Graphics.setDrawMethod();

MQA.InfoWindow=function(_1){
this.map=_1;
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 _2="<div id='poiclose' class='mqpoiclose'><div style='width:650px;height:685px;margin-left:-180px;margin-top:-650px;'></div></div>";
_2+="<div id='popup-topleft' style='position:absolute;overflow:hidden;'><div style='width:650px;height:685px;'></div></div>";
_2+="<div id='popup-topright' style='position:absolute;width:20px;overflow:hidden;'><div style='width:650px;height:685px;margin-left:-630px;'></div></div>";
_2+="<div id='popup-bottomleft' style='position:absolute;height:15px;overflow:hidden;'><div style='width:650px;height:685px;margin-top:-630px;'></div></div>";
_2+="<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>";
_2+="<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>";
_2+="<div id='popup-fillercontainer'></div>";
_2+="<div id='popup-content' style='position:absolute;left:13px;top:13px;overflow:auto;z-index:1;'></div></div>";
this.popup.innerHTML=_2;
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 _3=this.popup.childNodes[0];
this.poiClose=_3;
var _4=this.popup.childNodes[1];
var _5=this.popup.childNodes[2];
var _6=this.popup.childNodes[3];
var _7=this.popup.childNodes[4];
var _8=this.popup.childNodes[5];
var _9=this.popup.childNodes[6];
this.eClickClose=MQA._prEvent.EventCallback(this,"clickClose");
MQA._prEvent.observe(this.poiClose,"click",this.eClickClose);
this.popup.content=this.popup.childNodes[7];
this.eClick=MQA._prEvent.EventCallback(this,"onClick");
MQA._prEvent.observe(this.popup,"click",this.eClick);
if(MQA.browser.name=="msie"&&(MQA.browser.version>5)&&(MQA.browser.version<7)){
_4.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
_5.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
_6.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
_7.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
_8.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
_3.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
}else{
_4.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
_5.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
_6.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
_7.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
_8.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
_3.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
}
};
MQA.InfoWindow.prototype.dispose=function(){
MQA._prEvent.stopObserving(this.poiClose,"click",this.eClickClose);
MQA._prEvent.stopObserving(this.popup,"click",this.eClick);
this.map=null;
this.opener=null;
this.content=null;
this.infoWindowSrc="";
this.popup.oncontextmenu=null;
this.popup.content=null;
this.popup.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.popup);
MQA.Util._deleteDOMObject(this.popup);
this.popup=null;
this.poiClose=null;
delete this.popup;
};
MQA.InfoWindow.prototype.onOpen=function(e){
MQA.EventManager.trigger(this,"opened",e);
};
MQA.InfoWindow.prototype.onClose=function(e){
MQA.EventManager.trigger(this,"closed",e);
};
MQA.InfoWindow.prototype.onClickedClosed=function(e){
e=new MQA.Event("MQA.InfoWindow.clickedClosed");
MQA.EventManager.trigger(this,"clickedclosed",e);
MQA._prEvent.stop(e);
};
MQA.InfoWindow.prototype.clickClose=function(_d){
this.hide();
this.onClickedClosed(_d);
MQA._prEvent.stop(_d);
};
MQA.InfoWindow.prototype.onClick=function(_e){
_e.srcObject=this;
};
MQA.InfoWindow.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 MQA.Event("MQTileMap.infoWindowClose"));
this.opener=null;
}
this.onClose(new MQA.Event("MQA.InfoWindow.close"));
}
};
MQA.InfoWindow.prototype.setOpenerAndShow=function(_f){
this.show();
this.opener=_f;
};
MQA.InfoWindow.prototype.show=function(){
if(!this.isHidden()){
this.hide();
}
this.popup.style.display="block";
var _10=this.offset.y;
var _11=this.popup.offsetHeight+3;
var _12=this.offset.x;
var _13=25;
this.popup.style.top=(_10-_11)+"px";
this.popup.style.left=(_12-_13)+"px";
this.popup.style.visibility="visible";
this.avoidPopupCollisions(this.popup);
this.onOpen(new MQA.Event("MQA.InfoWindow.open"));
};
MQA.InfoWindow.prototype.isHidden=function(){
return (this.popup.style.visibility=="hidden");
};
MQA.InfoWindow.prototype.modify=function(_14,_15,_16,_17){
if(_14){
this.point=_14;
}
if(_15){
this.title=_15;
}
if(_16){
this.content=_16;
}
this.offset=new MQA.PointXY(0,0);
if(_17){
this.offset=_17;
}
this.popup.style.position="absolute";
this.resize(false);
};
MQA.InfoWindow.prototype.getMaxWidth=function(){
return this.maxwidth;
};
MQA.InfoWindow.prototype.setMaxWidth=function(_18){
_18=parseInt(_18);
if(isNaN(_18)){
return;
}
this.maxwidth=(_18>this.map.width-50)?(this.map.width-50):(_18<this.minwidth)?this.minwidth:_18;
};
MQA.InfoWindow.prototype.getMinWidth=function(){
return this.minwidth;
};
MQA.InfoWindow.prototype.setMinWidth=function(_19){
_19=parseInt(_19);
if(isNaN(_19)){
return;
}
this.minwidth=(_19<60)?60:(_19>this.maxwidth)?this.maxwidth:_19;
};
MQA.InfoWindow.prototype.getContentWidth=function(){
return this.contentwidth;
};
MQA.InfoWindow.prototype.setContentWidth=function(_1a){
this.contentwidth=_1a;
};
MQA.InfoWindow.prototype.getTitleBackgroundColor=function(){
return this.titlebackgroundcolor;
};
MQA.InfoWindow.prototype.setTitleBackgroundColor=function(_1b){
this.titlebackgroundcolor=_1b;
};
MQA.InfoWindow.prototype.getPointLL=function(){
return this.map.getXYToLL(this.point);
};
MQA.InfoWindow.prototype.getPointXY=function(){
return this.point;
};
MQA.InfoWindow.prototype.getPixelOffset=function(){
return this.offset;
};
MQA.InfoWindow.prototype.avoidPopupCollisions=function(_1c){
var _1d=this.getCollisionInfo(_1c);
if(_1d.panX!=0||_1d.panY!=0){
this.map.slideMapByOffset(new MQA.PointXY(_1d.panX,_1d.panY));
}
};
MQA.InfoWindow.prototype.getCollisionInfo=function(_1e){
var _1f=this.map.parent;
var _20={panX:0,panY:0};
var _21=MQA.Util.getParentOffset(_1f);
var _22=MQA.Util.getParentOffset(_1e);
var _23=10;
_22.x=_22.x-_21.x-_23;
_22.y=_22.y-_21.y-_23;
var _24={width:37,height:300};
var _25={width:139,height:15};
var _26=(_22.x<_24.width&&_22.y<_24.height+_23)?_24.width:0;
var _27=(_22.x+_1e.clientWidth>_1f.clientWidth-_25.width&&_22.y<_25.height+_23)?_25.height:0;
if(_1e.clientWidth>0&&_1e.clientHeight>0){
if(_22.x<_26){
_20.panX=Math.abs(_22.x-_26);
}else{
if(_22.x+_23+_1e.clientWidth>_1f.clientWidth){
_20.panX=-1*(_1e.clientWidth+_22.x+_23-_1f.clientWidth);
}
}
if(_22.y<_27){
_20.panY=Math.abs(_22.y-_27);
}else{
if(_22.y+_1e.clientHeight>_1f.clientHeight){
_20.panY=_1f.clientHeight-_22.y-_1e.clientHeight;
}
}
}
return _20;
};
MQA.InfoWindow.prototype.getOpener=function(){
return this.opener;
};
MQA.InfoWindow.prototype.resize=function(_28){
var _29=this.popup.childNodes[0];
var _2a=this.popup.childNodes[1];
var _2b=this.popup.childNodes[2];
var _2c=this.popup.childNodes[3];
var _2d=this.popup.childNodes[4];
var _2e=this.popup.childNodes[5];
var _2f=this.popup.childNodes[6];
var _30="";
if(this.getTitleBackgroundColor()){
_30=" style=background:"+this.getTitleBackgroundColor();
}
_2f.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 _31="";
if(_28){
if(this.popup.content){
_31=this.popup.content.innerHTML;
}
}else{
_31="<div class='mqpoiheading'"+_30+" title='"+MQA.Util.stripHTMLTags(this.title.innerHTML)+"'>"+this.title.innerHTML+"</div><div class='mqpoicontenttext'>"+this.content.innerHTML+"</div>";
}
this.popup.content.innerHTML=_31;
var _32=this.popup.content.childNodes[0];
var _33=this.popup.content.childNodes[1];
_32.style.display="none";
_33.style.whiteSpace="nowrap";
_33.style.overflow="visible";
_33.style.width="auto";
_33.style.height="auto";
var _34=this.popup.content.offsetWidth+35+2;
var _35=(_34>this.maxwidth)?18:0;
_34=(_34>this.maxwidth)?this.maxwidth:(_34<this.minwidth)?this.minwidth:_34;
var _36=_34-35;
_33.style.width=_36+"px";
_32.style.display="";
_33.style.whiteSpace="";
var _37=this.popup.content.offsetHeight+_35+30+2;
var _38=(_37>this.maxheight)?18:0;
_36+=_38;
_34+=_38;
_32.style.width=(_36-18)+"px";
var _39=_32.childNodes[0];
if(typeof (_39.tagName)=="undefined"){
_32.innerHTML="<div>"+this.title.innerHTML+"</div>";
_39=_32.childNodes[0];
}
_39.style.display="inline";
if((_39.offsetWidth>(_36-18))&&((_36-18)>25)){
var _3a=MQA.Util.stripHTMLTags(this.title.innerHTML);
var _3b=_39.innerHTML;
for(var i=_3a.length;(_39.offsetWidth>=(_36-18)&&i>0);i--){
_39.innerHTML=MQA.Util.getHTMLSubstring(_3b,i,"&nbsp;...");
}
}
_37=this.popup.content.offsetHeight+_35+30+2;
_37=(_37>this.maxheight)?this.maxheight:_37;
var _3d=_37-30+2;
var _3e=Math.ceil(_36/600);
var _3f=_36%600;
var _40=Math.ceil(_3d/600);
var _41=_3d%600;
var _42,_43,_44,_45;
var _46,_47;
var _48,_49;
var _4a,_4b,_4c,_4d;
var _4e=600;
var _4f=600;
for(var i=1;i<=_40;i++){
for(var j=1;j<=_3e;j++){
if(i==1&&j==1){
continue;
}
_42=(j==_3e&&_3f!=0)?_3f:_4e;
_43=(i==_40&&_41!=0)?_41:_4f;
_46=(j==1)?15:0;
_47=(i==1)?15:0;
_48=(i==1)?0:15;
_49=(j==1)?0:15;
_4a=(-1*_49);
_4b=(-1*_48);
_44=(_42+_46);
_45=(_43+_47);
_4c=(((j-1)*_4e)+_49);
_4d=(((i-1)*_4f)+_48);
this.createFillerDiv(_4a,_4b,_44,_45,_4c,_4d);
if(i==1){
_4a=-15;
_4b=-630;
_44=(_42+_46);
_45=15;
_4c=(((j-1)*_4e)+_49);
_4d=(_3d+15);
this.createFillerDiv(_4a,_4b,_44,_45,_4c,_4d);
}
}
if(i>1){
_4a=-630;
_4b=-15;
_44=20;
_45=(_43+_47);
_4c=(_36+15);
_4d=(((i-1)*_4f)+_48);
this.createFillerDiv(_4a,_4b,_44,_45,_4c,_4d);
}
}
var _51=(_36>_4e)?_4e:_36;
var _52=(_3d>_4f)?_4f:_3d;
this.popup.style.width=(_34)+"px";
this.popup.style.height=(_37)+"px";
this.popup.content.style.width=_36+"px";
this.popup.content.style.height=_3d+"px";
_29.style.left=(_34-38)+"px";
_29.style.top="12px";
_32.style.width=(_36-18)+"px";
_33.style.width=_36+"px";
_33.style.height=(_3d-_32.offsetHeight-5)+"px";
_33.style.overflow="auto";
_2a.style.width=_51+15+"px";
_2a.style.height=_52+15+"px";
_2b.style.left=_36+15+"px";
_2b.style.height=_52+15+"px";
_2c.style.top=_3d+15+"px";
_2c.style.width=_51+15+"px";
_2d.style.top=_3d+15+"px";
_2d.style.left=_36+15+"px";
_2e.style.left="14px";
_2e.style.top=_3d+15+"px";
if(_28){
this.popup.style.visibility="hidden";
this.show();
}
};
MQA.InfoWindow.prototype.createFillerDiv=function(_53,_54,_55,_56,_57,_58){
var _59=this.popup.childNodes[6];
var _5a=document.createElement("div");
_5a.style.position="absolute";
_5a.style.overflow="hidden";
var str="<div style='width:650px;height:685px;'></div>";
_5a.innerHTML=str;
_59.appendChild(_5a);
if((MQA.browser.name=="msie")&&(parseFloat(MQA.browser.version)<7)){
_5a.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.infoWindowSrc+"', sizingMethod='scale')";
}else{
_5a.childNodes[0].style.background="url("+this.infoWindowSrc+") no-repeat";
}
_5a.childNodes[0].style.marginLeft=_53+"px";
_5a.childNodes[0].style.marginTop=_54+"px";
_5a.style.width=_55+"px";
_5a.style.height=_56+"px";
_5a.style.left=_57+"px";
_5a.style.top=_58+"px";
};
MQA.InfoWindow.prototype.setPopupContentOverflow=function(_5c){
if(_5c&&(MQA.browser.name=="firefox")&&this.popup.content.childNodes[1]){
var _5d=this.popup.content.childNodes[1].scrollLeft;
var top=this.popup.content.childNodes[1].scrollTop;
this.popup.content.childNodes[1].style.overflow=_5c;
this.popup.content.childNodes[1].scrollLeft=_5d;
this.popup.content.childNodes[1].scrollTop=top;
}
};


MQA.PointFloatXY=function(X,Y){
this.x=parseFloat(X);
this.y=parseFloat(Y);
};
MQA.PointXY=function(X,Y){
this.x=parseInt(X);
this.y=parseInt(Y);
};
MQA.PointLL=function(_5,_6){
this.lat=parseFloat(_5);
this.lng=parseFloat(_6);
};
MQA.Image=function(){
this.image=null;
};
MQA.Tile=function(_7,_8,_9,_a,X,Y,_d,_e,_f){
this._dth=MQA._prEvent.addDtor(this,"dispose");
this.parent=_7;
this.div=_8;
this.size=_f;
this.lt=_9;
this.tp=_a;
var me=this;
if(this.parent.showMap){
this.MQMAP=new MQA.Image();
if(!MQA.SAFARI_BROWSER){
this.MQMAP.image=MQA.Util.createImage("",this.lt,this.tp,this.size,this.size,0);
this.MQMAP.image.onload=MQA._prEvent.hitch(this,"showingMapTile");
}else{
this.MQMAP.image=MQA.Util.createImage(MQA.RESOURCES+"loading.gif",this.lt,this.tp,this.size,this.size,0);
}
this.div.mapdiv.appendChild(this.MQMAP.image);
}
if(this.parent.showSat){
this.MQSAT=new MQA.Image();
if(!MQA.SAFARI_BROWSER){
this.MQSAT.image=MQA.Util.createImage("",this.lt,this.tp,this.size,this.size,0);
this.MQSAT.image.onload=MQA._prEvent.hitch(this,"showingSatTile");
}else{
this.MQSAT.image=MQA.Util.createImage(MQA.RESOURCES+"loading.gif",this.lt,this.tp,this.size,this.size,0);
}
this.div.satdiv.appendChild(this.MQSAT.image);
}
if(this.parent.showHyb){
this.MQHYB=new MQA.Image();
if(!MQA.SAFARI_BROWSER){
this.MQHYB.image=MQA.Util.createImage("",this.lt,this.tp,this.size,this.size,0);
this.MQHYB.image.onload=MQA._prEvent.hitch(this,"showingHybTile");
}else{
this.MQHYB.image=MQA.Util.createImage(MQA.RESOURCES+"loading.gif",this.lt,this.tp,this.size,this.size,0);
}
this.div.hybdiv.appendChild(this.MQHYB.image);
}
this.updateTile(_9,_a,X,Y,_d,_e);
};
MQA.Tile.prototype={dispose:function(){
MQA._prEvent.delDtor(this._dth);
this.imageurl=null;
this.div=null;
this.parent=null;
if(this.MQMAP){
this.MQMAP.image.onload=MQA._prEvent.emptyFunction;
MQA.Util._setOuterHTMLToEmptyString(this.MQMAP.image);
MQA.Util._deleteDOMObject(this.MQMAP.image);
this.MQMAP.image=null;
this.MQMAP=null;
}
if(this.MQSAT){
this.MQSAT.image.onload=MQA._prEvent.emptyFunction;
MQA.Util._setOuterHTMLToEmptyString(this.MQSAT.image);
MQA.Util._deleteDOMObject(this.MQSAT.image);
this.MQSAT.image=null;
this.MQSAT=null;
}
if(this.MQHYB){
this.MQHYB.image.onload=MQA._prEvent.emptyFunction;
MQA.Util._setOuterHTMLToEmptyString(this.MQHYB.image);
MQA.Util._deleteDOMObject(this.MQHYB.image);
this.MQHYB.image=null;
this.MQHYB=null;
}
},updateTile:function(_11,TOP,X,Y,_15,_16){
var _17=parseInt(X/1000);
var _18=parseInt(Y/1000);
this.lt=_11;
this.tp=TOP;
this.x=X;
this.y=Y;
while(X<0){
X+=MQA.MODS[_16];
}
while(X>=MQA.MODS[_16]){
X-=MQA.MODS[_16];
}
_17=parseInt(X/1000);
_18=parseInt(Y/1000);
if(this.parent.showMap){
this.imageurl="http://"+MAPSERVER[X%MAPSERVER.length]+"/map/Scale"+_15+"/"+_18+"/"+(Y-_18*1000)+"/"+_17+"/"+(X-_17*1000)+".gif";
this.MQMAP.image.src=this.imageurl;
this.MQMAP.image.lt=this.lt;
this.MQMAP.image.tp=this.tp;
this.MQMAP.image.style.left=MQA.Util.asPix(this.lt);
this.MQMAP.image.style.top=MQA.Util.asPix(this.tp);
}
if(this.parent.showSat){
this.imageurl="http://"+SATSERVER[X%SATSERVER.length]+"/sat/Scale"+_15+"/"+_18+"/"+(Y-_18*1000)+"/"+_17+"/"+(X-_17*1000)+".jpg";
this.MQSAT.image.src=this.imageurl;
this.MQSAT.image.lt=this.lt;
this.MQSAT.image.tp=this.tp;
this.MQSAT.image.style.left=MQA.Util.asPix(this.lt);
this.MQSAT.image.style.top=MQA.Util.asPix(this.tp);
}
if(this.parent.showHyb){
this.imageurl="http://"+HYBSERVER[X%HYBSERVER.length]+"/hyb/Scale"+_15+"/"+_18+"/"+(Y-_18*1000)+"/"+_17+"/"+(X-_17*1000)+".gif";
this.MQHYB.image.src=this.imageurl;
this.MQHYB.image.lt=this.lt;
this.MQHYB.image.tp=this.tp;
this.MQHYB.image.style.left=MQA.Util.asPix(this.lt);
this.MQHYB.image.style.top=MQA.Util.asPix(this.tp);
}
},loadingTile:function(){
var me=this;
if(this.parent.showMap){
if(!this.MQMAP){
this.MQMAP=new MQA.Image();
if(!MQA.SAFARI_BROWSER){
this.MQMAP.image=MQA.Util.createImage("",this.lt,this.tp,this.size,this.size,0);
this.MQMAP.image.onload=MQA._prEvent.hitch(this,"showingMapTile");
}else{
this.MQMAP.image=MQA.Util.createImage(MQA.RESOURCES+"loading.gif",this.lt,this.tp,this.size,this.size,0);
}
this.div.mapdiv.appendChild(this.MQMAP.image);
}else{
if(!MQA.SAFARI_BROWSER){
this.MQMAP.image.style.visibility="hidden";
}else{
this.MQMAP.image.src=MQA.RESOURCES+"loading.gif";
}
}
}
if(this.parent.showSat){
if(!this.MQSAT){
this.MQSAT=new MQA.Image();
if(!MQA.SAFARI_BROWSER){
this.MQSAT.image=MQA.Util.createImage("",this.lt,this.tp,this.size,this.size,0);
this.MQSAT.image.onload=MQA._prEvent.hitch(this,"showingSatTile");
}else{
this.MQSAT.image=MQA.Util.createImage(MQA.RESOURCES+"loading.gif",this.lt,this.tp,this.size,this.size,0);
}
this.div.satdiv.appendChild(this.MQSAT.image);
}else{
if(!MQA.SAFARI_BROWSER){
this.MQSAT.image.style.visibility="hidden";
}else{
this.MQSAT.image.src=MQA.RESOURCES+"loading.gif";
}
}
}
if(this.parent.showHyb){
if(!this.MQHYB){
this.MQHYB=new MQA.Image();
if(!MQA.SAFARI_BROWSER){
this.MQHYB.image=MQA.Util.createImage("",this.lt,this.tp,this.size,this.size,0);
this.MQHYB.image.onload=MQA._prEvent.hitch(this,"showingHybTile");
}else{
this.MQHYB.image=MQA.Util.createImage(MQA.RESOURCES+"loading.gif",this.lt,this.tp,this.size,this.size,0);
}
this.div.hybdiv.appendChild(this.MQHYB.image);
}else{
if(!MQA.SAFARI_BROWSER){
this.MQHYB.image.style.visibility="hidden";
}else{
this.MQHYB.image.src=MQA.RESOURCES+"loading.gif";
}
}
}
},showingMapTile:function(){
if(this.parent.showMap){
this.MQMAP.image.style.visibility="visible";
}
},showingSatTile:function(){
if(this.parent.showSat){
this.MQSAT.image.style.visibility="visible";
}
},showingHybTile:function(){
if(this.parent.showHyb){
this.MQHYB.image.style.visibility="visible";
}
}};
MQA.TKObjectCollection=function(max){
var _1b=new Array();
var _1c=max||-1;
this.add=function(obj){
if(_1c!=-1&&_1b.length==max){
return;
}
_1b.push(obj);
return _1b.length;
};
this.getSize=function(){
return _1b.length;
};
this.getAt=function(_1e){
return _1b[_1e];
};
this.remove=function(_1f){
return _1b.splice(_1f,1);
};
this.removeAll=function(){
_1b=null;
_1b=new Array();
};
this.contains=function(_20){
for(var _21=0,x=this.getSize();_21<x;_21++){
if(_1b[_21]==_20){
return true;
}
}
return false;
};
this.getById=function(_23){
for(var _24=0,x=this.getSize();_24<x;_24++){
if(_1b[_24].getId()==_23){
return _1b[_24];
}
}
return null;
};
this.removeItem=function(_26){
for(i=0;i<_1b.length;i++){
if(_1b[i]==_26){
this.remove(i);
i=_1b.length;
}
}
};
};
MQA.MapLogo=function(){
throw new Error("Do NOT instantiate MapLogo - use static values");
};
MQA.MapLogo.MAPQUEST=MQA.LOGO_MQ_LOGO;
MQA.MapLogo.SCALES=MQA.LOGO_MQ_SCALES;
MQA.MapLogo.MAPQUEST_COPYRIGHT=MQA.LOGO_MQ_COPY;
MQA.MapLogo.NAVTEQ_COPYRIGHT=MQA.LOGO_NT_COPY;
MQA.MapLogo.ICUBED_COPYRIGHT=MQA.LOGO_I3_COPY;
MQA.MapCorner=function(){
throw new Error("Do NOT instantiate MapCorner - use static values");
};
MQA.MapCorner.TOP_LEFT=MQA.CORNER_TOPLEFT;
MQA.MapCorner.TOP_RIGHT=MQA.CORNER_TOPRIGHT;
MQA.MapCorner.BOTTOM_LEFT=MQA.CORNER_BOTTOMLEFT;
MQA.MapCorner.BOTTOM_RIGHT=MQA.CORNER_BOTTOMRIGHT;
MQA.MapCornerPlacement=function(_27,_28){
if(_27==null){
_27=MQA.MapCorner.TOP_LEFT;
}
if(_28==null){
_28=new MQA.Size(0,0);
}
this.mapCorner=_27;
this.offsetSize=new MQA.Size(_28.getWidth(),_28.getHeight());
};
MQA.MapCornerPlacement.prototype.getMapCorner=function(){
return this.mapCorner;
};
MQA.MapCornerPlacement.prototype.getOffsetSize=function(){
return new MQA.Size(this.offsetSize.getWidth(),this.offsetSize.getHeight());
};
MQA.RectLL=function(_29,_2a){
if(_29==null){
_29=new MQA.LatLng(0,0);
}
if(_2a==null){
_2a=new MQA.LatLng(0,0);
}
this.ul=new MQA.PointLL(_29.lat,_29.lng);
this.lr=new MQA.PointLL(_2a.lat,_2a.lng);
};
MQA.RectLL.prototype.setLowerRight=function(_2b){
this.lr=new MQA.LatLng(_2b.getLatitude(),_2b.getLongitude());
};
MQA.RectLL.prototype.setUpperLeft=function(_2c){
this.ul=new MQA.LatLng(_2c.getLatitude(),_2c.getLongitude());
};
MQA.RectLL.prototype.getUpperLeft=function(){
return new MQA.LatLng(this.ul.lat,this.ul.lng);
};
MQA.RectLL.prototype.getLowerRight=function(){
return new MQA.LatLng(this.lr.lat,this.lr.lng);
};
MQA.RectLL.prototype.setBounds=function(_2d){
for(var i=1;i<_2d.length;i++){
var _2f=_2d[i];
this.extend(_2f);
}
};
MQA.RectLL.prototype.extend=function(_30){
if(_30.lat>this.ul.lat){
this.ul.lat=_30.lat;
}
if(_30.lng<this.ul.lng){
this.ul.lng=_30.lng;
}
if(_30.lat<this.lr.lat){
this.lr.lat=_30.lat;
}
if(_30.lng>this.lr.lng){
this.lr.lng=_30.lng;
}
};
MQA.RectXY=function(_31,_32){
if(_31==null){
_31=new MQA.Point(0,0);
}
if(_32==null){
_32=new MQA.Point(0,0);
}
this.ul=new MQA.PointXY(_31.x,_31.y);
this.lr=new MQA.PointXY(_32.x,_32.y);
};
MQA.RectXY.prototype.setUpperLeft=function(_33){
this.ul=new MQA.Point(_33.getX(),_33.getY());
};
MQA.RectXY.prototype.setLowerRight=function(_34){
this.lr=new MQA.Point(_34.getX(),_34.getY());
};
MQA.RectXY.prototype.getUpperLeft=function(){
return new MQA.Point(this.ul.x,this.ul.y);
};
MQA.RectXY.prototype.getLowerRight=function(){
return new MQA.Point(this.lr.x,this.lr.y);
};
MQA.Size=function(w,h){
if(w==null){
w=0;
}
if(h==null){
h=0;
}
this.width=parseInt(w);
this.height=parseInt(h);
};
MQA.Size.prototype.constructor=MQA.Size;
MQA.Size.prototype.getWidth=function(){
return this.width;
};
MQA.Size.prototype.getHeight=function(){
return this.height;
};
MQA.Size.prototype.setWidth=function(w){
this.width=parseInt(w);
};
MQA.Size.prototype.setHeight=function(h){
this.height=parseInt(h);
};
MQA.Size.prototype.toString=function(){
return this.width+","+this.height;
};
MQA.Clip=function(_39,_3a,_3b,_3c,vIn,_3e){
var _3f=new Array();
var D=(_3e?3:2);
if(vIn.length<D){
return _3f;
}
_3f=clipAgainstEdge(0,vIn,_3e);
var _41=clipAgainstEdge(1,_3f,_3e);
var _42=clipAgainstEdge(2,_41,_3e);
var _43=clipAgainstEdge(3,_42,_3e);
return _43;
function clipAgainstEdge(_44,_45,_46){
var v1;
var _48,_49;
var _4a;
var _4b=new Array();
for(var v2=0;v2<_45.length;v2++){
if(_3e){
v1=(v2==0?_45.length-1:v2-1);
}else{
v1=(v2==0?0:v2-1);
}
_48=inside(_44,_45[v1]);
_49=inside(_44,_45[v2]);
if(_48&&_49){
_4b.push(_45[v2]);
}else{
if(!_48&&_49){
_4a=clipIntersection(_44,_45[v2],_45[v1]);
_4b.push(_4a);
_4b.push(_45[v2]);
}else{
if(_48&&!_49){
_4a=clipIntersection(_44,_45[v1],_45[v2]);
_4b.push(_4a);
}
}
}
}
return _4b;
};
function clipIntersection(_4d,inv,_4f){
var x1=inv.x;
var y1=inv.y;
var x2=_4f.x;
var y2=_4f.y;
var AU=0;
var _55={x:0,y:0};
switch(_4d){
case 0:
var x3=_39;
var y3=_3b;
var x4=_39;
var y4=_3c;
break;
case 1:
var x3=_3a;
var y3=_3b;
var x4=_3a;
var y4=_3c;
break;
case 2:
var x3=_39;
var y3=_3c;
var x4=_3a;
var y4=_3c;
break;
case 3:
var x3=_39;
var y3=_3b;
var x4=_3a;
var y4=_3b;
break;
}
UA=(((x4-x3)*(y1-y3))-((y4-y3)*(x1-x3)))/(((y4-y3)*(x2-x1))-((x4-x3)*(y2-y1)));
_55.x=x1+(UA*(x2-x1));
_55.y=y1+(UA*(y2-y1));
return _55;
};
function inside(_5a,v){
switch(_5a){
case 0:
return (v.x>_39);
case 1:
return (v.x<_3a);
case 2:
return (v.y<_3c);
case 3:
return (v.y>_3b);
}
return false;
};
};
MQA.MapInit=function(){
this.bestFitRect=null;
this.bestFitMargin=0;
this.keepCenter=false;
this.minZoom=1;
this.maxZoom=16;
};
MQA.MapInit.prototype={setBestFitRect:function(_5c){
this.bestFitRect=_5c;
},getBestFitRect:function(){
return this.bestFitRect;
},setBestFitMargin:function(_5d){
this.bestFitMargin=_5d;
},getBestFitMargin:function(){
return this.bestFitMargin;
},setKeepCenter:function(_5e){
this.keepCenter=_5e;
},isKeepCenter:function(){
return this.keepCenter;
},setMinZoom:function(_5f){
_5f=parseInt(_5f);
if(_5f<1||_5f>15){
this.minZoom=1;
}else{
this.minZoom=_5f;
}
if(this.minZoom>this.maxZoom){
this.minZoom=this.maxZoom;
}
},getMinZoom:function(){
return this.minZoom;
},setMaxZoom:function(_60){
_60=parseInt(_60);
if(_60<1||_60>16){
this.maxZoom=16;
}else{
this.maxZoom=_60;
}
if(this.maxZoom<this.minZoom){
this.maxZoom=this.minZoom;
}
},getMaxZoom:function(){
return this.maxZoom;
}};

MQA.InitOverlays=function(_1){
window.onload=_1;
};
MQA.ShapeOverlay=function(){
};
MQA.ShapeOverlay.prototype={map:null,key:"",color:"#000000",altColor:null,colorAlpha:"1",altColorAlpha:null,fillColor:"#000000",altFillColor:null,fillColorAlpha:"1",altFillColorAlpha:null,borderWidth:"3",altBorderWidth:null,altStateFlag:false,visible:true,className:"MQA.ShapeOverlay",shapePoints:null,shapePointsXY:0,shape:null,maxZoomLevel:16,minZoomLevel:1,adjustXY:function(_2){
_2.x=_2.x+(MQA.SURFACE_OFFSET);
_2.y=_2.y+(MQA.SURFACE_OFFSET);
return _2;
},setKey:function(_3){
this.key=_3;
},getKey:function(){
return this.key;
},setColor:function(_4){
this.color=_4;
if(this.shape&&!this.altStateFlag){
var _5=MQA.Graphics.normalizeColor(this.color);
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke",_5.hex);
break;
case "vml":
this.shape.stroke.color=_5.hex;
break;
case "canvas":
this.drawShape();
break;
}
}
},getColor:function(){
return this.color;
},setAltColor:function(_6){
this.altColor=_6;
if(this.shape&&this.altStateFlag){
var _7=MQA.Graphics.normalizeColor(this.altColor);
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke",_7.hex);
break;
case "vml":
this.shape.stroke.color=_7.hex;
break;
case "canvas":
this.drawShape();
break;
}
}
},getAltColor:function(){
if(this.altColor){
return this.altColor;
}else{
return this.color;
}
},setColorAlpha:function(_8){
this.colorAlpha=parseFloat(_8);
if(this.shape&&!this.altStateFlag){
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke-opacity",this.colorAlpha);
break;
case "vml":
this.shape.stroke.opacity=this.colorAlpha;
break;
case "canvas":
this.drawShape();
break;
}
}
},getColorAlpha:function(){
return this.colorAlpha;
},setAltColorAlpha:function(_9){
this.altColorAlpha=parseFloat(_9);
if(this.shape&&this.altStateFlag){
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke-opacity",this.altColorAlpha);
break;
case "vml":
this.shape.stroke.opacity=this.altColorAlpha;
break;
case "canvas":
this.drawShape();
break;
}
}
},getAltColorAlpha:function(){
return (this.altColorAlpha!=null?this.altColorAlpha:this.colorAlpha);
},setFillColor:function(_a){
this.fillColor=_a;
if(this.shape&&!this.altStateFlag){
var _b=MQA.Graphics.normalizeColor(_a);
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("fill",_b.hex);
break;
case "vml":
this.shape.fill.color=_b.hex;
break;
case "canvas":
this.drawShape();
break;
}
}
},getFillColor:function(){
return [this.fillColor[0],this.fillColor[1],this.fillColor[2]];
},setAltFillColor:function(_c){
this.altFillColor=_c;
if(this.shape&&this.altStateFlag){
var _d=MQA.Graphics.normalizeColor(_c);
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("fill",_d.hex);
break;
case "vml":
this.shape.fill.color=_d.hex;
break;
case "canvas":
this.drawShape();
break;
}
}
},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]];
}
},setFillColorAlpha:function(_e){
this.fillColorAlpha=parseFloat(_e);
if(this.shape&&!this.altStateFlag){
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("fill-opacity",this.fillColorAlpha);
break;
case "vml":
this.shape.fill.opacity=this.fillColorAlpha;
break;
case "canvas":
this.drawShape();
break;
}
}
},getFillColorAlpha:function(){
return this.fillColorAlpha;
},setAltFillColorAlpha:function(_f){
this.altFillColorAlpha=parseFloat(_f);
if(this.shape&&this.altStateFlag){
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("fill-opacity",this.altFillColorAlpha);
break;
case "vml":
this.shape.fill.opacity=this.altFillColorAlpha;
break;
case "canvas":
this.drawShape();
break;
}
}
},getAltFillColorAlpha:function(){
return (this.altFillColorAlpha!=null?this.altFillColorAlpha:this.fillColorAlpha);
},setBorderWidth:function(_10){
this.borderWidth=_10;
if(this.shape&&!this.altStateFlag){
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke-width",_10);
break;
case "vml":
this.shape.stroke.weight=_10;
break;
case "canvas":
this.drawShape();
break;
}
}
},getBorderWidth:function(){
return this.borderWidth;
},setAltBorderWidth:function(_11){
this.altBorderWidth=_11;
if(this.shape&&this.altStateFlag){
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke-width",_11);
break;
case "vml":
this.shape.stroke.weight=_11;
break;
case "canvas":
this.drawShape();
break;
}
}
},getAltBorderWidth:function(){
if(this.altBorderWidth!=null){
return this.altBorderWidth;
}else{
return this.borderWidth;
}
},setAltStateFlag:function(_12){
this.altStateFlag=_12;
if(this.shape){
var _13=this.getCurrentState();
_13.color=MQA.Graphics.normalizeColor(_13.color).hex;
_13.fillColor=MQA.Graphics.normalizeColor(_13.fillColor).hex;
switch(MQA.Graphics.drawMethod){
case "svg":
this.shape.setAttribute("stroke",_13.color);
this.shape.setAttribute("stroke-opacity",_13.colorAlpha);
if(this.className!="LineOverlay"){
this.shape.setAttribute("fill",_13.fillColor);
this.shape.setAttribute("fill-opacity",_13.fillColorAlpha);
}
this.shape.setAttribute("stroke-width",_13.borderWidth);
break;
case "vml":
this.shape.stroke.color=_13.color;
this.shape.stroke.opacity=_13.colorAlpha;
if(this.className!="LineOverlay"){
this.shape.fill.color=_13.fillColor;
this.shape.fill.opacity=_13.fillColorAlpha;
}
this.shape.stroke.weight=_13.borderWidth;
break;
case "canvas":
this.drawShape();
break;
}
var _14=(this.className=="MQA.ImageOverlay"?this.shape.firstChild:this.shape);
_14.style.display=(_13.visible?"inline":"none");
}
},getAltStateFlag:function(){
return this.altStateFlag;
},setVisible:function(_15){
this.visible=_15;
if(this.shape){
var _16=(this.className=="MQA.ImageOverlay"?this.shape.firstChild:this.shape);
_16.style.display=(_15?"inline":"none");
}
},getVisible:function(){
return this.visible;
},setMaxZoomLevel:function(_17){
var _18=parseInt(_17);
if(isNaN(_18)){
return;
}
this.maxZoomLevel=(_18>16)?16:((_18<this.minZoomLevel)?this.minZoomLevel:_18);
this.redraw();
},getMaxZoomLevel:function(){
return this.maxZoomLevel;
},setMinZoomLevel:function(_19){
var _1a=parseInt(_19);
if(isNaN(_1a)){
return;
}
this.minZoomLevel=(_1a<1)?1:((_1a>this.maxZoomLevel)?this.maxZoomLevel:_1a);
this.redraw();
},getMinZoomLevel:function(){
return this.minZoomLevel;
},getClassName:function(){
return this.className;
},setShapePoints:function(_1b){
this.shapePointsXY=(arguments.length==2?arguments[1]:0);
if(this.shapePointsXY){
if(_1b.setLowerRight){
var _1c=new MQA.ObjectCollection();
_1c.add(new MQA.Point(_1b.ul.x,_1b.ul.y));
_1c.add(new MQA.Point(_1b.lr.x,_1b.lr.y));
_1b=_1c;
}
}else{
if(_1b.setLowerRight){
var _1c=new MQA.LatLngCollection();
_1c.add(new MQA.LatLng(_1b.ul.lat,_1b.ul.lng));
_1c.add(new MQA.LatLng(_1b.lr.lat,_1b.lr.lng));
_1b=_1c;
}
}
this.shapePoints=_1b;
if(this.shape){
this.drawShape();
}
},getShapePoints:function(){
return this.shapePoints;
},setAll:function(_1d){
if(typeof (_1d.shapePoints)!="undefined"){
this.setShapePoints(_1d.shapePoints);
}
if(typeof (_1d.key)!="undefined"){
this.setKey(_1d.key);
}
if(typeof (_1d.color)!="undefined"){
this.setColor(_1d.color);
}
if(typeof (_1d.altColor)!="undefined"){
this.setAltColor(_1d.altColor);
}
if(typeof (_1d.colorAlpha)!="undefined"){
this.setColorAlpha(_1d.colorAlpha);
}
if(typeof (_1d.altColorAlpha)!="undefined"){
this.setAltColorAlpha(_1d.altColorAlpha);
}
if(this.className!="MQLineOverlay"){
if(typeof (_1d.fillColor)!="undefined"){
this.setFillColor(_1d.fillColor);
}
if(typeof (_1d.altFillColor)!="undefined"){
this.setAltFillColor(_1d.altFillColor);
}
if(typeof (_1d.fillColorAlpha)!="undefined"){
this.setfillColorAlpha(_1d.fillColorAlpha);
}
if(typeof (_1d.altFillColorAlpha)!="undefined"){
this.setAltFillColorAlpha(_1d.altFillColorAlpha);
}
}
if(typeof (_1d.borderWidth)!="undefined"){
this.setBorderWidth(_1d.borderWidth);
}
if(typeof (_1d.altBorderWidth)!="undefined"){
this.setAltBorderWidth(_1d.altBorderWidth);
}
if(typeof (_1d.altStateFlag)!="undefined"){
this.setAltStateFlag(_1d.altStateFlag);
}
if(typeof (_1d.visible)!="undefined"){
this.setVisible(_1d.visible);
}
},getCurrentState:function(){
var _1e=new Object();
if(!this.altStateFlag){
_1e.color=this.color;
_1e.colorAlpha=this.colorAlpha;
_1e.fillColor=this.fillColor;
_1e.fillColorAlpha=this.fillColorAlpha;
_1e.borderWidth=this.borderWidth;
}else{
_1e.color=(this.altColor!=null?this.altColor:this.color);
_1e.colorAlpha=(this.altColorAlpha!=null?this.altColorAlpha:this.colorAlpha);
_1e.fillColor=(this.altFillColor!=null?this.altFillColor:this.fillColor);
_1e.fillColorAlpha=(this.altFillColorAlpha!=null?this.altFillColorAlpha:this.fillColorAlpha);
_1e.borderWidth=(this.altBorderWidth!=null?this.altBorderWidth:this.borderWidth);
}
_1e.visible=this.visible;
_1e.url=this.url;
_1e.maxZoomLevel=this.maxZoomLevel;
_1e.minZoomLevel=this.minZoomLevel;
return _1e;
},clone:function(_1f){
this.key=_1f.key;
this.color=_1f.color;
this.altColor=_1f.altColor;
this.colorAlpha=_1f.colorAlpha;
this.altColorAlpha=_1f.altColorAlpha;
this.fillColor=_1f.fillColor;
this.altFillColor=_1f.altFillColor;
this.fillColorAlpha=_1f.fillColorAlpha;
this.altFillColorAlpha=_1f.altFillColorAlpha;
this.borderWidth=_1f.borderWidth;
this.altBorderWidth=_1f.altBorderWidth;
this.altStateFlag=_1f.altStateFlag;
this.visible=_1f.visible;
this.maxZoomLevel=_1f.maxZoomLevel;
this.minZoomLevel=_1f.minZoomLevel;
this.shapePoints=_1f.shapePoints;
this.shape=null;
this.map=null;
},redraw:function(){
if(!this.map){
return;
}
this.drawShape();
},onClick:function(e){
var mqe=new MQA.Event(this.className+".click");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"click",mqe);
mqe.srcObject=this;
this.map.onClick(mqe);
MQA._prEvent.stop(e);
},onDoubleClick:function(e){
var mqe=new MQA.Event(this.className+".doubleClick");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"dblclick",mqe);
},onMouseDown:function(e){
var mqe=new MQA.Event(this.className+".mouseDown");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"mousedown",mqe);
},onMouseUp:function(e){
var mqe=new MQA.Event(this.className+".mouseUp");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"mouseup",mqe);
},onMouseOver:function(e){
var mqe=new MQA.Event(this.className+".mouseOver");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"mouseover",mqe);
MQA._prEvent.stop(e);
},onMouseOut:function(e){
var mqe=new MQA.Event(this.className+".mouseOut");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"mouseout",mqe);
MQA._prEvent.stop(e);
},onRemoved:function(e){
var mqe=new MQA.Event(this.className+".removed");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"removed",mqe);
}};
MQA.RectangleOverlay=function(_2e){
MQA.ShapeOverlay.call(this);
this.className="MQA.RectangleOverlay";
if(_2e){
if(_2e.getClassName()==this.className){
this.clone(_2e);
}
}
};
MQA.RectangleOverlay.prototype=new MQA.ShapeOverlay();
MQA.RectangleOverlay.prototype.constructor=MQA.RectangleOverlay;
MQA.RectangleOverlay.prototype.drawShape=function(){
var xy1,xy2,_31,_32,_33,_34,_35,_36,_37;
xy1=this.map.llToPix(this.shapePoints.get(0));
xy2=this.map.llToPix(this.shapePoints.get(1));
xy1=this.adjustXY(xy1);
xy2=this.adjustXY(xy2);
_34=xy1.x;
_35=xy2.x;
_36=xy1.y;
_37=xy2.y;
if(xy1.x>xy2.x){
xy1.x=_35;
xy2.x=_34;
}
if(xy1.y>xy2.y){
xy1.y=_37;
xy2.y=_36;
}
_33=this.getCurrentState();
if(this.shape!=null){
this.shape=MQA.Graphics.remove(this.map.surface,this.shape);
}
if((this.map.getZoomLevel()<_33.minZoomLevel)||(this.map.getZoomLevel()>_33.maxZoomLevel)){
return;
}
var _38=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));
var _39=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);
xy2.x=(xy2.x>_38?_38:xy2.x);
xy2.y=(xy2.y>_39?_39:xy2.y);
_31=xy2.y-xy1.y;
_32=xy2.x-xy1.x;
_31=(_31>_39?_39:_31);
_32=(_32>_38?_38:_32);
if(!(_31<1||_32<1)){
var p=new Array();
p[0]=xy1;
p[1]=xy2;
this.shape=MQA.Graphics.drawRectangle(p,_33.color,_33.colorAlpha,_33.borderWidth,_33.fillColor,_33.fillColorAlpha,_33.visible);
this.map.surface.appendChild(this.shape);
}
if(this.shape&&MQA.Graphics.eventsActive){
MQA._prEvent.observe(this.shape,"click",MQA._prEvent.EventCallback(this,"onClick"));
MQA._prEvent.observe(this.shape,"dblclick",MQA._prEvent.EventCallback(this,"onDoubleClick"));
MQA._prEvent.observe(this.shape,"mousedown",MQA._prEvent.EventCallback(this,"onMouseDown"));
MQA._prEvent.observe(this.shape,"mouseup",MQA._prEvent.EventCallback(this,"onMouseUp"));
MQA._prEvent.observe(this.shape,"mouseover",MQA._prEvent.EventCallback(this,"onMouseOver"));
MQA._prEvent.observe(this.shape,"mouseout",MQA._prEvent.EventCallback(this,"onMouseOut"));
}
};
MQA.LineOverlay=function(_3b){
MQA.ShapeOverlay.call(this);
this.className="MQA.LineOverlay";
this.fillColorAlpha="0.0";
this.altFillColorAlpha="0.0";
if(_3b){
if(_3b.getClassName()==this.className){
this.clone(_3b);
}
}
};
MQA.LineOverlay.prototype=new MQA.ShapeOverlay();
MQA.LineOverlay.prototype.constructor=MQA.LineOverlay;
MQA.LineOverlay.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 _40=this.getCurrentState();
if(this.shape!=null){
this.shape=MQA.Graphics.remove(this.map.surface,this.shape);
}
if((this.map.getZoomLevel()<_40.minZoomLevel)||(this.map.getZoomLevel()>_40.maxZoomLevel)){
return;
}
var _41=new Array();
if(MQA.Util.isOverLimit(xy)){
var _42=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));
var _43=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));
_41=MQA.Clip(0,_42,0,_43,xy,false);
}else{
_41=xy;
}
if(_41.length){
this.shape=MQA.Graphics.drawLine(_41,_40.color,_40.colorAlpha,_40.borderWidth,_40.visible);
this.map.surface.appendChild(this.shape);
}
if(this.shape&&MQA.Graphics.eventsActive){
MQA._prEvent.observe(this.shape,"click",MQA._prEvent.EventCallback(this,"onClick"));
MQA._prEvent.observe(this.shape,"dblclick",MQA._prEvent.EventCallback(this,"onDoubleClick"));
MQA._prEvent.observe(this.shape,"mousedown",MQA._prEvent.EventCallback(this,"onMouseDown"));
MQA._prEvent.observe(this.shape,"mouseup",MQA._prEvent.EventCallback(this,"onMouseUp"));
MQA._prEvent.observe(this.shape,"mouseover",MQA._prEvent.EventCallback(this,"onMouseOver"));
MQA._prEvent.observe(this.shape,"mouseout",MQA._prEvent.EventCallback(this,"onMouseOut"));
}
};
MQA.LineOverlay.prototype.setFillColor=function(){
};
MQA.LineOverlay.prototype.setAltFillColor=function(){
};
MQA.LineOverlay.prototype.setFillColorAlpha=function(){
};
MQA.LineOverlay.prototype.setAltFillColorAlpha=function(){
};
MQA.PolygonOverlay=function(_44){
MQA.ShapeOverlay.call(this);
this.className="MQA.PolygonOverlay";
if(_44){
if(_44.getClassName()==this.className){
this.clone(_44);
}
}
};
MQA.PolygonOverlay.prototype=new MQA.ShapeOverlay();
MQA.PolygonOverlay.prototype.constructor=MQA.PolygonOverlay;
MQA.PolygonOverlay.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 _49=this.getCurrentState();
if(this.shape!=null){
this.shape=MQA.Graphics.remove(this.map.surface,this.shape);
}
if((this.map.getZoomLevel()<_49.minZoomLevel)||(this.map.getZoomLevel()>_49.maxZoomLevel)){
return;
}
var _4a=new Array();
if(MQA.Util.isOverLimit(xy)){
var _4b=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));
var _4c=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));
_4a=MQA.Clip(0,_4b,0,_4c,xy,true);
}else{
_4a=xy;
}
if(_4a.length){
this.shape=MQA.Graphics.drawPolygon(_4a,_49.color,_49.colorAlpha,_49.borderWidth,_49.fillColor,_49.fillColorAlpha,_49.visible);
this.map.surface.appendChild(this.shape);
}
if(this.shape&&MQA.Graphics.eventsActive){
MQA._prEvent.observe(this.shape,"click",MQA._prEvent.EventCallback(this,"onClick"));
MQA._prEvent.observe(this.shape,"dblclick",MQA._prEvent.EventCallback(this,"onDoubleClick"));
MQA._prEvent.observe(this.shape,"mousedown",MQA._prEvent.EventCallback(this,"onMouseDown"));
MQA._prEvent.observe(this.shape,"mouseup",MQA._prEvent.EventCallback(this,"onMouseUp"));
MQA._prEvent.observe(this.shape,"mouseover",MQA._prEvent.EventCallback(this,"onMouseOver"));
MQA._prEvent.observe(this.shape,"mouseout",MQA._prEvent.EventCallback(this,"onMouseOut"));
}
};
MQA.EllipseOverlay=function(_4d){
MQA.ShapeOverlay.call(this);
this.className="MQA.EllipseOverlay";
if(_4d){
if(_4d.getClassName()==this.className){
this.clone(_4d);
}
}
};
MQA.EllipseOverlay.prototype=new MQA.ShapeOverlay();
MQA.EllipseOverlay.prototype.constructor=MQA.EllipseOverlay;
MQA.EllipseOverlay.prototype.drawShape=function(){
var xy1,xy2,_50,_51,_52,_53,_54,_55,_56;
var _57,_58,_59,_5a;
xy1=this.map.llToPix(this.shapePoints.get(0));
xy2=this.map.llToPix(this.shapePoints.get(1));
xy1=this.adjustXY(xy1);
xy2=this.adjustXY(xy2);
_53=xy1.x;
_54=xy2.x;
_55=xy1.y;
_56=xy2.y;
if(xy1.x>xy2.x){
xy1.x=_54;
xy2.x=_53;
}
if(xy1.y>xy2.y){
xy1.y=_56;
xy2.y=_55;
}
_57=Math.round((xy2.x-xy1.x)/2);
_58=Math.round((xy2.y-xy1.y)/2);
_59=xy1.x+_57;
_5a=xy1.y+_58;
var _5b=parseInt(this.map.overlaydiv.style.height.substr(0,(this.map.overlaydiv.style.height.length)-2));
var _5c=parseInt(this.map.overlaydiv.style.width.substr(0,(this.map.overlaydiv.style.width.length)-2));
var _5d=0;
if((xy1.x>_5b)||(xy2.x<0)||(xy1.y>_5c)||(xy2.y<0)){
_5d=1;
}
if(!_5d){
var x,y,c;
var _61=false;
x=0;
y=0;
_61=((x-_59)*(x-_59)/(_57*_57)+(y-_5a)*(y-_5a)/(_58*_58))<1;
if(_61){
x=_5b;
y=0;
_61=_61&&(((x-_59)*(x-_59)/(_57*_57)+(y-_5a)*(y-_5a)/(_58*_58))<1);
if(_61){
x=0;
y=_5c;
_61=_61&&(((x-_59)*(x-_59)/(_57*_57)+(y-_5a)*(y-_5a)/(_58*_58))<1);
if(_61){
x=_5b;
y=_5c;
_61=_61&&(((x-_59)*(x-_59)/(_57*_57)+(y-_5a)*(y-_5a)/(_58*_58))<1);
}
}
}
if(_61){
_5d=2;
}
}
if(!_5d){
if((_57*2)>32000||(_58*2)>32000){
_5d=3;
}
}
var _52=this.getCurrentState();
if(this.shape!=null){
this.shape=MQA.Graphics.remove(this.map.surface,this.shape);
}
if((this.map.getZoomLevel()<_52.minZoomLevel)||(this.map.getZoomLevel()>_52.maxZoomLevel)){
return;
}
switch(_5d){
case 0:
if(_57>1&&_58>1){
var p=new Array();
p[0]=xy1;
p[1]=xy2;
this.shape=MQA.Graphics.drawEllipse(p,_52.color,_52.colorAlpha,_52.borderWidth,_52.fillColor,_52.fillColorAlpha,_52.visible);
this.map.surface.appendChild(this.shape);
}
break;
case 1:
break;
case 2:
this.shape=MQA.Graphics.drawRectangle(p,_52.color,_52.colorAlpha,_52.borderWidth,_52.fillColor,_52.fillColorAlpha,_52.visible);
this.map.surface.appendChild(this.shape);
break;
case 3:
break;
}
if(this.shape){
MQA._prEvent.observe(this.shape,"click",MQA._prEvent.EventCallback(this,"onClick"));
MQA._prEvent.observe(this.shape,"dblclick",MQA._prEvent.EventCallback(this,"onDoubleClick"));
MQA._prEvent.observe(this.shape,"mousedown",MQA._prEvent.EventCallback(this,"onMouseDown"));
MQA._prEvent.observe(this.shape,"mouseup",MQA._prEvent.EventCallback(this,"onMouseUp"));
MQA._prEvent.observe(this.shape,"mouseover",MQA._prEvent.EventCallback(this,"onMouseOver"));
MQA._prEvent.observe(this.shape,"mouseout",MQA._prEvent.EventCallback(this,"onMouseOut"));
}
};
MQA.ImageOverlay=function(_63){
MQA.ShapeOverlay.call(this);
this.className="MQA.ImageOverlay";
this.url=null;
this.levels=null;
this.opacity=1;
if(_63){
if(_63.getClassName()==this.className){
this.clone(_63);
}
}
};
MQA.ImageOverlay.prototype=new MQA.ShapeOverlay();
MQA.ImageOverlay.prototype.constructor=MQA.ImageOverlay;
MQA.ImageOverlay.prototype.drawShape=function(){
var xy1,xy2,_66,_67,_68,_69,_6a,_6b,_6c,_6d,_6e,_6f,_70,_71;
_68=this.getCurrentState();
if(this.levels){
_6e=this.map.getZoomLevel();
_6f=17;
for(var i=0,j=this.levels.length;i<j;i++){
if(this.levels[i].zoomLevel==_6e){
_6d=this.levels[i].url;
break;
}else{
_70=Math.abs(this.levels[i].zoomLevel-_6e);
if(_70<_6f){
_6d=this.levels[i].url;
_6f=_70;
}
}
}
_68.url=_6d;
}else{
_68.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);
_69=xy1.x;
_6a=xy2.x;
_6b=xy1.y;
_6c=xy2.y;
if(xy1.x>xy2.x){
xy1.x=_6a;
xy2.x=_69;
}
if(xy1.y>xy2.y){
xy1.y=_6c;
xy2.y=_6b;
}
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()<_68.minZoomLevel)||(this.map.getZoomLevel()>_68.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=-(MQA.SURFACE_OFFSET+this.map.overlayOffsetX)+"px";
this.map.overlaydiv.style.top=-(MQA.SURFACE_OFFSET+this.map.overlayOffsetY)+"px";
}
}
_66=xy2.y-xy1.y;
_67=xy2.x-xy1.x;
if(!(_66<1||_67<1)){
this.shape=document.createElement("div");
this.shape.style.position="absolute";
this.shape.style.left=xy1.x+"px";
this.shape.style.top=xy1.y+"px";
this.map.overlaydiv.appendChild(this.shape);
var _74=document.createElement("img");
_74.width=_67;
_74.height=_66;
_74.style.height=_66+"px";
_74.style.width=_67+"px";
_74.src=_68.url;
_74.UNSELECTABLE="on";
_74.MozUserSelect="none";
this.shape.appendChild(_74);
this.shape.firstChild.style.display=(_68.visible?"inline":"none");
this.setImageOpacity(this.opacity);
}
if(this.shape){
MQA._prEvent.observe(this.shape,"click",MQA._prEvent.EventCallback(this,"onClick"));
MQA._prEvent.observe(this.shape,"dblclick",MQA._prEvent.EventCallback(this,"onDoubleClick"));
MQA._prEvent.observe(this.shape,"mousedown",MQA._prEvent.EventCallback(this,"onMouseDown"));
MQA._prEvent.observe(this.shape,"mouseup",MQA._prEvent.EventCallback(this,"onMouseUp"));
MQA._prEvent.observe(this.shape,"mouseover",MQA._prEvent.EventCallback(this,"onMouseOver"));
MQA._prEvent.observe(this.shape,"mouseout",MQA._prEvent.EventCallback(this,"onMouseOut"));
}
};
MQA.ImageOverlay.prototype.setImageURL=function(url){
if(this.levels==null){
this.url=url;
if(this.shape!=null){
this.drawShape();
}
}
};
MQA.ImageOverlay.prototype.getImageURL=function(){
return this.url;
};
MQA.ImageOverlayLevel=function(url,_77){
this.url=url;
this.zoomLevel=_77;
};
ImageOverlayLevel=MQA.ImageOverlayLevel;
MQA.ImageOverlay.prototype.setImageOverlayLevels=function(_78){
this.levels=_78;
if(this.shape!=null){
this.drawShape();
}
};
MQA.ImageOverlay.prototype.getImageOverlayLevels=function(){
return this.levels;
};
MQA.ImageOverlay.prototype.setImageOpacity=function(op){
this.opacity=op;
if(this.shape){
if(MQA.browser.name=="msie"){
this.shape.firstChild.style.filter="alpha(opacity="+(op*100)+")";
}
this.shape.firstChild.style.MozOpacity=op;
this.shape.firstChild.style.opacity=op;
}
};
MQA.ImageOverlay.prototype.getImageOpacity=function(){
return this.opacity;
};
MQA.OverlayCollection=function(){
MQA.TKObjectCollection.call(this);
this.overlayCollectionName="default";
};
MQA.OverlayCollection.prototype=new MQA.TKObjectCollection();
MQA.OverlayCollection.prototype.constructor=MQA.OverlayCollection;
MQA.OverlayCollection.prototype.append=function(_7a){
var i;
for(i=0;i<_7a.getSize();i++){
this.add(_7a.getAt(i));
}
};
MQA.OverlayCollection.prototype.getName=function(){
return this.overlayCollectionName;
};
MQA.OverlayCollection.prototype.setName=function(_7c){
this.overlayCollectionName=_7c;
};

if(MQA.browser.name=="msie"&&((MQA.browser.version<7)&&MQA.browser.version>5)){
MQA.Util._createImage("http://img.mqcdn.com/a/a",0,0,1,1,false);
}
MQA.PoiCollection=function(){
MQA.TKObjectCollection.call(this);
};
MQA.PoiCollection.prototype=new MQA.TKObjectCollection();
MQA.PoiCollection.prototype.constructor=MQA.PoiCollection;
MQA.PoiCollection.prototype.getBoundingRect=function(){
if(this.getSize()==0){
return null;
}
var _1=new MQA.LatLng(0,0);
var _2=new MQA.LatLng(0,0);
for(i=0;i<this.getSize();i++){
if(i==0){
_1.lat=this.getAt(i).element.ll.lat;
_1.lng=this.getAt(i).element.ll.lng;
_2.lat=this.getAt(i).element.ll.lat;
_2.lng=this.getAt(i).element.ll.lng;
}else{
if(this.getAt(i).element.ll.lat>_1.lat){
_1.lat=this.getAt(i).element.ll.lat;
}
if(this.getAt(i).element.ll.lat<_2.lat){
_2.lat=this.getAt(i).element.ll.lat;
}
if(this.getAt(i).element.ll.lng<_1.lng){
_1.lng=this.getAt(i).element.ll.lng;
}
if(this.getAt(i).element.ll.lng>_2.lng){
_2.lng=this.getAt(i).element.ll.lng;
}
}
}
return new MQA.RectLL(_1,_2);
};
MQA.PoiCollection.prototype.append=function(_3){
for(var i=0;i<_3.getSize();i++){
this.add(_3.getAt(i));
}
};
MQA.MapIcon=function(_5){
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(_5&&(_5 instanceof MQA.MapIcon)){
if(_5.image){
this.image=this._createImage(this._getImgSrc(_5.image),parseInt(_5.image.style.left),parseInt(_5.image.style.top),parseInt(_5.image.style.width),parseInt(_5.image.style.height),_5.image.isPng);
}
if(_5.shadow){
this.shadow=this._createImage(this._getImgSrc(_5.shadow),parseInt(_5.shadow.style.left),parseInt(_5.shadow.style.top),parseInt(_5.shadow.style.width),parseInt(_5.shadow.style.height),_5.shadow.isPng);
}
this.anchorOffset=new MQA.Point(_5.getAnchorOffset().getX(),_5.getAnchorOffset().getY());
this.infoWindowAnchor=new MQA.Point(_5.getInfoWindowAnchor().getX(),_5.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;
};
MQA.MapIcon.prototype.dispose=function(){
this.image=null;
this.shadow=null;
this.element=MQA.Util._deleteDOMObject(this.element);
if(this.parentPoi){
this.parentPoi=null;
}
};
MQA.MapIcon.prototype._calculateAnchors=function(){
if(this.image){
this.anchorOffset=new MQA.Point(-(parseInt(this.image.style.width)/2),-(parseInt(this.image.style.height)/2));
this.infoWindowAnchor=new MQA.Point(parseInt(this.image.style.width)/2,0);
}
};
MQA.MapIcon.prototype._fixPng=function(_6){
if((_6.isPng)&&(MQA.browser.name=="msie"&&((MQA.browser.version<7)&&MQA.browser.version>5))){
_6.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_6.src+"', sizingMethod='image')";
_6.src="http://img.mqcdn.com/a/a";
}
};
MQA.MapIcon.prototype._getImgSrc=function(_7){
if(_7){
if((_7.isPng)&&(MQA.browser.name=="msie"&&((MQA.browser.version<7)&&MQA.browser.version>5))){
var _8=_7.style.filter;
var _9=_8.indexOf("src='");
if(_9==-1){
throw new Error("MQA.MapIcon._getImgSrc: missing start of src string");
}
_9+=5;
var _a=_8.indexOf("'",_9);
if(_a==-1){
throw new Error("MQA.MapIcon._getImgSrc: missing end of src string");
}
var _b=_8.substr(_9,_a-_9);
return _b;
}else{
return _7.src;
}
}
};
MQA.MapIcon.prototype.getImage=function(){
return this.image;
};
MQA.MapIcon.prototype.setImage=function(_c,_d,_e,_f,_10){
if(this.image){
this.element.removeChild(this.image);
}
this.image=this._createImage(_c,0,0,_d,_e,_10);
this.element.appendChild(this.image);
if((_f==null)||(_f==true)){
this._calculateAnchors();
}
};
MQA.MapIcon.prototype.getShadow=function(){
return this.shadow;
};
MQA.MapIcon.prototype.setShadow=function(url,_12,top,_14,_15,_16){
if(this.shadow){
this.element.removeChild(this.shadow);
}
this.shadow=this._createImage(url,_12,top,_14,_15,_16);
this.element.appendChild(this.shadow);
};
MQA.MapIcon.prototype.getElement=function(){
return this.element;
};
MQA.MapIcon.prototype.getAnchorOffset=function(){
return this.anchorOffset;
};
MQA.MapIcon.prototype.setAnchorOffset=function(_17){
this.anchorOffset=_17;
this.redraw();
};
MQA.MapIcon.prototype.getInfoWindowAnchor=function(){
return this.infoWindowAnchor;
};
MQA.MapIcon.prototype.setInfoWindowAnchor=function(_18){
this.infoWindowAnchor=_18;
};
MQA.MapIcon.prototype.redraw=function(){
if(!this.parentPoi){
return;
}
this.parentPoi.redraw();
};
MQA.MapIcon.prototype._createImage=function(url,_1a,top,_1c,_1d,_1e){
return MQA.Util._createImage(url,_1a,top,_1c,_1d,_1e);
};
MQA.MapIcon.prototype._hasPngExtention=function(url){
return MQA.Util._hasPngExtension(url);
};
MQA.MapIcon.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 MQA.Point(-(parseInt(this.image.style.width)/2),-(parseInt(this.image.style.height)/2));
}
if(this.infoWindowAnchor==null){
this.infoWindowAnchor=new MQA.Point(parseInt(this.image.style.width)/2,0);
}
};
MQA.Poi=function(_21,_22){
this.map=null;
this.mqrw=null;
this.mqiw=null;
this.mqMapIcon=null;
if(_22&&(_22 instanceof MQA.MapIcon)){
this.mqMapIcon=_22;
}else{
this.mqMapIcon=new MQA.MapIcon();
}
this.mqMapIcon.parentPoi=this;
this.mqAltMapIcon=null;
this.altStateFlag=false;
this.element=document.createElement("div");
this.element.ll=new MQA.LatLng(_21.getLatitude(),_21.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;
this.isDecluttered=false;
this.titleBackgroundColor=null;
this.infoWindowTitle=null;
this.trafficPOI=0;
this.maxInfoWindowWidth=null;
this.eClick=MQA._prEvent.EventCallback(this,"onClick");
this.eDoubleClick=MQA._prEvent.EventCallback(this,"onDoubleClick");
this.eMouseDown=MQA._prEvent.EventCallback(this,"onMouseDown");
this.eMouseUp=MQA._prEvent.EventCallback(this,"onMouseUp");
this.eMouseOver=MQA._prEvent.EventCallback(this,"onMouseOver");
this.eMouseOut=MQA._prEvent.EventCallback(this,"onMouseOut");
MQA._prEvent.observe(this.element,"click",this.eClick);
MQA._prEvent.observe(this.element,"dblclick",this.eDoubleClick);
MQA._prEvent.observe(this.element,"mousedown",this.eMouseDown);
MQA._prEvent.observe(this.element,"mouseup",this.eMouseUp);
MQA._prEvent.observe(this.element,"mouseover",this.eMouseOver);
MQA._prEvent.observe(this.element,"mouseout",this.eMouseOut);
};
MQA.Poi.prototype.setTitleBackgroundColor=function(c){
this.titleBackgroundColor=c;
};
MQA.Poi.prototype.setInfoWindowTitle=function(c){
this.infoWindowTitle=c;
};
MQA.Poi.prototype.setMaxInfoWindowWidth=function(w){
this.maxInfoWindowWidth=w;
};
MQA.Poi.prototype.getMaxInfoWindowWidth=function(){
return this.maxInfoWindowWidth;
};
MQA.Poi.prototype.dispose=function(){
this.map=null;
MQA._prEvent.stopObserving(this.element,"click",this.eClick);
MQA._prEvent.stopObserving(this.element,"dblclick",this.eDoubleClick);
MQA._prEvent.stopObserving(this.element,"mousedown",this.eMouseDown);
MQA._prEvent.stopObserving(this.element,"mouseup",this.eMouseUp);
MQA._prEvent.stopObserving(this.element,"mouseover",this.eMouseOver);
MQA._prEvent.stopObserving(this.element,"mouseout",this.eMouseOut);
this.mqrw=null;
if(this.mqiw){
for(var i=0;i<this.element.childNodes.length;i++){
if(this.element.childNodes[i]==this.mqiw.popup){
this.element.removeChild(this.element.childNodes[i]);
break;
}
}
}
this.mqiw=null;
this.mqMapIcon.parentPoi=null;
this.mqMapIcon.element=null;
this.mqMapIcon.image=null;
this.mqMapIcon.shadow=null;
if(this.mqAltMapIcon){
this.mqAltMapIcon.element=null;
this.mqAltMapIcon.image=null;
this.mqAltMapIcon.shadow=null;
}
this.mqMapIcon=null;
if(this.mqAltMapIcon){
MQA.Util._deleteDOMObject(this.mqAltMapIcon);
this.mqAltMapIcon=null;
}
if(this.labelText){
this.labelText=null;
}
if(this.labelSpan){
MQA.Util._deleteDOMObject(this.labelSpan);
this.labelSpan=null;
}
if(this.labelDiv){
MQA.Util._deleteDOMObject(this.labelDiv);
this.labelDiv=null;
}
if(this.rolloverContent){
this.rolloverContent.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.rolloverContent);
MQA.Util._deleteDOMObject(this.rolloverContent);
this.rolloverContent=null;
}
if(this.infoWindowContent){
this.infoWindowContent.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.infoWindowContent);
MQA.Util._deleteDOMObject(this.infoWindowContent);
this.infoWindowContent=null;
}
this.leaderLineDotImage=null;
this.leaderLineDotIcon=null;
this.element.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.element);
MQA.Util._deleteDOMObject(this.element);
this.element=null;
};
MQA.Poi.prototype.getElement=function(){
return this.element;
};
MQA.Poi.prototype.onClick=function(e){
if(MQA._prEvent.element(e).id=="poiclose"||MQA._prEvent.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 MQA.Event("MQA.Poi.click");
var _29=MQA.Util.getParentOffset(this.map.parent);
var cx=e.clientX-_29.x;
var cy=e.clientY-_29.y;
mqe.xy=new MQA.Point(cx,cy);
mqe.button=(MQA._prEvent.isLeftClick(e))?MQA.BUTTON_MQ_LEFT:MQA.BUTTON_MQ_RIGHT;
mqe.domEvent=e;
MQA.EventManager.trigger(this,"click",mqe);
mqe.srcObject=this;
this.map.onClick(mqe);
MQA._prEvent.stop(e);
}
this.dragFlag=false;
};
MQA.Poi.prototype.onDoubleClick=function(e){
var mqe=new MQA.Event("MQA.Poi.dblClick");
var _2e=MQA.Util.getParentOffset(this.map.parent);
var cx=e.clientX-_2e.x;
var cy=e.clientY-_2e.y;
mqe.xy=new MQA.Point(cx,cy);
mqe.button=(MQA._prEvent.isLeftClick(e))?MQA.BUTTON_MQ_LEFT:MQA.BUTTON_MQ_RIGHT;
mqe.domEvent=e;
MQA.EventManager.trigger(this,"dblclick",mqe);
mqe.srcObject=this;
this.map.onDoubleClick(mqe);
MQA._prEvent.stop(e);
};
MQA.Poi.prototype.onMouseDown=function(e){
var mqe=new MQA.Event("MQA.Poi.mouseDown");
var _33=MQA.Util.getParentOffset(this.map.parent);
var cx=e.clientX-_33.x;
var cy=e.clientY-_33.y;
mqe.xy=new MQA.Point(cx,cy);
mqe.button=(MQA._prEvent.isLeftClick(e))?MQA.BUTTON_MQ_LEFT:MQA.BUTTON_MQ_RIGHT;
mqe.domEvent=e;
if(this.getDraggable()){
var _36=(this.altStateFlag&&this.mqAltMapIcon)?this.mqAltMapIcon.image:this.mqMapIcon.image;
var _37=this.map.getDragOffset();
var _38=MQA.Util.getWindowScrollXY();
var _39=cx+_38.x;
var _3a=cy+_38.y;
var _3b=parseInt(this.element.style.left)+_37.x;
var _3c=parseInt(this.element.style.top)+_37.y;
var _3d=(_3a>=_3c)&&(_3a<=(_3c+parseInt(_36.height)));
_3d=_3d&&(_39>=_3b)&&_39<=(_3b+parseInt(_36.width));
if(!_3d){
MQA.EventManager.trigger(this,"mousedown",mqe);
return;
}
if(typeof this.map.parent2.onselectstart!="undefined"){
this.map.div.poidiv.onselectstart=MQA._prEvent.falseFunction;
}
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.leaderLine=MQA.Graphics.remove(this.map.poisurface,this.leaderLine);
}
if(this.leaderLineDot){
this.leaderLineDot=MQA.Graphics.remove(this.map.poisurface,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(this.mqiw&&this.mqiw.opener==this){
this.mqiw.setPopupContentOverflow("hidden");
}
}
MQA.EventManager.trigger(this,"mousedown",mqe);
};
MQA.Poi.prototype.onMouseUp=function(e){
var mqe=new MQA.Event("MQA.Poi.mouseUp");
var _40=MQA.Util.getParentOffset(this.map.parent);
var cx=e.clientX-_40.x;
var cy=e.clientY-_40.y;
mqe.xy=new MQA.Point(cx,cy);
mqe.button=(MQA._prEvent.isLeftClick(e))?MQA.BUTTON_MQ_LEFT:MQA.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();
}
if(typeof this.map.parent2.onselectstart!="undefined"){
this.map.div.poidiv.onselectstart="";
}
MQA.EventManager.trigger(this,"mouseup",mqe);
};
MQA.Poi.prototype.finishDrag=function(){
var _43=(MQA.browser.name=="safari");
this.isDragging=false;
var _44=this.map.getDragOffset();
if(this.getAltStateFlag()){
var _45=this.getAltIcon().getAnchorOffset().getX();
var _46=this.getAltIcon().getAnchorOffset().getY();
}else{
var _45=this.getIcon().getAnchorOffset().getX();
var _46=this.getIcon().getAnchorOffset().getY();
}
var _47=(parseInt(this.element.style.left)-_45)+_44.x;
var _48=(parseInt(this.element.style.top)-_46)+_44.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 _49=(this.map.getDeclutter()?this.map.getDeclutter().getDeclutterMode():0);
if(this.snapback&&_49!=2){
this.setLatLng(this.getLatLng());
}else{
if(this.map.getDeclutter()){
if(this.map.getDeclutter().getDeclutterMode()==0){
this.setLatLng(this.map.pixToLL(new MQA.Point(_47,_48)));
}else{
if(this.map.getDeclutter().getDeclutterMode()==2){
theLatLngXY=this.map.llToPix(this.getLatLng());
this.dragLeft=theLatLngXY.x-(_44.x+parseInt(this.element.style.left));
this.dragTop=theLatLngXY.y-(_44.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(!_43){
this.map.getDeclutter().drawLeaderLine(this);
}else{
this.map.getDeclutter().redrawLeaderLines();
}
}
}else{
}
}
}else{
this.setLatLng(this.map.pixToLL(new MQA.Point(_47,_48)));
}
}
this.map.draggedObject=null;
if(this.mqiw&&this.mqiw.opener==this){
this.mqiw.setPopupContentOverflow("auto");
}
};
MQA.Poi.prototype.onMouseOver=function(e){
if(MQA.Util.isMouseLeaveOrEnter(e,this.element)){
var mqe=new MQA.Event("MQA.Poi.mouseOver");
mqe.domEvent=e;
var _4c=(this.map.draggedObject&&this.map.mypois.contains(this.map.draggedObject)&&this.map.draggedObject.isDragging)?true:false;
if(!this.isDragging&&!_4c&&(this.mqrw.isHidden()||this.mqrw.opener!=this)){
this.showRolloverWindow(mqe);
}
MQA.EventManager.trigger(this,"mouseover",mqe);
}
};
MQA.Poi.prototype.onMouseOut=function(e){
if(MQA.Util.isMouseLeaveOrEnter(e,this.element)){
if(this.isRolloverShowable()&&!this.isDragging&&this.mqrw.opener==this){
this.mqrw.hide();
}
var mqe=new MQA.Event("MQA.Poi.mouseOut");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"mouseout",mqe);
}
};
MQA.Poi.prototype.onInfoWindowOpen=function(e){
this.element.style.zIndex=100;
var mqe=new MQA.Event("MQA.Poi.infoWindowOpen");
mqe.domEvent=e;
this.showRolloverWindow(mqe);
MQA.EventManager.trigger(this,"infowindowopen",mqe);
};
MQA.Poi.prototype.onInfoWindowClose=function(e){
this.showingInfo=false;
this.element.style.zIndex=90;
if(this.isDecluttered&&this.map.getDeclutter()&&this.map.getDeclutter().getDeclutterMode()==1){
this.setVisible(false);
}
var mqe=new MQA.Event("MQA.Poi.infoWindowClose");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"infowindowclose",mqe);
};
MQA.Poi.prototype.onRolloverOpen=function(e){
this.element.style.zIndex=110;
MQA.EventManager.trigger(this,"rolloveropen",e);
};
MQA.Poi.prototype.onRolloverClose=function(e){
this.element.style.zIndex=90;
MQA.EventManager.trigger(this,"rolloverclose",e);
};
MQA.Poi.prototype.onRemoved=function(e){
var mqe=new MQA.Event("MQA.Poi.removed");
mqe.domEvent=e;
MQA.EventManager.trigger(this,"removed",mqe);
};
MQA.Poi.prototype.getLatLng=function(){
return new MQA.LatLng(this.element.ll.lat,this.element.ll.lng);
};
MQA.Poi.prototype.setLatLng=function(_57){
this.element.ll=new MQA.LatLng(_57.getLatitude(),_57.getLongitude());
this.redraw();
};
MQA.Poi.prototype.getIcon=function(){
return this.mqMapIcon;
};
MQA.Poi.prototype.setIcon=function(_58){
this.mqMapIcon.dispose();
this.mqMapIcon=null;
this.mqMapIcon=_58;
this.element.appendChild(this.mqMapIcon.getElement());
this.mqMapIcon.parentpoi=this;
this.redraw();
};
MQA.Poi.prototype.isIconVisible=function(){
var _59=false;
_59=(this.mqMapIcon.getElement().style.display!="none");
_59=_59||(this.mqAltMapIcon.getElement().style.display!="none");
return _59;
};
MQA.Poi.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";
}
};
MQA.Poi.prototype.getAltIcon=function(){
if(this.mqAltMapIcon){
return this.mqAltMapIcon;
}else{
return this.mqMapIcon;
}
};
MQA.Poi.prototype.setAltIcon=function(_5b){
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.mqAltMapIcon.dispose();
this.mqAltMapIcon=null;
}
this.mqAltMapIcon=new MQA.MapIcon();
this.mqAltMapIcon=_5b;
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";
};
MQA.Poi.prototype.setAltStateFlag=function(b){
this.altStateFlag=b;
if(this.mqAltMapIcon){
if(this.map){
var _5f=this.getIcon().getAnchorOffset().getX()-this.getAltIcon().getAnchorOffset().getX();
var _60=this.getIcon().getAnchorOffset().getY()-this.getAltIcon().getAnchorOffset().getY();
}else{
_5f=0;
_60=0;
}
if(b){
this.element.style.left=(parseInt(this.element.style.left)+_5f)+"px";
this.element.style.top=(parseInt(this.element.style.top)+_60)+"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)-_5f)+"px";
this.element.style.top=(parseInt(this.element.style.top)-_60)+"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);
}
}
}
}
};
MQA.Poi.prototype.getAltStateFlag=function(){
return this.altStateFlag;
};
MQA.Poi.prototype.getKey=function(){
return this.key;
};
MQA.Poi.prototype.setKey=function(key){
this.key=key;
};
MQA.Poi.prototype.isVisible=function(){
return (this.element.style.display!="none"?true:false);
};
MQA.Poi.prototype.setVisible=function(b){
if(b){
this.element.style.display="block";
}else{
this.element.style.display="none";
}
};
MQA.Poi.prototype.setLevel=function(i){
this.element.style.zIndex=i;
};
MQA.Poi.prototype.getLabel=function(){
return (this.labelText==null)?"":this.labelText.data;
};
MQA.Poi.prototype.setLabel=function(_64,_65){
if(!this.labelDiv){
this.labelDiv=document.createElement("div");
this.labelDiv.className="mq-poi-label";
this.labelDiv.style.MozUserSelect="none";
this.labelDiv.onselectstart=MQA._prEvent.falseFunction;
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=_64;
if(!_65){
this.labelDiv.className="mq-poi-label";
this.redrawLabel();
}else{
this.labelDiv.className=_65;
}
};
MQA.Poi.prototype.getLabelStyle=function(){
return this.labelDiv.style;
};
MQA.Poi.prototype.isLabelVisible=function(){
return (this.labelDiv.style.display!="none"?true:false);
};
MQA.Poi.prototype.setLabelVisible=function(b){
if(b){
this.labelDiv.style.display="block";
this.redrawLabel();
}else{
this.labelDiv.style.display="none";
}
};
MQA.Poi.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 _67=(this.mqMapIcon.getImage())?this.mqMapIcon.getImage().style.width:this.mqMapIcon._defImageWidth;
var _68=(this.mqMapIcon.getImage())?this.mqMapIcon.getImage().height:this.mqMapIcon._defImageHeight;
this.labelDiv.style.left=(parseInt(_67)/2-this.labelSpan.offsetWidth/2)+"px";
this.labelDiv.style.top=_68+"px";
}
}
};
MQA.Poi.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();
};
MQA.Poi.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 MQA.Event("MQA.Poi.rolloverOpen"));
}
};
MQA.Poi.prototype.showInfoWindow=function(){
if(this.infoWindowContent!=null){
if(this.mqiw==null){
this.mqiw=this.map.getInfoWindow();
}
if(this.isRolloverShowable()){
this.mqrw.hide();
}
var _6a=this.mqiw.getMaxWidth();
var _6b=this.mqiw.getTitleBackgroundColor();
if(this.titleBackgroundColor){
this.mqiw.setTitleBackgroundColor(this.titleBackgroundColor);
}
if(this.infoWindowTitle){
var _6c=document.createElement("div");
_6c.innerHTML="<div>"+this.infoWindowTitle+"</div>";
_6d=_6c;
}else{
var _6d=this.rolloverContent;
}
if(this.maxInfoWindowWidth){
this.mqiw.setMaxWidth(this.maxInfoWindowWidth);
}
this.element.appendChild(this.mqiw.popup);
this.mqiw.modify(this.map.getLLToXY(this.element.ll),_6d,this.infoWindowContent,this.getIcon().getInfoWindowAnchor());
this.mqiw.setOpenerAndShow(this);
this.showingInfo=true;
this.onInfoWindowOpen(new MQA.Event("MQA.Poi.infoWindowOpen"));
this.mqiw.setMaxWidth(_6a);
this.mqiw.setTitleBackgroundColor(_6b);
}
};
MQA.Poi.prototype.setInfoTitleHTML=function(_6e){
var _6f=document.createElement("div");
_6f.innerHTML="<div>"+_6e+"</div>";
this.rolloverContent=_6f;
};
MQA.Poi.prototype.setInfoContentHTML=function(_70){
if(_70==undefined){
return;
}
if(_70!=""){
this.infoContentExists=true;
}
var _71=document.createElement("div");
_71.innerHTML="<div>"+_70+"</div>";
this.infoWindowContent=_71;
};
MQA.Poi.prototype.setInfoTitleElement=function(_72){
this.rolloverContent=_72;
};
MQA.Poi.prototype.setInfoContentElement=function(_73){
this.infoWindowContent=_73;
};
MQA.Poi.prototype.setRolloverEnabled=function(_74){
this.rolloverEnabled=_74;
};
MQA.Poi.prototype.isRolloverEnabled=function(){
return this.rolloverEnabled;
};
MQA.Poi.prototype.isRolloverShowable=function(){
return this.isRolloverEnabled()&&this.map.getRolloversEnabled()&&(this.rolloverContent!=null)&&!this.showingInfo;
};
MQA.Poi.prototype.getInfoWindow=function(){
return this.mqiw;
};
MQA.Poi.prototype.getDraggable=function(){
if(this.map){
if(this.map.getDeclutter()){
if(this.map.getDeclutter().getDeclutterMode()==2){
return true;
}
}
}
return this.isDraggable;
};
MQA.Poi.prototype.setDraggable=function(_75){
this.isDraggable=_75;
if(arguments.length>1){
this.keepRolloverOnDrag=arguments[1];
}
};
MQA.Poi.prototype.getSnapback=function(){
return this.snapback;
};
MQA.Poi.prototype.setSnapback=function(_76){
this.snapback=_76;
};
MQA.Poi.prototype.getLeaderLineColor=function(){
if(this.leaderLineColor){
return this.leaderLineColor;
}else{
if(this.map.getDeclutter()){
return this.map.getDeclutter().leaderLineColor;
}else{
return "#000000";
}
}
};
MQA.Poi.prototype.setLeaderLineColor=function(c){
this.leaderLineColor=c;
if(this.map.getDeclutter()){
if(this.map.getDeclutter().getDeclutterMode()==2){
c=MQA.Graphics.normalizeColor(c).hex;
switch(MQA.Graphics.drawMethod){
case "svg":
this.leaderLine.setAttribute("stroke",c);
this.leaderLineDot.setAttribute("stroke",c);
this.leaderLineDot.setAttribute("fill",c);
break;
case "vml":
this.shape.stroke.color=c;
this.shape.stroke.opacity=c;
this.shape.fill.color=c;
break;
case "canvas":
this.map.getDeclutter().redrawLeaderLines();
break;
}
}
}
};
MQA.Poi.prototype.setRolloverDrag=function(b){
this.keepRolloverOnDrag=b;
};
MQA.Poi.prototype.getRolloverDrag=function(){
return this.keepRolloverOnDrag;
};
MQA.Poi.prototype.setLeaderLineDotImage=function(url,_7a,_7b){
this.leaderLineDotImage=new MQA.LeaderLineDotImage(url,_7a,_7b);
if(this.map.getDeclutter()){
if(this.map.getDeclutter().getDeclutterMode()==2){
this.map.getDeclutter().drawLeaderLine(this);
}
}
};
MQA.Poi.prototype.getLeaderLineDotImage=function(){
return this.leaderLineDotImage;
};
MQA.LeaderLineDotImage=function(url,_7d,_7e){
this.url=url;
this.width=_7d;
this.height=_7e;
};
MQA.LeaderLineDotIcon=function(_7f,map,poi){
this.map=map;
this.div=document.createElement("div");
this.div.im=document.createElement("img");
this.div.im.src=_7f.url;
this.div.im.style.height=_7f.height;
this.div.im.style.width=_7f.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 MQA.PointXY(-_7f.width/2,-_7f.height/2),this.div);
};

MQA.RolloverWindow=function(_1){
this.map=_1;
this.enabled=true;
this.point=null;
this.content=null;
this.offset=new MQA.Point(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;
};
MQA.RolloverWindow.prototype.onOpen=function(e){
MQA.EventManager.trigger(this,"opened",e);
};
MQA.RolloverWindow.prototype.onClose=function(e){
MQA.EventManager.trigger(this,"closed",e);
};
MQA.RolloverWindow.prototype.hide=function(_4){
if(!this.isHidden()){
if(this.minipopup.style.visibility!="hidden"){
this.minipopup.style.visibility="hidden";
}
if(this.opener!=null){
this.opener.onRolloverClose(new MQA.Event("MQPoi.rolloverClose"));
this.opener=null;
}
this.onClose(new MQA.Event("MQA.RolloverWindow.close"));
}
};
MQA.RolloverWindow.prototype.setOpenerAndShow=function(_5){
this.show();
this.opener=_5;
};
MQA.RolloverWindow.prototype.show=function(){
if(!this.isHidden()){
this.hide();
}
var _6=this.offset.y;
var _7=this.offset.x;
var _8=this.leftRolloverSrc;
this.minipopup.style.top=(_6+this.rolloverOffsetY)+"px";
this.minipopup.style.left=(_7+this.leftRolloverOffsetX)+"px";
if(this.flipStateEnabled){
var _9=this.getCollisionInfo(this.minipopup);
if(_9.panX<0){
_8=this.rightRolloverSrc;
this.minipopup.style.top=(_6+this.rolloverOffsetY)+"px";
this.minipopup.style.left=(_7+this.rightRolloverOffsetX)+"px";
}
}
if(MQA.browser.name=="msie"&&(MQA.browser.version>5)&&(MQA.browser.version<7)){
this.minipopup.style.display="none";
this.minipopup.style.visibility="visible";
this.minipopup.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_8+"', sizingMethod='scale')";
this.minipopup.style.display="block";
}else{
this.minipopup.style.background="";
this.minipopup.style.background="url("+_8+") left";
}
this.minipopup.style.visibility="visible";
this.onOpen(new MQA.Event("MQA.RolloverWindow.open"));
};
MQA.RolloverWindow.prototype.isHidden=function(){
return (this.minipopup.style.visibility=="hidden");
};
MQA.RolloverWindow.prototype.modify=function(_a,_b,_c,_d){
if(_a){
this.point=_a;
}
if(_b){
this.content=_b;
}
if(_c){
this.offset=_c;
}
this.minipopup.style.position="absolute";
this.minipopup.style.zIndex=9;
var _e=MQA.Util.stripHTMLTags(this.content.innerHTML);
if(_d.infoWindowContent&&this.textLength==31){
this.textLength-=2;
}
if(_d.infoWindowContent){
_e=(_e.length>this.textLength)?MQA.Util.getHTMLSubstring(this.content.innerHTML,this.textLength,"&nbsp;...&nbsp;&raquo;"):MQA.Util.getHTMLSubstring(this.content.innerHTML,_e.length,"&nbsp;&raquo;");
}else{
_e=(_e.length>this.textLength)?MQA.Util.getHTMLSubstring(this.content.innerHTML,this.textLength,"&nbsp;..."):MQA.Util.getHTMLSubstring(this.content.innerHTML,_e.length,"");
}
this.minipopup.innerHTML="<div class='mqminipopuphead'>"+_e+"</div>";
};
MQA.RolloverWindow.prototype.getMaxWidth=function(){
return this.maxWidth;
};
MQA.RolloverWindow.prototype.setMaxWidth=function(_f){
this.maxWidth=_f;
};
MQA.RolloverWindow.prototype.getPointLL=function(){
return this.map.getXYToLL(this.point);
};
MQA.RolloverWindow.prototype.getPointXY=function(){
return this.point;
};
MQA.RolloverWindow.prototype.getPixelOffset=function(){
return this.offset;
};
MQA.RolloverWindow.prototype.setRolloverGraphic=function(_10,_11){
if(typeof _10=="undefined"){
this.leftRolloverSrc=this.artUrl+"rollover-left.png";
}else{
this.leftRolloverSrc=_10;
}
this.rightRolloverSrc=_11;
};
MQA.RolloverWindow.prototype.setDefaultRollover=function(){
this.leftRolloverSrc=this.artUrl+"rollover-left.png";
this.rightRolloverSrc=this.artUrl+"rollover-right.png";
this.setRolloverGraphic(this.leftRolloverSrc,this.rightRolloverSrc);
};
MQA.RolloverWindow.prototype.setFlipStateEnabled=function(_12){
if(typeof _12=="undefined"||typeof _12!="boolean"){
this.flipStateEnabled=false;
}else{
this.flipStateEnabled=_12;
}
};
MQA.RolloverWindow.prototype.getFlipStateEnabled=function(){
return this.flipStateEnabled;
};
MQA.RolloverWindow.prototype.getCollisionInfo=function(_13,_14,_15){
var _16=this.map.parent;
var _17={panX:0,panY:0};
var _18=(_14)?_14:false;
var _19=(_15)?_15:false;
var _1a=MQA.Util.getParentOffset(_16);
var _1b=MQA.Util.getParentOffset(_13);
var _1c=0;
_1b.x=_1b.x-_1a.x-_1c;
_1b.y=_1b.y-_1a.y-_1c;
var _1d=(_18)?{width:37,height:300}:{width:0,height:0};
var _1e=(_19)?{width:139,height:15}:{width:0,height:0};
var _1f=(_1b.x<_1d.width&&_1b.y<_1d.height+_1c)?_1d.width:0;
var _20=(_1b.x+_13.clientWidth>_16.clientWidth-_1e.width&&_1b.y<_1e.height+_1c)?_1e.height:0;
if(_13.clientWidth>0&&_13.clientHeight>0){
if(_1b.x<_1f){
_17.panX=Math.abs(_1b.x-_1f);
}else{
if(_1b.x+_1c+_13.clientWidth>_16.clientWidth){
_17.panX=-1*(_13.clientWidth+_1b.x+_1c-_16.clientWidth);
}
}
if(_1b.y<_20){
_17.panY=Math.abs(_1b.y-_20);
}else{
if(_1b.y+_13.clientHeight>_16.clientHeight){
_17.panY=_16.clientHeight-_1b.y-_13.clientHeight;
}
}
}
return _17;
};
MQA.RolloverWindow.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";
};
MQA.RolloverWindow.prototype.dispose=function(){
this.map=null;
this.opener=null;
this.artUrl="";
this.leftRolloverSrc="";
this.rightRolloverSrc="";
if(this.content){
this.content.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.content);
this.content=null;
}
this.minipopup.oncontextmenu=null;
this.minipopup.innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.minipopup);
MQA.Util._deleteDOMObject(this.minipopup);
this.minipopup=null;
};
MQA.RolloverWindow.prototype.setTextLength=function(_21){
if(typeof _21=="undefined"||isNaN(parseInt(_21))){
this.textLength=31;
}else{
this.textLength=parseInt(_21);
}
};
MQA.RolloverWindow.prototype.getTextLength=function(){
return this.textLength;
};
MQA.RolloverWindow.prototype.setLeftRolloverOffsetX=function(_22){
if(typeof _22=="undefined"||isNaN(parseInt(_22))){
this.leftRolloverOffsetX=-25;
}else{
this.leftRolloverOffsetX=parseInt(_22);
}
};
MQA.RolloverWindow.prototype.getLeftRolloverOffsetX=function(){
return this.leftRolloverOffsetX;
};
MQA.RolloverWindow.prototype.setRightRolloverOffsetX=function(_23){
if(typeof _23=="undefined"||isNaN(parseInt(_23))){
this.rightRolloverOffsetX=-193;
}else{
this.rightRolloverOffsetX=parseInt(_23);
}
};
MQA.RolloverWindow.prototype.getRightRolloverOffsetX=function(){
return this.rightRolloverOffsetX;
};
MQA.RolloverWindow.prototype.setRolloverOffsetY=function(_24){
if(typeof _24=="undefined"||isNaN(parseInt(_24))){
this.rolloverOffsetY=(13-this.minipopup.offsetHeight);
}else{
this.rolloverOffsetY=parseInt(_24);
}
};
MQA.RolloverWindow.prototype.getRolloverOffsetY=function(){
return this.rolloverOffsetY;
};

MQA.SlideBroker=function(){
this.mapList=new Array();
};
MQA.SlideBroker.prototype={addListener:function(_1){
var _2=this.mapList.length;
this.mapList[_2]=_1;
return _2;
},DoSlide:function(_3,_4,_5,_6,_7,_8,_9,_a){
this.mapList[_3].slideMapTimer(_3,_4,_5,_6,_7,_8,_9,_a);
}};

MQA.TileMap=function(_1,_2,_3,_4,_5){
this.div1=document.createElement("div");
this.div1.style.width=_1.style.width;
this.div1.style.height=_1.style.height;
this.div1.style.zIndex=0;
_1.style.position="relative";
this.parent2=_1;
_1.appendChild(this.div1);
this.controls=[];
this.mypois=new MQA.PoiCollection();
try{
this.myoverlays=new MQA.OverlayCollection();
}
catch(err){
this.myoverlays=null;
}
try{
this.mydeclutter=new MQA.Declutter(this);
}
catch(err){
this.mydeclutter=null;
}
this.iwparent=document.createElement("div");
if(_2==null){
_2=1;
}
if(_3==null){
_3=new MQA.LatLng(38.134557,-98.4375);
}
this._dth=MQA._prEvent.addDtor(this,"dispose");
this.showMap=true;
this.showSat=false;
this.showHyb=false;
this.showRte=false;
this.updateOverlaysX=true;
this.updateOverlaysY=true;
this.tileMode="map";
this.tileNode="MQMAP";
this.bestFitRect=null;
this.keepCenter=null;
this.bestFitMargin=0;
if(_4=="sat"){
this.showSat=true;
this.showMap=false;
this.tileMode=_4;
this.tileNode="MQSAT";
}
if(_4=="hyb"){
this.showSat=true;
this.showHyb=true;
this.showMap=false;
this.tileMode=_4;
this.tileNode="MQHYB";
}
var me=this;
if(MQA.MASTER_BROKER==null){
MQA.MASTER_BROKER=new MQA.SlideBroker();
}
this.brokerKey=MQA.MASTER_BROKER.addListener(me);
this.parent=this.div1;
if(!this.parent.style.height||parseInt(this.parent.style.height)<100){
this.parent.style.width="550px";
this.parent.style.height="475px";
}
this.width=parseInt(this.parent.style.width);
this.height=parseInt(this.parent.style.height);
if(this.width>MQA.MAXMAPWIDTH){
this.width=MQA.MAXMAPWIDTH;
}
if(this.height>MQA.MAXMAPHEIGHT){
this.height=MQA.MAXMAPHEIGHT;
}
if(_5!=null){
if(_5.getBestFitMargin()!=null){
this.setBestFitMargin(_5.getBestFitMargin());
}
if(_5.getBestFitRect()!=null){
this.bestFitRect=_5.getBestFitRect();
this.keepCenter=_5.isKeepCenter();
_2=this.getZoom(_5.getBestFitRect(),_3,_5.isKeepCenter(),_5.getMinZoom(),_5.getMaxZoom());
if(_5.isKeepCenter()==false){
var _7=_5.getBestFitRect();
var _8=new MQA.PointLL(_7.ul.lat,_7.ul.lng);
var _9=new MQA.PointLL(_7.lr.lat,_7.lr.lng);
_3=new MQA.PointLL(((_8.lat+_9.lat)/2),((_8.lng+_9.lng)/2));
}
}
}
this.zoom=(_2>16)?16:parseInt(_2);
this.scale=MQA.SCALES[this.zoom];
this.tilesize=MQA.TILESIZE;
this.centerlat=_3.lat;
this.centerlng=_3.lng;
this.lastlat=this.centerlat;
this.lastlng=this.centerlng;
this.maprows=Math.ceil(this.height/this.tilesize)+2;
this.mapcols=Math.ceil(this.width/this.tilesize)+2;
this.disabled=false;
this.drag=false;
this.slide=false;
this.tiles=null;
this.routerect=null;
this.clickEvent=MQA.EVENT_NONE;
this.clickOper=-1;
this.rteserver="";
this.rtesession="";
this.routebestfit=false;
this.mapaccum1=0;
this.sataccum1=0;
this.hybaccum1=0;
this.mapaccum2=0;
this.sataccum2=0;
this.hybaccum2=0;
this.diffaccum=0;
this.moving=false;
this.startingToMove=false;
this.div=MQA.Util.createParentDiv("mqtiledmap",0,0,"absolute",0,0,0,null,null);
this.parent.style.overflow="hidden";
this.parent.style.background="#FFFFFF";
this.parent.style.position="relative";
this.parent.style.top="0px";
this.parent.style.left="0px";
this.parent.style.width=this.width+"px";
this.parent.style.height=this.height+"px";
this.parent.appendChild(this.div);
if(navigator.userAgent.indexOf("MSIE")>=0){
document.execCommand("BackgroundImageCache",false,true);
}
this.div.ldiv=MQA.Util.createParentDiv("mqloading",0,0,"absolute",0,0,0,(this.mapcols*MQA.TILESIZE),(this.maprows*MQA.TILESIZE));
this.div.ldiv.style.backgroundImage="url("+MQA.RESOURCES+"loading.gif)";
this.div.ldiv.style.backgroundRepeat="repeat";
this.div.appendChild(this.div.ldiv);
this.document_mousemove=MQA._prEvent.EventCallback(this,"onMouseMove");
this.document_mouseup=MQA._prEvent.EventCallback(this,"onMouseUp");
this.document_mouseout=MQA._prEvent.EventCallback(this,"onMouseOut");
this.parent_mouseover=MQA._prEvent.EventCallback(this,"onMouseOver");
this.parent_mousedown=MQA._prEvent.EventCallback(this,"onMouseDown");
MQA._prEvent.observe(document,"mousemove",this.document_mousemove);
MQA._prEvent.observe(document,"mouseup",this.document_mouseup);
MQA._prEvent.observe(document,"mouseout",this.document_mouseout);
MQA._prEvent.observe(this.parent,"mouseover",this.parent_mouseover);
MQA._prEvent.observe(this.parent,"mousedown",this.parent_mousedown);
this.rtehighlight=MQA.Util.createImgHolder(null,"on","none","none",50);
this.rtehighlight.id="mqrtehl";
this.rtehighlight.onload=MQA._prEvent.hitch(this,"showRouteHighlight");
this.rtehighlight.onselectstart=MQA._prEvent.falseFunction;
this.rtehighlight.oncontextmenu=MQA._prEvent.falseFunction;
this.rtehighlight.style.position="absolute";
this.rtehighlight.style.opacity="0.6";
this.rtehighlight.style.filter="alpha(opacity='60')";
this.div.appendChild(this.rtehighlight);
this.prnstyle=document.createElement("style");
this.prnstyle.type="text/css";
this.prnstyle.media="print";
var _a="img#mqrtehl { visibility:hidden; display:none }";
if(this.prnstyle.styleSheet){
this.prnstyle.styleSheet.cssText=_a;
}else{
var _b=document.createTextNode(_a);
this.prnstyle.appendChild(_b);
}
document.body.appendChild(this.prnstyle);
this.loading=MQA.Util.createImgHolder(null,"on","none","none",null);
this.loading.src=MQA.RESOURCES+"loading.gif";
this.parent.appendChild(this.loading);
this.maptiler=MQA.Util.createImgHolder(MQA.NOTHING,"on","none","none",null);
this.parent.appendChild(this.maptiler);
this.sattiler=MQA.Util.createImgHolder(MQA.NOTHING,"on","none","none",null);
this.parent.appendChild(this.sattiler);
this.hybtiler=MQA.Util.createImgHolder(MQA.NOTHING,"on","none","none",null);
this.parent.appendChild(this.hybtiler);
this.logos=new Array(5);
this.logos[MQA.LOGO_MQ_LOGO]=MQA.Util.createImgLogo("none","on",MQA.CORNER_TOPLEFT,new MQA.PointXY(0,0),"absolute","block",22,null,95,15);
this.logos[MQA.LOGO_MQ_LOGO].src=MQA.RESOURCES+"mqlogo.gif";
this.setLogoPosition(this.logos[MQA.LOGO_MQ_LOGO]);
this.parent.appendChild(this.logos[MQA.LOGO_MQ_LOGO]);
this.logos[MQA.LOGO_MQ_SCALES]=document.createElement("div");
this.logos[MQA.LOGO_MQ_SCALES].corner=MQA.CORNER_TOPRIGHT;
this.logos[MQA.LOGO_MQ_SCALES].offset=new MQA.PointXY(0,0);
this.logos[MQA.LOGO_MQ_SCALES].style.position="absolute";
this.logos[MQA.LOGO_MQ_SCALES].style.display="block";
this.logos[MQA.LOGO_MQ_SCALES].style.zIndex=22;
this.logos[MQA.LOGO_MQ_SCALES].width="124";
this.logos[MQA.LOGO_MQ_SCALES].height="18";
this.logos[MQA.LOGO_MQ_SCALES].style.overflow="hidden";
this.logos[MQA.LOGO_MQ_SCALES].style.width="124px";
this.logos[MQA.LOGO_MQ_SCALES].style.height="18px";
this.logos[MQA.LOGO_MQ_SCALES].innerHTML="<img style='-moz-user-select:none;' unselectable='on' src='http://"+RESSERVER+"/scales/scalebar.gif' />";
this.setLogoPosition(this.logos[MQA.LOGO_MQ_SCALES]);
this.parent.appendChild(this.logos[MQA.LOGO_MQ_SCALES]);
this.logos[MQA.LOGO_MQ_COPY]=MQA.Util.createImgLogo("none","on",MQA.CORNER_BOTTOMLEFT,new MQA.PointXY(0,0),"absolute","block",22,null,103,12);
this.logos[MQA.LOGO_MQ_COPY].src=MQA.RESOURCES+"mqcopy.gif";
this.setLogoPosition(this.logos[MQA.LOGO_MQ_COPY]);
this.parent.appendChild(this.logos[MQA.LOGO_MQ_COPY]);
logoDisplay=(this.tileMode!="sat")?"block":"none";
this.logos[MQA.LOGO_MAP_COPY]=MQA.Util.createImgLogo("none","on",MQA.CORNER_BOTTOMRIGHT,new MQA.PointXY(0,0),"absolute",logoDisplay,22,null,190,12);
this.logos[MQA.LOGO_MAP_COPY].src=MQA.RESOURCES+MQA.VENDORLIST[1];
this.setLogoPosition(this.logos[MQA.LOGO_MAP_COPY]);
this.parent.appendChild(this.logos[MQA.LOGO_MAP_COPY]);
logoDisplay=(this.tileMode!="map")?"block":"none";
this.logos[MQA.LOGO_SAT_COPY]=MQA.Util.createImgLogo("none","on",MQA.CORNER_BOTTOMRIGHT,new MQA.PointXY(0,-13),"absolute",logoDisplay,22,null,115,12);
this.logos[MQA.LOGO_SAT_COPY].src=MQA.RESOURCES+"sz1copy.gif";
this.setLogoPosition(this.logos[MQA.LOGO_SAT_COPY]);
this.parent.appendChild(this.logos[MQA.LOGO_SAT_COPY]);
this.grab_mousecursor=this.div.attachEvent?MQA.RESOURCES+"grab.cur":"-moz-grab";
this.grabbing_mousecursor=this.div.attachEvent?MQA.RESOURCES+"grabbing.cur":"-moz-grabbing";
this.current_mousecursor=this.grab_mousecursor;
this.div.style.cursor=this.current_mousecursor;
this.div.mapdiv=MQA.Util.createParentDiv("mqmapdiv",0,0,"absolute",0,0,null,null,null);
this.div.appendChild(this.div.mapdiv);
this.div.satdiv=MQA.Util.createParentDiv("mqsatdiv",0,0,"absolute",0,0,null,null,null);
this.div.appendChild(this.div.satdiv);
this.div.hybdiv=MQA.Util.createParentDiv("mqhybdiv",0,0,"absolute",0,0,null,null,null);
this.div.appendChild(this.div.hybdiv);
this.div.staticmapdiv=MQA.Util.createParentDiv("mqstaticmapdiv",0,0,"absolute",0,0,60,null,null);
this.div.appendChild(this.div.staticmapdiv);
this.div.poidiv=MQA.Util.createParentDiv("mqpoidiv",0,0,"absolute",0,0,90,null,null);
this.div.poidiv.style.cursor="auto";
this.div.poidiv.UNSELECTABLE="off";
this.div.appendChild(this.div.poidiv);
this.rebuildTiles();
this.hasTraffic=false;
this.trafficControlIndex=0;
this.mapShadowTop=document.createElement("div");
this.mapShadowTop.style.background="transparent url(http://img.mqcdn.com/mqmaptiled/mapshadow-top.png) repeat-y scroll 0pt";
this.mapShadowTop.style.height="14px";
this.mapShadowTop.style.left="0pt";
this.mapShadowTop.style.position="absolute";
this.mapShadowTop.style.top="0pt";
this.mapShadowTop.style.width="5000px";
this.mapShadowTop.style.zIndex="20";
this.mapShadowTop.style.display="none";
this.div1.appendChild(this.mapShadowTop);
this.mapShadowLeft=document.createElement("div");
this.mapShadowLeft.style.background="transparent url(http://img.mqcdn.com/mqmaptiled/mapshadow-side.png) repeat-y scroll 0pt";
this.mapShadowLeft.style.height="5000px";
this.mapShadowLeft.style.left="0pt";
this.mapShadowLeft.style.position="absolute";
this.mapShadowLeft.style.top="0pt";
this.mapShadowLeft.style.width="16px";
this.mapShadowLeft.style.zIndex="20";
this.mapShadowLeft.style.display="none";
this.div1.appendChild(this.mapShadowLeft);
this.surface=null;
this.overlayOffsetX=null;
this.overlayOffsetY=null;
this.poisurface=null;
this.poiLineOffsetX=null;
this.poiLineOffsetY=null;
this.dcCanvasDiv=null;
this.dcCanvasContext=null;
this.canvasOffsetX=null;
this.canvasOffsetY=null;
this.infowindow=new MQA.InfoWindow(this);
this.infoWindowTitle=null;
this.infoWindowContent=null;
this.rolloverwindow=new MQA.RolloverWindow(this);
this.rolloversEnabled=true;
this.div1_click=MQA._prEvent.EventCallback(this,"onClick");
this.div1_dblclick=MQA._prEvent.EventCallback(this,"onDoubleClick");
MQA._prEvent.observe(this.div1,"click",this.div1_click);
MQA._prEvent.observe(this.div1,"dblclick",this.div1_dblclick);
this.savedCenter=null;
this.savedZoomLevel=null;
this.savedMapType=null;
this.saveState();
MQA.incrTileMapCount();
this.uniqueMapID=MQA.getTileMapCount();
this.startDragPoint=new MQA.Point(0,0);
this.endDragPoint=new MQA.Point(0,0);
this.draggedObject=null;
this.staticMapEnabled=false;
this.turnEventsOff=false;
this.batchCount=0;
if(_5!=null){
this.showDragableMap();
}
};
MQA.TileMap.prototype._subDispose=function(){
for(var k in this){
try{
delete this[k];
}
catch(e){
}
}
};
MQA.TileMap.prototype.setBatchMode=function(_d){
if(_d){
this.batchCount+=1;
}else{
this.batchCount-=1;
if(this.batchCount<0){
this.batchCount=0;
}
if(this.batchCount==0){
var dc=this.getDeclutter();
if(dc){
dc.setDeclutterMode(dc.getDeclutterMode());
}
}
}
};
MQA.TileMap.prototype.getDragOffset=function(){
return new MQA.Point(this.m_dragoffX,this.m_dragoffY);
};
MQA.TileMap.prototype.onClick=function(e){
if(e.srcObject&&e.srcObject.createFillerDiv){
return;
}
if((this.click)?this.click:false){
var _10=MQA.Util.getParentOffset(this.parent);
var _11=0;
var _12=0;
if(typeof (window.pageYOffset)=="number"){
_12=window.pageYOffset;
_11=window.pageXOffset;
}else{
if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
_12=document.body.scrollTop;
_11=document.body.scrollLeft;
}else{
if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
_12=document.documentElement.scrollTop;
_11=document.documentElement.scrollLeft;
}
}
}
var mqe=new MQA.Event();
mqe.srcObject=e.srcObject;
if(!e.clientX&&e.domEvent){
mqe.domEvent=e.domEvent;
}else{
mqe.domEvent=e;
}
var cx=(mqe.domEvent.clientX+_11)-_10.x;
var cy=(mqe.domEvent.clientY+_12)-_10.y;
mqe.xy=new MQA.Point(cx,cy);
mqe.ll=this.pixToLL(mqe.xy);
mqe.eventName="MQA.TileMap.click";
MQA.EventManager.trigger(this,"click",mqe);
}
};
MQA.TileMap.prototype.onDoubleClick=function(e){
var _17=MQA.Util.getParentOffset(this.parent);
var _18=0;
var _19=0;
if(typeof (window.pageYOffset)=="number"){
_19=window.pageYOffset;
_18=window.pageXOffset;
}else{
if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
_19=document.body.scrollTop;
_18=document.body.scrollLeft;
}else{
if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
_19=document.documentElement.scrollTop;
_18=document.documentElement.scrollLeft;
}
}
}
var mqe=new MQA.Event();
mqe.srcObject=e.srcObject;
if(!e.clientX&&e.domEvent){
mqe.domEvent=e.domEvent;
}else{
mqe.domEvent=e;
}
var cx=(mqe.domEvent.clientX+_18)-_17.x;
var cy=(mqe.domEvent.clientY+_19)-_17.y;
mqe.xy=new MQA.Point(cx,cy);
mqe.ll=this.pixToLL(mqe.xy);
mqe.eventName="MQA.TileMap.dblclick";
MQA.EventManager.trigger(this,"dblclick",mqe);
};
MQA.TileMap.prototype.onZoomStart=function(e){
this.infowindow.setPopupContentOverflow("hidden");
MQA.EventManager.trigger(this,"zoomstart",e);
};
MQA.TileMap.prototype.onZoomEnd=function(e){
this.handleOverlays();
this.infowindow.setPopupContentOverflow("auto");
MQA.EventManager.trigger(this,"zoomend",e);
};
MQA.TileMap.prototype.onMapTypeChanged=function(e){
if(this.getDragOffset().x!=this.overlayOffsetX||this.getDragOffset().y!=this.overlayOffsetY){
this.handleOverlays();
}
MQA.EventManager.trigger(this,"maptypechanged",e);
};
MQA.TileMap.prototype.onPoiAdded=function(e){
MQA.EventManager.trigger(this,"poiadded",e);
};
MQA.TileMap.prototype.onPoiRemoved=function(e){
MQA.EventManager.trigger(this,"poiremoved",e);
};
MQA.TileMap.prototype.onMapCleared=function(e){
MQA.EventManager.trigger(this,"mapcleared",e);
};
MQA.TileMap.prototype.onOverlayAdded=function(e){
MQA.EventManager.trigger(this,"overlayadded",e);
};
MQA.TileMap.prototype.onOverlayRemoved=function(e){
MQA.EventManager.trigger(this,"overlayremoved",e);
};
MQA.TileMap.prototype.onInfoWindowOpen=function(e){
MQA.EventManager.trigger(this,"infowindowopen",e);
};
MQA.TileMap.prototype.onInfoWindowClose=function(e){
MQA.EventManager.trigger(this,"infowindowclose",e);
};
MQA.TileMap.prototype.onMoveStart=function(e){
this.infowindow.setPopupContentOverflow("hidden");
MQA.EventManager.trigger(this,"movestart",e);
};
MQA.TileMap.prototype.onMove=function(e){
MQA.EventManager.trigger(this,"move",e);
};
MQA.TileMap.prototype.onMoveEnd=function(e){
this.infowindow.setPopupContentOverflow("auto");
MQA.EventManager.trigger(this,"moveend",e);
};
MQA.TileMap.prototype.handleMove=function(){
if(arguments.length==1){
var e=new MQA.Event();
var _2b=arguments[0];
if(_2b=="move"){
e.eventName="MQA.TileMap.move";
this.onMove(e);
}else{
if(_2b=="movestart"){
e.eventName="MQA.TileMap.movestart";
this.onMoveStart(e);
}else{
if(_2b=="moveend"){
e.eventName="MQA.TileMap.moveend";
this.onMoveEnd(e);
}
}
}
}
};
MQA.TileMap.prototype.onDragStart=function(e){
this.infowindow.setPopupContentOverflow("hidden");
MQA.EventManager.trigger(this,"dragstart",e);
};
MQA.TileMap.prototype.onDrag=function(e){
MQA.EventManager.trigger(this,"drag",e);
};
MQA.TileMap.prototype.onDragEnd=function(e){
this.infowindow.setPopupContentOverflow("auto");
MQA.EventManager.trigger(this,"dragend",e);
};
MQA.TileMap.prototype.handleDrag=function(){
if(arguments.length==1){
var e=new MQA.Event();
var _30=arguments[0];
if(_30=="drag"){
e.eventName="MQA.TileMap.drag";
this.onDrag(e);
}else{
if(_30=="dragstart"){
e.eventName="MQA.TileMap.dragStart";
this.onDragStart(e);
}else{
if(_30=="dragend"){
e.eventName="MQA.TileMap.dragEnd";
this.onDragEnd(e);
}
}
}
}else{
if(arguments.length==2){
var e=new MQA.Event();
var _30=arguments[0];
if(_30=="dragend"){
var _31=arguments[1];
var _32=MQA.Util.getParentOffset(this.parent);
e.clientX=_31.clientX-_32.x;
e.clientY=_31.clientY-_32.y;
this.endDragPoint=new MQA.Point(e.clientX,e.clientY);
e.dragDirection=this.direction(this.startDragPoint.x,this.startDragPoint.y,this.endDragPoint.x,this.endDragPoint.y);
var _33=this.endDragPoint.x-this.startDragPoint.x;
var _34=this.endDragPoint.y-this.startDragPoint.y;
var _35=this.percentage(0,0,_33,_34,false);
e.dragPercentage=Math.round(Math.sqrt(_35.shiftX*_35.shiftX+_35.shiftY*_35.shiftY));
e.eventName="MQA.TileMap.dragEnd";
this.onDragEnd(e);
}
}
}
};
MQA.TileMap.prototype.direction=function(_36,_37,_38,_39){
var _3a="";
if(_39<_37){
_3a="n";
}else{
if(_39>_37){
_3a="s";
}
}
if(_38>_36){
_3a+="e";
}else{
if(_38<_36){
_3a+="w";
}
}
var _3b=MQA.Util.panAngle(_36,_37,_38,_39);
if(_3a=="ne"){
if(_3b<22){
_3a="e";
}else{
if(_3b>68){
_3a="n";
}
}
}else{
if(_3a=="nw"){
if(_3b<22){
_3a="w";
}else{
if(_3b>68){
_3a="n";
}
}
}else{
if(_3a=="se"){
if(_3b<22){
_3a="e";
}else{
if(_3b>68){
_3a="s";
}
}
}else{
if(_3a=="sw"){
if(_3b<22){
_3a="w";
}else{
if(_3b>68){
_3a="s";
}
}
}
}
}
}
return _3a;
};
MQA.TileMap.prototype.percentage=function(_3c,_3d,_3e,_3f,_40){
var _41={shiftX:0,shiftY:0};
if(parseInt(_3e)>parseInt(_3c)){
_41.shiftX=parseInt(_3e)-parseInt(_3c);
}else{
_41.shiftX=parseInt(_3c)-parseInt(_3e);
}
if(parseInt(_3f)>parseInt(_3d)){
_41.shiftY=parseInt(_3f)-parseInt(_3d);
}else{
_41.shiftY=parseInt(_3d)-parseInt(_3f);
}
if(!_40||typeof (_40)=="undefined"){
_41.shiftY=MQA.Util.calcPercentage(_41.shiftY,this.height);
_41.shiftX=MQA.Util.calcPercentage(_41.shiftX,this.width);
}
return _41;
};
MQA.TileMap.prototype.onTKMouseDown=function(e){
MQA.EventManager.trigger(this,"mousedown",e);
};
MQA.TileMap.prototype.onTKMouseUp=function(e){
MQA.EventManager.trigger(this,"mouseup",e);
};
MQA.TileMap.prototype.handleMouse=function(){
if(arguments.length==2){
var _44=arguments[1];
var str="";
var e=new MQA.Event();
var _47=MQA.Util.getParentOffset(this.parent);
e.button=(MQA._prEvent.isLeftClick(_44))?MQA.BUTTON_MQ_LEFT:MQA.BUTTON_MQ_RIGHT;
e.clientX=_44.clientX-_47.x;
e.clientY=_44.clientY-_47.y;
var _48=arguments[0];
if(_48=="mousedown"){
this.startDragPoint=new MQA.Point(e.clientX,e.clientY);
if(this.surface){
this.overlaydiv.style.cursor=this.current_mousecursor;
}
e.eventName="MQA.TileMap.mouseDown";
this.onTKMouseDown(e);
}else{
if(_48=="mouseup"){
if(this.surface){
this.overlaydiv.style.cursor=this.current_mousecursor;
}
e.eventName="MQA.TileMap.mouseUp";
this.onTKMouseUp(e);
}
}
}
};
MQA.TileMap.prototype.addControl=function(_49,_4a){
_49.initialize(this);
this.controls[_49.type]=_49;
var _4b=_49.elem.style;
if(_4a!=null){
_49.position=_4a;
}
this.parent2.appendChild(_49.elem);
this.placeControl(_49);
_4b.display="block";
_4b.zIndex=0;
};
MQA.TileMap.prototype.removeControl=function(_4c){
if(_4c.destructor){
_4c.destructor();
}
this.parent2.removeChild(_4c.elem);
this.controls[_4c.type]=null;
};
MQA.TileMap.prototype.updateZoom=function(_4d){
if(this.controls[MQA.CONTROL_PANZOOM]!=null){
this.controls[MQA.CONTROL_PANZOOM].setZoom(this.getZoomLevel());
this.controls[MQA.CONTROL_PANZOOM].unselectZoom(0);
}
};
MQA.TileMap.prototype.placeControl=function(_4e){
var pos=_4e.getPosition();
var _50=pos.getMapCorner();
var _51;
var top;
if(_50==MQA.MapCorner.TOP_LEFT){
_51=0;
top=0;
}else{
if(_50==MQA.MapCorner.TOP_RIGHT){
_51=this.width-_4e.getWidth();
top=0;
var _53=arguments;
if(typeof _53[1]=="undefined"){
pos.offsetSize.width*=-1;
}
}else{
if(_50==MQA.MapCorner.BOTTOM_LEFT){
_51=0;
top=this.height-_4e.getHeight();
var _53=arguments;
if(typeof _53[1]=="undefined"){
pos.offsetSize.height*=-1;
}
}else{
if(_50==MQA.MapCorner.BOTTOM_RIGHT){
_51=this.width-_4e.getWidth();
top=this.height-_4e.getHeight();
var _53=arguments;
if(typeof _53[1]=="undefined"){
pos.offsetSize.width*=-1;
pos.offsetSize.height*=-1;
}
}
}
}
}
_51+=pos.offsetSize.width;
top+=pos.offsetSize.height;
_4e.elem.style.left=_51+"px";
_4e.elem.style.top=top+"px";
};
MQA.TileMap.prototype.setLogoZindex=function(_54,_55){
var _56=parseInt(_54);
var _57=parseInt(_55);
var _58=this.logos[_56];
if(_58.style){
_58.style.zIndex=_57;
}
};
MQA.TileMap.prototype.setLogoPlacement=function(_59,_5a){
var _5b=_5a.getMapCorner();
var _5c=Math.abs(_5a.getOffsetSize().getWidth());
var _5d=Math.abs(_5a.getOffsetSize().getHeight());
var _5e=0;
var _5f=0;
if(_5b==MQA.MapCorner.TOP_LEFT){
_5e=_5c;
_5f=_5d;
}else{
if(_5b==MQA.MapCorner.TOP_RIGHT){
_5e=(-_5c);
_5f=_5d;
}else{
if(_5b==MQA.MapCorner.BOTTOM_LEFT){
_5e=_5c;
_5f=(-_5d);
}else{
if(_5b==MQA.MapCorner.BOTTOM_RIGHT){
_5e=(-_5c);
_5f=(-_5d);
}else{
return;
}
}
}
}
_59=parseInt(_59);
_5b=parseInt(_5b);
if(_59>=MQA.LOGO_MQ_LOGO&&_59<=MQA.LOGO_SAT_COPY&&_5b>=MQA.CORNER_TOPLEFT&&_5b<=MQA.CORNER_BOTTOMRIGHT){
this.logos[_59].corner=_5b;
this.logos[_59].offset=new MQA.Point(_5e,_5f);
this.setLogoPosition(this.logos[_59]);
}
};
MQA.TileMap.prototype.addPois=function(_60){
if(_60){
var h=_60.getSize();
for(i=0;i<h;i++){
this.addPoi(_60.getAt(i));
}
}
};
MQA.TileMap.prototype.addPoi=function(_62,_63){
if(this.mypois.contains(_62)){
return;
}
_62.getIcon()._checkInit();
this._addPoi(_62.getLatLng(),_62.getIcon().getAnchorOffset(),_62.getElement());
this.mypois.add(_62);
var e=new MQA.Event("MQA.TileMap.poiAdded");
e.poi=_62;
this.onPoiAdded(e);
_62.redrawLabel();
_62.map=this;
_62.mqrw=this.getRolloverWindow();
_62.mqiw=this.getInfoWindow();
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()!=0){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
}
};
MQA.TileMap.prototype._addPoi=function(_65,_66,_67){
if(this.pois==null){
this.pois=new Array();
}
var xy=this.getLLToXY(_65);
_67.ll=_65;
_67.offset=_66;
_67.style.position="absolute";
_67.style.zIndex=90;
_67.style.left=(xy.x+_66.x-this.m_dragoffX)+"px";
_67.style.top=(xy.y+_66.y-this.m_dragoffY)+"px";
_67.oncontextmenu=MQA._prEvent.falseFunction;
this.pois.push(_67);
this.div.poidiv.appendChild(_67);
};
MQA.TileMap.prototype.removePoi=function(_69){
this._removePoi(_69.element);
this.mypois.removeItem(_69);
var e=new MQA.Event("MQA.TileMap.poiRemoved");
_69.onRemoved(e);
e.poi=_69;
this.onPoiRemoved(e);
_69.map=null;
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()!=0){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
}
};
MQA.TileMap.prototype._removePoi=function(_6b){
var _6c=[];
if(this.pois==null){
return;
}
var j=this.pois.length;
for(var i=0;i<j;i++){
if(this.pois[i]!=_6b){
_6c.push(this.pois[i]);
}else{
if(this.div.poidiv.childNodes.length>0){
this.div.poidiv.removeChild(this.pois[i]);
}
}
}
this.pois.length=0;
this.pois=null;
var k=_6c.length;
for(var i=0;i<k;i++){
if(this.pois==null){
this.pois=new Array();
}
this.pois.push(_6c[i]);
}
_6c=null;
};
MQA.TileMap.prototype.removeAllPois=function(_70){
var _70=(typeof (_70)=="undefined"?false:_70);
if(this.getDeclutter()){
var _71=this.getDeclutter().getDeclutterMode();
}
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()!=0){
this.getDeclutter().setDeclutterMode(0);
}
}
var ptr=0;
while(ptr<this.mypois.getSize()){
if(!this.mypois.getAt(ptr).trafficPOI||_70){
this.removePoi(this.mypois.getAt(ptr));
}else{
ptr++;
}
}
if(this.getDeclutter()){
if(_71!=0){
this.getDeclutter().setDeclutterMode(_71);
}
}
this.onMapCleared(new MQA.Event("MQA.TileMap.mapCleared"));
};
MQA.TileMap.prototype.replacePois=function(_73){
if(this.getDeclutter()){
var dcm=this.getDeclutter().getDeclutterMode();
this.getDeclutter().setDeclutterMode(0);
}
this.removeAllPois();
for(var i=0,j=_73.getSize();i<j;i++){
this.addPoi(_73.getAt(i));
}
if(this.getDeclutter()){
if(dcm!=0){
this.getDeclutter().setDeclutterMode(dcm);
}
}
};
MQA.TileMap.prototype.createDrawingSurface=function(){
try{
if(MQA.Graphics){
this.TILESIZE=MQA.TILESIZE;
this.SURFACE_OFFSET=2*this.TILESIZE;
this.overlayOffsetX=0;
this.overlayOffsetY=0;
this.overlaydiv=document.createElement("div");
this.overlaydiv.id="mqOverlayDiv";
var _77=parseInt(this.div1.style.width);
var _78=parseInt(this.div1.style.height);
var _79=Math.ceil(_77/this.TILESIZE)*this.TILESIZE;
var _7a=Math.ceil(_78/this.TILESIZE)*this.TILESIZE;
var _7b=_79+(2*this.SURFACE_OFFSET);
var _7c=_7a+(2*this.SURFACE_OFFSET);
var _7d=-(this.SURFACE_OFFSET);
var _7e=-(this.SURFACE_OFFSET);
this.overlaydiv.lt=_7d+"px";
this.overlaydiv.tp=_7e+"px";
this.overlaydiv.style.position="absolute";
this.overlaydiv.style.top=_7e+"px";
this.overlaydiv.style.left=_7d+"px";
this.overlaydiv.style.height=_7c+"px";
this.overlaydiv.style.width=_7b+"px";
this.overlaydiv.style.zIndex=70;
this.overlaydiv.UNSELECTABLE="on";
this.overlaydiv.style.MozUserSelect="none";
this.overlaydiv.onselectstart=MQA._prEvent.falseFunction;
this.overlaydiv.style.cursor=this.current_mousecursor;
this.overlaydiv.style.backgroundColor="transparent";
this.overlaydiv.style.background="none";
this.div.appendChild(this.overlaydiv);
this.surface=MQA.Graphics.createSurface(this.overlaydiv,_7b,_7c);
}else{
this.surface=null;
}
}
catch(err){
this.surface=null;
}
};
MQA.TileMap.prototype.createPoiDrawingSurface=function(){
try{
if(MQA.Graphics){
this.TILESIZE=MQA.TILESIZE;
this.SURFACE_OFFSET=2*this.TILESIZE;
this.poiLineOffsetX=0;
this.poiLineOffsetY=0;
this.poilinediv=document.createElement("div");
this.poilinediv.id="mqPoiLineDiv";
var _7f=this.div1.style.width.replace("px","");
var _80=this.div1.style.height.replace("px","");
var _81=Math.ceil(_7f/this.TILESIZE)*this.TILESIZE;
var _82=Math.ceil(_80/this.TILESIZE)*this.TILESIZE;
var _83=_81+(2*this.SURFACE_OFFSET);
var _84=_82+(2*this.SURFACE_OFFSET);
var _85=-(Math.round((_81-_7f)/2)+this.SURFACE_OFFSET);
var _86=-(Math.round((_82-_80)/2)+this.SURFACE_OFFSET);
var _85=-(this.SURFACE_OFFSET);
var _86=-(this.SURFACE_OFFSET);
this.poilinediv.lt=_85+"px";
this.poilinediv.tp=_86+"px";
this.poilinediv.style.position="absolute";
this.poilinediv.style.top=_86+"px";
this.poilinediv.style.left=_85+"px";
this.poilinediv.style.height=_84+"px";
this.poilinediv.style.width=_83+"px";
this.poilinediv.style.zIndex=70;
this.poilinediv.UNSELECTABLE="on";
this.poilinediv.style.MozUserSelect="none";
this.poilinediv.onselectstart=MQA._prEvent.falseFunction;
this.poilinediv.style.cursor=this.current_mousecursor;
this.poilinediv.style.backgroundColor="transparent";
this.poilinediv.style.background="none";
this.div.appendChild(this.poilinediv);
this.poisurface=MQA.Graphics.createSurface(this.poilinediv,_83,_84);
}else{
this.poisurface=null;
}
}
catch(err){
this.poisurface=null;
}
};
MQA.TileMap.prototype.createCanvas=function(){
try{
this.TILESIZE=MQA.TILESIZE;
this.SURFACE_OFFSET=2*this.TILESIZE;
this.canvasOffsetX=0;
this.canvasOffsetY=0;
this.dcCanvasDiv=document.createElement("div");
this.dcCanvasDiv.id="mqCanvasDiv";
var _87=this.div1.style.width.replace("px","");
var _88=this.div1.style.height.replace("px","");
var _89=Math.ceil(_87/this.TILESIZE)*this.TILESIZE;
var _8a=Math.ceil(_88/this.TILESIZE)*this.TILESIZE;
var _8b=_89+(2*this.SURFACE_OFFSET);
var _8c=_8a+(2*this.SURFACE_OFFSET);
var _8d=-(Math.round((_89-_87)/2)+this.SURFACE_OFFSET);
var _8e=-(Math.round((_8a-_88)/2)+this.SURFACE_OFFSET);
var _8d=-(this.SURFACE_OFFSET);
var _8e=-(this.SURFACE_OFFSET);
this.dcCanvasDiv.style.position="absolute";
this.dcCanvasDiv.style.top=_8e+"px";
this.dcCanvasDiv.style.left=_8d+"px";
this.dcCanvasDiv.style.height=_8c+"px";
this.dcCanvasDiv.style.width=_8b+"px";
this.dcCanvasDiv.style.cursor="auto";
this.dcCanvasDiv.style.zIndex=70;
this.dcCanvasDiv.UNSELECTABLE="off";
this.div.appendChild(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){
alert("caught: \n"+err);
this.dcCanvasDiv=null;
this.dcCanvasContext=null;
}
};
MQA.TileMap.prototype.getOverlays=function(){
if(this.myoverlays){
var _90=new MQA.OverlayCollection();
for(var i=0,j=this.myoverlays.getSize();i<j;i++){
_90.add(this.myoverlays.getAt(i));
}
_90.setName(this.myoverlays.getName());
return _90;
}else{
return null;
}
};
MQA.TileMap.prototype.addOverlays=function(_93){
if(_93){
var h=_93.getSize();
for(i=0;i<h;i++){
this.addOverlay(_93.getAt(i));
}
}
};
MQA.TileMap.prototype.addOverlay=function(_95){
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(_95)){
return;
}
_95.map=this;
if(_95.shapePointsXY){
var _96=new MQA.LatLngCollection();
for(var i=0,y=_95.shapePoints.getSize();i<y;i++){
_96.add(this.pixToLL(_95.shapePoints.get(i)));
}
_95.shapePoints=_96;
_95.shapePointsXY=0;
}
this.myoverlays.add(_95);
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{
_95.drawShape();
}
var e=new MQA.Event("MQA.TileMap.overlayAdded");
e.overlay=_95;
this.onOverlayAdded(e);
};
MQA.TileMap.prototype.removeOverlay=function(_9a){
function removeChildrenFromNode(_9b){
if(_9b!==undefined&&_9b!==null){
return;
}
while(_9b.hasChildNodes()){
_9b.removeChild(_9b.firstChild);
}
};
if(!this.getOverlays()){
throw ("overlays.js has not been included.");
}
var i;
if(_9a){
for(i=0;i<this.myoverlays.getSize();i++){
if(_9a==this.myoverlays.getAt(i)){
_9a.onRemoved(e);
if(_9a.className=="MQA.ImageOverlay"&&_9a.shape){
_9a.shape.firstChild.style.width="0px";
_9a.shape.firstChild.style.height="0px";
_9a.shape.firstChild.src="";
_9a.shape.removeChild(_9a.shape.firstChild);
this.overlaydiv.removeChild(_9a.shape);
_9a.shape=null;
}else{
if(_9a.shape){
MQA.Graphics.remove(this.surface,_9a.shape);
}
_9a.shape=null;
}
_9a.map=null;
this.myoverlays.remove(i,1);
var e=new MQA.Event("MQA.TileMap.overlayRemoved");
e.overlay=_9a;
this.onOverlayRemoved(e);
break;
}
}
}
};
MQA.TileMap.prototype.removeAllOverlays=function(){
if(!this.getOverlays()){
throw ("overlays.js has not been included.");
}
while(this.myoverlays.getSize()>0){
this.removeOverlay(this.myoverlays.getAt(0));
}
};
MQA.TileMap.prototype.replaceOverlays=function(_9e){
if(!this.getOverlays()){
throw ("overlays.js has not been included.");
}
var i;
this.removeAllOverlays();
for(i=0;i<_9e.getSize();i++){
this.addOverlay(_9e.getAt(i));
}
this.myoverlays.setName(_9e.getName());
};
MQA.TileMap.prototype.redrawOverlays=function(){
var i,j;
if(!this.getOverlays()){
throw ("mqa.overlay.js has not been included.");
}
for(i=0,j=this.getOverlays().getSize();i<j;i++){
this.getOverlays().getAt(i).redraw();
}
};
MQA.TileMap.prototype.handleOverlays=function(){
if(this.hasTraffic){
if(typeof (this.controls[MQA.CONTROL_TRAFFIC])!="undefined"){
if(this.controls[MQA.CONTROL_TRAFFIC].mode=="on"){
this.controls[MQA.CONTROL_TRAFFIC].traffic.refresh();
this.controls[MQA.CONTROL_TRAFFIC].updateLegend();
}
}
}
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();
}
}
}
};
MQA.TileMap.prototype.handlePoiLines=function(){
if(this.surface){
this.poiLineOffsetX=this.getDragOffset().x;
this.poiLineOffsetY=this.getDragOffset().y;
this.poilinediv.style.left=-(this.SURFACE_OFFSET+this.poiLineOffsetX)+"px";
this.poilinediv.style.top=-(this.SURFACE_OFFSET+this.poiLineOffsetY)+"px";
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()==2){
this.getDeclutter().adjustLeaderLineSurface();
this.getDeclutter().redrawLeaderLines();
}
}
}
};
MQA.TileMap.prototype.getMapType=function(){
return this.tileMode;
};
MQA.TileMap.prototype.pixToLL=function(_a2){
var ll=this.getXYToLL(_a2);
return new MQA.LatLng(ll.lat,ll.lng);
};
MQA.TileMap.prototype.llToPix=function(_a4){
var xy=this.getLLToXY(_a4);
return new MQA.Point(xy.x,xy.y);
};
MQA.TileMap.prototype.setMapType=function(_a6,_a7){
var _a8=this.getMapType();
if(_a8!=_a6){
var _a9="";
switch(_a6){
case "map":
case "sat":
case "hyb":
break;
default:
return;
}
if(_a6=="map"||_a6=="sat"||_a6=="hyb"&&(this.tileMode!=_a6)){
this.sendTransactions();
this.showMap=false;
this.showSat=false;
this.showHyb=false;
this.div.mapdiv.style.display="none";
this.div.satdiv.style.display="none";
this.div.hybdiv.style.display="none";
if(_a6=="map"){
this.showMap=true;
this.div.mapdiv.style.display="block";
this.logos[MQA.LOGO_MAP_COPY].style.display="block";
this.logos[MQA.LOGO_SAT_COPY].style.display="none";
this.tileNode="MQMAP";
}
if(_a6=="sat"){
this.showSat=true;
this.div.satdiv.style.display="block";
this.logos[MQA.LOGO_MAP_COPY].style.display="none";
this.logos[MQA.LOGO_SAT_COPY].style.display="block";
this.tileNode="MQSAT";
}
if(_a6=="hyb"){
this.showSat=true;
this.showHyb=true;
this.div.satdiv.style.display="block";
this.div.hybdiv.style.display="block";
this.logos[MQA.LOGO_MAP_COPY].style.display="block";
this.logos[MQA.LOGO_SAT_COPY].style.display="block";
this.tileNode="MQHYB";
}
this.tileMode=_a6;
_a7=(typeof (_a7)=="undefined")?false:_a7;
if(!_a7){
var _aa=this.getCenterLatLng();
this.centerlat=_aa.lat;
this.centerlng=_aa.lng;
this.rebuildTiles();
}
}
this.redrawOverlays();
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()==2){
this.getDeclutter().resetDraggedPois();
this.getDeclutter().redrawLeaderLines();
}
}
if(this.controls[MQA.CONTROL_TYPE]!=null){
this.controls[MQA.CONTROL_TYPE].updateControl(_a6);
}
var evt=new MQA.Event("MQA.TileMap.mapTypeChanged");
evt.prevMapType=_a8;
evt.mapType=_a6;
this.onMapTypeChanged(evt);
}
};
MQA.TileMap.prototype.zoomIn=function(){
var _ac=this.getZoomLevel();
_ac++;
this.setZoomLevel(_ac);
};
MQA.TileMap.prototype.zoomOut=function(){
var _ad=this.getZoomLevel();
_ad--;
this.setZoomLevel(_ad);
};
MQA.TileMap.prototype.setZoomLevel=function(_ae){
var _af=this.getZoomLevel();
var evt=new MQA.Event("MQA.TileMap.zoomStart");
evt.zoom=_af;
this.onZoomStart(evt);
this._setZoomLevel(_ae);
this.updateZoom("on");
var e=new MQA.Event("MQA.TileMap.zoomEnd");
e.prevZoom=_af;
e.zoom=this.getZoomLevel();
this.onZoomEnd(e);
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()!=0){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
}
};
MQA.TileMap.prototype._setZoomLevel=function(_b2){
_b2=parseInt(_b2);
if(_b2<1||_b2>16||this.drag||this.slide||_b2==this.zoom){
return;
}
var _b3=this.getCenterLatLng();
this.sendTransactions();
this.centerlat=_b3.lat;
this.centerlng=_b3.lng;
this.zoom=_b2;
this.scale=MQA.SCALES[this.zoom];
this.rebuildTiles();
};
MQA.TileMap.prototype.getZoomLevel=function(){
return this.zoom;
};
MQA.TileMap.prototype.zoomToRect=function(_b4,_b5,_b6,_b7){
var _b8=this.getZoomLevel();
if(_b5==null){
_b5=false;
}
if(_b6==null){
_b6=1;
}
if(_b7==null){
_b7=16;
}
var evt=new MQA.Event("MQA.TileMap.zoomStart");
evt.zoom=_b8;
this.onZoomStart(evt);
this.updateZoom("off");
this._bestFit(_b4,_b5,_b6,_b7);
this.updateZoom("on");
var e=new MQA.Event("MQA.TileMap.zoomEnd");
e.prevZoom=_b8;
e.zoom=this.getZoomLevel();
this.onZoomEnd(e);
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()!=0){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
}
};
MQA.TileMap.prototype.getScale=function(){
return this.getScaleFromZoom(this.getZoomLevel());
};
MQA.TileMap.prototype.getScaleFromZoom=function(_bb){
var i=(_bb)?(((_bb>=1)&&(_bb<=16))?_bb:0):0;
return MQA.SCALES[i];
};
MQA.TileMap.prototype.bestFit=function(_bd,_be,_bf){
var _c0=this.getZoomLevel();
if(this.pois==null){
return;
}
if(_bd==null){
_bd=false;
}
if(_be==null){
_be=1;
}
if(_bf==null){
_bf=16;
}
var evt=new MQA.Event("MQA.TileMap.zoomStart");
evt.zoom=_c0;
this.onZoomStart(evt);
this.updateZoom("off");
var _c2=new MQA.RectLL(new MQA.PointLL(this.pois[0].ll.lat,this.pois[0].ll.lng),new MQA.PointLL(this.pois[0].ll.lat,this.pois[0].ll.lng));
var j=this.pois.length;
for(var i=1;i<j;i++){
var _c5=this.pois[i].ll;
if(_c5.lat>_c2.ul.lat){
_c2.ul.lat=_c5.lat;
}
if(_c5.lng<_c2.ul.lng){
_c2.ul.lng=_c5.lng;
}
if(_c5.lat<_c2.lr.lat){
_c2.lr.lat=_c5.lat;
}
if(_c5.lng>_c2.lr.lng){
_c2.lr.lng=_c5.lng;
}
}
this._bestFit(_c2,_bd,_be,_bf);
this.updateZoom("on");
var e=new MQA.Event("MQA.TileMap.zoomEnd");
e.prevZoom=_c0;
e.zoom=this.getZoomLevel();
this.onZoomEnd(e);
if(this.getDeclutter()){
if(this.getDeclutter().getDeclutterMode()!=0){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
}
};
MQA.TileMap.prototype._bestFit=function(_c7,_c8,_c9,_ca){
var _cb,_cc,_cd,_ce,_cf,_d0;
if(_c8==null){
_c8=false;
}
if(_c9==null){
_cf=1;
}else{
_c9=parseInt(_c9);
if(_c9<1||_c9>15){
_cf=1;
}else{
_cf=_c9+1;
}
}
if(_ca==null){
_d0=16;
}else{
_ca=parseInt(_ca);
if(_ca<1||_ca>16){
_d0=16;
}else{
_d0=_ca;
}
if(_d0<_cf){
_d0=_cf+1;
}
}
if(_c7.ul.x){
_cb=new MQA.PointXY(_c7.ul.x,_c7.ul.y);
_cc=new MQA.PointXY(_c7.lr.x,_c7.lr.y);
_cd=this.getXYToLL(new MQA.PointXY(_c7.ul.x,_c7.ul.y));
_ce=this.getXYToLL(new MQA.PointXY(_c7.lr.x,_c7.lr.y));
}else{
_cb=this.getLLToXY(new MQA.PointLL(_c7.ul.lat,_c7.ul.lng));
_cc=this.getLLToXY(new MQA.PointLL(_c7.lr.lat,_c7.lr.lng));
_cd=new MQA.PointLL(_c7.ul.lat,_c7.ul.lng);
_ce=new MQA.PointLL(_c7.lr.lat,_c7.lr.lng);
}
var _d1=Math.abs(_ce.lng-_cd.lng)*(MQA.PIXERSPERLNGDEGREE/this.scale);
var _d2=Math.abs(_ce.lat-_cd.lat)*(MQA.PIXERSPERLATDEGREE/this.scale);
if(_c8==true){
var _d3=this.getCenterLatLng();
var _d4=Math.max(Math.abs(_d3.lng-_cd.lng),Math.abs(_d3.lng-_ce.lng));
var _d5=Math.max(Math.abs(_d3.lat-_cd.lat),Math.abs(_d3.lat-_ce.lat));
_d1=(_d4*2)*(MQA.PIXERSPERLNGDEGREE/this.scale);
_d2=(_d5*2)*(MQA.PIXERSPERLNGDEGREE/this.scale);
}
var _d6=(this.bestFitMargin<(this.width/2)&&this.bestFitMargin<(this.height/2)?this.bestFitMargin:Math.round(Math.min(((this.width/2)-1),((this.height/2)-1))));
var _d7=Math.max((this.scale*(_d1/(this.width-(_d6*2)))),(this.scale*(_d2/(this.height-(_d6*2)))));
while(_d7<MQA.SCALES[_cf]&&_cf<=_d0){
_cf++;
}
if(_c8==true){
this._setZoomLevel((_cf-1));
}else{
this.setCenterLatLngZoomLevel(new MQA.PointLL(((_cd.lat+_ce.lat)/2),((_cd.lng+_ce.lng)/2)),(_cf-1));
}
};
MQA.TileMap.prototype.bestFitLL=function(_d8,_d9,_da,_db){
if(!_d8.length){
return;
}
if(_d9==null){
_d9=false;
}
if(_da==null){
_da=1;
}
if(_db==null){
_db=16;
}
var _dc=new MQA.RectLL(_d8[0],_d8[0]);
_dc.setBounds(_d8);
this.zoomToRect(_dc,_d9,_da,_db);
};
MQA.TileMap.prototype.getCenter=function(){
var ll=this.getCenterLatLng();
return new MQA.LatLng(ll.lat,ll.lng);
};
MQA.TileMap.prototype.setCenter=function(_de,_df){
if(_df==null){
this.setCenterLatLng(_de);
}else{
var _e0=this.getZoomLevel();
var evt=new MQA.Event("MQA.TileMap.zoomStart");
evt.zoom=_e0;
this.onZoomStart(evt);
this.updateZoom("off");
this.setCenterLatLngZoomLevel(_de,_df);
this.updateZoom("on");
var e=new MQA.Event("MQA.TileMap.zoomEnd");
e.prevZoom=_e0;
e.zoom=this.getZoomLevel();
this.onZoomEnd(e);
}
if(this.getDeclutter()){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
if(this.surface){
this.redrawOverlays();
}
};
MQA.TileMap.prototype.panToLatLng=function(_e3){
var pnt=this.llToPix(_e3);
if((pnt.getX()>-100&&pnt.getX()<this.width+100)||(pnt.getY()>-100&&pnt.getY()<this.height+100)){
this.slideMapToPoint(pnt);
}else{
this.setCenter(_e3);
}
};
MQA.TileMap.prototype.getRolloverWindow=function(){
return this.rolloverwindow;
};
MQA.TileMap.prototype.getInfoWindow=function(){
return this.infowindow;
};
MQA.TileMap.prototype.setInfoTitleHTML=function(_e5){
var _e6=document.createElement("div");
_e6.innerHTML="<div>"+_e5+"</div>";
this.infoWindowTitle=_e6;
};
MQA.TileMap.prototype.setInfoContentHTML=function(_e7){
var _e8=document.createElement("div");
_e8.innerHTML="<div>"+_e7+"</div>";
this.infoWindowContent=_e8;
};
MQA.TileMap.prototype.setInfoTitleElement=function(_e9){
this.infoWindowTitle=_e9;
};
MQA.TileMap.prototype.setInfoContentElement=function(_ea){
this.infoWindowContent=_ea;
};
MQA.TileMap.prototype.openInfoWindow=function(_eb){
if(this.iwparent.parentNode){
this._removePoi(this.iwparent);
}
this._addPoi(this.pixToLL(_eb),new MQA.Point(0,0),this.iwparent);
this.iwparent.appendChild(this.infowindow.popup);
this.infowindow.modify(_eb,this.infoWindowTitle,this.infoWindowContent,new MQA.Point(-7,-14));
this.infowindow.setOpenerAndShow(this);
this.onInfoWindowOpen(new MQA.Event("MQA.TileMap.infoWindowOpen"));
};
MQA.TileMap.prototype.setRolloversEnabled=function(_ec){
this.rolloversEnabled=_ec;
};
MQA.TileMap.prototype.getRolloversEnabled=function(){
return this.rolloversEnabled;
};
MQA.TileMap.prototype.enableDragging=function(_ed){
this.disabled=(!_ed==true);
};
MQA.TileMap.prototype.getDragEnabled=function(){
return !this.disabled;
};
MQA.TileMap.prototype.getPois=function(_ee){
_ee=(typeof (_ee)!="undefined"?_ee:false);
var _ef=new MQA.PoiCollection;
for(var i=0,j=this.mypois.getSize();i<j;i++){
if(!this.mypois.getAt(i).trafficPOI||_ee){
_ef.add(this.mypois.getAt(i));
}
}
return _ef;
};
MQA.TileMap.prototype.getSize=function(){
return new MQA.Size(this.div1.style.width,this.div1.style.height);
};
MQA.TileMap.prototype.setSize=function(_f2){
if(typeof (_f2)=="undefined"){
var _f2={};
}
var w=(typeof (_f2.width)=="undefined")?this.parent2.clientWidth:_f2.width;
var h=(typeof (_f2.height)=="undefined")?this.parent2.clientHeight:_f2.height;
var _f5=new MQA.Size(w,h);
if(_f5.width==this.width&&_f5.height==this.height){
return;
}
var _f6=this.getCenterLatLng();
this.width=parseInt(_f5.width);
this.height=parseInt(_f5.height);
if(this.width>MQA.MAXMAPWIDTH){
this.width=MQA.MAXMAPWIDTH;
}
if(this.height>MQA.MAXMAPHEIGHT){
this.height=MQA.MAXMAPHEIGHT;
}
this.centerlat=_f6.lat;
this.centerlng=_f6.lng;
this.maprows=Math.ceil(this.height/this.tilesize)+2;
this.mapcols=Math.ceil(this.width/this.tilesize)+2;
this.drag=false;
this.slide=false;
this.parent.style.width=this.width+"px";
this.parent.style.height=this.height+"px";
var j=this.logos.length;
for(i=0;i<j;i++){
this.setLogoPosition(this.logos[i]);
}
this.tiles=null;
while(this.div.mapdiv.hasChildNodes()){
this.div.mapdiv.removeChild(this.div.mapdiv.firstChild);
}
while(this.div.satdiv.hasChildNodes()){
this.div.satdiv.removeChild(this.div.satdiv.firstChild);
}
while(this.div.hybdiv.hasChildNodes()){
this.div.hybdiv.removeChild(this.div.hybdiv.firstChild);
}
this.div.ldiv.style.width=(this.mapcols*MQA.TILESIZE)+"px";
this.div.ldiv.style.height=(this.maprows*MQA.TILESIZE)+"px";
this.sendTransactions();
this.rebuildTiles();
var _f8=this.getDeclutter().getDeclutterMode();
if(_f8!=0){
this.getDeclutter().setDeclutterMode(0);
this.getDeclutter().setDeclutterMode(_f8);
}
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);
if(x==MQA.CONTROL_TRAFFIC){
this.controls[x].placeLegendControl();
}
}
}
};
MQA.TileMap.prototype.getRectFromMapState=function(_fb){
try{
var _fc=new MQMapState();
_fc=null;
}
catch(e){
throw "The JSAPI must be included to use this function.";
return;
}
if(_fb==null){
return;
}
var _fd=parseFloat(_fb.getCenter().getLatitude());
var _fe=parseFloat(_fb.getCenter().getLongitude());
var _ff=_fb.getHeightPixels();
var _100=_fb.getWidthPixels();
var _101=_fb.getMapScale();
var _102=(_ff/2)/(MQA.PIXERSPERLATDEGREE/_101);
var _103=(_100/2)/(MQA.PIXERSPERLNGDEGREE/_101);
_102=parseInt(_102*1000000)/1000000;
_103=parseInt(_103*1000000)/1000000;
var ul=new MQA.LatLng(_fd+_102,_fe-_103);
var lr=new MQA.LatLng(_fd-_102,_fe+_103);
return new MQA.RectLL(ul,lr);
};
MQA.TileMap.prototype.addRouteHighlight=function(_106,_107,_108,_109,_10a,_10b,_10c){
var _10d=this.getZoomLevel();
var evt=new MQA.Event("MQA.TileMap.zoomStart");
evt.zoom=_10d;
this.onZoomStart(evt);
this.updateZoom("off");
this.routerect=_106;
this.rteserver=_107;
if(_108==null){
this.rtesession="";
}else{
this.rtesession=_108.toString();
}
if(this.routerect.ul.lat<this.routerect.lr.lat){
var _10f=this.routerect.ul.lat;
this.routerect.ul.lat=this.routerect.lr.lat;
this.routerect.lr.lat=_10f;
}
if(this.routerect.ul.lng>this.routerect.lr.lng){
var _110=this.routerect.ul.lng;
this.routerect.ul.lng=this.routerect.lr.lng;
this.routerect.lr.lng=_110;
}
this.showRte=true;
if(_109==null||_109==false){
this.getNewRouteHighlight();
}else{
if(_10a==null){
_10a=false;
}
if(_10b==null){
_10b=1;
}
if(_10c==null){
_10c=16;
}
this.bestFitRoute(_10a,_10b,_10c);
}
this.updateZoom("on");
var e=new MQA.Event("MQA.TileMap.zoomEnd");
e.prevZoom=_10d;
e.zoom=this.getZoomLevel();
this.onZoomEnd(e);
if(this.getDeclutter()){
this.getDeclutter().setDeclutterMode(this.getDeclutter().getDeclutterMode());
}
};
MQA.TileMap.prototype.getRouteSession=function(){
return this.rtesession;
};
MQA.TileMap.prototype.getBounds=function(){
var ulLL=this.pixToLL(new MQA.Point(0,0));
var lrLL=this.pixToLL(new MQA.Point(this.div1.style.width,this.div1.style.height));
return new MQA.RectLL(ulLL,lrLL);
};
MQA.TileMap.prototype.restoreState=function(){
this.setCenter(this.savedCenter);
this.setZoomLevel(this.savedZoomLevel);
this.setMapType(this.savedMapType);
};
MQA.TileMap.prototype.saveState=function(){
this.savedCenter=this.getCenter();
this.savedZoomLevel=this.getZoomLevel();
this.savedMapType=this.getMapType();
};
MQA.TileMap.prototype.removeRouteHighlight=function(){
this.showRte=false;
this.routerect=null;
this.rtehighlight.style.display="none";
this.rtesession="";
};
MQA.TileMap.prototype.getDeclutter=function(){
return this.mydeclutter;
};
MQA.TileMap.prototype.showDragableMap=function(){
this.getPoiDiv().style.zIndex=90;
if(MQA.browser.name=="safari"&&this.dcCanvasDiv){
this.dcCanvasDiv.style.zIndex=70;
}
this.div1.style.zIndex=0;
if(this.staticMapEnabled){
this.rebuildTiles(true);
}
if(this.getRouteSession()!=""){
var _114=(this.bestFitRect!=null)?this.bestFitRect:this.routerect;
this.addRouteHighlight(_114,this.rteserver,this.getRouteSession(),this.routebestfit);
}
this.getLoadingDiv().style.zIndex=-1;
},MQA.TileMap.prototype.showStaticMap=function(){
this.getLoadingDiv().style.zIndex=110;
this.div1.style.zIndex=100;
this.setLogoZindex(MQA.MapLogo.MAPQUEST_COPYRIGHT,-100);
this.setLogoZindex(MQA.MapLogo.MAPQUEST,-100);
this.setLogoZindex(MQA.MapLogo.SCALES,-100);
this.setLogoZindex(MQA.MapLogo.ICUBED_COPYRIGHT,-100);
this.setLogoZindex(MQA.MapLogo.NAVTEQ_COPYRIGHT,-100);
this.turnEventsOff=true;
var _115={type:this.getMapType(),size:this.getSize().toString(),scale:this.getScale(),center:this.getCenter(),key:Key};
if(this.getRouteSession()!=""){
_115.session=this.getRouteSession();
}
if(IsDotCom){
var _116="";
if(this.hasTraffic){
if(typeof (this.controls[MQA.CONTROL_TRAFFIC])!="undefined"){
_116+="&traffic=";
var _117=this.controls[MQA.CONTROL_TRAFFIC].traffic.getIncidentType();
switch(_117){
case MQA.TRAFFIC_NONE:
_116+=4;
break;
case MQA.TRAFFIC_CONSTRUCTION:
_116+=3;
break;
case MQA.TRAFFIC_INCIDENTS:
_116+=2;
break;
case MQA.TRAFFIC_ALL:
_116+=1;
break;
}
}
}
this.getPoiDiv().style.zIndex=-100;
if(MQA.browser.name=="safari"&&this.dcCanvasDiv){
this.dcCanvasDiv.style.zIndex=-100;
}
this.getDeclutter().removeLeaderLines();
_115.stops=_115.pois="";
var _118=this.getPois();
for(var i=0,j=_118.getSize();i<j;i++){
var _11b=_118.getAt(i);
var _11c=(_11b.dragLeft==null)?0:((-1*_11b.dragLeft)-_11b.mqMapIcon.getAnchorOffset().getX());
var _11d=(_11b.dragTop==null)?0:((-1*_11b.dragTop)-_11b.mqMapIcon.getAnchorOffset().getY());
switch(_11b.getKey()){
case "mcenter":
case "scenter":
case "ecenter":
case "pcenter":
_115[_11b.getKey()]=_11b.getLatLng().toString()+","+_11c+","+_11d;
break;
default:
var _11e=_11b.getKey().split("-");
switch(_11e[0]){
case "stops":
case "pois":
_115[_11e[0]]+=_11e[1].toUpperCase()+","+_11b.getLatLng().toString()+","+_11c+","+_11d+"|";
break;
}
break;
}
}
}
var _11f=MQA.getStaticMapResources()+"?";
for(var nv in _115){
_11f+=(_115[nv]!="")?nv+"="+_115[nv]+"&":"";
}
_11f+="rand="+(Math.round((Math.random()*10000)));
_11f+=_116;
if(this.staticMapImg){
var _121=this.staticMapImg.src;
if(_121.split("&rand=")[0]==_11f.split("&rand=")[0]){
this.staticMapImg.style.display="block";
this.getLoadingDiv().style.zIndex=0;
this.staticMapEnabled=true;
return _121;
}
}
var _122=this.getSize().toString().split(",");
var _123=this.getStaticMapDiv();
_123.style.top=(0-this.getDragOffset().y)+"px";
_123.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="";
_123.appendChild(this.staticMapImg);
}
this.staticMapImg.style.width=_122[0]+"px";
this.staticMapImg.style.height=_122[1]+"px";
this.staticMapImg.src=_11f;
this.staticMapImg.style.display="block";
this.staticMapEnabled=true;
this.getLoadingDiv().style.zIndex=0;
};
MQA.TileMap.prototype.hideStaticMap=function(){
if(!this.staticMapEnabled){
return;
}
this.turnEventsOff=false;
if(!(this.tiles!=null)){
this.showDragableMap();
}
if(this.staticMapImg){
this.staticMapImg.style.display="none";
MQA.Util._nukeChildren(this.staticMapImg.parentNode);
this.staticMapImg=null;
this.div1.style.zIndex=0;
this.getPoiDiv().style.zIndex=90;
if(MQA.browser.name=="safari"&&this.dcCanvasDiv){
this.dcCanvasDiv.style.zIndex=70;
}
this.setLogoZindex(MQA.MapLogo.MAPQUEST_COPYRIGHT,22);
this.setLogoZindex(MQA.MapLogo.MAPQUEST,22);
this.setLogoZindex(MQA.MapLogo.SCALES,22);
this.setLogoZindex(MQA.MapLogo.ICUBED_COPYRIGHT,22);
this.setLogoZindex(MQA.MapLogo.NAVTEQ_COPYRIGHT,22);
this.getDeclutter().redrawLeaderLines();
}
this.staticMapEnabled=false;
};
MQA.TileMap.prototype.setBestFitMargin=function(_124){
this.bestFitMargin=_124;
};
MQA.TileMap.prototype.getBestFitMargin=function(){
return this.bestFitMargin;
};
MQA.TileMap.prototype.dispose=function(){
var _125=true;
var _126=true;
var dan=true;
MQA._prEvent.delDtor(this._dth);
this.brokerKey=null;
MQA._prEvent.stopObserving(this.div1,"click",this.div1_click);
MQA._prEvent.stopObserving(this.div1,"dblclick",this.div1_dblclick);
this.div1_click=null;
this.div1_dblclick=null;
MQA._prEvent.stopObserving(document,"mousemove",this.document_mousemove);
MQA._prEvent.stopObserving(document,"mouseup",this.document_mouseup);
MQA._prEvent.stopObserving(document,"mouseout",this.document_mouseout);
MQA._prEvent.stopObserving(this.parent,"mouseover",this.parent_mouseover);
MQA._prEvent.stopObserving(this.parent,"mousedown",this.parent_mousedown);
this.document_mousemove=null;
this.document_mouseup=null;
this.document_mouseout=null;
this.parent_mouseover=null;
this.parent_mousedown=null;
if(this.controls[MQA.CONTROL_TYPE]&&this.controls[MQA.CONTROL_TYPE].dispose){
this.controls[MQA.CONTROL_TYPE].dispose();
this.controls[MQA.CONTROL_TYPE]=null;
}
if(this.controls[MQA.CONTROL_PANZOOM]&&this.controls[MQA.CONTROL_PANZOOM].dispose){
this.controls[MQA.CONTROL_PANZOOM].dispose();
this.controls[MQA.CONTROL_PANZOOM]=null;
}
if(this.controls[MQA.CONTROL_ZOOM]&&this.controls[MQA.CONTROL_ZOOM].dispose){
this.controls[MQA.CONTROL_ZOOM].dispose();
this.controls[MQA.CONTROL_ZOOM]=null;
}
if(this.controls[MQA.CONTROL_PAN]&&this.controls[MQA.CONTROL_PAN].dispose){
this.controls[MQA.CONTROL_PAN].dispose();
this.controls[MQA.CONTROL_PAN]=null;
}
if(this.controls[MQA.CONTROL_TRAFFIC]&&this.controls[MQA.CONTROL_TRAFFIC].dispose){
this.controls[MQA.CONTROL_TRAFFIC].dispose();
this.controls[MQA.CONTROL_TRAFFIC]=null;
}
this.controls=null;
if(this.pois){
for(var t=0,j=this.pois.length;t<j;t++){
if(_125){
this.pois[t].innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.pois[t]);
}
this.pois[t]=null;
}
}
this.pois=null;
if(this.mypois){
for(var i=0,j=this.mypois.getSize();i<j;i++){
this.mypois.getAt(i).dispose();
}
this.mypois.removeAll();
}
this.mypois=null;
if(this.flowImage){
if(dan){
MQA.Util._deleteDOMObject(this.flowImage);
}
this.flowImage=null;
}
if(this.prnstyle.styleSheet){
this.prnstyle.styleSheet.cssText="";
if(_125){
this.prnstyle.styleSheet.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.prnstyle.styleSheet);
}
if(dan){
MQA.Util._deleteDOMObject(this.prnstyle);
}
}else{
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.prnstyle);
}
if(dan){
MQA.Util._deleteDOMObject(this.prnstyle);
}
}
this.prnstyle=null;
this.infowindow.dispose();
this.infowindow=null;
if(_125){
this.iwparent.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.iwparent);
}
if(dan){
MQA.Util._deleteDOMObject(this.iwparent);
}
this.iwparent=null;
this.infoWindowTitle=null;
this.infoWindowContent=null;
this.rolloverwindow.dispose();
this.rolloverwindow=null;
if(_125){
this.div.ldiv.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div.ldiv);
}
if(dan){
MQA.Util._deleteDOMObject(this.div.ldiv);
}
this.div.ldiv=null;
if(_125){
this.div.mapdiv.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div.mapdiv);
}
if(dan){
MQA.Util._deleteDOMObject(this.div.mapdiv);
}
this.div.mapdiv=null;
if(_125){
this.div.satdiv.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div.satdiv);
}
if(dan){
MQA.Util._deleteDOMObject(this.div.satdiv);
}
this.div.satdiv=null;
if(_125){
this.div.hybdiv.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div.hybdiv);
}
if(dan){
MQA.Util._deleteDOMObject(this.div.hybdiv);
}
this.div.hybdiv=null;
if(_125){
this.div.staticmapdiv.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div.staticmapdiv);
}
if(dan){
MQA.Util._deleteDOMObject(this.div.staticmapdiv);
}
this.div.staticmapdiv=null;
if(_125){
this.div.poidiv.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div.poidiv);
}
if(dan){
MQA.Util._deleteDOMObject(this.div.poidiv);
}
this.div.poidiv=null;
if(_125){
this.div.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div);
}
if(dan){
MQA.Util._deleteDOMObject(this.div);
}
this.div=null;
if(_125){
this.div1.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.div1);
}
if(dan){
MQA.Util._deleteDOMObject(this.div1);
}
this.div1=null;
for(var a=0;a<this.mapcols;a++){
for(var b=0;b<this.maprows;b++){
this.tiles[a][b].dispose();
this.tiles[a][b].innerHTML=null;
MQA.Util._setOuterHTMLToEmptyString(this.tiles[a][b]);
this.tiles[a][b]=null;
}
}
this.tiles=null;
if(_125){
this.parent.innerHTML=null;
}
if(_126){
MQA.Util._setOuterHTMLToEmptyString(this.parent);
}
if(dan){
MQA.Util._deleteDOMObject(this.parent);
}
this.parent=null;
var logo;
for(var i=0;i<this.logos.length;i++){
logo=this.logos[i];
MQA.Util._deleteDOMObject(logo);
logo=null;
}
this.logos=null;
if(dan){
MQA.Util._deleteDOMObject(this.loading);
}
this.loading=null;
this.rtehighlight.onload=null;
if(dan){
MQA.Util._deleteDOMObject(this.rtehighlight);
}
this.rtehighlight=null;
delete this.prnstyle;
delete this.logos;
delete this.maptiler;
delete this.hybtiler;
delete this.sattiler;
delete this.loading;
delete this.div1;
delete this.parent;
delete this.rtehighlight;
this._subDispose();
this.sendTransactions(true);
};
MQA.TileMap.prototype.getZoom=function(RECT,_12f,_130,_131,_132,SIZE){
var SIZE=(typeof (SIZE)!="undefined")?SIZE:this.getSize();
if(_130==null){
_130=false;
}
if(_131==null){
_131=1;
}else{
_131=parseInt(_131);
if(_131<1||_131>15){
_131=1;
}
}
if(_132==null){
_132=16;
}else{
_132=parseInt(_132);
if(_132<1||_132>16){
_132=16;
}
if(_132<_131){
_132=_131+1;
}
}
var zoom=_131;
var _135=_132;
var _136=new MQA.PointFloatXY((RECT.ul.lng+180)*(MQA.PIXERSPERLNGDEGREE/MQA.SCALES[zoom]),(RECT.ul.lat+90)*(MQA.PIXERSPERLATDEGREE/MQA.SCALES[zoom]));
var _137=new MQA.PointFloatXY((RECT.lr.lng+180)*(MQA.PIXERSPERLNGDEGREE/MQA.SCALES[zoom]),(RECT.lr.lat+90)*(MQA.PIXERSPERLATDEGREE/MQA.SCALES[zoom]));
var _138=new MQA.PointLL(RECT.ul.lat,RECT.ul.lng);
var _139=new MQA.PointLL(RECT.lr.lat,RECT.lr.lng);
var _13a=Math.abs(_139.lng-_138.lng)*(MQA.PIXERSPERLNGDEGREE/MQA.SCALES[zoom]);
var _13b=Math.abs(_139.lat-_138.lat)*(MQA.PIXERSPERLATDEGREE/MQA.SCALES[zoom]);
if(_130==true){
var ptXY=new MQA.PointFloatXY((_12f.lng+180)*(MQA.PIXERSPERLNGDEGREE/MQA.SCALES[zoom]),(_12f.lat+90)*(MQA.PIXERSPERLATDEGREE/MQA.SCALES[zoom]));
var _13d=Math.max(Math.abs(ptXY.x-_136.x),Math.abs(ptXY.x-_137.x));
var _13e=Math.max(Math.abs(ptXY.y-_136.y),Math.abs(ptXY.y-_137.y));
_13a=_13d*2;
_13b=_13e*2;
}
var _13f=(this.bestFitMargin<(SIZE.width/2)&&this.bestFitMargin<(SIZE.height/2)?this.bestFitMargin:Math.round(Math.min(((SIZE.width/2)-1),((SIZE.height/2)-1))));
var _140=Math.max((MQA.SCALES[zoom]*(_13a/(SIZE.width-(_13f*2)))),(MQA.SCALES[zoom]*(_13b/(SIZE.height-(_13f*2)))));
if(_140>MQA.SCALES[zoom]){
return zoom;
}
while(_140<MQA.SCALES[zoom]&&zoom<=_135){
zoom++;
}
return zoom-1;
};
MQA.TileMap.prototype.rebuildTiles=function(_141){
this.lastlat=this.centerlat;
this.lastlng=this.centerlng;
this.m_centerX=MQA.getColTile(this.centerlng,this.scale);
this.m_centerY=MQA.getRowTile(this.centerlat,this.scale);
this.m_offsetX=MQA.getColTileOffset(this.centerlng,this.scale);
this.m_offsetY=this.tilesize-MQA.getRowTileOffset(this.centerlat,this.scale);
this.m_intoffX=Math.floor(this.m_offsetX);
this.m_intoffY=Math.floor(this.m_offsetY);
this.m_layoffX=parseInt(this.width/2)-this.m_intoffX;
this.m_layoffY=parseInt(this.height/2)-this.m_intoffY;
this.m_shiftX=0;
this.m_shiftY=0;
while(this.m_layoffX<0){
this.m_layoffX+=this.tilesize;
this.m_shiftX--;
this.m_centerX++;
}
while(this.m_layoffY<0){
this.m_layoffY+=this.tilesize;
this.m_shiftY--;
this.m_centerY--;
}
while(this.m_layoffX>2*this.tilesize){
this.m_layoffX-=this.tilesize;
this.m_shiftX++;
this.m_centerX--;
}
while(this.m_layoffY>2*this.tilesize){
this.m_layoffY-=this.tilesize;
this.m_shiftY++;
this.m_centerY++;
}
this.m_tileofX=this.m_layoffX;
this.m_tileofY=this.m_layoffY;
while(this.m_tileofX>this.tilesize){
this.m_tileofX-=this.tilesize;
}
while(this.m_tileofY>this.tilesize){
this.m_tileofY-=this.tilesize;
}
this.m_dragoffX=0;
this.m_dragoffY=0;
this.m_tileoffX=0;
this.m_tileoffY=0;
this.m_routeoffX=0;
this.m_routeoffY=0;
this.m_transoffX=0;
this.m_transoffY=0;
this.m_scrollofX=0;
this.m_scrollofY=0;
this.diffaccum=0;
this.div.lt=0;
this.div.tp=0;
this.div.style.left=this.div.lt+"px";
this.div.style.top=this.div.tp+"px";
_141=(typeof (_141)=="undefined")?false:_141;
if(this.tiles==null){
this.tiles=new Array(this.mapcols);
for(var a=0;a<this.mapcols;a++){
this.tiles[a]=new Array(this.maprows);
for(var b=0;b<this.maprows;b++){
this.tiles[a][b]=new MQA.Tile(this,this.div,(a-2)*this.tilesize+this.m_layoffX,(b-2)*this.tilesize+this.m_layoffY,this.m_centerX-2+a,this.m_centerY+2-b,this.scale,this.zoom,this.tilesize);
}
}
}else{
for(var a=0;a<this.mapcols;a++){
for(var b=0;b<this.maprows;b++){
this.tiles[a][b].loadingTile();
}
}
for(var a=0;a<this.mapcols;a++){
for(var b=0;b<this.maprows;b++){
this.tiles[a][b].updateTile((a-2)*this.tilesize+this.m_layoffX,(b-2)*this.tilesize+this.m_layoffY,this.m_centerX-2+a,this.m_centerY+2-b,this.scale,this.zoom,this.tilesize);
}
}
}
this.div.ldiv.tp=this.tiles[0][0].tp;
this.div.ldiv.lt=this.tiles[0][0].lt;
this.div.ldiv.style.top=MQA.Util.asPix(this.div.ldiv.tp);
this.div.ldiv.style.left=MQA.Util.asPix(this.div.ldiv.lt);
this.logos[MQA.LOGO_MQ_SCALES].childNodes[0].style.marginTop=-((this.zoom-1)*parseInt(this.logos[MQA.LOGO_MQ_SCALES].height))+"px";
this.logos[MQA.LOGO_MAP_COPY].src=MQA.RESOURCES+MQA.VENDORLIST[MQA.MAPVENDORS[this.zoom]];
if(this.showMap){
this.mapaccum1+=1;
this.mapaccum2+=1;
}
if(this.showSat){
this.sataccum1+=1;
this.sataccum2+=1;
}
if(this.showHyb){
this.hybaccum1+=1;
this.hybaccum2+=1;
}
if(this.showRte){
this.rtehighlight.style.display="none";
this.getNewRouteHighlight();
}
if(!_141&&this.pois){
var y=this.pois.length;
for(var x=0;x<y;x++){
var poi=this.pois[x];
var XY=this.getLLToXY(poi.ll);
poi.style.left=(XY.x+poi.offset.x-this.m_dragoffX)+"px";
poi.style.top=(XY.y+poi.offset.y-this.m_dragoffY)+"px";
}
}
};
MQA.TileMap.prototype.setLogoPosition=function(LOGO){
var LEFT;
var TOP;
if(LOGO.corner==MQA.CORNER_TOPLEFT){
LEFT=0;
TOP=0;
}else{
if(LOGO.corner==MQA.CORNER_TOPRIGHT){
LEFT=this.width-parseInt(LOGO.width);
TOP=0;
}else{
if(LOGO.corner==MQA.CORNER_BOTTOMLEFT){
LEFT=0;
TOP=this.height-parseInt(LOGO.height);
}else{
if(LOGO.corner==MQA.CORNER_BOTTOMRIGHT){
LEFT=this.width-parseInt(LOGO.width);
TOP=this.height-parseInt(LOGO.height);
}
}
}
}
LEFT+=LOGO.offset.x;
TOP+=LOGO.offset.y;
LOGO.style.left=LEFT+"px";
LOGO.style.top=TOP+"px";
};
MQA.TileMap.prototype.setClickHandler=function(_14b,_14c){
if(this.clickEvent==MQA.EVENT_CLICK){
MQA._prEvent.stopObserving(this.parent,"click",this.clickHandler);
}else{
if(this.clickEvent==MQA.EVENT_DBLCLICK){
MQA._prEvent.stopObserving(this.parent,"dblclick",this.clickHandler);
}
}
this.clickEvent=_14b;
this.clickOper=_14c;
if(this.clickEvent==MQA.EVENT_CLICK){
this.clickHandler=MQA._prEvent.EventCallback(this,"onClick");
MQA._prEvent.observe(this.parent,"click",this.clickHandler);
}else{
if(this.clickEvent==MQA.EVENT_DBLCLICK){
this.clickHandler=MQA._prEvent.EventCallback(this,"onDblClick");
MQA._prEvent.observe(this.parent,"dblclick",this.clickHandler);
}
}
};
MQA.TileMap.prototype.sendTransactions=function(_14d){
if(this.showMap&&this.mapaccum1>0){
this.maptiler.src="http://"+LOGSERVER+"/tilelog/transaction?transaction=log&t=m&c="+(parseInt(this.mapaccum1*1000000)/1000000)+"&c2="+(parseInt(this.mapaccum2*1000000)/1000000)+"&s="+this.scale+"&lat="+this.lastlat+"&lng="+this.lastlng+"&key="+Key+"&rand="+Math.floor(Math.random()*99991);
this.mapaccum1=0;
this.mapaccum2=0;
}
if(this.showSat&&this.sataccum1>0){
this.sattiler.src="http://"+LOGSERVER+"/tilelog/transaction?transaction=log&t=a&c="+(parseInt(this.sataccum1*1000000)/1000000)+"&c2="+(parseInt(this.sataccum2*1000000)/1000000)+"&s="+this.scale+"&lat="+this.lastlat+"&lng="+this.lastlng+"&key="+Key+"&rand="+Math.floor(Math.random()*99991);
this.sataccum1=0;
this.sataccum2=0;
}
if(this.showHyb&&this.hybaccum1>0){
this.hybtiler.src="http://"+LOGSERVER+"/tilelog/transaction?transaction=log&t=h&c="+(parseInt(this.hybaccum1*1000000)/1000000)+"&c2="+(parseInt(this.hybaccum2*1000000)/1000000)+"&s="+this.scale+"&lat="+this.lastlat+"&lng="+this.lastlng+"&key="+Key+"&rand="+Math.floor(Math.random()*99991);
this.hybaccum1=0;
this.hybaccum2=0;
}
this.m_transoffX=0;
this.m_transoffY=0;
if(_14d!=null&&_14d==true){
MQA.Util.pause(250);
}
};
MQA.TileMap.prototype.getNewRouteHighlight=function(){
var _14e=MQA.getRowTile(this.routerect.ul.lat,this.scale);
var _14f=MQA.getColTile(this.routerect.ul.lng,this.scale);
var _150=MQA.getRowTile(this.routerect.lr.lat,this.scale);
var _151=MQA.getColTile(this.routerect.lr.lng,this.scale);
this.rteoffset=-1;
this.rtethresh=2;
if(this.tiles==null){
this.rebuildTiles();
}
var _152=this.tiles[0][0];
var _153=this.tiles[this.mapcols-1][this.maprows-1];
if(_14f>_152.x&&_14e<_152.y&&_151<_153.x&&_150>_153.y){
this.rteoffset=0;
this.rtethresh=-1;
_152=this.tiles[_14f-_152.x][_152.y-_14e];
_153=this.tiles[this.mapcols-1-(_153.x-_151)][this.maprows-1-(_150-_153.y)];
}
var _154=MQA.getLatTileRowOffset(_152.y+this.rteoffset*-1,255,this.scale);
var _155=MQA.getLngTileColOffset(_152.x-1+this.rteoffset*1,255,this.scale);
var _156=MQA.getLatTileRowOffset(_153.y-1+this.rteoffset*1,255,this.scale);
var _157=MQA.getLngTileColOffset(_153.x+this.rteoffset*-1,255,this.scale);
var WDTH=(1+(_153.x+this.rteoffset*-1)-(_152.x+this.rteoffset*1))*this.tilesize;
var HGHT=(1+(_152.y+this.rteoffset*-1)-(_153.y+this.rteoffset*1))*this.tilesize;
this.m_routeoffX=0;
this.m_routeoffY=0;
if(this.zoom<3&&_155>0&&this.centerlng<0){
_155-=360;
}
var _15a=!((_155>this.routerect.lr.lng)||(_157<this.routerect.ul.lng)||(_156>this.routerect.ul.lat)||(_154<this.routerect.lr.lat));
if(this.rteoffset==0||_15a){
this.rtehighlight.lt=(_152.lt+this.rteoffset*this.tilesize+1);
this.rtehighlight.tp=(_152.tp+this.rteoffset*this.tilesize+1);
this.rtehighlight.style.left=this.rtehighlight.lt+"px";
this.rtehighlight.style.top=this.rtehighlight.tp+"px";
this.rtehighlight.style.width=WDTH+"px";
this.rtehighlight.style.height=HGHT+"px";
if(this.rtesession.length>0){
var CLAT=(_154+_156)/2;
var CLNG=(_155+_157)/2;
this.rtehighlight.src=this.rteserver+"/?e=0&GetMapFromUpdatedSession.1=1280:"+this.rtesession+",1270:2,1190:,rtehl,"+CLAT+","+CLNG+","+(WDTH/72)+","+(HGHT/72)+","+this.scale+",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+4%2c4%2c215+Opacity+255+CasePen+Style+Solid+Size+210+Color+255%2c255%2c255+Opacity+255,1650.1:77,72,1,1400.2:,,,"+"&rand="+Math.floor(Math.random()*99991);
}else{
this.rtehighlight.src=this.rteserver+"&latul="+_154+"&lngul="+_155+"&latlr="+_156+"&lnglr="+_157+"&width="+WDTH+"&height="+HGHT+"&scale="+this.scale+"&rand="+Math.floor(Math.random()*99991);
}
}
};
MQA.TileMap.prototype.showRouteHighlight=function(){
this.rtehighlight.style.display="block";
};
MQA.TileMap.prototype.scrollMap=function(SX,SY){
this.moving=true;
if(SX!=0||SY!=0){
this.handleMove("move");
}
if((SX!=0||SY!=0)&&this.drag){
this.handleDrag("drag");
}
this.m_dragoffX+=SX;
this.m_dragoffY+=SY;
this.m_tileoffX+=SX;
this.m_tileoffY+=SY;
this.m_scrollofX+=SX;
this.m_scrollofY+=SY;
this.div.lt=this.div.lt+SX;
this.div.tp=this.div.tp+SY;
this.div.style.left=this.div.lt+"px";
this.div.style.top=this.div.tp+"px";
var _15f=0;
while(this.m_tileoffX+this.m_tileofX>MQA.TILESIZE){
this.tiles.unshift(this.tiles.pop());
for(var b=0;b<this.maprows;b++){
this.tiles[0][b].loadingTile();
}
for(var b=0;b<this.maprows;b++){
var _161=this.tiles[0][b];
var _162=this.tiles[1][b];
_161.updateTile(_162[this.tileNode].image.lt-this.tilesize,_161[this.tileNode].image.tp,_162.x-1,_161.y,this.scale,this.zoom);
}
this.m_tileoffX-=this.tilesize;
this.m_routeoffX--;
this.m_transoffX--;
_15f+=(this.maprows-2);
this.div.ldiv.lt-=MQA.TILESIZE;
this.div.ldiv.style.left=MQA.Util.asPix(this.div.ldiv.lt);
}
while(this.m_tileoffX+this.m_tileofX<0){
this.tiles.push(this.tiles.shift());
for(var b=0;b<this.maprows;b++){
this.tiles[this.mapcols-1][b].loadingTile();
}
for(var b=0;b<this.maprows;b++){
var _161=this.tiles[this.mapcols-1][b];
var _162=this.tiles[this.mapcols-2][b];
_161.updateTile(_162[this.tileNode].image.lt+this.tilesize,_161[this.tileNode].image.tp,_162.x+1,_161.y,this.scale,this.zoom);
}
this.m_tileoffX+=this.tilesize;
this.m_routeoffX++;
this.m_transoffX++;
_15f+=(this.maprows-2);
this.div.ldiv.lt+=MQA.TILESIZE;
this.div.ldiv.style.left=MQA.Util.asPix(this.div.ldiv.lt);
}
while(this.m_tileoffY+this.m_tileofY>MQA.TILESIZE){
for(var a=0;a<this.mapcols;a++){
this.tiles[a].unshift(this.tiles[a].pop());
this.tiles[a][0].loadingTile();
}
for(var a=0;a<this.mapcols;a++){
var _161=this.tiles[a][0];
var _162=this.tiles[a][1];
_161.updateTile(_161[this.tileNode].image.lt,_162[this.tileNode].image.tp-this.tilesize,_161.x,_162.y+1,this.scale,this.zoom);
}
this.m_tileoffY-=this.tilesize;
this.m_routeoffY--;
this.m_transoffY--;
_15f+=(this.mapcols-2);
this.div.ldiv.tp-=MQA.TILESIZE;
this.div.ldiv.style.top=MQA.Util.asPix(this.div.ldiv.tp);
}
while(this.m_tileoffY+this.m_tileofY<0){
for(var a=0;a<this.mapcols;a++){
this.tiles[a].push(this.tiles[a].shift());
this.tiles[a][this.maprows-1].loadingTile();
}
for(var a=0;a<this.mapcols;a++){
var _161=this.tiles[a][this.maprows-1];
var _162=this.tiles[a][this.maprows-2];
_161.updateTile(_161[this.tileNode].image.lt,_162[this.tileNode].image.tp+this.tilesize,_161.x,_162.y-1,this.scale,this.zoom);
}
this.m_tileoffY+=this.tilesize;
this.m_routeoffY++;
this.m_transoffY++;
_15f+=(this.mapcols-2);
this.div.ldiv.tp+=MQA.TILESIZE;
this.div.ldiv.style.top=MQA.Util.asPix(this.div.ldiv.tp);
}
if(this.m_dragoffX>1*MQA.MODS[this.zoom]*this.tilesize){
this.m_dragoffX-=MQA.MODS[this.zoom]*this.tilesize;
}
if(this.m_dragoffX<-1*MQA.MODS[this.zoom]*this.tilesize){
this.m_dragoffX+=MQA.MODS[this.zoom]*this.tilesize;
}
if(_15f>0){
_15f=_15f/((this.mapcols-2)*(this.maprows-2)*9);
if(this.showMap){
this.mapaccum1+=_15f;
}
if(this.showSat){
this.sataccum1+=_15f;
}
if(this.showHyb){
this.hybaccum1+=_15f;
}
}
if(Math.abs(this.m_transoffY)>4||Math.abs(this.m_transoffX)>4){
this.sendTransactions();
}
var _164=Math.abs(this.m_dragoffX)%MQA.SURFACE_OFFSET;
var _165=Math.abs(this.m_dragoffY)%MQA.SURFACE_OFFSET;
var _166=Math.ceil(MQA.SURFACE_OFFSET/1.5);
if((_164>_166)&&this.updateOverlaysX){
this.handleOverlays();
this.updateOverlaysX=false;
}
if((_165>_166)&&this.updateOverlaysY){
this.handleOverlays();
this.updateOverlaysY=false;
}
if(_164<_166&&!this.updateOverlaysX){
this.updateOverlaysX=true;
}
if(_165<_166&&!this.updateOverlaysY){
this.updateOverlaysY=true;
}
if(this.showRte&&(this.rtethresh>0)&&(this.m_routeoffY>=this.rtethresh||this.m_routeoffY<=this.rtethresh*-1||this.m_routeoffX>=this.rtethresh||this.m_routeoffX<=this.rtethresh*-1)){
this.rtehighlight.style.display="none";
this.getNewRouteHighlight();
}
};
MQA.TileMap.prototype.slideMapTimer=function(_167,_168,_169,_16a,_16b,_16c,_16d,_16e){
var pc=_16c/_16d;
var dx=parseInt(pc*_16a)-_168;
var dy=parseInt(pc*_16b)-_169;
this.scrollMap(dx,dy);
_168+=dx;
_169+=dy;
_16c++;
if(_16c<=_16d){
setTimeout("MQA.MASTER_BROKER.DoSlide( "+_167+", "+_168+", "+_169+", "+_16a+", "+_16b+", "+_16c+", "+_16d+", "+_16e+" );",_16e);
}else{
this.slide=false;
this.moving=false;
this.handleMove("moveend");
}
};
MQA.TileMap.prototype.isPoi=function(_172){
if(this.pois==null){
return false;
}
while(_172!=null&&_172!=this.parent){
var j=this.pois.length;
for(var i=0;i<j;i++){
if(this.pois[i]==_172){
return true;
}
}
_172=_172.parentNode;
}
return false;
};
MQA.TileMap.prototype.onMouseMove=function(_175){
if(this.startingToMove){
this.startingToMove=false;
this.handleMove("movestart");
}
if(this.startingToDrag){
this.startingToDrag=false;
this.handleDrag("dragstart");
}
this.click=false;
if(this.draggedObject){
this.draggedObject.element.style.left=this.draggedObject.offsetX+_175.clientX-this.draggedObject.startX+"px";
this.draggedObject.element.style.top=this.draggedObject.offsetY+_175.clientY-this.draggedObject.startY+"px";
if(this.draggedObject.mqrw&&!this.draggedObject.mqrw.isHidden()&&(Math.abs(this.draggedObject.startX-_175.clientX)>3||Math.abs(this.draggedObject.startY-_175.clientY)>3)&&!this.getDeclutter().keepRolloversOnDrag){
this.draggedObject.mqrw.hide();
}
}
if(!this.drag||this.disabled){
return;
}
var _176=MQA.Util.getParentOffset(this.parent);
var cx=_175.clientX-_176.x;
var cy=_175.clientY-_176.y;
var gx=parseInt(this.width/2)-cx;
var gy=parseInt(this.height/2)-cy;
this.lastlat=MQA.getLatTileRowOffset(this.m_centerY-this.m_shiftY,this.tilesize-this.m_offsetY+this.m_dragoffY+gy,this.scale);
this.lastlng=MQA.getLngTileColOffset(this.m_centerX+this.m_shiftX,this.m_offsetX-this.m_dragoffX-gx,this.scale);
var difX=cx-this.lastX;
var difY=cy-this.lastY;
this.lastX=cx;
this.lastY=cy;
this.scrollMap(difX,difY);
};
MQA.TileMap.prototype.onMouseUp=function(_17d){
if(this.draggedObject&&this.mypois.contains(this.draggedObject)&&this.draggedObject.isDragging){
this.draggedObject.mqrw.hide();
this.draggedObject.finishDrag();
}
if(!this.drag||this.disabled){
return;
}
this.current_mousecursor=this.grab_mousecursor;
this.div.style.cursor=this.current_mousecursor;
if(!this.click){
var xdif=Math.abs(this.m_scrollofX-this.startX);
var ydif=Math.abs(this.m_scrollofY-this.startY);
this.diffaccum+=((xdif*ydif)+((this.width-xdif)*ydif)+((this.height-ydif)*xdif));
var _180=((this.diffaccum/(this.width*this.height))>=0.4);
if(this.showMap&&_180){
this.mapaccum2+=1;
this.diffaccum=0;
}
if(this.showSat&&_180){
this.sataccum2+=1;
this.diffaccum=0;
}
if(this.showHyb&&_180){
this.hybaccum2+=1;
this.diffaccum=0;
}
}
var _181=MQA.Util.getParentOffset(this.parent);
_17d.cx=_17d.clientX-_181.x;
_17d.cy=_17d.clientY-_181.y;
this.startingToMove=false;
if(this.moving){
this.moving=false;
this.handleMove("moveend");
}
this.startingToDrag=false;
if(this.drag&&!this.click){
this.handleDrag("dragend",_17d);
}
this.handleMouse("mouseup",_17d);
MQA._prEvent.stop(_17d);
this.drag=false;
};
MQA.TileMap.prototype.onMouseOver=function(_182){
this.div.style.cursor=this.current_mousecursor;
};
MQA.TileMap.prototype.onMouseDown=function(_183){
this.click=true;
if(this.slide||this.disabled){
return;
}
if(this.isPoi(MQA._prEvent.element(_183))){
return;
}
var _184=MQA.Util.getParentOffset(this.parent);
this.current_mousecursor=this.grabbing_mousecursor;
this.div.style.cursor=this.current_mousecursor;
var cx=_183.clientX-_184.x;
var cy=_183.clientY-_184.y;
this.startX=this.m_scrollofX;
this.startY=this.m_scrollofY;
this.lastX=cx;
this.lastY=cy;
this.drag=true;
this.startingToMove=true;
this.startingToDrag=true;
_183.cx=cx;
_183.cy=cy;
this.handleMouse("mousedown",_183);
MQA._prEvent.stop(_183);
};
MQA.TileMap.prototype.onMouseOut=function(_187){
if(!_187.relatedTarget&&!_187.toElement){
this.onMouseUp(_187);
}
};
MQA.TileMap.prototype.onDblClick=function(_188){
this.handleClickEvent(_188,false);
};
MQA.TileMap.prototype.handleClickEvent=function(_189,_18a){
if(this.drag||this.slide||(!this.click&&_18a)){
return;
}
this.click=false;
this.div.style.cursor="default";
var _18b=MQA.Util.getParentOffset(this.parent);
var cx=(_189.pageX||(_189.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)))-_18b.x;
var cy=(_189.pageY||(_189.clientY+(document.documentElement.scrollTop||document.body.scrollTop)))-_18b.y;
if(this.clickOper==MQA.OPER_RECENTER||this.zoom==16){
this.slideMapToPoint(new MQA.PointXY(cx,cy));
}else{
var ptLL=this.getXYToLL(new MQA.PointXY(cx,cy));
this.setCenterLatLngZoomLevel(ptLL,this.zoom+1);
}
this.div.style.cursor=this.current_mousecursor;
};
MQA.TileMap.prototype.onWheelMouse=function(_18f){
if(this.drag){
return;
}
if(_18f.wheelDelta>0&&this.zoom<16){
this.zoomIn();
}
if(_18f.wheelDelta<0&&this.zoom>1){
this.zoomOut();
}
};
MQA.TileMap.prototype.onKeyDown=function(_190){
if(this.drag){
return;
}
key=_190.which?_190.which:_190.keyCode;
if(key==107&&this.zoom<16){
this.zoomIn();
}
if(key==109&&this.zoom>1){
this.zoomOut();
}
};
MQA.TileMap.prototype.slideMapByOffset=function(PTXY){
if(this.slide){
return;
}
this.handleMove("movestart");
this.slide=true;
var _192=PTXY.x,_193=PTXY.y,_194=this.brokerKey;
setTimeout(function(){
MQA.MASTER_BROKER.DoSlide(_194,0,0,_192,_193,1,MQA.SLIDESTEPS,MQA.SLIDEDELAY);
},MQA.SLIDEDELAY);
var xdif=Math.abs(PTXY.x);
var ydif=Math.abs(PTXY.y);
this.diffaccum+=((xdif*ydif)+((this.width-xdif)*ydif)+((this.height-ydif)*xdif));
var _197=((this.diffaccum/(this.width*this.height))>=0.4);
if(this.showMap&&_197){
this.mapaccum2+=1;
this.diffaccum=0;
}
if(this.showSat&&_197){
this.sataccum2+=1;
this.diffaccum=0;
}
if(this.showHyb&&_197){
this.hybaccum2+=1;
this.diffaccum=0;
}
};
MQA.TileMap.prototype.slideMapToPoint=function(PTXY){
if(this.slide){
return;
}
this.handleMove("movestart");
var gx=parseInt(this.width/2)-PTXY.x;
var gy=parseInt(this.height/2)-PTXY.y;
this.slide=true;
var _19b=this.brokerKey;
setTimeout(function(){
MQA.MASTER_BROKER.DoSlide(_19b,0,0,gx,gy,1,MQA.SLIDESTEPS,MQA.SLIDEDELAY);
},MQA.SLIDEDELAY);
var xdif=Math.abs(gx);
var ydif=Math.abs(gy);
this.diffaccum+=((xdif*ydif)+((this.width-xdif)*ydif)+((this.height-ydif)*xdif));
var _19e=((this.diffaccum/(this.width*this.height))>=0.4);
if(this.showMap&&_19e){
this.mapaccum2+=1;
this.diffaccum=0;
}
if(this.showSat&&_19e){
this.sataccum2+=1;
this.diffaccum=0;
}
if(this.showHyb&&_19e){
this.hybaccum2+=1;
this.diffaccum=0;
}
};
MQA.TileMap.prototype.panNorth=function(_19f){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2),parseInt(this.height/2)-parseInt(this.height*(_19f/100))));
};
MQA.TileMap.prototype.panSouth=function(_1a0){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2),parseInt(this.height/2)+parseInt(this.height*(_1a0/100))));
};
MQA.TileMap.prototype.panEast=function(_1a1){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2)+parseInt(this.width*(_1a1/100)),parseInt(this.height/2)));
};
MQA.TileMap.prototype.panWest=function(_1a2){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2)-parseInt(this.width*(_1a2/100)),parseInt(this.height/2)));
};
MQA.TileMap.prototype.panNorthWest=function(_1a3){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2)-parseInt(this.width*(_1a3/100)),parseInt(this.height/2)-parseInt(this.height*(_1a3/100))));
};
MQA.TileMap.prototype.panSouthWest=function(_1a4){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2)-parseInt(this.width*(_1a4/100)),parseInt(this.height/2)+parseInt(this.height*(_1a4/100))));
};
MQA.TileMap.prototype.panNorthEast=function(_1a5){
this.slideMapToPoint(new MQA.PointXY(parseInt(this.width/2)+parseInt(this.width*(_1a5/100)),parseInt(this.height/2)-parseInt(this.height*(_1a5/100))));
};
MQA.TileMap.prototype.panSouthEast=functi