function checkForm(myForm) 
{
	error_msg="Veuillez compléter tous les champs !";
	if (!checkemail(myForm.f10.value)) {
		alert(error_msg);
		return false;
	} 
	if(!check_field(myForm.f2.value))		{	alert(error_msg); 	return false;	}
	if(!check_field(myForm.f3.value))		{	alert(error_msg); 	return false;	}
	if(!check_field(myForm.f4.value))		{	alert(error_msg);	return false;	}												  		    
	if(!check_field(myForm.f5.value))		{	alert(error_msg); 	return false;	}
	if(!check_field(myForm.f6.value))		{	alert(error_msg); 	return false;	}												  					    
	if(!check_field(myForm.f7.value))		{	alert(error_msg); 	return false;	}
	if(!check_field(myForm.f10.value))		{	alert(error_msg); 	return false;	}
	if(!check_field(myForm.f11.value))		{	alert(error_msg); 	return false;	}	
	if(!check_object(myForm.f1.value))		{	alert(error_msg); 	return false;	}	
	return true;
}

function check_field(s)
{
	if(s == "")
	{
		return false;
	}
	return true;
}	

function check_object(s)
{
	if(s == "1") return false;
	if(s == "2" || s == "3" ||s == "4") return true;
	return false;
}

function checkemail(s) 
{

 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }

 if(a == true)
 {
  reg = new RegExp('^([a-zA-Z0-9\-\.\_]+)'+
                   '(\@)([a-zA-Z0-9\-\.]+)'+
                   '(\.)([a-zA-Z]{2,4})$');
  res = (reg.test(s));
 }
 else
 {
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
 }
 return(res);
}
