/// detect a special case of "web browser"
var Browser = {
	init: function () {
		this.agt=navigator.userAgent.toLowerCase();
		this.is_major = parseInt(navigator.appVersion);
		this.is_minor = parseFloat(navigator.appVersion);

		this.is_ie = ( /msie/i.test(navigator.userAgent) &&
		   !/opera/i.test(navigator.userAgent) );

		this.is_ie3    = (this.is_ie && (this.is_major < 4));
		this.is_ie4    = (this.is_ie && (this.is_major == 4) && (this.agt.indexOf("msie 4")!=-1) );
		this.is_ie4up  = (this.is_ie && (this.is_major >= 4));
		this.is_ie5    = (this.is_ie && (this.is_major == 4) && (this.agt.indexOf("msie 5.0")!=-1) );
		this.is_ie5_5  = (this.is_ie && (this.is_major == 4) && (this.agt.indexOf("msie 5.5") !=-1));
		this.is_ie5up  = (this.is_ie && !this.is_ie3 && !this.is_ie4);
		this.is_ie5_5up =(this.is_ie && !this.is_ie3 && !this.is_ie4 && !this.is_ie5);
		this.is_ie6    = (this.is_ie && (this.is_major == 4) && (this.agt.indexOf("msie 6.")!=-1) );
		this.is_ie6up  = (this.is_ie && !this.is_ie3 && !this.is_ie4 && !this.is_ie5 && !this.is_ie5_5);
		this.is_ie7    = (this.is_ie && (this.agt.indexOf("msie 7.")!=-1) );
		this.is_ie7up  = (this.is_ie && !this.is_ie3 && !this.is_ie4 && !this.is_ie5 && !this.is_ie5_5 && !this.is_ie6);
		this.is_ie8    = (this.is_ie && (this.agt.indexOf("msie 8.")!=-1) );
		this.is_ie8up  = (this.is_ie && !this.is_ie3 && !this.is_ie4 && !this.is_ie5 && !this.is_ie5_5 && !this.is_ie6 && !this.is_ie7);

		/// detect Opera browser
		this.is_opera = /opera/i.test(navigator.userAgent);

		/// detect Gecko browser
		this.is_gecko = /gecko/i.test(navigator.userAgent);

		/// detect KHTML-based browsers
		this.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
	}
};
Browser.init();
