<!--
function rememberFnc(){
strMail = document.form1.txtEmail.value;
strUser = document.form1.txtIDutente.value;
if (strMail != ''){
if (checkMail('txtEmail') == true){
if (strUser != ''){
document.form1.BodyFnc.value = 1;
document.form1.submit();
}
else{
document.form1.txtIDutente.focus();
}
}
else{
document.form1.txtEmail.focus();
}
}
else{
document.form1.txtEmail.focus();
}
}
function checkMail(InputData){
Mail = document.form1[InputData].value;
var mailRet = false;
	Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
  	if (Filtro.test(Mail)){
	mailRet = true;}
return mailRet;}
function checkInputData(InputName){
strData = document.form1[InputName].value;
strData.test = /\w/;
if (strData != false || strData != ""){
bTrue = true;
}
else{
bTrue = false;
}
return bTrue;}

function sendFnc(){
strName = document.form1.txtName.value;
strLastName = document.form1.txtLastName.value;
strEmail = document.form1.txtEmail.value;
strText = document.form1.txMsg.value;
strPrivacy = document.form1.PRIVACY_FLAG_[0].checked;
if (strName != ""){
if (strLastName != ""){
if (strEmail != ""){
if (checkMail('txtEmail') == true){
if (strText != ""){
if (strPrivacy == true){
document.form1.HdnFnc.value = 4;
document.form1.submit();
}
}
else{
document.form1.txMsg.focus();
}
}
else{
document.form1.txtEmail.value="@";
document.form1.txtEmail.focus();
}
}
else{
document.form1.txtEmail.focus();
}
}
else{
document.form1.txtLastName.focus();
}
}
else{
document.form1.txtName.focus();
}
}
function keyControl(){
	if( (event.keyCode < 48) || (event.keyCode > 57 ) ){
		event.keyCode = "".charCodeAt(0);
	}
}
function newWindow(link){
var bookWindow,windowh,windoww;
windowh = 500;
windoww = 500;
width = (screen.width - 500)/2;
height = (screen.height - 500)/2;
bookWindow = window.open(link,'new1','width='+windoww+',height='+windowh+',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,screenX='+width+',screenY='+height+',top='+height+',left='+width+'');
	if (bookWindow.open){
	bookWindow.close
	}
bookWindow.focus();
}
function setPage(pagina){
document.form1.setpage.value = pagina;
document.form1.submit();
}

function SignNews(){
strLastName = document.form1.txt_lastname.value;
if (strLastName != ""){
if (checkMail('txt_email') == true){
document.form1.HdnFnc.value = 5;
document.form1.submit();
}
else{
document.form1.txt_email.value="@";
document.form1.txt_email.focus();
}
}
else{
document.form1.txt_lastname.focus();
}
}

function checkFormPartners(){
document.retVal = false;
one_check = 0;

if (document.form1.txtNome.value == "" && one_check == 0){
first_check = "txtNome";
one_check = 1;
}	

if (document.form1.txtCognome.value == "" && one_check == 0){
first_check = "txtCognome";
one_check = 1;
}	

if (document.form1.txtCf.value == "" && one_check == 0){
first_check = "txtCf";
one_check = 1;
}	

if (document.form1.txtTel_1.value == "" && one_check == 0){
first_check = "txtTel_1";
one_check = 1;
}

if (checkInputData('txtIndirizzo') == true && checkInputData('txtCitta') == false && one_check == 0){
first_check = "txtCitta";
one_check = 1;
}

if (checkInputData('txtIndirizzo') == true && checkInputData('txtCap') == false && one_check == 0){
first_check = "txtCap";
one_check = 1;
}

if (checkInputData('txtEmail') == false && one_check == 0){
first_check = "txtEmail";
one_check = 1;
}

if (document.form1.txtEmail.value != document.form1.txtREmail.value && one_check == 0){
first_check = "txtEmail";
one_check = 1;
}

if (checkUserID('txtIDuser') == false && one_check == 0){
alert("Attenzione.\nID Utente e Password devono essere composti da minimo 6 caratteri.\nGrazie.");
first_check = "txtIDuser";
one_check = 1;
}

if (checkPwd('txtPassword','txtRPassword') == false && one_check == 0){
first_check = "txtPassword";
one_check = 1;
}

if (one_check == 0){
document.form1.BodyFnc.value = 1;
document.retVal = true;
}
else{
	document.form1[first_check].focus();
}
}

function checkPwd(InputData,InputDataR){
var pwdRet = false;
password = document.form1[InputData].value;
passwordR = document.form1[InputDataR].value;
password.test=/\w/;
if (password == passwordR && password != false){
	if (password.length >= 6 && password.length <= 10 ){
	pwdRet = true;}
}
return pwdRet;}

function checkUserID(InputData){
user = document.form1[InputData].value;
var userRet = false;
user.test=/\w/;
if (user != false){
		if (user.length >= 6 && user.length <= 12 ){
		userRet = true;}
}
return userRet;}

function loginFnc(){
document.retVal = false;
strUser=document.form1.txtuserid.value;
strUser.test = /\w/;
strPassword=document.form1.txtpassword.value;
strPassword.test = /\w/;
if (strUser != false){
if (strPassword != false){
document.form1.HdnFnc.value = 2;
document.retVal = true;
}
else{
document.form1.txtpassword.focus();
}
}
else{
document.form1.txtuserid.focus();
}
}

function CheckQuiz(){
if (document.form1.dropCategoria.value != ""){
document.form1.BodyFnc.value = 1;
document.form1.submit();
}
else{
	alert('Selezionare categoria.\n Grazie.');
	}
}

function CheckQuizHaccp(){
document.form1.BodyFnc.value = 1;
document.form1.submit();
}

