

window.onload = function() {
 	ReseteaMenu();	
	
	cargarCabecera ('.includes/menuSuperior.php','HeaderTop', false);	
	
	cargarContenido ('.nw/nw.php','MiddleRight', true);
	IniciaLiza();
}


function cierraNews () {
	//alert('cerrando');
	//document.getElementById("FooterText").style.visibility = 'hidden';
	cargarContenido ('.includes/infoFidas.html','MiddleRight');
}

function cierraNW () {
	//alert('cerrando');
	document.getElementById("FooterText").style.visibility = 'hidden';
	cargarContenido ('.nw/nw.php','MiddleRight', true);
}

function IniciaLiza() {
	
	if (bt = document.getElementById("btCerrar")) {
		bt.onclick = cierraNews;
	}
	if (bt = document.getElementById("btCerrarNW")) {
		bt.onclick = cierraNW;
	}
	
	if (bt = document.getElementById("btCustonNW")) {
		bt.onclick = CustonNW;
	}
	
	
	var capas = document.getElementById("Noticias");
	if   (capas)      {
		var opciones = capas.getElementsByTagName("div");
		
		for (var i=0; i<opciones.length; i++) {
			div = opciones[i];
			
			if (div.id != "") {
					//div.onmouseover = overCurso;
				//div.onmouseout = outCurso;
				div.onclick = clickNW;
				
			}		
		}	
	}
	preparaThickbox();
	redimensiona();
	

}

function clickNW() {
	document.getElementById("FooterText").style.visibility = 'hidden';
	cargarContenido ('.nw/nw.php?Id='+this.id,'MiddleRight', true);
	//cargarContenido ('curso.php?Id='+this.id,'Contenido');
}
function CustonNW() {
	document.getElementById("FooterText").style.visibility = 'hidden';
	cargarContenido (this.lang,'MiddleRight', true);
	//cargarContenido ('curso.php?Id='+this.id,'Contenido');
}

function proceFormNuevoEmail (url, id_contenedor, Inicializar) {
	
	ctEmail = document.getElementById('ctEmail').value;
	ctNumCol = document.getElementById('ctNumCol').value;
	ctApellidos = document.getElementById('ctApellidos').value;	
	ctNombre = document.getElementById('ctNombre').value;
	
	if ( (ValidaCampoTXT (document.getElementById('ctEmail'))) && (ValidaCampoTXT (document.getElementById('ctApellidos'))) && (ValidaCampoTXT (document.getElementById('ctNombre'))) ) {
	
		procesaFormulario (url, id_contenedor, Inicializar, "ctEmail="+ctEmail+"&ctNumCol="+ctNumCol+"&ctApellidos="+ctApellidos+"&ctNombre="+ctNombre);
	
	} else {
		alert ('Los campos Correo, Apellidos y Nombre son obligatorios.');
		return false;
	}	


}
