﻿$(document).ready(function () {
    $('#link-festejo').click(function () {
        if ($('#div-festejos').css("display") == "none") {
            $('#div-festejos').fadeIn("slow");
            carcarFestejos();
        } else {
            $('#div-festejos').fadeOut("slow");
        }

        return false;
    });
});

function carcarFestejos() {
    $.ajax({
        url: '/Home/Festejos',
        cache: false,
        type: 'get',
        success: function (data) {
            $('#div-festejos').html(data);
        }
    });
}

function getFestejo(festejoId) {
    var infoFest = "id=" + festejoId;
    $.ajax({
        url: "/Home/Festejo",
        data: infoFest,
        cache: false,
        type: "get",
        success: function (data) {
            $('#div-festejos-festejo-content').html(data);
        }
    });

    return false;
}

function nextCalendar(mes, anio) {
    var datos = "mes=" + mes + "&anio=" + anio;
    $.ajax({
        url: "/Home/Festejos",
        data: datos,
        cache: false,
        type: "get",
        success: function (data) {
            $('#div-festejos').html(data);
        }
    });
    return false;
}
