function Montre(id){
	if(document.getElementById(id).style.visibility == "visible"){
		jQuery("#"+id).css("visibility","hidden");
		jQuery("#"+id).css("display","none");
	}else{
		jQuery("#"+id).css("visibility","visible");
		jQuery("#"+id).css("display","block");
	}
}

function isEmail(str)
{
  // Expressions regulières supportées ?
  var supported = 0;
  if (window.RegExp) 
  {
	var tempStr = "a";
	var tempReg = new RegExp(tempStr);
	if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new
	RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(str) && r2.test(str));
}

function ValidationFormNews(form)
{
  	if (!isEmail(form.email.value))
  	{
		alert("Merci de renseigner un email valide.")
		form.email.focus();
		return false;
	}	
  
	return true;
}

function ValidationFormContact(form)
{
  	if (form.nom.value=="")
  	{
		alert("Merci de renseigner votre nom.")
		form.nom.focus();
		return false;
	}	
	
	if (form.prenom.value=="")
  	{
		alert("Merci de renseigner votre prénom.")
		form.prenom.focus();
		return false;
	}	
	
	if (!isEmail(form.email.value))
  	{
		alert("Merci de renseigner un email valide.")
		form.email.focus();
		return false;
	}
	
	form.submit.value="Envoyer";
	form.submit();
	
	return true;
}

function ouvrir(l,h,url) 
{
  hauteur=Math.round((screen.availHeight-h)/2);
  largeur=Math.round((screen.availWidth-l)/2);
  window.open(url, "site", "toolbar=0,location=0,directories=0,status=0, scrollbars=1,resizable=1,menubar=0,top="+hauteur+",left="+largeur+",width="+l+",height="+h);
}

function aller(id)
{
	document.location.href=jQuery('#'+id+' a:first-child').attr('href');
}

