$(document).ready(function() {
   qty1 = 0;
	current1 = 1;


   $('.proc').each(function (){ 
		qty1 = qty1 + 1;
		$(this).attr('id','proc-'+qty1);
   });
	

	$("#down").click(function()
	{
      if ($('.proc:animated').length == 0)
		{
			old1 = current1;
			current1 = current1 + 1;
			if (current1 == (qty1 + 1))
				current1 = 1;
			$('#proc-'+old1).fadeOut(300, function() {
					$('#proc-'+current1).fadeIn();
		      });
		};

      return false;

	});
	$("#up").click(function()
	{
      if ($('.proc:animated').length == 0)
		{
			old1 = current1;
			current1 = current1 - 1;
			if (current1 == 0)
				current1 = qty1;
			$('#proc-'+old1).fadeOut(300, function() {
					$('#proc-'+current1).fadeIn();
		      });
		};

      return false;

	});


})
