var ie=document.all?1:0;
var ns6=document.getElementById&&!document.all?1:0;
var ns4=document.layers?1:0;

function sub(){

     if (check()) {
        document.forms[0].action_form.value="valider";
        document.forms[0].submit();
       }
 }

function touche_ie(){ //pour Explorer
 if (event.keyCode == "13") sub();
 }

function touche(e){ //pour Netscape
   if (e.which == "13") sub();
 }

function valid_key() {
   if (ie) {
         touche_ie();
        } else {
                touche(e);
     }
 }

document.onKeyPress = touche; // pour Netscape

function gere_fond() {

//opera Netscape 6 Netscape 4x Mozilla 
if (window.innerWidth || window.innerHeight){ 
docwidth = window.innerWidth; 
docheight = window.innerHeight; 
} 
//IE Mozilla 
if (document.body.clientWidth || document.body.clientHeight){ 
docwidth = eval(document.body.clientWidth); 
docheight = eval(document.body.clientHeight); 
} 
posleft = docwidth - 283;
postop = docheight - 393;
document.write ("<STYLE> body {background: url('./images/logo_fond.gif') no-repeat fixed "+ posleft +"px "+postop+"px;}</STYLE>");
}

function modifierContenu(id,idUser,code,url_retour)
{
  // detection du navigateur
  var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
  if( (navigator.userAgent.indexOf('Mac')>=0) ||
      (navigator.userAgent.indexOf('Windows CE')>=0) ||
      (navigator.userAgent.indexOf('Opera')>=0) )win_ie_ver = 0;
  // accès à l'éditeur
  if(win_ie_ver>=5.5)
    ouvrirPopup('saisieNews.php4?id='+id+'&idUser='+idUser+'&code='+code+'&url_retour='+url_retour, 300, 400);
  else
    alert("Votre navigateur ne supporte pas le DHTML !\nVeuillez installer Internet Explorer au minimum dans sa version 5.5.\n");
}
