var browserCode = navigator.appCodeName;
var browserAgent = navigator.userAgent;
var browserName =  navigator.appName;
var browserVersion =  parseFloat(navigator.appVersion);
var browserPlatform = navigator.platform;
var browserOkForEditor = (browserPlatform == "Win32" && browserName == "Microsoft Internet Explorer" && browserVersion >= 4);

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}



function loadFrames(page1, page2) {
framecode = "<frameset rows='90%,10%'>"
+ "<frame src='" + page1 + "'>"
+ "<frame src='" + page2 + "'>"
+ "</frameset>";

page = window.open("");
page.document.open();
page.document.write(framecode);
page.document.close();
}

function changeRepertoire() {
if (document.forms[0].typelien[0].checked){
  document.forms[0].repertoireLiens.value = document.forms[0].repertoirePDF.value;
} else {
  document.forms[0].repertoireLiens.value = document.forms[0].repertoirePublications.value;
}
 return true;
}


function showList(fname,wname,wattr) {
 sList = window.open(fname,wname,wattr);
  }

function correctDirName(fichier){
 if (fichier.value.substr(0,3)=="../") {
   var l=fichier.value.length-3;
   fichier.value=fichier.value.substr(3,l);
 } 

}

function remLink() {
 if (window.sList && window.sList.open && !window.sList.closed)
  window.sList.opener = null; }


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}


function newImage(arg) {
        if (document.images) {
                rslt = new Image();
                rslt.src = arg;
                return rslt;
        }
}

function changeImages() {
        if (document.images && (preloadFlag == true)) {
                for (var i=0; i<changeImages.arguments.length; i+=2) {
                        document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
                }
        }
}

var preloadFlag = false;
function preloadImages() {
        if (document.images) {
                openfile_over = newImage("./../admindb/images/openfile-over.gif");
                openfile_down = newImage("./../admindb/images/openfile-down.gif");
				me_modifier_over = newImage("./../admindb/images/me_modifier-over.gif");
				me_effacer_over = newImage("./../admindb/images/me_effacer-over.gif");
                preloadFlag = true;
        }
}


/*
function changeridCategorie(){
var item = document.forms[0].categorie.selectedIndex;

if (item==0)
  {document.forms[0].idCategorie.value = '';}
  else
  {document.forms[0].idCategorie.value = item;}

return true;
}

function bonneCategorie(){
return (document.forms[0].categorie.selectedIndex > 0)
}
*/

function enableOrder(aform){
if (aform.typeaction[0].checked)
    aform.ordre.disabled = false
    else aform.ordre.disabled = true;
}

function checkAction(aform,id){
if (aform.typeaction[2].checked){
  if(confirm("Etes-vous certain de vouloir effacer l'enregistrement "+id+"?"))
  {
  aform.typemodif.value = "effacer";
  aform.submit();
  }
} else
  if (aform.typeaction[0].checked)
  {
  aform.typemodif.value = "ordre";
  aform.submit();
  } else
    if (aform.typeaction[1].checked)
    {
    aform.typemodif.value = "modifier";
    aform.submit();
    }
  }


function check_email(address) {
  if (address == "")
  {
  return true;
  }
  else
  {
  if ((address.indexOf ('@') == -1)
    || (address.indexOf ('.') == -1))
      return false;
  }
  return true;
}

function check_phone(checkStr) {
  var checkOK = "0123456789.-()- \t\r\n\f";
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
return allValid;
}



function check_empty(text) {
  return (text.length > 0); // returns false if empty
}

