home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / progress_number.js < prev    next >
Encoding:
Text File  |  2004-03-24  |  1.6 KB  |  48 lines

  1. var isDom = document.getElementById?true:false;
  2. var isIE  = document.all?true:false;
  3. var isNS4 = document.layers?true:false;
  4. var cellCount = 10;
  5.  
  6. function setprogress(pIdent, pValue, pString, pDeterminate)
  7. {
  8.         if (isDom)
  9.             prog = document.getElementById(pIdent+'installationProgress');
  10.         if (isIE)
  11.             prog = document.all[pIdent+'installationProgress'];
  12.         if (isNS4)
  13.             prog = document.layers[pIdent+'installationProgress'];
  14.     if (prog != null) 
  15.         prog.innerHTML = pString;
  16.  
  17.         if (pValue == pDeterminate) {
  18.         for (i=0; i < cellCount; i++) {
  19.                 showCell(i, pIdent, "hidden");    
  20.             }
  21.         }
  22.         if ((pDeterminate > 0) && (pValue > 0)) {
  23.             i = (pValue-1) % cellCount;
  24.             showCell(i, pIdent, "visible");    
  25.         } else {
  26.             for (i=pValue-1; i >=0; i--) {
  27.                 showCell(i, pIdent, "visible");    
  28.                 if (isDom)
  29.                     document.getElementById(pIdent+'progressCell'+i+'A').innerHTML = i;
  30.                 if (isIE)
  31.                     document.all[pIdent+'progressCell'+i+'A'].innerHTML = i;
  32.                 if (isNS4)
  33.                     document.layers[pIdent+'progressCell'+i+'A'].innerHTML = i;
  34.             }
  35.     }
  36. }
  37.  
  38. function showCell(pCell, pIdent, pVisibility)
  39. {
  40.     if (isDom)
  41.         document.getElementById(pIdent+'progressCell'+pCell+'A').style.visibility = pVisibility;
  42.     if (isIE)
  43.         document.all[pIdent+'progressCell'+pCell+'A'].style.visibility = pVisibility;
  44.     if (isNS4)
  45.         document.layers[pIdent+'progressCell'+pCell+'A'].style.visibility = pVisibility;
  46.  
  47. }
  48.