function TLabel(){}
TLabel.prototype.initialize=function(a,oWin){if(!oWin)oWin=window;this.oWin=oWin;this.parentMap=a;this.green=0;var b=oWin.document.createElement('div');b.setAttribute('id',this.id);if(this.content==null)this.content="";this.layer=b;this.anchorPoint="center";b.innerHTML=this.content;oWin.document.body.appendChild(b);b.style.position='absolute';b.style.zIndex=1;if(this.percentOpacity){this.setOpacity(this.percentOpacity);}
this.w=25;this.h=25;this.layer.style.width=this.w+'px';this.layer.style.height=this.h+'px';this.layer.style.padding="0 0 0 0";this.layer.style.lineHeight="100%";this.layer.style.fontSize="11px";this.layer.style.fontWeight="bold";this.layer.style.color="black";this.layer.style.textAlign="center";this.layer.style.cursor="pointer";this.markerImage=null;this.markerColour=null;this.mapTray=a.getPane(G_MAP_MARKER_SHADOW_PANE);this.mapTray.appendChild(b);if(!this.markerOffset){this.markerOffset=new GSize(0,0);}
this.setPosition();}
TLabel.prototype.setPosition=function(a){if(a){this.anchorLatLng=a;}
var b=this.parentMap.fromLatLngToDivPixel(this.anchorLatLng);var x=parseInt(b.x);var y=parseInt(b.y);with(Math){switch(this.anchorPoint){case 'topLeft':break;case 'topCenter':x-=floor(this.w/2);break;case 'topRight':x-=this.w;break;case 'midRight':x-=this.w;y-=floor(this.h/2);break;case 'bottomRight':x-=this.w;y-=this.h;break;case 'bottomCenter':x-=floor(this.w/2);y-=this.h;break;case 'bottomLeft':y-=this.h;break;case 'midLeft':y-=floor(this.h/2);break;case 'center':x-=floor(this.w/2);y-=floor(this.h/2);break;default:break;}}
var d=this.oWin.document.getElementById(this.id);d.style.left=x-this.markerOffset.width+'px';d.style.top=y-this.markerOffset.height+'px';}
TLabel.prototype.setOpacity=function(b){if(b<0){b=0;} if(b>100){b=100;}
var c=b/100;var d=this.oWin.document.getElementById(this.id);if(typeof(d.style.filter)=='string'){d.style.filter='alpha(opacity:'+b+')';}
if(typeof(d.style.KHTMLOpacity)=='string'){d.style.KHTMLOpacity=c;}
if(typeof(d.style.MozOpacity)=='string'){d.style.MozOpacity=c;}
if(typeof(d.style.opacity)=='string'){d.style.opacity=c;}}
TLabel.prototype.setImage=function(url,colour){if(this.icondiv !=null)var curr_div=this.icondiv;else
var curr_div=this.layer;this.markerImage=url;this.markerColour=colour;if(this.tempImage==null){curr_div.style.backgroundImage="url("+url+")";curr_div.style.backgroundRepeat="no-repeat";if(this.green>0 && ICON_HIGH)curr_div.style.backgroundPosition="3px 3px";else
curr_div.style.backgroundPosition="0 0";curr_div.style.color=colour;}}
TLabel.prototype.clearImage=function(){this.markerImage=null;if(this.icondiv !=null)var curr_div=this.icondiv;else
var curr_div=this.layer;curr_div.style.backgroundImage="none";curr_div.style.color="black";}
TLabel.prototype.setTempImage=function(url,colour){this.tempImage=url;if(this.icondiv !=null)var curr_div=this.icondiv;else
var curr_div=this.layer;curr_div.style.backgroundImage="url("+url+")";curr_div.style.color=colour;curr_div.style.backgroundRepeat="no-repeat";if(this.green>0 && ICON_HIGH)curr_div.style.backgroundPosition="3px 3px";else
curr_div.style.backgroundPosition="0 0";}
TLabel.prototype.clearTempImage=function(){this.tempImage=null;if(this.markerImage !=null)this.setImage(this.markerImage,this.markerColour);else
this.clearImage();}
TLabel.prototype.setHTML=function(c){if(this.content !=c){if(this.icondiv !=null)var curr_div=this.icondiv;else
var curr_div=this.layer;this.content=c;curr_div.innerHTML=this.content;}}
TLabel.prototype.clearHTML=function(){if(this.content !=""){if(this.icondiv !=null)var curr_div=this.icondiv;else
var curr_div=this.layer;this.content="";curr_div.innerHTML=this.content;}}
GMap2.prototype.addTLabel=function(a,oWin){a.initialize(this,oWin);}
GMap2.prototype.removeTLabel=function(a){this.getPane(G_MAP_MARKER_SHADOW_PANE).removeChild(a.layer);delete(a.layer);}
