//
//Author: Matt Frazee
//Copyright 2010
//
var Client = {
	viewportWidth: function() {
		return self.innerWidth || (document.documentElement.clientWidth || document.body.clientWidth);
	},
	viewportHeight: function() {
		return self.innerHeight || (document.documentElement.clientHeight || document.body.clientHeight);
	},
	viewportSize: function() {
		return { width: this.viewportWidth(), height: this.viewportHeight() };
	},
	webpageHeight: function() {
		return (Client.viewportHeight()>document.body.parentNode.scrollHeight)?Client.viewportHeight():document.body.parentNode.scrollHeight;
	},
	isIE: function() {
		if(navigator.userAgent.indexOf("MSIE")!=-1){
			return true;
		}
		return false;
	},
	browerName: function() {
		if(navigator.userAgent.indexOf("Chrome")!=-1){
			return 'Chrome';
		}
		if(navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1){
			return 'Safari';
		}
		if(navigator.userAgent.indexOf("MSIE")!=-1){
			return 'MSIE';
		}
		if(navigator.userAgent.indexOf("Firefox")!=-1){
			return 'Firefox';
		}
		if(navigator.userAgent.indexOf("Opera")!=-1){
			return 'Opera';
		}
	},
	hasWebkit: function(){
		if(navigator.userAgent.indexOf("AppleWebKit")!=-1){
			return true;
		}
		return false;
	},
	isMobile: function(){
		if(navigator.userAgent.indexOf("iPod")!=-1||navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPhone")!=-1||navigator.userAgent.indexOf("Android")!=-1||navigator.userAgent.indexOf("Blackberry")!=-1){
			return true;
		}
		return false;
	}
};
