/*
  jquery.carousel
  made by Robin Duckett in 2009
  http://twitter.com/robinduckett
  You are free to use, modify or distribute this code as long as it retains this header.
*/
(function($){$.fn.carousel=function(d){var e={start:0,duration:10000,hide:'fadeOut',show:'fadeIn',speed:'slow',seed:5,timer:0,animate:true,slideshow:true};function _rand(a,b){return(Math.floor(Math.random()*(b-a))+a)}function _generateId(a){var b='abcdefghijklmnopqrstuvwxyz0123456789';var c='';for(i=0;i<a;i++){c+=b.charAt(_rand(0,b.length-1))}return c}function _init(){if($(f).children('li').length<=1)return;$(f).children('li').each(function(a){if(d.slideshow){$(this)[a==h?d.show:'hide'](a==h?d.speed:'').addClass(j+a).addClass('slide')[a==h?'addClass':'removeClass']('active')}else{$(this).addClass(j+a).addClass('slide')[a==h?'addClass':'removeClass']('active')}g=a});d.timer=setTimeout(function(){var a=arguments.callee;if(d.animate&&d.slideshow){$(f).children('li.'+j+h)[d.hide](d.speed,function(){$(this).removeClass('active');h=h==g?0:h+1;$(f).children('li.'+j+h).addClass('active');$(f).children('li.'+j+h)[d.show](d.speed,function(){d.timer=setTimeout(a,d.duration)})})}else if(!d.slideshow&&!d.animate){setTimeout(function(){$(f).children('li.'+j+h).removeClass('active');h=h==g?0:h+1;$(f).children('li.'+j+h).addClass('active');setTimeout(function(){d.timer=setTimeout(a,d.duration)},d.speed)},d.speed)}else if(d.slideshow&&!d.animate){setTimeout(function(){$(f).children('li.'+j+h).removeClass('active').hide();h=h==g?0:h+1;$(f).children('li.'+j+h).addClass('active').show();setTimeout(function(){d.timer=setTimeout(a,d.duration)},d.speed)},d.speed)}},d.duration)}d=jQuery.extend(e,d);var f=this;var g;var h=d.start;var j=_generateId(d.seed);$(f).load(_init())}})(jQuery);