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() {
if (document.all){
window_width=document.body.clientWidth;
window_height=document.body.clientHeight;
posleft = eval(window_width-610);
postop = eval(window_height-300);
document.write ("<STYLE>body{background-position:"+ posleft +" "+postop+";}</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");
}