(function(E){var C=E.fn.remove;E.fn.remove=function(){E("*",this).add(this).each(function(){E(this).triggerHandler("remove")});return C.apply(this,arguments)};function B(F){function H(I){var J=I.style;return(J.display!="none"&&J.visibility!="hidden")}var G=H(F);(G&&E.each(E.dir(F,"parentNode"),function(){return(G=H(this))}));return G}E.extend(E.expr[":"],{data:function(G,H,F){return E.data(G,F[3])},tabbable:function(G,H,F){var I=G.nodeName.toLowerCase();return(G.tabIndex>=0&&(("a"==I&&G.href)||(/input|select|textarea|button/.test(I)&&"hidden"!=G.type&&!G.disabled))&&B(G))}});E.keyCode={BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38};var D=E.browser.mozilla&&(parseFloat(E.browser.version)<1.9);E.fn.extend({ariaRole:function(F){return(F!==undefined?this.attr("role",D?"wairole:"+F:F):(this.attr("role")||"").replace(/^wairole:/,""))},ariaState:function(G,F){return(F!==undefined?this.each(function(H,I){(D?I.setAttributeNS("http://www.w3.org/2005/07/aaa","aaa:"+G,F):E(I).attr("aria-"+G,F))}):this.attr(D?"aaa:"+G:"aria-"+G))}});function A(I,J,K,H){function G(M){var L=E[I][J][M]||[];return(typeof L=="string"?L.split(/,?\s+/):L)}var F=G("getter");if(H.length==1&&typeof H[0]=="string"){F=F.concat(G("getterSetter"))}return(E.inArray(K,F)!=-1)}E.widget=function(F,G){var H=F.split(".")[0];F=F.split(".")[1];E.fn[F]=function(L){var J=(typeof L=="string"),K=Array.prototype.slice.call(arguments,1);if(J&&L.substring(0,1)=="_"){return this}if(J&&A(H,F,L,K)){var I=E.data(this[0],F);return(I?I[L].apply(I,K):undefined)}return this.each(function(){var M=E.data(this,F);(!M&&!J&&E.data(this,F,new E[H][F](this,L)));(M&&J&&E.isFunction(M[L])&&M[L].apply(M,K))})};E[H]=E[H]||{};E[H][F]=function(K,J){var I=this;this.widgetName=F;this.widgetEventPrefix=E[H][F].eventPrefix||F;
this.widgetBaseClass=H+"-"+F;this.options=E.extend({},E.widget.defaults,E[H][F].defaults,E.metadata&&E.metadata.get(K)[F],J);this.element=E(K).bind("setData."+F,function(N,L,M){return I._setData(L,M)}).bind("getData."+F,function(M,L){return I._getData(L)}).bind("remove",function(){return I.destroy()});this._init()};E[H][F].prototype=E.extend({},E.widget.prototype,G);E[H][F].getterSetter="option"};E.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName)},option:function(H,I){var G=H,F=this;if(typeof H=="string"){if(I===undefined){return this._getData(H)}G={};G[H]=I}E.each(G,function(J,K){F._setData(J,K)})},_getData:function(F){return this.options[F]},_setData:function(F,G){this.options[F]=G;if(F=="disabled"){this.element[G?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(G,I,H){var F=(G==this.widgetEventPrefix?G:this.widgetEventPrefix+G);I=I||E.event.fix({type:F,target:this.element[0]});return this.element.triggerHandler(F,[I,H],this.options[G])}};E.widget.defaults={disabled:false};E.ui={plugin:{add:function(G,H,J){var I=E.ui[G].prototype;for(var F in J){I.plugins[F]=I.plugins[F]||[];I.plugins[F].push([H,J[F]])}},call:function(F,H,G){var J=F.plugins[H];if(!J){return }for(var I=0;I<J.length;I++){if(F.options[J[I][0]]){J[I][1].apply(F.element,G)}}}},cssCache:{},css:function(F){if(E.ui.cssCache[F]){return E.ui.cssCache[F]}var G=E('<div class="ui-gen">').addClass(F).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");E.ui.cssCache[F]=!!((!(/auto|default/).test(G.css("cursor"))||(/^[1-9]/).test(G.css("height"))||(/^[1-9]/).test(G.css("width"))||!(/none/).test(G.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(G.css("backgroundColor"))));try{E("body").get(0).removeChild(G.get(0))}catch(H){}return E.ui.cssCache[F]},disableSelection:function(F){return E(F).attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false
})},enableSelection:function(F){return E(F).attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},hasScroll:function(I,G){if(E(I).css("overflow")=="hidden"){return false}var F=(G&&G=="left")?"scrollLeft":"scrollTop",H=false;if(I[F]>0){return true}I[F]=1;H=(I[F]>0);I[F]=0;return H}};E.ui.mouse={_mouseInit:function(){var F=this;this.element.bind("mousedown."+this.widgetName,function(G){return F._mouseDown(G)});if(E.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(E.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(H){(this._mouseStarted&&this._mouseUp(H));this._mouseDownEvent=H;var G=this,I=(H.which==1),F=(typeof this.options.cancel=="string"?E(H.target).parents().add(H.target).filter(this.options.cancel).length:false);if(!I||F||!this._mouseCapture(H)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){G.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(H)&&this._mouseDelayMet(H)){this._mouseStarted=(this._mouseStart(H)!==false);if(!this._mouseStarted){H.preventDefault();return true}}this._mouseMoveDelegate=function(J){return G._mouseMove(J)};this._mouseUpDelegate=function(J){return G._mouseUp(J)};E(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},_mouseMove:function(F){if(E.browser.msie&&!F.button){return this._mouseUp(F)}if(this._mouseStarted){this._mouseDrag(F);return false}if(this._mouseDistanceMet(F)&&this._mouseDelayMet(F)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,F)!==false);(this._mouseStarted?this._mouseDrag(F):this._mouseUp(F))}return !this._mouseStarted},_mouseUp:function(F){E(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;this._mouseStop(F)}return false},_mouseDistanceMet:function(F){return(Math.max(Math.abs(this._mouseDownEvent.pageX-F.pageX),Math.abs(this._mouseDownEvent.pageY-F.pageY))>=this.options.distance)},_mouseDelayMet:function(F){return this.mouseDelayMet},_mouseStart:function(F){},_mouseDrag:function(F){},_mouseStop:function(F){},_mouseCapture:function(F){return true}};E.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);
