var todo = [];				  
todo[todo.length]={fn:function(){$('.rotator').each(function(){var items=$(this).find('li.r').each(function(i){$(this).data('rotation:index',i);});var selected=0;var switchTo=function(i){if(i==selected){return;}
var item1=items.eq(selected);var img1=item1.find('img');var item2=items.eq(i);var img2=item2.find('img');img1.stop(false,true);img2.stop(false,true);img2.hide();img1.fadeOut('fast',function(){item1.removeClass('selected');item2.addClass('selected');selected=i;img2.fadeIn('slow');});};var skipTo=function(i){if(i==selected){return;}
var item1=items.eq(selected);var img1=item1.find('img');var item2=items.eq(i);var img2=item2.find('img');img1.stop(true,true).hide();img2.stop(true,true).show();item1.removeClass('selected');item2.addClass('selected');selected=i;};var rotate=function(){var i=selected;if(++i>=items.length){i=0;}
switchTo(i);};var interval=false;var startRotation=function(){if(!interval){interval=window.setInterval(rotate,6000);}};var stopRotation=function(){if(interval){window.clearInterval(interval);interval=false;}};items.mouseover(function(){stopRotation();var i=$(this).data('rotation:index');skipTo(i);}).mouseout(startRotation);startRotation();});}};

