function addToKart(codice) {
	window.open('_kart.asp?op=add&codice=' + codice,'_self')
}

function delFromKart(items) {
	if (confirm('Sicuro di voler eliminare il prodotto dal carrello?')){
  		window.open('_kart.asp?op=del&item=' + items,'_self')
	}
}

function qta(items,versus) {
	window.open('_kart.asp?op=qta&item=' + items + '&versus=' + versus,'_self')
}

function delOrder() {
	if (confirm('Sicuro di voler svuotare il carrello?')){
	window.open('_kart.asp?op=dek','_self')
	}
}

function speseSped(tipo) {
	document.getElementById('sped0').style.display = 'none'
	document.getElementById('sped1').style.display = 'none'
	document.getElementById('sped2').style.display = 'none'
	document.getElementById('sped3').style.display = 'none'
	document.getElementById('sped4').style.display = 'none'
	document.getElementById('sped' + tipo).style.display = 'block'
}

function modRegType(tipo) {
	document.getElementById('reg_type1').style.display = 'none'
	document.getElementById('reg_type2').style.display = 'none'
	document.getElementById('reg_type' + tipo).style.display = 'block'
}

function modRagSociale(tipo) {
	if (tipo == 1){
		document.order.cli_ragione_sociale.disabled = true
		document.order.cli_partita_iva.disabled = true
		document.getElementById('rag_sociale').style.textDecoration = "line-through"
		document.getElementById('partita_iva').style.textDecoration = "line-through"
		document.order.cli_ragione_sociale.style.visibility = "hidden"
		document.order.cli_partita_iva.style.visibility = "hidden"
		}
	else {
		document.order.cli_ragione_sociale.disabled = false
		document.order.cli_partita_iva.disabled = false
		document.getElementById('rag_sociale').style.textDecoration = "none"
		document.getElementById('partita_iva').style.textDecoration = "none"
		document.order.cli_ragione_sociale.style.visibility = "visible"
		document.order.cli_partita_iva.style.visibility = "visible" }
}

	
function sessionRestore(){
	if (document.order.order_reg_type[0].checked == true) {
		setTimeout('modRegType(1)',0)
	}
	if (document.order.order_reg_type[1].checked == true) {
		setTimeout('modRegType(2)',0)
	}
	if (document.order.cli_persona_fisica[0].checked == true) {
		setTimeout('modRagSociale(1)',0)
	}
	if (document.order.cli_persona_fisica[1].checked == true) {
		setTimeout('modRagSociale(2)',0)
	}
	if (document.order.order_spedizione[0].checked == true) {
		setTimeout('speseSped(2)',0)
	}
	if (document.order.order_spedizione[1].checked == true) {
		setTimeout('speseSped(2)',0)
	}
	if (document.order.order_spedizione[2].checked == true) {
		setTimeout('speseSped(2)',0)
	}
	if (document.order.order_spedizione[3].checked == true) {
		setTimeout('speseSped(2)',0)
	}
}