function emailIsValid(email) {
	var reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
	var element = $('input#'+email);
	if( element.val() == "" || !reg.test(element.val())) {
		alert("The e-mail address is incorrect");
		element.focus();
		return false;
	}
	
	return true;
}

function fieldIsNotEmpty(champ, nom){
	var element = $('input#'+champ);
	if(nom!="") tmpName = nom; else tmpName = element.attr("name");
	if(element.val()==""){
		alert("The '"+tmpName+"' field is required");
		return false;
	}	
	return true;
}

function textAreaIsNotEmpty(champ, nom){
	var element = $('textarea#'+champ);
	if(nom!="") tmpName = nom; else tmpName = element.attr("name");
	if(element.val()==""){
		alert("The '"+tmpName+"' field is required");
		return false;
	}	
	return true;
}


function isValid() {
	return emailIsValid('your_email') && emailIsValid('his_email');
}

function verifGameForm() {
	return emailIsValid('gameMail');
}

function commentValid(){
	if(!fieldIsNotEmpty('author','Name') || !emailIsValid('email') || !textAreaIsNotEmpty('comment','Comment')) return false;
	return true;
}