    var txt_obj = {};
    var toggle_switch = {};
    var cookie_switch = {};

    // cookie の値
    var cookie_text = unescape(getCookie("toggle_switch"));
    if (cookie_text) {
        cookie_switch = JSON.parse(cookie_text);
    } else {
        cookie_switch = null;
    }

    // 初期情報を取得
    function set_elem(id, default_switch) {
        txt_obj[id] = document.getElementById(id);

        // 初期状態を設定
        if ( default_switch ) {
            toggle_switch[id] = default_switch;
        } else {
            toggle_switch[id] = "off";
        }

        // cookie があればそちらを優先
        if ( cookie_switch ) {
            if ( cookie_switch[id] ) {
                toggle_switch[id] = cookie_switch[id];
                toggle(id, cookie_switch[id]);
            }
        }

    }

    // ボタン処理
    function toggle(id, force) {
        if (force == "on" || (toggle_switch[id] == "off" && !force)) {
            txt_obj[id].style.display = "inline";
            toggle_switch[id] = "on";
        } else if ( force == "off" || (toggle_switch[id] == "on" && !force)) {
            txt_obj[id].style.display = "none";
            toggle_switch[id] = "off";
        }

        // cookie をセット
        if (!force) {
            setCookie("toggle_switch", escape(JSON.stringify(toggle_switch)));
        }
        window.focus();
    }