function valideSondage(typeChoix,nbReponseAutorise,totReponse){
    var nbCaseCoche=0;
  if(typeChoix=='radio'){
    
    /* SI c'est radio y a pas de test a faire */
    for (var y=1; y<=totReponse; y++) {
     var field=eval("document.voterForm.btradio["+(y-1)+"]");
     if(field.checked==true){
       nbCaseCoche++;

     }
   }
   if(nbCaseCoche==0) {
      alert('Selectionnez au moins une réponse !');
      return;
    }
  }
  else if(typeChoix=='checkbox'){

    /*Ici il faut verifier le max de rep*/
    //Je vais compter combien de case sont cochés.
    for (var y=1; y<=totReponse; y++) {
      var field=eval("document.voterForm.checkbox"+y);

      if(field.checked) {
        alert('Case:'+y+' coché');
        nbCaseCoche++;
        }
    }
    if(nbCaseCoche>nbReponseAutorise){
      alert('Trop de choix validé !');
      return;
      }
    if(nbCaseCoche==0){      
      alert('Selectionnez au moins une réponse !');
      return;
    }    

  }
  document.voterForm.submit();
}

