// Browser and OS Detect Script
// Used to insert browser and OS specific style sheets

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('msie'))
{
	browser = "Internet Explorer";
}
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
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";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


if (OS == "Mac" && browser == "Internet Explorer")
{
	document.write('<'+'link rel="stylesheet" href="style-mac_ie.css" />');
}

if (OS == "Mac" && browser != "Internet Explorer")
{
	document.write('<'+'link rel="stylesheet" href="style-mac_ns.css" />');
}

if (OS == ("Windows" || "Linux" || "Unix") && browser != "Internet Explorer")
{
	document.write('<'+'link rel="stylesheet" href="style-win_ns.css" />');
}

if (OS == ("Windows" || "Linux" || "Unix") && browser == "Internet Explorer")
{
	document.write('<'+'link rel="stylesheet" href="style-win_ie.css" />');
} 