// JavaScript Document
function Left(str, n)
{
   if (n <= 0)
         return "";
   else if (n > String(str).length)
         return str;
   else
         return String(str).substring(0,n);
}


function FrontPage_Form1_Validator(theForm)
{

	var counter=0;
	var invalidChar = ":.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var invalidChar2 = "qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ:.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var badChar;
	var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
	



    if (theForm.codicecard.value == "")
		{
		alert("Codice Card obbligatorio!");
    theForm.codicecard.focus();
		return (false);
    }	
	
	if (theForm.codicecard.value.length < 13)
		{
		alert("Codice Card incompleto!");
    theForm.codicecard.focus();
		return (false);
    }
	

	
	if (Left(theForm.codicecard.value, 4) != '0448')
		{
		alert("Codice Card errato!");
    theForm.codicecard.focus();
	return (false);
    } 
	
	
	
	
    if(theForm.codicecard.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar2.length; i++) {
                        badChar = invalidChar2.charAt(i);
                        if(theForm.codicecard.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm.codicecard.focus();
         			return (false);
    }}}



	
	  if (theForm.prov.value == "")
		{
		alert("Campo obbligatorio!");
    theForm.prov.focus();
		return (false);
    }
	
		  if (!(theForm.volantino[0].checked || theForm.volantino[1].checked ))
		{
		alert("Campo obbligatorio!");
    theForm.volantino[0].focus();
		return (false);
    }
	

	
	if (theForm.emailn.value == "")
		{
			alert("E-mail obbligatorio!");
    theForm.emailn.focus();
		return (false);
    }
	

	

   EmailAddr = theForm.emailn.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (Filtro.test(EmailAddr))
      return (true);
   else
      {
      alert("Controlla l'indirizzo di e-mail inserito");
      theForm.emailn.focus();
      return (false);
      }


	

	}
	
	
	
	function FrontPage_Form2_Validator(theForm2)
{

	var counter=0;
	var invalidChar = ":.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var invalidChar2 = "qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ:.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var badChar;
	var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;



    if (theForm2.nome.value == "")
		{
		alert("Campo obbligatorio!");
    theForm2.nome.focus();
		return (false);
    }	
	

	if (theForm2.email.value == "")
		{
			alert("E-mail obbligatorio!");
    theForm2.email.focus();
		return (false);
    }
	



	

	
	
	
    if(theForm2.telefono.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar2.length; i++) {
                        badChar = invalidChar2.charAt(i);
                        if(theForm2.telefono.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm2.telefono.focus();
         			return (false);
    }}}


	if (theForm2.testo.value.length == "")
		{
			alert("Campo obbligatorio!");
    theForm2.testo.focus();
		return (false);
    }
	

	

	   EmailAddr = theForm2.email.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (Filtro.test(EmailAddr))
      return true;
   else
      {
      alert("Controlla l'indirizzo di e-mail inserito");
      theForm2.email.focus();
      return false;
      }

	
	

	

	}
	
	
	
	
	function FrontPage_Form3_Validator(theForm3)
{
	
if (theForm3.emailn.value == "")
		{
			alert("E-mail obbligatorio!");
    theForm3.emailn.focus();
		return (false);
    }
	

	

   EmailAddr = theForm3.emailn.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (Filtro.test(EmailAddr))
      return (true);
   else
      {
      alert("Controlla l'indirizzo di e-mail inserito");
      theForm3.emailn.focus();
      return (false);
      }
	}
	
	
	function FrontPage_Form5_Validator(theForm5)
{
	
	
		var counter=0;
	var invalidChar = ":.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var invalidChar2 = "qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ:.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var badChar;
	var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
	



    if (theForm5.codicecard.value == "")
		{
		alert("Codice Card obbligatorio!");
    theForm5.codicecard.focus();
		return (false);
    }	
	
	if (theForm5.codicecard.value.length < 13)
		{
		alert("Codice Card incompleto!");
    theForm5.codicecard.focus();
		return (false);
    }
	

	
	if (Left(theForm5.codicecard.value, 4) != '0448')
		{
		alert("Codice Card errato!");
    theForm5.codicecard.focus();
	return (false);
    } 
	
	
	
	
    if(theForm5.codicecard.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar2.length; i++) {
                        badChar = invalidChar2.charAt(i);
                        if(theForm5.codicecard.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm5.codicecard.focus();
         			return (false);
    }}}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
