(function($) {
	$.fn.slider = function(){
        var prova=this.attr('id');
        jQuery(this).css('display','none');
        jQuery(this).after('<span id="tastodown"><a href="javascript:void(0)"><img src="images/icons/pren.png" border="0"></a></span> <span id="tastoup"><a href="javascript:void(0)"><img src="images/icons/next.png" border="0"></a></span>');
        var z=0;
        var v=0;
        function up(iddiv) {
            var a=jQuery('#'+iddiv).clone().find('li');
            if (z<a.length) {
                var b=jQuery('#'+iddiv+"_1").find('li');
                if (b.length=='0') {
                    jQuery('#'+iddiv).after('<div id="'+iddiv+'_1"></div>');
                }
                else {
                    jQuery('#'+iddiv+"_1").empty(); 
                }
                    jQuery('#'+iddiv+"_1").html(a[z]);
                v=z;
                z++;
            }
        }

        function down(iddiv) {
            if (v>0) {
                z--;
                v--;
                var a=jQuery('#'+iddiv).clone().find('li');
                var b=jQuery('#'+iddiv+'_1').find('li');
                if (b.length=='0') {
                    jQuery('#'+iddiv).after('<div id="'+iddiv+'_1"></div>');
                }
                else {
                    jQuery('#'+iddiv+'_1').empty(); 
                }
                   jQuery('#'+iddiv+'_1').html(a[v]);
            }
        }
    jQuery('#tastoup').click(function(){up(prova)});
    jQuery('#tastodown').click(function(){down(prova)});
    up(prova);
    };
})(jQuery);
