/*****************************************************/
// variables globales, bueno, algunas se usan de constantes pero javascript no entiende de ello

var hoja = (document.layers)? '../estilos/estilos_ns.css' : '../estilos/estilos_ie.css';
document.write('<link rel="stylesheet" type="text/css" href="'+hoja+'">');
var total_fotos = 9;
var num = 0; //recorre el array de fotos
var mseg = 5000;  //milisegundos entre fotos, OJO con el parametro inicial en el body
var lengua ="";
var anterior;

/******************************************************/

function cambiaframe(page)
{ 
	parent.barra.location.href = page;
}

/******************************************************/

function preload(idioma)
{
	lengua = idioma;
	parent.mostrador.location.href = "intro_" + lengua + ".html";	
	anterior = 0;
	on_off('2');
}

/******************************************************/
function rotate()
{
	cadena = String(num);
	document.images[1].src = "../img/pupila" + cadena + ".jpg";
	num++;
	if (num >= total_fotos) num = 0;
	window.setTimeout('rotate();',mseg);
}


/******************************************************/

function on_off(indice)
{
	var aux = String(anterior);
	var cad = "../img/menu" + aux + "off_" + lengua + ".gif";
	document.images[anterior].src = cad;
	cad = "../img/menu" + indice + "on_" + lengua + ".gif";
	aux = parseInt(indice);
	document.images[aux].src = cad;
	anterior = indice;
}

/******************************************************/

function colocar(){
window.moveTo(0,0);

var x = screen.width;
var y = screen.height;
window.resizeTo(x,y);

}

function preCarga() {
if (!document.images) return;
var ar = new Array();
var arguments = preload.arguments;
for (var i = 0; i < arguments.length; i++) {
ar[i] = new Image();
ar[i].src = arguments[i];
}
}
