var	browser, 
	version,
	platform,
	style_sheet,
	the_link;
	
browser = navigator.appName;
version = navigator.appVersion;
platform = navigator.platform;

if (platform.indexOf("Mac") >= 0) { platform = "Mac"; }
else if (platform.indexOf("Win") >= 0) { platform = "Win"; }
else if (platform.indexOf("Linux") >= 0) { platform = "Lin"; }
else { platform = "Other"; }

//alert(platform + " " + browser + " ." + version + ". ");

if (platform == "Mac")
{
	if (browser == "Microsoft Internet Explorer")	
	{ 
		if (version == "4.0 (compatible; MSIE 5.0; Macintosh; I; PPC)") { style_sheet = "MIE5.css"; }
		else {style_sheet = "MIE.css"; }
	}	
	else if (browser == "Netscape")					{ style_sheet = "MNC.css"; }
	else                                            { style_sheet = "WIE.css"; }
}
else if (platform == "Win")
{
	if (browser == "Microsoft Internet Explorer")	{ style_sheet = "WIE.css"; }
	else if (browser == "Netscape")					{ style_sheet = "WNC.css"; }
	else                                            { style_sheet = "WIE.css"; }
}
else if (platform == "Lin")
{
	if (browser == "Microsoft Internet Explorer")	{ style_sheet = "WIE.css"; }
	else if (browser == "Netscape")					{ style_sheet = "WNC.css"; }
	else                                            { style_sheet = "WIE.css"; }
}
else
{
	if (browser == "Microsoft Internet Explorer")	{ style_sheet = "WIE.css"; }
	else if (browser == "Netscape")					{ style_sheet = "WNC.css"; }
	else                                            { style_sheet = "WIE.css"; }
}	

the_link = "<link rel=stylesheet href=\"styles/" + style_sheet + "\" type=\"text/css\">";

//alert(the_link);

document.write(the_link);
