home *** CD-ROM | disk | FTP | other *** search
/ Kazoku Keikaku / kazoku_g.img / directx.cab / dxdiafrn.chm / linkcss.js < prev    next >
Text File  |  1999-09-09  |  972b  |  32 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.             document.writeln('<SCRIPT FOR="reftip" EVENT=onclick>window.event.cancelBubble = true;</SCRIPT>');
  18.             document.writeln('<SCRIPT FOR="cmd_lang" EVENT=onclick>langClick(this);</SCRIPT>');
  19.             document.writeln('<SCRIPT FOR="cmd_filter" EVENT=onclick>filterClick(this);</SCRIPT>');
  20.             //document.writeln('<STYLE>body{display:none;}</STYLE>');
  21.             css = "backsdk4.css";
  22.         }
  23.         else
  24.             css = "backsdk3.css";
  25.     }
  26.  
  27.     // The CSS is in the same directory as the script.
  28.     css = spath.replace(/linkcss.js/, css);
  29.     document.writeln('<LINK REL="stylesheet" HREF="' + css + '">');
  30. }
  31.  
  32.