			var desprazamento = (function() {
		function desprazando (e) {
			this.desprazar (e.currentTarget) ;
		}
		function desprazar (actual) {
			if (actual.getAttribute ('bloqueo') == 1) {
				actual.removeAttribute ('bloqueo') ;
				return ;
			}
			var porc = actual.scrollTop / (actual.scrollHeight - actual.offsetHeight) ;
			for (i in this.barras) {
				if (this.barras [i] != actual) {
					this.barras [i].setAttribute ('bloqueo', 1) ;
					this.barras [i].scrollTop = porc * (this.barras [i].scrollHeight - this.barras [i].offsetHeight  + parseInt (this.barras [i].getAttribute ('pad_corr')));
				}
			}
		}
		function actualizar() {
//console.log ('actualizando') ;
			var max=0 ;
			for (i=1 ; i< this.barras.length ; i++) {
aux=0 ;
				if (this.barras [i].scrollHeight + aux > max) {
					max = this.barras [i].scrollHeight + aux ;
				}
			}

			this.corrector1.style.height = max - parseInt (document.defaultView.getComputedStyle (this.corrector1.parentNode.parentNode, null).getPropertyValue ('padding-top')) ;	
			this.desprazar (this.barras [0]) ;
		}
		function redim (e) {
			if (document.body.clientHeight == this.doc_alto && document.body.clientWidth == this.doc_ancho) return ;
			this.doc_alto = document.body.clientHeight ;
			this.doc_ancho = document.body.clientWidth ;
			//alert (e.target) ;
			this.actualizar() ;
		}
		function desprazamento (idents, corrector1, corrector2) {
			var inst = this ;
			this.desprazando = desprazando ;
			this.desprazar = desprazar ;
			this.actualizar = actualizar ;
			this.redim = redim ;
			this.barras  = [] ;
			this.corrector1 = document.getElementById (corrector1) ;
			for (i in idents) {
				this.barras.push (document.getElementById (idents [i])) ;
				dojo.connect (this.barras [i], 'scroll', inst, 'desprazando') ;
				dojo.connect (window, 'resize', inst, 'redim') ;
				this.barras [i].setAttribute ('pad_corr', 0) ;
			}
			this.doc_alto = document.body.clientHeight ;
			this.doc_ancho = document.body.clientWidth ;

			var div = document.body.appendChild (document.createElement ('div')) ;
			div.style.width = '100px' ;
			div.style.overflowY = 'scroll' ;
			var ancho_scroll = div.offsetWidth - div.clientWidth;
			
			this.corrector1.parentNode.parentNode.style.width = ancho_scroll + 1 ;
			this.corrector1.parentNode.parentNode.style.paddingTop = ancho_scroll ;
			this.corrector1.parentNode.parentNode.style.bottom = ancho_scroll ;
			document.getElementById (corrector2).style.paddingRight = parseInt ('10px') + ancho_scroll ;
			//this.corrector.parentNode.parentNode.style.width=div.offsetWidth - div.clientWidth ;
			
			document.body.removeChild (div) ;
			
			this.actualizar() ;
		}
		return desprazamento ;
	})() ;
	//lenzo_scroll barra_scroll contedor_scroll
	/*var desprazamento_inst ;
	dojo.addOnLoad (function() {
		desprazamento_inst = new desprazamento (['lenzo_scroll', 'barra_scroll', 'contedor_scroll'], 'empuxe_scroll') ;
	});*/




//RELOJ ANALOGICO
//	url1 : scriptasylum.com
//	url2 : www.elcodigo.com

var navok
if ( document.getElementById || document.all )	
	navok = true
else
	navok = false

var ahora = new Date(0) ;
var circulo_x = new Array() ;
var circulo_y = new Array() ;
circulo_x[7] = [80, 94, 100, 94, 77, 53, 28, 11,  5, 11, 28, 53] ;
circulo_y[7] = [ 8, 26,  50, 74, 91, 97, 91, 74, 50, 26,  8,  2] ;
var horas = new Array() ;
var minutos = new Array() ;
var segundos = new Array() ;
var numeros = new Array() ;

