/*******************************************************************************
 *
 * class UI.ImageButton
 *
 ******************************************************************************/


ImageButton.prototype = new Control();
ImageButton.prototype.constructor = ImageButton;

function ImageButton( jquery_element ) {
    Control.call( this, jquery_element );
}

UI.ImageButton = ImageButton;

ImageButton.add = function( properties ) {
    // Build DOM objects.
    var $control = $('<img/>');
    $control.addClass('control control-imagebutton');
    // Initialize wrapper.
    var control = new ImageButton( $control );
    control.update( properties );
    // Set up events.
    UI.add_event( 'click', $control );
    // Attach to document.
    control.attach();
    return control;
};
ImageButton.prototype.set_file = function( value ) {
    this.control.attr( 'src', value );
    return value;
};