/*
function validerValeurs(){
  validity = true; // assume valid

  if  (
      (!check_empty(document.forms[0].etablissement.value)) &&
      (!check_empty(document.forms[0].capacite.value)) &&
      (!check_empty(document.forms[0].horaireresto.value)) &&
      (!check_empty(document.forms[0].caracteristiques.value)) &&
      (!check_empty(document.forms[0].service.value)) &&
      (!check_empty(document.forms[0].prix.value)) &&
      (!check_empty(document.forms[0].hebergement.value)) &&
      (!check_empty(document.forms[0].services.value)) &&
      (!check_empty(document.forms[0].loisir_detente.value)) &&
      (!check_empty(document.forms[0].restauration.value)) &&
      (!check_empty(document.forms[0].descriptif.value)) &&
      (!check_empty(document.forms[0].horaire.value)) &&
      (!check_empty(document.forms[0].entree.value)) &&
      (!check_empty(document.forms[0].adresse.value)) &&
      (!check_empty(document.forms[0].adresse2.value)) &&
      (!check_empty(document.forms[0].ville.value)) &&
      (!check_empty(document.forms[0].province.value)) &&
      (!check_empty(document.forms[0].codepostal.value)) &&
      (!check_empty(document.forms[0].telephone1.value)) &&
      (!check_empty(document.forms[0].telephone2.value)) &&
      (!check_empty(document.forms[0].telecopieur.value)) &&
      (!check_empty(document.forms[0].url.value)) &&
      (!check_empty(document.forms[0].courriel))
      )
      {
       validity = false;
       alert("S.V.P. inscrivez au moins une valeur. Ce formulaire est vide!");
       document.forms[0].etablissement.focus();
       return false;
     }
  if (!bonneCategorie())
        {validity = false;
         alert("Veuillez S.V.P. choisir une catégorie.");
         document.forms[0].categorie.focus();
         return validity;
        }

 document.forms[0].idCategorie.disabled = false; // permettre la lecture de cet item
 document.forms[0].submit();
}


function validerValeurs2(){
  if (!check_empty(document.forms[0].ordre.value))
        { validity = false; alert("S.V.P. inscrivez l'ordre de l'établissement!");
          document.forms[0].ordre.focus();
          return false;
        }
  if (!bonneCategorie())
        {validity = false;
         alert("Veuillez S.V.P. choisir une catégorie.");
         document.forms[0].categorie.focus();
         return validity;
        }
  if (!check_empty(document.forms[0].etablissement.value))
        { validity = false; alert("S.V.P. inscrivez un nom d'établissement!");
          document.forms[0].etablissement.focus();
          return false;
        }
  if (!check_empty(document.forms[0].descriptif.value))
        { validity = false; alert("S.V.P. inscrivez une description!");
          document.forms[0].descriptif.focus();
          return;
        }
  if (!check_empty(document.forms[0].adresse.value))
        { validity = false; alert("Veuillez S.V.P. inscrire une adresse!");
          document.forms[0].adresse.focus();
          return;
        }
  if (!check_empty(document.forms[0].ville.value))
        { validity = false; alert("Veuillez S.V.P. inscrire une ville!");
          document.forms[0].ville.focus();
          return;
        }
  if (!check_empty(document.forms[0].province.value))
        { validity = false; alert("Veuillez S.V.P. inscrire une province!");
          document.forms[0].province.focus();
          return;
        }
  if (!check_empty(document.forms[0].codepostal.value))
        { validity = false; alert("Veuillez S.V.P. inscrire un code postal!");
          document.forms[0].codepostal.focus();
          return;
        }
  if (!check_phone(document.forms[0].telephone1.value))
        { validity = false; alert("Veuillez S.V.P. inscrire un numéro de téléphone valide!");
          document.forms[0].telephone1.focus();
          return;
        }
  if (!check_email(document.forms[0].courriel.value))
        { validity = false; alert("Veuillez S.V.P. inscrire une adresse de courriel valide!");
          document.forms[0].courriel.focus();
          return;
        }
document.forms[0].idCategorie.disabled = false; // permettre la lecture de cet item
document.forms[0].submit();

}
*/

var text = "";

function ConvertBR(input) {
// Converts carriage returns
// to <BR> for display in HTML

var output = "";
for (var i = 0; i < input.length; i++) {
if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) {
i++;
output += "<BR>";
} else {
output += input.charAt(i);
   }
}
return output;
}


