/*
 * jQuery UI Widget 1.8.2
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var a=b.fn.remove;b.fn.remove=function(c,d){return this.each(function(){if(!d){if(!c||b.filter(c,[this]).length){b("*",this).add(this).each(function(){b(this).triggerHandler("remove");});}}return a.call(b(this),c,d);});};b.widget=function(g,c,h){var f=g.split(".")[0],d;g=g.split(".")[1];d=f+"-"+g;if(!h){h=c;c=b.Widget;}b.expr[":"][d]=function(i){return !!b.data(i,g);};b[f]=b[f]||{};b[f][g]=function(j,i){if(arguments.length){this._createWidget(j,i);}};var e=new c();e.options=b.extend({},e.options);b[f][g].prototype=b.extend(true,e,{namespace:f,widgetName:g,widgetEventPrefix:b[f][g].prototype.widgetEventPrefix||g,widgetBaseClass:d},h);b.widget.bridge(g,b[f][g]);};b.widget.bridge=function(d,c){b.fn[d]=function(h){var f=typeof h==="string",e=Array.prototype.slice.call(arguments,1),g=this;h=!f&&e.length?b.extend.apply(null,[true,h].concat(e)):h;if(f&&h.substring(0,1)==="_"){return g;}if(f){this.each(function(){var j=b.data(this,d),i=j&&b.isFunction(j[h])?j[h].apply(j,e):j;if(i!==j&&i!==undefined){g=i;return false;}});}else{this.each(function(){var i=b.data(this,d);if(i){if(h){i.option(h);}i._init();}else{b.data(this,d,new c(h,this));}});}return g;};};b.Widget=function(d,c){if(arguments.length){this._createWidget(d,c);}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(d,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],d);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy();});this._create();this._init();},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled");},widget:function(){return this.element;},option:function(f,c){var e=f,d=this;if(arguments.length===0){return b.extend({},d.options);}if(typeof f==="string"){if(c===undefined){return this.options[f];}e={};e[f]=c;}b.each(e,function(g,h){d._setOption(g,h);});return d;},_setOption:function(c,d){this.options[c]=d;if(c==="disabled"){this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",d);}return this;},enable:function(){return this._setOption("disabled",false);},disable:function(){return this._setOption("disabled",true);},_trigger:function(g,h,c){var e=this.options[g];h=b.Event(h);h.type=(g===this.widgetEventPrefix?g:this.widgetEventPrefix+g).toLowerCase();c=c||{};if(h.originalEvent){for(var d=b.event.props.length,f;d;){f=b.event.props[--d];h[f]=h.originalEvent[f];}}this.element.trigger(h,c);return !(b.isFunction(e)&&e.call(this.element[0],h,c)===false||h.isDefaultPrevented());}};})(jQuery);
