function alternate(){
	var elements = document.getElementsByTagName('*');
	for (var j=0; j<elements.length; j++) {
		if(elements[j].className == "alternatingtables"){
   			var table = elements[j];
   			var rows = table.getElementsByTagName("tr");
   			for(i = 0; i < rows.length; i++){
     			if(i % 2 == 0){
       			rows[i].className = "even";
     			}else{
       			rows[i].className = "odd";
     			}
   			}
 		}
	}
}
function switchvisibility(elem){
	el = document.getElementById(elem);
	if (el.style.display == "none"){
		el.style.display = "inline";
	} else {
		el.style.display = "none";
	}
}

function VerificaMailForm(){
	email_Email           = 'Please tell us your e-mail';
	email_Subject         = 'Please name the message';
	email_Comments        = 'Please input some comments';
	captcha_input	      = "To verify you are person and not a software, please write the text from the image in the next field...";
	
	if(document.mailform.email.value==""){
		alert(email_Email);
		document.mailform.email.focus();
		return false;
	}
	if(document.mailform.subject.value==""){
		alert(email_Subject);
		document.mailform.subject.focus();
		return false;
	}
	if(document.mailform.comments.value==""){
		alert(email_Comments);
		document.mailform.comments.focus();
		return false;
	}
	
	if(document.mailform.captcha_input.value==""){
		alert(captcha_input);
		document.mailform.captcha_input.focus();
		return false;
	}
}

function Verificadate(lingua){
	var error = '';
		city  = 'Please fill the city';
		phone = 'Please fill the phone';
		email = 'Please fill the email';
		details = 'Please input your request';

	if(document.solicita_info.city.value==""){
		error += city + "\n";
		document.solicita_info.city.focus();
	}
	if(document.solicita_info.phone.value==""){
		error += phone + "\n";
		document.solicita_info.phone.focus();
	}
	if(document.solicita_info.email.value==""){
		error += email + "\n";
		document.solicita_info.email.focus();
	}
	if(document.solicita_info.details.value==""){
		error += details + "\n";
		document.solicita_info.details.focus();
	}

	if (error == ''){
		document.solicita_info.submit();
		return true;
	} else {
		alert(error);
		return false;
	}
	
}

/** Controlla la correttezza dell'indirizzo email.
	Forse si può sostituire con una funzione PHP per il controllo delle expr regolari, tipo eregi(). */
function checkMail(mail){
	var iAtPosition;
	var iDotPosition;

	iAtPosition = mail.indexOf("@");
	if (iAtPosition < 1 || iAtPosition == mail.length)
		return false;
	iDotPosition = mail.indexOf('.', iAtPosition);
	if (iDotPosition < 0)
		return false;
	return true;
}	// checkMail()
//-->
