/**
 * =============================================================
 *  get_window_size.js
 * =============================================================
 *  @copyright	COPYRIGHT (C) 2009 MdN Corporation., ALL RIGHTS RESERVED.
 *  @version	$Id
 */

function getWindowSize(){
	var width = 0, height = 0;
	var availWidth = 0, availHeight = 0;

	if(document.compatMode == "CSS1Compat"){
		width = document.documentElement.scrollWidth;
		height = document.documentElement.scrollHeight;
		availWidth = document.documentElement.clientWidth;

		if(navigator.userAgent.match(/opera/i)){
			availHeight = window.innerHeight;
		}else{
			availHeight = document.documentElement.clientHeight;
		}
	}else{
		width = document.body.scrollWidth;
		height = document.body.scrollHeight;
		availWidth = document.body.clientWidth;

		if(navigator.userAgent.match(/opera/i)){
			availHeight = document.body.offsetHeight;
		}else{
			availHeight = document.body.clientHeight;
		}
	}

	var windowSize = {
		width: width,
		height: height,
		availWidth: availWidth * 0.98,
		availHeight: availHeight * 0.98
	}

	return windowSize;
}

