//yo = document.getElementById(mb_pseudo).name;
//yo = document.getElementById("pseudo").getAttribute('type');
//alert(yo);

function check_alacon(o){
    couleurFocus = '#FFD8BA';
    //if( document.getElementById(mb_pseudo)!= null ){
        if ( o.pseudo.value == '' ) {
              alert(alertPseudo);
              o.pseudo.style.background=couleurFocus;
              o.pseudo.focus();
              return false;
              }
       // }
    
    var MESSAGELANG = 'message_'+lang;
    if ( o.elements[MESSAGELANG].value == '' ) {
          alert(alertBillet);
          o.elements[MESSAGELANG].style.background=couleurFocus;
          o.elements[MESSAGELANG].focus();
          return false;
          }
    if (isCAT==1){
        if ( o.categorie.options[o.categorie.selectedIndex].value == '' ) {
              alert(alertTheme);
              o.categorie.style.background=couleurFocus;
              o.categorie.focus();
              return false;
              }
        }
    document.getElementById("butform").disabled = true;
    }

function rating(qui) {
    $.post(Path+"rating.php", { id: qui });
    $("#rate"+qui).fadeOut("slow", function(){$("#rate"+qui).html("Merquiiii !!");} );
	$("#rate"+qui).fadeIn("slow");
    }

function checkmsg(lechamps, ou) {
    nbNow = lechamps.value.length;
    reste = nbCaract - nbNow;
    $("#caracteresreste"+ou).html("reste <b>"+reste+"</b> caractère"+(reste<=1?'':'s'));
    if(nbNow >= nbCaract) {
        lechamps.value = lechamps.value.substring(0, nbCaract-1);
        }
    }

// verification du formmulaire 'reponses'
function check_reponses(o){
    couleurFocus = '#FFD8BA';

    var MESSAGELANG = 'reponse_'+lang;
    if ( o.elements[MESSAGELANG].value == '' ) {
	      alert('Oupss !! C\'est vide !!');
	      o.elements[MESSAGELANG].style.background=couleurFocus;
	      o.elements[MESSAGELANG].focus();
	      return false;
	      }
    if ( o.pseudo.value == '' ) {
	      alert('Et le "Pseudo" alooooors ?!!');
	      o.pseudo.style.background=couleurFocus;
	      o.pseudo.focus();
	      return false;
	      }
    document.getElementById("butformrep").disabled = true;
    }
