//Aqui cambia el numero de filas que quieras en los EVENTOS (Agenda)
var filaseventos = 2;
var AGENDA = "POSGRADOUV";

// Esperamos que se cargue el documento y llamamos a $.ajax();
$(document).ready(function()
{
	/* Se carga el panel de agenda de eventos */
	$.ajax(
	{
		type: "GET",
        url: "/noticiasuv/PrincipalEventosIzq.aspx",
		contentType: "charset=ISO-8859-1",
		data: "IDAGENDA=" + AGENDA + "&filas=" + filaseventos + "&url=agenda&ms="+new Date().getTime(),
        success: function(datos)
		{
        	$("#agendauv").hide();
			$("#agendauv").html(datos);
			$("#agendauv").fadeIn(500);
        },
		error: function(obj1, e, obj2)
		{
			//alert("No se pudo cargar el calendario.\n\nIntentelo nuevamente recargando la página.");
			CambiaMes();
		}
	});
	/* Termina el panel de agenda de eventos */
});

/*Función para cambiar el mes del calendario*/
function CambiaMes( url )
{
	$.ajax(
	{
        type: "GET",
        url: "/noticiasuv/PrincipalEventosIzq.aspx",
	contentType: "charset=ISO-8859-1",
        data: url + "&IDAGENDA=" + AGENDA + "&filas=" + filaseventos + "&url=agenda&ms="+new Date().getTime(),
		
        success: function(datos)
		{        	
			$("#agendauv").hide();
			$("#agendauv").html(datos);
			$("#agendauv").fadeIn(500);
        },
		error: function(obj1, e, obj2)
		{
			//alert("Se produjo un error : "+ e);
			CambiaMes();
		}
	});
}
/*Función para abrir un evento seleccionado */
function abredetalles( idevento, f, b )
{
	if( b != null )
		window.open("agenda/detalles.php?eventoid=" + idevento + "&fecha=" + f + "&busca=" + b,"evento" + idevento,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=700");
	else
		window.open("agenda/detalles.php?eventoid=" + idevento + "&fecha=" + f,"evento" + idevento,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=700");
}
