(function(a,b,c){a.fn.jScrollPane=function(b){function d(b,d){function bB(){var a=bn(),c=bm();b.removeClass("jspScrollable").unbind(".jsp");b.replaceWith(R.append(g.children()));R.scrollTop(a);R.scrollLeft(c)}function bA(){var a,b,c,d,e,g=false;j.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(f){var h=f.originalEvent.touches[0];a=bm();b=bn();c=h.pageX;d=h.pageY;e=false;g=true}).bind("touchmove.jsp",function(h){if(!g){return}var i=h.originalEvent.touches[0],j=v,k=s;f.scrollTo(a+c-i.pageX,b+d-i.pageY);e=e||Math.abs(c-i.pageX)>5||Math.abs(d-i.pageY)>5;return j==v&&k==s}).bind("touchend.jsp",function(a){g=false}).bind("click.jsp-touchclick",function(a){if(e){e=false;return false}})}function bz(){by();a("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var a=this.href.split("#"),b;if(a.length>1){b=a[1];if(b.length>0&&g.find("#"+b).length>0){bl("#"+b,true);return false}}})}function by(){a("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function bx(){if(location.hash&&location.hash.length>1){var b,c,d=escape(location.hash);try{b=a(d)}catch(e){return}if(b.length&&g.find(d)){if(j.scrollTop()===0){c=setInterval(function(){if(j.scrollTop()>0){bl(d,true);a(document).scrollTop(j.position().top);clearInterval(c)}},50)}else{bl(d,true);a(document).scrollTop(j.position().top)}}}}function bw(){b.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function bv(){function k(){var a=v,b=s;switch(c){case 40:f.scrollByY(e.keyboardSpeed,false);break;case 38:f.scrollByY(-e.keyboardSpeed,false);break;case 34:case 32:f.scrollByY(i*e.scrollPagePercent,false);break;case 33:f.scrollByY(-i*e.scrollPagePercent,false);break;case 39:f.scrollByX(e.keyboardSpeed,false);break;case 37:f.scrollByX(-e.keyboardSpeed,false);break}d=a!=v||b!=s;return d}var c,d,h=[];p&&h.push(D[0]);o&&h.push(w[0]);g.focus(function(){b.focus()});b.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(b){if(b.target!==this&&!(h.length&&a(b.target).closest(h).length)){return}var e=v,f=s;switch(b.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:c=b.keyCode;k();break;case 35:bj(l-i);c=null;break;case 36:bj(0);c=null;break}d=b.keyCode==c&&e!=v||f!=s;return!d}).bind("keypress.jsp",function(a){if(a.keyCode==c){k()}return!d});if(e.hideFocus){b.css("outline","none");if("hideFocus"in j[0]){b.attr("hideFocus",true)}}else{b.css("outline","");if("hideFocus"in j[0]){b.attr("hideFocus",false)}}}function bu(){g.find(":input,a").unbind("focus.jsp")}function bt(){g.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(a){bl(a.target,false)})}function bs(){return false}function br(){j.unbind(S)}function bq(){j.unbind(S).bind(S,function(a,b,c,d){var g=v,h=s;f.scrollBy(c*e.mouseWheelSpeed,-d*e.mouseWheelSpeed,false);return g==v&&h==s})}function bp(){var a=k-h;return a>20&&a-bm()<10}function bo(){var a=l-i;return a>20&&a-bn()<10}function bn(){return-g.position().top}function bm(){return-g.position().left}function bl(b,c,d){var f,g,k,l=0,m=0,n,o,p,q,r,s;try{f=a(b)}catch(t){return}g=f.outerHeight();k=f.outerWidth();j.scrollTop(0);j.scrollLeft(0);while(!f.is(".jspPane")){l+=f.position().top;m+=f.position().left;f=f.offsetParent();if(/^body|html$/i.test(f[0].nodeName)){return}}n=bn();p=n+i;if(l<n||c){r=l-e.verticalGutter}else{if(l+g>p){r=l-i+g+e.verticalGutter}}if(r){bj(r,d)}o=bm();q=o+h;if(m<o||c){s=m-e.horizontalGutter}else{if(m+k>q){s=m-h+k+e.horizontalGutter}}if(s){bk(s,d)}}function bk(a,b){var c=a/(k-h);bf(c*u,b)}function bj(a,b){var c=a/(l-i);bd(c*r,b)}function bi(a,b){if(e.showArrows){H[a?"addClass":"removeClass"]("jspDisabled");I[b?"addClass":"removeClass"]("jspDisabled")}}function bh(a,b){if(e.showArrows){B[a?"addClass":"removeClass"]("jspDisabled");C[b?"addClass":"removeClass"]("jspDisabled")}}function bg(a){if(a===c){a=t.position().left}j.scrollTop(0);v=a;var d=v===0,e=v==u,f=a/u,i=-f*(k-h);if(O!=d||Q!=e){O=d;Q=e;b.trigger("jsp-arrow-change",[N,P,O,Q])}bi(d,e);g.css("left",i);b.trigger("jsp-scroll-x",[-i,d,e]).trigger("scroll")}function bf(a,b){if(!p){return}if(a<0){a=0}else{if(a>u){a=u}}if(b===c){b=e.animateScroll}if(b){f.animate(t,"left",a,bg)}else{t.css("left",a);bg(a)}}function be(a){if(a===c){a=q.position().top}j.scrollTop(0);s=a;var d=s===0,e=s==r,f=a/r,h=-f*(l-i);if(N!=d||P!=e){N=d;P=e;b.trigger("jsp-arrow-change",[N,P,O,Q])}bh(d,e);g.css("top",h);b.trigger("jsp-scroll-y",[-h,d,e]).trigger("scroll")}function bd(a,b){if(!o){return}if(a<0){a=0}else{if(a>r){a=r}}if(b===c){b=e.animateScroll}if(b){f.animate(q,"top",a,be)}else{q.css("top",a);be(a)}}function bc(){a("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(q){q.removeClass("jspActive")}if(t){t.removeClass("jspActive")}}function bb(){if(E){E.unbind("mousedown.jsp")}if(x){x.unbind("mousedown.jsp")}}function ba(){bb();if(o){x.bind("mousedown.jsp",function(b){if(b.originalTarget===c||b.originalTarget==b.currentTarget){var d=a(this),g=d.offset(),h=b.pageY-g.top-s,j,k=true,m=function(){var a=d.offset(),c=b.pageY-a.top-A/2,g=i*e.scrollPagePercent,o=r*g/(l-i);if(h<0){if(s-o>c){f.scrollByY(-g)}else{bd(c)}}else{if(h>0){if(s+o<c){f.scrollByY(g)}else{bd(c)}}else{n();return}}j=setTimeout(m,k?e.initialDelay:e.trackClickRepeatFreq);k=false},n=function(){j&&clearTimeout(j);j=null;a(document).unbind("mouseup.jsp",n)};m();a(document).bind("mouseup.jsp",n);return false}})}if(p){E.bind("mousedown.jsp",function(b){if(b.originalTarget===c||b.originalTarget==b.currentTarget){var d=a(this),g=d.offset(),i=b.pageX-g.left-v,j,l=true,m=function(){var a=d.offset(),c=b.pageX-a.left-G/2,g=h*e.scrollPagePercent,o=u*g/(k-h);if(i<0){if(v-o>c){f.scrollByX(-g)}else{bf(c)}}else{if(i>0){if(v+o<c){f.scrollByX(g)}else{bf(c)}}else{n();return}}j=setTimeout(m,l?e.initialDelay:e.trackClickRepeatFreq);l=false},n=function(){j&&clearTimeout(j);j=null;a(document).unbind("mouseup.jsp",n)};m();a(document).bind("mouseup.jsp",n);return false}})}}function _(b,c,d,g){d=a(d).addClass("jspActive");var h,i,j=true,k=function(){if(b!==0){f.scrollByX(b*e.arrowButtonSpeed)}if(c!==0){f.scrollByY(c*e.arrowButtonSpeed)}i=setTimeout(k,j?e.initialDelay:e.arrowRepeatFreq);j=false};k();h=g?"mouseout.jsp":"mouseup.jsp";g=g||a("html");g.bind(h,function(){d.removeClass("jspActive");i&&clearTimeout(i);i=null;g.unbind(h)})}function $(a,b,c){return function(){_(a,b,this,c);this.blur();return false}}function Z(a,b,c,d){var e="before",f="after",g;if(b=="os"){b=/Mac/.test(navigator.platform)?"after":"split"}if(b==e){f=b}else{if(b==f){e=b;g=c;c=d;d=g}}a[e](c)[f](d)}function Y(){if(p&&o){var b=E.outerHeight(),c=x.outerWidth();z-=b;a(D).find(">.jspCap:visible,>.jspArrow").each(function(){F+=a(this).outerWidth()});F-=c;i-=c;h-=b;E.parent().append(a('<div class="jspCorner" />').css("width",b+"px"));V();X()}if(p){g.width(j.outerWidth()-L+"px")}l=g.outerHeight();n=l/i;if(p){G=Math.ceil(1/m*F);if(G>e.horizontalDragMaxWidth){G=e.horizontalDragMaxWidth}else{if(G<e.horizontalDragMinWidth){G=e.horizontalDragMinWidth}}t.width(G+"px");u=F-G;bg(v)}if(o){A=Math.ceil(1/n*z);if(A>e.verticalDragMaxHeight){A=e.verticalDragMaxHeight}else{if(A<e.verticalDragMinHeight){A=e.verticalDragMinHeight}}q.height(A+"px");r=z-A;be(s)}}function X(){j.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){F-=a(this).outerWidth()});E.width(F+"px");v=0}function W(){if(p){j.append(a('<div class="jspHorizontalBar" />').append(a('<div class="jspCap jspCapLeft" />'),a('<div class="jspTrack" />').append(a('<div class="jspDrag" />').append(a('<div class="jspDragLeft" />'),a('<div class="jspDragRight" />'))),a('<div class="jspCap jspCapRight" />')));D=j.find(">.jspHorizontalBar");E=D.find(">.jspTrack");t=E.find(">.jspDrag");if(e.showArrows){H=a('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",$(-1,0)).bind("click.jsp",bs);I=a('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",$(1,0)).bind("click.jsp",bs);if(e.arrowScrollOnHover){H.bind("mouseover.jsp",$(-1,0,H));I.bind("mouseover.jsp",$(1,0,I))}Z(E,e.horizontalArrowPositions,H,I)}t.hover(function(){t.addClass("jspHover")},function(){t.removeClass("jspHover")}).bind("mousedown.jsp",function(b){a("html").bind("dragstart.jsp selectstart.jsp",bs);t.addClass("jspActive");var c=b.pageX-t.position().left;a("html").bind("mousemove.jsp",function(a){bf(a.pageX-c,false)}).bind("mouseup.jsp mouseleave.jsp",bc);return false});F=j.innerWidth();X()}}function V(){x.height(z+"px");s=0;y=e.verticalGutter+x.outerWidth();g.width(h-y-L);try{if(w.position().left===0){g.css("margin-left",y+"px")}}catch(a){}}function U(){if(o){j.append(a('<div class="jspVerticalBar" />').append(a('<div class="jspCap jspCapTop" />'),a('<div class="jspTrack" />').append(a('<div class="jspDrag" />').append(a('<div class="jspDragTop" />'),a('<div class="jspDragBottom" />'))),a('<div class="jspCap jspCapBottom" />')));w=j.find(">.jspVerticalBar");x=w.find(">.jspTrack");q=x.find(">.jspDrag");if(e.showArrows){B=a('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",$(0,-1)).bind("click.jsp",bs);C=a('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",$(0,1)).bind("click.jsp",bs);if(e.arrowScrollOnHover){B.bind("mouseover.jsp",$(0,-1,B));C.bind("mouseover.jsp",$(0,1,C))}Z(x,e.verticalArrowPositions,B,C)}z=i;j.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){z-=a(this).outerHeight()});q.hover(function(){q.addClass("jspHover")},function(){q.removeClass("jspHover")}).bind("mousedown.jsp",function(b){a("html").bind("dragstart.jsp selectstart.jsp",bs);q.addClass("jspActive");var c=b.pageY-q.position().top;a("html").bind("mousemove.jsp",function(a){bd(a.pageY-c,false)}).bind("mouseup.jsp mouseleave.jsp",bc);return false});V()}}function T(d){var f,q,r,t,u,w,x=false,y=false;e=d;if(g===c){u=b.scrollTop();w=b.scrollLeft();b.css({overflow:"hidden",padding:0});h=b.innerWidth()+L;i=b.innerHeight();b.width(h);g=a('<div class="jspPane" />').css("padding",K).append(b.children());j=a('<div class="jspContainer" />').css({width:h+"px",height:i+"px"}).append(g).appendTo(b)}else{b.css("width","");x=e.stickToBottom&&bo();y=e.stickToRight&&bp();t=b.innerWidth()+L!=h||b.outerHeight()!=i;if(t){h=b.innerWidth()+L;i=b.innerHeight();j.css({width:h+"px",height:i+"px"})}if(!t&&M==k&&g.outerHeight()==l){b.width(h);return}M=k;g.css("width","");b.width(h);j.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}g.css("overflow","auto");if(d.contentWidth){k=d.contentWidth}else{k=g[0].scrollWidth}l=g[0].scrollHeight;g.css("overflow","");m=k/h;n=l/i;o=n>1;p=m>1;if(!(p||o)){b.removeClass("jspScrollable");g.css({top:0,width:j.width()-L});br();bu();bw();bb();by()}else{b.addClass("jspScrollable");f=e.maintainPosition&&(s||v);if(f){q=bm();r=bn()}U();W();Y();if(f){bk(y?k-h:q,false);bj(x?l-i:r,false)}bt();bq();bA();if(e.enableKeyboardNavigation){bv()}if(e.clickOnTrack){ba()}bx();if(e.hijackInternalLinks){bz()}}if(e.autoReinitialise&&!J){J=setInterval(function(){T(e)},e.autoReinitialiseDelay)}else{if(!e.autoReinitialise&&J){clearInterval(J)}}u&&b.scrollTop(0)&&bj(u,false);w&&b.scrollLeft(0)&&bk(w,false);b.trigger("jsp-initialised",[p||o])}var e,f=this,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=true,O=true,P=false,Q=false,R=b.clone(false,false).empty(),S=a.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";K=b.css("paddingTop")+" "+b.css("paddingRight")+" "+b.css("paddingBottom")+" "+b.css("paddingLeft");L=(parseInt(b.css("paddingLeft"),10)||0)+(parseInt(b.css("paddingRight"),10)||0);a.extend(f,{reinitialise:function(b){b=a.extend({},e,b);T(b)},scrollToElement:function(a,b,c){bl(a,b,c)},scrollTo:function(a,b,c){bk(a,c);bj(b,c)},scrollToX:function(a,b){bk(a,b)},scrollToY:function(a,b){bj(a,b)},scrollToPercentX:function(a,b){bk(a*(k-h),b)},scrollToPercentY:function(a,b){bj(a*(l-i),b)},scrollBy:function(a,b,c){f.scrollByX(a,c);f.scrollByY(b,c)},scrollByX:function(a,b){var c=bm()+Math[a<0?"floor":"ceil"](a),d=c/(k-h);bf(d*u,b)},scrollByY:function(a,b){var c=bn()+Math[a<0?"floor":"ceil"](a),d=c/(l-i);bd(d*r,b)},positionDragX:function(a,b){bf(a,b)},positionDragY:function(a,b){bd(a,b)},animate:function(a,b,c,d){var f={};f[b]=c;a.animate(f,{duration:e.animateDuration,easing:e.animateEase,queue:false,step:d})},getContentPositionX:function(){return bm()},getContentPositionY:function(){return bn()},getContentWidth:function(){return k},getContentHeight:function(){return l},getPercentScrolledX:function(){return bm()/(k-h)},getPercentScrolledY:function(){return bn()/(l-i)},getIsScrollableH:function(){return p},getIsScrollableV:function(){return o},getContentPane:function(){return g},scrollToBottom:function(a){bd(r,a)},hijackInternalLinks:function(){bz()},destroy:function(){bB()}});T(d)}b=a.extend({},a.fn.jScrollPane.defaults,b);a.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){b[this]=b[this]||b.speed});return this.each(function(){var c=a(this),f=c.data("jsp");if(f){f.reinitialise(b)}else{f=new d(c,b);c.data("jsp",f)}})};a.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8}})(jQuery,this);(function(a){function c(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=true,g=0,h=0;b=a.event.fix(c);b.type="mousewheel";if(b.wheelDelta){e=b.wheelDelta/120}if(b.detail){e=-b.detail/3}h=e;if(c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS){h=0;g=-1*e}if(c.wheelDeltaY!==undefined){h=c.wheelDeltaY/120}if(c.wheelDeltaX!==undefined){g=-1*c.wheelDeltaX/120}d.unshift(b,e,g,h);return a.event.handle.apply(this,d)}var b=["DOMMouseScroll","mousewheel"];a.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var a=b.length;a;){this.addEventListener(b[--a],c,false)}}else{this.onmousewheel=c}},teardown:function(){if(this.removeEventListener){for(var a=b.length;a;){this.removeEventListener(b[--a],c,false)}}else{this.onmousewheel=null}}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);jQuery.extend({roundabout_shape:{def:'lazySusan',lazySusan:function(r,a,t){return{x:Math.sin(r+a),y:(Math.sin(r+3*Math.PI/2+a)/8)*t,z:(Math.cos(r+a)+1)/2,scale:(Math.sin(r+Math.PI/2+a)/2)+0.5}}}});jQuery.fn.roundabout=function(){var options=(typeof arguments[0]!='object')?{}:arguments[0];options={bearing:(typeof options.bearing=='undefined')?0.0:jQuery.roundabout_toFloat(options.bearing%360.0),tilt:(typeof options.tilt=='undefined')?0.0:jQuery.roundabout_toFloat(options.tilt),minZ:(typeof options.minZ=='undefined')?100:parseInt(options.minZ,10),maxZ:(typeof options.maxZ=='undefined')?400:parseInt(options.maxZ,10),minOpacity:(typeof options.minOpacity=='undefined')?0.40:jQuery.roundabout_toFloat(options.minOpacity),maxOpacity:(typeof options.maxOpacity=='undefined')?1.00:jQuery.roundabout_toFloat(options.maxOpacity),minScale:(typeof options.minScale=='undefined')?0.40:jQuery.roundabout_toFloat(options.minScale),maxScale:(typeof options.maxScale=='undefined')?1.00:jQuery.roundabout_toFloat(options.maxScale),duration:(typeof options.duration=='undefined')?600:parseInt(options.duration,10),btnNext:options.btnNext||null,btnPrev:options.btnPrev||null,easing:options.easing||'swing',clickToFocus:(options.clickToFocus!==false),focusBearing:(typeof options.focusBearing=='undefined')?0.0:jQuery.roundabout_toFloat(options.focusBearing%360.0),shape:options.shape||'lazySusan',debug:options.debug||false,childSelector:options.childSelector||'li',startingChild:(typeof options.startingChild=='undefined')?null:parseInt(options.startingChild,10),reflect:(typeof options.reflect=='undefined'||options.reflect===false)?false:true};this.each(function(i){var ref=jQuery(this);var period=jQuery.roundabout_toFloat(360.0/ref.children(options.childSelector).length);var startingBearing=(options.startingChild===null)?options.bearing:options.startingChild*period;ref.addClass('roundabout-holder').css('padding',0).css('position','relative').css('z-index',options.minZ);ref.data('roundabout',{'bearing':startingBearing,'tilt':options.tilt,'minZ':options.minZ,'maxZ':options.maxZ,'minOpacity':options.minOpacity,'maxOpacity':options.maxOpacity,'minScale':options.minScale,'maxScale':options.maxScale,'duration':options.duration,'easing':options.easing,'clickToFocus':options.clickToFocus,'focusBearing':options.focusBearing,'animating':0,'childInFocus':-1,'shape':options.shape,'period':period,'debug':options.debug,'childSelector':options.childSelector,'reflect':options.reflect});if(options.clickToFocus===true){ref.children(options.childSelector).each(function(i){jQuery(this).click(function(e){var degrees=(options.reflect===true)?360.0-(period*i):period*i;degrees=jQuery.roundabout_toFloat(degrees);if(!jQuery.roundabout_isInFocus(ref,degrees)){e.preventDefault();if(ref.data('roundabout').animating===0){ref.roundabout_animateAngleToFocus(degrees)}return false}})})}if(options.btnNext){jQuery(options.btnNext).bind('click.roundabout',function(e){e.preventDefault();if(ref.data('roundabout').animating===0){ref.roundabout_animateToNextChild()}return false})}if(options.btnPrev){jQuery(options.btnPrev).bind('click.roundabout',function(e){e.preventDefault();if(ref.data('roundabout').animating===0){ref.roundabout_animateToPreviousChild()}return false})}});this.roundabout_startChildren();if(typeof arguments[1]==='function'){var callback=arguments[1],ref=this;setTimeout(function(){callback(ref)},0)}return this};jQuery.fn.roundabout_startChildren=function(){this.each(function(i){var ref=jQuery(this);var data=ref.data('roundabout');var children=ref.children(data.childSelector);children.each(function(i){var degrees=(data.reflect===true)?360.0-(data.period*i):data.period*i;jQuery(this).addClass('roundabout-moveable-item').css('position','absolute');jQuery(this).data('roundabout',{'startWidth':jQuery(this).width(),'startHeight':jQuery(this).height(),'startFontSize':parseInt(jQuery(this).css('font-size'),10),'degrees':degrees})});ref.roundabout_updateChildPositions()});return this};jQuery.fn.roundabout_setTilt=function(newTilt){this.each(function(i){jQuery(this).data('roundabout').tilt=newTilt;jQuery(this).roundabout_updateChildPositions()});if(typeof arguments[1]==='function'){var callback=arguments[1],ref=this;setTimeout(function(){callback(ref)},0)}return this};jQuery.fn.roundabout_setBearing=function(newBearing){this.each(function(i){jQuery(this).data('roundabout').bearing=jQuery.roundabout_toFloat(newBearing%360,2);jQuery(this).roundabout_updateChildPositions()});if(typeof arguments[1]==='function'){var callback=arguments[1],ref=this;setTimeout(function(){callback(ref)},0)}return this};jQuery.fn.roundabout_adjustBearing=function(delta){delta=jQuery.roundabout_toFloat(delta);if(delta!==0){this.each(function(i){jQuery(this).data('roundabout').bearing=jQuery.roundabout_getBearing(jQuery(this))+delta;jQuery(this).roundabout_updateChildPositions()})}if(typeof arguments[1]==='function'){var callback=arguments[1],ref=this;setTimeout(function(){callback(ref)},0)}return this};jQuery.fn.roundabout_adjustTilt=function(delta){delta=jQuery.roundabout_toFloat(delta);if(delta!==0){this.each(function(i){jQuery(this).data('roundabout').tilt=jQuery.roundabout_toFloat(jQuery(this).roundabout_get('tilt')+delta);jQuery(this).roundabout_updateChildPositions()})}if(typeof arguments[1]==='function'){var callback=arguments[1],ref=this;setTimeout(function(){callback(ref)},0)}return this};jQuery.fn.roundabout_animateToBearing=function(bearing){bearing=jQuery.roundabout_toFloat(bearing);var currentTime=new Date();var duration=(typeof arguments[1]=='undefined')?null:arguments[1];var easingType=(typeof arguments[2]=='undefined')?null:arguments[2];var passedData=(typeof arguments[3]!=='object')?null:arguments[3];this.each(function(i){var ref=jQuery(this),data=ref.data('roundabout'),timer,easingFn,newBearing;var thisDuration=(duration===null)?data.duration:duration;var thisEasingType=(easingType!==null)?easingType:data.easing||'swing';if(passedData===null){passedData={timerStart:currentTime,start:jQuery.roundabout_getBearing(ref),totalTime:thisDuration}}timer=currentTime-passedData.timerStart;if(timer<thisDuration){data.animating=1;if(typeof jQuery.easing.def=='string'){easingFn=jQuery.easing[thisEasingType]||jQuery.easing[jQuery.easing.def];newBearing=easingFn(null,timer,passedData.start,bearing-passedData.start,passedData.totalTime)}else{newBearing=jQuery.easing[thisEasingType]((timer/passedData.totalTime),timer,passedData.start,bearing-passedData.start,passedData.totalTime)}ref.roundabout_setBearing(newBearing,function(){ref.roundabout_animateToBearing(bearing,thisDuration,thisEasingType,passedData)})}else{bearing=(bearing<0)?bearing+360:bearing%360;data.animating=0;ref.roundabout_setBearing(bearing)}});return this};jQuery.fn.roundabout_animateToDelta=function(delta){var duration=arguments[1],easing=arguments[2];this.each(function(i){delta=jQuery.roundabout_getBearing(jQuery(this))+jQuery.roundabout_toFloat(delta);jQuery(this).roundabout_animateToBearing(delta,duration,easing)});return this};jQuery.fn.roundabout_animateToChild=function(childPos){var duration=arguments[1],easing=arguments[2];this.each(function(i){var ref=jQuery(this),data=ref.data('roundabout');if(data.childInFocus!==childPos&&data.animating===0){var child=jQuery(ref.children(data.childSelector)[childPos]);ref.roundabout_animateAngleToFocus(child.data('roundabout').degrees,duration,easing)}});return this};jQuery.fn.roundabout_animateToNearbyChild=function(passedArgs,which){var duration=passedArgs[0],easing=passedArgs[1];this.each(function(i){var data=jQuery(this).data('roundabout');var bearing=jQuery.roundabout_toFloat(360.0-jQuery.roundabout_getBearing(jQuery(this)));var period=data.period,j=0,range;var reflect=data.reflect;var length=jQuery(this).children(data.childSelector).length;bearing=(reflect===true)?bearing%360.0:bearing;if(data.animating===0){if((reflect===false&&which==='next')||(reflect===true&&which!=='next')){bearing=(bearing===0)?360:bearing;while(true&&j<length){range={lower:jQuery.roundabout_toFloat(period*j),upper:jQuery.roundabout_toFloat(period*(j+1))};range.upper=(j==length-1)?360.0:range.upper;if(bearing<=range.upper&&bearing>range.lower){jQuery(this).roundabout_animateToDelta(bearing-range.lower,duration,easing);break}j++}}else{while(true){range={lower:jQuery.roundabout_toFloat(period*j),upper:jQuery.roundabout_toFloat(period*(j+1))};range.upper=(j==length-1)?360.0:range.upper;if(bearing>=range.lower&&bearing<range.upper){jQuery(this).roundabout_animateToDelta(bearing-range.upper,duration,easing);break}j++}}}});return this};jQuery.fn.roundabout_animateToNextChild=function(){return this.roundabout_animateToNearbyChild(arguments,'next')};jQuery.fn.roundabout_animateToPreviousChild=function(){return this.roundabout_animateToNearbyChild(arguments,'previous')};jQuery.fn.roundabout_animateAngleToFocus=function(target){var duration=arguments[1],easing=arguments[2];this.each(function(i){var delta=jQuery.roundabout_getBearing(jQuery(this))-target;delta=(Math.abs(360.0-delta)<Math.abs(0.0-delta))?360.0-delta:0.0-delta;delta=(delta>180)?-(360.0-delta):delta;if(delta!==0){jQuery(this).roundabout_animateToDelta(delta,duration,easing)}});return this};jQuery.fn.roundabout_updateChildPositions=function(){this.each(function(i){var ref=jQuery(this),data=ref.data('roundabout');var inFocus=-1;var info={bearing:jQuery.roundabout_getBearing(ref),tilt:data.tilt,stage:{width:Math.floor(ref.width()*0.9),height:Math.floor(ref.height()*0.9)},animating:data.animating,inFocus:data.childInFocus,focusBearingRad:jQuery.roundabout_degToRad(data.focusBearing),shape:jQuery.roundabout_shape[data.shape]||jQuery.roundabout_shape[jQuery.roundabout_shape.def]};info.midStage={width:info.stage.width/2,height:info.stage.height/2};info.nudge={width:info.midStage.width+info.stage.width*0.05,height:info.midStage.height+info.stage.height*0.05};info.zValues={min:data.minZ,max:data.maxZ,diff:data.maxZ-data.minZ};info.opacity={min:data.minOpacity,max:data.maxOpacity,diff:data.maxOpacity-data.minOpacity};info.scale={min:data.minScale,max:data.maxScale,diff:data.maxScale-data.minScale};ref.children(data.childSelector).each(function(i){if(jQuery.roundabout_updateChildPosition(jQuery(this),ref,info,i)&&info.animating===0){inFocus=i;jQuery(this).addClass('roundabout-in-focus')}else{jQuery(this).removeClass('roundabout-in-focus')}});if(inFocus!==info.inFocus){jQuery.roundabout_triggerEvent(ref,info.inFocus,'blur');if(inFocus!==-1){jQuery.roundabout_triggerEvent(ref,inFocus,'focus')}data.childInFocus=inFocus}});return this};jQuery.roundabout_getBearing=function(el){return jQuery.roundabout_toFloat(el.data('roundabout').bearing)%360};jQuery.roundabout_degToRad=function(degrees){return(degrees%360.0)*Math.PI/180.0};jQuery.roundabout_isInFocus=function(el,target){return(jQuery.roundabout_getBearing(el)%360===(target%360))};jQuery.roundabout_triggerEvent=function(el,child,eventType){return(child<0)?this:jQuery(el.children(el.data('roundabout').childSelector)[child]).trigger(eventType)};jQuery.roundabout_toFloat=function(number){number=Math.round(parseFloat(number)*1000)/1000;return parseFloat(number.toFixed(2))};jQuery.roundabout_updateChildPosition=function(child,container,info,childPos){var ref=jQuery(child),data=ref.data('roundabout'),out=[];var rad=jQuery.roundabout_degToRad((360.0-ref.data('roundabout').degrees)+info.bearing);while(rad<0){rad=rad+Math.PI*2}while(rad>Math.PI*2){rad=rad-Math.PI*2}var factors=info.shape(rad,info.focusBearingRad,info.tilt);factors.scale=(factors.scale>1)?1:factors.scale;factors.adjustedScale=(info.scale.min+(info.scale.diff*factors.scale)).toFixed(4);factors.width=(factors.adjustedScale*data.startWidth).toFixed(4);factors.height=(factors.adjustedScale*data.startHeight).toFixed(4);ref.css('left',((factors.x*info.midStage.width+info.nudge.width)-factors.width/2.0).toFixed(1)+'px').css('top',((factors.y*info.midStage.height+info.nudge.height)-factors.height/2.0).toFixed(1)+'px').css('width',factors.width+'px').css('height',factors.height+'px').css('opacity',(info.opacity.min+(info.opacity.diff*factors.scale)).toFixed(2)).css('z-index',Math.round(info.zValues.min+(info.zValues.diff*factors.z))).css('font-size',(factors.adjustedScale*data.startFontSize).toFixed(2)+'px').attr('current-scale',factors.adjustedScale);if(container.data('roundabout').debug===true){out.push('<div style="font-weight: normal; font-size: 10px; padding: 2px; width: '+ref.css('width')+'; background-color: #ffc;">');out.push('<strong style="font-size: 12px; white-space: nowrap;">Child '+childPos+'</strong><br />');out.push('<strong>left:</strong> '+ref.css('left')+'<br /><strong>top:</strong> '+ref.css('top')+'<br />');out.push('<strong>width:</strong> '+ref.css('width')+'<br /><strong>opacity:</strong> '+ref.css('opacity')+'<br />');out.push('<strong>z-index:</strong> '+ref.css('z-index')+'<br /><strong>font-size:</strong> '+ref.css('font-size')+'<br />');out.push('<strong>scale:</strong> '+ref.attr('current-scale'));out.push('</div>');ref.html(out.join(''))}return jQuery.roundabout_isInFocus(container,ref.data('roundabout').degrees)};
