/*
Fichero de funciones para la web de Lunatico
Autores: Bernardo y Jaime Alemany (2006)
*/ 

//función de precarga de fotos.
function preLoad()
{
	preload_image_object = new Array();
	image_url = new Array();
	image_url[0] = "images/foto-A.jpg";
	image_url[1] = "images/foto-B.jpg";
	image_url[2] = "images/foto-C.jpg";
	image_url[3] = "images/foto-D.jpg";
	image_url[4] = "images/foto-E.jpg";
	image_url[5] = "images/foto-F.jpg";
	image_url[6] = "images/foto-G.jpg";
	image_url[7] = "images/foto-H.jpg";
	image_url[8] = "images/foto-I.jpg";
	var i = 0;
	for(i=0; i<=8; i++) 
	{
		preload_image_object[i] = new Image();
		preload_image_object[i].src = image_url[i];
	}
//window.alert(i)
}


//función para cambiar la foto del fondo
function cambif(foto){
document.getElementById('capafoto').style.backgroundImage = "url("+ foto +")";
}
//la misma función para Mozilla (pero no la estoy invocando)
function cambifMz(foto)
{
fondo = document.getElementById('capafoto');
fondo.style.background = "url("+ foto +")";
}
//función para el mosaico

var valorLeft=0;
var valorTop=0;

function capturar(nombreImage){
valorLeft=nombreImage.offsetLeft + nombreImage.offsetParent.offsetLeft;
valorTop=nombreImage.offsetTop + nombreImage.offsetParent.offsetTop;
//window.alert("·capturar" + valorLeft +" - "+ valorTop);
}
function asignar(nombreCapa){
//window.alert("asignar " + valorLeft +" - "+ valorTop);
document.getElementById(nombreCapa).style.top=valorTop - 10;
document.getElementById(nombreCapa).style.left=valorLeft - 10;
document.getElementById(nombreCapa).style.visibility="visible";
}
function asignar2(nombreCapa){
//window.alert("asignar " + valorLeft +" - "+ valorTop);
document.getElementById(nombreCapa).style.top=valorTop + 139;//añadir para bajar
document.getElementById(nombreCapa).style.left=valorLeft + 230;//añadir para desplazar derecha
document.getElementById(nombreCapa).style.visibility="visible";
}
function mostrar(nombreCapa){ 
document.getElementById(nombreCapa).style.visibility="visible"; 
} 
function ocultar(nombreCapa){ 
document.getElementById(nombreCapa).style.visibility="hidden"; 
}
function oculta(){ 
window.alert("hola"); 
}
/*
Fin del fichero
*/