var conHeight;
function init() {
	var obj = document.getElementById("backimg");
	var obj3 = document.getElementById("naviSet").offsetHeight;
	var obj6 = document.getElementById("contents").offsetHeight + 20;
	var obj9 = document.getElementById("dummy");
	if(conType == "bottom"){
		obj9.style.marginBottom = -obj6 + "px";
		obj9.style.height = "100%";
		obj9.style.minHeight = obj6 + "px";
	}
	if(conType == "center"){
		obj9.style.marginBottom = -obj6/2 + "px";
		obj9.style.height = "50%";
		obj9.style.minHeight = obj6/2 + "px";
	}
	if(obj3 > obj6) {
		conHeight = obj3;
	} else {
		conHeight = obj6;
	}
	var obj4 = document.getElementById("dummy2");
	obj4.style.height = conHeight + "px";
	fit();

}
function fot() {
	setTimeout(function(){
		var obj3 = document.getElementById("naviSet").offsetHeight;
		var obj6 = document.getElementById("contents").offsetHeight + 20;
		if(obj3 > obj6) {
			conHeight = obj3;
		} else {
			conHeight = obj6;
		}
		var obj4 = document.getElementById("dummy2");
		obj4.style.height = conHeight + "px";
	},600);
}
function fit() {
	var isWin9X = (navigator.appVersion.toLowerCase().indexOf('windows 98')+1);
	var isIE = (navigator.appName.toLowerCase().indexOf('internet explorer')+1?1:0);
	var isOpera = (navigator.userAgent.toLowerCase().indexOf('opera')+1?1:0);
	if (isOpera) isIE = false;
	var isSafari = (navigator.appVersion.toLowerCase().indexOf('safari')+1?1:0);

	var obj = document.getElementById("backimg");
	var obj2 = document.getElementById("navigation");
	var navHeight = obj2.offsetHeight;

	if (!isSafari && !isOpera) {
		winWidth = document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth;
		winHeight = document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight;
	} else {
		winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}

	var obj5 = document.getElementById("footer");
	obj5.style.width = winWidth - 20 + "px";

	if(winWidth > winHeight){
			obj.style.width = winWidth + "px";
			obj.style.height = "auto";
	}
	if(winWidth < winHeight){
			obj.style.width = "auto";
			obj.style.height = winHeight + "px";
	}
	if(winHeight > navHeight){
		obj2.style.height = winHeight + "px";
	}
	
	var navHeight = obj2.offsetHeight;
	if(conHeight < navHeight){
		obj2.style.height = winHeight + "px";
	} else{
		obj2.style.height = conHeight + "px";
	}
	var obj7 = document.getElementById("container");
	var obj8 = document.getElementById("pageBottom");
	if (typeof document.documentElement.style.maxHeight == "undefined") {
		 obj8.style.top = -obj7.scrollTop;
	}
}

window.onresize = fit;
