

/**
 * Window Open
 */

function openLinks() {
	var w = 660;
	var h = 800;
	var x = (screen.width - w)/2;
	var y = (screen.height - h)/4;
	var subWin = window.open("links.html", "sub", "toolbar=no, location=no, status=no, scrollbars=yes, menubar=no, resizable=yes, width="+w+", height="+h+", left="+x+", top="+y+""); 
	subWin.focus();
}

function openNaruhodo() {
	var w = 660;
	var h = 530;
	var x = (screen.width - w)/2;
	var y = (screen.height - h)/4;
	var subWin = window.open("naruhodo.html", "sub", "toolbar=no, location=no, status=no, scrollbars=yes, menubar=no, resizable=yes, width="+w+", height="+h+", left="+x+", top="+y+""); 
	subWin.focus();
}




/**
 * Set min-width & min-height
 */

function setMinSize() {
	var minW = 1000;
	var minH = 600;
	var ht = document.getElementsByTagName("html")[0];
	var body = document.body;
	var div = document.getElementById("main");
	var windowWidth, windowHeight;
	
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight){
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}
	
	if (windowWidth < minW){
		div.style.width = minW + "px";
	} else {
		div.style.width = '100%';
	}
	
	if (windowHeight < minH){
		div.style.height = minH + "px";
	} else {
		div.style.height = '100%';
	}
	
	
	if (navigator.userAgent.indexOf("MSIE") != -1) {
		ht.style.overflow = "hidden";
			
		if (windowWidth < minW || windowHeight < minH){
			ht.style.overflow = "scroll";
		} else {
			ht.style.overflow = "hidden";
		}
	}
	window.onresize = setMinSize;
};
