// Make link to cascading stylesheets according to browser/OS.
//  - 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 stylesheet link directly into the header of the html page.
//  - Write the stylesheet link according to the level of subdirectory
//     is the calling page, (rather than leading slash '/lib/stylsheet.css')
//     so that this can be used on a standalone machine without webserver.
//  18 nov 2003 - modified for solidarity.
//   5 jun 2003 - wrote.

  // All our stylesheets begin with this name:
  var cssname   = 'solidarity';
  var jslibpath = '/solidarity/lib/js/';
  var link_html_beg = '<link rel="stylesheet" href="' + jslibpath;
  var link_html_end = '" type="text/css" />';

  // Now determine OS and browser, and give alternate(s):
  var name = navigator.appName;
  var version = navigator.appVersion;
  var agent = navigator.userAgent;

  if ( navigator.appVersion.indexOf("X11") > 0 ) {
    stylesheet = cssname + '-linux.css';
    document.write(link_html_beg + stylesheet + link_html_end);
  }

  if ( navigator.appVersion.indexOf("Mac") > 0 ) {
    stylesheet = cssname + '-mac.css';
    document.write(link_html_beg + stylesheet + link_html_end);
  }

  // Special stylesheet for admin section:
  if ( location.href.indexOf("admin") > 0 ) {
    cssname = cssname + '_admin';
    document.write(link_html_beg + stylesheet + link_html_end);
    if ( navigator.appVersion.indexOf("X11") > 0 ) {
	    stylesheet = cssname + '-linux.css';
        document.write(link_html_beg + stylesheet + link_html_end);
	  }
	  if ( navigator.appVersion.indexOf("Mac") > 0 ) {
	    stylesheet = cssname + '-mac.css';
        document.write(link_html_beg + stylesheet + link_html_end);
	  }
  }

// -- EOF 

