<!--
function popup(file,name,w,h,l,t,scroll,resize) {
    if ( scroll != 'no' ) { scroll = 'yes' ; }
    if ( resize != 'no' ) { resize = 'yes' ; }
    name = window.open(file,name,"width="+w+",height="+h+",left="+l+",top="+t+",scrollbars="+scroll+",resizable="+resize+",status=no,location=no")
    name.focus()
}

function insert(id) {
    insertion=window.open("insert.php?id="+id+"","insertion","width=700,height=120,left=10,top=10,scrollbars=no,resizable=no,status=no,location=no")
    insertion.focus()
}

function confirm_supp(id,des) {
    if ( !confirm("Etes-vous sur de vouloir supprimer le document : \n\n---- "+id+"    "+des+"----") ) {
       return false
    }
    else {
       return true
    }
}

/******************************************
*   Verification saisies document
******************************************/
function Verif_doc() {
    sup = document.all.fsup.value ;
    titre = document.all.ftitre.value ;
    mes ="";

    if ( sup == "" ) {
      mes += "Le type de SUPPORT est obligatoire\n" ;
    }
    if ( titre == "" ) {
      mes += "Le TITRE est obligatoire\n" ;
    }
    if ( mes != "" ) {
      alert (mes) ;
      return false ;
    }
   return true ;
}
/******************************************
*   Verif saisie poids et taille pour calcul IMC
******************************************/
function Verif_imc() {
    p = document.all.fpoids.value ;
    t = document.all.ftaille.value ;
    mes = "" ;
    if ( p == "" | t == "" ) {
      mes += "Les 2 valeurs doivent être saisies.\n" ;
    }

    if ( mes != "" ) {
      alert (mes) ;
      return false ;
    }
   return true ;
}
/******************************************
*   Verif cohérence age/palier pour calcul VO2max
******************************************/
function Verif_vo2m() {
    m = eval(document.all.fmin.value) ;
    s = eval(document.all.fsec.value) ;
    a = eval(document.all.fage.value) ;
    mes = "" ;
    if ( ( ((m == 24 && s > 0) || m > 24) && a < 8)
      || ( ((m == 25 && s > 0) || m > 25) && a < 10)
      || ( ((m == 26 && s > 0) || m > 26) && a < 12)
      || ( ((m == 28 && s > 0) || m > 28) && a < 14)
      || ( ((m == 29 && s > 0) || m > 29) && a < 15) ) {
      mes += "Ce palier n'est pas prévu pour cet âge.\n" ;
    }

    if ( mes != "" ) {
      alert (mes) ;
      return false ;
    }
   return true ;
}
/******************************************
*   Verif saisie FCR et FCMax pour formule Karvonen
******************************************/
function Verif_karvonen() {
    fcr = document.all.ffcr.value ;
    fcm = document.all.ffcm.value ;
    mes = "" ;
    if ( fcr == "" | fcm == "" ) {
      mes += "Les 2 valeurs doivent être saisies.\n" ;
    }

    if ( mes != "" ) {
      alert (mes) ;
      return false ;
    }
   return true ;
}
/******************************************
*   Calcul de l'Indice de Masse Corporelle (imc)
******************************************/
function Calcul_imc() {
    p = document.all.fpoids.value ;
    t = document.all.ftaille.value ;
    mes = "" ;
    if ( p == "" | t == "" ) {
      mes += "Les 2 valeurs doivent être saisies.\n" ;
      alert ( mes) ;
      return ;
    }

    imc =  p / ( t*t);
    mes = imc;

    if ( imc < 20 ) {
      mes += " : Trop maigre !!\n" ;
    }
    if ( imc >= 20 & imc <= 24 ) {
      mes += " : Normal.\n" ;
    }
    if ( imc > 24 & imc <= 29 ) {
      mes += " : Surcharge pondérale.\n" ;
    }
    if ( imc >= 30 ) {
      mes += " : Obésité.\n" ;
    }
      alert ( mes) ;
}

//-->