/*
 *
 * 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){return b=b||4e3,initTicker=function(b){stopTicker(b),b.items=a("li",b),b.items.not(":eq(0)").hide().end(),b.currentitem=0,startTicker(b)},startTicker=function(a){a.tickfn=setInterval(function(){doTick(a)},b)},stopTicker=function(a){clearInterval(a.tickfn)},pauseTicker=function(a){a.pause=!0},resumeTicker=function(a){a.pause=!1},doTick=function(b){if(b.pause)return;b.pause=!0,a(b.items[b.currentitem]).fadeOut("slow",function(){a(this).hide(),b.currentitem=++b.currentitem%b.items.size(),a(b.items[b.currentitem]).fadeIn("slow",function(){b.pause=!1})})},this.each(function(){if(this.nodeName.toLowerCase()!="ul")return;initTicker(this)}).addClass("newsticker").hover(function(){pauseTicker(this)},function(){resumeTicker(this)}),this}})(jQuery)
