!function(t,e,n){function o(o,i){function r(){m.elem.children().css("margin",0).children().css("margin",0),m.elem.css({position:"relative",height:m.opts.height,overflow:"hidden"}),m.targ.css({position:"absolute",margin:0}),setInterval(function(){f()},100)}function c(){m.timer=setInterval(function(){1==m.winFocus&&l(m.opts.direction)},m.opts.interval),t(m.opts.controls.toggle).addClass("run").html(m.opts.controls.stopText)}function a(){clearInterval(m.timer),m.timer=0,t(m.opts.controls.toggle).removeClass("run").html(m.opts.controls.playText)}function l(t){var e,n,o;if(m.elem.is(":visible")){"up"==t?(e=":first-child",n="-=",o="appendTo"):(e=":last-child",n="+=",o="prependTo");var i=m.targ.children(e),s=i.outerHeight();m.targ.stop(!0,!0).animate({top:n+s+"px"},m.opts.duration,m.opts.animation,function(){i.hide()[o](m.targ).fadeIn(),m.targ.css("top",0),f()})}}function u(t){a(),"up"==t?l("up"):l("down")}function p(){var e=0,n=m.elem.css("display");m.elem.css("display","block"),m.targ.children().each(function(){e+=t(this).outerHeight()}),m.elem.css({display:n,height:e})}function h(e){var n=0;m.targ.children(":lt("+m.opts.visible+")").each(function(){n+=t(this).outerHeight()}),1==e?m.elem.stop(!0,!0).animate({height:n},m.opts.duration):m.elem.css("height",n)}function f(){"auto"==m.opts.height&&0!=m.opts.visible?(anim="init"==arguments.callee.caller.name?0:1,h(anim)):"auto"==m.opts.height&&p()}var m=this;return m.opts=t.extend({},s,i),m.elem=t(o),m.targ=t(o).children(":first-child"),m.timer=0,m.mHover=0,m.winFocus=1,r(),c(),t([e,n]).off("focus.jqet").on("focus.jqet",function(){m.winFocus=1}).off("blur.jqet").on("blur.jqet",function(){m.winFocus=0}),1==m.opts.mousePause&&m.elem.mouseenter(function(){m.timerTemp=m.timer,a()}).mouseleave(function(){0!==m.timerTemp&&c()}),t(m.opts.controls.up).on("click",function(t){t.preventDefault(),u("up")}),t(m.opts.controls.down).on("click",function(t){t.preventDefault(),u("down")}),t(m.opts.controls.toggle).on("click",function(t){t.preventDefault(),0==m.timer?c():a()}),{up:function(){u("up")},down:function(){u("down")},start:c,stop:a,options:m.opts}}var i="newsticker",s={height:"auto",visible:3,duration:500,interval:5e3,direction:"up",animation:"swing",mousePause:0,controls:{up:"",down:"",toggle:"",playText:"",stopText:""}};t.fn[i]=function(e){return this.each(function(){t.data(this,i)||t.data(this,i,new o(this,e))})}}(jQuery,window,document);