// Copyright 1999-2007 Maptuit Inc, All Rights Reserved

if(!document.CanvasCanvasInstances)
{document.CanvasCanvasInstances={};}
function CanvasCanvas(id)
{this.id=id;this.MyMap=this.MyDivId=this.MyCanvasId=this.MyCtx=this.MyTextObjDivId=null;this.sta_tic=true;this.reProcessTimeout=null;this.allowProcessBreaks=true;this.MyMapArea=null;this.MyMapAreaPadding=0.75;document.CanvasCanvasInstances[id]=this;this.MyCmdStack=['_lineJoin("round")'];this.left=this.top=this.textCount=0;this.showMe=true;this.textObjs=[];this.openPath=false;this.defer=false;this.imgCache={};this.outsideBounds=false;this.lastPointOutside=null;}
CanvasCanvas.prototype.init=function(mydivId,damap)
{this.cleanup();this.MyMap=damap;this.MyDivId=mydivId;var mydiv=$(mydivId);var traydiv=$(this.MyMap.TrayDivId);var nc=document.createElement('CANVAS');mydiv.appendChild(nc);if(window.G_vmlCanvasManager)
{nc=G_vmlCanvasManager.initElement(nc);}
nc.id=this.id+'_canvasarea';nc.width=this.MyMap.mapWidth;nc.height=this.MyMap.mapHeight;nc.style.width=mydiv.style.width=this.MyMap.mapWidth+'px';nc.style.height=mydiv.style.height=this.MyMap.mapHeight+'px';nc.style.visibility="inherit";nc.style.position="absolute";nc.style.top=mydiv.style.top="0px";nc.style.left=mydiv.style.left="0px";this.MyCanvasId=nc.id;this.MyCtx=nc.getContext('2d');this.clearTextObjs();this.left=parseInt(traydiv.style.left,10);this.top=parseInt(traydiv.style.top,10);this.MyCtx.save();this.MyCtx.translate(this.left,this.top);this.findMapArea();this.MyCtx.lineJoin="round";this.MyCtx.lineCap="round";};CanvasCanvas.prototype.reInit=function(divId)
{this.init(divId,this.MyMap);this.beginReProcess();return true;};CanvasCanvas.prototype.moveToLL=function(lon,lat)
{this.MyCmdStack.push('_moveToLL('+lon+','+lat+')');return this._moveToLL(lon,lat);};CanvasCanvas.prototype.lineToLL=function(lon,lat)
{this.MyCmdStack.push('_lineToLL('+lon+','+lat+')');return this._lineToLL(lon,lat);};CanvasCanvas.prototype.beginPath=function()
{this.MyCmdStack.push('_beginPath()');return this._beginPath();};CanvasCanvas.prototype.closePath=function()
{this.MyCmdStack.push('_closePath()');return this._closePath();};CanvasCanvas.prototype.rectLL=function(lon,lat,w,h)
{this.MyCmdStack.push('_rectLL('+lon+','+lat+','+w+','+h+')');return this._rectLL(lon,lat,w,h);};CanvasCanvas.prototype.rectLLCenter=function(lon,lat,w,h)
{this.MyCmdStack.push('_rectLLCenter('+lon+','+lat+','+w+','+h+')');return this._rectLLCenter(lon,lat,w,h);};CanvasCanvas.prototype.arcLL=function(lon,lat,radius,startA,endA,anticlockwise)
{this.MyCmdStack.push('_arcLL('+lon+','+lat+','+radius+','+startA+','+endA+','+anticlockwise+')');return this._arcLL(lon,lat,radius,startA,endA,anticlockwise);};CanvasCanvas.prototype.arcLLMeters=function(lon,lat,radius,startA,endA,anticlockwise)
{this.MyCmdStack.push('_arcLL('+lon+','+lat+','+radius+','+startA+','+endA+','+anticlockwise+',true)');return this._arcLL(lon,lat,radius,startA,endA,anticlockwise,true);};CanvasCanvas.prototype.stroke=function()
{this.MyCmdStack.push('_stroke()');return this._stroke();};CanvasCanvas.prototype.fill=function()
{this.MyCmdStack.push('_fill()');return this._fill();};CanvasCanvas.prototype.drawImageLL=function()
{var bad=0;switch(arguments.length)
{case 3:this.MyCmdStack.push('_drawImageLL1('+"'"+arguments[0]+"'"+','+arguments[1]+','+arguments[2]+')');bad=this._drawImageLL1(arguments[0],arguments[1],arguments[2]);break;case 4:this.MyCmdStack.push('_drawImageLL4('+"'"+arguments[0]+"'"+','+arguments[1]+','+arguments[2]+','+arguments[3]+')');bad=this._drawImageLL4(arguments[0],arguments[1],arguments[2],arguments[3]);break;case 5:this.MyCmdStack.push('_drawImageLL2('+"'"+arguments[0]+"'"+','+arguments[1]+','+arguments[2]+','+arguments[3]+','+arguments[4]+')');bad=this._drawImageLL2(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);break;case 9:this.MyCmdStack.push('_drawImageLL3('+"'"+arguments[0]+"'"+','+arguments[1]+','+arguments[2]+','+arguments[3]+','+arguments[4]+','+arguments[5]+','+arguments[6]+','+arguments[7]+','+arguments[8]+')');bad=this._drawImageLL3(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);break;default:return 0;}
if(bad){if(typeof this.reProcessTimeout!="number")
{var _this=this;this.reProcessTimeout=setTimeout(function(){_this.reProcess(0);},300);}
return-1;}
return 0;};CanvasCanvas.prototype.fillRectLL=function(lon,lat,w,h)
{this.MyCmdStack.push('_fillRectLL('+lon+','+lat+','+w+','+h+')');return this._fillRectLL(lon,lat,w,h);};CanvasCanvas.prototype.fillRectLLCenter=function(lon,lat,w,h)
{this.MyCmdStack.push('_fillRectLLCenter('+lon+','+lat+','+w+','+h+')');return this._fillRectLLCenter(lon,lat,w,h);};CanvasCanvas.prototype.strokeRectLL=function(lon,lat,w,h)
{this.MyCmdStack.push('_strokeRectLL('+lon+','+lat+','+w+','+h+')');return this._strokeRectLL(lon,lat,w,h);};CanvasCanvas.prototype.strokeRectLLCenter=function(lon,lat,w,h)
{this.MyCmdStack.push('_strokeRectLLCenter('+lon+','+lat+','+w+','+h+')');return this._strokeRectLLCenter(lon,lat,w,h);};CanvasCanvas.prototype.clearRectLL=function(lon,lat,w,h)
{this.MyCmdStack.push('_clearRectLL('+lon+','+lat+','+w+','+h+')');return this._clearRectLL(lon,lat,w,h);};CanvasCanvas.prototype.drawText=function(datext,cssClass,lon,lat,width,height,centered,adjx,adjy)
{var tmpcmd='_drawText('+"'"+datext+"'"+','+"'"+cssClass+"'"+','+lon+','+lat+','+"'"+this.id+'txt'+this.textCount+"'";if(width&&height)
{tmpcmd+=','+width+','+height+','+centered+','+adjx+','+adjy+')';}
else
{tmpcmd+=',null,null,'+centered+','+adjx+','+adjy+')';}
this.MyCmdStack.push(tmpcmd);this._drawText(datext,cssClass,lon,lat,this.id+'txt'+this.textCount,width,height,centered,adjx,adjy);this.textCount++;return 0;};CanvasCanvas.prototype.lineCap=function(l)
{this.MyCmdStack.push('_lineCap("'+l+'")');return this._lineCap(l);};CanvasCanvas.prototype.lineJoin=function(l)
{this.MyCmdStack.push('_lineJoin("'+l+'")');return this._lineJoin(l);};CanvasCanvas.prototype.miterLimit=function(l)
{this.MyCmdStack.push('_miterLimit('+l+')');return this._miterLimit(l);};CanvasCanvas.prototype.globalAlpha=function(a)
{this.MyCmdStack.push('_globalAlpha('+a+')');return this._globalAlpha(a);};CanvasCanvas.prototype.lineWidth=function(w)
{this.MyCmdStack.push('_lineWidth('+w+')');return this._lineWidth(w);};CanvasCanvas.prototype.fillStyle=function(colour)
{this.MyCmdStack.push('_fillStyle("'+colour+'")');return this._fillStyle(colour);};CanvasCanvas.prototype.strokeStyle=function(colour)
{this.MyCmdStack.push('_strokeStyle("'+colour+'")');return this._strokeStyle(colour);};CanvasCanvas.prototype.clearHistory=function()
{this.MyCmdStack=[];return true;};CanvasCanvas.prototype.clearCanvas=function()
{this.MyCmdStack=[];this.clearReprocessTimeout();this.clearTextObjs();this.openPath=false;var cvs=$(this.MyCanvasId);var mydiv=$(this.MyDivId);var tray=$(this.MyMap.TrayDivId);this.MyCtx.restore();this.MyCtx.save();this.MyCtx.clearRect(0,0,parseInt(cvs.width,10),parseInt(cvs.height,10));cvs.style.width=mydiv.style.width=this.MyMap.mapWidth+'px';cvs.style.height=mydiv.style.height=this.MyMap.mapHeight+'px';this.left=parseInt(tray.style.left,10);this.top=parseInt(tray.style.top,10);this.MyCtx.translate(this.left,this.top);};CanvasCanvas.prototype.ClearCanvas=CanvasCanvas.prototype.clearCanvas;CanvasCanvas.prototype.beginReProcess=function()
{if(this.showMe)
{if(typeof this.reProcessTimeout=="number"){return;}
this.clearReprocessTimeout();var _this=this;this.reProcessTimeout=setTimeout(function(){_this.reProcess(0);},0);}};CanvasCanvas.prototype.clearReprocessTimeout=function()
{if(typeof this.reProcessTimeout=="number")
{clearTimeout(this.reProcessTimeout);this.reProcessTimeout=null;}};CanvasCanvas.prototype.reProcess=function(pos)
{this.defer=false;if(!this.showMe){return 0;}
if(pos===0){this.clearTextObjs();}
var need2break=false;var cmdstack=this.MyCmdStack;var stacklen=cmdstack.length;while(pos<stacklen)
{var result=eval('this.'+cmdstack[pos]+';');if(result<0)
{this.reProcessTimeout=setTimeout("document.CanvasCanvasInstances['"+this.id+"'].reProcess("+pos+")",20);return;}
pos++;if(this.allowProcessBreaks)
{if((pos%100)===0)
{need2break=true;}
if(need2break&&!this.openPath)
{break;}}}
if(pos<cmdstack.length)
{this.reProcessTimeout=setTimeout("document.CanvasCanvasInstances['"+this.id+"'].reProcess("+pos+")",0);}};CanvasCanvas.prototype.cleanup=function()
{if(this.MyCanvasId&&$(this.MyCanvasId)){$(this.MyDivId).removeChild(this.purge($(this.MyCanvasId)));this.MyCanvasId=null;}
this.clearTextObjs();this.clearReprocessTimeout();if(this.MyCtx&&this.MyCtx.destroy){this.MyCtx.destroy();}
this.MyCtx=null;};CanvasCanvas.prototype.findMapArea=function()
{var TL_t=this.MyMap.xy_tray(Math.round(0-(this.MyMap.mapWidth*this.MyMapAreaPadding)),Math.round(0-(this.MyMap.mapHeight*this.MyMapAreaPadding)));var BR_t=this.MyMap.xy_tray(Math.round(this.MyMap.mapWidth+(this.MyMap.mapWidth*this.MyMapAreaPadding)),Math.round(this.MyMap.mapHeight+(this.MyMap.mapHeight*this.MyMapAreaPadding)));var TL_g=this.MyMap.c2g(TL_t.x,TL_t.y);var BR_g=this.MyMap.c2g(BR_t.x,BR_t.y);this.MyMapArea={top:parseFloat(TL_g.lat),left:parseFloat(TL_g.lon),bottom:parseFloat(BR_g.lat),right:parseFloat(BR_g.lon)};};CanvasCanvas._clip=function(x){x=parseFloat(x);if(x<-16383){return-16383;}
if(x>16383){return 16383;}
return x;};CanvasCanvas.prototype.purge=function(d,childOnly){if(!d){return d;}
var a=d.attributes,i,n;if(a&&!childOnly){for(i=0;i<a.length;i++){if(a[i]){n=a[i].name;if(typeof d[n]==='function'){d[n]=null;}}}}
a=d.childNodes;if(a){for(i=0;i<a.length;i++){this.purge(d.childNodes[i]);}}
return d;};CanvasCanvas.prototype.clearTextObjs=function()
{var mydiv;if($(this.MyDivId)){mydiv=$(this.MyDivId);}
else{return;}
if(this.MyTextObjDivId){var div=$(this.MyTextObjDivId);if(div){mydiv.removeChild(this.purge(div));}}
this.MyTextObjDivId=null;this.textObjs=[];mydiv.appendChild(this.createTextObjDiv());};CanvasCanvas.prototype.createTextObjDiv=function()
{this.MyTextObjDivId=this.id+"_textobjs";var tempD=document.createElement('DIV');tempD.id=this.MyTextObjDivId;var mydiv=$(this.MyDivId);tempD.style.position="absolute";tempD.style.visibility="inherit";tempD.style.zIndex=parseInt(mydiv.style.zIndex,10)+1;tempD.style.top="0px";tempD.style.left="0px";return tempD;};CanvasCanvas.prototype.checkBounds=function(lon,lat)
{lon=parseFloat(lon);lat=parseFloat(lat);if((lon<this.MyMapArea.left)||(lon>this.MyMapArea.right))
{return false;}
if((lat<this.MyMapArea.bottom)||(lat>this.MyMapArea.top))
{return false;}
return true;};CanvasCanvas.prototype._get_img=function(src)
{var o,img,_this;if(!this.imgCache[src]){img=new Image();_this=this;o={loaded:false};o.img=img;this.imgCache[src]=o;img.onload=function(){_this.imgCache[src].loaded=true;img.onload=null;};img.src=src;return null;}else{o=this.imgCache[src];if(o.loaded){o.img.onload=null;return o.img;}else if(o.img.complete){o.img.onload=null;o.loaded=true;return o.img;}else{return null;}}};CanvasCanvas.prototype._rectLL=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
var isInside=this.checkBounds(lon,lat);var tp=this.MyMap.g2c(lon,lat);if(!isInside&&this.outsideBounds)
{this.lastPointOutside=tp;return 0;}
else if(isInside&&this.outsideBounds)
{this.outsideBounds=false;this.openPath=true;this.MyCtx.moveTo(CanvasCanvas._clip(this.lastPointOutside.x),CanvasCanvas._clip(this.lastPointOutside.y));this.lastPointOutside=null;}
this.openPath=true;this.MyCtx.rect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._rectLLCenter=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
var isInside=this.checkBounds(lon,lat);var tp=this.MyMap.g2c(lon,lat);tp.x=tp.x-Math.round(w/2);tp.y=tp.y-Math.round(h/2);if(!isInside&&this.outsideBounds)
{this.lastPointOutside=tp;return 0;}
else if(isInside&&this.outsideBounds)
{this.outsideBounds=false;this.openPath=true;this.MyCtx.moveTo(CanvasCanvas._clip(this.lastPointOutside.x),CanvasCanvas._clip(this.lastPointOutside.y));this.lastPointOutside=null;}
this.openPath=true;this.MyCtx.rect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._fillRectLL=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
if(!this.checkBounds(lon,lat)){return 0;}
var tp=this.MyMap.g2c(lon,lat);this.MyCtx.fillRect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._fillRectLLCenter=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
if(!this.checkBounds(lon,lat)){return 0;}
var tp=this.MyMap.g2c(lon,lat);tp.x=tp.x-Math.round(w/2);tp.y=tp.y-Math.round(h/2);this.MyCtx.fillRect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._strokeRectLL=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
if(!this.checkBounds(lon,lat)){return 0;}
var tp=this.MyMap.g2c(lon,lat);this.MyCtx.strokeRect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._strokeRectLLCenter=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
if(!this.checkBounds(lon,lat)){return 0;}
var tp=this.MyMap.g2c(lon,lat);tp.x=tp.x-Math.round(w/2);tp.y=tp.y-Math.round(h/2);this.MyCtx.strokeRect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._clearRectLL=function(lon,lat,w,h)
{if(!this.showMe||this.defer){return 0;}
var tp=this.MyMap.g2c(lon,lat);this.MyCtx.clearRect(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),w,h);return 0;};CanvasCanvas.prototype._arcLL=function(lon,lat,radius,startA,endA,anticlockwise,radiusInM)
{if(!this.showMe||this.defer){return 0;}
var tp=this.MyMap.g2c(lon,lat);var isInside=this.checkBounds(lon,lat);if(radiusInM){radius=Math.ceil(radius/this.MyMap.Scale);}
if(isInside&&this.outsideBounds)
{this.outsideBounds=false;this.openPath=true;this.MyCtx.moveTo(CanvasCanvas._clip(this.lastPointOutside.x),CanvasCanvas._clip(this.lastPointOutside.y));this.MyCtx.arc(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),radius,startA,endA,anticlockwise);this.lastPointOutside=null;}
else if(!isInside&&this.outsideBounds)
{this.lastPointOutside=tp;}
else
{this.openPath=true;this.MyCtx.arc(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),radius,startA,endA,anticlockwise);if(!isInside)
{this.outsideBounds=true;}}
return 0;};CanvasCanvas.prototype._drawImageLL1=function(imgsrc,lon,lat)
{var tp=this.MyMap.g2c(lon,lat);var img=this._get_img(imgsrc);if(img===null){return-1;}
if(!this.showMe||this.defer){return 0;}
this.MyCtx.drawImage(img,CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y));};CanvasCanvas.prototype._drawImageLL2=function(imgsrc,lon,lat,width,height)
{var tp=this.MyMap.g2c(lon,lat);tp.x=tp.x-Math.round(width/2);tp.y=tp.y-Math.round(height/2);var img=this._get_img(imgsrc);if(img===null){return-1;}
if(!this.showMe||this.defer){return 0;}
this.MyCtx.drawImage(img,CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),width,height);};CanvasCanvas.prototype._drawImageLL3=function(imgsrc,x1,y1,width1,height1,lon2,lat2,width2,height2)
{var tp2=this.MyMap.g2c(lon2,lat2);var img=this._get_img(imgsrc);if(img===null){return-1;}
if(!this.showMe||this.defer){return 0;}
this.MyCtx.drawImage(img,x1,y1,width1,height1,CanvasCanvas._clip(tp2.x),CanvasCanvas._clip(tp2.y),width2,height2);};CanvasCanvas.prototype._drawImageLL4=function(imgsrc,lon,lat,centre)
{var tp=this.MyMap.g2c(lon,lat);var img=this._get_img(imgsrc);if(img===null){return-1;}
if(!this.showMe||this.defer){return 0;}
if(centre)
{tp.x=tp.x-Math.round(img.width/2);tp.y=tp.y-Math.round(img.height/2);this.MyCtx.drawImage(img,CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y),img.width,img.height);}
else
{this.MyCtx.drawImage(img,CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y));}};CanvasCanvas.prototype._drawText=function(datext,cssClass,lon,lat,daid,width,height,centered,adjx,adjy)
{if(!this.showMe||this.defer){return 0;}
var tp=this.MyMap.g2c(lon,lat);tp=this.MyMap.xy_skin(tp.x,tp.y);var md=document.createElement("DIV");md.id=daid;md.className=cssClass;if(width&&height)
{md.style.width=width+'px';md.style.height=height+'px';}
if(width&&height&&centered)
{tp.x=tp.x-Math.round(width/2);tp.y=tp.y-Math.round(height/2);}
if(adjx||adjy)
{tp.x=tp.x+parseInt(adjx,10);tp.y=tp.y+parseInt(adjy,10);}
md.style.left=tp.x+'px';md.style.top=tp.y+'px';md.style.position="absolute";md.innerHTML=datext;$(this.MyTextObjDivId).appendChild(md);this.textObjs.push(daid);return 0;};CanvasCanvas.prototype._fill=function()
{if(!this.showMe||this.defer){return 0;}
this.openPath=false;this.MyCtx.fill();if(this.outsideBounds)
{this.lastPointOutside=null;this.outsideBounds=false;}
return 0;};CanvasCanvas.prototype._stroke=function()
{if(!this.showMe||this.defer){return 0;}
this.openPath=false;this.MyCtx.stroke();if(this.outsideBounds)
{this.lastPointOutside=null;this.outsideBounds=false;}
return 0;};CanvasCanvas.prototype._beginPath=function()
{if(!this.showMe||this.defer){return 0;}
this.openPath=true;this.MyCtx.beginPath();if(this.outsideBounds)
{this.lastPointOutside=null;this.outsideBounds=false;}
return 0;};CanvasCanvas.prototype._closePath=function()
{if(!this.showMe||this.defer){return 0;}
this.openPath=false;this.MyCtx.closePath();if(this.outsideBounds)
{this.lastPointOutside=null;this.outsideBounds=false;}
return 0;};CanvasCanvas.prototype._moveToLL=function(lon,lat,force)
{if(!this.showMe||this.defer){return 0;}
var tp=this.MyMap.g2c(lon,lat);var isInside=this.checkBounds(lon,lat);if(isInside&&this.outsideBounds)
{this.outsideBounds=false;this.openPath=true;this.MyCtx.moveTo(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y));this.lastPointOutside=null;}
else if(!isInside&&this.outsideBounds)
{this.lastPointOutside=tp;}
else
{this.openPath=true;this.MyCtx.moveTo(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y));if(!isInside)
{this.outsideBounds=true;}}
return 0;};CanvasCanvas.prototype._lineToLL=function(lon,lat,force)
{if(!this.showMe||this.defer){return 0;}
var tp=this.MyMap.g2c(lon,lat);var isInside=this.checkBounds(lon,lat);if(isInside&&this.outsideBounds)
{this.outsideBounds=false;this.openPath=true;if(this.lastPointOutside!==null)
{this.MyCtx.moveTo(CanvasCanvas._clip(this.lastPointOutside.x),CanvasCanvas._clip(this.lastPointOutside.y));}
this.MyCtx.lineTo(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y));this.lastPointOutside=null;}
else if(!isInside&&this.outsideBounds)
{this.lastPointOutside=tp;}
else
{this.openPath=true;this.MyCtx.lineTo(CanvasCanvas._clip(tp.x),CanvasCanvas._clip(tp.y));if(!isInside)
{this.outsideBounds=true;}}
return 0;};CanvasCanvas.prototype._fillStyle=function(colour)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.fillStyle=colour;return 0;};CanvasCanvas.prototype._strokeStyle=function(colour)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.strokeStyle=colour;return 0;};CanvasCanvas.prototype._lineWidth=function(w)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.lineWidth=w;return 0;};CanvasCanvas.prototype._lineCap=function(l)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.lineCap=l;return 0;};CanvasCanvas.prototype._lineJoin=function(l)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.lineJoin=l;return 0;};CanvasCanvas.prototype._miterLimit=function(l)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.miterLimit=l;return 0;};CanvasCanvas.prototype._globalAlpha=function(a)
{if(!this.showMe||this.defer){return 0;}
this.MyCtx.globalAlpha=a;return 0;};CanvasCanvas.prototype.singleClickCallback=function(vpx,vpy)
{return true;};CanvasCanvas.prototype.doubleClickCallback=function(vpx,vpy)
{return true;};CanvasCanvas.prototype.hoverCallback=function(vpx,vpy)
{return true;};CanvasCanvas.prototype.resizeCallback=function(w,h)
{this.reInit(this.MyDivId);return true;};CanvasCanvas.prototype.trayMoveCallback=function(dx,dy)
{var cvs=$(this.MyCanvasId);var mydiv=$(this.MyDivId);var tray=$(this.MyMap.TrayDivId);var textdiv=$(this.MyTextObjDivId);if(!cvs||!mydiv||!tray)
{return true;}
this.clearReprocessTimeout();if(textdiv){textdiv.style.top=tray.style.top;textdiv.style.left=tray.style.left;}
this.MyCtx.restore();this.MyCtx.save();this.MyCtx.clearRect(0,0,parseInt(cvs.width,10),parseInt(cvs.height,10));cvs.style.width=mydiv.style.width=this.MyMap.mapWidth+'px';cvs.style.height=mydiv.style.height=this.MyMap.mapHeight+'px';this.left=parseInt(tray.style.left,10);this.top=parseInt(tray.style.top,10);this.MyCtx.translate(this.left,this.top);this.findMapArea();this.beginReProcess();return true;};CanvasCanvas.prototype.showCallback=function(show){this.showMe=show;if(show){this.beginReProcess();}
return true;};