

function MarkerLight(latlng, imgSrc, width, height, xOffset, yOffset, zIndex, tooltip, website ) {

    this.latlng = latlng;

    this.height_ = height; 
    this.width_ = width;
    this.image_ = imgSrc; 
    this.xOffset_ = xOffset; 
    this.yOffset_ = yOffset;
    this.zIndex_ = zIndex;
    this.div = null;
    this.tooltip_ = tooltip; 
    this.website_ = website; 
    
}


MarkerLight.prototype = new GOverlay();

MarkerLight.prototype.setLatLng = function( inLatlng ) {
    this.latlng = inLatlng;
    this.redraw(true);
}


MarkerLight.prototype.initialize = function(map) {
    var me = this;

    this.div = document.createElement("div");
    
    this.div.style.position = "absolute";
    if ( this.zIndex_ != null ) {
        this.div.style.zIndex = this.zIndex_;
    }
    this.div.style.cursor = 'pointer';
    if ( me.website_ != null ) {
        this.div.onclick = new Function("markerClicked(\""+ me.website_+"\");");
    }
   
    if ( me.tooltip_ != null ) {
        //me.tooltip_ = me.tooltip_.replace("|","<br>");
        var html = "<a href='#' class='helplink2'><img border=0 style='width:"+me.width_+"px;height:"+me.height_+"px;' src='"+me.image_+"'/><span style='z-index:10000000;'>" + me.tooltip_ + "</span></a>";
        this.div.innerHTML = html;
    }


    map.getPane(G_MAP_MARKER_PANE).appendChild(this.div);
    
    this.map_ = map;

};

MarkerLight.prototype.remove = function() {
    this.div.parentNode.removeChild(this.div);
};


MarkerLight.prototype.redraw = function(force) {

    // We only need to redraw if the coordinate system has changed
    if (!force) return;

    // Calculate the DIV coordinates of two opposite corners 
    // of our bounds to get the size and position of our MarkerLight
    var divPixel = this.map_.fromLatLngToDivPixel(this.latlng);
    try{ 
    // Now position our DIV based on the DIV coordinates of our bounds
        this.div.style.width = this.width_ + "px";
        this.div.style.left = ((divPixel.x) - (this.width_/2) + this.xOffset_) + "px"
        this.div.style.height = (this.height_) + "px";
        this.div.style.top = ((divPixel.y) - (this.height_/2) + this.yOffset_ ) + "px";
    } catch (e) {}
};





