home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 July / VPR0107A.BIN / dxdiarus.chm / linkcss.js < prev    next >
Text File  |  2000-11-07  |  620b  |  27 lines

  1. writeCSS(scriptPath());
  2.  
  3. function scriptPath()
  4. {
  5.     var col = document.scripts;
  6.     return col[col.length - 1].src;
  7. }
  8.  
  9. function writeCSS(spath)
  10. {
  11.     // Get a base CSS name based on the browser.
  12.     var css = "backsdkn.css";
  13.     if (navigator.appName == "Microsoft Internet Explorer") {
  14.         var sVer = navigator.appVersion;
  15.         sVer = sVer.substring(0, sVer.indexOf("."));
  16.         if (sVer >= 4)
  17.             css = "backsdk4.css";
  18.         else
  19.             css = "backsdk3.css";
  20.     }
  21.  
  22.     // The CSS is in the same directory as the script.
  23.     css = spath.replace(/linkcss.js/, css);
  24.     document.writeln('<LINK REL="stylesheet" HREF="' + css + '">');
  25. }
  26.  
  27.