// Javascript Functions

function swapDiv(id, hideList) {
//	var element = document.getElementById(id).style.display;

	var arr = hideList.split(',');
		
	var x;
	
	for (x in arr) {
		document.getElementById(arr[x]).style.display = 'none';
		//document.write(arr[x]);
	}
	
	document.getElementById(id).style.display = 'block';

}

function addQty(id,price,disp,codice_negozio){

			if(document.getElementById(id).value > disp - 1)
				return;
			else
				document.getElementById(id).value++;
		   		var quantity = document.getElementById(id).value;
				$.get("test.php", { codice_negozio: codice_negozio, quantita: quantity } );
		}


function subtractQty(id,price){

			if(document.getElementById(id).value - 1 < 1)
				return;
			else
				document.getElementById(id).value--;
				var quantity = document.getElementById(id).value;
				$.get("test.php", { codice_negozio: codice_negozio, quantita: quantity } );
		}



function total(price,quant_id,tot_id){
	var quantity = document.getElementById(quant_id).value;
	var total = 0;
	total = (quantity * price);
				return document.getElementById(tot_id).value = (total.toFixed(2));
		}

