(function(jQuery){jQuery.fn.headline=function(o){o=jQuery.extend({effect:'ticker',speed:2000,wait:5000,interval:500,delay:1000},o);return this.each(function(){var e=jQuery(this),t=e.children();t.hide();e.css({overflow:'hidden'});setTimeout(function(){var n=0,f=function(){jQuery(t[n]).css({whiteSpace:'nowrap'});switch(o.effect){case'fade':jQuery(t[n]).fadeIn(o.speed).delay(o.wait).fadeOut(o.speed);break;case'slide':jQuery(t[n]).slideDown(o.speed).delay(o.wait).slideUp(o.speed);break;default:var w=e.innerWidth()+100;jQuery(t[n]).css({marginLeft:w+'px'});jQuery(t[n]).show(0).animate({marginLeft:'0'},o.speed,'swing').delay(o.wait).animate({marginLeft:'-'+(Math.max(e.innerWidth(),jQuery(t[n]).outerWidth())+100)+'px'},o.speed,'swing').hide(0).animate({marginLeft:w+'px'},0);}n=n>t.length-2?0:n+1;setTimeout(f,o.speed*2+o.wait+o.interval);};f();},o.delay);});};})(jQuery);

