// JavaScript Document
function commentEmail(str) {
	parob = str.indexOf('@');
	if (parob!=-1) {
		if (str.lastIndexOf('.') < parob) {
			return false;
		}
	} else {
		return false;
	}
	return true;
}

function controlecomment() {
	if (document.forms["form-comment"].nom.value.length == 0) 	{
		alert('Veuillez saisir votre nom svp.');
		document.forms["form-comment"].nom.focus();
		return false;
	}
	if (document.forms["form-comment"].email.value.length == 0 || !commentEmail(document.forms["form-comment"].email.value)) 	{
		alert('Veuillez saisir une adresse mail valide svp.');
		document.forms["form-comment"].email.focus();
		return false;
	}
	if (document.forms["form-comment"].comment.value.length == 0) 	{
		alert('Veuillez saisir votre commentaire svp.');
		document.forms["form-comment"].comment.focus();
		return false;
	}
	return true;
}
