function VisitsMarker(latlng,visits,mapper,map,opts){this.latlng=latlng;this.visits_=parseInt(visits,10);this.mapper_=mapper;this.map_=map;if(!opts)opts={};this.tooltipTitle_=opts.tooltipTitle||'';this.clicked_=0;this.setMap(map);}
VisitsMarker.prototype=new google.maps.OverlayView();VisitsMarker.prototype.onAdd=function(){var me=this;var div=document.createElement("div");div.style.position="absolute";div.style.paddingLeft="0px";div.style.cursor='pointer';div.title=this.tooltipTitle_;var img=document.createElement("img");img.src=this.mapper_.getImageName(this.map_.getZoom(),this.visits_);var imageSize=this.mapper_.getImageSize(this.map_.getZoom(),this.visits_);img.style.width=imageSize+"px";img.style.height=imageSize+"px";div.appendChild(img);google.maps.event.addDomListener(div,"click",function(event){me.clicked_=1;google.maps.event.trigger(me,"click");});this.getPanes().overlayLayer.appendChild(div);this.div_=div;this.img_=img;};VisitsMarker.prototype.onRemove=function(){this.div_.parentNode.removeChild(this.div_);};VisitsMarker.prototype.copy=function(){var opts={};opts.tooltipTitle=this.tooltipTitle_;opts.color=this.color_;return new VisitsMarker(this.latlng,this.visits_,this.mapper_,opts);};VisitsMarker.prototype.draw=function(){var divPixel=this.getProjection().fromLatLngToDivPixel(this.latlng);var imageSize=this.mapper_.getImageSize(this.map_.getZoom(),this.visits_);var centerDistance=Math.ceil(imageSize/2);this.div_.style.width=imageSize+"px";this.div_.style.left=(divPixel.x-centerDistance)+"px";this.div_.style.height=imageSize+"px";this.div_.style.top=(divPixel.y-centerDistance)+"px";this.img_.src=this.mapper_.getImageName(this.map_.getZoom(),this.visits_);this.img_.style.height=imageSize+"px";this.img_.style.width=imageSize+"px";};VisitsMarker.prototype.getZIndex=function(m){return this.visits_*-1;};VisitsMarker.prototype.getPosition=function(){return this.latlng;};VisitsMarker.prototype.hide=function(){if(this.div_){this.div_.style.visibility="hidden";}};VisitsMarker.prototype.show=function(){if(this.div_){this.div_.style.visibility="visible";}};VisitsMarker.prototype.toggle=function(){if(this.div_){if(this.div_.style.visibility=="hidden"){this.show();}else{this.hide();}}}
VisitsMarker.prototype.setVisible=function(visibility){if(visibility){this.show();}else{this.hide();}}
VisitsMarker.prototype.isHidden=function(){return this.div_.style.visibility=="hidden";};VisitsMarker.prototype.setStyle=function(style){for(s in style){this.div_.style[s]=style[s];}};VisitsMarker.prototype.setImage=function(image){this.div_.style.background='url("'+image+'")';};VisitsMarker.prototype.getVisits=function(){return this.visits_;};