//FUNCIONES COMUNES

//Para noticias Agenda y Actualidad
/*function mostrarFecha(fecha, seccion){
	if(seccion==21 && fecha != ''){
		document.write('<span class="fecha1">' + fecha + '</span>');
	}
}
function mostrarEvento(fecha, seccion){
	if(seccion==19 && fecha != ''){
		document.write('<span class="fecha2">' + fecha + '</span>');
	}
}*/

//Para validación
function Blancos(Cadena){
	if (Cadena.split(" ").join("").length == 0)
		return true;
	else
		return false;
}

//General
function nuevoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

//Acordeon
	
window.addEvent('load', function()
{
		new Accordion('#asociaciones h3.titulo', '#asociaciones div.informacion',
		{
			//Para poder cerrar los elementos que se abren
			alwaysHide: true,
			start: 'all-closed',
			//Cuando se abre, agregamos la clase 'seleccionado' al titulo
			onActive: function(titulo, informacion)
			{
				titulo.addClass('seleccionado');
			},
			//Cuando se cierra, quitamos la clase 'seleccionado' del titulo
			onBackground: function(titulo, informacion)
			{
				titulo.removeClass('seleccionado');
			}
		});
		new Accordion('#asesoria h3.titulo', '#asesoria div.informacion',
		{
			//Para poder cerrar los elementos que se abren
			alwaysHide: true,
			start: 'all-closed',
			//Cuando se abre, agregamos la clase 'seleccionado' al titulo
			onActive: function(titulo, informacion)
			{
				titulo.addClass('seleccionado');
			},
			//Cuando se cierra, quitamos la clase 'seleccionado' del titulo
			onBackground: function(titulo, informacion)
			{
				titulo.removeClass('seleccionado');
			}
		});
});

