(function($){var roller=function(element,options){this.element=element;var defaults={cycleTime:5000};this.options=$.extend(defaults,options);this.timer=null;this.currentNode=null;this.clicked=false;roller.prototype.init=function(){var firstList=$('li.article:first',this.element);firstList.addClass('selected').fadeIn('fast');firstList.siblings().fadeOut('fast');$('li.article',this.element).css('position','absolute').css('top',0);this.currentNode=firstList;var pager=$(this.element).siblings('div.pagination');var self=this;$('li',pager).each(function(i){var li=$(this);var anchor=$(li.children()[0]);anchor.bind('click',function(){return false;});li.hover(function(){var nodeToShow=$('li.article:nth-child('+(i+1)+')',this.element);self.currentNode=nodeToShow;self.stop();self.showPage(nodeToShow);},function(){self.start();});});if(this.options.cycleTime>0) {this.element.hover(function(){self.stop();},function(){self.start();});} this.element.find("a.newwindow").live('click',function(){window.open($(this).attr('href'));return false});this.start();};roller.prototype.showPage=function(next){var current=this.element.find('li.selected');this.fade(current,next);};roller.prototype.moveNext=function(){var current=this.element.find('li.selected')?this.element.find('li.selected'):this.element.find('li:first');var next=current.next().length?current.next():this.element.find('li:first');this.currentNode=next;this.fade(current,next);this.start();};roller.prototype.fade=function(current,next){current.removeClass('selected').fadeOut();next.addClass('selected').fadeIn();var newIndex=this.element.find('li.article').index(next)+1;$('li.page.current').removeClass('current');$('.pagination li:nth-child('+newIndex+')').addClass('current');};roller.prototype.start=function(){var self=this;if(this.options.cycleTime>0) {this.stop();this.timer=setTimeout(function(){self.moveNext();},this.options.cycleTime);}};roller.prototype.stop=function(){if(this.timer) {clearTimeout(this.timer);}};};$.fn.extend({summaryRoll:function(options){return this.each(function(){var o=options;var e=$(this);if(e.data('summaryRoll')) {return;} var rl=new roller(e,o);e.data('summaryRoll',rl);rl.init();});}});})(jQuery);