/**
* Fichero: FrmkBrowserSniffer.js
* Descripcion: Detecta la version del browser actual
*
*/


// --------------------------------------------------  Constructor

	var is = new FrmkBrowserSniffer();

	function FrmkBrowserSniffer(){
		var IE;
		var NS;
		var MOZ;
		var isMac;
		var NS4;
		var IEmac;
		var IE4plus;
		var IE4;
		var IE5;
		var IE6;
		var ver4;
		var NS6;
		var IE5plus;
		var IEMajor;
	
		this.MOZ =  (document.getElementById) ? true : false;
		this.isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
		this.NS4 = this.NS = (document.layers) ? true : false;
		this.IEmac = ((document.all)&&(isMac)) ? true : false;
		this.IE4plus = this.IE = (document.all) ? true : false;
		this.IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
		this.IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
		this.IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
		this.ver4 = (NS4 || IE4plus) ? true : false;
		this.NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;
		
		this.IE5plus = IE5 || IE6;
		this.IEMajor = 0;
		
		if (this.IE4plus)
		{
			var start = navigator.appVersion.indexOf("MSIE");
			var end = navigator.appVersion.indexOf(".",start);
			this.IEMajor = parseInt(navigator.appVersion.substring(start+5,end));
			this.IE5plus = (IEMajor>=5) ? true : false;
		}
		
		if (this.MOZ && (this.IE5 || this.IE6 || this.NS6)) {
			this.MOZ = false;
		}
	}




// --------------------------------------------------  Metodos globales

	FrmkBrowserSniffer.prototype.toString = function()
	{
		return  "isMac=" + this.isMac + "\r\n" +
				"IEmac=" + this.IEmac + "\r\n" +
				"IE4plus=" + this.IE4plus + "\r\n" +
				"IE4=" + this.IE4 + "\r\n" +
				"IE5=" + this.IE5 + "\r\n" +
				"IE6=" + this.IE6 + "\r\n" +
				"IE5plus=" + this.IE5plus + "\r\n" +
				"IEMajor=" + this.IEMajor + "\r\n" +
				"ver4=" + this.ver4 + "\r\n" +
			    "NS4=" + this.NS4 + "\r\n" +				
				"NS6=" + this.NS6 + "\r\n" +			    
				"IE=" + this.IE + "\r\n" +
				"NS=" + this.NS + "\r\n" +			
				"MOZ=" + this.MOZ + "\r\n" ;
	}

