function startAutoPlay(){return setInterval(function(){$("ul.imagerotator").roundabout_animateToNextChild()},3e3)}jQuery.extend({roundabout_shape:{def:"lazySusan",lazySusan:function(a,b,c){return{x:Math.sin(a+b),y:Math.sin(a+3*Math.PI/2+b)/8*c,z:(Math.cos(a+b)+1)/2,scale:Math.sin(a+Math.PI/2+b)/2+.5}}}});jQuery.fn.roundabout=function(){var a=typeof arguments[0]!="object"?{}:arguments[0];a={bearing:typeof a.bearing=="undefined"?0:jQuery.roundabout_toFloat(a.bearing%360),tilt:typeof a.tilt=="undefined"?0:jQuery.roundabout_toFloat(a.tilt),minZ:typeof a.minZ=="undefined"?10:parseInt(a.minZ,10),maxZ:typeof a.maxZ=="undefined"?400:parseInt(a.maxZ,10),minOpacity:typeof a.minOpacity=="undefined"?.9:jQuery.roundabout_toFloat(a.minOpacity),maxOpacity:typeof a.maxOpacity=="undefined"?1:jQuery.roundabout_toFloat(a.maxOpacity),minScale:typeof a.minScale=="undefined"?.3:jQuery.roundabout_toFloat(a.minScale),maxScale:typeof a.maxScale=="undefined"?1.1:jQuery.roundabout_toFloat(a.maxScale),duration:typeof a.duration=="undefined"?300:parseInt(a.duration,10),btnNext:a.btnNext||null,btnPrev:a.btnPrev||null,easing:a.easing||"swing",clickToFocus:a.clickToFocus!==false,focusBearing:typeof a.focusBearing=="undefined"?0:jQuery.roundabout_toFloat(a.focusBearing%360),shape:a.shape||"lazySusan",debug:a.debug||false,childSelector:a.childSelector||"li",startingChild:typeof a.startingChild=="undefined"?null:parseInt(a.startingChild,10),reflect:typeof a.reflect=="undefined"||a.reflect===false?false:true};this.each(function(b){var c=jQuery(this);var d=jQuery.roundabout_toFloat(360/c.children(a.childSelector).length);var e=a.startingChild===null?a.bearing:a.startingChild*d;c.addClass("roundabout-holder").css("padding",0).css("position","relative").css("z-index",a.minZ);c.data("roundabout",{bearing:e,tilt:a.tilt,minZ:a.minZ,maxZ:a.maxZ,minOpacity:a.minOpacity,maxOpacity:a.maxOpacity,minScale:a.minScale,maxScale:a.maxScale,duration:a.duration,easing:a.easing,clickToFocus:a.clickToFocus,focusBearing:a.focusBearing,animating:0,childInFocus:-1,shape:a.shape,period:d,debug:a.debug,childSelector:a.childSelector,reflect:a.reflect});if(a.clickToFocus===true){c.children(a.childSelector).each(function(b){jQuery(this).click(function(e){var f=a.reflect===true?360-d*b:d*b;f=jQuery.roundabout_toFloat(f);if(!jQuery.roundabout_isInFocus(c,f)){e.preventDefault();if(c.data("roundabout").animating===0){c.roundabout_animateAngleToFocus(f)}return false}})})}if(a.btnNext){jQuery(a.btnNext).bind("click.roundabout",function(a){a.preventDefault();if(c.data("roundabout").animating===0){c.roundabout_animateToNextChild()}return false})}if(a.btnPrev){jQuery(a.btnPrev).bind("click.roundabout",function(a){a.preventDefault();if(c.data("roundabout").animating===0){c.roundabout_animateToPreviousChild()}return false})}});this.roundabout_startChildren();if(typeof arguments[1]==="function"){var b=arguments[1],c=this;setTimeout(function(){b(c)},0)}return this};jQuery.fn.roundabout_startChildren=function(){this.each(function(a){var b=jQuery(this);var c=b.data("roundabout");var d=b.children(c.childSelector);d.each(function(a){var b=c.reflect===true?360-c.period*a:c.period*a;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:b})});b.roundabout_updateChildPositions()});return this};jQuery.fn.roundabout_setTilt=function(a){this.each(function(b){jQuery(this).data("roundabout").tilt=a;jQuery(this).roundabout_updateChildPositions()});if(typeof arguments[1]==="function"){var b=arguments[1],c=this;setTimeout(function(){b(c)},0)}return this};jQuery.fn.roundabout_setBearing=function(a){this.each(function(b){jQuery(this).data("roundabout").bearing=jQuery.roundabout_toFloat(a%360,2);jQuery(this).roundabout_updateChildPositions()});if(typeof arguments[1]==="function"){var b=arguments[1],c=this;setTimeout(function(){b(c)},0)}return this};jQuery.fn.roundabout_adjustBearing=function(a){a=jQuery.roundabout_toFloat(a);if(a!==0){this.each(function(b){jQuery(this).data("roundabout").bearing=jQuery.roundabout_getBearing(jQuery(this))+a;jQuery(this).roundabout_updateChildPositions()})}if(typeof arguments[1]==="function"){var b=arguments[1],c=this;setTimeout(function(){b(c)},0)}return this};jQuery.fn.roundabout_adjustTilt=function(a){a=jQuery.roundabout_toFloat(a);if(a!==0){this.each(function(b){jQuery(this).data("roundabout").tilt=jQuery.roundabout_toFloat(jQuery(this).roundabout_get("tilt")+a);jQuery(this).roundabout_updateChildPositions()})}if(typeof arguments[1]==="function"){var b=arguments[1],c=this;setTimeout(function(){b(c)},0)}return this};jQuery.fn.roundabout_animateToBearing=function(a){a=jQuery.roundabout_toFloat(a);var b=new Date;var c=typeof arguments[1]=="undefined"?null:arguments[1];var d=typeof arguments[2]=="undefined"?null:arguments[2];var e=typeof arguments[3]!=="object"?null:arguments[3];this.each(function(f){var g=jQuery(this),h=g.data("roundabout"),i,j,k;var l=c===null?h.duration:c;var m=d!==null?d:h.easing||"swing";if(e===null){e={timerStart:b,start:jQuery.roundabout_getBearing(g),totalTime:l}}i=b-e.timerStart;if(i<l){h.animating=1;if(typeof jQuery.easing.def=="string"){j=jQuery.easing[m]||jQuery.easing[jQuery.easing.def];k=j(null,i,e.start,a-e.start,e.totalTime)}else{k=jQuery.easing[m](i/e.totalTime,i,e.start,a-e.start,e.totalTime)}g.roundabout_setBearing(k,function(){g.roundabout_animateToBearing(a,l,m,e)})}else{a=a<0?a+360:a%360;h.animating=0;g.roundabout_setBearing(a)}});return this};jQuery.fn.roundabout_animateToDelta=function(a){var b=arguments[1],c=arguments[2];this.each(function(d){a=jQuery.roundabout_getBearing(jQuery(this))+jQuery.roundabout_toFloat(a);jQuery(this).roundabout_animateToBearing(a,b,c)});return this};jQuery.fn.roundabout_animateToChild=function(a){var b=arguments[1],c=arguments[2];this.each(function(d){var e=jQuery(this),f=e.data("roundabout");if(f.childInFocus!==a&&f.animating===0){var g=jQuery(e.children(f.childSelector)[a]);e.roundabout_animateAngleToFocus(g.data("roundabout").degrees,b,c)}});return this};jQuery.fn.roundabout_animateToNearbyChild=function(a,b){var c=a[0],d=a[1];this.each(function(a){var e=jQuery(this).data("roundabout");var f=jQuery.roundabout_toFloat(360-jQuery.roundabout_getBearing(jQuery(this)));var g=e.period,h=0,i;var j=e.reflect;var k=jQuery(this).children(e.childSelector).length;f=j===true?f%360:f;if(e.animating===0){if(j===false&&b==="next"||j===true&&b!=="next"){f=f===0?360:f;while(true&&h<k){i={lower:jQuery.roundabout_toFloat(g*h),upper:jQuery.roundabout_toFloat(g*(h+1))};i.upper=h==k-1?360:i.upper;if(f<=i.upper&&f>i.lower){jQuery(this).roundabout_animateToDelta(f-i.lower,c,d);break}h++}}else{while(true){i={lower:jQuery.roundabout_toFloat(g*h),upper:jQuery.roundabout_toFloat(g*(h+1))};i.upper=h==k-1?360:i.upper;if(f>=i.lower&&f<i.upper){jQuery(this).roundabout_animateToDelta(f-i.upper,c,d);break}h++}}}});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(a){var b=arguments[1],c=arguments[2];this.each(function(d){var e=jQuery.roundabout_getBearing(jQuery(this))-a;e=Math.abs(360-e)<Math.abs(0-e)?360-e:0-e;e=e>180?-(360-e):e;if(e!==0){jQuery(this).roundabout_animateToDelta(e,b,c)}});return this};jQuery.fn.roundabout_updateChildPositions=function(){this.each(function(a){var b=jQuery(this),c=b.data("roundabout");var d=-1;var e={bearing:jQuery.roundabout_getBearing(b),tilt:c.tilt,stage:{width:Math.floor(b.width()*.9),height:Math.floor(b.height()*.9)},animating:c.animating,inFocus:c.childInFocus,focusBearingRad:jQuery.roundabout_degToRad(c.focusBearing),shape:jQuery.roundabout_shape[c.shape]||jQuery.roundabout_shape[jQuery.roundabout_shape.def]};e.midStage={width:e.stage.width/2,height:e.stage.height/2};e.nudge={width:e.midStage.width+e.stage.width*.05,height:e.midStage.height+e.stage.height*.05};e.zValues={min:c.minZ,max:c.maxZ,diff:c.maxZ-c.minZ};e.opacity={min:c.minOpacity,max:c.maxOpacity,diff:c.maxOpacity-c.minOpacity};e.scale={min:c.minScale,max:c.maxScale,diff:c.maxScale-c.minScale};b.children(c.childSelector).each(function(a){if(jQuery.roundabout_updateChildPosition(jQuery(this),b,e,a)&&e.animating===0){d=a;jQuery(this).addClass("roundabout-in-focus")}else{jQuery(this).removeClass("roundabout-in-focus")}});if(d!==e.inFocus){jQuery.roundabout_triggerEvent(b,e.inFocus,"blur");if(d!==-1){jQuery.roundabout_triggerEvent(b,d,"focus")}c.childInFocus=d}});return this};jQuery.roundabout_getBearing=function(a){return jQuery.roundabout_toFloat(a.data("roundabout").bearing)%360};jQuery.roundabout_degToRad=function(a){return a%360*Math.PI/180};jQuery.roundabout_isInFocus=function(a,b){return jQuery.roundabout_getBearing(a)%360===b%360};jQuery.roundabout_triggerEvent=function(a,b,c){return b<0?this:jQuery(a.children(a.data("roundabout").childSelector)[b]).trigger(c)};jQuery.roundabout_toFloat=function(a){a=Math.round(parseFloat(a)*1e3)/1e3;return parseFloat(a.toFixed(2))};jQuery.roundabout_updateChildPosition=function(a,b,c,d){var e=jQuery(a),f=e.data("roundabout"),g=[];var h=jQuery.roundabout_degToRad(360-e.data("roundabout").degrees+c.bearing);while(h<0){h=h+Math.PI*2}while(h>Math.PI*2){h=h-Math.PI*2}var i=c.shape(h,c.focusBearingRad,c.tilt);i.scale=i.scale>1?1:i.scale;i.adjustedScale=(c.scale.min+c.scale.diff*i.scale).toFixed(4);i.width=(i.adjustedScale*f.startWidth).toFixed(4);i.height=(i.adjustedScale*f.startHeight).toFixed(4);e.css("left",(i.x*c.midStage.width+c.nudge.width-i.width/2).toFixed(1)+"px").css("top",(i.y*c.midStage.height+c.nudge.height-i.height/2).toFixed(1)+"px").css("width",i.width+"px").css("height",i.height+"px").css("opacity",(c.opacity.min+c.opacity.diff*i.scale).toFixed(2)).css("z-index",Math.round(c.zValues.min+c.zValues.diff*i.z)).css("font-size",(i.adjustedScale*f.startFontSize).toFixed(2)+"px").attr("current-scale",i.adjustedScale);if(b.data("roundabout").debug===true){g.push('<div style="font-weight: normal; font-size: 10px; padding: 2px; width: '+e.css("width")+'; background-color: #ffc;">');g.push('<strong style="font-size: 12px; white-space: nowrap;">Child '+d+"</strong><br />");g.push("<strong>left:</strong> "+e.css("left")+"<br /><strong>top:</strong> "+e.css("top")+"<br />");g.push("<strong>width:</strong> "+e.css("width")+"<br /><strong>opacity:</strong> "+e.css("opacity")+"<br />");g.push("<strong>z-index:</strong> "+e.css("z-index")+"<br /><strong>font-size:</strong> "+e.css("font-size")+"<br />");g.push("<strong>scale:</strong> "+e.attr("current-scale"));g.push("</div>");e.html(g.join(""))}return jQuery.roundabout_isInFocus(b,e.data("roundabout").degrees)};$(document).ready(function(){var a;$("ul.imagerotator").roundabout().hover(function(){clearInterval(a)},function(){a=startAutoPlay()});a=startAutoPlay()});var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-4218230-5"]);_gaq.push(["_trackPageview"]);(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})()
