function setFooter() {
	var gaucheHeight=document.getElementById('gauche').offsetHeight;
	var centreHeight=document.getElementById('centre').offsetHeight;
	var droiteHeight=document.getElementById('droite').offsetHeight;
	var heightGDMax = Math.max(droiteHeight, gaucheHeight)
	if (heightGDMax>centreHeight){
	   document.getElementById('centre').style.height=(heightGDMax)+'px';
	}
}


function hasAttribute(element,attribute,val) {
        var has=element.getAttribute(attribute);
        if (has == val)
        {
            return false;
        }
        else {
            return false;
        }
}

function formValidation(id) {
    var oForm = id;
    var doSubmit = true;
    for(var i=0; i<oForm.length; i++){
        var oE = oForm[i]
        if(eval(oE.getAttribute('required'))){
            if(oE.type=="text"||oE.type=="hidden"){
                if(oE.value == ""){ setError(oE, 0); doSubmit = false; }
                else { setError(oE, 1); }
            }
            else if(oE.type=="password"){
                if(oE.value == ""){ setError(oE, 0); doSubmit = false; }
                else {
                    if (!valid_pass())
                    { setError(oE, 0); doSubmit = false; }
                    else {setError(oE, 1); }
                }
            }
            else if(oE.type=="textarea"){
                if(oE.value == ""){ setError(oE, 0); doSubmit = false; }
                else { setError(oE, 1); }
            }
            else if(oE.type=="checkbox"||oE.type=="radio"){
                var aE = oForm[oE.name];
                var checked = false;
                if(aE.length){
                    for(var j=0; j<aE.length; j++){
                        checked = (checked||aE[j].checked);
                    }
                }
                else { checked = aE.checked; }
                if(!checked) { setError(oE, 0); doSubmit = false; }
                else { setError(oE, 1); }
            }
            else if(oE.type=="select-one"){
                if(oE.selectedIndex==0){ setError(oE, 0); doSubmit = false; }
                else { setError(oE, 1); }
            }
            else if(oE.type=="select-multiple"){
                if(oE.selectedIndex==-1){ setError(oE, 0); doSubmit = false; }
                else { setError(oE, 1); }
            }
        }
        if(eval(oE.getAttribute('emailcheck'))){
            var isOK = true;
            var aEmail = oE.value.split("@");
            if(aEmail.length!=2) { isOK = false; }
            else {
                if(aEmail[0].length<1) { isOK = false; }
                else {
                    aEmail = aEmail[1].split(".");
                    if(aEmail.length<2) { isOK = false; }
                    else{
                        for(var z=0; z<aEmail.length; z++){
                            if(aEmail[z].length<2) { isOK = false; }
                        }
                    }
                }
            }

            if(!isOK) { setError(oE, 0); doSubmit = false; }
            else { setError(oE, 1); }
        }
        if(eval(oE.getAttribute('telephonecheck'))) {
            var isOK = true;
            var aTel = oE.value.split(" ");
            if(oE.value == "" || oE.value.length != 14) { isOK = false; }
            else { if (aTel.length>5) { isOK = false; }
                else {
            for(var k=1; k<aTel.length; k++) {
                var premier = aTel[k].substr(0,1);
                var deux = aTel[k].substr(1,1);
                if (isNaN(premier) == true || isNaN(deux) == true)
                    {isOK = false;}
                }
              }
            }
         if(!isOK) { setError(oE, 0); doSubmit = false; }
            else { setError(oE, 1); }
        }

        if(eval(oE.getAttribute('passecheck'))){
            var isOK = true;
            if(oE.value.length<4 || oE.value.length>9) { isOK = false; }

          if(!isOK) { setError(oE, 0); doSubmit = false; }
            else { setError(oE, 1); }
          }

        if(eval(oE.getAttribute('passwordcheck'))){
            var isOK = true;
            if(oE.value.length<4 || oE.value == "Password") { isOK = false; }
          if(!isOK) { setError(oE, 0); doSubmit = false; }
            else { setError(oE, 1); }
          }
        }
    if (doSubmit) {
        return oForm.submit();
    }
}

