function grayFirstItem(b) {
    var list = new Array();
    list.push('headerItem_path');
    //list.push('headerItem_circle');
    list.push('headerItem_img');
    for (i = 0; i < list.length; i++) {
        var item = document.getElementById(list[i]);
        item.classList.add(list[i]);
        if (b) {
            item.classList.add('gray');
        } else {
            item.classList.remove('gray');
        }
    }

    var hItem = document.getElementById('headerItem_img');
    hItem.style.cursor = (b ? 'pointer' : 'none');
}
function resetFirstHeaderItem() {
    var hItem = document.getElementById('headerItem_img');
    if (g_onlyHtmlDebug) {
        hItem.setAttribute('src', "./image/1.png");
    } else {
        hItem.setAttribute('src', parent.dataFromMain('firstHeaderItem'));
    }
}
function onHeaderItemClick(obj) {
    if (obj) {
        pasueAnimation(obj, false);
        switchAlbum(g_item_id_all);
        resetSecondHeader(g_item_id_all, g_item_id_all);
        showMoveFrame(true);
    }
}
function firstHeaderItemClick(obj) {
    if (g_current_album == g_item_id_all) return;
    if (!obj.classList.contains('gray')) return;
    onHeaderItemClick(g_itemMovment);
}
function checkallClicked() {
    var obj = document.getElementById('selectAllBox');
    var b = checkboxClickTest(window.event);
    if (b && !g_onlyHtmlDebug) {
        parent.jsAction('checkItem', g_current_album, g_item_id_all, !obj.checked);
        obj.checked = !obj.checked;
        setTimeout(function () {
            parent.jsAction('updateChildrenCheckState', g_current_album);
        }, 20);
    }
}

function onPreviewBtnClicked() {
    //g_btnPreviewClicked = true;
    if (!g_isLoaded) {
        return;
    }
    var cnt = document.getElementById('header_cnt');
    showItem(cnt, false);
    var headerFrm = document.getElementById('item_frame_second');
    //pasueAnimation(headerFrm, false);
    showItem(headerFrm, false);
    //var list = document.getElementsByClassName('main');
    //for (i = 0; i < list.length; i++) {
    //    var obj = list[i];
    //    pasueAnimation(obj, false);
    //}
    startPreviewAnimation(false, window.event);
}