/**
 * Set min-width & min-height
 */
function setMinSize(id,minW,minH) {
var html = document.getElementsByTagName("html")[0];
var body = document.body;
var div = document.getElementById(id);
var windowWidth, windowHeight;
html.style.height = "100%";
body.style.height = "100%";
body.style.margin = "0";
body.style.padding = "0";
div.style.height = "100%";

function onset() {
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) {
html.style.overflow = "hidden";

if (windowWidth < minW || windowHeight < minH){
html.style.overflow = "scroll";
} else {
html.style.overflow = "hidden";
}
}
}
onset();
window.onresize = onset;
};


/**
 * Window Open
 */
function openWin(url,name,w,h) {
var x = (screen.width - w)/2;
var y = (screen.height - h)/4;
var subWin = window.open(url, name, "menubar=yes ,toolbar=yes, location=yes, status=no, scrollbars=yes, resizable=yes, width="+w+", height="+h+", left="+x+", top="+y+"");

if(subWin){
subWin.focus();
return true;
}else{
alert("ポップアップブロックです");
return false;
}
}

