function jsInsertCart(form) {
	id = form.elements["id"].value;
	quantita = form.elements["quantita"].value;
	if(jsIsLogged()) {
		ret = insertCart(id, quantita, {"content_type": "json", "type": "synchronous"});
		alert(ret.messaggio);
	} else {
		jsShowLogin();
	}
}

function jsUpdateCart(form) { //josh
	id = form.elements["id"].value;
	quantita = form.elements["quantita"].value;
	ret = updateCart(id, quantita, {"content_type": "json", "type": "synchronous"});
	jsShowCart();
	alert(ret.messaggio);
}

function jsDeleteCart(id) { //josh
	ret = deleteCart(id, {"content_type": "json", "type": "synchronous"});
	jsShowCart();
	alert(ret.messaggio);
}

function jsShowCart() {
	showCart({"target": "carrello"});
}

function jsConfermaOrdine() {
	return confirm("Sei sicuro di voler trasformare il tuo carrello in un ordine a ASV Stubbe Italia?");
}

