(function($){
$.fn.vTicker = function(options) {
    var defaults = {
        speed: 700,
        pause: 4000,
        showItems: 8,
        animation: '',
        mousePause: true,
        isPaused: false
    };
    var options = $.extend(defaults, options);
    moveUp = function(obj2, height){
        
        if(options.isPaused)
            return;
        
        var obj = obj2.children('ul');
        
        first = obj.children('li:first').clone(true);
    //    alert("obj2: "+obj2.id);
        height = obj.children('li:first').height();
        obj.animate({top: '-=' + (obj.children('li:first').height()+10) + 'px'}, options.speed, function() {
            $(this).children('li:first').remove();
            $(this).css('top', '0px');
        });
        
        if(options.animation == 'fade')
        {
            obj.children('li:first').fadeOut(options.speed);
            obj.children('li:last').hide().fadeIn(options.speed);
        }
        first.appendTo(obj);
    };
    
    return this.each(function() {
        var obj = $(this);
        var maxHeight = 0;
        obj.css({overflow: 'hidden', position: 'relative'})
            .children('ul').css({position: 'absolute', margin: 0, padding: 0})
            .children('li').css({ padding:0, marginTop: 0, marginBottom: 6, marginLeft: 12, marginRight: 12});
        obj.children('ul').children('li').each(function(){
            if($(this).height() > maxHeight)
            {
                maxHeight = $(this).height();
            }
        });
        obj.children('ul').children('li').each(function(){
            // $(this).height(maxHeight);
        });
        // obj.height(maxHeight * options.showItems);
        obj.height(135);
        maxHeight = obj.height();
        var interval = setInterval(function(){ moveUp(obj, maxHeight); }, options.pause);
        
        if(options.mousePause)
        {
            obj.bind("mouseenter",function(){
                options.isPaused = true;
            }).bind("mouseleave",function(){
                options.isPaused = false;
            });
        }
    });
};
})(jQuery);
