function init(form)
{
  var id='{cat_annonce}';
  if (id == '') { } else {  
	for (var i=0; i<form.hh_cat_annonce.length; i++)  {
	  if (form.hh_cat_annonce[i].value == id)  {
		 form.hh_cat_annonce[i].checked=true;
	  }
	 }
  }
  return true;
}
function choix(id)
{
//alert (document.getElementById(id).style.display);
	if (document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
		document.getElementById('img_'+id).src = "/common/images/cat_plus.gif";
	}
	else
	if (document.getElementById(id).style.display == "none")
	{
		document.getElementById(id).style.display = "block";
		document.getElementById('img_'+id).src = "/common/images/cat_moins.gif";
	}
}
function testerRadio(radio)
{
	  for (var i=0; i<radio.length;i++)
	  {
		 if (radio[i].checked)
		 {
			return radio[i].value;
		 }
	  }
}

function Verif(form){
var indefini;
	var MyForm=form;
	var Email=MyForm.hh_email_annonceur.value;			// remplacer .email. par le bon nom
	var nom=MyForm.hh_nom_annonceur.value;		// remplacer .password. par le bon nom
	var tel1=MyForm.hh_tel1_annonceur.value;
	var codePostal=MyForm.hh_code_postal_diffusion.value;
	var pays=testerRadio(MyForm.hh_pays_diffusion);	//france
	var categorie=testerRadio(MyForm.hh_cat_annonce);
	var strTexte="Merci de vérifier votre saisie :\n\n";
	var Good=strTexte.length;


var maRegCodePostal = new RegExp ("^[0-9][0-9]+$","g") ;//test de 5 chiffres
var maRegMail = new RegExp ( "^\\w[\\w+\.\-]*@[\\w\-]+\.\\w[\\w+\.\-]*\\w$", "gi" ) ;

if (pays == 'France')//si la france est choisie, on test que le code postal est bien été saisi
{
	if (codePostal.search( maRegCodePostal )!=0)
	strTexte+="  + Il faut entrer un code postal\n";
}
	if(categorie == indefini)
	strTexte+="  + Il faut cocher une catégorie\n";

   if ( Email.search( maRegMail ) == -1 )
	  strTexte+="  + L'email ne semble pas correct\n";

	if ( nom=='')
	  strTexte+="  + Il faut préciser votre nom\n";

	if ( tel1.length<10)
	  strTexte+="  + Indiquer votre N° de telephone fixe\n";

	if(strTexte.length > Good){
		alert(strTexte + "\n");
		return false;
	}
	return true;
//
}

