/****************************************************
 *
 *	Contains serveral Javasctipt functions
 *
 ****************************************************/
var Util;
Util  = {
	
	/************************************************
	 *
	 *	Returns the width of the inner client window
	 *
	 ************************************************/
	windowWidth: function () {
		var width = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			width = window.innerWidth;
		} else if( document.documentElement && document.documentElement.clientWidth) {
			width = document.documentElement.clientWidth;
		} else if( document.body && document.body.clientWidth) {
			width = document.body.clientWidth;
		}
		return width;
	},

	/************************************************
	 *
	 *	Returns the height of the inner client window
	 *
	 ************************************************/
	windowHeight: function () {
		var height = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			height = window.innerHeight;
		} else if( document.documentElement && document.documentElement.clientHeight) {
			height = document.documentElement.clientHeight;
		} else if( document.body && document.body.clientHeight) {
			height = document.body.clientHeight;
		}
		return height;
	},
	
	/************************************************
	 *
	 *	Returns the width of an element
	 *
	 ************************************************/
	elementWidth: function(ele) {
		var width = 0;
		width = ele.offsetWidth;
		return width;
	},
	
	/************************************************
	 *
	 *	Returns the height of an element
	 *
	 ************************************************/
	elementHeight: function(ele) {
		var height = 0;
		height = ele.offsetHeight;
		return height;
	},
	
	/************************************************
	 *
	 *	Returns the amount Left that the window is
	 *	is scrolled.
	 *
	 ************************************************/
	bodyX: function() {
		var scrollX = 0;
		if(document.body.scrollLeft) {
			scrollX = document.body.scrollLeft;
		} else if(document.documentElement.scrollLeft) {
			scrollX = document.documentElement.scrollLeft;
		}
		return scrollX;
	},
	
	/************************************************
	 *
	 *	Returns the amount down that the window is
	 *	is scrolled.
	 *
	 ************************************************/
	bodyY: function() {
		var scrollY = 0;
		if(document.body.scrollTop) {
			scrollY = document.body.scrollTop;
		} else if(document.documentElement.scrollTop) {
			scrollY = document.documentElement.scrollTop;
		}
		return scrollY;
	}
}
