﻿jQuery.extend(jQuery.easing,{easein:function(e,a,b,c,d){return c*(a/=d)*a+b},easeinout:function(f,c,e,b,a){if(c<a/2)return 2*b*c*c/(a*a)+e;var d=c-a/2;return -2*b*d*d/(a*a)+2*b*d/a+b/2+e},easeout:function(e,b,d,c,a){return -c*b*b/(a*a)+2*c*b/a+d},expoin:function(f,e,c,a,d){var b=1;if(a<0){b*=-1;a*=-1}return b*Math.exp(Math.log(a)/d*e)+c},expoout:function(f,e,d,a,c){var b=1;if(a<0){b*=-1;a*=-1}return b*(-Math.exp(-Math.log(a)/c*(e-c))+a+1)+d},expoinout:function(f,d,e,a,b){var c=1;if(a<0){c*=-1;a*=-1}if(d<b/2)return c*Math.exp(Math.log(a/2)/(b/2)*d)+e;return c*(-Math.exp(-2*Math.log(a/2)/b*(d-b))+a+1)+e},bouncein:function(e,d,c,a,b){return a-jQuery.easing["bounceout"](e,b-d,0,a,b)+c},bounceout:function(e,a,b,c,d){if((a/=d)<1/2.75)return c*(7.5625*a*a)+b;else if(a<2/2.75)return c*(7.5625*(a-=1.5/2.75)*a+.75)+b;else if(a<2.5/2.75)return c*(7.5625*(a-=2.25/2.75)*a+.9375)+b;else return c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},bounceinout:function(e,c,d,b,a){if(c<a/2)return jQuery.easing["bouncein"](e,c*2,0,b,a)*.5+d;return jQuery.easing["bounceout"](e,c*2-a,0,b,a)*.5+b*.5+d},elasin:function(h,d,e,a,f){var g=1.70158,b=0,c=a;if(d==0)return e;if((d/=f)==1)return e+a;if(!b)b=f*.3;if(c<Math.abs(a)){c=a;var g=b/4}else var g=b/(2*Math.PI)*Math.asin(a/c);return -(c*Math.pow(2,10*(d-=1))*Math.sin((d*f-g)*(2*Math.PI)/b))+e},elasout:function(h,d,e,a,f){var g=1.70158,b=0,c=a;if(d==0)return e;if((d/=f)==1)return e+a;if(!b)b=f*.3;if(c<Math.abs(a)){c=a;var g=b/4}else var g=b/(2*Math.PI)*Math.asin(a/c);return c*Math.pow(2,-10*d)*Math.sin((d*f-g)*(2*Math.PI)/b)+a+e},elasinout:function(h,a,e,b,f){var g=1.70158,c=0,d=b;if(a==0)return e;if((a/=f/2)==2)return e+b;if(!c)c=f*(.3*1.5);if(d<Math.abs(b)){d=b;var g=c/4}else var g=c/(2*Math.PI)*Math.asin(b/d);if(a<1)return -.5*(d*Math.pow(2,10*(a-=1))*Math.sin((a*f-g)*(2*Math.PI)/c))+e;return d*Math.pow(2,-10*(a-=1))*Math.sin((a*f-g)*(2*Math.PI)/c)*.5+b+e},backin:function(f,a,c,d,e){var b=1.70158;return d*(a/=e)*a*((b+1)*a-b)+c},backout:function(f,a,c,d,e){var b=1.70158;return d*((a=a/e-1)*a*((b+1)*a+b)+1)+c},backinout:function(f,a,c,d,e){var b=1.70158;if((a/=e/2)<1)return d/2*(a*a*(((b*=1.525)+1)*a-b))+c;return d/2*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)+c}});(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0])return;var d=c=="Height"?"Top":"Left",b=c=="Height"?"Bottom":"Right";return a(this,c.toLowerCase())+a(this,"padding"+d)+a(this,"padding"+b)};b.fn["outer"+c]=function(d){if(!this[0])return;var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";d=b.extend({margin:false},d||{});return a(this,c.toLowerCase())+a(this,"border"+f+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+f)+a(this,"padding"+e)+(d.margin?a(this,"margin"+f)+a(this,"margin"+e):0)}});b.each(["Left","Top"],function(c,a){b.fn["scroll"+a]=function(c){if(!this[0])return;return c!=undefined?this.each(function(){this==window||this==document?window.scrollTo(a=="Left"?c:b(window)["scrollLeft"](),a=="Top"?c:b(window)["scrollTop"]()):(this["scroll"+a]=c)}):this[0]==window||this[0]==document?self[a=="Left"?"pageXOffset":"pageYOffset"]||b.boxModel&&document.documentElement["scroll"+a]||document.body["scroll"+a]:this[0]["scroll"+a]}});b.fn.extend({position:function(){var g=0,h=0,e=this[0],c,b,d,f;if(e){d=this.offsetParent();c=this.offset();b=d.offset();c.top-=a(e,"marginTop");c.left-=a(e,"marginLeft");b.top+=a(d,"borderTopWidth");b.left+=a(d,"borderLeftWidth");f={top:c.top-b.top,left:c.left-b.left}}return f},offsetParent:function(){var a=this[0].offsetParent;while(a&&(!/^body|html$/i.test(a.tagName)&&b.css(a,"position")=="static"))a=a.offsetParent;return b(a)}});function a(a,c){return parseInt(b.css(a.jquery?a[0]:a,c))||0}})(jQuery);(function(a){a.ui=a.ui||{};a.fn.extend({accordion:function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof b=="string"){var d=a.data(this,"accordion");if(d)d[b].apply(d,c)}else if(!a(this).is(".ui-accordion"))a.data(this,"accordion",new a.ui.accordion(this,b))})},activate:function(a){return this.accordion("activate",a)}});a.ui.accordion=function(e,d){this.options=d=a.extend({},a.ui.accordion.defaults,d);this.element=e;a(e).addClass("ui-accordion");if(d.navigation){var g=a(e).find("a").filter(d.navigationFilter);if(g.length)if(g.filter(d.header).length)d.active=g;else{d.active=g.parent().parent().prev();g.addClass("current")}}d.headers=a(e).find(d.header);d.active=c(d.headers,d.active);if(d.fillSpace){var f=a(e).parent().height();d.headers.each(function(){f-=a(this).outerHeight()});var h=0;d.headers.next().each(function(){h=Math.max(h,a(this).innerHeight()-a(this).height())}).height(f-h)}else if(d.autoHeight){var f=0;d.headers.next().each(function(){f=Math.max(f,a(this).outerHeight())}).height(f)}d.headers.not(d.active||"").next().hide();d.active.parent().andSelf().addClass(d.selectedClass);if(d.event)a(e).bind(d.event+".accordion",b)};a.ui.accordion.prototype={activate:function(a){b.call(this.element,{target:c(this.options.headers,a)[0]})},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight)this.options.headers.next().css("height","");a.removeData(this.element,"accordion");a(this.element).removeClass("ui-accordion").unbind(".accordion")}};function e(a,b){return function(){return a.apply(b,arguments)}}function f(d){if(!a.data(this,"accordion"))return;var c=a.data(this,"accordion"),b=c.options;b.running=d?0:--b.running;if(b.running)return;if(b.clearStyle)b.toShow.add(b.toHide).css({height:"",overflow:""});a(this).triggerHandler("accordionchange",[b.data],b.change)}function d(d,c,j,h,i){var b=a.data(this,"accordion").options;b.toShow=d;b.toHide=c;b.data=j;var g=e(f,this);b.running=c.size()==0?d.size():c.size();if(b.animated)if(!b.alwaysOpen&&h)a.ui.accordion.animations[b.animated]({toShow:jQuery([]),toHide:c,complete:g,down:i,autoHeight:b.autoHeight});else a.ui.accordion.animations[b.animated]({toShow:d,toHide:c,complete:g,down:i,autoHeight:b.autoHeight});else{if(!b.alwaysOpen&&h)d.toggle();else{c.hide();d.show()}g(true)}}function b(h){var b=a.data(this,"accordion").options;if(b.disabled)return false;if(!h.target&&!b.alwaysOpen){b.active.parent().andSelf().toggleClass(b.selectedClass);var f=b.active.next(),i={instance:this,options:b,newHeader:jQuery([]),oldHeader:b.active,newContent:jQuery([]),oldContent:f},g=b.active=a([]);d.call(this,g,f,i);return false}var c=a(h.target);if(c.parents(b.header).length)while(!c.is(b.header))c=c.parent();var e=c[0]==b.active[0];if(b.running||b.alwaysOpen&&e)return false;if(!c.is(b.header))return;b.active.parent().andSelf().toggleClass(b.selectedClass);if(!e)c.parent().andSelf().addClass(b.selectedClass);var g=c.next(),f=b.active.next(),i={instance:this,options:b,newHeader:c,oldHeader:b.active,newContent:g,oldContent:f},j=b.headers.index(b.active[0])>b.headers.index(c[0]);b.active=e?a([]):c;d.call(this,g,f,i,e,j);return false}function c(c,b){return b!=undefined?typeof b=="number"?c.filter(":eq("+b+")"):c.not(c.not(b)):b===false?a([]):c.filter(":eq(0)")}a.extend(a.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(b,f){b=a.extend({easing:"swing",duration:300},b,f);if(!b.toHide.size()){b.toShow.animate({height:"show"},b);return}var c=b.toHide.height(),e=b.toShow.height(),d=e/c;b.toShow.css({height:0,overflow:"hidden"}).show();b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate({height:"hide"},{step:function(f){var e=(c-f)*d;if(a.browser.msie||a.browser.opera)e=Math.ceil(e);b.toShow.height(e)},duration:b.duration,easing:b.easing,complete:function(){if(!b.autoHeight)b.toShow.css("height","auto");b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"bounceout":"swing",duration:a.down?1e3:500})},easeslide:function(a){this.slide(a,{easing:"easeinout",duration:700})}}})})(jQuery);jQuery().ready(function(){jQuery("#accordian").accordion({event:"mouseover",active:".selected",selectedClass:"active",animated:"bounceslide",header:"div.header"}).bind("changeaccordion",function(b,a){jQuery("<div>"+a.oldHeader.text()+" hidden, "+a.newHeader.text()+" shown</div>").appendTo("#log")})})
