// Register the namespace for the control.
Type.registerNamespace("Brainstorming.WebControls.HoveredItem");

Brainstorming.WebControls.HoveredItem.HoveredImage = function(element)
{   
    Brainstorming.WebControls.HoveredItem.HoveredImage.initializeBase(this, [element]);
    
    this._elem = this.get_element();
   
    this._imageUrl = null;
    this._hoverImageUrl = null;
    
//    this._image = new Image();
//    this._hoverImage = new Image();
    
};

Brainstorming.WebControls.HoveredItem.HoveredImage.prototype =
{
    initialize : function() 
    {
        Brainstorming.WebControls.HoveredItem.HoveredImage.callBaseMethod(this, "initialize");
        
        $addHandlers(this.get_element(), 
                     { 'mouseover' : this._onMouseOver,
                       'mouseout' : this._onMouseOut},
                     this);
                     
//        this._image.src = this._imageUrl;                     
//        this._hoverImage.src = this._hoverImageUrl;                     
        
    }, 
    
    dispose : function()
    {
        $clearHandlers(this._elem);
        
        Brainstorming.WebControls.HoveredItem.HoveredImage.callBaseMethod(this, "dispose");
    },
    

    _onMouseOver : function()
    {
        window.status = this._hoverImageUrl;
        this._elem.src = this._hoverImageUrl;
    },
    
    _onMouseOut : function()
    {
        this._elem.src = this._imageUrl;
    },

    get_hoverImageUrl: function()
    {
        return this._hoverImageUrl;
    },
    
    set_hoverImageUrl : function(value)
    {
        if (this._hoverImageUrl != value)
        {
            this._hoverImageUrl = value;
            this.raisePropertyChanged("hoverImageUrl");
        }
    },
 

    get_imageUrl: function()
    {
        return this._imageUrl;
    },
    
    set_imageUrl : function(value)
    {
        if (this._imageUrl != value)
        {
            this._imageUrl = value;
            this.raisePropertyChanged("imageUrl");
        }
    }

//    get_hoverCss: function()
//    {
//        return this._hoverCss;
//    },
//    
//    set_hoverCss : function(value)
//    {
//        this._hoverCss = value;
//        this.raisePropertyChanged("hoverCss");
//    },


//    get_cssClass: function()
//    {
//        return this._cssClass;
//    },
//    
//    set_cssClass : function(value)
//    {
//        this._cssClass = value;
//        this.raisePropertyChanged("imageUrl");
//    }
    
}

Brainstorming.WebControls.HoveredItem.HoveredImage.registerClass("Brainstorming.WebControls.HoveredItem.HoveredImage", Sys.UI.Control);

if (typeof(Sys) !== "undefined")
{
    Sys.Application.notifyScriptLoaded();
}
