jQuery.fn.live = function(settings) {
    settings = jQuery.extend({
        newsSpeed: "normal"
    }, settings);
    return this.each(function(i) {
        aNewsSlider.itemHeight = parseInt(jQuery(".item:eq(" + i + ")",".cards_slider").css("height")) + parseInt(jQuery(".item:eq(" + i + ")",".cards_slider").css("margin-bottom"));
        aNewsSlider.init(settings,this);

    });
};
var aNewsSlider = {
    itemWidth: 0,
    itemHeight:0,
    init: function(s,p) {
        jQuery(".messaging",p).css("display","none");
        itemLength = jQuery(".item",p).length;
        newsContainerHeight = itemLength * aNewsSlider.itemHeight;
        ///jQuery(".container",p).css("height",newsContainerHeight + "px");
        jQuery(".next",p).css("display","block");
        animating = false;

    $.rtnext2 = function() {
            if (animating == false) {
                animating = true;
                animateBottom = parseInt(jQuery(".container",p).css("bottom")) - (aNewsSlider.itemHeight)-10;
                if (animateBottom + parseInt(jQuery(".container",p).css("height")) > 0) {
                    //jQuery(".prev",p).css("display","block");
                    jQuery(".container",p).animate({bottom: animateBottom}, s.newsSpeed, function() {
                        jQuery(this).css("bottom",animateBottom);
                        /*if (parseInt(jQuery(".container",p).css("left")) + parseInt(jQuery(".container",p).css("width")) <= aNewsSlider.itemWidth) {
                            jQuery(".next",p).css("display","none");
                        }*/
                        animating = false;
                    });
                } else {
                    animating = false;
                }
            }
            return false;
        };
    },
    vAll: function(s,p) {
        var o = p;
        while (p) {
            p = p.parentNode;
            if (jQuery(p).attr("class") != undefined && jQuery(p).attr("class").indexOf("cards_slider") != -1) {
                break;
            }
        }

    }
};
