/**
 * 共通画面用javascript
 *
 * @package JKX
 * @author TAKEMOTO.
 * @copyright All Rights Reserved Copyright(c) FUJITSU LIMITED 2008
 */
var Common =
{
    /**
     * 共通完了画面から次画面へ
    */

    redirectUrl: function(url)
    {
        location.href = url;
    },

    /**
     * ライブラリを開く
     **/
    librarydisplay: function (file)
    {
        var f = document.libraryForm;

        with (f) {
            action = '/common/display';
            filename.value = file;
            method = 'post';
            target = '_self';
            lib_flag.value = 'lib_html';
            submit();
        }
    },

    /**
     * ライブラリのオプションを開く
     **/
    libraryoptiondisplay: function ()
    {
        var f = document.libraryForm;
        var obj = document.getElementById('selectBox');
        var file = obj[obj.selectedIndex].value;
        if (file) {
            if (file.substr(0,1) != "#") {
                with (f) {
                    action = '/common/display';
                    filename.value = file;
                    method = 'post';
                    target = '_self';
                    lib_flag.value = 'lib_html';
                    submit();
                }
            } else {
                location.href = file;
            }
        }
    },

    /**
     * ボタンをDisableにする
     **/
    btnDisable: function (obj)
    {
        obj.disabled = true;
    },

    /**
     * すべてのボタンをDisableにする
     **/
    btnDisableAll: function (fForm)
    {
        len = fForm.elements.length;
        for (i=0; i<len; i++)
            if(fForm.elements[i].type == 'button')
                fForm.elements[i].disabled = true;
    }
}
