
// *** Start: Code for checking which CSS file to use ***
// get platform and browser versions
var platform = navigator.platform.substr(0,3);
var browserName = navigator.appName;
var browserVer;

//for IE 5, the first number in "navigator.appVersion" is 4.0, so need to parse the string further 
if (navigator.appVersion.indexOf('MSIE 5') != -1) {
	browserVer=5;
}
else {
	browserVer = parseInt(navigator.appVersion);
}

// Platform is Windows
if (platform=="Win") {

//Netscape 4 on Windows
if ((browserName=="Netscape") && (browserVer <=4)) {	
	document.write('<link rel="stylesheet" type="text/css" href="ns.css" >');
//	alert('Win running NS 4');
}
//IE, NS6, (or any other browsers) on Windows 
else {
	document.write('<link rel="stylesheet" type="text/css" href="ie.css" >');
//	alert('Windows running IE, NS6, etc.');
}
} 
	
// Platform is Macintosh
else if (platform=="Mac") {

//IE5 or NS6 on Mac
if (browserVer >=5) {
	document.write('<link rel="stylesheet" type="text/css" href="ie.css" >');
//	alert('Mac running IE ');
}
		
//Netscape 4, IE4, and all other browsers on Mac
else {
	document.write('<link rel="stylesheet" type="text/css" href="ie.css" >');
//	alert('Mac running NS4, IE4, all other" ');
}
} 

// All other platforms
else {
//	document.write('<link rel="stylesheet" type="text/css" href="ie.css" >');
	alert('All other platforms');
}

// *** End: Code for checking which CSS file to use ***

// This is a workaround for a Netscape 4 bug that causes 
// stylesheets to be corrupted when the window is resized.
if (document.layers) {
	var widthCheck = window.innerWidth;
	var heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}

function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
	document.location.href = document.location.href;
}

// *** End: Code for Netscape 4 Resize bug ***


