// BrowserCheck Object
// provides most commonly needed browser checking variables
// 19990326

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

// addition platform and browser checks contributed by Russell Warner 2001

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns";
	else if (b=="Microsoft Internet Explorer") this.b = "ie";
	else if (b.toLowerCase().indexOf("opera") != -1) this.b = "op";
	else this.b = b;
	
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5

	this.min = (this.ns||this.ie)
	
	var p = navigator.platform
	if(p.toLowerCase().indexOf("mac") != -1) { this.p = "mac" }
	else if(p.toLowerCase().indexOf("win") != -1) { this.p = "win" }
	else if(p.toLowerCase().indexOf("elf") != -1) { this.p = "bsd" }
	else if(p.toLowerCase().indexOf("linux") != -1) { this.p = "lnx" }
	else this.p = p;
	
}

// automatically create the "is" object
is = new BrowserCheck()
