var minWidth = 980;
var minHeight = 620;

function checkWindow(){
	
	var size = getCurrentSize();
	var w = document.getElementById("divx");
	
	w.style.width = (size.w > minWidth) ? "100%" : minWidth + "px";
	w.style.height = (size.h > minHeight) ? "100%": minHeight + "px";
	
}

function getCurrentSize(){

	var _obj = new Object();

	if(window.innerHeight){
		_obj.w = window.innerWidth;
		_obj.h = window.innerHeight;

	} else if (document.all && document.getElementById && (document.compatMode=='CSS1Compat')) {
		_obj.w = window.clientWidth;
		_obj.h = document.documentElement.clientHeight;

	} else if(document.body.clientHeight){
		_obj.w = document.body.clientWidth;
		_obj.h = document.body.clientHeight;

	} else {
		_obj.w = 0;
		_obj.h = 0;
	}

	return _obj;

}
