<!--
/* This script detects browser and operating system,
   and writes the appropriate UNBC stylesheet     */

var detect = navigator.userAgent.toLowerCase();
var is_os_win = detect.indexOf('win');
var is_os_mac = detect.indexOf('mac');
var is_os_linux = detect.indexOf('linux');
var is_os_unix = detect.indexOf('unix');
var is_b_ns = detect.indexOf('netscape');
var is_b_ns6 = detect.indexOf('netscape6');
var is_b_mozilla = detect.indexOf('mozilla');
var is_b_gecko = detect.indexOf('gecko');
var is_b_ie = detect.indexOf('msie');
var is_b_konqueror = detect.indexOf('konqueror');

if (is_os_mac > -1) { // MAC TEST 
	if (is_b_ie == -1 && (is_b_ns > -1 || is_b_ns6 > -1 || is_b_mozilla > -1)) { // NUTSCRAPE TEST FOR MAC
		document.write('<link rel="stylesheet" href="http://www.unbc.ca/homepage_styles/mac_ns.css" type="text/css">');
	}
	else if (is_b_ie) { // MSIE TEST FOR MAC
		document.write('<link rel="stylesheet" href="http://www.unbc.ca/homepage_styles/mac_ie.css" type="text/css">');
	}
} else if (is_os_linux > -1 || is_os_unix > -1 || detect.indexOf('x11') > -1) { // UNIX/LINUX TEST 
    if (is_b_konqueror > -1) { // Konqueror
        document.write('<link rel="stylesheet" href="http://www.unbc.ca/homepage_styles/konqueror.css" type="text/css">');
    } else if (is_b_mozilla > -1 && is_b_gecko == -1) { // NS4x on UNIX/LINUX
		document.write('<link rel="stylesheet" href="http://www.unbc.ca/homepage_styles/nix_ns.css" type="text/css">');
	} else if (is_b_mozilla > -1) {
		document.write('<link rel="stylesheet" href="http://www.unbc.ca/homepage_styles/nix_mozilla.css" type="text/css">');
	}
} else { // DEFAULT STYLE SHEET
	document.write('<link rel="stylesheet" href="http://www.unbc.ca/homepage_styles/default.css" type="text/css">');
}
//-->
