// JavaScript Document
function openW(win,title,h,w,scroll) {
var x;
var y;
var param;
x = screen.width / 2 - w / 2;
y = screen.height / 2 - (h / 2+20);
param = "width="+w+",height="+h+",left="+x+",top="+y+",scrollbars="+scroll+",toolbar=0,location=0,directories=0,menuBar=0,resizable=0";
windowDoPop=window.open(win,title,param);
windowDoPop.focus();
}
function comingsoon() {
	alert("Questa parte del sito non e' ancora disponibile. Vi preghiamo di scusarci.")
}
function comingsoonuk() {
    alert("This part of the website is not yet available. Please excuse.")
}
function validate_riservata(theForm){
	if (theForm.user.value == "" || theForm.user.value.length < 2){
		alert("E' necessario inserire la User.");
		theForm.user.focus();
		return false;
	}
	if (theForm.password.value == "" || theForm.password.value.length < 2){
		alert("E' necessario inserire la Password.");
		theForm.password.focus();
		return false;
	}
return true;
}
function validatejob(theForm){
	if (theForm.ragione.value == "" || theForm.ragione.value.length < 2){
		alert("E' necessario inserire la ragione sociale.");
		theForm.ragione.focus();
		return false;
	}
	if (theForm.contatto.value == "" || theForm.contatto.value.length < 2){
		alert("E' necessario inserire il contatto.");
		theForm.contatto.focus();
		return false;
	}
	if (theForm.telefono.value == "" || theForm.telefono.value.length < 2){
		alert("E' necessario inserire il telefono.");
		theForm.telefono.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1)== -1 || theForm.email.value.indexOf('.',2)==-1){
		alert("E' necessario inserire un'indirizzo e-mail valida.");
		theForm.email.focus();
		return false;
	}
return true;
}
function validateordine(theForm){
	var n_pagamento=0;
	var cc_pagamento = theForm.elements['pagamento'];
	for(var i_pagamento=0; i_pagamento< cc_pagamento.length; i_pagamento++) {
		if(cc_pagamento[i_pagamento].checked) { n_pagamento++; break; }
		} if(n_pagamento==0) {
		alert("E' necessario selezionare un prodotto");
		return false;
	}
	if (theForm.cognome.value == "" || theForm.cognome.value.length < 2){
		alert("E' necessario inserire il cognome o denominazione.");
		theForm.cognome.focus();
		return false;
	}
	if (theForm.telefono.value == "" || theForm.telefono.value.length < 2){
		alert("E' necessario inserire il telefono.");
		theForm.telefono.focus();
		return false;
	}
	if (theForm.fax.value == "" || theForm.fax.value.length < 2){
		alert("E' necessario inserire il fax.");
		theForm.fax.focus();
		return false;
	}
	if (theForm.piva.value == "" || theForm.piva.value.length < 2){
		alert("E' necessario inserire la partita IVA.");
		theForm.piva.focus();
		return false;
	}
	if (theForm.contatto.value == "" || theForm.contatto.value.length < 2){
		alert("E' necessario inserire la persona da contattare.");
		theForm.contatto.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1)== -1 || theForm.email.value.indexOf('.',2)==-1){
			alert("E' necessario inserire un'indirizzo e-mail valida.");
			theForm.email.focus();
			return false;
	}
	if (theForm.via.value == "" || theForm.via.value.length < 2){
		alert("E' necessario inserire l'indirizzo.");
		theForm.via.focus();
		return false;
	}
	if (theForm.cap.value == "" || theForm.cap.value.length < 2){
		alert("E' necessario inserire il CAP.");
		theForm.cap.focus();
		return false;
	}
	if (theForm.localita.value == "" || theForm.localita.value.length < 2){
		alert("E' necessario inserire la localita'.");
		theForm.localita.focus();
		return false;
	}
	if (theForm.provincia.value == "" || theForm.provincia.value.length < 2){
		alert("E' necessario inserire la provincia.");
		theForm.provincia.focus();
		return false;
	}
	if (theForm.riservatezza.checked == false){
		alert("E\' necessario accettare le condizioni di riservtezza dei dati.");
		theForm.riservatezza.focus();
		return false;
	}
return true;
}
function validatelistino(theForm){
	var n_listino=0;
	var cc_listino = theForm.elements['prodottoscelto'];
	for(var i_listino=0; i_listino< cc_listino.length; i_listino++) {
		if(cc_listino[i_listino].checked) { n_listino++; break; }
		} if(n_listino==0) {
		alert("E' necessario selezionare un prodotto");
		TMP_Submit = document.getElementById("Submit");
		TMP_Submit.disabled = false;
		return false;
	}
return true;
}

