// JavaScript Document

x = 20;
y = 20;
function setVisible(obj,visible,ruta,texto)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	document.imagendetalle.src = '/galerias/'+ruta;
	var textodetalle = document.getElementById("textodetalle");
	textodetalle.innerHTML = texto; 
	setTimeout("placeIt('layer1')",500);
}

function setVisibleElegir(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	setTimeout("placeIt('seleccionar')",500);
}

function setVisibleAviso(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}

function placeIt(obj)
{
	obj = document.getElementById(obj);
	//if (document.documentElement)
	//{
		theLeft = document.documentElement.scrollLeft;
		theLeftBody = document.body.scrollLeft;
		theTop = document.documentElement.scrollTop;
		theTopBody = document.body.scrollTop;
		if (theTop == 0 && theTopBody > 0){
			theTop = theTopBody;
		}
		if (theLeft == 0 && theLeftBody > 0){
			theLeft = theLeftBody;
		}
	//	alert("Los valores son: left="+theLeft+" y top="+theTop);
	//	alert("Los valores con body son son: left="+document.body.scrollLeft+" y top="+document.body.scrollTop);
	//}
	//else if (document.body)
	//{
	//	theLeft = document.body.scrollLeft;
	//	theTop = document.body.scrollTop;
	//}
	theLeft += x;
	theTop += y;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	//setTimeout("placeIt('layer1')",500);
}

//window.onscroll = setTimeout("placeIt('layer1')",500);