Browser = {
	GetAgent: function(){
		return navigator.userAgent.toLowerCase();
		
	},

	IsMac: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return !!agent.match(/mac/i);
	},

	IsWin: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return !!agent.match(/win/i);
	},

	IsWin2k: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return this.IsWin(agent)&&(agent.match(/nt\s*5/i));
	},

	IsWinVista: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return this.IsWin(agent)&&(agent.match(/nt\s*6/i));
	},
		
	IsWebKit: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return !!agent.match(/AppleWebKit/i);
	},

	IsOpera: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return !!agent.match(/opera/i);
	},

	IsIE: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return !!agent.match(/msie/i);
	},

	IsIEStrict: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return agent.match(/msie/i)&&!this.IsOpera(agent);
	},

	IsFirefox: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return !!agent.match(/firefox/i);
	},

	IsiPhone: function(iAgent){
		var agent=iAgent||this.GetAgent();
		return this.IsWebKit(agent)&&agent.match(/Mobile/i);
	},

	SiteRoot: function() {
		var scriptPath=$A(document.getElementsByTagName("script")).findAll( function(s) {
			return (s.src && s.src.match(/\/js\/lib\/common\.js(\?.*)?$/))
		});
		if(scriptPath.length > 0) {
			return scriptPath[0].src.replace(/\/js\/lib\/common\.js(\?.*)?$/,'');
		}
		return '';
	}
	
	// don't place a comma after the last one, IE6 won't like it
};

