/*______________
|       ______  |   U I Z E     J A V A S C R I P T     A P I
|     /      /  |   -----------------------------------------
|    /    O /   |    MODULE : Uize.Widget Class (version 1.1.0)
|   /    / /    |    AUTHOR : Chris van Rensburg (http://www.tomkidding.com)
|  /    / /  /| |    ONLINE : http://www.tomkidding.com/uize/uize-js-api
| /____/ /__/_| | COPYRIGHT : (c)2005 Chris van Rensburg
|           |__ |   LICENSE : Distributed under the terms of the GNU General Public License
|_______________|             http://www.gnu.org/licenses/gpl.txt
*/
(function(){var b_a=null,b_b=true,b_c=false,b_d='undefined',b_e=Uize.Element;var b_f=Uize.Widget=Uize.subclass(function(){var b_g=this;b_g.widgets={map:{},add:function(b_h,b_i){this.map[b_h]=b_i;b_i.parentWidget=b_g;},checkInherited:function(b_j){var b_k=this.map;for(var b_h in b_k)b_k[b_h].checkInherited(b_j);},insertUi:function(){b_f.doForObjects(this.map,'insertUi')},removeUi:function(){b_f.doForObjects(this.map,'removeUi')},
set:function(b_l){b_f.doForObjects(this.map,function(){this.set(b_l)})},updateUi:function(){b_f.doForObjects(this.map,'updateUi')},wireUi:function(){b_f.doForObjects(this.map,'wireUi')},remove:function(b_i){var b_k=this.map;for(var b_h in b_k){if(b_h===b_i||b_k[b_h]===b_i){b_k[b_h].removeUi();delete b_k[b_h];break;}}}};b_g.b_m={};}),b_n=b_f.prototype;b_n.getUiElement=function(b_o){return b_e.getById(this.b_p+b_o);};b_n.checkInherited=function(b_j){var b_g=this,b_q=typeof b_g.b_m[b_j]!=b_d?b_g.b_m[b_j]:'inherit',b_r=b_g.getInherited(b_j);if(b_r!=b_q){b_g.b_m[b_j]=b_r;b_g.updateUi();b_g.widgets.checkInherited(b_j);}};b_n.getInherited=function(b_j){var b_g=this,b_s=b_g.get(b_j);if(typeof b_s==b_d)b_s='inherit';if(b_s==='inherit'){var b_t=b_g.parentWidget;if(b_t)b_s=typeof b_t.getInherited=='function'?b_t.getInherited(b_j):b_t.get(b_j);}return b_s;};b_n.isEnabled=function(){return this.getInherited('enabled')!==b_c};b_n.isBusy=function(){return this.getInherited('busy')===b_b};b_n.insertUi=function(){
var b_g=this;if(b_g.b_u!=b_a)b_e.insertHtml(b_f.substituteInto(b_f.substituteInto(b_g.substituteResources(typeof b_g.b_u=='string'?b_g.b_u:b_g.b_u()),b_g.b_v),b_g.b_w),b_g.b_x);b_g.widgets.insertUi();b_g.wireUi();};b_n.removeUi=function(){this.widgets.removeUi()};b_n.updateUi=function(){};b_n.wireUi=function(){var b_g=this;if(!b_g.b_y){b_g.b_y=b_b;b_g.widgets.wireUi();b_g.updateUi();}};function b_z(b_A){b_f[b_A]=function(){this.doForInstance(b_A)}}b_z('insertUi');b_z('updateUi');b_z('wireUi');b_z('removeUi');b_f.registerProperties({b_B:{name:'busy',onChange:function(){this.checkInherited('busy')}},b_x:'container',b_p:{name:'elementIdPrefix',onChange:function(){this.b_p=this.substituteResources(this.b_p);this.updateUi();}},b_C:{name:'enabled',onChange:function(){this.checkInherited('enabled')}},b_u:'html',b_v:'htmlSubstitutions',b_w:'substitutions',b_y:'uiWired'});b_f.set({b_B:'inherit',b_x:b_a,b_p:'[#objectName]_',b_C:'inherit',b_u:b_a,b_v:{},b_w:{},b_y:b_c});var b_D=window.onload;window.onload=function(){
if(typeof b_D=='function')b_D();b_f.fireEvent('Document Loaded');}})();