var dias_sema = ["Domingo", "Luns", "Martes", "M&eacute;rcores", "Xoves", "Venres", "S&aacute;bado"] ;var meses = ["Xaneiro", "Febreiro", "Marzo", "Abril", "Maio", "Xu&ntilde;o", "Xullo", "Agosto", "Setembro", "Outubro", "Novembro", "Decembro"] ;function pinta_reloj() {
	var txt ;
        txt = '<div id="exterior" style="position:relative; width:117px; height:117px; visibility:visible">' ;
	for(i=1;i<=5;i++)	//horas
		txt += '<div id="hrs'+i+'" style="position:absolute; top:-100px; left:-100px; width:6px; height:6px; background-image:url(\'http://www.lefredecaldereta.com/wordpress/wp-content/themes/lefredecaldereta/definitivo/estilos/../imaxes/punto_azul_6.png\'); font-size:0px;"></div>' ;
	for(i=1;i<=7;i++)	//minutero
		txt += '<div id="min'+i+'" style="position:absolute; top:-100px; left:-100px; width:6px; height:6px; background-image:url(\'http://www.lefredecaldereta.com/wordpress/wp-content/themes/lefredecaldereta/definitivo/estilos/../imaxes/punto_roxo_6.png\'); font-size:0px;"></div>' ;
	for(i=1;i<=7;i++)	//segundero
		txt += '<div id="sec'+i+'" style="position:absolute; top:-100px; left:-100px; width:6px; height:6px; background-image:url(\'http://www.lefredecaldereta.com/wordpress/wp-content/themes/lefredecaldereta/definitivo/estilos/../imaxes/punto_azul_6.png\'); font-size:0px;"></div>' ;
	for(i=1;i<=12;i++)	//digitos
		txt += '<div id="h'+i+'" style="text-align:center ;  line-height:10px ; position:absolute; top:-100px; left:0px; width:10px; height:10px; font-size:11px ; font-weight:bold; font-family: Arial; font-weight:bold ; color:#'+((i%2)?'a61728':'2e357c')+'">'+i+'</div>' ;
		//font-size:7px ;background-image:url(\'/fondo_dix_reloxio.png\') ;
	txt += '</div>' ;
	document.getElementById ('reloxio').innerHTML = txt ;
//	mueve_capa( exterior, 100, 200);
}

function avanza_reloj() {
	var dia1 = ahora.getDay() ;
	ahora = new Date()
	var dia2 = ahora.getDay() ;
	if (dia1 != dia2) {
	document.getElementById ('sema').firstChild.data = descodificar_entidades_html (dias_sema [ahora.getDay()]) ;
	document.getElementById ('dia').firstChild.data = 'día '+ahora.getDate()+' de' ;
	document.getElementById ('mes').firstChild.data = descodificar_entidades_html (meses [ahora.getMonth()]) ;
	document.getElementById ('ano').firstChild.data = 'do '+ahora.getFullYear() ;
	}
	ahora.hrs = ahora.getHours()
	ahora.min = ahora.getMinutes()
	ahora.sec = ahora.getSeconds()
	ahora.hrs = ( ahora.hrs >= 12 ) ? ahora.hrs - 12 : ahora.hrs
	ahora.hrs = Math.floor( ( ahora.hrs * 5 ) + ( ahora.min/12 ) )
	for(n=0;n<horas.length;n++)
		mueve_capa(horas[n], circulo_x[n][ahora.hrs], circulo_y[n][ahora.hrs])
	for(n=0;n<minutos.length;n++)
		mueve_capa(minutos[n], circulo_x[n][ahora.min], circulo_y[n][ahora.min])
	for(n=0;n<segundos.length;n++)
		mueve_capa(segundos[n], circulo_x[n][ahora.sec], circulo_y[n][ahora.sec])
}

function mueve_capa(id,x,y){
	id.style.left = x + 'px'
	id.style.top = y + 'px'
}


function obtiene_capa(idstr) {
	if (document.getElementById)
		return document.getElementById(idstr)
	else if (document.all)
		return document.all[idstr]
}

