﻿/// <reference name="MicrosoftAjax.js"/>
/// <reference path="../Common/AjaxCommonBase.js" />

Type.registerNamespace("Crown.Web.Ajax.Controls");

// --------------------------------------------------------------------------
// DynamicContentCtrl Ctrl
// --------------------------------------------------------------------------
Crown.Web.Ajax.Controls.DynamicContentCtrl = function(element) 
{
	this._manager = null;
	Crown.Web.Ajax.Controls.DynamicContentCtrl.initializeBase(this, [element]);
}
Crown.Web.Ajax.Controls.DynamicContentCtrl.prototype = 
{
    initialize: function() 
    {
		// Add this control to our manager
		if (this._manager != null)
			Array.add(this._manager.get_controls(), this);
			
        Crown.Web.Ajax.Controls.DynamicContentCtrl.callBaseMethod(this, 'initialize');
    },
    dispose: function() 
    {
		Crown.Web.Ajax.Controls.DynamicContentCtrl.callBaseMethod(this, 'dispose');
    },
    
    // Gets or sets the control's manager
    get_manager: function() { return this._manager; },
    set_manager: function(value) { this._manager = value; },
    
    // Sets the content for the control
    update: function(content)
    {
		this.get_element().innerHTML = content;
    }
}
Crown.Web.Ajax.Controls.DynamicContentCtrl.registerClass('Crown.Web.Ajax.Controls.DynamicContentCtrl', Crown.Web.Ajax.Controls.AjaxControlBase);
Type.registerNamespace('Crown.Web.Ajax.Controls');Crown.Web.Ajax.Controls.Resource={};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();