!function(a){var n,r,s;n={speed:700,pause:4e3,showItems:1,mousePause:!0,height:0,animate:!0,margin:0,padding:0,startPaused:!1,autoAppend:!0},r={moveUp:function(t,e){return r.showNextItem(t,e,"up")},moveDown:function(t,e){return r.showNextItem(t,e,"down")},nextItemState:function(t,e){var i,n;return n=t.element.children("ul"),i=t.itemHeight,0<t.options.height&&(i=n.children("li:first").height()),{height:i+=t.options.margin+2*t.options.padding,options:t.options,el:t.element,obj:n,selector:"up"===e?"li:first":"li:last",dir:e}},showNextItem:function(t,e,i){var n;return(n=r.nextItemState(t,i)).el.trigger("vticker.beforeTick"),i=n.obj.children(n.selector).clone(!0),"down"===n.dir&&n.obj.css("top","-"+n.height+"px").prepend(i),e&&e.animate?t.animating||r.animateNextItem(n,t):r.nonAnimatedNextItem(n),"up"===n.dir&&t.options.autoAppend&&i.appendTo(n.obj),n.el.trigger("vticker.afterTick")},animateNextItem:function(t,e){return e.animating=!0,t.obj.animate("up"===t.dir?{top:"-="+t.height+"px"}:{top:0},e.options.speed,function(){return a(t.obj).children(t.selector).remove(),a(t.obj).css("top","0px"),e.animating=!1})},nonAnimatedNextItem:function(t){return t.obj.children(t.selector).remove(),t.obj.css("top","0px")},nextUsePause:function(){var t,e;if(t=(e=a(this).data("state")).options,!e.isPaused&&!r.hasSingleItem(e))return s.next.call(this,{animate:t.animate})},startInterval:function(){var t,e,i;return t=(e=a(this).data("state")).options,e.intervalId=setInterval((i=this,function(){return r.nextUsePause.call(i)}),t.pause)},stopInterval:function(){var t;if(t=a(this).data("state"))return t.intervalId&&clearInterval(t.intervalId),t.intervalId=void 0},restartInterval:function(){return r.stopInterval.call(this),r.startInterval.call(this)},getState:function(t,e){var i;if(!(i=a(e).data("state")))throw Error("vTicker: No state available from "+t);return i},isAnimatingOrSingleItem:function(t){return t.animating||this.hasSingleItem(t)},hasMultipleItems:function(t){return 1<t.itemCount},hasSingleItem:function(t){return!r.hasMultipleItems(t)},bindMousePausing:function(t,e){return t.bind("mouseenter",function(){if(!e.isPaused)return e.pausedByCode=!0,r.stopInterval.call(this),s.pause.call(this,!0)}).bind("mouseleave",function(){if(!e.isPaused||e.pausedByCode)return e.pausedByCode=!1,s.pause.call(this,!1),r.startInterval.call(this)})},setItemLayout:function(t,e,i){var n;return t.css({overflow:"hidden",position:"relative"}).children("ul").css({position:"relative",margin:0,padding:0}).children("li").css({margin:i.margin,padding:i.padding}),isNaN(i.height)||0===i.height?(t.children("ul").children("li").each(function(){if(a(this).height()>e.itemHeight)return e.itemHeight=a(this).height()}),t.children("ul").children("li").each(function(){return a(this).height(e.itemHeight)}),n=i.margin+2*i.padding,t.height((e.itemHeight+n)*i.showItems+i.margin)):t.height(i.height)},defaultStateAttribs:function(t,e){return{itemCount:t.children("ul").children("li").length,itemHeight:0,itemMargin:0,element:t,animating:!1,options:e,isPaused:e.startPaused,pausedByCode:!1}}},s={init:function(t){var e,i;if(a(this).data("state")&&s.stop.call(this),e=jQuery.extend({},n),t=a.extend(e,t),e=a(this),i=r.defaultStateAttribs(e,t),a(this).data("state",i),r.setItemLayout(e,i,t),t.startPaused||r.startInterval.call(this),t.mousePause)return r.bindMousePausing(e,i)},pause:function(t){var e;return e=r.getState("pause",this),!!r.hasMultipleItems(e)&&(e.isPaused=t,e=e.element,t?(a(this).addClass("paused"),e.trigger("vticker.pause")):(a(this).removeClass("paused"),e.trigger("vticker.resume")))},next:function(t){var e;return e=r.getState("next",this),!r.isAnimatingOrSingleItem(e)&&(r.restartInterval.call(this),r.moveUp(e,t))},prev:function(t){var e;return e=r.getState("prev",this),!r.isAnimatingOrSingleItem(e)&&(r.restartInterval.call(this),r.moveDown(e,t))},stop:function(){return r.getState("stop",this),r.stopInterval.call(this)},remove:function(){var t;return t=r.getState("remove",this),r.stopInterval.call(this),(t=t.element).unbind(),t.remove()}},a.fn.vTicker=function(t){return s[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?a.error("Method "+t+" does not exist on jQuery.vTicker"):s.init.apply(this,arguments)}}(jQuery);