if (window.addEventListener) {
	window.addEventListener("load",setDiv, false);
	window.addEventListener("resize",setDiv, false);
} else if(window.attachEvent) {
	window.attachEvent("onload",setDiv);
	window.attachEvent("onresize",setDiv);
} else {
	window.onload=setDiv();
	window.onresize=setDiv();
}
function setDiv(){
	checkDiv(false);
}
function checkDiv(checkedagain){
	if (typeof(window.innerHeight) == 'number') {
		win_height = window.innerHeight;
		win_width = window.innerWidth;
	}	else if (document.documentElement && document.documentElement.clientHeight) {
		win_height = document.documentElement.clientHeight;
		win_width = document.documentElement.clientWidth;
	}	else if (document.body && document.body.clientHeight) {
		win_height = document.body.clientHeight;
		win_width = document.body.clientWidth;
	}
	if (document.all) {
		doc_height = document.body.offsetHeight;
		doc_width = document.getElementById('container').offsetHeight;
	} else if (document.layers) {
		doc_height = document.body.document.height;
		doc_width = document.getElementById('container').height;
	} else {
		doc_height = document.body.offsetHeight;
		doc_width = document.getElementById('container').offsetHeight;
	}
	if(win_width<1000){
		document.body.style.width = "1000px";
		document.getElementById('container').style.width = "1000px";
	} else {
		document.body.style.width = "auto";
		document.getElementById('container').style.width = "auto";
	}
	if(!checkedagain){
		checkDiv(true);
	}
}
