/*______________
|       ______  |   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-2006 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,b_g=b_f.Widget=b_f.subclass(function(){var b_h=this;function b_i(b_j){return b_h.b_k+(b_h.b_l?'_':'')+b_j;}b_h.widgets={map:{},b_m:function(b_n){var b_o=this.map;for(var b_j in b_o){var b_p=b_o[b_j];if(!b_p.b_k)b_p.b_k=b_i(b_j);b_p[b_n]();}},add:function(b_j,b_p){this.map[b_j]=b_p;b_p.parentWidget=b_h;if(!b_p.b_k&&b_h.b_k)b_p.b_k=b_i(b_j);return b_p;},
checkInherited:function(b_q){var b_o=this.map;for(var b_j in b_o)b_o[b_j].checkInherited(b_q);},insertUi:function(){this.b_m('insertUi')},kill:function(){b_g.doForObjects(this.map,'kill')},removeUi:function(){b_g.doForObjects(this.map,'removeUi')},set:function(b_r){b_g.doForObjects(this.map,function(){this.set(b_r)})},updateUi:function(){b_g.doForObjects(this.map,'updateUi')},wireUi:function(){this.b_m('wireUi')},unwireUi:function(){b_g.doForObjects(this.map,'unwireUi')},remove:function(b_p){var b_o=this.map;for(var b_j in b_o){if(b_j===b_p||b_o[b_j]===b_p){b_o[b_j].unwireUi();delete b_o[b_j].parentWidget;delete b_o[b_j];break;}}}};b_h.b_s={};}),b_t=b_g.prototype;b_t.wired=function(b_u){if(typeof b_u=='boolean')this.set({b_u:b_u});return this.b_u;};b_t.getNode=b_t.getUiElement=function(b_v){return b_e.resolve(b_v||'',this.b_k,this.b_l?'-':'');};b_t.displayNode=function(b_w,b_x){return b_e.display(this.getNode(b_w),b_x);};b_t.removeNode=function(b_w){return b_e.remove(this.getNode(b_w));};
b_t.setNodeProperties=function(b_w,b_r){return b_e.setProperties(this.getNode(b_w),b_r);};b_t.setNodeOpacity=function(b_w,b_y){return b_e.setOpacity(this.getNode(b_w),b_y);};b_t.setNodeStyle=function(b_w,b_z){return b_e.setStyle(this.getNode(b_w),b_z);};b_t.setNodeClipRect=function(b_w,b_A,b_B,b_C,b_D){return b_e.setClipRect(this.getNode(b_w),b_A,b_B,b_C,b_D);};b_t.setNodeInnerHtml=function(b_w,b_E){return b_e.setInnerHtml(this.getNode(b_w),b_E);};b_t.showNode=function(b_w,b_F){return b_e.show(this.getNode(b_w),b_F);};b_t.wireNodeEvent=function(b_w,b_G,b_H){return b_e.wireEvent(this.getNode(b_w),b_G,b_H,this.objectName);};b_t.wireNodeEvents=function(b_w,b_I){return b_e.wireEvents(this.getNode(b_w),b_I,this.objectName);};b_t.checkInherited=function(b_q){var b_h=this,b_J=typeof b_h.b_s[b_q]!=b_d?b_h.b_s[b_q]:'inherit',b_K=b_h.getInherited(b_q);if(b_K!=b_J){b_h.b_s[b_q]=b_K;if(b_q!='busy'){b_h.updateUi();}else if(b_h.updateUiBusy){b_h.updateUiBusy();}b_h.widgets.checkInherited(b_q);}};
b_t.getInherited=function(b_q){var b_h=this,b_L=b_h.get(b_q);if(typeof b_L==b_d)b_L='inherit';if(b_L==='inherit'){var b_M=b_h.parentWidget;if(b_M)b_L=typeof b_M.getInherited=='function'?b_M.getInherited(b_q):b_M.get(b_q);}return b_L;};b_t.isEnabled=function(){return this.getInherited('enabled')!==b_c};b_t.isBusy=function(){return this.getInherited('busy')===b_b};b_t.kill=function(){this.widgets.kill();b_f.prototype.kill.call(this);};b_t.insertUi=function(){var b_h=this;if(!b_h.b_k)b_h.b_k=b_h.objectName+(b_h.b_l?'':'_');if(b_h.b_E)b_e.insertHtml(b_g.substituteInto(b_g.substituteInto(b_h.substituteResources(typeof b_h.b_E=='string'?b_h.b_E:b_h.b_E()),b_h.b_N),b_g.addPropertiesToObject({idPrefix:b_h.b_k},b_h.b_O)),b_h.b_P||b_h.getNode());b_h.widgets.insertUi();b_h.wireUi();};b_t.removeUi=function(){var b_h=this;b_h.unwireUi();b_h.removeNode();b_h.widgets.removeUi();};b_t.updateUi=function(){};b_t.wireUi=function(){var b_h=this;if(!b_h.b_u){b_h.b_u=b_b;b_h.widgets.wireUi();b_h.updateUi();}};
b_t.unwireUi=function(){var b_h=this;if(b_h.b_u){b_e.unwireEventsByOwnerId(b_h.objectName);b_h.widgets.unwireUi();b_h.b_u=b_c;}};b_g.spawn=function(b_r){var b_h=this,b_Q=[];b_e.doForAll(b_r.idPrefix,function(b_R){b_r.idPrefix=b_R;var b_S=new b_h(b_r);b_S.wireUi();b_Q.push(b_S);});return b_Q;};b_g.registerProperties({b_T:{name:'busy',onChange:function(){this.checkInherited('busy')}},b_P:'container',b_k:{name:'idPrefix|elementIdPrefix|element',onChange:function(){var b_h=this;if(b_e.isNode(b_h.b_k)){if(!b_h.b_k.id)b_h.b_k.id=Uize.getGuid();b_h.b_k=b_h.b_k.id;}if(b_h.b_u){b_h.b_u=b_c;b_h.wireUi();}}},b_U:{name:'enabled',onChange:function(){this.checkInherited('enabled')}},b_E:'html',b_N:'htmlSubstitutions',b_O:'substitutions',b_l:'useNewIdSyntax',b_u:'wired|uiWired'});b_g.set({b_T:'inherit',b_P:b_a,b_U:'inherit',b_N:{},b_O:{},b_l:b_c,b_u:b_c});function b_V(){clearTimeout(b_W);if(typeof b_X=='function')b_X();b_g.fireEvent('Document Loaded');}var b_X=window.onload,b_W=setTimeout(b_V,15000);window.onload=b_V;
var b_Y=window.onresize;window.onresize=function(){b_g.fireEvent('Window Resized');if(typeof b_Y=='function')b_Y();};})();