var Browser = function() { this.init() };
Browser.getInstance = function() {
	if( !Browser.instance ) { Browser.instance = new Browser(); }
	return Browser.instance;
};
Browser.prototype = {
	init: function() {
		var ua = navigator.userAgent.toLowerCase(),
			is = function(t) { return ua.indexOf(t) != -1; };
		this.name = (!(/opera|webtv/i.test(ua)) && /msie (\d)/.test(ua)) ? ((is('mac') ? 'ieMac ' : '') + 'ie ie' + RegExp.$1)
				: is('gecko/') ? 'gecko' : is('opera') ? 'opera' : is('konqueror') ? 'konqueror' : is('applewebkit/') ? 'webkit safari' : is('mozilla/') ? 'gecko' : '';
		this.os = (is('x11') || is('linux')) ? 'linux' : is('mac') ? 'mac' : is('win') ? 'win' : '';
	},
	addClasses: function () {
		var c = this.name+' '+this.os;
		var h = document.getElementsByTagName('html')[0];
		h.className += h.className?' '+c:c;
	}
};
