// //////////
// Find OS
var system = 'pc'; // pc as default

if ((navigator.appVersion.indexOf('Lin')!=-1)
        || (navigator.appVersion.indexOf('X11')!=-1)) {
        system = 'lin';
} else if (navigator.appVersion.indexOf('Mac')!=-1) {
        system = 'mac';
}

// //////////////////
// Search for browser
function Client() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.isNS  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.isNS4 = (this.isNS && (this.major < 5));
    this.isNS6 = (this.isNS && (this.major >= 5));
    this.isIE   = (agent.indexOf("msie") != -1);
    this.name = 'default';

    this.browser = -1;

    // this.NS = 0;
    this.NS4 = 0;
    this.NS6 = 1;
    this.IE = 2;

    if (this.isNS4) {
        this.browser = this.NS4;
        this.name = 'ns_' + system;
    } else if (this.isNS6) {
        this.browser = this.NS6;
        this.name = 'ns6_' + system;
    } else if (this.isIE) {
        this.browser = this.IE;
        this.name = 'ie_' + system;
    }
}
var client = new Client();

// /////////////////////
// set helper variables to access layers and style attributes
// more convenient
var doc = "";
var sty = "";

if (client.isNS4) {
        doc = "document.";
        sty = "";
} else if (client.isNS6) {
        doc = "document.";
        sty = "";
} else if (client.isIE) {
        doc = "document.all.";
        sty = ".style";
}


