/**
* @class
*/
OpenLayers.Marker = Class.create();
OpenLayers.Marker.prototype = {
    
    /** @type OpenLayers.Icon */
    icon: null,

    /** location of object
    * @type OpenLayers.LonLat */
    lonlat: null,
    
    /** @type OpenLayers.Events*/
    events: null,
    
    /** @type OpenLayers.Map */
    map: null,
    
    /** 
    * @constructor
    *
    * @param {OpenLayers.Icon} icon
    * @param {OpenLayers.LonLat lonlat
    */
    initialize: function(lonlat, icon) {
        this.lonlat = lonlat;
        this.icon = (icon) ? icon : OpenLayers.Marker.defaultIcon();

        this.events = new OpenLayers.Events(this, this.icon.imageDiv, null);
    },
    
    destroy: function() {
        this.map = null;
        
        if (this.icon != null) {
            this.icon.destroy();
            this.icon = null;
        }
    },
    
    /** 
    * @param {OpenLayers.Pixel} px
    * 
    * @return A new DOM Image with this markers icon set at the 
    *         location passed-in
    * @type DOMElement
    */
    draw: function(px) {
        return this.icon.draw(px);
    }, 

    /**
    * @param {OpenLayers.Pixel} px
    */
    moveTo: function (px) {
        if ((px != null) && (this.icon != null)) {
            this.icon.moveTo(px);
        }            
    },

    /**
     * @param {float} inflate
     */
    inflate: function(inflate) {
        if (this.icon) {
            var newSize = new OpenLayers.Size(this.icon.size.w * inflate,
                                              this.icon.size.h * inflate);
            this.icon.setSize(newSize);
        }        
    },
    
    /** @final @type String */
    CLASS_NAME: "OpenLayers.Marker"
};


/** 
 * @returns A default OpenLayers.Icon to use for a marker
 * @type OpenLayers.Icon
 */
OpenLayers.Marker.defaultIcon = function() {
    var url = OpenLayers.Util.getImagesLocation() + "marker.png";
    var size = new OpenLayers.Size(21, 25);
    var calculateOffset = function(size) {
                    return new OpenLayers.Pixel(-(size.w/2), -size.h);
                 };

    return new OpenLayers.Icon(url, size, null, calculateOffset);        
};
    


@@ -1289,16 +1289,670 @@
     %7D,%0A%0A
+    /**%0A     * @returns Whether or not the marker is currently visible on screen.%0A     * @type Boolean%0A     */%0A    onScreen:function() %7B%0A%0A        var screenBounds = OpenLayers.Bounds.fromSize(this.map.getSize());  %0A%0A        var iconTop = parseInt(this.icon.div.style.top);%0A        var iconLeft = parseInt(this.icon.div.style.left);%0A        var iconBottom = iconTop + parseInt(this.icon.div.style.height);%0A        var iconRight = iconLeft + parseInt(this.icon.div.style.width);%0A        var iconBounds = %0A           new OpenLayers.Bounds(iconLeft, iconBottom, iconRight, iconTop);%0A%0A        return screenBounds.containsBounds(iconBounds, true);%0A    %7D,%0A    %0A
     /**%0A

add first draft of onScreen() function to marker