function clickSeta(bolPositivo, strPrefixo, delay) {
    i = 0;
    iQtd = 0;
    iIndice = 0;

    while (true) {
        if (i < 10)
            objImg = window.document.getElementById(strPrefixo + "0" + i.toString() + "_imgAlbum");
        else
            objImg = window.document.getElementById(strPrefixo + i.toString() + "_imgAlbum");
            
        if (objImg == null) {
            break;
        }
        else {
            iQtd += 1;
        }
        i += 1;
    }

    if (iQtd > 0) {
        var arrImg = new Array(iQtd - 1)
        var arrImgDestino = new Array(iQtd - 1)
        i = 0;
        while (true) {
            if (i < 10)
                objImg = window.document.getElementById(strPrefixo + "0" + i.toString() + "_imgAlbum");
            else
                objImg = window.document.getElementById(strPrefixo + i.toString() + "_imgAlbum");

            if (objImg == null) {
                break;
            }
            else {
                arrImg[i] = objImg.style.visibility;
                arrImgDestino[i] = objImg.style.visibility;
            }
            i += 1;
        }

        iQtd -= 1;
        for (z = 0; z < arrImg.length; z++) {
            if (arrImg[z] == 'visible') {
                if (bolPositivo) {
                    iIndice = z + 1;
                }
                else {
                    iIndice = z - 1;
                }

                if (iIndice > iQtd) {
                    iIndice = z - (iQtd);
                }
                else if (iIndice < 0) {
                    iIndice = iQtd - z;
                }
                arrImgDestino[iIndice] = 'OK';
            }
        }

        for (z = 0; z < arrImgDestino.length; z++) {
            if (z < 10)
                objImg = window.document.getElementById(strPrefixo + "0" + z.toString() + "_imgAlbum");
            else
                objImg = window.document.getElementById(strPrefixo + z.toString() + "_imgAlbum");
            
            if (objImg != null) {
                if (arrImgDestino[z] == 'OK') {
                    objImg.style.visibility = 'visible';
                    objImg.style.display = 'inline';
                }
                else {
                    objImg.style.visibility = 'hidden';
                    objImg.style.display = 'none';
                }
            }
        }

        try {
            if (timer != null) {
                clearTimeout(timer);
            }
        }
        catch (e) {
            timer = null;
        }

        timer = setTimeout("clickSeta(true,'" + strPrefixo + "'," + delay + ")", delay);
    }
}


function mediaBoxClick(iIndiceParam, strPrefixo, delay) {
    i = 0;
    iQtd = 0;
    iIndice = 0;

    while (true) {
        objImg = window.document.getElementById(strPrefixo + i.toString() + "_divMediaBoxItem");
        if (objImg == null) {
            break;
        }
        else {
            iQtd += 1;
        }
        i += 1;
    }

    if (iQtd > 0) {
        var arrImg = new Array(iQtd - 1)
        var arrImgDestino = new Array(iQtd - 1)
        i = 0;
        while (true) {
            objImg = window.document.getElementById(strPrefixo + i.toString() + "_divMediaBoxItem");
            if (objImg == null) {
                break;
            }
            else {
                arrImg[i] = objImg.style.visibility;
                arrImgDestino[i] = objImg.style.visibility;
            }
            i += 1;
        }

        iQtd -= 1;
        if (iIndiceParam == 0) {
            for (z = 0; z < arrImg.length; z++) {
                if (arrImg[z] == 'visible') {
                    iIndice = z + 1;

                    if (iIndice > iQtd) {
                        iIndice = z - (iQtd);
                    }
                    arrImgDestino[iIndice] = 'OK';
                }

            }
        }
        else {
            arrImgDestino[iIndiceParam - 1] = 'OK';
        }
        for (z = 0; z < arrImgDestino.length; z++) {

            objImg = window.document.getElementById(strPrefixo + z.toString() + "_divMediaBoxItem");
            if (objImg != null) {
                if (arrImgDestino[z] == 'OK') {
                    objImg.style.visibility = 'visible';
                    objImg.style.display = 'inline';
                }
                else {
                    objImg.style.visibility = 'hidden';
                    objImg.style.display = 'none';
                }
            }
        }

        try {
            if (timerMediaBox != null) {
                clearTimeout(timerMediaBox);
            }
        }
        catch (e) {
            timerMediaBox = null;
        }
        timerMediaBox = setTimeout("mediaBoxClick(0,'" + strPrefixo + "'," + delay + ")", delay);
    }
}
