/*
 * This file is part of HELIOS.CoTV.
 * (c) 2007-2008 Exbridge,inc. <info@exbridge.jp>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * 画面処理のJavaScript
 *
 * @copyright 2008- EXBRIDGE,Inc. All Rights Reserved.
 * @link      http://exbridge.jp/
 * @package   HELIOS.CoTV
 * @version   svn:$Id: waiting.js 1 2009-02-11 23:55:39Z suganuma $
 */

/************************************************************************************
 * 自分以外のリンクオブジェクト、ボタンオブジェクトを無効にする
 ************************************************************************************/
function disabledAll(myself) {
    var linkObj = document.links;
    for (var i=0; i<linkObj.length; i++) {
        if (linkObj[i] != myself) {
            linkObj[i].disabled = true;
        }
    }
    var formsObj = document.forms;
    for (var i=0; i<formsObj.length; i++) {
        var formObj = formsObj[i];
        for (var j=0; j<formObj.length; j++) {
            if (formObj[j] != myself) {
                formObj[j].disabled = true;
            }
        }
    }
}
/************************************************************************************
 * ウィンドウを覆うカーバーの表示
 *
 *
 ************************************************************************************/
function showWindowCover(){
    var tmp_width1  = document.documentElement.scrollWidth;
    var tmp_height1 = document.documentElement.scrollWidth;
    var tmp_width2  = document.body.scrollWidth;
    var tmp_height2 = document.body.scrollWidth;

    var tmp_width = (tmp_width1 > tmp_width2)?tmp_width1:tmp_width2;
    var tmp_height = (tmp_height1 > tmp_height2)?tmp_height1:tmp_height2;

    //firefoxの場合
    if(j$.browser.mozilla){
        tmp_width1  = document.documentElement.clientWidth + window.scrollMaxX;
        tmp_height1 = document.documentElement.clientHeight + window.scrollMaxY ;
        tmp_width2  = document.body.clientWidth + window.scrollMaxX;
        tmp_height2 = document.body.clientWidth + window.scrollMaxX;

        var tmp_width3 = (tmp_width1 > tmp_width2)?tmp_width1:tmp_width2;
        var tmp_height3 = (tmp_height1 > tmp_height2)?tmp_height1:tmp_height2;

        tmp_width = (tmp_width > tmp_width3)?tmp_width:tmp_width3;
        tmp_height = (tmp_height > tmp_height3)?tmp_height:tmp_height3;
    }

    j$("#cover").width(tmp_width);
    j$("#cover").height(tmp_height);

    //画面制御ON
    document.getElementById('cover').style.display = '';
    j$("#cover").fadeTo("normal",0.6);

    //リストボックスのz-index対応
    j$('#cover').bgiframe();
}

/************************************************************************************
 * ウィンドウを覆うカーバーの非表示
 ************************************************************************************/
function hideWindowCover(target_id){
    j$("#cover").fadeTo("normal",0);
    j$("#cover").hide();
}

/************************************************************************************
 * ウィンドウを覆う待ち画面の表示
 ************************************************************************************/
function showWaiing(){
    var I_BC_03 = "処理中です。しばらくお待ちください。";

    //coverを表示
    showWindowCover();

    //待ち情報を表示
    j$("#waiting").show();
    j$("#waiting").html(I_BC_03);
}

/************************************************************************************
 * ウィンドウを覆う待ち画面の非表示
 ************************************************************************************/
function hideWaiing(){
    //処理中ラベルを表示
    hideWindowCover();

    //待ち情報を非表示
    j$("#waiting").hide();
}


