if(typeof Obout=="undefined")if(typeof Type!="undefined"&&typeof Type.registerNamespace!="undefined")Type.registerNamespace("Obout");else Obout=function(){};if(typeof Obout.Interface=="undefined")Obout.Interface=function(){};Obout.Interface.OboutButton=function(f,b,g,e,d,c,a){this.ID=f;this.Type="OboutButton";this.Container=document.getElementById(b);this.FocusHelper=this.Container.childNodes[2].childNodes[1];this.CssSettings=c;this.Width=g;this.IsOver=false;this.IsPressed=false;this.IsFocused=d;this.IsDisabled=!e;this.IsStillPressed=false;this.AttachedEventHandlers=[];this.CreateOnlyClientObject=a;this.init()};Obout.Interface.OboutButton.prototype.init=function(){this.applyCrossBrowserFixes();this.attachEventHandlers();if(this.IsDisabled)this.disable();else this.IsFocused&&this.handleFocus()};Obout.Interface.OboutButton.prototype.applyCrossBrowserFixes=function(){var c=Obout.Interface.OboutCore.Browser.isIE(),b=Obout.Interface.OboutCore.Browser.isIE6(),a=Obout.Interface.OboutCore.Browser.isIEWithDoctype();if(this.Width==""&&c&&(!a||b))this.Container.childNodes[2].style.display="inline"};Obout.Interface.OboutButton.prototype.attachEventHandlers=function(){var a=this;if(this.FocusHelper.onclick&&this.FocusHelper.onclick.toString().indexOf("WebForm_DoPostBackWithOptions")!=-1)if(typeof WebForm_DoPostBackWithOptions=="undefined"||typeof WebForm_PostBackOptions=="undefined")this.FocusHelper.onclick=null;this.Container.onmouseover=function(){a.handleMouseOver()};this.Container.onmouseout=function(){a.handleMouseOut()};this.Container.onmousedown=function(){a.handleMouseDown()};Obout.Interface.OboutCore.attachEventHandler(document,"mouseup",function(){a.handleMouseUp(false)},this.AttachedEventHandlers);this.FocusHelper.onfocus=function(){a.handleFocus()};this.FocusHelper.onblur=function(){a.handleBlur()};this.Container.onclick=function(){a.handleClick()}};Obout.Interface.OboutButton.prototype.handleMouseOver=function(){this.IsOver=true;if(this.IsStillPressed){this.IsPressed=true;this.IsStillPressed=false}this.updateState()};Obout.Interface.OboutButton.prototype.handleMouseOut=function(){this.IsOver=false;if(this.IsPressed){this.IsStillPressed=true;this.IsPressed=false;this.IsFocused=true}this.updateState()};Obout.Interface.OboutButton.prototype.mouseout=function(){this.handleMouseOut()};Obout.Interface.OboutButton.prototype.handleMouseDown=function(){this.IsPressed=true;this.IsFocused=true;this.updateState()};Obout.Interface.OboutButton.prototype.handleMouseUp=function(a){if(this.IsStillPressed||a){this.IsPressed=false;this.IsStillPressed=false;if(!this.IsDisabled)try{this.FocusHelper.focus()}catch(b){}}};Obout.Interface.OboutButton.prototype.handleFocus=function(){this.IsFocused=true;this.updateState()};Obout.Interface.OboutButton.prototype.handleBlur=function(){this.IsFocused=false;this.updateState()};Obout.Interface.OboutButton.prototype.blur=function(){this.handleMouseOut();this.FocusHelper.blur();this.handleBlur()};Obout.Interface.OboutButton.prototype.handleClick=function(){this.handleMouseUp(true);this.FocusHelper.click()};Obout.Interface.OboutButton.prototype.click=function(){this.FocusHelper.click()};Obout.Interface.OboutButton.prototype.focus=function(){if(!this.IsDisabled)try{this.FocusHelper.focus()}catch(a){}};Obout.Interface.OboutButton.prototype.enable=function(){this.FocusHelper.disabled=false;this.IsDisabled=false;this.updateState()};Obout.Interface.OboutButton.prototype.disable=function(){this.FocusHelper.disabled=true;this.IsDisabled=true;this.updateState()};Obout.Interface.OboutButton.prototype.updateState=function(){if(!this.IsDisabled)if(this.IsPressed)this.changeState("P");else if(this.IsOver)this.changeState("O");else if(this.IsFocused)this.changeState("F");else if(this.IsDisabled)this.changeState("D");else this.changeState("N");else this.changeState("D")};Obout.Interface.OboutButton.prototype.changeState=function(a){if(a!=this.PreviousState){this.Container.className=this.CssSettings[a];this.PreviousState=a}};Obout.Interface.OboutButton.prototype.destruct=function(){return;this.detachEventHandlers();this.FocusHelper=null;this.Container=null};Obout.Interface.OboutButton.prototype.detachEventHandlers=function(){if(this.Container){this.Container.onmouseover=null;this.Container.onmouseout=null;this.Container.onmousedown=null;this.Container.onclick=null}if(this.FocusHelper){this.FocusHelper.onfocus=null;this.FocusHelper.onblur=null}Obout.Interface.OboutCore.detachAllEventHandlers(this.AttachedEventHandlers)};oboutButtonJSLoaded=true;try{if(Sys)Sys.Application&&Sys.Application.notifyScriptLoaded()}catch(ex){};