var itemsActive = 0;

jQuery.slideud = function (opciones_usuario) {

    var opciones_default = {
        contenido: ".SlideDU .Content",
        navs: ".SlideDU .Navs",
        itemNum: 3,
        numLineas: 3,
        velocidad: 300
    }

    var opciones = jQuery.extend(opciones_default, opciones_usuario);
    var timer = setInterval("TimerDown()", 4000);

    $(opciones.navs).find('a').click(function (e) {
        e.preventDefault();
        var index = $(opciones.navs).find('a').index(this);
        if (index == 0) {
            itemsActive++;
            if (itemsActive > opciones.numLineas - 1) itemsActive = opciones.numLineas - 1;
        } else if (index == 1) {
            itemsActive--;
            if (itemsActive < 0) itemsActive = 0;
        }
        clearInterval(timer);
        timer = setInterval("TimerDown()", 4000);
        $(opciones.contenido).stop().animate({ 'top': -itemsActive * ($(opciones.contenido).parent().height() - 4) }, opciones.velocidad);
    });
    $(opciones.contenido).hover(function () {
        clearInterval(timer);
    }, function () {
        clearInterval(timer);
        timer = setInterval("TimerDown()", 4000);
    });

}
function TimerDown() {
    itemsActive++;
    if (itemsActive > 3 - 1) itemsActive = 0;
    $('.ProductosSS .Items .Item').stop().animate({ 'top': -itemsActive * ($('.ProductosSS .Items .Item').parent().height() - 4) }, 1000);

}

