;(function(c){c.ui={plugin:{add:function(a,b,f){var d=c.ui[a].prototype;for(var g in f){d.plugins[g]=d.plugins[g]||[];d.plugins[g].push([b,f[g]])}},call:function(a,b,f){var d=a.plugins[b];if(!d){return}for(var g=0;g<d.length;g++){if(a.options[d[g][0]]){d[g][1].apply(a.element,f)}}}},cssCache:{},css:function(a){if(c.ui.cssCache[a]){return c.ui.cssCache[a]}var b=c('<div class="ui-gen">').addClass(a).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');c.ui.cssCache[a]=!!((!(/auto|default/).test(b.css('cursor'))||(/^[1-9]/).test(b.css('height'))||(/^[1-9]/).test(b.css('width'))||!(/none/).test(b.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(b.css('backgroundColor'))));try{c('body').get(0).removeChild(b.get(0))}catch(e){}return c.ui.cssCache[a]},disableSelection:function(a){c(a).attr('unselectable','on').css('MozUserSelect','none')},enableSelection:function(a){c(a).attr('unselectable','off').css('MozUserSelect','')},hasScroll:function(a,b){var f=/top/.test(b||"top")?'scrollTop':'scrollLeft',d=false;if(a[f]>0)return true;a[f]=1;d=a[f]>0?true:false;a[f]=0;return d}};var k=c.fn.remove;c.fn.remove=function(){c("*",this).add(this).triggerHandler("remove");return k.apply(this,arguments)};function l(a,b,f){var d=c[a][b].getter||[];d=(typeof d=="string"?d.split(/,?\s+/):d);return(c.inArray(f,d)!=-1)}c.widget=function(h,m){var i=h.split(".")[0];h=h.split(".")[1];c.fn[h]=function(b){var f=(typeof b=='string'),d=Array.prototype.slice.call(arguments,1);if(f&&l(i,h,b)){var g=c.data(this[0],h);return(g?g[b].apply(g,d):undefined)}return this.each(function(){var a=c.data(this,h);if(f&&a&&c.isFunction(a[b])){a[b].apply(a,d)}else if(!f){c.data(this,h,new c[i][h](this,b))}})};c[i][h]=function(d,g){var j=this;this.widgetName=h;this.widgetBaseClass=i+'-'+h;this.options=c.extend({},c.widget.defaults,c[i][h].defaults,g);this.element=c(d).bind('setData.'+h,function(a,b,f){return j.setData(b,f)}).bind('getData.'+h,function(a,b){return j.getData(b)}).bind('remove',function(){return j.destroy()});this.init()};c[i][h].prototype=c.extend({},c.widget.prototype,m)};c.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(a){return this.options[a]},setData:function(a,b){this.options[a]=b;if(a=='disabled'){this.element[b?'addClass':'removeClass'](this.widgetBaseClass+'-disabled')}},enable:function(){this.setData('disabled',false)},disable:function(){this.setData('disabled',true)}};c.widget.defaults={disabled:false};c.ui.mouse={mouseInit:function(){var b=this;this.element.bind('mousedown.'+this.widgetName,function(a){return b.mouseDown(a)});if(c.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on')}this.started=false},mouseDestroy:function(){this.element.unbind('.'+this.widgetName);(c.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable))},mouseDown:function(b){(this._mouseStarted&&this.mouseUp(b));this._mouseDownEvent=b;var f=this,d=(b.which==1),g=(typeof this.options.cancel=="string"?c(b.target).parents().add(b.target).filter(this.options.cancel).length:false);if(!d||g||!this.mouseCapture(b)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){f._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(b)&&this.mouseDelayMet(b)){this._mouseStarted=(this.mouseStart(b)!==false);if(!this._mouseStarted){b.preventDefault();return true}}this._mouseMoveDelegate=function(a){return f.mouseMove(a)};this._mouseUpDelegate=function(a){return f.mouseUp(a)};c(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(a){if(c.browser.msie&&!a.button){return this.mouseUp(a)}if(this._mouseStarted){this.mouseDrag(a);return false}if(this.mouseDistanceMet(a)&&this.mouseDelayMet(a)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,a)!==false);(this._mouseStarted?this.mouseDrag(a):this.mouseUp(a))}return!this._mouseStarted},mouseUp:function(a){c(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(a)}return false},mouseDistanceMet:function(a){return(Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance)},mouseDelayMet:function(a){return this._mouseDelayMet},mouseStart:function(a){},mouseDrag:function(a){},mouseStop:function(a){},mouseCapture:function(a){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);