﻿function checkForm(formid) {
	theform=document.getElementById(formid);
	if(theform.nom.value=="") {alert("Veuillez saisir votre Nom");theform.nom.focus();}
	else if(theform.prenom.value=="") {alert("Veuillez saisir votre Prénom");theform.prenom.focus();}
	else if(theform.tel.value=="") {alert("Veuillez saisir votre numéro de téléphone");theform.tel.focus();}
	else if(theform.msg.value=="" || theform.msg.value=="Votre message") {alert("Veuillez saisir un message");theform.msg.focus();}
	else if((theform.mel.value.indexOf("@")>=0) && (theform.mel.value.indexOf(".")>=0)) {
		  var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/
		  if(reg.exec(theform.mel.value) == null) alert("L'adresse mail que vous avez entré est invalide");
		  else theform.submit();
	}
	else {alert("L'adresse mail que vous avez entré est invalide");theform.mel.focus();}
}

function GetId(id) {
	return document.getElementById(id);
}

jQuery(function($){
	$(".menu")
		.mouseover(function(){
			$(this).css("cursor","pointer");
			$(this).css("backgroundPosition","0 -54px");
			$(this).stop().animate(
				{backgroundPosition:"(0 0)"},
				{duration:700}
			)
		})
		.mouseout(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 -54px)"}, 
				{duration:700}
			)
		})
		.click(function() {
			document.location.href=$(this).attr("title")+".php";
		});

	$(".menu2").css("opacity","0.6");
	$(".menu2")
		.mouseover(function(){
			$(this).animate( {opacity:"1"}, {duration:700} );
		})
		.mouseout(function(){
			$(this).animate( {opacity:"0.6"}, {duration:700} );
		})
		.click(function() {
			document.location.href=$(this).attr("title")+".php";
		});

	$("#langue img").hover(
		function() { $(this).animate({ marginTop:"5px" });},
		function() { $(this).animate({marginTop:"0px"});}
	);
	
	$('a.mentions').colorbox({ maxWidth:'75%', maxHeight:'75%' });
})

