/*
   var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
   if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
   if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
   if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
   if (win_ie_ver >= 5.5) {
     document.write('<scr' + 'ipt src="bible/java/editor.js"');
     document.write(' language="Javascript1.2"></scr' + 'ipt>');
   } else {
      document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>');
   }
*/
	function OverO(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="A"){
		S=S.parentElement;}
		S.className="onglet_select";
	}
	function OverU(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="A"){
		S=S.parentElement;}
		S.className="onglet_onselect";
	}


	function SelO(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD"){
		S=S.parentElement;}
		S.className="sel_act";
	}
	function SelN(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD"){
		S=S.parentElement;}
		S.className="sel_inact";
	}


	function MO1(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD"){
		S=S.parentElement;}
		S.className="onglet_over";
	}
	function MU1(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD"){
		S=S.parentElement;}
		S.className="onglet_inactif";
	}
	function MO(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD"){
		S=S.parentElement;}
		S.className="s_menu_T";
	}
	function MU(e){
	if (!e)
		var e=window.event;
	var S=e.srcElement;
	while (S.tagName!="TD"){
		S=S.parentElement;}
		S.className="s_menu_P";
	}

   NS4 = (document.layers) ? 1 : 0;
   IE4 = (document.all) ? 1 : 0;
   W3C = (document.getElementById) ? 1 : 0;
   var aujourdhui = new Date();
   var timeNow = aujourdhui.getTime();
   function thisFrame(url){
      this.frames.window.location=url;
   }
   function hidestatus(){
      window.status='';
      return true;
   }
   if (document.layers)
      document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);

   document.onmouseover=hidestatus;
   document.onmouseout=hidestatus;
   document.onmouseclick=hidestatus;
   function chargerMenu(pgm2,pgm1){
      parent.frames['mnu_eNetix'].window.location=pgm1;
      parent.frames['appli'].window.location=pgm2;
   }
   function chargerAppli(pgm1){
      parent.frames['appli'].window.location=pgm1;
   }
   function chargerMenuAppli(pgm1){
      aujourdhui = new Date();
      ttime = aujourdhui.getTime();
      pgm1 = pgm1+'&ze='+ttime;
      parent.frames['appli'].window.location=pgm1;
   }
   function chargerDoc(pgm1){
      window.location=pgm1;
   }
   function chargerForm(pgm1,apli){
      aujourdhui = new Date();
      timeNow = aujourdhui.getTime();
      parent.frames[apli].window.location=pgm1;
   }
   function runClock() {
      theTime = window.setTimeout("runClock()", 1000);
      var today = new Date();
      var display = today.toLocaleString();
      window.status = display;
   }
   function runRight() {
      theTime = window.setTimeout("runRight()", 1000);
      var display = "eNetix";
      window.status = display;
   }
   //runRight();
  /*================== SIREN ==============*/
  /* @return   Un booléen qui vaut 'true' si le code SIREN OK */
  function EstSirenValide(siren) {
    var estValide;
    if ( (siren.length != 9) || (isNaN(siren)) )
      estValide = false;
    else {
      // Donc le SIREN est un numérique à 9 chiffres
      var somme = 0;
      var tmp;
      for (var cpt = 0; cpt<siren.length; cpt++) {
        if ((cpt % 2) == 1) { // Les positions paires : 2ème, 4ème, 6ème et 8ème chiffre
          tmp = siren.charAt(cpt) * 2; // On le multiplie par 2
          if (tmp > 9)
            tmp -= 9;  // Si le résultat est supérieur à 9, on lui soustrait 9
        }
        else
          tmp = siren.charAt(cpt);
        somme += parseInt(tmp);
      }
      if ((somme % 10) == 0)
        estValide = true;  // Si la somme est un multiple de 10 alors le SIREN est valide
      else
        estValide = false;
    }
    return estValide;
  }
  /*================== SIRET ==============*/
  /* @return   Un booléen qui vaut 'true' si le code SIRET OK */
  function SiretValide(siret) {
    var estValide;
    if ( (siret.length != 14 && siret.length > 0) || (isNaN(siret)) ){
    }else {
       // Donc le SIRET est un numérique à 14 chiffres
       // Les 9 premiers chiffres sont ceux du SIREN (ou RCS), les 4 suivants
       // correspondent au numéro d'établissement
       // et enfin le dernier chiffre est une clef de LUHN.
      var somme = 0;
      var tmp;
      for (var cpt = 0; cpt<siret.length; cpt++) {
        if ((cpt % 2) == 0) { // Les positions impaires : 1er, 3è, 5è, etc...
          tmp = siret.charAt(cpt) * 2; // On le multiplie par 2
          if (tmp > 9)
            tmp -= 9;  // Si le résultat est supérieur à 9, on lui soustrait 9
        }
       else
         tmp = siret.charAt(cpt);
         somme += parseInt(tmp);
      }
      if ((somme % 10) == 0)
        estValide = true; // Si la somme est un multiple de 10 alors le SIRET est valide
      else
        estValide = false;
    }
    return estValide;
  }