if (theForm5.emailn.value == "")
		{
			alert("E-mail obbligatorio!");
    theForm5.emailn.focus();
		return (false);
    }
	

	

   EmailAddr = theForm5.emailn.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (Filtro.test(EmailAddr))
      return (true);
   else
      {
      alert("Controlla l'indirizzo di e-mail inserito");
      theForm5.emailn.focus();
      return (false);
      }
	}
	
		function FrontPage_Form6_Validator(theForm6)
{
	
	var counter=0;
	var invalidChar = ":.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var invalidChar2 = "qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ:.;<>\"'|-_òàù+èé*§°ç@#[]!£$%&/()=?^ì";
	var invalidChar3 = "1234567890";
	var badChar;
	var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
	
	
	
	if (theForm6.s01.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s01.focus();
		return (false);
    }
	
	    if(theForm6.s01.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar3.length; i++) {
                        badChar = invalidChar3.charAt(i);
                        if(theForm6.s01.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm6.s01.focus();
         			return (false);
    }}}
	
	
	
	
		if (theForm6.s02.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s02.focus();
		return (false);
    }
	
	
	
		    if(theForm6.s02.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar2.length; i++) {
                        badChar = invalidChar2.charAt(i);
                        if(theForm6.s02.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm6.s02.focus();
         			return (false);
    }}}
	
	
	
		if (theForm6.s03.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s03.focus();
		return (false);
    }
	
		if (theForm6.s04.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s04.focus();
		return (false);
    }
	
		if (theForm6.s05.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s05.focus();
		return (false);
    }
	
		    if(theForm6.s05.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar3.length; i++) {
                        badChar = invalidChar3.charAt(i);
                        if(theForm6.s05.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm6.s05.focus();
         			return (false);
    }}}
	
	
	
		if (theForm6.s06.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s06.focus();
		return (false);
    }
	
		if (theForm6.s07.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s07.focus();
		return (false);
    }
	
		    if(theForm6.s07.value.length > 0) {
                //Controlla caratteri non ammessi
 		for (var i=0; i < invalidChar3.length; i++) {
                        badChar = invalidChar3.charAt(i);
                        if(theForm6.s07.value.indexOf(badChar,0) != -1) {
         			alert ("Mai inserito caratteri non validi !!");
         			theForm6.s07.focus();
         			return (false);
    }}}
	
	
	
	if (!(theForm6.s08[0].checked || theForm6.s08[1].checked || theForm6.s08[2].checked || theForm6.s08[3].checked || theForm6.s08[4].checked 																																   || theForm6.s08[5].checked	))
		{
		alert("Campo obbligatorio!");
    theForm6.s08[0].focus();
		return (false);
    }
	
		if (!(theForm6.s09[0].checked || theForm6.s09[1].checked || theForm6.s09[2].checked))
		{
		alert("Campo obbligatorio!");
    theForm6.s09[0].focus();
		return (false);
    }
	
			if (!(theForm6.s10a.checked || theForm6.s10b.checked || theForm6.s10c.checked
 || theForm6.s10d.checked || theForm6.s10e.checked || theForm6.s10f.checked || theForm6.s10g.checked))
		{
		alert("Campo obbligatorio!");
    theForm6.s10a.focus();
		return (false);
    }
	
	
	
	
	
		if (theForm6.s11.value == "")
		{
			alert("campo obbligatorio!");
    theForm6.s11.focus();
		return (false);
    }
	
}	
	
	