function reloadImage()
{
	var rand = Math.random();
	document.getElementById('image').src = 'antirobot/image.php?pVar='+rand ;
}
function testerCaptcha()
{
	var h = Math.random(); // variable pour que IE recherge la page 
	var url = 'getImage.php?var='+h;
	new Ajax.Request(
						url, 
						{
							method: 'get',
							onSuccess: function(req) 
							{
								if (200 == req.status )//important
								{
									//alert(req.responseText+$('id_pCode').value);
									if(req.responseText == $('id_pCode').value.toLowerCase())
									{
										$('id_form_news').submit();
									}
									else
									{	
										alert("Le cryptograme n'est pas correcte !");
										return false ;	
									}
								}
							}
						}
					);
}
function valider_form_newsletter(theForm) 
{  
	if (theForm.pMail.value.length == 0)
	{
		alert("Votre adresse e-mail est obligatoire !");
		theForm.pMail.focus();
		return false;
	}
	if (!isValidMail(theForm.pMail.value))
	{
		alert("Format mail invalide !");
		theForm.pMail.focus();
		return false;
	}
	if (theForm.pCode.value.length == 0)
	{
		alert("Le cryptograme n'est pas correcte !");
		theForm.pCode.focus();
		return false;
	}
	testerCaptcha();
	return true ;
}
