/*
 * Menú de navegación
 */
function menu(n, funcion){
	if(funcion=='over'){
		document.images['menu'+n].src='/lib/img/menu_der_h.gif';
	}else{
		document.images['menu'+n].src='/lib/img/menu_der.gif';
	}
}


/*
 * Título de documento animado
 */
function Titulo(){
	// Definimos los atributos
	this.titulos=new Array();
	this.fotograma=0;
	
	// Convertimos funciones en métodos del objeto
	this.anadir=anadir;
	this.siguiente=siguiente;
	this.aleatorio=aleatorio;
	
	function anadir(texto){
		this.titulos[this.titulos.length]=texto;
	}
	
	function siguiente(){
		document.title=this.titulos[this.fotograma];
		this.fotograma=(this.fotograma+1)%this.titulos.length;
	}

	function aleatorio(){
		while( (tmp=Math.floor(Math.random()*this.titulos.length)) == this.fotograma ){
			;
		}
		document.title=this.titulos[tmp];
	}
}

var T=new Titulo();
T.anadir('... Hostal Acacia .::');
T.anadir('..: Hostal Acacia ...');
T.anadir('.:. Hostal Acacia :.:');
T.anadir('.:: Hostal Acacia ::.');
T.anadir(':.. Hostal Acacia ..:');
T.anadir(':.: Hostal Acacia :..');
T.anadir('::. Hostal Acacia :::');
T.anadir('::: Hostal Acacia .:.');

T.anadir('... Hostal Acacia ...');
T.anadir('..: Hostal Acacia ..:');
T.anadir('.:. Hostal Acacia .::');
T.anadir('.:: Hostal Acacia :.:');
T.anadir(':.. Hostal Acacia ::.');
T.anadir(':.: Hostal Acacia :::');
T.anadir('::. Hostal Acacia .:.');
T.anadir('::: Hostal Acacia :..');
setInterval('T.aleatorio()', 250);


/*
 * Cambiar etiqueta idioma
 */
var idiomas=Array('IDIOMA', 'LANGUAGE', 'IDIOME');
var idioma=0;
setInterval('idioma_siguiente()', 1000);
function idioma_siguiente(){
	document.getElementById('etiqueta_idioma').innerHTML=idiomas[idioma];
	idioma=(idioma+1)%idiomas.length;
}

/*
 * Capa del selector de idiomas
 */
document.writeln('<div id="lista_idiomas" style="visibility: hidden; position: absolute; top: 22; left: 685; z-index: 100; border: 1px solid #707070; background: #EEE7AD; -moz-opacity: 0.8; filter: alpha(Opacity=80);">');
document.writeln('	<table border="0" cellspacing="2" cellpadding="2">');
document.writeln('	<tr>');
document.writeln('		<td><a href="/presentacion.html"><img src="/lib/img/bandera_es.gif" width="15" height="11" alt="[Bandera española]" title="" align="middle" style="margin-right: 5;" border="0">Español</a></td>');
document.writeln('	</tr><tr>');
document.writeln('		<td><a href="/welcome.html"><img src="/lib/img/bandera_en.gif" width="15" height="11" alt="[Bandera inglesa]" title="" align="middle" style="margin-right: 5;" border="0">English</a></td>');
document.writeln('	</tr><tr>');
document.writeln('		<td><a href="/presentation.html"><img src="/lib/img/bandera_fr.gif" width="15" height="11" alt="[Bandera francesa]" title="" align="middle" style="margin-right: 5;" border="0">Français</a></td>');
document.writeln('	</tr>');
document.writeln('	</table>');
document.writeln('</div>');


function capa_idiomas(){
	var objeto=document.getElementById('lista_idiomas');
	
	if(objeto.style.visibility=='visible' || objeto.style.visibility==''){
		objeto.style.visibility='hidden';
	}else{
		objeto.style.visibility='visible';
	}

	return false;
}

/*
 * Controlamos el cierre de la capa de idiomas
 */
function clic(boton){
	var objeto=document.getElementById('lista_idiomas');
	objeto.style.visibility='hidden';
	return true;
}
document.onmouseup=clic;
