$(function() {

    $("#carousel").jcarousel({
        vertical: true,
        auto: 2,
        animation: 'slow',
        visible: 1,
        scroll: 1,
        wrap: 'circular'
    });

    // Scroll news
    // Cuando es español se muestra solo una noticia.
    /*
    if(lng == 'ES') {
        $(".newsticker").jCarouselLite({
                vertical: true,
                hoverPause: true,
                visible: 1,
                auto: 2000,
                speed: 500
        });
        $(".newsticker li").css({
            overflow: "visible",
            height: "28px",
            fontSize: "12px"
        })
    // En ingles se muestran dos noticias
    } else {
        $(".newsticker").jCarouselLite({
                vertical: true,
                hoverPause: true,
                visible: 2,
                auto: 2000,
                speed: 500
        });
        $(".newsticker li").css({
            overflow: "hidden"
        })
    }*/
    
    // Llamada a las funciones live
    liveTransactions();
    liveSpeed();
    setInterval("liveTransactions()",3000);
    setInterval("liveSpeed()",3000);

});

// Llamada a https://dashboard.get2d.com/transactions.php
function liveTransactions(){
    $.get("transactions.php", function(data) {
        $("#live-vouchers").html(data);
    });
}

// llamada a https://dashboard.get2d.com/speed.php
function liveSpeed(){
    $.get("speed.php", function(data) {
        $("#live-speed").html(data);
    });
}