function sendtotutor(CID){
width = (screen.width - 550)/2;
height = (screen.height - 360)/2;
win = window.open('tutor.asp?CID=' + CID + '','popup','width=550,height=360,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,screenX='+width+',screenY='+height+',top='+height+',left='+width+'');
win.focus();
}

function checkForm(){
if (checkInputData('txtNome') == true){
if (checkInputData('txtCognome') == true){
if (checkInputData('txtCf') == true){
if (checkInputData('txtIDdoc') == true){
if (checkInputData('txtRagSoc') == true){
if (checkInputData('txtPIva') == true){
if (checkInputData('txtTel_1') == true){
if (checkInputData('txtTel_2') == true){
if (checkInputData('txtEmail') == true && checkMail('txtEmail') == true){
if (document.form1.txtEmail.value == document.form1.txtREmail.value){
if (checkInputData('txtIDUtente') == true){
if (checkPwd('txtPassword','txtRPassword') == true){
document.form1.BodyFnc.value = 1;
document.form1.submit();
}
else{
alert("Attenzione.\nPassword non valida. Controllare l'esattezza della Password.\nGrazie.");
document.form1.txtPassword.value = "";
document.form1.txtRPassword.value = "";
document.form1.txtPassword.focus();
}
}
else{
alert("Attenzione.\nE-Mail non valida. controllare l'esattezza dell'E-Mail inserita.\nGrazie.");
document.form1.txtREmail.value = "";
document.form1.txtREmail.focus();
}
}
else{
alert("Attenzione.\nDigitare l'ID Utente.\nGrazie.");
document.form1.txtIDUtente.value = "";
document.form1.txtIDUtente.focus();
}
}
else{
alert('Attenzione.\nInserire E-Mail nel campo richiesto o E-Mail non valida.\nGrazie.');
document.form1.txtEmail.value = "";
document.form1.txtEmail.focus();
}
}
else{
alert('Attenzione.\nInserire il Telefono Secondario nel campo richiesto.\nGrazie.');
document.form1.txtTel_2.focus();
}
}
else{
alert('Attenzione.\nInserire il Telefono Principale nel campo richiesto.\nGrazie.');
document.form1.txtTel_1.focus();
}
}
else{
alert("Attenzione.\nInserire la Partita Iva nel campo richiesto.\nGrazie.");
document.form1.txtPiva.focus();
}
}
else{
alert("Attenzione.\nInserire la Ragione Sociale nel campo richiesto.\nGrazie.");
document.form1.txtRagSoc.focus();
}
}
else{
alert("Attenzione.\nInserire N° documento di identità nel campo richiesto.\nGrazie.");
document.form1.txtIDdoc.focus();
}
}
else{
alert("Attenzione.\nInserire il Codice Fiscale nel campo richiesto.\nGrazie.");
document.form1.txtCf.focus();
}
}
else{
alert('Attenzione.\nInserire il Cognome nel campo richiesto.\nGrazie.');
document.form1.txtCognome.focus();
}
}
else{
alert("Attenzione.\nInserire il Nome nel campo richiesto.\nGrazie.");
document.form1.txtNome.focus();
}
}

function checkUpdatingForm(){
if (checkInputData('txtNome') == true){
if (checkInputData('txtCognome') == true){
if (checkInputData('txtCf') == true){
if (checkInputData('txtIDdoc') == true){
if (checkInputData('txtRagSoc') == true){
if (checkInputData('txtPIva') == true){
if (checkInputData('txtTel_1') == true){
if (checkInputData('txtTel_2') == true){
if (checkInputData('txtEmail') == true && checkMail('txtEmail') == true){
if (document.form1.txtEmail.value == document.form1.txtREmail.value){
if (checkPwd('txtPassword','txtRPassword') == true){
document.form1.BodyFnc.value = 1;
document.form1.submit();
}
else{
alert("Attenzione.\nPassword non valida. Controllare l'esattezza della Password.\nGrazie.");
document.form1.txtPassword.value = "";
document.form1.txtRPassword.value = "";
document.form1.txtPassword.focus();
}
}
else{
alert("Attenzione.\nE-Mail non valida. controllare l'esattezza dell'E-Mail inserita.\nGrazie.");
document.form1.txtREmail.value = "";
document.form1.txtREmail.focus();
}
}
else{
alert('Attenzione.\nInserire E-Mail nel campo richiesto o E-Mail non valida.\nGrazie.');
document.form1.txtEmail.value = "";
document.form1.txtEmail.focus();
}
}
else{
alert('Attenzione.\nInserire il Telefono Secondario nel campo richiesto.\nGrazie.');
document.form1.txtTel_2.focus();
}
}
else{
alert('Attenzione.\nInserire il Telefono Principale nel campo richiesto.\nGrazie.');
document.form1.txtTel_1.focus();
}
}
else{
alert("Attenzione.\nInserire la Partita Iva nel campo richiesto.\nGrazie.");
document.form1.txtPiva.focus();
}
}
else{
alert("Attenzione.\nInserire la Ragione Sociale nel campo richiesto.\nGrazie.");
document.form1.txtRagSoc.focus();
}
}
else{
alert("Attenzione.\nInserire N° documento di identità nel campo richiesto.\nGrazie.");
document.form1.txtIDdoc.focus();
}
}
else{
alert("Attenzione.\nInserire il Codice Fiscale nel campo richiesto.\nGrazie.");
document.form1.txtCf.focus();
}
}
else{
alert('Attenzione.\nInserire il Cognome nel campo richiesto.\nGrazie.');
document.form1.txtCognome.focus();
}
}
else{
alert("Attenzione.\nInserire il Nome nel campo richiesto.\nGrazie.");
document.form1.txtNome.focus();
}
}