function getActiveText(attribute,field,ot,ot2,sel,ahref,exwin) {
// Sets text MSIE or Netscape active
// text based on browser, puts text in form

if (ot.value=="") {
 ot.value=field.value;
 ot2.value=field.value;
}

if ((navigator.appName=='Microsoft Internet Explorer')
   && (navigator.platform=='Win32')) {
text = (document.all) ? document.selection.createRange().text :
 document.getSelection();
}
else
{
text=sel.value;
}

alltext = field.value;
if (text.length==0){return false;}

if (attribute=="bold") {
  ntext="<b>" + text + "</b>";
} else
 if (attribute=="italic") {
  ntext="<i>" + text + "</i>";
 } else
    if (attribute=="li") {
     ntext="<li>" + text;
     } else
      if (attribute=="nobr") {
       ntext="<nobr>" + text + "</nobr>";
    } else
     if (attribute=="h1") {
      ntext="<h1>" + text + "</h1>";
      } else
      if (attribute=="h2") {
       ntext="<h2>" + text + "</h2>";
      } else
       if (attribute=="h3") {
        ntext="<h3>" + text + "</h3>";
       } else
        if (attribute=="h4") {
         ntext="<h4>" + text + "</h4>";
        } else
         if (attribute=="h5") {
          ntext="<h5>" + text + "</h5>";
         } else
          if (attribute=="center") {
           ntext="<p align=center>" + text + "</p>";
          } else
          if (attribute=="left") {
           ntext="<p align=left>" + text + "</p>";
          } else
          if (attribute=="right") {
           ntext="<p align=right>" + text + "</p>";
          } else
          if (attribute=="size") {
           var aSize = ahref.value;
           if (isNaN(aSize) || (aSize.length==0)) {
            return false;
           } else {ntext="<font size="+ aSize +">" + text + "</font>";
           }
          } else
          if (attribute=="ahref") {
           var hrname = ahref.value;
           if (hrname.substring(0,3)=="www") {hrname="http://"+hrname;}
           if (exwin.checked) {
             ntext = "<a href=\"javascript:;\" onClick="+"MM_openBrWindow('" + hrname +"','lienexterne','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=500,height=400')"+">" + text + "</a>";
           } else {
             ntext="<a href='../admindb/%22%20%2B%20hrname%20%2B%20%22'>" + text + "</a>";
           }

          } else
           if (attribute=="mailto") {
            var mname = ahref.value;
            ntext = "<a href='mailto:" + mname + "'>" + text + "</a>";
           }

text2 = replaceString(text,ntext,alltext);
field.value = text2;
ahref.focus();
field.blur();

return true;
}

function setSelection(sel) {
// Sets text MSIE or Netscape active
// text based on browser, puts text in form

 sel.value = (document.all) ? document.selection.createRange().text :
 document.getSelection();

 }

function delHTML(HTMLWord)
{
 a = HTMLWord.indexOf("<");
 b = HTMLWord.indexOf(">");
 HTMLlen = HTMLWord.length;
 c = HTMLWord.substring(0, a);
 if(b == -1) b = a;
 d = HTMLWord.substring((b + 1), HTMLlen);
 Word = c + d;
 tmp = Word.indexOf("<");
 if(tmp != -1) Word = delHTML(Word);
 return Word;
}
 


function transferValues(){
// alert(arguments.length);
 if (arguments.length>0){
  for (i=0;i<arguments.length;i++){
	tempf='temp'+arguments[i];
	tempf1=eval('document.forms[0].'+tempf);
	f=eval('document.forms[0].'+arguments[i]);
	f.value=tempf1.value;
  }
 } 
}

function transferValues0(){
 if (arguments.length>0){
 for (i=0;i<arguments.length;i=i+2){
  arguments[i+1].value=arguments[i].value;
  }
 } 
}



function replaceChars(entry,out,add) {
// in string entry, replace out with add
// replaceChars(aString,"a","z")

temp = "" + entry; // temporary holder
while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add +
temp.substring((pos + out.length), temp.length));
}
document.forms[0].descriptif.value = temp;
}

/*
function cleanupString(fullS) {
start = fullS.indexOf("<", 0);
end   = fullS.indexOf(">", 0);
var oldS =fullS.substring(start,end+1) ;
var newS = cleanString(oldS,"",fullS);

document.forms[0].descriptif.value = newS;
document.forms[0].fsize.focus();
return true;
}
*/

function cleanupAllHTML(field) {
 field.value = delHTML(field.value);
return true;
}

function cleanupString(field,ot,ot2,sel,ahref) {
if (field.value!=ot2.value)
{
  if (ot.value!="") {
  field.value = ot.value;
  ot.value="";
  ahref.focus();
  field.blur();
  }
}
return true;
}


function makeQuestion(occ){
 items = new Array(13)
  items[0]='';
  items[1]=' la première ';
  items[2]=' la seconde ';
  items[3]=' la troisième ';
  items[4]=' la quatrième ';
  items[5]=' la cinquième ';
  items[6]=' la sixième ';
  items[7]=' la septième ';
  items[8]=' la huitième ';
  items[9]=' la neuvième ';
  items[10]=' la dixième ';
  items[11]=' la onzième ';
  items[12]=' la douzième ';
  items[13]=' cette ';

// alert("occ = " + occ);

 if ((occ>=1) && (occ<13)) {
  return items[occ];
 } else {
   return items[13];
  }

}


