<!--
/*
+--------------------------------------+
|         (c) Jakub Uhlik, 2005        |
+--------------------------------------+
|   jakub[DOT]uhlik[AT]gmail[DOT]com   |
++------------------------------------++
++------------------------------------++
||    ----- Browser Sniffer -----     ||
||    ------- version 0.3 -------     ||
||    ---------------------------     ||
++------------------------------------++
*/
function Browser() {
	this.isIEWin = this.isIEMac = this.isFFoxWin = this.isFFoxMac = this.isSafari = this.isNSWin = this.isNSMac = this.isOperaWin = this.isOperaMac = false;
	this.other = false;
	this.version = null;
	
	this._browser = '';
	this._version = '';
	this._platform = '';
	
	var ua = this.ua = navigator.userAgent.toLowerCase();
	var an = this.an = navigator.appName.toLowerCase();
	
	if(ua.indexOf('msie') != -1 && ua.indexOf('opera') == -1){
		if(ua.indexOf('win') != -1) this.isIEWin = true;
		else if(ua.indexOf('mac') != -1) this.isIEMac = true;
		var i = ua.indexOf('msie') + 5;
		this.version = parseInt(ua.substring(i));
	}else if(ua.indexOf('firefox') != -1){
		if(ua.indexOf('win') != -1) this.isFFoxWin = true;
		else if(ua.indexOf('mac') != -1) this.isFFoxMac = true;
		var i = ua.indexOf('firefox') + 8;
		this.version = parseInt(ua.substring(i));
	}else if(ua.indexOf('safari') != - 1){ 
		this.isSafari = true;
		var i = ua.indexOf('safari') + 7;
		this.version = parseInt(ua.substring(i,i+1));
	}else if(ua.indexOf('netscape') != -1){
		if(ua.indexOf('win') != -1) this.isNSWin = true;
		else if(ua.indexOf('mac') != -1) this.isNSMac = true;
		var i = ua.indexOf('netscape') + 9;
		this.version = parseInt(ua.substring(i));
	}else if(ua.indexOf('opera') != -1){
		if(ua.indexOf('win') != -1) this.isOperaWin = true;
		else if(ua.indexOf('mac') != -1) this.isOperaMac = true;
		var i = ua.indexOf('opera') + 6;
		this.version = parseInt(ua.substring(i));
	}else{
		this.other = true;
		this.version = null;
	}
	var a = ['isIEWin','isIEMac','isFFoxWin','isFFoxMac','isSafari','isNSWin','isNSMac','isOperaWin','isOperaMac','other'];
	var b = ['IE','IE','FireFox','FireFox','Safari','NetScape','NetScape','Opera','Opera','other'];
	var c = ['Win','Mac','Win','Mac','Mac','Win','Mac','Win','Mac','other'];
	var o = new Object();
	for(var i=0;i<10;i++){
		eval('o.' + a[i] +' = this.' + a[i]);
	}
	for(var i=0;i<10;i++){
		if(eval('o.' + a[i]) == true){
			this._browser = b[i];
			this._platform = c[i];
			this._version = this.version;
			break;
		}
	}
}
var browser = new Browser();



//-->



