﻿function PutImg(sRuta)
{
	document.getElementById('img_gal_fall').src = sRuta;
	document.getElementById('img_gal_fall').style.display = 'block';
}

/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
DEBE EXISTIR EN LA PLANTILLA UNA CAPA QUE SE LLAME con el nombre definido en la variable __PREV_IMG_LAYER_ID
*/
var __PREV_IMG_offsetfrommouse=[-200,0]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var __PREV_IMG_displayduration=0; //duration in seconds image should remain visible. 0 for always.
var __PREV_IMG_defaultimageheight = 40;	// maximum image size.
var __PREV_IMG_defaultimagewidth = 40;	// maximum image size.
var __PREV_IMG_timer;
var __PREV_IMG_LAYER_ID = "preview_div_IMAGEN"

function __PREV_IMG_gettrailobj(){
if (document.getElementById) return document.getElementById(__PREV_IMG_LAYER_ID).style;
}

function __PREV_IMG_gettrailobjnostyle(){
if (document.getElementById) return document.getElementById(__PREV_IMG_LAYER_ID);
}
function __PREV_IMG_truebody(){
  return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function __PREV_IMG_hidetrail(){
	__PREV_IMG_gettrailobj().display="none";
	document.onmousemove=""
	__PREV_IMG_gettrailobj().left="-500px"
	clearTimeout(__PREV_IMG_timer);
}
function __PREV_IMG_showtrail(imagename,title,width,height){
	i = imagename;t = title;w = width;h = height;
	__PREV_IMG_timer = setTimeout("__PREV_IMG_show('"+i+"',t,w,h);",200);
}
function __PREV_IMG_show(imagename,title,width,height){
  var docwidth=document.all? __PREV_IMG_truebody().scrollLeft+__PREV_IMG_truebody().clientWidth : pageXOffset+window.innerWidth - __PREV_IMG_offsetfrommouse[0];
	var docheight=document.all? Math.min(__PREV_IMG_truebody().scrollHeight, __PREV_IMG_truebody().clientHeight) : Math.min(window.innerHeight);
	if( (navigator.userAgent.indexOf("Konqueror")==-1  || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
		( width == 0 ) ? width = __PREV_IMG_defaultimagewidth: '';
		( height == 0 ) ? height = __PREV_IMG_defaultimageheight: '';
		width+=30;
		height+=55;
		__PREV_IMG_defaultimageheight = height;
		__PREV_IMG_defaultimagewidth = width;
		document.onmousemove=__PREV_IMG_followmouse;

    // Aquí el código que pintará dentro de la capa
		newHTML = '<div class="border_preview" style="background:#FFF;width:'+  width +'px;height:'+ height +'px"><div id="loader_container"><div id="loader"><div align="center">Cargando imagen, espere un momento por favor...</div><div id="loader_bg"><div id="progress"> </div></div></div></div>';
		newHTML = newHTML + '<h2 class="title_h2">' + ' '+title + '</h2>'
   	newHTML = newHTML + '<div class="preview_temp_load"><img onload="javascript:__PREV_IMG_remove_loading();" src="' + imagename + '" border="0"></div>';
		newHTML = newHTML + '</div>';

/*		if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
			newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'"></iframe>';
		}
*/
		__PREV_IMG_gettrailobjnostyle().innerHTML = newHTML;
		__PREV_IMG_gettrailobj().display="block";
	}
}
function __PREV_IMG_remove_loading() {
  document.getElementById("loader_container").style.display='none';
}
function __PREV_IMG_followmouse(e){
	var xcoord=__PREV_IMG_offsetfrommouse[0]
	var ycoord=__PREV_IMG_offsetfrommouse[1]
	var docwidth=document.all? __PREV_IMG_truebody().scrollLeft+__PREV_IMG_truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(__PREV_IMG_truebody().scrollHeight, __PREV_IMG_truebody().clientHeight) : Math.min(window.innerHeight)
	if (typeof e != "undefined"){
		if (docwidth - e.pageX < __PREV_IMG_defaultimagewidth + 2*__PREV_IMG_offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - __PREV_IMG_defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < __PREV_IMG_defaultimageheight + 2*__PREV_IMG_offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*__PREV_IMG_offsetfrommouse[1] + __PREV_IMG_defaultimageheight + e.pageY - docheight - __PREV_IMG_truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}
	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < __PREV_IMG_defaultimagewidth + 2*__PREV_IMG_offsetfrommouse[0]){
			xcoord = event.clientX + __PREV_IMG_truebody().scrollLeft - xcoord - __PREV_IMG_defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += __PREV_IMG_truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (__PREV_IMG_defaultimageheight + 2*__PREV_IMG_offsetfrommouse[1])){
			ycoord += event.clientY + __PREV_IMG_truebody().scrollTop - Math.max(0,(2*__PREV_IMG_offsetfrommouse[1] + __PREV_IMG_defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += __PREV_IMG_truebody().scrollTop + event.clientY;
		}
	}
	__PREV_IMG_gettrailobj().left=xcoord+"px"
	__PREV_IMG_gettrailobj().top=ycoord+"px"
}