// Gaia Ajax Widgets Copyright (C) 2007 - 2008 Gaiaware AS. details at http://ajaxwidgets.com/
Gaia.CheckBox=Class.create();Object.extend(Gaia.CheckBox.prototype,Gaia.WebControl.prototype);Object.extend(Gaia.CheckBox.prototype,{initialize:function(element,options){this.initializeCheckBox(element,options);},initializeCheckBox:function(element,options){this.initializeWebControl(element,options);},setTabIndex:function(value){var checkbox=this._getCheckBox();checkbox.tabIndex=value;return this;},setEnabled:function(value){var checkbox=this._getCheckBox();value?Form.Element.enable(checkbox):Form.Element.disable(checkbox);if(value&&checkbox.hasAttribute('disabled')){checkbox.removeAttribute('disabled');}
return this;},setText:function(value){this.element.select('label')[0].innerHTML=value;return this;},setAutoPostBack:function(value){if(value==true){if(this._checkboxCheckListener==null)
{this._checkboxCheckListener=this._onEvent.bindAsEventListener(this,'click',true);Element.observe(this._getCheckBox(),'click',this._checkboxCheckListener);}}else{if(this._checkboxCheckListener!=null){Element.stopObserving(this._getCheckBox(),'click',this._checkboxCheckListener);delete this._checkboxCheckListener;}}
return this;},destroy:function(){this.setAutoPostBack(false);this._destroyImpl();},setChecked:function(value){this._getCheckBox().checked=value;return this;},setTextAlign:function(value){var elToMove=this.element.select('label')[0];this.element.removeChild(elToMove);if(value=='Left'){this.element.insertBefore(elToMove,this._getCheckBox());}else{this.element.appendChild(elToMove);}
return this;},_getElementPostValue:function(){return($F(this._getCheckBox())=='on'?'&'+this.getCallbackName()+'='+$F(this._getCheckBox()):'');},_getElementPostValueEvent:function(){return($F(this._getCheckBox())=='on'?'&'+this.getCallbackName()+'='+$F(this._getCheckBox()):'')+'&__EVENTTARGET='+this.getCallbackName();},_getCheckBox:function(){return $(this.element.id+"_checkbox");}});Gaia.CheckBox.browserFinishedLoading=true;