function cargarEventos(dia,exacto) {
    $("#cargando_eventos").show();
    $("#lista_eventos").hide();
    $.ajax({
        url:'./includes/modules/index/eventos.php',
        data:{
            dia: dia,
            exacto: exacto,
            limit: 2
        },
        async:false,
        type: 'post',
        dataType: 'json',
        error: function(a,b,c) {
            Sexy.error("1Hubo un error al obtener los eventos de la base de datos.");
            $("#cargando_eventos").hide();
            $("#lista_eventos").show();
        },
        success: function(data) {
            if (data.error == 1 && exacto == "true") {
                Sexy.error(data.mensaje);
            } else if (data.error == 1) {
                return false;
            } else {
                var text = '';
                for (i = 0; i < data.eventos.length; i++) {

                    text = text + '<div class="evento_arriba">';
                    text = text + '<div class="dia">' + data.eventos[i].dia + '</div>';
                    text = text + '<div class="mes">' + data.eventos[i].mes + '</div>';
                    text = text + '<div class="titulo">' + data.eventos[i].titulo + '</div>';
                    text = text + '</div>';

                    text = text + '<div class="evento_cuerpo">';
                    text = text + '<div class="cuerpo">' + data.eventos[i].cuerpo + '</div>';
                    text = text + '<div class="mas_info" rel="' + data.eventos[i].id + '" ><img src="'+ ruta + 'masinfo.jpg" alt="M&aacute;s informaci&oacute;n"></div>';
                    text = text + '</div>';

                    text = text + '<div class="evento_abajo"></div>';
                }
              
                $("#lista_eventos").html(text);
                $("#cargando_eventos").hide();
                $("#lista_eventos").show();
                 ajustareventos();
                 ajustar_v2('portal_cuerpo_principal_contenido');
            }
        }
    });
}

$(document).ready(function(){
    $(".evento_cuerpo .mas_info").live('click',function(){
        var id = $(this).attr('rel');
		location.href="agenda.php?evento_id="+id;
    });
	
	$("#titulo_contenido").text('Noticias');
});
