function browseCap() 
{
	this.browser = navigator.appName;
	this.platform = "other";
	this.version = null;
	this.bcVersion = 20030616;
	this.aol = false;
	this.seed = seedBrowseCap;
	this.seed();
}

function seedBrowseCap()
{
	// define the regular expressions
	var ua = navigator.userAgent;
	var Win = /win/i;
	var Mac = /mac/i;
	var IE = /(MSIE )([0-9]{1}\.[0-9]{0,2})/i;
	var zilla = /(zilla\/)([0-9]{1,2}\.[0-9]{0,2})/i;
	var Netscape = /(netscape[0-9]?\/)([0-9]?\.[0-9]{0,2})/i;
	var safari = /safari/i;
	var aol = /(aol )([0-9]?\.[0-9]{0,2})/i;
	
	// perform base pattern matches
	if (Win.test(ua)) { this.platform = "Windows"; }
	if (Mac.test(ua)) { this.platform = "Mac"; }
	if (navigator.appName == 'Netscape') { this.browser = "Netscape"; }
	if (safari.test(ua)) { this.browser = "Safari"; this.version = 1; }
	if (IE.test(ua)) { this.browser = "IE"; }
	if (aol.test(ua)) { this.aol = true; }
	
	// get the version numbers
	if ( this.browser == "Netscape" )
	{
		answerArray = ua.match(zilla);
		this.version = answerArray[2];
		if (parseInt(this.version) == 5)
		{
			answerArray = ua.match(Netscape);
			if (answerArray && answerArray.length > 2) { this.version = answerArray[2]; }
		}

	}
	if (this.browser == "IE" )
	{
		answerArray = ua.match(IE);
		this.version = answerArray[2];
	}
}

var bc = new browseCap();