function replaceString(oldS,newS,fullS) {
// Replaces oldS with newS in the string fullS
var occ=0;
   for (var i=0; i<fullS.length; i++) {
      if (fullS.substring(i,i+oldS.length) == oldS) {
         occ = occ + 1;
         j = i - 16;
         if (j>0) {j=0;}
         k = i+newS.length+16;
         if (k>fullS.length){k=fullS.length;}
     fullS0 = fullS.substring(j,i) + " >>>>>" + newS + "<<<<< " + fullS.substring(i+oldS.length,k);
     // if (approveModification(fullS.substring(0,i),newS,fullS.substring(i+oldS.length,fullS.length))){
     if (confirm("Remplacer" + makeQuestion(occ) + "occurence de : \n" + fullS0 + "?")) {
         fullS = fullS.substring(0,i) + newS + fullS.substring(i+oldS.length,fullS.length);
         i=i+newS.length+1;
         }

      }
   }
return fullS
}

function cleanString(oldS,newS,fullS) {
// Replaces oldS with newS in the string fullS
var occ=0;
   for (var i=0; i<fullS.length; i++) {
      if (fullS.substring(i,i+oldS.length) == oldS) {
         occ = occ + 1;
         tempS = " _ " + newS;
     fullS0 = fullS.substring(0,i) + tempS + fullS.substring(i+oldS.length,fullS.length);
     if (confirm("Remplacer" + makeQuestion(occ) + "occurence de : \n" + fullS0 + "?")) {
         fullS = fullS.substring(0,i) + newS + fullS.substring(i+oldS.length,fullS.length);
         i=i-oldS.length;
         }

      }
   }
return fullS
}