var IdIntervalo ;
function Inicializa() {
	for( i=1; i<=5; i++)
		horas[i-1] = obtiene_capa('hrs'+i)
	for( i=1; i<=7; i++)
		minutos[i-1] = obtiene_capa('min'+i)
	for( i=1; i<=7; i++)
		segundos[i-1] = obtiene_capa('sec'+i)
	for( i=1; i<=12; i++)
		numeros[i] = obtiene_capa('h'+i)
	for( n=1; n<=12; n++)
		mueve_capa(numeros[n], circulo_x[7][n-1], circulo_y[7][n-1])
	var centro = [0]
  	var radio = 6
  	var resultado = new Array()
  	for( i=1; i<=60; i++) {
  		centro[i] = centro[i-1] + ((Math.PI*2)/60)
  		centro[i-1] += Math.PI/180
  	}
  
	for( num=0; num<=6; num++) {
		circulo_x[num] = new Array()
		circulo_y[num] = new Array()
  		for( i=1; i<=60; i++) {
  			resultado = ((i-15)<0)? 60 + i - 15 : i - 15
  			circulo_x[num][i] = Math.floor((num*radio*Math.cos(centro[resultado]))+56)
  			circulo_y[num][i] = Math.floor((num*radio*Math.sin(centro[resultado]))+55)
  		}
		circulo_x[num][0]=circulo_x[num][60]
		circulo_y[num][0]=circulo_y[num][60]
  	}
  
	IdIntervalo = setInterval("avanza_reloj()", 100)
}


