﻿/**
 * jQuery-slideShow
 * Thanks to Ariel Flesler for is jQuery.ScrollShow
 * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php).
 * Date: 10/02/2010
 * @author Christophe LAFFONT
 * @version 1.0
 **/
(function($){$.fn.slideShow=function(options){var defaults={view:'.view',navigators:null,circular:false,easing:'linear',speed:500,start:0};var settings=$.extend(defaults,options);this.each(function(){var
widget=this,$view=settings.view?$(settings.view,this):this,$elements=$('li',$view),dim={w:$elements.outerWidth(true),h:$elements.height()},limit=$elements.length-Math.ceil($(widget).innerWidth()/dim.w),$pos=$('#pos'),active=0;if($elements.length<=limit){return;}function sequential(event){event.data.pos=active+event.data.dir;return random(event);}function animate(pos){if(settings.easing){$view.stop().animate({marginLeft:-((pos)*dim.w)+'px'},{queue:false,duration:settings.speed,easing:settings.easing});}else{$elements.hide().eq(pos).show();}$pos.html(pos+1+' / '+$elements.length);active=pos;return;}function random(event){var pos=typeof event=='number'?event:event.data.pos;if(pos<0){pos=active===0&&settings.circular?limit:0;which=0;}else if(pos>limit){pos=active==limit&&settings.circular?0:limit;which=1;}animate(pos);active=pos;return false;}$(settings.navigators,widget).show().find('a').eq(0).bind('click.prev',{dir:-1},sequential).end().eq(1).bind('click.next',{dir:+1},sequential);if(settings.start!==null){random(settings.start);}});};})(jQuery);

