function makePageObject(){
    var agent = navigator.userAgent.toLowerCase();
    var appName = navigator.appVersion;
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major >= 4) && (!this.ns4b));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4) && !this.mac);
    this.ie5  = (appName.indexOf("MSIE 5") != -1) && !this.mac;
    this.op3 = (agent.indexOf("opera") != -1);
    this.isDHTML = (this.ie4 || this.ie5) && !this.mac && !this.unix;
    this.is4  = this.ie4 || this.ns4 || this.ie5 && !this.ns4b;
    return this;
}

// Get a base CSS name based on the browser.
var browser = new makePageObject();
var css = "/css/netscape.css";
if (browser.ie) {
	if (browser.major >= 4) {
	    if (browser.win) css =  "/css/sglass.css";
	    if (browser.mac) css = "/css/macie.css";
	}
}
// The CSS is in the same directory as the script.
document.writeln('<LINK REL="stylesheet" HREF="' + css + '">');
