(function(){Type.registerNamespace("Smarthouse.Web.UI");var b=Smarthouse.Web.UI;var a=b.ClientScriptControl=function(c){a.initializeBase(this,[c]);this._applicationLoadDelegate=null;this._localization={};this._debugEnabled=false};a.prototype={get_debugEnabled:function(){return this._debugEnabled},set_debugEnabled:function(c){if(c){$smarthouse.debug.enable()}this._debugEnabled=c},initialize:function(){a.callBaseMethod(this,"initialize");this.debug_trace("Initializing control.");Sys.Application.add_load(this._applicationLoadDelegate=Function.createDelegate(this,this.application_load))},dispose:function(){this.debug_trace("Disposing control.");if(this._applicationLoadDelegate!=null){Sys.Application.remove_load(this._applicationLoadDelegate);delete this._applicationLoadDelegate}a.callBaseMethod(this,"dispose")},application_load:function(){this.debug_trace("Late initializing control on application load.");Sys.Application.remove_load(this._applicationLoadDelegate);delete this._applicationLoadDelegate},get_localization:function(){return this._localization},translate:function(){var e=this.get_localization()[arguments[0]];if(arguments[1]){if(arguments[2]){var c=new Array();for(var d=1;d<arguments.length;d++){c[d-1]=arguments[d]}return e.xFormat(c)}return e.xFormat(arguments[1])}return e},add_handler:function(d,c){this.get_events().addHandler(d,c)},remove_handler:function(d,c){this.get_events().removeHandler(d,c)},raise_event:function(e,c){var d=this.get_events().getHandler(e);if(d){if(!c){c=Sys.EventArgs.Empty}d(this,c)}},_buildMessage:function(c){return Object.getType(this).getName()+" ("+this.get_id()+"): "+c},debug_assert:function(c,e,d){if(this.get_debugEnabled()){$smarthouse.debug.assert(c,this._buildMessage(e),d)}},debug_clearTrace:function(){if(this.get_debugEnabled()){$smarthouse.debug.clearTrace()}},debug_fail:function(c){if(this.get_debugEnabled()){$smarthouse.debug.fail(this._buildMessage(c))}},debug_trace:function(c){if(this.get_debugEnabled()){$smarthouse.debug.trace(this._buildMessage(c))}},debug_traceDump:function(d,c){if(this.get_debugEnabled()){$smarthouse.debug.traceDump(d,this._buildMessage(c))}},_end:function(){}};a.registerClass("Smarthouse.Web.UI.ClientScriptControl",Sys.UI.Control)})();
