

var cssDir = "css/";

var stylePrefix = "";

var typeof_is_printable = new String(typeof(is_printable));

if (typeof_is_printable.indexOf("undefined") == -1 && is_printable==true)

{

        stylePrefix = "print_";

}

var winNS6CSS = "win_ns6.css";

var winNSCSS = "win_ns.css";

var winIECSS = "win_ie.css";

var macCSS = "mac.css";



// *************************************************************

//  CLIENT_SIDE SNIFFER CODE

// *************************************************************

// convert all characters to lowercase to simplify testing

var agt=navigator.userAgent.toLowerCase();



// *** BROWSER VERSION ***

// Note: On IE5, these return 4, so use is_ie5up to detect IE5.

var is_major = parseInt(navigator.appVersion);

var is_minor = parseFloat(navigator.appVersion);



// *** BROWSER TYPE ***

var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)

            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)

            && (agt.indexOf('webtv')==-1));

var is_nav4up = (is_nav && (is_major == 4 && is_minor <= 4.8));

var is_nav6 = (is_nav && (is_major == 5));

var is_ie   = (agt.indexOf("msie") != -1);

var is_ie3  = (is_ie && (is_major < 4));

var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );

var is_ie4up  = (is_ie  && (is_major >= 4));

var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );

var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);



// *** PLATFORM ***

var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

var is_mac    = (agt.indexOf("mac")!=-1);



//  Select the appropriate stylesheet

if ((is_nav4up || is_ie4up || is_nav6) || (!is_nav && !is_ie)) {

ChooseStyleSheet();

}



// Function to choose the style sheet for use based on the platform

// and browser version

function ChooseStyleSheet() {

  var fileHead = cssDir + stylePrefix;

  var styles;

  if (is_win) {

        if (is_nav) {

          styles = fileHead + winNSCSS;

        } else {

          // Windows Netscape fonts need to be larger than those for IE

          styles = fileHead + winIECSS;

        }

        if (is_nav6) {

          styles = fileHead + winNS6CSS;

        }

  } else if (is_mac) {

      if (is_ie5up) {

            // Default font settings for Mac IE5 match PC IE fonts

        styles = fileHead + winIECSS;

          } else {

            styles = fileHead + macCSS;

          }

  } else {

        // Default style = macCSS

        // Macintosh stylesheets have the largest font sizes, which

        // will ensure readability

        styles = fileHead + macCSS;

  }

  document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + styles + "\">");

  return true;

}