function writeIt(texte){
 var w = window.open("","resultat","resizable,scrollbars,status,width=500,height=400");
 var d = w.document;
 d.writeln(">html>");
 d.writeln("<head>");
 d.writeln("<title>Categories</title>");
 d.writeln("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
 d.writeln("<link rel='stylesheet' href='../css/stylesheet.css' type='text/css'>");
 d.writeln("<SCRIPT LANGUAGE=\"JavaScript\">");
 d.writeln("<!-- Begin");
 d.writeln("function MM_openBrWindow(theURL,winName,features) { //v2.0");
 d.writeln("  window.open(theURL,winName,features);");
 d.writeln("}");
 d.writeln("//  End -->");
 d.writeln("</script>");
 d.writeln("</head>");
 d.writeln("<body>");
 d.writeln("<form name=\"form2\" method=\"post\" action=../admindb//%22/%22>");
 d.writeln("<input type=\"hidden\" name=\"action\" value=\"changer\">");
 d.writeln("<TABLE border=\"0\" width=\"480px\" cellpadding=\"2\" cellspacing=\"2\" align=\"MIDDLE\" valign=\"MIDDLE\">");
 d.writeln("<tr>");
 d.writeln("<td align=\"left\" valign=\"top\">");
 d.writeln("<p>" + ConvertBR(texte) + "</p>");
 d.writeln("</td>");
 d.writeln("</tr>");
 d.writeln("<tr>");
 d.writeln("<td align=\"center\" valign=\"top\">");
 d.writeln("<INPUT TYPE=\"BUTTON\"  name=\"fermer\" value=\"Fermer\" align=\"middle\" onClick=\"window.close()\">");
 d.writeln("</td>");
 d.writeln("</tr>");
 d.writeln("</table>");
 d.writeln("</form>");
 d.writeln("</body>");
 d.writeln("</html>");
 d.close();
 return true;
}


function approveModification(startText,changeText,endText){

 var w = window.open("","resultat","resizable,status,width=500,height=400");
 var d = w.document;
 d.writeln("<html>");
 d.writeln("<head>");
 d.writeln("<title>Categories</title>");
 d.writeln("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
 d.writeln("<link rel='stylesheet' href='../css/stylesheet.css' type='text/css'>");
 d.writeln("<SCRIPT LANGUAGE=\"JavaScript\">");
 d.writeln("<!-- Begin");
 d.writeln("function MM_openBrWindow(theURL,winName,features) { //v2.0");
 d.writeln("  window.open(theURL,winName,features);");
 d.writeln("}");
 d.writeln("//  End -->");
 d.writeln("</script>");
 d.writeln("</head>");
 d.writeln("<body>");
 d.writeln("<form name=\"form2\" method=\"post\" action=../admindb//%22/%22>");
 d.writeln("<input type=\"hidden\" name=\"action\" value=\"changer\">");
 d.writeln("<TABLE border=\"0\" width=\"480px\" cellpadding=\"2\" cellspacing=\"2\" align=\"MIDDLE\" valign=\"MIDDLE\">");
 d.writeln("<tr>");
 d.writeln("<td align=\"left\" valign=\"top\">");
 d.writeln("<tr>");
 d.writeln("Désirez-vous remplacer cette occurence : ");
 d.writeln("</td>");
 d.writeln("</tr>");
 d.writeln("<td align=\"left\" valign=\"top\">");
 d.writeln("<p>" + ConvertBR(startText) + "<font color=\"#FF0000\"><b>" + changeText + "</b></font>" + ConvertBR(endText) + "</p>");


 d.writeln("</td>");
 d.writeln("</tr>");
 d.writeln("<tr>");
 d.writeln("<td align=\"center\" valign=\"top\">");
 d.writeln("<INPUT TYPE=\"BUTTON\"  name=\"oui\" value=\"Oui\" align=\"middle\" onClick=\"return true\">");
 d.writeln("<INPUT TYPE=\"BUTTON\"  name=\"non\" value=\"Non\" align=\"middle\" onClick=\"return false\">");
 d.writeln("</td>");
 d.writeln("</tr>");
 d.writeln("</table>");
 d.writeln("</form>");
 d.writeln("</body>");
 d.writeln("</html>");
 d.close();
 }
 
 
 
 function voirHTML(txt){
 var w = window.open("","resultat","resizable,scrollbars,status,width=500,height=400");
 var d = w.document;
 d.writeln("<html>");
 d.writeln("<head>");
 d.writeln("<title>Visionnement du résultat</title>");
 d.writeln("<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>");
 d.writeln("<link rel='stylesheet' href='stylesheet.css' type='text/css'>");
 d.writeln("<SCRIPT LANGUAGE=\"JavaScript\">");
 d.writeln("<!-- Begin");
 d.writeln("function MM_openBrWindow(theURL,winName,features) { //v2.0");
 d.writeln("  window.open(theURL,winName,features);");
 d.writeln("}");
 d.writeln("//  End -->");
 d.writeln("</script>");
 d.writeln("</head>");
 d.writeln("<body>");
 d.writeln(""+ConvertBR(txt)+"");
 d.writeln("<br><hr><br>");
 d.writeln("<center><INPUT TYPE=\"BUTTON\"  name=\"fermer\" value=\"Fermer\" align=\"middle\" onClick=\"window.close()\"></center>");
 d.writeln("</body>");
 d.writeln("</html>");
 d.close();
 return true;
}



function openEditor(id){

if(browserOkForEditor) {
 var url= 'editor.php?idEnreg='+id;
 window.open(url,"Editor","titlebar=no,resizable,scrollbars,width=800,height=600");
 } else {
 var url= 'editor2.php?idEnreg='+id;
 window.open(url,"Editor","titlebar=no,resizable=no,scrollbars=no,width=798,height=598");
 }

}


var isns4 = (document.layers);
var isie4 = (document.all && !document.getElementById);
var isie5 = (document.all && document.getElementById);
var isns6 = (!document.all && document.getElementById);

function showMyLayer(id){
 // Netscape 4
 if(isns4){
 document.layers[id].visibility = "show";
 }
 // Explorer 4
 else if(isie4){
 document.all[id].style.visibility = "visible";
 }
 // W3C - Explorer 5+ and Netscape 6+
 else if(isie5 || isns6){
 document.getElementById(id).style.visibility = "visible";
 }
}

function hideMyLayer(id){
 // Netscape 4
 if(isns4){
 document.layers[id].visibility = "hide";
 }
 // Explorer 4
 else if(isie4){
 document.all[id].style.visibility = "hidden";
 }
 // W3C - Explorer 5+ and Netscape 6+
 else if(isie5 || isns6){
 document.getElementById(id).style.visibility = "hidden";
 }
}
