(function($){$.fn.orbit=function(_1){var _2={animation:"horizontal-push",animationSpeed:600,timer:true,advanceSpeed:4000,pauseOnHover:false,startClockOnMouseOut:false,startClockOnMouseOutAfter:1000,directionalNav:true,captions:true,captionAnimation:"fade",captionAnimationSpeed:600,bullets:false,bulletThumbs:false,bulletThumbLocation:"",afterSlideChange:function(){}};var _1=$.extend(_2,_1);return this.each(function(){var _3=0,_4=0,_5,_6,_7;var _8=$(this).addClass("orbit"),_9=_8.wrap("<div class=\"orbit-wrapper\" />").parent();_8.add(_5).width("1px").height("1px");var _a=_8.children("img, a, div");_a.each(function(){var _b=$(this),_c=_b.width(),_d=_b.height();if(_c>_8.width()){_8.add(_9).width(_c);_5=_8.width();}if(_d>_8.height()){_8.add(_9).height(_d);_6=_8.height();}_4++;});function _e(){_7=false;};function _f(){_7=true;};if(_a.length==1){_1.directionalNav=false;_1.timer=false;_1.bullets=false;}_a.eq(_3).css({"z-index":3}).fadeIn(function(){_a.css({"display":"block"});});function _10(){if(!_1.timer||_1.timer=="false"){return false;}else{if(_11.is(":hidden")){_12=setInterval(function(e){_17("next");},_1.advanceSpeed);}else{_19=true;_1a.removeClass("active");_12=setInterval(function(e){var _13="rotate("+_14+"deg)";_14+=2;_15.css({"-webkit-transform":_13,"-moz-transform":_13,"-o-transform":_13});if(_14>180){_15.addClass("move");_16.addClass("move");}if(_14>360){_15.removeClass("move");_16.removeClass("move");_14=0;_17("next");}},_1.advanceSpeed/180);}}};function _18(){if(!_1.timer||_1.timer=="false"){return false;}else{_19=false;clearInterval(_12);_1a.addClass("active");}};if(_1.timer){var _1b="<div class=\"timer\"><span class=\"mask\"><span class=\"rotator\"></span></span><span class=\"pause\"></span></div>";_9.append(_1b);var _11=$("div.timer"),_19;if(_11.length!=0){var _15=$("div.timer span.rotator"),_16=$("div.timer span.mask"),_1a=$("div.timer span.pause"),_14=0,_12;_10();_11.click(function(){if(!_19){_10();}else{_18();}});if(_1.startClockOnMouseOut){var _1c;_9.mouseleave(function(){_1c=setTimeout(function(){if(!_19){_10();}},_1.startClockOnMouseOutAfter);});_9.mouseenter(function(){clearTimeout(_1c);});}}}if(_1.pauseOnHover){_9.mouseenter(function(){_18();});}if(_1.captions){var _1d="<div class=\"orbit-caption\"></div>";_9.append(_1d);var _1e=_9.children(".orbit-caption");_1f();}function _1f(){if(!_1.captions||_1.captions=="false"){return false;}else{var _20=_a.eq(_3).data("caption");_captionHTML=$(_20).html();if(_captionHTML){_1e.attr("id",_20).html(_captionHTML);if(_1.captionAnimation=="none"){_1e.show();}if(_1.captionAnimation=="fade"){_1e.fadeIn(_1.captionAnimationSpeed);}if(_1.captionAnimation=="slideOpen"){_1e.slideDown(_1.captionAnimationSpeed);}}else{if(_1.captionAnimation=="none"){_1e.hide();}if(_1.captionAnimation=="fade"){_1e.fadeOut(_1.captionAnimationSpeed);}if(_1.captionAnimation=="slideOpen"){_1e.slideUp(_1.captionAnimationSpeed);}}}};if(_1.directionalNav){if(_1.directionalNav=="false"){return false;}var _21="<div class=\"slider-nav\"><span class=\"right\">Right</span><span class=\"left\">Left</span></div>";_9.append(_21);var _22=_9.children("div.slider-nav").children("span.left"),_23=_9.children("div.slider-nav").children("span.right");_22.click(function(){_18();_17("prev");});_23.click(function(){_18();_17("next");});}if(_1.bullets){var _24="<ul class=\"orbit-bullets\"></ul>";_9.append(_24);var _25=$("ul.orbit-bullets");for(i=0;i<_4;i++){var _26=$("<li>"+(i+1)+"</li>");if(_1.bulletThumbs){var _27=_a.eq(i).data("thumb");if(_27){var _26=$("<li class=\"has-thumb\">"+i+"</li>");_26.css({"background":"url("+_1.bulletThumbLocation+_27+") no-repeat"});}}$("ul.orbit-bullets").append(_26);_26.data("index",i);_26.click(function(){_18();_17($(this).data("index"));});}_28();}function _28(){if(!_1.bullets){return false;}else{_25.children("li").removeClass("active").eq(_3).addClass("active");}};countB=140-((15*$("#featured").children("a").length)/2);$(".orbit-bullets").css("left",countB);function _17(_29){var _2a=_3,_2b=_29;if(_2a==_2b){return false;}function _2c(){_a.eq(_2a).css({"z-index":1});_e();_1.afterSlideChange.call(this);};if(_a.length=="1"){return false;}if(!_7){_f();if(_29=="next"){_3++;if(_3==_4){_3=0;}}else{if(_29=="prev"){_3--;if(_3<0){_3=_4-1;}}else{_3=_29;if(_2a<_3){_2b="next";}else{if(_2a>_3){_2b="prev";}}}}_28();_a.eq(_2a).css({"z-index":2});if(_1.animation=="fade"){_a.eq(_3).css({"opacity":0,"z-index":3}).animate({"opacity":1},_1.animationSpeed,_2c);}if(_1.animation=="horizontal-slide"){if(_2b=="next"){_a.eq(_3).css({"left":_5,"z-index":3}).animate({"left":0},_1.animationSpeed,_2c);}if(_2b=="prev"){_a.eq(_3).css({"left":-_5,"z-index":3}).animate({"left":0},_1.animationSpeed,_2c);}}if(_1.animation=="vertical-slide"){if(_2b=="prev"){_a.eq(_3).css({"top":_6,"z-index":3}).animate({"top":0},_1.animationSpeed,_2c);}if(_2b=="next"){_a.eq(_3).css({"top":-_6,"z-index":3}).animate({"top":0},_1.animationSpeed,_2c);}}if(_1.animation=="horizontal-push"){if(_2b=="next"){_a.eq(_3).css({"left":_5,"z-index":3}).animate({"left":0},_1.animationSpeed,_2c);_a.eq(_2a).animate({"left":-_5},_1.animationSpeed);}if(_2b=="prev"){_a.eq(_3).css({"left":-_5,"z-index":3}).animate({"left":0},_1.animationSpeed,_2c);_a.eq(_2a).animate({"left":_5},_1.animationSpeed);}}_1f();}};});};})(jQuery);
