function query_browser()
{
    var b = navigator.appName;
    var v = parseInt(navigator.appVersion);

    this.netscape = 0;
    this.gecko = 0;
    this.ns = 0;
    this.ie = 0;

    if (b == "Netscape" && v >= 4) {
      this.netscape = 1;
        if (v == 5) {
            this.gecko = 1;
        }

        if (v == 4) {
            this.ns = 1;
        }
    }

    if (b == "Microsoft Internet Explorer" && v >= 4) {
        this.ie = 1;
    }
}

agent = new query_browser();