﻿  function WindowFind()
  {
    if (navigator.appName=='Netscape'&& parseInt(navigator.appVersion) > 3)
    { window.find(); }
    else
    {
      var element = document.getElementById("WindowFindCustom");
      element.style.display = "block";
    }
  }
  function WindowFindCustom()
  {
    var strSearchTerm = document.getElementById("WindowFindCustomTextBox").value;
    findString(strSearchTerm);
  }
 
  var TRange=null

  function findString (str) {
 if (parseInt(navigator.appVersion)<4) return;
 var strFound;
 if (navigator.appName=="Netscape") {

  // NAVIGATOR-SPECIFIC CODE

  strFound=self.find(str);
  if (!strFound) {
   strFound=self.find(str,0,1)
   while (self.find(str,0,1)) continue
  }
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {

  // EXPLORER-SPECIFIC CODE

  if (TRange!=null) {
   TRange.collapse(false)
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
  }
  if (TRange==null || strFound==0) {
   TRange=self.document.body.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
  }
 }
 if (!strFound) alert ("\'" + str + "\' non trouvé/not found!")
} 
