

/********************
Verification des champs
*********************/

	function verif_champs()
{
	if(document.forml.nom.value == "")
	{
		alert("Veuillez entrer votre nom SVP");
		document.forml.nom.focus();
		return false;
	}
	
	if(document.forml.prenom.value == "")
	{
		alert("Veuillez entrer votre prenom SVP");
		document.forml.prenom.focus();
		return false;
	}
	
	if(document.forml.mail.value == "")
	{
		alert("Veuillez nous communiquer votre adresse email pour que nous puissons vous répondre.");
		document.forml.mail.focus();
		return false;
	}
	
	if(document.forml.mail.value.indexOf('@') == -1)
	{
		alert("Adresse Email invalide!");
		document.forml.mail.focus();
		return false;
	}
	
	if(document.forml.mail.value.indexOf('.') == -1)
	{
		alert("Adresse Email invalide!");
		document.forml.mail.focus();
		return false;
	}
	
	if(document.forml.mail.value.length <7)
	{
		alert("Adresse Email invalide!");
		document.forml.mail.focus();
		return false;
	}
	
	if(document.forml.message.value == "")
	{
		alert("N'oubliez pas d'écrire votre message, merci.");
		document.forml.message.focus();
		return false;
	}
}



/********************
Sleight for Backgrounds
*********************/

if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	window.attachEvent("onload", alphaBackgrounds);
}

function alphaBackgrounds(){
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (i=0; i<document.all.length; i++){
		var bg = document.all[i].currentStyle.backgroundImage;
		if (itsAllGood && bg){
			if (bg.match(/\.png/i) != null){
				var mypng = bg.substring(5,bg.length-2);
				document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
				document.all[i].style.backgroundImage = "url('/assets/images/x.gif')";
			}
		}
	}
}


