/// <reference name="MicrosoftAjax.js" />
/// <reference name="dnn.js" assembly="DotNetNuke.WebUtility" />
/// <reference name="dnn.xmlhttp.js" assembly="DotNetNuke.WebUtility" />

Type.registerNamespace('WinDoH.Html');
    
WinDoH.Html.ViewHtml = function()
{
    //Call Base Method
    WinDoH.Html.ViewHtml.initializeBase(this);
    //Member Variables
    this._msgs = {};

    //create delegates (MAKE SURE YOU CLEAN UP IN dispose!)
    this._onLoadDelegate = Function.createDelegate(this, this._onLoad);


    //Event Hookup
    Sys.Application.add_load(this._onLoadDelegate);
}

WinDoH.Html.ViewHtml.prototype =
{
    //Properties
    get_ns: function() {return this.get_id() + '_';},
    get_msgs: function() {return this._msgs;},
    set_msgs: function(value) {this._msgs = Sys.Serialization.JavaScriptSerializer.deserialize(value);},
    //Events
    initialize: function() 
    {
        //Call Base Method    
        WinDoH.Html.ViewHtml.callBaseMethod(this, 'initialize');
    },

    _onLoad: function(src, arg)
    {
    },
    //Methods
    getMessage: function(key)
    {
        return this._msgs[key];
    },

    showMessage: function(msg)
    {
        $get(this.get_ns() + 'lblResponse').innerHTML = msg;
    },
    
    //Private Methods
    _displayWait: function(show)
    {
         document.body.style.cursor=(show ? 'wait' : 'default');
        $get(this.get_ns() + 'imgAjax').className = (show ? '' : 'ceHidden');
    },

    dispose: function()
    {
        this._onLoadDelegate = null;
    }
}

//register class and inherit from Sys.Component
WinDoH.Html.ViewHtml.registerClass('WinDoH.Html.ViewHtml', Sys.Component);

