;(function($){$.fn.extend({slideWidget:function(options){var data=''
options=$.extend({},$.slideWidget.defaults,options);return this.each(function(){new $.slideWidget(this,options);});}});$.slideWidget=function(input,options){var stepSpeed=options.stepSpeed;var transSpeed=options.transSpeed;var MaxItems=0;var idx=0;var forcedIdx=0;var stepTimer;var doneOnce=false;startSlide();function startSlide(){MaxItems=$('.swImage').length;$('.swImage').hide();$('#swImage0').show();$('.swThumb a').attr('class','passive');$('#swThumb0 a').attr('class','active');$('.swThumb').bind("click",function(event){var evnTarget=event.currentTarget;if(evnTarget){forceStep(evnTarget);}});stepTimer=setTimeout(step,stepSpeed*1000);}
function forceStep(item){if(stepTimer)window.clearTimeout(stepTimer);forcedIdx=item.getAttribute("idx");forcedIdx++;step();}
function step(){showOff();stepTimer=setTimeout(step,stepSpeed*1000);}
function showOff(){if(doneOnce&&!forcedIdx){stopShow();return 0;}
$('#swImage'+parseInt(idx)).fadeOut(transSpeed);$('#swThumb'+parseInt(idx)+" a").attr('class','passive');if(forcedIdx){idx=forcedIdx-1;forcedIdx=0;showOn();}else{idx++;if(idx<MaxItems){showOn();}else{idx=0;showOn();doneOnce=true;}}}
function showOn(){$('#swThumb'+parseInt(idx)+" a").attr('class','active');$('#swImage'+parseInt(idx)).fadeIn(transSpeed);}
function stopShow(){try{if(stepTimer)window.clearTimeout(stepTimer);}catch(e){alert(e)}}}
$.slideWidget.defaults={stepSpeed:6,transSpeed:1000};})(jQuery);
