if(typeof Obout=="undefined"){Obout=function(){};Obout.Interface=function(){}}Obout.Interface.OboutCheckBox=function(k,a,g,l,j,i,e,h,f,d,c){this.ID=k;this.Type="OboutCheckBox";if(a!=""&&a!=this.ID){if(typeof Obout.Interface.OboutCheckBox.PageCheckBoxes=="undefined")Obout.Interface.OboutCheckBox.PageCheckBoxes={};if(typeof Obout.Interface.OboutCheckBox.PageCheckBoxes[a]=="undefined")Obout.Interface.OboutCheckBox.PageCheckBoxes[a]=[];Obout.Interface.OboutCheckBox.PageCheckBoxes[a].push(this);this.ParentCheckBoxID=a}this.Container=document.getElementById(g);var b=this.Container.lastChild.previousSibling;if(b.nodeName!="SPAN")b=b.previousSibling;this.CheckBox=b.childNodes[0];this.ClientSideEvents=e;this.CssSettings=h;this.IsOver=false;this.IsFocused=i;this.CheckedState=1;this.IsDisabled=!j;this.HandleBlur=true;this.RaiseFocusEvent=true;this.AllowCascadePropagationToParent=true;this.AllowCascadePropagationToChildren=true;this.AttachedEventHandlers=[];this._controlsToEnable=f;this._controlsToDisable=d;this.CreateOnlyClientObject=c;this._initialStateHandled=false;this.init();this._initialized=true};Obout.Interface.OboutCheckBox.prototype.init=function(){this.attachEventHandlers();if(this.IsDisabled)this.disable();else this.IsFocused&&this.handleFocus();if(this.CheckBox.checked)this.updateCheckedState();else(this._controlsToEnable||this._controlsToDisable)&&this.enableDependentControls()};Obout.Interface.OboutCheckBox.prototype.attachEventHandlers=function(){var a=this;this.Container.onmouseover=function(){a.handleMouseOver()};this.Container.onmouseout=function(){a.handleMouseOut()};this.Container.onmousedown=function(){a.handleMouseDown()};this.CheckBox.onfocus=function(){a.handleFocus()};this.CheckBox.onblur=function(){a.handleBlur()};this.Container.onclick=function(){a.handleClick()};Obout.Interface.OboutCore.attachEventHandler(document,"mouseup",function(){a.handleMouseUp()},this.AttachedEventHandlers)};Obout.Interface.OboutCheckBox.prototype.handleMouseOver=function(){this.IsOver=true;this.updateState()};Obout.Interface.OboutCheckBox.prototype.handleMouseOut=function(){this.IsOver=false;this.updateState()};Obout.Interface.OboutCheckBox.prototype.mouseout=function(){this.handleMouseOut()};Obout.Interface.OboutCheckBox.prototype.handleMouseDown=function(){this.HandleBlur=false;window.setTimeout(this.ID+".focus();",100)};Obout.Interface.OboutCheckBox.prototype.handleMouseUp=function(){this.HandleBlur=true};Obout.Interface.OboutCheckBox.prototype.handleFocus=function(){this.RaiseFocusEvent&&!this.IsFocused&&this.ClientSideEvents.OnFocus&&this.ClientSideEvents.OnFocus(this);if(this.RaiseFocusEvent==false)this.RaiseFocusEvent=true;this.IsFocused=true;this.updateState()};Obout.Interface.OboutCheckBox.prototype.handleBlur=function(){if(this.HandleBlur){this.ClientSideEvents.OnBlur&&this.ClientSideEvents.OnBlur(this);this.IsFocused=false;this.RaiseFocusEvent=true;this.updateState()}};Obout.Interface.OboutCheckBox.prototype.blur=function(){this.handleMouseOut();this.CheckBox.blur();this.handleBlur()};Obout.Interface.OboutCheckBox.prototype.handleClick=function(){if(!this.IsDisabled){if(this.ClientSideEvents.OnFocus&&!this.IsFocused){this.ClientSideEvents.OnFocus(this);this.RaiseFocusEvent=false}this.ClientSideEvents.OnClick&&this.ClientSideEvents.OnClick(this);this.updateCheckedState();var a=true;if(this.ClientSideEvents.OnCheckedChanged)a=this.ClientSideEvents.OnCheckedChanged(this,this.CheckedState==2,this.CheckedState);window.setTimeout(this.ID+".focus();",100);a&&this.CheckBox.onclick&&this.CheckBox.onclick()}};Obout.Interface.OboutCheckBox.prototype.updateCheckedState=function(){if(this.CheckedState==1||this.CheckedState==3){this.CheckedState=2;this.CheckBox.checked=true}else{this.CheckedState=1;this.CheckBox.checked=false}this.manageParentChildRelations();this.updateState()};Obout.Interface.OboutCheckBox.prototype.setCheckedState=function(){if(this.CheckedState==1)this.CheckBox.checked=false;else if(this.CheckedState==2)this.CheckBox.checked=true;this.manageParentChildRelations()};Obout.Interface.OboutCheckBox.prototype.manageParentChildRelations=function(){if(Obout.Interface.OboutCheckBox.PageCheckBoxes){Obout.Interface.OboutCheckBox.PageCheckBoxes[this.ID]&&this.CheckedState!=3&&this.AllowCascadePropagationToChildren&&this.manageChildrenState();if(this.ParentCheckBoxID&&this.AllowCascadePropagationToParent){var a=eval(this.ParentCheckBoxID);a.manageParentState()}}(this._controlsToEnable||this._controlsToDisable)&&this.enableDependentControls()};Obout.Interface.OboutCheckBox.prototype.enableDependentControls=function(){if(this._initialized){Obout.Interface.OboutCore.enableDependentControls(this);this._initialStateHandled=true}else window.setTimeout(Obout.Interface.OboutCore.createDelegate(this,this.enableDependentControls),250)};Obout.Interface.OboutCheckBox.prototype.manageChildrenState=function(){for(var b=Obout.Interface.OboutCheckBox.PageCheckBoxes[this.ID],a=0;a<b.length;a++){b[a].AllowCascadePropagationToParent=false;b[a].checked(this.CheckedState);b[a].AllowCascadePropagationToParent=true}};Obout.Interface.OboutCheckBox.prototype.manageParentState=function(){this.AllowCascadePropagationToChildren=false;if(Obout.Interface.OboutCheckBox.PageCheckBoxes[this.ID]){for(var e=Obout.Interface.OboutCheckBox.PageCheckBoxes[this.ID],b=false,a=false,d=false,c=0;c<e.length;c++){var f=e[c].checked();if(f!=Obout.Interface.OboutCheckBox.CheckedState.PartiallyChecked)if(f==true)b=true;else a=true;else d=true}if(!d)if(!b&&a)this.checked(Obout.Interface.OboutCheckBox.CheckedState.Unchecked);else if(b&&!a)this.checked(Obout.Interface.OboutCheckBox.CheckedState.Checked);else this.checked(Obout.Interface.OboutCheckBox.CheckedState.PartiallyChecked);else this.checked(Obout.Interface.OboutCheckBox.CheckedState.PartiallyChecked)}this.AllowCascadePropagationToChildren=true};Obout.Interface.OboutCheckBox.prototype.click=function(){this.CheckBox.click()};Obout.Interface.OboutCheckBox.prototype.focus=function(){if(!this.IsDisabled)try{this.CheckBox.focus()}catch(a){}};Obout.Interface.OboutCheckBox.prototype.checked=function(a){if(typeof a!="undefined"){var b=this.CheckedState;if(a.toString()=="true"||a.toString()=="false")if(a==true)this.CheckedState=2;else this.CheckedState=1;else this.CheckedState=a;this.setCheckedState();this.updateState();this.ClientSideEvents.OnCheckedChanged&&b!=this.CheckedState&&this.ClientSideEvents.OnCheckedChanged(this,this.CheckedState==2,this.CheckedState)}else return this.CheckedState==1||this.CheckedState==2?this.CheckBox.checked:Obout.Interface.OboutCheckBox.CheckedState.PartiallyChecked};Obout.Interface.OboutCheckBox.prototype.enable=function(){this.CheckBox.disabled=false;this.IsDisabled=false;this.updateState()};Obout.Interface.OboutCheckBox.prototype.disable=function(){this.CheckBox.disabled=true;this.IsDisabled=true;this.updateState()};Obout.Interface.OboutCheckBox.prototype.updateState=function(){if(!this.IsDisabled)switch(this.CheckedState){case 1:if(this.IsFocused)this.changeState("UF");else if(this.IsOver)this.changeState("UO");else this.changeState("UN");break;case 2:if(this.IsFocused)this.changeState("CF");else if(this.IsOver)this.changeState("CO");else this.changeState("CN");break;case 3:if(this.IsFocused)this.changeState("PF");else if(this.IsOver)this.changeState("PO");else this.changeState("PN")}else switch(this.CheckedState){case 1:this.changeState("UD");break;case 2:this.changeState("CD");break;case 3:this.changeState("PD")}};Obout.Interface.OboutCheckBox.prototype.changeState=function(a){if(a!=this.PreviousState){this.Container.className=this.CssSettings[a];this.PreviousState=a}};Obout.Interface.OboutCheckBox.prototype.destruct=function(){this.detachEventHandlers();this.CheckBox=null;this.Container=null};Obout.Interface.OboutCheckBox.prototype.detachEventHandlers=function(){if(this.Container){this.Container.onmouseover=null;this.Container.onmouseout=null;this.Container.onmousedown=null;this.Container.onclick=null}if(this.CheckBox){this.CheckBox.onfocus=null;this.CheckBox.onblur=null}Obout.Interface.OboutCore.detachAllEventHandlers(this.AttachedEventHandlers)};Obout.Interface.OboutCheckBox.prototype.getText=function(){return this.Container.childNodes[1].innerHTML};Obout.Interface.OboutCheckBox.CheckedState=function(){};Obout.Interface.OboutCheckBox.CheckedState.Unchecked=1;Obout.Interface.OboutCheckBox.CheckedState.Checked=2;Obout.Interface.OboutCheckBox.CheckedState.PartiallyChecked=3;oboutCheckBoxJSLoaded=true;try{if(Sys)Sys.Application&&Sys.Application.notifyScriptLoaded()}catch(ex){};