
// detect browsers that need special stylesheets
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

// Insert ie conditional comments

document.write('<!--[if IE 7]>');
document.write('<link rel="stylesheet" href="../styles/ie7.css" type="text/css">');
document.write('<![endif]-->');
document.write('<!--[if IE 6]>');
document.write('<link rel="stylesheet" href="../styles/ie6.css" type="text/css">');
document.write('<![endif]-->');
document.write('<!--[if IE 5.5]>');
document.write('<link rel="stylesheet" href="../styles/ie55.css" type="text/css">');
document.write('<![endif]-->');
document.write('<!--[if IE 5]>');
document.write('<link rel="stylesheet" href="../styles/ie5.css" type="text/css">');
document.write('<![endif]-->');

if (checkIt('opera')) 
{
	browser = "Opera"
}
else if (checkIt('msie')) browser = "Internet Explorer"
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

// add style sheets for Opera (all versions)
if (browser == "Opera") {
	document.write('<link rel="stylesheet" href="/styles/opera.css" type="text/css">');
	// add style sheet just	for Opera 6
	if (version == "6") {
		document.write('<link rel="stylesheet" href="/styles/opera6.css" type="text/css">');
	}
}

// add style sheet for IE 4
if (browser == "Internet Explorer") {
	if (version == "4") {
		document.write('<link rel="stylesheet" href="/styles/ie4.css" type="text/css">');
	}
}

// add style sheet just for Netscape 4
if (document.layers) {
	document.write('<link rel="stylesheet" href="/styles/nn4.css" type="text/css">');
}

// function to extract browser type and versions
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
	
