﻿/// <reference name="MicrosoftAjax.js"/>

Type.registerNamespace("WebControls");

// This 'element' here should be the inputEl
WebControls.Button = function(element) {
    WebControls.Button.initializeBase(this, [element]);
    
}

WebControls.Button.prototype = {
    initialize: function() {
        WebControls.Button.callBaseMethod(this, 'initialize');

        var that = this;
        
        $addHandlers(this._element, { click: this._buttonClicked }, this);

    },
    dispose: function() {
        //Add custom dispose actions here
        WebControls.Button.callBaseMethod(this, 'dispose');
    },
    
    _buttonClicked: function() {
        this._raiseEvent("buttonClicked", {});
    },
    
    hide: function() {
        this.get_element().style.display = 'none';
    },
    
    show: function() {
        this.get_element().style.display = '';
    }
 
}
WebControls.Button.createEvent("buttonClicked");

WebControls.Button.registerClass('WebControls.Button', WebControls.BaseInput);

if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();