var Util = {
	/**
	 * Get the width, height of current browser.
	 * @return {object} dimensions = { width, height }
	 */
	getBrowserSizeForReader : function() {
		//showWH();
		// Default settings for dimensions.
		var dimensions = {
			width : 1024,
			height : 768
		}

		// Netscape settings.	
		if (parseInt(navigator.appVersion) > 3) {
			if (navigator.appName == "Netscape") {
				dimensions.width =  window.outerWidth;
				dimensions.height = window.outerHeight;
				//alert('outerWidth' + dimensions.width +" , height" + dimensions.height);
			}
		}

		// IE settings.
		if (navigator.appName.indexOf("Microsoft") != -1) {
			
				cW=document.body.offsetWidth;
				cH=document.body.offsetHeight;
				window.resizeTo(dimensions.width,dimensions.height);
				barsW=Util.getScreenResolution().width-document.body.offsetWidth;
				barsH=Util.getScreenResolution().height-document.body.offsetHeight;
				wW=barsW+cW;
				wH=barsH+cH;
				
			    dimensions.width = wW;
			    dimensions.height = wH;		
			    //alert('IE outerWidth' + dimensions.width +" , height" + dimensions.height);
		}

		
		return dimensions;		
	},

 
 	/**
	 * Get the width, height of current browser.
	 * @return {object} dimensions = { width, height }
	 */
	getBrowserSize : function() {
		// Default settings for dimensions.
		var dimensions = {
			width : 1024,
			height : 768
		}

		// Netscape settings.	
		if (parseInt(navigator.appVersion) > 3) {
			if (navigator.appName == "Netscape") {
				dimensions.width = window.innerWidth;
				dimensions.height = window.innerHeight;
			}
		}

		// IE settings.
		if (navigator.appName.indexOf("Microsoft") != -1) {
			if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
				dimensions.width = document.documentElement.clientWidth;
				dimensions.height = document.documentElement.clientHeight;
			}
			
			else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
			    dimensions.width = document.body.clientWidth;
			    dimensions.height = document.body.clientHeight;			
			}
		}

		return dimensions;		
	},
	/**
	 * Get screen resolution.
	 * @return {object} dimensions = { width, height }
	 */ 
	 
	getScreenResolution : function() {
		var dimensions = {
			width : 1024,
			height : 768
		}
		
		// Check if the screen property even exists before getting the width and height.
		if (screen && screen.width > 0 && screen.height > 0) {
			dimensions.width = screen.availWidth;
			dimensions.height = screen.availHeight;
		}
		
		return dimensions;
	}	
}



