
(function($){$.fn.cuiNewsticker=function(options){var self=this;var settings=$.extend({speed:700,delay:5000,delayPause:400,height:0},options||{});var cnt=0;var maxHeight=0;var timer;var pause=false;function _move(){if(!pause){var clone=$(self).children('ul').children('li:first').clone(true);$(self).children('ul').stop().animate({top:'-='+maxHeight+'px'},options.speed,function(){$(this).children('li:first').remove();$(this).css({'top':'0px'});clone.appendTo($(self).children('ul'));});}
if(!pause){cnt++;if(cnt<100){try{clearTimeout(timer);timer=setTimeout(_move,settings.delay);}catch(e){}}}else{}};function _init(){$(self).css({overflow:'hidden',position:'relative'}).children('ul').css({position:'absolute',margin:0,padding:0}).children('li').each(function(){if($(this).height()>maxHeight){maxHeight=$(this).height();}}).css({margin:0,padding:0}).children('a').css({display:'block'});$(self).height(maxHeight);$(self).children('ul').children('li').children('a').css({height:maxHeight,width:'100%'});$(self).live('mouseenter',function(){pause=true;});$(self).live('mouseleave',function(){if(pause){try{clearTimeout(timer);}catch(e){}
timer=setTimeout(_move,settings.delayPause);}
pause=false;});timer=setTimeout(_move,settings.delay);};_init();return this;};})(jQuery);
