
  function donPack() {
      document.forms[1].accountTxt.value = '';
  }
  function donOther() {
    document.forms[1].don[5].checked = true;
  }
  function copieDon(arg) {
    document.forms[1].account.value = arg;  
  }
  function clearAccount() {
    document.forms[1].account.value = '';
  }

	function verif() {
		var accountTxt, account, civilite, nom, prenom, adresse, ville, cp, email, naissance;
		var testAccount = 0;
		var nb = 0;
		tabb = new Array('accountTxt','account', 'civilite', 'nom', 'prenom', 'adresse', 'ville', 'cp', 'email', 'naissance');
		
		for (i=0; i<tabb.length; i++) {
			tt = eval("document.forms[1]."+tabb[i]+".value");

			if ((tabb[i] == 'nom' || tabb[i] == 'prenom' || tabb[i] == 'adresse' || tabb[i] == 'civilite') && (tt == "")) nb = nb + 1;
			if (tabb[i] == 'cp' && (isNaN(tt) || tt == "" || tt.length<5 || tt<01000 || tt>95999 || tt==75000 || (tt >= 75021 && tt <= 75999) )) nb = nb + 1;
			//if (tabb[i] == 'naissance' && (isNaN(tt) || tt == "" || tt.length<4 || tt<1900 || tt><?=date(Y)?>)) nb = nb + 1;

			reg = new RegExp("[0-9]+");
			if (tabb[i] == 'ville' && (!isNaN(tt) || tt == "" || reg.test([tt])==true)) nb = nb + 1;

			mel = new RegExp("[;,:!?()+*]+");
			if (tabb[i] == 'email' && (tt == "" || mel.test([tt])==true)) nb = nb + 1;
			mel = new RegExp("[@]{1}");
			if (tabb[i] == 'email' && (tt == "" || mel.test([tt])==false)) nb = nb + 1;
			mel = new RegExp("[.]{1}[a-zA-Z]{2,3}$");
			if (tabb[i] == 'email' && (tt == "" || mel.test([tt])==false)) nb = nb + 1;

			som = new RegExp("[.,:!?()+*]+");
			if (tabb[i] == 'account' && (tt == "" || tt == 0 || som.test([tt])==true || isNaN(tt))) nb = nb + 1;
		}
/*
    for(j=0; j<5; j++) {
      if (eval('document.forms[1].don['+j+'].checked')) { testAccount = 1; }
    }
    if (document.forms[1].don[5].checked && document.forms[1].accountTxt.value!="" && !isNaN(document.forms[1].accountTxt.value)) { testAccount = 1; }
    if (testAccount == 0) nb = nb + 1;
*/

		if (nb > 0) {
			document.forms[1].action = 'send.php?nb=' + nb;
			return true;
		}else{
			document.forms[1].action = 'http://www.avh.asso.fr/cgi-bin/mercanet_dons/call_request.pl';
			return true;
		}
	}
