function movePage() {
    var str = window.location.toString();
    var index = str.lastIndexOf("?");
    if (index != -1) {
        str = str.substring(index+1);
        if (str != "") {
            var e = window.frames["menu"].document.getElementsByTagName("A");
            for (var i = e.length; i--; ) {
                if (e[i].href.indexOf(str) + str.length == e[i].href.length) {
                    window.frames["main"].location.replace(str);
                    return;
                }
            }
            // menuにない
            window.frames["main"].location.replace("sub_index.html");
        }
    }

}

function moveSubPage(obj) {
    var str = obj.href.split("/");
    top.subpageName = str[str.length-1]
    window.frames["main"].location.href='./sub_index.html';
    return false;
}

// ポップアップウィンドウを開く
top.childWindow = new Array();
function openWindow(strUrl, strWinName, width, height, scroll) {
    if (typeof scroll == "undefined") { scroll = "yes"; }
    var openwindow = window.open(strUrl, strWinName, "scrollbars=" + scroll + ", resizable=yes, copyhistory=no, width=" + width + ", height=" + height);
    openwindow.childNum = top.childWindow.length;
    top.childWindow[strWinName] = openwindow;
    return false;
}

// ポップアップウィンドウを閉じる
function popupCheck() {
    for (var i in top.childWindow) {
        try {
            if (!top.childWindow[i].closed) {
                top.childWindow[i].close();
                delete top.childWindow[i];
            }
        } catch(Exception) {
        }
    }
    top.childWindow = new Array();
}

function check() {
    var s = "";
    for (var i in top.childWindow) {
        s += (i + "[" + top.childWindow[i] + "], ");
    }
    return s;
}

