function style() {

// set showdebug to true or false, depending on your mood.
var showDebug = false;

var agt=navigator.userAgent.toLowerCase();

var is_major = parseInt(navigator.appVersion);

var is_safari = (agt.indexOf('safari') != -1);

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_nav4 = (agt.indexOf('mozilla/4') != -1);

var is_ie = (agt.indexOf('msie') != -1);

var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")!=-1) );

var is_aol   = (agt.indexOf("aol") != -1);

// *** PLATFORM ***
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

var is_mac    = (agt.indexOf("mac")!=-1);

if (showDebug == true){
	document.write("Determines browser and list debug info");
	document.write("<br> agent: ");
	document.write(agt);
	document.write("<br> major version: ");
	document.write(is_major);
	document.write("<br> is Safari: ");
	document.write(is_safari);
	document.write("<br> is NNav: ");
	document.write(is_nav);
	document.write("<br> is NNav v. 4: ");
	document.write(is_nav4);
	document.write("<br> is IE: " );
	document.write(is_ie);
	document.write("<br> is IE 5: ");
	document.write(is_ie5);
	document.write("<br> is AOL: ");
	document.write(is_aol);
	document.write("<br> is Windows: ");
	document.write(is_win);
	document.write("<br> is Mac: ");
	document.write(is_mac);
	document.write("<P>");
}


	if (is_mac == true) {	  
		if (showDebug == true){document.write("<br> in is-mac section");}
  	
		if (is_safari == true) {
			if (showDebug == true){document.write("<br> in is-safari section");}
			document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/mac_safari.css' title='styles'>");
		} else if (is_nav == true) {
			if (showDebug == true){document.write("<br> in is-nav section");}

			if (is_nav4 == true) {
				//navigator version 4.x
				if (showDebug == true){document.write("<br> in is-nav4 section");}
				document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/mac_ns4.css' title='styles'>");

			} else {
				//NOT navigator version 4.x
				if (showDebug == true){document.write("<br> in else not nav4 section");}
				document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/mac_ns.css' title='styles'>");
			}

		} else if (is_ie == true && is_aol == false && is_ie5 == false) {
				if (showDebug == true){document.write("<br> in IE, not AOL, not IE5 section");}
				document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/mac_ie4.css' title='styles'>");

		} else if (is_ie == true && is_aol == false && is_ie5 == true) {
				if (showDebug == true){document.write("<br> in IE, not AOL, is IE5 section");}
				document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/mac_ie5.css' title='styles'>");

		} else if (is_aol == true) {
				if (showDebug == true){document.write("<br> in AOL section");}
				document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/mac_ie4.css' title='styles'>");

		} else  {
				if (showDebug == true){document.write("<br> in mac fall-through section");}
				document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/default.css' title='styles'>");
				}

	} else if (is_win == true) {
		if (showDebug == true){document.write("<br> in is-win section");}

		if (is_nav == true) {
			if (showDebug == true){document.write("<br> in is-nav section");}
			document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/win_ns.css' title='styles'>");

		} else if (is_ie == true && is_aol == false) {
			if (showDebug == true){document.write("<br> in IE, not AOL section");}
			document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/default.css' title='styles'>");

		} else if (is_aol == true) {
			if (showDebug == true){document.write("<br> in AOL section");}
			document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/default.css' title='styles'>");

		} else  {
			if (showDebug == true){document.write("<br> in win fall-through section");}
			document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/default.css' title='styles'>");
		}

	} else {
		if (showDebug == true){document.write("<br> in not mac/not win fall-through section");}
		document.write("<link rel='stylesheet' type='text/css' href='http://www.ctc.ca.gov/styles/default.css' title='styles'>");
	}

	if (showDebug == true){document.write("<P>");}

}
