// Link to cascading stylesheets according to browser/OS.
//  5 jun 2003 - wrote.
//  - They are *cascading*, i.e., we give the main stylesheet first,
//     (defaulting to the most common, MSIE browsers)
//      and then provide stylesheet with diffs for other browsers/OSs.
//  - Write the main stylesheet link directly into the header of the html page.

  // All our stylesheets begin with this name:
  var cssname = 'tchrd';
  var lib     = '/lib/';

  // Give the default stylsheet:
  stylesheet = cssname + '.css';
  // We're going to show the default stylesheet in the page -
  //   if they have javascript turned off, they won't see any styles!


  // Now determine OS and browser, and give alternate(s):
  // var name = navigator.appName;
  // var version = navigator.appVersion;
  var agent = navigator.userAgent;

// alert(agent);

  // Stylesheets for browser/os:
  if ( navigator.userAgent.indexOf("Firefox") > 0 ) {
    stylesheet = cssname + '-linux.css';

    document.write('<link rel="stylesheet" type="text/css" media="all" href="' + 
        lib + stylesheet + '" />'
        );
  }
  if ( navigator.userAgent.indexOf("X11") > 0 ) {
    stylesheet = cssname + '-linux.css';
    document.write('<link rel="stylesheet" type="text/css" media="all" href="' + 
        lib + stylesheet + '" />'
        );
  }
  if ( navigator.userAgent.indexOf("Mac") > 0 ) {
    stylesheet = cssname + '-mac.css';
    document.write('<link rel="stylesheet" type="text/css" media="all" href="' + 
        lib + stylesheet + '" />'
        );
  }

  // Special stylesheet for admin section:
  if ( location.href.indexOf("admin") > 0 ) {
      stylesheet = cssname + '-admin.css';
    document.write('<link rel="stylesheet" type="text/css" media="all" href="' + 
        lib + stylesheet + '" />'
	        );
  }

// -- EOF 


