var sliderHome;

$(document).ready(function () {
    $(".noticia-fecha").each(function () {
        $(this).html(moment($(this).html(), "YYYY-MM-DD h:mm:ss").format("dddd, d [de] MMMM YYYY"));
    });
    
    
    $('#sliderNews').bxSlider({
        mode: 'horizontal',
        pagerCustom : '#home-noticias-pager',
        auto:true,
        pause:6000
      });
      
    $("#imgVideoHome").click(function () {
        $("#modalVideoHome").modal();
        $("#modalVideoHome iframe").attr("src", "https://www.youtube.com/embed/eCa8HGRMVFg?autoplay=1&rel=0");
    });

    $('#modalVideoHome').on('hidden.bs.modal', function () {
        $('#modalVideoHome iframe').removeAttr('src');
    });

    sliderHome = $('#sliderHome').bxSlider({
        mode: 'horizontal',
        auto: true,
        pagerCustom: '#bx-pager',
        pause: 6000
    });

    $(".page-arrow-prev").click(function () {
        sliderHome.goToPrevSlide();
        return false;
    });

    $(".page-arrow-next").click(function () {
        sliderHome.goToNextSlide();
        return false;
    });

});