function chromeless(u,n,W,H,X,Y,cU,cO,cL,mU,mO,xU,xO,rU,rO,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO,brd,max,min,res,tsz, fU, bU, fO, bO, pU, pO){
   var c=(document.all&&navigator.userAgent.indexOf("Win")!=-1)?1:0;
   var v=navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE ")+5,navigator.appVersion.indexOf("MSIE ")+8);
   min=(v>=5.5?min:false);
   var w=window.screen.width; var h=window.screen.height;
   var W=W||w; W=(typeof(W)=='string'?Math.ceil(parseInt(W)*w/100):W); W+=(brd*2+2)*c;
   var H=H||h; H=(typeof(H)=='string'?Math.ceil(parseInt(H)*h/100):H); H+=(tsz+brd+2)*c;
   var X=X||Math.ceil((w-W)/2);
   var Y=Y||Math.ceil((h-H)/2);
   var s=",width="+W+",height="+H;
   if(c){
      var cTIT='\n'+
      '<html><head><META HTTP-EQUIV="eNetix" CONTENT="no">\n'+
      '<script>\n'+
      'var IcU=new Image();IcU.src="'+cU+'";var IcO=new Image();IcO.src="'+cO+'";var IcL=new Image();IcL.src="'+cL+'";var IxU=new Image();IxU.src="'+xU+'";var IxO=new Image();IxO.src="'+xO+'";var IrU=new Image();IrU.src="'+rU+'";var IrO=new Image();IrO.src="'+rO+'";var ImU=new Image();ImU.src="'+mU+'";var ImO=new Image();ImO.src="'+mO+'";var IfU=new Image();IfU.src="'+fU+'";var IfO=new Image();IfO.src="'+fO+'";var IbU=new Image();IbU.src="'+bU+'";var IbO=new Image();IbO.src="'+bO+'";var IpU=new Image();IpU.src="'+pU+'";var IpO=new Image();IpO.src="'+pO+'";\n'+
      'document.onmousemove=document.onselectstart=document.ondragstart=document.oncontextmenu=new Function("wMOV();return false");\n'+
      'b=-1\n'+
      'wLOA=function(){if(top.ok&&document.body){'+(min?'bMIN.style.visibility="visible";':'')+'bLOA.style.visibility="hidden";wRSZ()}else setTimeout("wLOA()",500)};wLOA()\n'+
      'wRSZ=function(){var dw=document.body.clientWidth;bCLO.style.pixelLeft=dw-22;bMIN.style.pixelLeft=bLOA.style.pixelLeft=dw-62;bFUL.style.pixelLeft=bRES.style.pixelLeft=dw-42;bFwd.style.pixelLeft=dw-102;bBak.style.pixelLeft=dw-114;bPrt.style.pixelLeft=dw-134}\n'+
      'wMAX=function(m){top.mod=m;if(m){top.mT(0,0);top.rT('+w+','+h+');bFUL.style.visibility="hidden";bRES.style.visibility="visible"}else{top.mT(top.px,top.py);top.rT(top.sW,top.sH);bFUL.style.visibility="visible";bRES.style.visibility="hidden"}}\n'+
      'wDBL=function(){if(!top.mod)wMAX(1);else wMAX(0)}\n'+
      'wMIN=function(){top.window.moveTo(0,-4000);if(top.opener&&!top.opener.closed){top.opener.window.focus()};top.window.blur()}\n'+
      'wMOV=function(){\n'+
      'if(b==0){top.bCOL("'+wBG+'","'+wB+'");b=-1}\n'+
      'if(b==2&&!top.mod){top.px=event.screenX-ofx-1;top.py=event.screenY-ofy-1;top.mT(top.px,top.py)}\n'+
      'if(b==1){top.bCOL("'+wBGs+'","'+wBs+'");ofx=event.x;ofy=event.y;b=2}\n'+
      '}</script></head>\n'+
      '<body onresize="wRSZ()" bgcolor='+wBG+'>\n'+
      '<div style="position:absolute;left:5px;top:4px;width:2000px">'+tH+   '</div>\n'+
      '<img id=bMOV style="position:absolute;left:-50px;top:-50px" '+(max?'ondblclick="wDBL()"':'')+' onmousemove="wMOV()" onmousedown="b=1;wMOV()" onmouseup="b=0;wMOV()" border=0 src="" width=2000 height=2000>\n'+
      '<img id=bFUL style="position:absolute;top:4px;left:'+(W-42)+'px;'+(max?'':'display:none')+'" src="'+xU+'" border=0 width=11 height=11 onmouseover="this.src=IxO.src" onmouseout="this.src=IxU.src" onmouseup="this.src=IxU.src" onmousedown="this.src=IxU.src" onclick="wMAX(1)">\n'+
      '<img id=bRES style="position:absolute;top:4px;left:'+(W-42)+'px;visibility:hidden" src="'+rU+'" border=0 width=11 height=11 onmouseover="this.src=IrO.src" onmouseout="this.src=IrU.src" onmouseup="this.src=IrU.src" onmousedown="this.src=IrU.src" onclick="wMAX(0)">\n'+
      '<img id=bCLO style="position:absolute;top:4px;left:'+(W-22)+'px;" src="'+cU+'" border=0 width=11 height=11 onmouseover="this.src=IcO.src" onmouseout="this.src=IcU.src" onmouseup="this.src=IcU.src" onmousedown="this.src=IcU.src" onclick="top.window.close()">\n'+
      '<img id=bLOA style="position:absolute;top:4px;left:'+(W-82)+'px;" src="'+cL+'" border=0 width=11 height=11>\n'+
      '<img id=bMIN style="position:absolute;top:4px;left:'+(W-62)+'px;visibility:hidden" src="'+mU+'" border=0 width=11 height=11 onmouseover="this.src=ImO.src" onmouseout="this.src=ImU.src" onmouseup="this.src=ImU.src" onmousedown="this.src=ImU.src" onclick="wMIN()">\n'+
      '<img id=bFwd style="position:absolute;top:4px;left:'+(W-102)+'px;" src="'+fU+'" border=0 width=11 height=11 onmouseover="this.src=IfO.src" onmouseout="this.src=IfU.src" onmouseup="this.src=IfU.src" onmousedown="this.src=IfO.src" onclick="window.history.forward()" alt="History forward">\n' +
      '<img id=bBak style="position:absolute;top:4px;left:'+(W-114)+'px;" src="'+bU+'" border=0 width=11 height=11 onmouseover="this.src=IbO.src" onmouseout="this.src=IbU.src" onmouseup="this.scr=IbU.src" onmousedown"this.src=IbO.src" onclick="window.history.back()" alt="History back">\n' +
      '<img id=bPrt style="position:absolute;top:4px;left:'+(W-134)+'px;" src="'+pU+'" border=0 width=11 height=11 onmouseover="this.src=IpO.src" onmouseout="this.src=IpU.src" onmouseup="this.scr=IpU.src" onmousedown"this.src=IpO.src" onclick="parent.main.focus(); parent.main.print()" alt="Print content">\n' +
      '</body>\n'+
      '</html>';
      cTIT=cTIT.replace(/\//g,"\\\/").replace(/\"/g,"\\\"").replace(/\n/g,"\\n");
      cRES=function(b,s){
         var tmp='\n'+
         '<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no">\n'+
         '<script>\n'+
         'document.onmousemove=document.onselectstart=document.ondragstart=document.oncontextmenu=new Function("wMOV();return false");\n'+
         'b=-1\n'+
         'wMOV=function(){if(!top.mod){\n'+
         'if(b==0){top.sH=top.fH;top.sW=top.fW;b=-1}\n'+
         'if(b==2&&(1=='+b+'||4=='+b+'||5=='+b+')){tmp=event.screenY-oH;if(top.sH+tmp>100){top.fH=top.sH+tmp}}\n'+
         'if(b==2&&(2=='+b+'||4=='+b+')){tmp=event.screenX-oW;if(top.sW-tmp>100){top.fW=top.sW-tmp;top.px=event.screenX-ofx-1}}\n'+
         'if(b==2&&(3=='+b+'||5=='+b+')){tmp=event.screenX-oW;top.fW=top.sW+tmp}\n'+
         'if(b==2){setTimeout("top.rT(top.fW,top.fH);top.mT(top.px,top.py);",10)}\n'+
         'if(b==1){ofx=event.x;oH=event.screenY;oW=event.screenX;b=2}\n'+
         '}}</script></head>\n'+
         '<body bgcolor='+wBG+'>\n'+
         '<img style="cursor:'+s+'-resize" id=bMOV style="position:absolute;left:-50px;top:-50px" onmousemove="wMOV()" onmousedown="b=1;wMOV()" onmouseup="b=0;wMOV()" border=0 src="" width=3000 height=2000>\n'+
         '</body>\n'+
         '</html>';
         return tmp.replace(/\//g,"\\\/").replace(/\"/g,"\\\"").replace(/\n/g,"\\n");
      };
      var cRESd=cRES(1,'s'),cRESl=cRES(2,'w'),cRESr=cRES(3,'e'),cRESbl=cRES(4,'sw'),cRESbr=cRES(5,'se');
      var cFRM='<HTML><HEAD><TITLE>'+tW+'</TITLE>\n'+
      '<script>\n'+
      'ok=0;mod=0;sH=fH='+(H)+';sW=fW='+(W)+';px='+(X)+';py='+(Y)+'\n'+
      'bCOL=function(c1,c2){fT.document.bgColor=n0.document.bgColor=n1.document.bgColor=n2.document.bgColor=n3.document.bgColor=n4.document.bgColor=c1;bL.document.bgColor=bT.document.bgColor=bR.document.bgColor=bB.document.bgColor=c2}\n'+
      'mTIT=function(){if(frames.length>8){fT.document.write("'+cTIT+'");fT.document.close();if ('+res+'){n2.document.write("'+cRESd+'");n2.document.close();n1.document.write("'+cRESr+'");n1.document.close();n0.document.write("'+cRESl+'");n0.document.close();n3.document.write("'+cRESbl+'");n3.document.close();n4.document.write("'+cRESbr+'");n4.document.close()};top.bCOL("'+wBG+'","'+wB+'")}else{setTimeout("mTIT()",20)}}\n'+
      'mT=function(x,y){top.window.moveTo(x,y)}\n'+
      'rT=function(w,h){top.window.resizeTo(w,h)}\n'+
      'top.rT(fW,fH);top.mT(px,py)\n'+
      'mTIT()\n'+
      '</script></HEAD>\n'+
      '<frameset onselectstart="return false" onload="top.ok=1" onfocus="if (top.ok&&fT&&fT.wMAX) fT.wMAX(top.mod)" border=0 framespacing=0 frameborder=0 rows="'+tsz+',100%,'+brd+'">\n'+
      '   <frame name=fT src="about:blank" scrolling=no noresize>\n'+
      '   <frameset border=0 framespacing=0 frameborder=0 cols="'+brd+',1,100%,1,'+brd+'">\n'+
      '      <frame name=n0 src="about:blank" scrolling=no noresize>\n'+
      '      <frame name=bL src="about:blank" scrolling=no noresize>\n'+
      '         <frameset border=0 framespacing=0 frameborder=0 rows="1,100%,1">\n'+
      '            <frame name=bT src="about:blank" scrolling=no noresize>\n'+
      '            <frame name=main src="'+u+'" '+fSO+'>\n'+
      '            <frame name=bB src="about:blank" scrolling=no noresize>\n'+
      '         </frameset>\n'+
      '      <frame name=bR src="about:blank" scrolling=no noresize>\n'+
      '      <frame name=n1 src="about:blank" scrolling=no noresize>\n'+
      '   </frameset>\n'+
      '   <frameset border=0 framespacing=0 frameborder=0 cols="'+brd+',100%,'+brd+'">\n'+
      '      <frame name=n3 src="about:blank" scrolling=no noresize>\n'+
      '      <frame name=n2 src="about:blank" scrolling=no noresize>\n'+
      '      <frame name=n4 src="about:blank" scrolling=no noresize>\n'+
      '   </frameset>\n'+
      '</frameset>\n'+
      '</HTML>';

      var CWIN=window.open("", n ,"fullscreen=1,"+s);
      CWIN.moveTo(5000,0);
      CWIN.ft=true;
      CWIN.document.write(cFRM);
      CWIN.document.close();
   } else {
      var CWIN=window.open(u,n,wNS+s,true);
      CWIN.moveTo(X,Y);
   }
   CWIN.focus();
   CWIN.setURL=function(u) { if (this && !this.closed) { if (this.frames.main) this.frames.main.location.href=u; else this.location.href=u; } };
   CWIN.closeIT=function() { if (this && !this.closed) this.close() ;};
   return CWIN;
}
  var highlightcolor="lightyellow";
  var ns6=document.getElementById&&!document.all;
  var previous='';
  var eventobj;
  var intended=/INPUT|TEXTAREA|SELECT|OPTION/;
function checkel(which){
  if (which.style&&intended.test(which.tagName)){
  if (ns6&&eventobj.nodeType==3)
  eventobj=eventobj.parentNode.parentNode;
  return true;
  }
  else
  return false;
  }

function popup(url,nom,ht,lg){
   LeftPosition=(screen.width)?(screen.width-lg)/2:100;
   TopPosition=(screen.height)?(screen.height-ht)/2:100;
   if(!window.open(url,nom,"top="+TopPosition+",left="+LeftPosition+"location=0,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+lg+",height="+ht)){
      alert("Anti-popup !");
   }
}

function openwin(url,nom,ht,lg){
   LeftPosition=(screen.width)?(screen.width-lg)/2:100;
   TopPosition=(screen.height)?(screen.height-ht)/2:100;
   if(!window.open(url,nom,"top="+TopPosition+",left="+LeftPosition+"location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+lg+",height="+ht)){
      alert("Antipopup !");
   }
   /*
   if (document.all&&window.print){ //if ie5
      //eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
      eval('window.showModelessDialog(url,nom,"top="'+TopPosition+'",left="'+LeftPosition+'"location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,dialogWidth="'+lg+'px",dialogHeight="'+ht+'px)');
   }else{
      //eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
      //eval('window.open(url,nom,"top="'+TopPosition+'",left="'+LeftPosition+'"location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="'+lg+'",height="'+ht+')');
      eval('window.open(url,nom,"top="'+T9+opPosition+'",left="'+LeftPosition+'"location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="'+lg+'px",height="'+ht+'px)');
   }
   */
}
function openwinsize(url,nom,ht,lg){
   LeftPosition=(screen.width)?(screen.width-lg)/2:100;
   TopPosition=(screen.height)?(screen.height-ht)/2:100;
   if(!window.open(url,nom,"top="+TopPosition+",left="+LeftPosition+"location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+lg+",height="+ht)){
      alert("Antipopup !");
   }
}
function openwin2(url,nom,ht,lg){
   LeftPosition=(screen.width)?(screen.width-lg)/2:100;
   TopPosition=(screen.height)?(screen.height-ht)/2:100;
   if(!window.open(url,nom,"top="+TopPosition+",left="+LeftPosition+"location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+lg+",height="+ht)){
      alert("Antipopup !");
   }
}
function highlight(e){
  eventobj=ns6? e.target : event.srcElement;
  if (previous!=''){
  if (checkel(previous))
  previous.style.backgroundColor=''
  previous=eventobj
  if (checkel(eventobj))
  eventobj.style.backgroundColor=highlightcolor
  }
  else{
  if (checkel(eventobj))
  eventobj.style.backgroundColor=highlightcolor
  previous=eventobj
  }
  }
  function winCherche(url,frm){
   //parent.frames[frm].window.location=url;
   window.location=url;
}
var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor){
    var theCells = null;
    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }else{
        return false;
    }
    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }else { // 3.2 ... with other browsers
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3
    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor = theDefaultColor;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }else { // 5.2 ... with other browsers
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
}
   function exe_hm(fld1,fld2,type,val){
      var lgTrt = false;
      for (var idx=0; idx < document.forms.length; idx++) {
         field = window.document.forms[idx];
         for (i = 0; i < field.length; i++) {
            if (field.elements[i].name == fld1) {
               lgTrt = true;
               fld_N = i;
               fldVal_N = field.elements[i].value;
            }
            if (field.elements[i].name == (fld1+"_H")) {
               lgTrt = true;
               fld_H = i;
               fldVal_H = field.elements[i].value;
            }
            if (field.elements[i].name == (fld1+"_M")) {
               lgTrt = true;
               fld_M = i;
               fldVal_M = field.elements[i].value;
            }
         }
         if(lgTrt == true){
            if (type == 'H'){
               if (fldVal_H>23 || fldVal_H <0){
                  alert("h = [0-> 23]");
                  return false;
               }
            }else{
               if (fldVal_M >59 || fldVal_M < 0){
                  alert("h = [0-> 59]");
                  return false;
               }
            }
            // sauvegarde H*60+Mn
            field.elements[fld_N].value = Math.abs(fldVal_H * 60) + Math.abs(fldVal_M);
            // Mise en forme Saisie
            Mn = '';
            for (i=fldVal_H.length;i<2;i++){
               Mn = '0' + Mn;
            }
            field.elements[fld_H].value = Mn + fldVal_H;
            val = '';
            for (i=fldVal_M.length;i<2;i++){
               val = '0' + val;
            }
            field.elements[fld_M].value = val + fldVal_M;
            return true;
         }
      }
   }
//-------------------------------------------------------
//-----------       SEL_Edit       ----------------
//-------------------------------------------------------
   function sel_edit(website,nom,acti,def) {
//      alert(website+'&ajj_trie_name='+ acti.name+'&ajj_trie_value='+acti.value+'&'+nom+'='+ acti.value+def);
      if(def){
         window.location = website+'&ajj_trie_name='+ acti.name+'&ajj_trie_value='+acti.value+'&'+nom+'='+ acti.value+def;
      }else{
         window.location = website+'&ajj_trie_name='+ acti.name+'&ajj_trie_value='+acti.value+'&'+nom+'='+ acti.value;
      }
   }
//-------------------------------------------------------
//-----------       Syncronisation       ----------------
//-------------------------------------------------------
   function exe_sync(website,acti,def) {
      if(def){
         window.location = website+'&ajj_trie_name='+ acti.name+'&ajj_trie_value='+acti.value+'&ajj_'+acti.name+'='+ acti.value+def;
      }else{
         window.location = website+'&ajj_trie_name='+ acti.name+'&ajj_trie_value='+acti.value+'&ajj_'+acti.name+'='+ acti.value;
      }
      //alert(website);
      //alert('&ajj_trie_name='+ acti.name+'&ajj_trie_value='+acti.value+'&ajj_'+acti.name+'='+ acti.value);
   }
//-------------------------------------------------------
//-----------       Syncronisation  Fld  ----------------
//-------------------------------------------------------
   function exe_appel(website,nomvar,acti) {
      window.location = website+'&'+nomvar+'='+acti.value;
   }
//-------------------------------------------------------
//-----------          Lien HTTP         ----------------
//-------------------------------------------------------
   function exe_http(website,acti) {
      var heightspeed =10;  // vertical scrolling speed (higher = slower)\n";
      var widthspeed = 10;  // horizontal scrolling speed (higher = slower)\n";
      var leftdist = 0;     // distance to left edge of window\n";
      var topdist = 0;      // distance to top edge of window\n";
      if (document.all) {
        var winwidth = window.screen.availWidth - leftdist;
        var winheight = window.screen.availHeight - topdist;
        var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=yes");
        for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
           sizer.resizeTo("1", sizeheight);
        }
        for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
           sizer.resizeTo(sizewidth, sizeheight);
        }
        sizer.location = website;
     }else{
        window.location = website;
     }
   }
//-------------------------------------------------------
//-----------          Lien HTTP       fullscreen,  ----------------
//-------------------------------------------------------
   function exe_open(website,acti) {
      if (document.all) {
        var sizer = window.open('','','location=no,toolbar=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
        sizer.location = website;
     }else{
        window.location = website;
     }
   }
//-------------------------------------------------------
//-----------   Positionnement sur Champ   --------------
//-------------------------------------------------------
   function placeFocus() {
      if (document.forms.length > 0) {
         var field = document.forms[0];
         for (i = 0; i < field.length; i++) {
            if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
               document.forms[0].elements[i].focus();
               break;
            }
         }
      }
   }

//-------------------------------------------------------
//-----------        Resize Windows        --------------
//-------------------------------------------------------
function winfull(url,name){
   //newwin=window.open(url,name,"scrollbars=yes,status=yes");
   //newwin=window.open(url,name,"scrollbars=yes,status=yes");
   newwin=window.open("",name,"fullscreen,location=no,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
//   if (document.all){
      newwin.moveTo(0,0);
      newwin.resizeTo(screen.width,screen.height);
//   }
   newwin.location=url;
}
//-------------------------------------------------------
//-----------        Resize Windows        --------------
//-------------------------------------------------------
  function nSize(w,h){
     if (h==0){
       window.moveTo(0,0);
       if (document.all){
          window.resizeTo(screen.availWidth,screen.availHeight);
       }else if (document.layers){
          if (window.outerHeight<screen.availHeight||window.outerWidth<screen.availWidth){
             window.outerHeight = screen.availHeight;
             window.outerWidth  = screen.availWidth;
          }
       }
     }else{
        window.resizeTo(w,h);
     }
  }
// ************* TYPE STRING
function ctrlStr(){
   returnVal = true;
}
// ************* TYPE NUMERIC
function ctrlNum(){
   if (isNaN(locval) ) {
      errors += "Vous ne devez saisir que des chiffres <br>";
      returnVal = false;
   }
  return true;
}
// ************* CTRL HEURE
function ctrlHeure(){
   returnVal = true;
   if (isNaN(locval) ) {
      errors += "Vous ne devez saisir que des chiffres <br>";
      returnVal = false;
   }
   if (locval.value > 23 || locval.value < 0) {
      errors += "h = [0 -> 23] <br>";
      returnVal = false;
   }
  return returnVal;
}
// ************* CTRL MINUTES
function ctrlMinute(){
   returnVal = true;
   if (isNaN(locval) ) {
      errors += "Vous ne devez saisir que des chiffres <br>";
      returnVal = false;
   }
   if (locval > 59 || locval < 0 ) {
      errors += "Mn = [ 0-> 59] <br>";
      returnVal = false;
   }
  return returnVal;
}
// ***** Il veut partir
function de(type,val) {
   loctype = type;
   locval  = val;
//   if (loctype == "H") {ctrlHeure();}
   if (loctype == "MN") {ctrlMinute();}
   if (loctype == "A") {ctrlStr();}
   if (loctype == "N") {ctrlNum();}
   if (loctype == "I") {ctrlNum();}
   if (errors.length > 0) {
      alert(errors);
      errors = "";
      returnVal = false;
   } else {
      returnVal = true;
   }
   return returnVal;
}
function bloque_clic(){
   return false;
}
var xHttp = "";
var xUrl  = ""
function get_Response(){
	if(xHttp.hasResponse()){
		document.getElementById(xUrl).innerHTM = xHttp.getResponse();
		xHttp.validateRequest();
	}else{
		document.getElementById(xUrl).innerHTM = 'DANGER';
	}
}
var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
var W3C = (document.getElementById) ? 1 : 0;
function accesServeur(flag){
	if (NS4){
	   ele    = document.layers;
	}else if (W3C){
	   ele    = document.getElementById;
	}else{
	   ele    = document.all;
	}
	var frm="";
	if(ele){ //user
	   if(frm = parent.frames['mnu_eNetix'].document.getElementById('httpbulle')){
         frm.style.display = flag ? "block" : "none";
		}
	}
//	parent.frames['mnu_eNetix'].document.getElementById('httpbulle').style.display = flag ? "block" : "none";
	//alert(parent.frames['mnu_eNetix'].document.getElementById('httpbulle').style.value)
}

function get_xHttp(Url,Balise,Synchrone,Etat,Data){
   var check_delay = 1000;
   xUrl = Balise;
	xHttp = new CreateXMLHTTPRequestObject();
	xHttp.setIndicatorFunction(accesServeur);
	setTimeout("get_Response()", check_delay);
	if(Synchrone == 1){
		xHttp.setSynchronous();
	}else{
		xHttp.setAsynchronous();
	}
	if(Etat == "view"){
		if(!xHttp.getFileGet(Url, Data)){
			xHttp.validateRequest();
			return;
		}
	}else{
		if(!xHttp.getFilePost(Url, Data)){
			xHttp.validateRequest();
			return;
		}
	}
	if(xHttp.getResponse()){
		document.getElementById(Balise).innerHTML = xHttp.getResponse();
	}
	xHttp.setIndicatorFunction(accesServeur);
	xHttp.validateRequest();
}

function CreateXMLHTTPRequestObject() {
	// Propriétés
	this.xhr_object    = null;
	this.response      = null;
	this.ready         = true;
	this.asynchronous  = true;

	// Création de l'objet XMLHTTpRequest
	if(window.XMLHttpRequest) // Firefox
		this.xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
		this.xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else // XMLHttpRequest non supporté par le navigateur
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");



	// Méthodes

	// Appelle la fonction censée indiquer qu'une communication est en cours
	// La fonction doit être fournie par l'utilisateur de la classe et doit prendre un booléen en paramètre :
	//  - true  : la communication commence
	//  - false : la communication est terminée
	this.indicatorFunction = null;

	// Permet de définir la fonction qui servira d'indicateur de communication
	this.setIndicatorFunction = function(func) {
		if(typeof(func) == "function") this.indicatorFunction = func;
	}

	// Passe en mode synchrone
	this.setSynchronous = function() {
		this.asynchronous = false;
	}

	// Passe en mode asynchrone
	this.setAsynchronous = function() {
		this.asynchronous = true;
	}

	// Lance une requête sur un fichier du serveur en passant éventuellement des paramètres, avec la méthode GET
	this.getFileGet = function(url, data) {
		return this.doRequest(url, "GET", data);
	}

	// Alias de this.getFileGet
	this.getFile = this.getFileGet;

	// Lance une requête sur un fichier du serveur en passant éventuellement des paramètres, avec la méthode POST
	this.getFilePost = function(url, data) {
		return this.doRequest(url, "POST", data);
	}

	// Récupère tous les header associés à l'URL passée en paramètre, ou juste le header passé en paramètre s'il est précisé
	this.getFileHeader = function(url, header) {
		return this.doRequest(url, "HEAD", header);
	}

	// Effectue la requête proprement dite
	//  - method : GET, POST ou HEAD
	//  - url    : chemin vers un fichier
	//  - data   : données à transmettre (ex : a=5&foo=bar)
	this.doRequest = function(url, method, data) {
		if(!this.ready || !this.xhr_object) return false;

		// Recherche header_name dans tous les headers et retourne la valeur correspondante
		// ou "Header inconnu..." si header_name n'a pas été trouvé
		function _getResponseHeader(headers, header_name) {
			var tmp = headers.split("\n");
			for(var i=0, n=tmp.length, t=[]; i<n-1; ++i) {
				t = tmp[i].split(": ");
				if(t[0].toLowerCase() == header_name.toLowerCase()) return t[1];
			}
			return "Header inconnu...";
		}
		if(this.indicatorFunction) this.indicatorFunction(true);
		this.ready = false;
		// On copie la référence à l'objet courant car il ne sera plus "dans le contexte"
		// au moment où la fonction onreadystatechange sera exécutée
		var obj = this;
		function onreadystatechangeFunction() {
			if(obj.xhr_object.readyState != 4) return;

			if(obj.indicatorFunction) obj.indicatorFunction(false);

			var all_headers = obj.xhr_object.getAllResponseHeaders();
			if(method == "HEAD") {
				obj.response = data ? _getResponseHeader(all_headers, data) : all_headers;
			}
			else {
				var content_type = _getResponseHeader(all_headers, "Content-Type");
				if (content_type != "Header inconnu..." && (new RegExp("^text/xml.*$", "gi")).test(content_type))
					obj.response = obj.xhr_object.responseXML;
				else
					obj.response = obj.xhr_object.responseText;
			}
		}

		if(method == "GET" && typeof(data) != "undefined" && data != "") url += "?"+data;
		this.xhr_object.open(method, url, this.asynchronous);

		if(this.asynchronous)
			this.xhr_object.onreadystatechange = onreadystatechangeFunction;

		if(data) this.xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		else     data = null;
		this.xhr_object.send(data);

		if(!this.asynchronous)
			onreadystatechangeFunction();

		return true;
	}
	// Retourne true si la réponse est arrivée, false sinon
	this.hasResponse = function() {
		return this.response != null;
	}
	// Retourne la réponse à la dernière requête
	this.getResponse = function() {
		return this.response;
	}
	// Valide la requête, une nouvelle requête peut être faite avec ce même objet
	this.validateRequest = function() {
		this.ready    = true;
		this.response = null;
	}
	// Annule la requête en cours
	this.cancelRequest = function() {
		this.xhr_object.abort();
		if(this.indicatorFunction) this.indicatorFunction(false);
		this.validateRequest();
	}
}

function get_httpRequest(url,name,stat){
         if (document.all){
            var obj = document.all['httpbulle'];
         }else if (document.getElementById){
            var obj = document.getElementById('httpbulle');
         }else{
            var obj = null;
         }
         if(obj){
            obj.style.display = "block";;
         }
         try{
           xquery = new XMLHttpRequest();
         }
         catch (microsoft){
            try{
               xquery = new ActiveXObject('Msxml2.XMLHTTP');
            }
            catch(autremicrosoft){
               try{
                  xquery = new ActiveXObject('Microsoft.XMLHTTP');
               }
               catch(echec){
                  xquery = null;
               }
            }
         }
         if(xquery == null){
           alert('Impossible de créer l\'objet requête,\nVotre navigateur ne semble pas supporter les object XMLHttpRequest.');
         }else{
            if(stat != 'view'){
               xquery.open('POST', url, true);
            }else{
               xquery.open('GET', url, true);
            }
            xquery.onreadystatechange = function(){
            if(xquery.readyState == 4){
               if(xquery.status == 200){
                  var contenu = xquery.responseText;
                  if(spanId = document.getElementById(name)){
                     spanId.innerHTML = contenu;
                  }else{
                    // alert(name+' INTROUVABLE !');
                  }
               }else{
                  alert('888 get_httpRequest Error Status='+xquery.status);
               }
			      if(obj){
			         obj.style.visibility = "hidden";
			         obj.style.display = "none";
			      }
            }
         }
	      if(obj){
	         obj.style.display = "none";
	      }
      }
      xquery.send(null);
}
function get_field(url,name,val,stat){
         if (document.all){
            var obj = parent.frames['mnu_eNetix'].document.all['httpbulle'];
         }else if (document.getElementById){
            var obj = parent.frames['mnu_eNetix'].document.getElementById('httpbulle');
         }else{
            var obj = null;
         };
/*
         if(obj){
            obj.style.visibility = "visible";
            obj.style.display = "block";;
         }
*/
         try{
           xquery = new XMLHttpRequest();
         }
         catch (microsoft){
            try{
               xquery = new ActiveXObject('Msxml2.XMLHTTP');
            }
            catch(autremicrosoft){
               try{
                  xquery = new ActiveXObject('Microsoft.XMLHTTP');
               }
               catch(echec){
                  xquery = null;
               }
            }
         }
         if(xquery == null){
           alert('Impossible de créer l\'objet requête,\nVotre navigateur ne semble pas supporter les object XMLHttpRequest.');
         }else{
            //if(stat != 'view'){
            //   xquery.open('POST', url, true);
            //}else{
               xquery.open('GET', url, true);
            //}
            xquery.onreadystatechange = function(){
            if(xquery.readyState == 4){
               if(xquery.status == 200){
                  var contenu = xquery.responseText;
                  if(spanId = document.getElementById(name)){
                     spanId.innerHTML = contenu;
                  }else{
                    // alert(name+' INTROUVABLE !');
                  }
               }else{
                  alert('948 get_field Error Status='+xquery.status);
               }
               if(obj){
                  obj.style.visibility = "hidden";
                  obj.style.display = "none";
               }
            }
         }
      }
      xquery.send(null);
}
function get_query(url,name,stat){
							alert(name+"  "+url+"   "+stat);
         if (document.all){
            var obj = parent.frames['mnu_eNetix'].document.all['httpbulle'];
            var type = 1;
         }else if (document.getElementById){
            var type = 2;
            var obj = parent.frames['mnu_eNetix'].document.getElementById('httpbulle');
         }else{
            var obj = null;
         };
         if(obj){
            obj.style.display = "block";;
         }
         try{
           xquery = new XMLHttpRequest();
         }
         catch (microsoft){
            try{
               xquery = new ActiveXObject('Msxml2.XMLHTTP');
            }
            catch(autremicrosoft){
               try{
                  xquery = new ActiveXObject('Microsoft.XMLHTTP');
               }
               catch(echec){
                  xquery = null;
               }
            }
         }
         if(xquery == null){
           alert('Impossible de créer l\'objet requête,\nVotre navigateur ne semble pas supporter les object XMLHttpRequest.');
         }else{
            if(stat != 'view'){
               xquery.open('POST', url, true);
            }else{
               xquery.open('GET', url, true);
            }
            xquery.onreadystatechange = function(){
            if(xquery.readyState == 4){
               if(xquery.status == 200){
                  var contenu = xquery.responseText;
                  if(spanId = document.getElementById(name)){
							alert(name+" --- "+url+" --- "+contenu);
                     spanId.innerHTML = contenu;
                  }else{
                     alert(name+' INTROUVABLE !');
                  }
               }else{
                  alert('1008 get_query Error Status='+xquery.status);
               }
			      if(obj){
			         obj.style.display = "none";
			      }
            }
         }
      }
      xquery.send(null);
}
function get_frame_query(frm,url,name,stat){
         //if (document.all){
         //   var obj = parent.frames['mnu_eNetix'].document.all['httpbulle'];
         //}else if (document.getElementById){
         //   var obj = parent.frames['mnu_eNetix'].document.getElementById('httpbulle');
         //}else{
            var obj = null;
         //};
         try{
           xquery = new XMLHttpRequest();
         }
         catch (microsoft){
            try{
               xquery = new ActiveXObject('Msxml2.XMLHTTP');
            }
            catch(autremicrosoft){
               try{
                  xquery = new ActiveXObject('Microsoft.XMLHTTP');
               }
               catch(echec){
                  xquery = null;
               }
            }
         }
         if(xquery == null){
           alert('Impossible de créer l\'objet requête,\nVotre navigateur ne semble pas supporter les object XMLHttpRequest.');
         }else{
	         if(obj){
	            obj.style.visibility = "visible";
	            obj.style.display = "block";;
	         }
            if(stat != 'view'){
               xquery.open('POST', url, true);
            }else{
               xquery.open('GET', url, true);
            }
            xquery.onreadystatechange = function(){
	            if(xquery.readyState == 4){
	               if(xquery.status == 200){
	                  var contenu = xquery.responseText;
	                  if(spanId = parent.frames[frm].window.document.getElementById(name)){
	                     spanId.innerHTML = contenu;
	                  }else{
	                     alert(name+' INTROUVABLE !');
	                  }
	               }else{
	                  alert('1064 get_frame_query Error Status='+xquery.status);
	               }
	            }
			      if(obj){
			         obj.style.visibility = "hidden";
			         obj.style.display = "none";
			      }
            }
         }
         xquery.send(null);
}
function get_httpR(frm,url,name,stat){
         if (document.all){
            var obj = parent.frames['appli'].document.all['httpbulle'];
         }else if (document.getElementById){
            var obj = parent.frames['appli'].document.getElementById('httpbulle');
         }else{
            var obj = null;
         };
         try{
           xquery = new XMLHttpRequest();
         }
         catch (microsoft){
            try{
               xquery = new ActiveXObject('Msxml2.XMLHTTP');
            }
            catch(autremicrosoft){
               try{
                  xquery = new ActiveXObject('Microsoft.XMLHTTP');
               }
               catch(echec){
                  xquery = null;
               }
            }
         }
         if(xquery == null){
           alert('Votre navigateur ne semble pas supporter les object XMLHttpRequest.');
         }else{
	         if(obj){
	            obj.style.visibility = "visible";
	            obj.style.display = "block";;
	         }
            if(stat != 'view'){
               xquery.open('POST', url, true);
            }else{
               xquery.open('GET', url, true);
            }
            xquery.onreadystatechange = function(){
	            if(xquery.readyState == 4){
	               if(xquery.status == 200){
	                  var contenu = xquery.responseText;
	                  if(spanId = parent.frames[frm].window.document.getElementById(name)){
	                     spanId.innerHTML = contenu;
	                  }else{
	                     alert(name+' INTROUVABLE !');
	                  }
	               }else{
	                  alert('1064 get_frame_query Error Status='+xquery.status);
	               }
	            }
			      if(obj){
			         obj.style.visibility = "hidden";
			         obj.style.display = "none";
			      }
            }
         }
         xquery.send(null);
}

