function validateCerca(theForm)
{
if (theForm.Testo.value == "") 
	{
	alert("Scrivi la parola da cercare.");
	theForm.Testo.focus();
	return(false)
	}

return (true)
}
function validateCercaEng(theForm)
{
if (theForm.Testo.value == "") 
	{
	alert("Insert a word to search.");
	theForm.Testo.focus();
	return(false)
	}

return (true)
}



function validateFormContatti(theForm)
{
// Controlla che il codice di sicurezza sia presente
/*
  if (theForm.CMImgCheckerText.value == "") {
	alert("Inserisci le lettere che vedi qui sotto.");
	theForm.CMImgCheckerText.focus();
	return(false)
  }
*/
// Controlla che il messaggio non sia vuoto
if (theForm.Messaggio.value == "") 
	{
	alert("Scrivi il messaggio.");
	theForm.Messaggio.focus();
	return(false)
	}
// Controlla che il nome non sia vuoto
/*
if (theForm.Nome.value == "") 
	{
	alert("Inserisci il Nome.");
	theForm.Nome.focus();
	return(false)
	}
*/
// Controlla che il cognome non sia vuoto
/*
if (theForm.Cognome.value == "") 
	{
	alert("Inserisci il Cognome.");
	theForm.Cognome.focus();
	return(false)
	}
*/
// Controlla se email non sia vuota
if (theForm.EMail.value == "") 
	{
	alert("Inserisci il tuo indirizzo Email.");
	theForm.EMail.focus();
	return(false)
	}

// Controlla che email sia valida: caratteri consentiti
var checkOK = "1234567890qwertyuiopsdfghjklafghjklzxcvbnm@_-.QERTYUIOPASDFGHJLZXCVBNM";
var checkStr = theForm.EMail.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	  if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}

	}

// Controlla che email sia valida: presenza della @
if (checkStr.indexOf('@') == -1)
	allValid = false;

// Controlla che email sia valida: presenza di 1 punto
if (checkStr.indexOf('.') == -1)
	allValid = false;

if (!allValid)
	{
	alert("Inserisci un indirizzo email valido");
	theForm.EMail.focus();
	return (false);
	}

	
// Controlla che il telefono sia in cifre
/*
var checkOK = "0123456789/-\+ ";
var checkStr = theForm.Telefono.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	  if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	}
	
if (!allValid)
	{
	alert("Inserisci un numero di telefono valido, solo cifre.");
	theForm.Telefono.focus();
	return (false);
	}
*/	

// Controlla che il telefono sia in cifre
/*
var checkOK = "0123456789/-\+ ";
var checkStr = theForm.Cellulare.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	  if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	}
	
if (!allValid)
	{
	alert("Inserisci un numero di Cellulare valido, solo cifre.");
	theForm.Cellulare.focus();
	return (false);
	}
*/
// Controlla che la provincia non sia vuoto
/*
if (theForm.Provincia.value == "") 
	{
	alert("Scrivi la Provincia.");
	theForm.Provincia.focus();
	return(false)
	}
*/
if (theForm.Privacy.checked == false )
	{
	alert('Per inviare un messaggio devi autorizzarci al trattamento dei tuoi dati personali.');
	theForm.Privacy.focus();
	return (false);
	}

return (true)
}

function ValidateNewsletter(theForm)
{

  // Controlla che email non sia vuoto
  if (theForm.EMail.value == "") {
	alert("Inserire l\'indirizzo Email.");
	theForm.EMail.focus();
	return(false)
  }

  // Controlla che email sia valida: caratteri consentiti
  var checkOK = "1234567890qwertyuiopsdfghjklafghjklzxcvbnm@_-.QERTYUIOPASDFGHJLZXCVBNM";
  var checkStr = theForm.EMail.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	  if (ch == checkOK.charAt(j))
		break;
	if (j == checkOK.length)
	{
	  allValid = false;
	  break;
	}

  }

  // Controlla che email sia valida: presenza della @
  if (checkStr.indexOf('@') == -1)
    allValid = false;

  // Controlla che email sia valida: presenza di 1 punto
  if (checkStr.indexOf('.') == -1)
    allValid = false;

  if (!allValid)
	{
	alert("Inserire un indirizzo email valido");
	theForm.EMail.focus();
	return (false);
	}

  // Controlla che nomeCognome non sia vuoto
	/*
	if (theForm.NomeCognome.value == "") {
  			alert("Inserire il Nome e Cognome.");
  			theForm.NomeCognome.focus();
  			return(false)
  	}

	*/


  if (theForm.Privacy.checked == false )
  {
	alert('Per inviare iscriverti alal newsletter devi autorizzare il trattamento dei dati personali.');
	theForm.Privacy.focus();
	return (false);
  }

  return (true);
}
function mostraDivScheda1()
{
   	if(document.getElementById("BoxScheda1")){
		document.getElementById("BoxScheda1").style.display = 'block';
	}
}
function nascondiDivScheda1()
{
   	if(document.getElementById("BoxScheda1")){
		document.getElementById("BoxScheda1").style.display = 'none';
	}
}

function MouseOverMenu(idVoceMenu){
	//nulla
}
function MouseClickMenu(idVoceMenu){
   	if(idVoceMenu=='CEMenu5Voce25'){
		if(document.getElementById('boxIscrSMS')) $("#boxIscrSMS").show("fast");
		if(document.getElementById('boxIscrNewsletter')) $("#boxIscrNewsletter").show("fast");
		if(document.getElementById('boxIscrSMS')) {
			//if(idVoceMenu=='CEMenu5Voce25') document.getElementById('boxIscrSMS').style.display = 'block';
			//if(idVoceMenu=='CEMenu5Voce25') document.getElementById('boxIscrNewsletter').style.display = 'block';
		}
	}
}
function MouseOutMenu(idVoceMenu){
	//nulla
}
function nascondiDivSms(){
   	if(document.getElementById('boxIscrSMS')){
		$("#boxIscrSMS").hide("fast");
		//document.getElementById('boxIscrSMS').style.display = 'none';
	}
}
function nascondiDivNewsletter(){
   	if(document.getElementById('boxIscrNewsletter')){
		$("#boxIscrNewsletter").hide("fast");
		//document.getElementById('boxIscrNewsletter').style.display = 'none';
	}
}
