window.addEvent('domready',function(){
    
	//FUENTES
	Cufon.replace('.noticias_portada h1 span',{ fontFamily: 'HelveticaNeue45', hover:true });
	Cufon.replace('#frm_suscripcion strong',{ fontFamily: 'HelveticaNeue45', hover:true });
	Cufon.replace('.titulo_apartado',{ fontFamily: 'MetaplusBlackItalic', hover:true });
	Cufon.replace('#h2_opinion',{ fontFamily: 'MetaplusBlackItalic', hover:true });
	Cufon.now();    

	//MENU  ACORDEON
		
	var elements=[];
	var togglers=[];
	
	if(nodo_id && $('node'+nodo_id)){
		$('node'+nodo_id).addClass('activo');
	}
	
	$$('#menu_arbol a').each(function(el){
		
		if(el.getParent().getParent().id=='menu_arbol'){
			Cufon.replace(el,{ fontFamily: 'HelveticaRoundedCondensedBold', hover:true });
			var ul=el.getNext();
			if(ul){
				el.addEvent('click',function(event){
					event=new Event(event);
					event.preventDefault();
					return false;
				});
				togglers.push(el);
				elements.push(ul);
			}
		}
		
		if(el.getParent().hasClass('formulario')){
			el.onclick=function(){
				popUp(this.href,513,400,true);
				return false;
			}
			$$('a').each(function(a){
				if(a.href==el.href) a.onclick=el.onclick;
			});
		}
		
	});
	
	var show=false;//inicialmente lo muestro cerrado
	
	for(var k=0;k<elements.length;k++){
		if(('node'+id_primer_nivel)==elements[k].getParent().id ||elements[k].getElementById('node'+nodo_id)){
			show=k;
		}
	}
		
    
	var accordion = new Accordion(togglers, elements, {
			alwaysHide:true,
			/*show:0,*/
			show:show,
			display:false,
			onActive: function(toggler, element){	
				element.addClass('con_margen');
			},
			onBackground: function(toggler, element){
				setTimeout(function(){element.removeClass('con_margen')},400);
			}
		});    
    $('texto_buscar').addEvent('click',function(){
        this.value = '';
    })
		
})