// ################## FUNCION PARA CALCULO HORA ACTUALIZADA (Hora PC local)  ####################
function hora(){
var t = new Date();
var h = t.getHours();
var m = t.getMinutes();
var s = t.getSeconds();
if (m < 10)
m = "0" + m;
if (s < 10)
s = "0" + s;
document.reloj.time.value = h + ":" + m + ":" + s;
window.setTimeout("hora();",1000);
}

function imprime() {
  if (window.print)
    window.print();
  else
    alert("Lo siento, pero a tu navegador no se le puede ordenar imprimir" +
      " desde la web. Actualizate o hazlo desde los menús");
}

function correo(){

}

//Anular Boton derecho
<!-- 
function click() {
if (event.button== 2 ) {
alert('Gracias por visitar la web del Ayuntamiento de Beas de Segura.'); 
}
}
//document.onmousedown=click 
// --> 

// Funciones para Mostrar/Ocultar CAPAS
function muestra(capa){ 
document.getElementById(capa).style.visibility="visible"; 
} 
function oculta(capa){ 
document.getElementById(capa).style.visibility="hidden";
} 

function iniciafn(){
//oculta('mami');
setTimeout("oculta('feliznav');muestra('mami');escrolea();",10000);

}

// ################## FUNCION PARA Noticias  ####################
// Parece que el ancho y el alto, poniendo un número elevado se adapta a la celda dondes esté situada
// ancho
var marqueewidth=1000
// alto
var marqueeheight=1000
// velocidad
var speed=1
// CONTENIDOS DE LA MARQUESINA

var marqueecontents = ''

function noticia(titulo,texto,fecha,enlace,destino,imagen)
{
	this.fecha = fecha
	this.titulo = titulo
	this.texto = texto										
	this.enlace = enlace	
	this.destino = destino
	this.imagen = imagen
}

function escribe(primeranoticia,ultimanoticia){
	var noticia=''
	for(i=ultimanoticia;i>primeranoticia-1;i--){
		noticia=''
		if (noticias[i].fecha != null && noticias[i].fecha != ''){
			noticia= noticia + '<span class="noticia_fecha">' + noticias[i].fecha + '</span><br>'
		}
		if (noticias[i].titulo != null && noticias[i].titulo != ''){
			noticia= noticia + '<span class="noticia_titulo">' + noticias[i].titulo + '</span><br>'
		}
		
		if (noticias[i].imagen != null && noticias[i].imagen != ''){
			noticia= noticia + '<span class="noticia_imagen">' + noticias[i].imagen + '</span><br>'
		}
		if (noticias[i].texto != null && noticias[i].texto !=''){
			noticia= noticia + '<span class="noticia_texto">' + noticias[i].texto + '</span><br>'
		}
		if (noticias[i].enlace != null && noticias[i].enlace != ''){
			noticia= noticia + '<span class="noticia_link"><a href="' + noticias[i].enlace + '"'
			if (noticias[i].destino != null && noticias[i].destino != ''){
				noticia = noticia + ' target= "' + noticias[i].destino + '"'
			}
			noticia = noticia + '>m&aacute;s informaci&oacute;n</a></span><br>'
		}
		noticia = noticia + '<br>'
		marqueecontents = marqueecontents + noticia
	}
	
	if (document.all)
	document.write('<marquee name="noticias" direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')
	window.onload=regenerate2
}

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}


