1jQuery(function() {
2    'use strict';
3
4    var duration = 3000;
5    if (typeof JSINFO['plugin']['newsticker']['duration'] !== 'undefined'){
6        duration = JSINFO['plugin']['newsticker']['duration'] * 1000;
7    }
8
9    function ticker() {
10        jQuery('ul#tickerlist li:first').slideUp(function () {
11            jQuery(this).appendTo(jQuery('ul#tickerlist')).slideDown();
12        });
13    }
14
15    function unticker() {
16        jQuery('ul#tickerlist li:last').slideUp(function () {
17            jQuery(this).prependTo(jQuery('ul#tickerlist')).slideDown();
18        });
19    }
20
21    setInterval(function () {
22        if (jQuery('#plugin-newsticker').hasClass('ticking')) {
23            ticker();
24        }
25    }, duration);
26
27    jQuery('#plugin-newsticker').hover(function () {
28        jQuery(this).removeClass('ticking');
29    },function () {
30        jQuery(this).addClass('ticking');
31    });
32
33    jQuery('button#plugin_newsticker_unticker').click(function () {
34        unticker();
35    });
36
37    jQuery('button#plugin_newsticker_ticker').click(function () {
38        ticker();
39    });
40
41});
42