	function posicionaCapa(nombre_capa){
		
		if (window.pageYOffset)
		{
			scrollTop = window.pageYOffset;
		}
		else
		{
			scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
		}
		obj_capa = eval("document.getElementById(\""+nombre_capa+"\")");
		var ancho_array = obj_capa.style.width.split("p");
		var left_temp = 0;
		obj_capa.style.top = scrollTop+'px';
		obj_capa.style.left = left_temp + 'px';
	}
		function AccionesFondo(url_ajax){
			posicionaCapa("dd1")
			var obj_fondo = document.getElementById("dd1");
			if(document.documentElement.clientHeight < document.documentElement.scrollHeight){
				var alto_temp = document.documentElement.scrollHeight;
				var ancho_temp = document.documentElement.scrollWidth;
			}else{
				var alto_temp = document.documentElement.clientHeight;
				var ancho_temp = document.documentElement.clientWidth;
			}
			obj_fondo.style.visibility="visible";
			
			obj_fondo.style.top = 0 + "px";
			obj_fondo.style.width= ancho_temp + "px";
			obj_fondo.style.height= alto_temp + "px";

			http_CargaDatos = NuevoAjax();
			var q = url_ajax + '?aleatorio='+ aleatorio(1,99999);
			//parent.location = q;
			http_CargaDatos.open("GET", q, true);
			http_CargaDatos.onreadystatechange = ResultadoCargaDatos;
			http_CargaDatos.send(null);
		}
		
		function ResultadoCargaDatos(){
			if (http_CargaDatos.readyState == 4){
				var valor = http_CargaDatos.responseText.split('|');
				
				var obj_contenido = document.getElementById("capaContenido");
				if (window.pageYOffset)	{
					_scrollTop = window.pageYOffset;
				}else{
					_scrollTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
				}

				top_temp = (document.documentElement.clientHeight/2) - 160; //el 200 es la altura/2 de la capa
				left_temp = (document.documentElement.clientWidth/2) - 224; //el 209 es la anchura/2 de la capa
	
				obj_contenido.style.top= eval(top_temp+_scrollTop) + "px";
				obj_contenido.style.left= left_temp + "px";
				obj_contenido.innerHTML = valor[1];
				obj_contenido.style.visibility="visible";
			}else{
			}
		}
		
		function cerrarCapaFondo(){
			var obj_fondo = document.getElementById("dd1");
			obj_fondo.style.visibility="hidden";
			obj_fondo.style.width= 1 + "px";
			obj_fondo.style.height= 1 + "px";
			var obj_contenido = document.getElementById("capaContenido");
			obj_contenido.style.visibility="hidden";
		}

	var miTimerOcultar;
	var miTimerMostrar;

	function cargaImagen(id_salon_h,puntero)
	{
		if (miTimerOcultar){
			clearTimeout(miTimerOcultar)
		}
		if (miTimerMostrar){
			clearTimeout(miTimerMostrar)
		}
		http = NuevoAjax();
		b = "&puntero=" + puntero;
		var z = 'ajax_imagesGallery_salon.cfm?id_salon_h=' + id_salon_h +' &idcache=' + aleatorio(1,9999999);
		http.open("GET", z+b, true);
//		document.write(z+b)
		http.onreadystatechange = ResultadoImagen;
		http.send(null);
	}
	
	function ResultadoImagen() {
		if (http.readyState == 4) {
			var valor = http.responseText.split('|');
			obj = document.getElementById("imagenDetalle");
			obj1 = document.getElementById("textoDetalle");
			objFlechas = document.getElementById("idFlechas");
			ocultar(obj,obj1,100,valor[1],valor[2]);
			objFlechas.innerHTML = valor[3]
		}
		else{
		}
	}
	
function hideWaitMessageAndShowCaption(obj,obj1)
{
	document.getElementById('waitMessage').style.display='none';
	mostrar(obj,obj1,0);	
}


function ocultar(obj,obj1,cont,imagen,texto){
	laimagen = imagen;
	eltexto = texto;
	aux = cont - 6;
	if (aux > 1){
		if (obj.style.MozOpacity){
			if (aux < 10){
				obj.style.MozOpacity = eval("0.0" + parseInt(aux))
				obj1.style.MozOpacity = eval("0.0" + parseInt(aux))
			}else{
				obj.style.MozOpacity = eval("0." + parseInt(aux))
				obj1.style.MozOpacity = eval("0." + parseInt(aux))
			}
		}else{
			obj.filters.alpha.opacity = parseInt(aux)
		}
		miTimerOcultar = setTimeout("ocultar(obj,obj1,aux,laimagen,eltexto)",1)
	}else{
		
		if (obj.style.MozOpacity){
			obj.style.MozOpacity = 0
			obj1.style.MozOpacity = 0
		}else{
			obj.filters.alpha.opacity = parseInt(aux)
		}

		document.getElementById('waitMessage').style.left = 170 + "px";
		document.getElementById('waitMessage').style.top = 280 + "px";
		document.getElementById('waitMessage').style.display='inline';
		obj.onload = function() { hideWaitMessageAndShowCaption(obj,obj1); };
		obj.src = laimagen;
		obj1.innerHTML = texto;

//		mostrar(obj,obj1,0);		
	}
}
function mostrar(obj,obj1,cont){
	aux = cont + 5
	if (aux < 99){
		if (obj.style.MozOpacity){
			if (aux < 10){
					obj.style.MozOpacity = eval("0.0" + parseInt(aux))
					obj1.style.MozOpacity = eval("0.0" + parseInt(aux))
			}else{

				obj.style.MozOpacity = eval("0." + parseInt(aux))
				obj1.style.MozOpacity = eval("0." + parseInt(aux))
			}
		}else{
				obj.filters.alpha.opacity = parseInt(aux)
		}
		miTimerMostrar =setTimeout("mostrar(obj,obj1,aux)",3)
	}else{
		if (obj.style.MozOpacity){
			obj.style.MozOpacity = 100
			obj1.style.MozOpacity = 100
		}else{
			obj.filters.alpha.opacity = parseInt(aux)
		}

	}
}
