/**
 * Browser detection, based on code from Professional Javascript book
 * @author Phil Benson
 * @version $Id: detect.js,v 1.1 2006/08/31 15:58:55 phil Exp $
 * @package realx5
 */
function BrowserDetect() {
	this._sUserAgent = navigator.userAgent;
	this._fAppVersion = parseFloat(navigator.appVersion);
	this._detectIE();
}

/**
 * @return {Object} instance of BrowserDetect object
 */
BrowserDetect.getInstance = function() {
	return detect;
}

BrowserDetect.prototype._detectIE = function() {
	this.isIE = (this._sUserAgent.indexOf("compatible") > -1 && this._sUserAgent.indexOf("MSIE") > -1);

	this.isMinIE4 = this.isMinIE5 = this.isMinIE5_5 = this.isMinIE6 = false;

	if (this.isIE) {
		var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
		reIE.test(this._sUserAgent);
		var fIEVersion = parseFloat(RegExp["$1"]);

		// ie version...
		this.isMinIE4   = (fIEVersion >= 4);
		this.isMinIE5   = (fIEVersion >= 5);
		this.isMinIE5_5 = (fIEVersion >= 5.5);
		this.isMinIE6   = (fIEVersion >= 6.0);
		this.isMinIE7   = (fIEVersion >= 7.0);
	}
}

var detect = new BrowserDetect();