function isDate(cdate, formatLang) {
			// format lang FR, EN
      Erreur=false;
      tp1 = cdate.indexOf("/",0);
      tp2 = cdate.indexOf("/",tp1+1);
      tmp=cdate;
      if (formatLang=="EN") {
				 tmp=cdate.substring(tp1+1,tp2);
				 tmp=tmp+"/"+cdate.substring(0,tp1);
				 tmp=tmp+"/"+cdate.substring(tp2+1,10);
			}
      
      if (formatLang=="FR") { 
      	tmp=cdate;
      }
      tp1 = tmp.indexOf("/",0);
      tp2 = tmp.indexOf("/",tp1+1);
			Day=tmp.substring(0,tp1);
			Month=tmp.substring(tp1+1,tp2);
			Year=tmp.substring(tp2+1,10);
			if (Day.length==1) Day='0'+Day;
			if (Month.length==1) Month='0'+Month;
			if (Year.length==1) Year='0'+Year;
			tmp=Day+'/'+Month+'/'+Year;
      tp1 = tmp.indexOf("/",0);
      tp2 = tmp.indexOf("/",tp1+1);
   		var tpr1 = tmp.substring(0,tp1);
    	var tpr2 = tmp.substring(tp1 + 1, 10);
      if (tmp.length != 10) {

            Erreur=true;
            return false; 
      }
      else {
            if (tpr1.length != 2 || tpr1 > 31 || tpr1 == 0) {

                  Erreur=true;
                  return false;
             }
            else {
                  var tp2 = tpr2.indexOf("/",0);
                  var tpr3 = tpr2.substring(0,tp2);
                  var tpr4 = tpr2.substring(tp2 + 1, 10);
                  if (tpr3.length != 2 || tpr3 > 12 || tpr3 == 0) {
                        Erreur=true;
                        return false;
                   }
                  else {
                        if ((tpr3=='04' || tpr3=='06' || tpr3=='09' || tpr3=='11') && tpr1 > 30) {
                              Erreur=true;
                              return false;
                        }
                        else {
                              BISEXTILE=28;
                              if (tpr3=='02') {
                                    x=tpr4/4;
                                    y=Math.floor(x);
                                    if (x==y) {
                                          BISEXTILE=29;
                                          x=tpr4/100;
                                          y=Math.floor(x);
                                          if (x==y) {
                                                BISEXTILE=28;
                                                x=tpr4/400;
                                                y=Math.floor(x);
                                                if (x==y) {
                                                      BISEXTILE=29;
                                                }
                                          }
                                    }
                                    if (tpr1 > BISEXTILE) {
                                          Erreur=true;
                                          return false;
                                    }
                              }
                        }
                  }
            }     
            if (tpr4.length != 4 ) {
                  Erreur=true;
                  return false;
            }
            if (Erreur==false) {
                  return true;
            }     
       }
}

