/*
 *
 * Copyright (c) 2006/2007 Sam Collett (http://www.texotela.co.uk)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Version 2.0
 * Demo: http://www.texotela.co.uk/code/jquery/newsticker/
 *
 * $LastChangedDate$
 * $Rev$
 *
 */
(function(A){A.fn.newsTicker=A.fn.newsticker=function(B){B=B||4000;initTicker=function(C){stopTicker(C);C.items=A("li",C);C.items.not(":eq(0)").hide().end();C.currentitem=0;startTicker(C)};startTicker=function(C){C.tickfn=setInterval(function(){doTick(C)},B)};stopTicker=function(C){clearInterval(C.tickfn)};pauseTicker=function(C){C.pause=true};resumeTicker=function(C){C.pause=false};doTick=function(C){if(C.pause){return }C.pause=true;A(C.items[C.currentitem]).fadeOut("slow",function(){A(this).hide();C.currentitem=++C.currentitem%(C.items.size());A(C.items[C.currentitem]).fadeIn("slow",function(){C.pause=false})})};this.each(function(){if(this.nodeName.toLowerCase()!="ul"){return }initTicker(this)}).addClass("newsticker").hover(function(){pauseTicker(this)},function(){resumeTicker(this)});return this}})(jQuery);