function is_valid_mail(email){
	var verif = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
	if (verif.exec(email) == null){
		return false;
	} else {
		return true;
	}
}


function valid_form(){
	var errors = "";
	
	if( document.formContact.email.value == "" || !is_valid_mail(document.formContact.email.value) ){
		errors += "• Vous n'avez pas entr\351 d'adresse e-mail ou celle-ci est invalide.\r\n";
	}
	if( document.formContact.nom.value == "" ){
		errors += "• Vous n'avez pas entr\351 votre nom/prénom.\r\n";
	}
	if( document.formContact.tel.value == "" ){
		errors += "• Vous n'avez pas entr\351 votre numéro de téléphone.\r\n";
	}
	if( document.formContact.sujet.value == "" ){
		errors += "• Vous n'avez pas entr\351 de sujet pour votre message.\r\n";
	}
	if( document.formContact.message.value == "" ){
		errors += "• Vous n'avez pas entré de message.";
	}
	
	if( errors != "" ){
		alert("Le formulaire contient des erreurs :\r\n\r\n"+errors);
		return false;
	} else {
		return true;	
	}
	
}

function writeSWF(name, width, height){
	html  = '<object id="'+name+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="'+name+'" width="'+width+'" height="'+height+'">';
	html +=    '<param name="movie" value="./swf/'+name+'.swf" />';
	html +=    '<param name="allowfullscreen" value="true" />';
	html +=    '<param name="allowscriptaccess" value="always" />';
	html += '<embed ';
	html +=    'type="application/x-shockwave-flash" ';
	html +=    'id="'+name+'" ';
	html +=    'name="'+name+'" ';
	html +=    'src="./swf/'+name+'.swf" ';
	html +=    'width="'+width+'" ';
	html +=    'height="'+height+'" ';
	html +=    'allowscriptaccess="always" ';
	html +=    'allowfullscreen="true"';
	html += '/>';
	html += '</object>';
	
	//document.write(html);
	return html;

}
