var i=0;
var futurebig2 = new Image();
var mypath = "";
var mycode = "";
var root = "/NET/";

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 popup2(path,code){
  mypath = path;
  mycode = code;
  if(i==0){
    futurebig2.src=path;
  }
  if(i<100){
    if(futurebig2.complete && futurebig2.width<2){
      w1=720;
      h1=500;
      }
    else{
      w1=0;
      h1=0;
      }
    wait = setTimeout("if(futurebig2.complete){w=w1 + futurebig2.width;h=h1 + futurebig2.height;pop=window.open('','pop"+code+"','toolbar=no,location=no,width='+w+',height='+h+',dependent,screenx=150,screeny=150,left=100,top=100,titlebar=no');i=0;pop.document.clear();pop.document.write('<body leftmargin=\"0\" topmargin=\"0\"><center><img border=\"0\" src=\""+path+"\"></center></body>');pop.focus();} else {i++;popup2(mypath,mycode);}",315);
    
  }
}

function gopop1(URL,width,Height) {
  isSub=true;
  if(isNaN(Height)) {
    Height = 550;
  }
  pop=window.open(URL,'pop','toolbar=no,location=no,scrollbars=no,width='+width+',height='+Height+',dependent,resizable=yes,screenx=150,screeny=150,left=100,top=100,titlebar=no');
}

function gopop2(URL,width,Height,numero) {
  document.submitor.DECLENCHEUR.value=numero;
  isSub=true;
  if(isNaN(Height)) {
    Height = 550;
  }
  pop=window.open(URL,'pop','toolbar=no,location=no,scrollbars=no,width='+width+',height='+Height+',dependent,resizable=yes,screenx=150,screeny=150,left=100,top=100,titlebar=no');
}

function date_heure() {
  now = new Date();                                                       
  jour = now.getDate();                                                   
  mois = now.getMonth() + 1;                                              
  annee = now.getFullYear();                                              
  lettres = now.toGMTString();                                 
  joursemaine = lettres.substring(0,3);                                   
  if(joursemaine=="Mon"){                                                 
  js="Lundi";}                                                             
  if(joursemaine=="Tue"){                                                 
  js="Mardi";}                                                             
  if(joursemaine=="Wed"){                                                 
  js="Mercredi";}                                                          
  if(joursemaine=="Thu"){                                                 
  js="Jeudi";}                                                             
  if(joursemaine=="Fri"){                                                 
  js="Vendredi";}                                                          
  if(joursemaine=="Sat"){                                                 
  js="Samedi";}                                                            
  if(joursemaine=="Sun"){                                                 
  js="Dimanche";}                                                          
                                                                          
  //On recherche le mois                                                  
  if(mois=="1"){                                                          
  mois2="Janvier";}                                                       
  if(mois=="2"){                                                          
  mois2="Fevrier";}                                                       
  if(mois=="3"){                                                          
  mois2="Mars";}                                                          
  if(mois=="4"){                                                          
  mois2="Avril";}                                                         
  if(mois=="5"){                                                          
  mois2="Mai";}                                                           
  if(mois=="6"){                                                          
  mois2="Juin";}                                                          
  if(mois=="7"){                                                          
  mois2="Juillet";}                                                       
  if(mois=="8"){                                                          
  mois2="Aout";}                                                          
  if(mois=="9"){                                                          
  mois2="Septembre";}                                                     
  if(mois=="10"){                                                         
  mois2="Octobre";}                                                       
  if(mois=="11"){                                                         
  mois2="Novembre";}                                                      
  if(mois=="12"){                                                         
  mois2="Decembre";}                                                      
  document.write('Nous sommes le '+ js +' '+ jour +' '+ mois2 +' '+annee);
}         

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;
  /*if (lg == 96)
    x = (lg-1) * (pos-1) + x_sup;
  if (lg == 109)
    x = (lg+1.5) * (pos-1) + x_sup;
  if (lg == 128)
    x = (lg-1.5) * (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 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('','mail','scrollbars,toolbar=no,directories=no,width=350,height=200');
  document.submitor.target = 'mail';
  document.submitor.action = racine + 'xsltMailer.aspx';
  document.submitor.elementid.value = elementid;
  document.submitor.submit();
  document.submitor.target = '';
  document.submitor.action=racine+'xslt.aspx';    
} 

function sendletter(lettername, root)
{
  document.submitor.REC1.value = lettername;
  document.submitor.action = root + 'xslt.aspx';
  document.submitor.elementid.value = '0004';
  document.submitor.firstrec.value = '1';
  document.submitor.nbrec.value = '1';
  document.submitor.typerubrique.value = '1';
  document.submitor.rubriqueid.value = '2';
  document.submitor.submit(); 
}

