function launchOnEnter(expression) {
  if(event.keyCode==3 || event.keyCode==13) {
    eval(expression);
  }
}

var timer=setTimeout('1',0);

function setEnr(enregistrementid,firstenr,nbenr){
  document.submitor.enregistrementid.value = enregistrementid;document.submitor.nbenr.value = nbenr;document.submitor.firstenr.value = firstenr;
} 
function Bip(id)
{ 
  var mesDivs = document.getElementsByTagName("DIV");
  for(var i=0; i<mesDivs.length; i++) {
    mesDivs[i].style.visibility = "hidden";
  }
   if (navigator.appName=='Microsoft Internet Explorer') {
    eval('document.all.menu'+id+'.style.visibility=\'visible\'');
  }
  else {
    document.getElementById('menu'+id).style.visibility='visible'
  }
}

function adjustMenu(no,pos,lg,y) {
  if (document.body.clientWidth > 780) 
    x_sup = (document.body.clientWidth-780) / 2;
  else
    x_sup = 0;
  x = lg * (pos-1) + x_sup;
  eval('document.all.menu'+no+'.style.pixelLeft = x');
  eval('document.all.menu'+no+'.style.pixelTop = y');
}

function adjustMain() {
  x = 0;
  y = 0;
  if (document.body.clientWidth > 780) 
    x_sup = (document.body.clientWidth-780) / 2;
  else
    x_sup = 0;
  if (document.body.clientHeight > 480) 
    y_sup = (document.body.clientHeight-480) / 2;
  else
    y_sup = 0;
  x = x_sup + 495;
  y = y_sup + 5;
  eval('document.all.menuContenu.style.pixelLeft = x');
  eval('document.all.menuContenu.style.pixelTop = y');  
}  
         
function Boup(id) {                
  if (navigator.appName=='Microsoft Internet Explorer')
  {
       eval('document.all.menu'+id+'.style.visibility=\'hidden\'');
  }
  else
  {
       document.getElementById('menu'+id).style.visibility='hidden';
  }
}                 
    
function setTimer(s) 
  {
    clearTimeout(timer);
    timer=setTimeout(s,600);
  }
  
function go(typerubrique,rubriqueid,elementid,offset,nbrec,firstrec) {
  document.submitor.target='';
  document.submitor.typerubrique.value = typerubrique;document.submitor.rubriqueid.value = rubriqueid;
  document.submitor.elementid.value = elementid;document.submitor.offset.value = offset;
  document.submitor.nbrec.value = nbrec;
  document.submitor.firstrec.value = firstrec;
  document.submitor.submit();
} 



function notgood(field,msg) {
  field.focus();
  alert(msg);
  return false;
}

function isFull(field,msg){
  if (field.value=='') {return notgood(field,msg);}
  return true;
}

function isDigit(field,msg) {
  i = field.value.charCodeAt(0);
  if (!((47<i)&&(i<58))){return notgood(field,msg);}
  return true;
}

function isSelect(field,msg){
  if (field.selectedIndex==0 && field.options[0].value=="") {return notgood(field,msg);}
  return true;
}

function isMail(field,msg) {
  email=field.value;
  arobase=email.indexOf('@');
  point=email.indexOf('.',arobase);
  longueur=email.length;
  if(arobase<=0||point<=arobase+1||longueur<=point+1) {return notgood(field,msg);}
  return true;
}

function goMail(elementid,racine) {
  //window.open('','_self','scrollbars,toolbar=yes,directories=yes,width=950,height=200');
  document.submitor.target = '_self';
  document.submitor.action = racine + 'xsltMailer.aspx';
  document.submitor.elementid.value = elementid;
  document.submitor.submit();
  document.submitor.target = '';
  document.submitor.action='xslt.aspx';    
} 
  
