(function(){var scriptName="ExtendedHover";function execute(){var g="unhover",f="hover",b="unhoverDelay",c=true,e=false,d=null;Type.registerNamespace("Sys.Extended.UI");Sys.Extended.UI.HoverBehavior=function(b){var a=this;Sys.Extended.UI.HoverBehavior.initializeBase(a,[b]);a._elementHandlers=d;a._hoverElementHandlers=d;a._hoverElement=d;a._hoverCount=0;a._unhoverDelay=0;a._hoverDelay=0;a._hoverScript=d;a._unhoverScript=d;a._hoverFired=e};Sys.Extended.UI.HoverBehavior.prototype={_setupHandlersArray:function(){var a=this,b=[];b[0]=Function.createDelegate(a,a._onHover);b[1]=Function.createDelegate(a,a._onUnhover);return b},get_elementHandlers:function(){var a=this;if(!a._elementHandlers)a._elementHandlers=a._setupHandlersArray();return a._elementHandlers},get_hoverElementHandlers:function(){var a=this;if(!a._hoverElementHandlers)a._hoverElementHandlers=a._setupHandlersArray();return a._hoverElementHandlers},get_hoverElement:function(){return this._hoverElement},set_hoverElement:function(b){var a=this;if(b!=a._hoverElement){a._hoverElement&&a._setupHandlers(a._hoverElement,a.get_hoverElementHandlers(),e);a._hoverElement=b;a._hoverElement&&a._setupHandlers(a._hoverElement,a.get_hoverElementHandlers(),c)}},get_hoverDelay:function(){return this._hoverDelay},set_hoverDelay:function(a){this._hoverDelay=a;this.raisePropertyChanged("hoverDelay")},get_hoverScript:function(){return this._hoverScript},set_hoverScript:function(a){this._hoverScript=a},get_unhoverDelay:function(){return this._unhoverDelay},set_unhoverDelay:function(a){this._unhoverDelay=a;this.raisePropertyChanged(b)},get_unhoverScript:function(){return this._unhoverScript},set_unhoverScript:function(a){this._unhoverScript=a},dispose:function(){var a=this,c=a.get_element();if(a._elementHandlers){var b=a.get_elementHandlers();a._setupHandlers(c,b,e);a._elementHandlers=d}if(a._hoverElement){var b=a.get_hoverElementHandlers();a._setupHandlers(a._hoverElement,b,e);a._hoverElement=d}Sys.Extended.UI.HoverBehavior.callBaseMethod(a,"dispose")},initialize:function(){var a=this;Sys.Extended.UI.HoverBehavior.callBaseMethod(a,"initialize");var b=a.get_elementHandlers();a._setupHandlers(a.get_element(),b,c);if(a._hoverElement){b=a.get_hoverElementHandlers();a._setupHandlers(a._hoverElement,b,c)}},add_hover:function(a){this.get_events().addHandler(f,a)},remove_hover:function(a){this.get_events().removeHandler(f,a)},_fireHover:function(){var a=this;if(!a._hoverCount||a._hoverFired)return;var handler=a.get_events().getHandler(f);handler&&handler(a,Sys.EventArgs.Empty);if(a._hoverScript)eval(a._hoverScript);a._hoverFired=c},_onHover:function(){var a=this;a._hoverCount++;if(!a._hoverDelay)a._fireHover();else window.setTimeout(Function.createDelegate(a,a._fireHover),a._hoverDelay)},add_unhover:function(a){this.get_events().addHandler(g,a)},remove_unhover:function(a){this.get_events().removeHandler(g,a)},_fireUnhover:function(){var a=this;if(a._hoverFired&&!a._hoverCount){a._hoverFired=e;var handler=a.get_events().getHandler(g);handler&&handler(a,Sys.EventArgs.Empty);if(a._unhoverScript)eval(a._unhoverScript)}},_onUnhover:function(){var a=this;a._hoverCount--;if(a._hoverCount<=0){a._hoverCount=0;if(!a._unhoverDelay)a._fireUnhover();else window.setTimeout(Function.createDelegate(a,a._fireUnhover),a._unhoverDelay)}},_setupHandlers:function(a,b,e){var d="mouseout",c="mouseover";if(!this.get_isInitialized()||!a)return;if(e){$addHandler(a,c,b[0]);$addHandler(a,"focus",b[0]);$addHandler(a,d,b[1]);$addHandler(a,"blur",b[1])}else{$removeHandler(a,c,b[0]);$removeHandler(a,"focus",b[0]);$removeHandler(a,d,b[1]);$removeHandler(a,"blur",b[1])}}};Sys.Extended.UI.HoverBehavior.descriptor={properties:[{name:"hoverElement",isDomElement:c},{name:b,type:Number}],events:[{name:f},{name:g}]};Sys.Extended.UI.HoverBehavior.registerClass("Sys.Extended.UI.HoverBehavior",Sys.Extended.UI.BehaviorBase);Sys.registerComponent(Sys.Extended.UI.HoverBehavior,{name:f})}if(window.Sys&&Sys.loader)Sys.loader.registerScript(scriptName,["ExtendedBase","ExtendedCommon"],execute);else execute()})();