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 validate_login(theForm){
	if (theForm.nominativo.value == "" || theForm.nominativo.value.length < 2){
		alert("Il campo Nominativo e' vuoto.");
		theForm.nominativo.focus();
		return false;
	}
	if (theForm.user.value == "" || theForm.user.value.length < 5){
		alert("Il campo User e' vuoto o ha meno di 5 caratteri.");
		theForm.user.focus();
		return false;
	}
	if (theForm.password.value == "" || theForm.password.value.length < 5){
		alert("Il campo Password e' vuoto o ha meno di 5 caratteri.");
		theForm.password.focus();
		return false;
	}
return true;
}
function validate_avvisi(theForm){
	valore = theForm.date3.value
	primacoppia = valore.substr(0,2)
	secondacoppia = valore.substr(3,2)
	quadrupla = valore.substr(6,4)
	numero = parseInt('1' + primacoppia)-100
	numero1 = parseInt('1' + secondacoppia)-100
	numero2 = parseInt(quadrupla)
	primoslash = valore.substr(2,1)
	secondoslash = valore.substr(5,1)
	//alert(valore + ' - ' + primacoppia + ' ' + secondacoppia + ' ' + quadrupla)
	//alert(valore + ' - ' + numero + ' ' + numero1 + ' ' + numero2)
	primalunghezza = primacoppia.length
	secondalunghezza = secondacoppia.length
	terzalunghezza = quadrupla.length
		if ((primalunghezza=2)&&(primoslash=="/")&&(numero>=1)&&(numero<=31)&&(secondalunghezza=2)&&(secondoslash=="/")&&(numero1>=1)&&(numero1<=12)&&(quadrupla=4)&&(numero2>=1700)&&(numero2<=2200))
		{
		}
		else
		{
			alert("Il campo data non segue il formato indicato.");
			theForm.date3.focus();
			return false;
		}
	if (theForm.titolo_avvisi.value == "" || theForm.titolo_avvisi.value.length < 2){
		alert("Il campo titolo e' vuoto o ha meno di 2 caratteri.");
		theForm.titolo_avvisi.focus();
		return false;
	}
	if (theForm.testo_avvisi.value == ""){
		alert("Il campo testo e' vuoto.");
		theForm.testo_avvisi.focus();
		return false;
	}
return true;
}
function validate_circolari(theForm){
	valore = theForm.date3.value
	primacoppia = valore.substr(0,2)
	secondacoppia = valore.substr(3,2)
	quadrupla = valore.substr(6,4)
	numero = parseInt('1' + primacoppia)-100
	numero1 = parseInt('1' + secondacoppia)-100
	numero2 = parseInt(quadrupla)
	primoslash = valore.substr(2,1)
	secondoslash = valore.substr(5,1)
	//alert(valore + ' - ' + primacoppia + ' ' + secondacoppia + ' ' + quadrupla)
	//alert(valore + ' - ' + numero + ' ' + numero1 + ' ' + numero2)
	primalunghezza = primacoppia.length
	secondalunghezza = secondacoppia.length
	terzalunghezza = quadrupla.length
		if ((primalunghezza=2)&&(primoslash=="/")&&(numero>=1)&&(numero<=31)&&(secondalunghezza=2)&&(secondoslash=="/")&&(numero1>=1)&&(numero1<=12)&&(quadrupla=4)&&(numero2>=1700)&&(numero2<=2200))
		{
		}
		else
		{
			alert("Il campo data non segue il formato indicato.");
			theForm.date3.focus();
			return false;
		}
	if (theForm.titolo_circolari.value == "" || theForm.titolo_circolari.value.length < 2){
		alert("Il campo titolo e' vuoto o ha meno di 2 caratteri.");
		theForm.titolo_circolari.focus();
		return false;
	}
	if (theForm.testo_circolari.value == ""){
		alert("Il campo testo e' vuoto.");
		theForm.testo_circolari.focus();
		return false;
	}
return true;
}
function validate_documenti(theForm){
	valore = theForm.date3.value
	primacoppia = valore.substr(0,2)
	secondacoppia = valore.substr(3,2)
	quadrupla = valore.substr(6,4)
	numero = parseInt('1' + primacoppia)-100
	numero1 = parseInt('1' + secondacoppia)-100
	numero2 = parseInt(quadrupla)
	primoslash = valore.substr(2,1)
	secondoslash = valore.substr(5,1)
	//alert(valore + ' - ' + primacoppia + ' ' + secondacoppia + ' ' + quadrupla)
	//alert(valore + ' - ' + numero + ' ' + numero1 + ' ' + numero2)
	primalunghezza = primacoppia.length
	secondalunghezza = secondacoppia.length
	terzalunghezza = quadrupla.length
		if ((primalunghezza=2)&&(primoslash=="/")&&(numero>=1)&&(numero<=31)&&(secondalunghezza=2)&&(secondoslash=="/")&&(numero1>=1)&&(numero1<=12)&&(quadrupla=4)&&(numero2>=1700)&&(numero2<=2200))
		{
		}
		else
		{
			alert("Il campo data non segue il formato indicato.");
			theForm.date3.focus();
			return false;
		}
	if (theForm.titolo_documenti.value == "" || theForm.titolo_documenti.value.length < 2){
		alert("Il campo titolo e' vuoto o ha meno di 2 caratteri.");
		theForm.titolo_documenti.focus();
		return false;
	}
	if (theForm.testo_documenti.value == ""){
		alert("Il campo testo e' vuoto.");
		theForm.testo_documenti.focus();
		return false;
	}
return true;
}
function validate_categorie(theForm){
	if (theForm.catnome.value == ""){
		alert("Il campo categoria e' vuoto.");
		theForm.catnome.focus();
		return false;
	}
	if (theForm.color.value == ""){
		alert("Il campo colore e' vuoto.");
		theForm.color.focus();
		return false;
	}
return true;
}
function validate_faq_cat(theForm){
	if (theForm.catnome.value == ""){
		alert("Il campo categoria e' vuoto.");
		theForm.catnome.focus();
		return false;
	}
return true;
}
function validate_faq_subcat(theForm){
	if (theForm.subcatnome.value == ""){
		alert("Il campo subcategoria e' vuoto.");
		theForm.subcatnome.focus();
		return false;
	}
return true;
}

function validate_faq_risposte(theForm){
	if (theForm.oggetto.value == ""){
		alert("Il campo oggetto e' vuoto.");
		theForm.oggetto.focus();
		return false;
	}
	if (theForm.domanda.value == ""){
		alert("Il campo domanda e' vuoto.");
		theForm.domanda.focus();
		return false;
	}
	if (theForm.risposta.value == ""){
		alert("Il campo risposta e' vuoto.");
		theForm.risposta.focus();
		return false;
	}
return true;
}
function validate_link(theForm){
	if (theForm.descr_link.value == ""){
		alert("Il campo descrizione e' vuoto.");
		theForm.descr_link.focus();
		return false;
	}
	if (theForm.link_link.value == ""){
		alert("Il campo link e' vuoto.");
		theForm.link_link.focus();
		return false;
	}
return true;
}
function validate_linkcat(theForm){
	if (theForm.catnome.value == ""){
		alert("Il campo categoria e' vuoto.");
		theForm.catnome.focus();
		return false;
	}
return true;
}
function validate_linkrank(theForm){
	if (theForm.descr_link.value == ""){
		alert("Il campo descrizione e' vuoto.");
		theForm.descr_link.focus();
		return false;
	}
	if (theForm.href_link.value == ""){
		alert("Il campo link e' vuoto.");
		theForm.href_link.focus();
		return false;
	}
return true;
}

