function modifyQuantity(action, form, input)
{
	var el = document.forms[form][input];
	
	if(action == 'add')	{
		el.value++;
	} else {
		if(el.value>2) {
			el.value--;
		} else {
			el.value = 1;
		}
	}
}

//=============================== SCROLL PRODOTTI HOME E OFFERTE
	
if ($('.prodotti.home li').length > 5) {
	$('.prodotti.home ul li:last').remove().prependTo('.prodotti.home ul');
	$('.prodotti.home ul').css('left','-128px');
}
if ($('.prodotti.offerte li').length > 3) {
	$('.prodotti.offerte ul li:last').remove().prependTo('.prodotti.offerte ul');
	$('.prodotti.offerte ul').css('left','-214px');
}

$('.next').click(function(){
	gallery = $(this).prev('div').children('ul');
	offset = gallery.children('li').outerWidth(true);
	if (!gallery.is(':animated')) {
		gallery.stop(true).animate({'margin-left':'-'+offset},600,function(){
			gallery.children('li:first').remove().appendTo(gallery);
			gallery.css('margin-left','0px');
		});
	}
});

$('.prev').click(function(){
	gallery = $(this).next('div').children('ul');
	offset = gallery.children('li').outerWidth(true);
	elemWidth = gallery.children('li').width();
	if (!gallery.children('li:first').is(':animated')) {
		gallery.children('li:last').css({'width':'0px', 'padding':'0px', 'overflow':'hidden'}).remove().prependTo(gallery);
		gallery.children('li:first').stop(true).animate({width:elemWidth, 'paddingLeft':'10px', 'paddingRight':'10px'},600);
	}
});

/*$('#catalog').accordion({
	header: 'li[class*=cat] > a',
	collapsible: true,
	event: 'mouseover',
	active: 'li.active a'
 });*/
 
/*var menu = $('#catalog');

// accordion menu
$('li ul', menu).hide();						// nasconde tutti i menu di secondo livello
$('li[class*=active] > ul', menu).show();		// mostra i menu attivi

$('li > a', menu).hover(function(){										// quando clicco su un collegamento
	$(this).next().filter(':not(:animated)').slideDown('normal');									// apro il sottomenu corrispondente e...
	$(this).parent().siblings('li').children('ul').filter(':not(:animated)').slideUp('normal');	// ...nascondo gli altri menu
	return false;
});*/
// fine accordion menu