
//vai mostrar os itens
//qtdShow - Quantidade que vai mostrar
//largura - largura de cada item
//larguraEspaco - largura de um item para o outro
function showSlide2(qtdShow, largura, larguraEspaco) {
    for(i = 1; (document.getElementById("item" + i) != null && i <= qtdShow); i++) {
        document.getElementById("item" + i).style.left = ((i - 1) * largura) + larguraEspaco + "px";
        document.getElementById("item" + i).style.display = 'block';
    }
}

function proximoSlide2(qtdShow) {
    var idProximo = new Array();
    var idAnterior = new Array();

    //uso temporario
    var tmp = 0;

    //vou pegar o proximo item
    for(i = 1; (document.getElementById("item" + i) != null && tmp < qtdShow); i++) {
        if(document.getElementById("item" + i).style.display == 'none') {
            idProximo[tmp] = i;
            tmp++;
        }
    }

    //se não tiver mais item na lista para ser mostrado
    //vai pegar o inicio e colocar no final
    if(idProximo.length < qtdShow) {
        for(i = 1; (document.getElementById("item" + i) != null && tmp < qtdShow); i++) {
            idProximo[tmp] = i;
            tmp++;
        }
    }

    //para não termos problemas
    tmp = 0;

    //vou pegar os anteriores que serão substituidos
    //vou pegar o proximo item
    for(i = 1; (document.getElementById("item" + i) != null && tmp < qtdShow); i++) {
        if(document.getElementById("item" + i).style.display == 'block') {
            idAnterior[tmp] = i;
            tmp++;
        }
    }

    //vou substituir alterar as popriedades dos dois vetores
    for(i = 0; i <= idProximo.length; i++) {
        document.getElementById("item" + idProximo[i]).style.left = document.getElementById("item" + idAnterior[i]).style.left;
        document.getElementById("item" + idAnterior[i]).style.display = 'none';
        document.getElementById("item" + idProximo[i]).style.display = 'block';
    }

}
