// JavaScript Document

function salvaModificheUtente(){

		var re = /^[A-Za-z0-9]{6,10}/
		var str = document.modificaUtente.username.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome Utente. Deve contenere almeno di 6 caratteri alfanumerici.");
		return;
		
		}

		var re = /^[A-Za-z0-9]{6,10}/
		var str = document.modificaUtente.pwd.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Password. Deve contenere almeno di 6 caratteri alfanumerici.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.pwd.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo E-mail.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.piva_codicefiscale.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo P.Iva in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.nome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.cognome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cognome in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.azienda.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Azienda in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.via.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Via in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.civico.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Civico in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.cap.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cap in Dati Fatturazione.");
		return;
		
		}


		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.provincia.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Provincia in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.nazione.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nazione in Dati Fatturazione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.modificaUtente.tel.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Telefono in Dati Fatturazione.");
		return;
		
		}

document.modificaUtente.submit();
}





function paginaSucc(pagina, cat, lingua){
document.location.href = "cat.asp"+"?page="+pagina+"&idC="+cat+"&l="+lingua
}

function paginaSucc_paginazione_articoli(pagina, nomeCat, lingua){
document.location.href = "/"+lingua+"/cat/"+nomeCat+"/index_"+pagina+".htm"
}


//aggiumgi ai preferiti
function addbookmark(url, title){
	var bookmarkurl = url
	var bookmarktitle = title
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

//per img gallery
function popUp(url,name,features){
html = '<HTML>\n<HEAD>\n<TITLE> GALLERIA </TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=20>\n<CENTER><IMG SRC="'+url+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width,document.imageTest.height + 100)"></CENTER>\n</BODY>\n</HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,statusbar=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}


//per carrello

function addQty(fObj){
 var re = /^[1-9]/
 var str = fObj.qty.value
 var strDispo = fObj.magazzino.value
 if(!re.test(str)){
  alert("Inserire quantità");
  return false;
 }
 if(parseInt(str) > parseInt(strDispo)){
  alert("La quantità indicata non è disponibile. Disponibilità massima di "+strDispo+" articoli.");
  return false;
 }

 return true;
}



function popUpStampaScheda(theURL,winName,features) { 
window.open(theURL,winName,features);
}


	function conferma_ordive_step1(){
	
		var re = /^[A-Za-z0-9]/
		var str = document.inviaOrdine.combo_nazioni.value
		if(!re.test(str)){
		alert("Compilare il campo Nazione nei dati di spedizione.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.inviaOrdine.pagamento_con.value
		if(!re.test(str)){
		alert("Scegliere una modalità di pagamento.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.inviaOrdine.metodo_spedizione.value
		if(!re.test(str)){
		alert("Scegliere metodo di spedizione.");
		return;
		
		}
	
	document.inviaOrdine.submit();
	}
	
	///per registrazione utenti
	
	function inviaFormRegistrazione(){
	
		var re = /^[A-Za-z0-9]{6,10}/
		var str = document.nuoviUtenti.pwd.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Password. Deve contenere almeno di 6 caratteri alfanumerici.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.username.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Login.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.mail.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo E-mail.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.nome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Nome.");
		return;
		
		}
		
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.cognome.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cognome.");
		return;
		
		}
		
		//var re = /^[A-Za-z0-9]/
		//var str = document.nuoviUtenti.ditta.value
		//if(!re.test(str)){
		//alert("Compilare correttamente il campo Ditta.");
		//return;
		
		//}
		var re = /^[0-9]/
		var str = document.nuoviUtenti.tel.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Telefono.");
		return;
		
		}

		var re =/^[A-Za-z0-9]/
		var str = document.nuoviUtenti.indirizzo.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Via.");
		return;
		
		}

		var re =/^[A-Za-z0-9]/
		var str = document.nuoviUtenti.civico.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Civico.");
		return;
		
		}

		var re =/^[A-Za-z0-9]/
		var str = document.nuoviUtenti.cap.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Cap.");
		return;
		
		}

		
		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.city.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Città.");
		return;
		
		}

		var re = /^[A-Za-z0-9]/
		var str = document.nuoviUtenti.provincia.value
		if(!re.test(str)){
		alert("Compilare correttamente il campo Provincia.");
		return;
		
		}
				
		//var re = /^[0-9]/
		//var str = document.nuoviUtenti.fax.value
		//if(!re.test(str)){
		//alert("Compilare correttamente il campo Fax.");
		//return;
		
		//}



		//var re =/^[A-Za-z0-9]/
		//var str = document.nuoviUtenti.indirizzo.value
		//if(!re.test(str)){
		//alert("Compilare correttamente il campo Indirizzo.");
		//return;
		
		//}
	
		
	if(document.nuoviUtenti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
	
	document.nuoviUtenti.submit();
	}

function inviaFormContatti() {
	
	var str = document.FormContatti.nome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Nome");
		return;}
	
	var str = document.FormContatti.cog.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Cognome");
		return;}
		
	var str = document.FormContatti.tel.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Telefono");
		return;}

	var str = document.FormContatti.valmail.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail");
		return;}
		
	var str = document.FormContatti.mess.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Messaggio");
		return;}
		
	if(document.FormContatti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
document.FormContatti.submit();
	}
	


function inviaFormPreventivi() {
	
	var str = document.FormPreventivi.nome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Nome");
		return;}
	
	var str = document.FormPreventivi.cog.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Cognome");
		return;}
		
	var str = document.FormPreventivi.tel.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Telefono");
		return;}

	var str = document.FormPreventivi.valmail.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail");
		return;}
		
	var str = document.FormPreventivi.servizio.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Tipo di Servizio");
		return;}
		
	if(document.FormPreventivi.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
document.FormPreventivi.submit();
	}
	


function inviaFormProponiti() {
	
	var str = document.FormProponiti.nome.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Nome");
		return;}
	
	var str = document.FormProponiti.cog.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Cognome");
		return;}
		
	var str = document.FormProponiti.tel.value;
	var re = /^[0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo Telefono");
		return;}

	var str = document.FormProponiti.valmail.value;
	var re = /^[A-Za-z0-9]/;
	
		if (!re.test(str)) {
		alert("Compilare correttamente il campo E-mail");
		return;}
		
		
	if(document.FormProponiti.RadioGroup1[1].checked){
	alert("Per inviare il messaggio accettare il trattamento dei dati personali selezionando la voce Accetta.")
	return;
	}
document.FormProponiti.submit();
	}

//Google map----------------------------------------------------------
   


	

//-------------------FINR GOOGLE MAP--------------------------------------------------------
function paginaSucc_paginazione_ricerca(pagina){
document.formRicerca.pagina.value = pagina
document.formRicerca.submit()
}

function paginaSucc_paginazione_Thumbs(pagina, lingua){
document.pagThums.pagina.value = pagina
document.pagThums.submit();
}

//--------------------------------------------------------
