(function(c){c.ui={plugin:{add:function(e,f,h){var g=c.ui[e].prototype;for(var d in h){g.plugins[d]=g.plugins[d]||[];g.plugins[d].push([f,h[d]])}},call:function(d,f,e){var h=d.plugins[f];if(!h){return}for(var g=0;g<h.length;g++){if(d.options[h[g][0]]){h[g][1].apply(d.element,e)}}}},cssCache:{},css:function(d){if(c.ui.cssCache[d]){return c.ui.cssCache[d]}var f=c('<div class="ui-gen">').addClass(d).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");c.ui.cssCache[d]=!!((!(/auto|default/).test(f.css("cursor"))||(/^[1-9]/).test(f.css("height"))||(/^[1-9]/).test(f.css("width"))||!(/none/).test(f.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(f.css("backgroundColor"))));try{c("body").get(0).removeChild(f.get(0))}catch(g){}return c.ui.cssCache[d]},disableSelection:function(d){c(d).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(d){c(d).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(h,f){var d=/top/.test(f||"top")?"scrollTop":"scrollLeft",g=false;if(h[d]>0){return true}h[d]=1;g=h[d]>0?true:false;h[d]=0;return g}};var b=c.fn.remove;c.fn.remove=function(){c("*",this).add(this).triggerHandler("remove");return b.apply(this,arguments)};function a(e,f,g){var d=c[e][f].getter||[];d=(typeof d=="string"?d.split(/,?\s+/):d);return(c.inArray(g,d)!=-1)}c.widget=function(e,d){var f=e.split(".")[0];e=e.split(".")[1];c.fn[e]=function(j){var h=(typeof j=="string"),i=Array.prototype.slice.call(arguments,1);if(h&&a(f,e,j)){var g=c.data(this[0],e);return(g?g[j].apply(g,i):undefined)}return this.each(function(){var k=c.data(this,e);if(h&&k&&c.isFunction(k[j])){k[j].apply(k,i)}else{if(!h){c.data(this,e,new c[f][e](this,j))}}})};c[f][e]=function(i,h){var g=this;this.widgetName=e;this.widgetBaseClass=f+"-"+e;this.options=c.extend({},c.widget.defaults,c[f][e].defaults,h);this.element=c(i).bind("setData."+e,function(l,j,k){return g.setData(j,k)}).bind("getData."+e,function(k,j){return g.getData(j)}).bind("remove",function(){return g.destroy()});this.init()};c[f][e].prototype=c.extend({},c.widget.prototype,d)};c.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(d){return this.options[d]},setData:function(d,e){this.options[d]=e;if(d=="disabled"){this.element[e?"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 d=this;this.element.bind("mousedown."+this.widgetName,function(f){return d.mouseDown(f)});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(g){(this._mouseStarted&&this.mouseUp(g));this._mouseDownEvent=g;var f=this,h=(g.which==1),d=(typeof this.options.cancel=="string"?c(g.target).parents().add(g.target).filter(this.options.cancel).length:false);if(!h||d||!this.mouseCapture(g)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){f._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(g)&&this.mouseDelayMet(g)){this._mouseStarted=(this.mouseStart(g)!==false);if(!this._mouseStarted){g.preventDefault();return true}}this._mouseMoveDelegate=function(i){return f.mouseMove(i)};this._mouseUpDelegate=function(i){return f.mouseUp(i)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(d){if(c.browser.msie&&!d.button){return this.mouseUp(d)}if(this._mouseStarted){this.mouseDrag(d);return false}if(this.mouseDistanceMet(d)&&this.mouseDelayMet(d)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this.mouseDrag(d):this.mouseUp(d))}return !this._mouseStarted},mouseUp:function(d){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(d)}return false},mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},mouseDelayMet:function(d){return this._mouseDelayMet},mouseStart:function(d){},mouseDrag:function(d){},mouseStop:function(d){},mouseCapture:function(d){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(e){e.widget("ui.accordion",{init:function(){var g=this.options;if(g.navigation){var j=this.element.find("a").filter(g.navigationFilter);if(j.length){if(j.filter(g.header).length){g.active=j}else{g.active=j.parent().parent().prev();j.addClass("current")}}}g.headers=this.element.find(g.header);g.active=c(g.headers,g.active);if(e.browser.msie){this.element.find("a").css("zoom","1")}if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");e("<span class='ui-accordion-left'/>").insertBefore(g.headers);e("<span class='ui-accordion-right'/>").appendTo(g.headers);g.headers.addClass("ui-accordion-header").attr("tabindex","0")}var i;if(g.fillSpace){i=this.element.parent().height();g.headers.each(function(){i-=e(this).outerHeight()});var h=0;g.headers.next().each(function(){h=Math.max(h,e(this).innerHeight()-e(this).height())}).height(i-h)}else{if(g.autoHeight){i=0;g.headers.next().each(function(){i=Math.max(i,e(this).outerHeight())}).height(i)}}g.headers.not(g.active||"").next().hide();g.active.parent().andSelf().addClass(g.selectedClass);if(g.event){this.element.bind((g.event)+".accordion",f)}},activate:function(g){f.call(this.element[0],{target:c(this.options.headers,g)[0]})},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}e.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")}});function b(h,g){return function(){return h.apply(g,arguments)}}function d(i){if(!e.data(this,"accordion")){return}var g=e.data(this,"accordion");var h=g.options;h.running=i?0:--h.running;if(h.running){return}if(h.clearStyle){h.toShow.add(h.toHide).css({height:"",overflow:""})}e(this).triggerHandler("accordionchange",[e.event.fix({type:"accordionchange",target:g.element[0]}),h.data],h.change)}function a(g,k,l,j,m){var i=e.data(this,"accordion").options;i.toShow=g;i.toHide=k;i.data=l;var h=b(d,this);i.running=k.size()===0?g.size():k.size();if(i.animated){if(!i.alwaysOpen&&j){e.ui.accordion.animations[i.animated]({toShow:jQuery([]),toHide:k,complete:h,down:m,autoHeight:i.autoHeight})}else{e.ui.accordion.animations[i.animated]({toShow:g,toHide:k,complete:h,down:m,autoHeight:i.autoHeight})}}else{if(!i.alwaysOpen&&j){g.toggle()}else{k.hide();g.show()}h(true)}}function f(l){var j=e.data(this,"accordion").options;if(j.disabled){return false}if(!l.target&&!j.alwaysOpen){j.active.parent().andSelf().toggleClass(j.selectedClass);var i=j.active.next(),m={options:j,newHeader:jQuery([]),oldHeader:j.active,newContent:jQuery([]),oldContent:i},g=(j.active=e([]));a.call(this,g,i,m);return false}var k=e(l.target);k=e(k.parents(j.header)[0]||k);var h=k[0]==j.active[0];if(j.running||(j.alwaysOpen&&h)){return false}if(!k.is(j.header)){return}j.active.parent().andSelf().toggleClass(j.selectedClass);if(!h){k.parent().andSelf().addClass(j.selectedClass)}var g=k.next(),i=j.active.next(),m={options:j,newHeader:k,oldHeader:j.active,newContent:g,oldContent:i},n=j.headers.index(j.active[0])>j.headers.index(k[0]);j.active=h?e([]):k;a.call(this,g,i,m,h,n);return false}function c(h,g){return g!=undefined?typeof g=="number"?h.filter(":eq("+g+")"):h.not(h.not(g)):g===false?e([]):h.filter(":eq(0)")}e.extend(e.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:"slide",event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(g,i){g=e.extend({easing:"swing",duration:300},g,i);if(!g.toHide.size()){g.toShow.animate({height:"show"},g);return}var h=g.toHide.height(),j=g.toShow.height(),k=j/h;g.toShow.css({height:0,overflow:"hidden"}).show();g.toHide.filter(":hidden").each(g.complete).end().filter(":visible").animate({height:"hide"},{step:function(l){var m=(h-l)*k;if(e.browser.msie||e.browser.opera){m=Math.ceil(m)}g.toShow.height(m)},duration:g.duration,easing:g.easing,complete:function(){if(!g.autoHeight){g.toShow.css("height","auto")}g.complete()}})},bounceslide:function(g){this.slide(g,{easing:g.down?"bounceout":"swing",duration:g.down?1000:200})},easeslide:function(g){this.slide(g,{easing:"easeinout",duration:700})}}});e.fn.activate=function(g){return this.accordion("activate",g)}})(jQuery);