function setError(oFld, ok){
    document.getElementById(oFld.getAttribute('txtspan')).className = ok?null:"required";
}


function formulaireV(id) {
    var oForm = id;
    var doSubmit = true;
    for(var i=0; i<oForm.length; i++){
        var oE = oForm[i]
        if(eval(oE.getAttribute('requis'))){
            if(oE.type=="text"||oE.type=="hidden"){
                if(oE.value == ""){ setErreur(oE, 0); doSubmit = false; }
                else { setErreur(oE, 1); }
            }
            else if(oE.type=="password"){
                if(oE.value == ""){ setErreur(oE, 0); doSubmit = false; }
                else {
                    if (!valid_pass())
                    { setErreur(oE, 0); doSubmit = false; }
                    else {setErreur(oE, 1); }
                }
            }
            else if(oE.type=="textarea"){
                if(oE.value == ""){ setErreur(oE, 0); doSubmit = false; }
                else { setErreur(oE, 1); }
            }
            else if(oE.type=="checkbox"||oE.type=="radio"){
                var aE = oForm[oE.name];
                var checked = false;
                if(aE.length){
                    for(var j=0; j<aE.length; j++){
                        checked = (checked||aE[j].checked);
                    }
                }
                else { checked = aE.checked; }
                if(!checked) { setErreur(oE, 0); doSubmit = false; }
                else { setErreur(oE, 1); }
            }
            else if(oE.type=="select-one"){
                if(oE.selectedIndex==0){ setErreur(oE, 0); doSubmit = false; }
                else { setErreur(oE, 1); }
            }
            else if(oE.type=="select-multiple"){
                if(oE.selectedIndex==-1){ setErreur(oE, 0); doSubmit = false; }
                else { setErreur(oE, 1); }
            }
        }
        if(eval(oE.getAttribute('emailcheck'))){
            var isOK = true;
            var aEmail = oE.value.split("@");
            if(aEmail.length!=2) { isOK = false; }
            else {
                if(aEmail[0].length<1) { isOK = false; }
                else {
                    aEmail = aEmail[1].split(".");
                    if(aEmail.length<2) { isOK = false; }
                    else{
                        for(var z=0; z<aEmail.length; z++){
                            if(aEmail[z].length<2) { isOK = false; }
                        }
                    }
                }
            }

            if(!isOK) { setErreur(oE, 0); doSubmit = false; }
            else { setErreur(oE, 1); }
        }
        if(eval(oE.getAttribute('telephonecheck'))) {
            var isOK = true;
            var aTel = oE.value.split(" ");
            if(oE.value == "" || oE.value.length != 14) { isOK = false; }
            else { if (aTel.length>5) { isOK = false; }
                else {
            for(var k=1; k<aTel.length; k++) {
                var premier = aTel[k].substr(0,1);
                var deux = aTel[k].substr(1,1);
                if (isNaN(premier) == true || isNaN(deux) == true)
                    {isOK = false;}
                }
              }
            }
         if(!isOK) { setErreur(oE, 0); doSubmit = false; }
            else { setErreur(oE, 1); }
        }

        if(eval(oE.getAttribute('passecheck'))){
            var isOK = true;
            if(oE.value.length<4 || oE.value.length>9) { isOK = false; }

          if(!isOK) { setErreur(oE, 0); doSubmit = false; }
            else { setErreur(oE, 1); }
          }

        if(eval(oE.getAttribute('passwordcheck'))){
            var isOK = true;
            if(oE.value.length<4 || oE.value == "Password") { isOK = false; }
          if(!isOK) { setErreur(oE, 0); doSubmit = false; }
            else { setErreur(oE, 1); }
          }
        }
    if (doSubmit) {
        return oForm.submit();
    }
}