var recoller_cabeceira = (function(){
	var estado ;
	var cab ;
	var cont ;
	var logo_fondo ;
	var boton ;
	var ancho ;
	var ancho_d ;
	var margin ;
	var c = 0 ;
	var pasos = 10 ;
// 	var z_index ;
	function animacion() {
		if (!c) {
			clearInterval (IdIntervalo) ;//reloxio
			boton.className="boton_neutro" ;
			if (estado == 'pechar') {
				cab.parentNode.style.width = (ancho - 0)+'px' ;
				cab.parentNode.style.left = 0+'px' ;
				document.getElementById ('cab_var_int').style.display = 'block' ;
			}
			if (!dojo.isIE)
				document.getElementById ('corpo').className = 'animando' ;
			document.getElementById ('cab_cont').style.display = 'none' ;
 			document.getElementById ('b_esq1').style.visibility = 'visible' ;
 			document.getElementById ('b_esq2').style.visibility = 'visible' ;
		}
		if (c < pasos - 1) {
			if (estado == 'pechar') {
				var aux2 = (Math.cos ((pasos - c - 1) * Math.PI / (pasos - 1)) + 1) / 2 ;
				var aux1 = (Math.cos (c * Math.PI / (pasos - 1)) + 1)/ 2 ;
				
				cab.parentNode.style.left = (0 + (ancho - 200) * aux2)+"px" ;
				cab.parentNode.style.width = (200 + (ancho - 200) * aux1)+"px" ;
				cont2.style.left =  - 360 * aux2 ;
				cont2.style.width = ancho_cont + 360 * aux2 ;
 				document.getElementById ('b_esq1').style.left = - 360 * aux2 ;
 				document.getElementById ('b_esq2').style.left = - 360 * aux2 ;
				/*if (0 && ! (c % 3)) {
 				dojo.style (document.getElementById ('b_esq1'), {opacity:aux1}) ;
 				dojo.style (document.getElementById ('b_esq2'), {opacity:aux1}) ;
				}*/
				document.getElementById ('corpo').style.paddingTop= (aux1 * 151)+'px' ;
 				dojo.style (document.getElementById ('cab_var_int'), {opacity:aux2}) ;
				
			} else {
				var aux1 = (Math.cos ((pasos - c - 1) * Math.PI / (pasos - 1)) + 1) / 2 ;
				var aux2 = (Math.cos (c * Math.PI / (pasos - 1)) + 1)/ 2 ;
				
				cab.parentNode.style.left = (0 + (ancho - 200) * aux2)+"px" ;
				cab.parentNode.style.width = (200 + (ancho - 200) * aux1)+"px" ;
				cont2.style.left =  - 360 * aux2 ;
				cont2.style.width = ancho_cont + 360 * aux2 ;
 				document.getElementById ('b_esq1').style.left = - 360 * aux2 ;
 				document.getElementById ('b_esq2').style.left = - 360 * aux2 ;
				/*if (0 && ! (c % 3)) {
 				dojo.style (document.getElementById ('b_esq1'), {opacity:aux1}) ;
 				dojo.style (document.getElementById ('b_esq2'), {opacity:aux1}) ;
				}*/
				document.getElementById ('corpo').style.paddingTop= (aux1 * 151)+'px' ;
 				dojo.style (document.getElementById ('cab_var_int'), {opacity:aux2}) ;
			}
// 			logo_fondo.style.top = (150 * aux1 + 70)+"px" ;
			c ++ ;
			setTimeout (function() {animacion()}, 80) ;
		} else {
			c = 0 ;
			if (estado == 'abrir') {
				document.getElementById ('cab_var_int').style.display = 'none' ;
// 				logo_fondo.style.top="220px" ;
				
				document.getElementById ('corpo').style.paddingTop= (151)+'px' ;
				cab.parentNode.style.left="0px" ;
				cab.parentNode.style.width = 'auto' ;
				document.getElementById ('cab_cont').style.display = 'block' ;
				Inicializa() ;
				estado = 'pechar' ;
			cont2.style.left = 0 ;
			cont2.style.width = '100%' ;
				boton.className = 'boton_pechar' ;
 				document.getElementById ('b_esq1').style.left = 0 ;
 				document.getElementById ('b_esq2').style.left = 0 ;
 				/*dojo.style (document.getElementById ('b_esq1'), {opacity:1}) ;
 				dojo.style (document.getElementById ('b_esq2'), {opacity:1}) ;*/
			} else {
 				if (0) {
}
 				document.getElementById ('b_esq1').style.visibility = 'hidden' ;
 				document.getElementById ('b_esq2').style.visibility = 'hidden' ;
// 				logo_fondo.style.top="70px" ;
				cab.parentNode.style.left=(ancho - 200)+"px" ;
				cab.parentNode.style.width = 200+"px" ;
				boton.className = 'boton_abrir' ;
				estado = 'abrir' ;
				cont2.style.left = - 360 ;
				cont2.style.width = ancho_cont + 360 ;
			}
			cab.style.display='block' ;
			//setTimeout (function() {document.getElementById ('corpo').className = '' ;},0) ;
			if (! dojo.isIE)
				document.getElementById ('corpo').className = '' ;
		}
	}
	
	function resize() {
		if (boton.className == 'boton_abrir') {
			animacion() ;
		}
	}
	var cont2 ;
	var ancho_cont, cab_cont ;
	function inicializar() {
		estado = 'pechar' ;
		cab = document.getElementById ('cab') ;
		cab_cont = document.getElementById ('cab_cont') ;
		boton = document.getElementById ('boton_cab') ;
		cont = document.getElementById ('corpo') ;
		cont2 = document.getElementById ('contido') ;
		ancho_cont = cont2.offsetWidth ;
		//logo_fondo = document.getElementById ('logo_fondo') ;
		if (typeof document.defaultView == 'undefined') {
			margin = parseInt (cont.currentStyle ['marginTop']) ;
// 			z_index = parseInt (cont.parentNode.currentStyle ['zIndex']) ;
		} else {
			margin = parseInt (document.defaultView.getComputedStyle (cont, null).getPropertyValue ('margin-top')) ;
// 			z_index = parseInt (document.defaultView.getComputedStyle (cab.parentNode, null).getPropertyValue ('z-index')) ;//cab.parentNode.style.zIndex ;
		}
		window.onresize=resize ;
// 		alert (z_index) ;
	}
	
	function control() {
		if (typeof estado == 'undefined')
			inicializar() ;
		if (estado == 'pechar' || typeof estado == 'undefined') {
		if (typeof document.defaultView == 'undefined') {
			ancho = parseInt (cab.parentNode.offsetWidth) ;
			ancho_d = parseInt (cab.offsetWidth) ;
		} else {
			ancho = parseInt (document.defaultView.getComputedStyle (cab.parentNode, null).getPropertyValue ('width')) ;
			ancho_d = parseInt (document.defaultView.getComputedStyle (cab, null).getPropertyValue ('width')) ;
		}
		}
		setTimeout (function() {animacion()}, 80) ;
		
	}
	return control ;
})() ;


function procurar (o) {
	if (! o.s.value.length) return false ;
// 	var patron = document.getElementById ('procura_patron') ;
// 	if (patron.nextSibling == null)
// 		var aux = patron.parentNode.appendChild (patron.cloneNode (true)) ;
// 	else
// 		var aux = patron.parentNode.insertBefore (patron.cloneNode (true), patron.nextSibling) ;
// 	var anc = aux.getElementsByTagName ('a') [0] ;
// 	anc.href = '/procurar/'+encodeURIComponent (encodeURIComponent (o.procura.value)) ;
// 	anc.firstChild.data =  o.procura.value ;
// 	aux.style.display = 'block' ;
	location.hash = '/buscar/'+encodeURIComponent(encodeURIComponent(o.s.value)) ;
	return false ;
// 	alert (aux) ;
// 	alert (o.procura.value) ;

}


