/*!
 * jQuery UI Widget 1.9m6
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){var l=Array.prototype.slice,o=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}o(a)};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(g){return!!b.data(g,a)};b[e]=b[e]||{};b[e][a]=b.extend(function(g,i){if(!this._createWidget)return new b[e][a](g,i);arguments.length&&this._createWidget(g,i)},b[e][a],{version:d.version});var h=new c;h.options=b.widget.extend({},
h.options);b.each(d,function(g,i){if(b.isFunction(i))d[g]=function(){var p=function(k){return c.prototype[k].apply(this,l.call(arguments,1))},q=function(k,m){return c.prototype[k].apply(this,m)};return function(){var k=this._super,m=this._superApply,n;this._super=p;this._superApply=q;n=i.apply(this,arguments);this._super=k;this._superApply=m;return n}}()});b[e][a].prototype=b.widget.extend(h,{namespace:e,widgetName:a,widgetEventPrefix:a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.extend=
function(a){for(var c=l.call(arguments,1),d=0,e=c.length,f,h;d<e;d++)for(f in c[d]){h=c[d][f];if(c[d].hasOwnProperty(f)&&h!==j)a[f]=b.isPlainObject(h)?b.widget.extend({},a[f],h):h}return a};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=l.call(arguments,1),h=this;d=!e&&f.length?b.widget.extend.apply(null,[d].concat(f)):d;e?this.each(function(){var g=b.data(this,a);if(!g)return b.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+
d+"'");if(!b.isFunction(g[d])||d.charAt(0)==="_")return b.error("no such method '"+d+"' for "+a+" widget instance");var i=g[d].apply(g,f);if(i!==g&&i!==j){h=i&&i.jquery?h.pushStack(i.get()):i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():c(d,this)});return h}};b.Widget=function(a,c){if(!this._createWidget)return new b[namespace][name](a,c);arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",
options:{disabled:false,create:null},_createWidget:function(a,c){c=b(c||this.defaultElement||this)[0];this.element=b(c);this.options=b.widget.extend({},this.options,this._getCreateOptions(),a);this.bindings=b();this.hoverable=b();this.focusable=b();if(c!==this){b.data(c,this.widgetName,this);this._bind({remove:"destroy"})}this._create();this._trigger("create");this._init()},_getCreateOptions:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy();this.element.unbind("."+this.widgetName).removeData(this.widgetName);
this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled");this.bindings.unbind("."+this.widgetName);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:b.noop,widget:function(){return this.element},option:function(a,c){var d=a,e,f,h;if(arguments.length===0)return b.widget.extend({},this.options);if(typeof a==="string"){d={};e=a.split(".");a=e.shift();if(e.length){f=d[a]=b.widget.extend({},
this.options[a]);for(h=0;h<e.length-1;h++){f[e[h]]=f[e[h]]||{};f=f[e[h]]}a=e.pop();if(c===j)return f[a]===j?null:f[a];f[a]=c}else{if(c===j)return this.options[a]===j?null:this.options[a];d[a]=c}}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled"){this.widget().toggleClass(this.widgetBaseClass+"-disabled ui-state-disabled",!!c).attr("aria-disabled",c);this.hoverable.removeClass("ui-state-hover");
this.focusable.removeClass("ui-state-focus")}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_bind:function(a,c){if(c){a=b(a);this.bindings=this.bindings.add(a)}else{c=a;a=this.element}var d=this;b.each(c,function(e,f){function h(){if(!(d.options.disabled===true||b(this).hasClass("ui-state-disabled")))return(typeof f==="string"?d[f]:f).apply(d,arguments)}var g=e.match(/^(\w+)\s*(.*)$/),i=g[1]+"."+d.widgetName;(g=
g[2])?d.widget().delegate(g,i,h):a.bind(i,h)})},_delay:function(a,c){var d=this;return setTimeout(function(){return(typeof a==="string"?d[a]:a).apply(d,arguments)},c||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._bind(a,{mouseenter:function(c){b(c.currentTarget).addClass("ui-state-hover")},mouseleave:function(c){b(c.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._bind(a,{focusin:function(c){b(c.currentTarget).addClass("ui-state-focus")},
focusout:function(c){b(c.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);d=b.isArray(d)?[c].concat(d):[c,d];return!(b.isFunction(e)&&e.apply(this.element[0],d)===false||c.isDefaultPrevented())}};b.each({show:"fadeIn",hide:"fadeOut"},
function(a,c){b.Widget.prototype["_"+a]=function(d,e,f){if(typeof e==="string")e={effect:e};var h,g=!e?a:e===true||typeof e==="number"?c:e.effect||c;e=e||{};if(typeof e==="number")e={duration:e};h=!b.isEmptyObject(e);e.complete=f;e.delay&&d.delay(e.delay);if(h&&b.effects&&(b.effects.effect[g]||b.uiBackCompat!==false&&b.effects[g]))d[a](e);else if(g!==a&&d[g])d[g](e.duration,e.easing,f);else d.queue(function(i){b(this)[a]();f&&f.call(d[0]);i()})}});if(b.uiBackCompat!==false)b.Widget.prototype._getCreateOptions=
function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]}})(jQuery);