function setErreur(oFld, ok){
 //   document.getElementById(oFld.getAttribute('txtspan')).className = ok?null:"requis";
    document.getElementById(oFld.getAttribute('txtspan')).style.display = ok?"none":"block";
}


/* FORMULAIRE  INSCRIPTION */
function formValidationi(id) {
    var oForm = id;
    var doSubmit = true;
    for(var i=0; i<oForm.length; i++){
        var oE = oForm[i]
        if(eval(oE.getAttribute('required'))){
            if(oE.type=="text"||oE.type=="hidden"){
                if(oE.value == ""){ setErrori(oE, 0); doSubmit = false; }
                else { setErrori(oE, 1); }
            }
            else if(oE.type=="password"){
                if(oE.value == ""){ setErrori(oE, 0); doSubmit = false; }
                else {
                    if (!valid_pass())
                    { setErrori(oE, 0); doSubmit = false; }
                    else {setErrori(oE, 1); }
                }
            }
            else if(oE.type=="textarea"){
                if(oE.value == ""){ setErrori(oE, 0); doSubmit = false; }
                else { setErrori(oE, 1); }
            }
            else if(oE.type=="checkbox"||oE.type=="radio"){
                var aE = oForm[oE.name];
                var checked = false;
                if(aE.length){
                    for(var j=0; j<aE.length; j++){
                        checked = (checked||aE[j].checked);
                    }
                }
                else { checked = aE.checked; }
                if(!checked) { setErrori(oE, 0); doSubmit = false; }
                else { setErrori(oE, 1); }
            }
            else if(oE.type=="select-one"){
                if(oE.selectedIndex==0){ setErrori(oE, 0); doSubmit = false; }
                else { setErrori(oE, 1); }
            }
            else if(oE.type=="select-multiple"){
                if(oE.selectedIndex==-1){ setErrori(oE, 0); doSubmit = false; }
                else { setErrori(oE, 1); }
            }
        }
        if(eval(oE.getAttribute('emailcheck'))){
            var isOK = true;
            var aEmail = oE.value.split("@");
            if(aEmail.length!=2) { isOK = false; }
            else {
                if(aEmail[0].length<1) { isOK = false; }
                else {
                    aEmail = aEmail[1].split(".");
                    if(aEmail.length<2) { isOK = false; }
                    else{
                        for(var z=0; z<aEmail.length; z++){
                            if(aEmail[z].length<2) { isOK = false; }
                        }
                    }
                }
            }
            if(!isOK) { setErrori(oE, 0); doSubmit = false; }
            else { setErrori(oE, 1); }
        }
        if(eval(oE.getAttribute('telephonecheck'))) {
            var isOK = true;
            var aTel = oE.value.split(" ");
            if(oE.value == "" || oE.value.length != 14) { isOK = false; }
            else { if (aTel.length>5) { isOK = false; }
                else {
            for(var k=1; k<aTel.length; k++) {
                var premier = aTel[k].substr(0,1);
                var deux = aTel[k].substr(1,1);
                if (isNaN(premier) == true || isNaN(deux) == true)
                    {isOK = false;}
                }
              }
            }
         if(!isOK) { setErrori(oE, 0); doSubmit = false; }
            else { setErrori(oE, 1); }
        }

        if(eval(oE.getAttribute('passecheck'))){
            var isOK = true;
            if(oE.value.length<4 || oE.value.length>9) { isOK = false; }

          if(!isOK) { setErrori(oE, 0); doSubmit = false; }
            else { setErrori(oE, 1); }
          }

        if(eval(oE.getAttribute('passwordcheck'))){
            var isOK = true;
            if(oE.value.length<4 || oE.value == "Password") { isOK = false; }
          if(!isOK) { setErrori(oE, 0); doSubmit = false; }
            else { setErrori(oE, 1); }
          }
        }
    if (doSubmit) {
        return oForm.submit();
    }
}

function setErrori(oFld, ok){
    document.getElementById(oFld.getAttribute('txtspan')).className = ok?null:"requir";
}


