/***** Fonctions de controle des emails pour la recommandation du site *****/

function envoyer_email(formulaire)
{
   	var message = "";
	var ok = true;
	
	if ( formulaire._ami_1_courriel.value == "" &&
		 formulaire._ami_2_courriel.value == "" &&
		 formulaire._ami_3_courriel.value == "" &&
		 formulaire._ami_4_courriel.value == "" )
	{
		message = msg_js_002;
		ok = false;
	}

	if ( ok == true )
	{
		if( formulaire._mon_courriel.value == "" )
		{
			message = msg_js_003;
			ok = false;
		}
	}

	
	if ( ok == true )
	{
		if( formulaire._mon_courriel.value != "" )
		{
			if(!VerifMail(formulaire._mon_courriel))
	    	{
				message = msg_js_001_0;
				ok = false;
			}
		}
	}
	if ( ok == true )
	{
		if( formulaire._ami_1_courriel.value != "" )
		{
			if(!VerifMail(formulaire._ami_1_courriel))
	    	{
				message = msg_js_001_1;
				ok = false;
			}
		}
    }
   	
	if ( ok == true )
	{
		if( formulaire._ami_2_courriel.value != "" )
		{
			if(!VerifMail(formulaire._ami_2_courriel))
	    	{
				message = msg_js_001_2;
				ok = false;
			}
		}
    }
   	
	if ( ok == true )
	{
		if( formulaire._ami_3_courriel.value != "" )
		{
			if(!VerifMail(formulaire._ami_3_courriel))
	    	{
				message = msg_js_001_3;
				ok = false;
			}
		}
    }
   	
	if ( ok == true )
	{
		if( formulaire._ami_4_courriel.value != "" )
		{
			if(!VerifMail(formulaire._ami_4_courriel))
	    	{
				message = msg_js_001_4;
				ok = false;
			}
		}
    }
    var obj = document.getElementById("erreur");
   	if ( ok == true )
   	{
	    obj.className = "cache";
		obj.innerHTML = "";
   		formulaire._cas.value='v';
   		formulaire.submit();
   	}
   	else
   	{
	    obj.className = "erreur";
		obj.innerHTML = message;
	}
	return ok;
}
