function modifica_dati_personali() {
	var f_nome = document.getElementById('f_nome');
	var f_cognome = document.getElementById('f_cognome');
	var f_indirizzo = document.getElementById('f_indirizzo');
	var f_codicepostale = document.getElementById('f_codicepostale');
	var f_citta = document.getElementById('f_citta');
	var f_stato = document.getElementById('f_stato');
	var f_provincia = document.getElementById('f_provincia');
	var f_piva = document.getElementById('f_piva');

	var s_nome = document.getElementById('s_nome');
	var s_cognome = document.getElementById('s_cognome');
	var s_indirizzo = document.getElementById('s_indirizzo');
	var s_codicepostale = document.getElementById('s_codicepostale');
	var s_citta = document.getElementById('s_citta');
	var s_stato = document.getElementById('s_stato');
	var s_provincia = document.getElementById('s_provincia');
	
	f_nome.disabled = false;
	f_cognome.disabled = false;
	f_indirizzo.disabled = false;
	f_codicepostale.disabled = false;
	f_citta.disabled = false;
	f_stato.disabled = false;
	f_provincia.disabled = false;
	f_piva.disabled = false;
	
	f_nome.className = 'fieldbianco2';
	f_cognome.className = 'fieldbianco2';
	f_indirizzo.className = 'fieldbianco2';
	f_codicepostale.className = 'fieldbianco2';
	f_citta.className = 'fieldbianco2';
	f_stato.className = 'fieldbianco2';
	f_provincia.className = 'fieldbianco2';
	f_piva.className = 'fieldbianco2';
	
	s_nome.disabled = false;
	s_cognome.disabled = false;
	s_indirizzo.disabled = false;
	s_codicepostale.disabled = false;
	s_citta.disabled = false;
	s_stato.disabled = false;
	s_provincia.disabled = false;
	
	s_nome.className = 'fieldbianco2';
	s_cognome.className = 'fieldbianco2';
	s_indirizzo.className = 'fieldbianco2';
	s_codicepostale.className = 'fieldbianco2';
	s_citta.className = 'fieldbianco2';
	s_stato.className = 'fieldbianco2';
	s_provincia.className = 'fieldbianco2';

}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function mostraDiv(id) {
	//var motivo = document.getElementById(id);
	//motivo.style.display = 'block';
	new Effect.Appear(id, { duration: 0.2 } );
}

function nascondiDiv(id) {
	//var motivo = document.getElementById(id);
	//motivo.style.display = 'none';
	new Effect.Fade(id, { duration: 0.2 } )
}

function categoria_hover(id) {
	if (document.getElementById('categoria_selezionata_'+id).className!='catsel') {
		document.getElementById('img_navbar_categoria_'+id).src = 'img/ico_navbar_roll.gif';
		document.getElementById('table_categoria_'+id).className = 'bgNAVBARsel';
		document.getElementById('pointer_categoria_'+id).className = 'pointerNAVBARsel';
	}
}

function categoria_out(id) {
	if (document.getElementById('categoria_selezionata_'+id).className!='catsel') {
		document.getElementById('img_navbar_categoria_'+id).src = 'img/ico_navbar.gif';
		document.getElementById('table_categoria_'+id).className = 'bgNAVBAR';
		document.getElementById('pointer_categoria_'+id).className = 'pointerNAVBAR';
	}
}

function ico_hover(id) {
	document.getElementById('ico'+id).src = 'img/ico_informativa_roll.gif';
}

function ico_out(id) {
	document.getElementById('ico'+id).src = 'img/ico_informativa.gif';
}

function check_limite_quantita(max) {
	if (max==undefined) max = 0;
	var inputs = document.getElementsByTagName('input');
	var numero_prodotti = 0;
	for (var i=0; i<inputs.length;i++) {
		if (inputs[i].type=='text' && inputs[i].id.substr(0,9)=='quantita_' && inputs[i].value!='') {
			numero_prodotti += parseInt(inputs[i].value);
		}
	}
	if (numero_prodotti>max && max>0) {
		document.getElementById('passa_ordine').disabled = true;
		document.getElementById('passa_ordine').style.display = 'none';
		document.getElementById('limite_superato').style.display = 'block';
	} else if (numero_prodotti==0) {
		document.getElementById('passa_ordine').disabled = true;
		document.getElementById('passa_ordine').style.display = 'none';
		document.getElementById('limite_superato').style.display = 'none';
	} else {
		document.getElementById('passa_ordine').disabled = false;
		document.getElementById('passa_ordine').style.display = 'block';
		document.getElementById('limite_superato').style.display = 'none';
	}
}
