var NOTICIAS = 
{
	init : function()
	{	
		var lnkNoticias = document.getElementById('listaNoticias').getElementsByTagName('a');
		for (cont = 0; cont < lnkNoticias.length; ++cont)
		{
			document.getElementById(lnkNoticias[cont].id).onclick = function()
			{
				document.getElementById('listaNoticias').className = 'oculto';
				document.getElementById('detalleNoticia').className = 'visible';
				document.getElementById('capaContenido2').className = 'total';
				document.getElementById('capaSubContenido').className = 'oculto';
				document.getElementById('det'+this.id).className = 'visible';
				document.getElementById('lnk'+this.id).onclick = function()
				{
					document.getElementById('listaNoticias').className = 'visible';
					document.getElementById('detalleNoticia').className = 'oculto';
					document.getElementById('capaContenido2').className = '';
					document.getElementById('capaSubContenido').className = 'visible';
					NOTICIAS.ocultarDetalles();
					return false;
				}
				return false;
			}
		}
	},
	ocultarDetalles : function()
	{
		var capasDetalle = document.getElementById('detalleNoticia').getElementsByTagName('div');
		for (cont = 0; cont<capasDetalle.length; ++cont)
		{
			document.getElementById(capasDetalle[cont].id).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() { NOTICIAS.init(); } );
