/*
 * LF 20/07/2009 23.59
 * Script per la visualizzazione della gallery
 *
 */

/*
 * Basato su JQuery
 */
 $(document).ready( function(){ 
		$('#cImgFade').innerfade({ 
			speed: 1000, 
			timeout: 4000, 
			type: 'sequence', 
			containerheight: '490px' }); 
}); 


function FormValidator(theForm)
{
        <!-- Variables -->
        var i = 0;
        var emailats = 0;
        var emaildots = 0;
        
        
        <!-- Name -->
        if (theForm.nome.value == "")
        {
                alert("Inserisci il tuo nome");
                theForm.nome.focus();
                return (false);
        }
        
        
        <!-- Email -->
        if (theForm.email.value == "")
        {
                alert("Inserisci il tuo indirizzo email");
                theForm.email.focus();
                return (false);
        }
		
        <!-- Privacy -->
        if (!theForm.privacy.checked )
        {
                alert("Conferma di aver letto l'informativa sulla Privacy");
                theForm.privacy.focus();
                return (false);
        }
        
        for (i = 0; i < theForm.email.value.length; ++i)
        {
                if (theForm.email.value.charAt(i) == '@') ++emailats;
                else if (emailats==1) {
                        if (theForm.email.value.charAt(i) == '.') 
++emaildots;
                }
        }
        if ((emailats != 1) || (emaildots==0))
        {
                alert("L'indirizzo email inserito non e' valido: si prega di reinserirlo.");
                theForm.email.focus();
                return (false);
        }
        
        
        return (true);
}

