var noticias = new Array();

$(document).ready(function() {
    
    $('#BtnAnt').click(function() {

        if( $("#newsCurrent").html() > 1 )
        {
            $("#newsCurrent").html( ($("#newsCurrent").html()*1) - 1 );

            showNews();
        }

    });
    
    $('#BtnSeg').click(function() {

        if( $("#newsCurrent").html() < $("#newsTotal").html() )
        {
            $("#newsCurrent").html( ($("#newsCurrent").html()*1) + 1 );

            showNews();
        }

    });
    
    
    if( noticias.length > 0 )
    {
        $("#newsCurrent").html("1");
        $("#newsTotal").html( noticias.length );
        
        showNews();
    }
    else
    {
        $("#newsCurrent").html("0");
        $("#newsTotal").html("0");
    }
});

function showNews()
{
    for(index = 0; index < noticias.length; index ++ )
    {
        $("#actualidad_" + noticias[index] ).hide();
    }
    
    $("#actualidad_" + noticias[ $("#newsCurrent").html() - 1 ]).show();
}
