// ------------------------------------------
// CLASS   : amcms_browser
// descr.  : determine browser and version
// author  : Richard Lagerström (+46 739 39 19 10)
// website : http://www.empty.se, http://www.mediatroop.se
// date    : 2007-07-12
// ------------------------------------------
function amcms_browser()
{
	var ua, s, i;
	
	this.isIE    = false;
	this.isNS    = false;
	this.isOP 	= false;
	this.version = null;
	
	ua = navigator.userAgent;
	
	s = "MSIE";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isIE = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
	
	s = "Netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}
	
	// Treat any other "Gecko" browser as NS 6.1.
	s = "Gecko";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = 6.1;
		return;
	}
	
	s = "Opera";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isOP = true;
		this.version = ua.substr(i + ua.indexOf('/'));
		this.version = parseFloat(this.version.substr(1, this.version.indexOf(' (')));
		return;
	}
}
// instantiate browser object
var amcmsBrowser = new amcms_browser();