var FILOSOFIA = 
{
	init : function()
	{	
		document.getElementById('lnketiquetas').onclick = function()
		{
			document.getElementById('iniciofilosofia').className = 'oculto';
			document.getElementById('etiquetas').className = 'visible';
			document.getElementById('premios').className = 'oculto';
			document.getElementById('lnketiquetas').style.color = '#C5722C';
			document.getElementById('lnkpremios').style.color = '#600007';
			document.getElementById('capaSubContenido').style.display = 'none';
			document.getElementById('imgpremios0').className = 'oculto';
			document.getElementById('imgInicio').className = 'oculto';
			document.getElementById('imgetiquetas0').className = 'visible';
			document.getElementById('capaContenido2').className = 'filosofia';
			return false;
		}
		
		document.getElementById('lnkpremios').onclick = function()
		{
			FILOSOFIA.mostrarImgEtiquetas('99');
			document.getElementById('iniciofilosofia').className = 'oculto';
			document.getElementById('etiquetas').className = 'oculto';
			document.getElementById('premios').className = 'visible';
			document.getElementById('lnkpremios').style.color = '#C5722C';
			document.getElementById('capaSubContenido').style.display = 'none';
			document.getElementById('lnketiquetas').style.color = '#600007';
			document.getElementById('imgetiquetas0').className = 'oculto';
			document.getElementById('imgInicio').className = 'oculto';
			document.getElementById('imgpremios0').className = 'visible';
			document.getElementById('capaContenido2').className = 'filosofia';
			return false;			
		}
		
		var opcEtiquetas = document.getElementById('etiquetas').getElementsByTagName('a');
		for (cont = 0; cont<opcEtiquetas.length; ++cont)
		{
			document.getElementById(opcEtiquetas[cont].id).onclick = function()
			{
				FILOSOFIA.mostrarImgEtiquetas(this.id);
				return false;
			}
		}
		
		var opcPremios = document.getElementById('diplomas').getElementsByTagName('a');
		for (cont = 0; cont<opcPremios.length; ++cont)
		{
			document.getElementById(opcPremios[cont].id).onclick = function()
			{
				FILOSOFIA.mostrarImgPremios(this.id);
				return false;
			}
		}
	},
	mostrarImgEtiquetas : function(opcion)
	{
		var opcImg = document.getElementById('contDcha').getElementsByTagName('img');
		for (cont = 0; cont<opcImg.length; ++cont)
		{
			if ('imgetiquetas'+opcion.substring(3,opcion.length) == opcImg[cont].id)
				document.getElementById(opcImg[cont].id).className = 'visible';
			else if (document.getElementById(opcImg[cont].id).className == 'visible')
				document.getElementById(opcImg[cont].id).className = 'oculto';
		}
	},
	mostrarImgPremios : function(opcion)
	{
		document.getElementById('capaFondoImg').className = 'visible';
		document.getElementById('capaContentImg').className = 'visible';
		document.body.style.overflow = 'hidden';
		
		document.getElementById('btncerrar').onclick = function()
		{
			document.getElementById('capaFondoImg').className = 'oculto';
			document.getElementById('capaContentImg').className = 'oculto';
			document.body.style.overflow = 'visible';
			return false;
		}
		document.getElementById('imgcerrar').onclick = function()
		{
			document.getElementById('capaFondoImg').className = 'oculto';
			document.getElementById('capaContentImg').className = 'oculto';
			document.body.style.overflow = 'visible';
			return false;
		}
		
		var imgDiplomas = document.getElementById('capaDiplomas').getElementsByTagName('img');
		for (cont = 0; cont<imgDiplomas.length; ++cont)
		{
			document.getElementById(imgDiplomas[cont].id).className = "oculto";
		}
		document.getElementById('dip'+opcion.substring(3,4)).className = "diploma visible";
		
		if (opcion.substring(3,4) == 3)
		{
			document.getElementById('lnksiguiente').className = 'visible';			
			document.getElementById('lnksiguiente').onclick = function ()
			{
				document.getElementById('lnkanterior').className = 'visible';
				document.getElementById(this.id).className = 'oculto';
				document.getElementById('dip3').className = 'oculto';
				document.getElementById('dip4').className = 'diploma visible';
				return false;
			}
			document.getElementById('lnkanterior').onclick = function()
			{
				document.getElementById('lnksiguiente').className = 'visible';
				document.getElementById(this.id).className = 'oculto';			
				document.getElementById('dip4').className = 'oculto';
				document.getElementById('dip3').className = 'diploma visible';	
				return false;	
			}
		}
		else if (opcion.substring(3,4) == 6)
		{
			document.getElementById('lnksiguiente').className = 'visible';			
			document.getElementById('lnksiguiente').onclick = function ()
			{
				document.getElementById('lnkanterior').className = 'visible';
				document.getElementById(this.id).className = 'oculto';
				document.getElementById('dip6').className = 'oculto';
				document.getElementById('dip7').className = 'diploma visible';
				return false;
			}
			document.getElementById('lnkanterior').onclick = function()
			{
				document.getElementById('lnksiguiente').className = 'visible';
				document.getElementById(this.id).className = 'oculto';			
				document.getElementById('dip7').className = 'oculto';
				document.getElementById('dip6').className = 'diploma visible';	
				return false;	
			}			
		}
		else
		{
			document.getElementById('lnksiguiente').className = 'oculto';
		}
	}
}

/* LOAD */

function addLoadEvent(fn)
 {
	var old = window.onload;
	if(typeof window.onload != 'function')
		window.onload = fn;
	else
		window.onload = function()
		 {
			old();
			fn();
		 }
 }

addLoadEvent( function() { FILOSOFIA.init(); } );
