function getOSType()
{
    str = navigator.userAgent.toUpperCase();
    if (str.indexOf("MAC") >= 0) return "MacOS";
    if (str.indexOf("WIN") >= 0) return "Windows";
    return "unknown";
}


function getBrowserName()
{
	str  = navigator.appName.toUpperCase();
	str2 = navigator.userAgent.toUpperCase();
	if (str.indexOf("NETSCAPE") >= 0)  return "Netscape";
	if (str.indexOf("MICROSOFT") >= 0) return "Explorer";
	return "unknown";
}

function getBrowserVersion()
{
    str   = navigator.appName.toUpperCase();
	version = 0;
	appVer  = navigator.appVersion;
	if (str.indexOf("NETSCAPE") >= 0)
	{
		s = appVer.indexOf(" ",0);
		version = eval(appVer.substring(0,s));
		if (version >= 5) version++;
	}
	if (str.indexOf("MICROSOFT") >= 0)
	{
		appVer  = navigator.userAgent;
		s = appVer.indexOf("MSIE ",0) + 5;
		e = appVer.indexOf(";",s);
		version = eval(appVer.substring(s,e));
	}
	return version;
}

os      = getOSType();
browser = getBrowserName();
version = getBrowserVersion();
if (os == "MacOS")   dirName = "../../css/mac";
if (os == "Windows") dirName = "../../css/win";
if (browser == "Netscape") dirName += "nn";
if (browser == "Explorer") dirName += "ie";
if ((version >= 3) && (version < 6))   dirName += ".css";
if ((version >= 6) && (version < 7))   dirName += "6.css";
document.write("<link rel='stylesheet' href='"+dirName+"' type='text/css'>");
