/** 
 * Función que cambia las imágenes con un efecto fade entre ellas
*/	
function runSlideShow() {
	if (document.all){
		document.images.PictureBox.style.filter="blendTrans(duration=2)";
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}
	document.images.PictureBox.src = preLoad[jss].src;
	if (document.all) 
		document.images.PictureBox.filters.blendTrans.Play();
	jss = jss + 1;
	if (jss > (pss)) 
		jss=1;
		
	timer = setTimeout('runSlideShow()', SlideShowSpeed);					
}
	
/**
 * Funciones para siguiente y anterior
*/		
var foto1 = 1;
var foto2 = 2;						
function anterior() {
	foto1 = foto1 - 1;
	if (foto1 < 1) {
		foto1 = numFotos;
	}

	foto2 = foto2 - 1;
	if (foto2 < 1) {
		foto2 = numFotos;
	}		
		
	eval("document['foto1'].src=Picture[" + foto1 + "]"); 	
	var f1 = document.getElementById('f1');
			
	eval("document['foto2'].src=Picture[" + foto2 + "]");
	var f2 = document.getElementById('f2');			
}

function siguiente() {
	foto1 = foto1 + 1;
	if (foto1 > numFotos) {
		foto1 = 1;
	}

	foto2 = foto2 + 1;
	if (foto2 > numFotos) {
		foto2 = 1;
	}		
	
	eval("document['foto1'].src=Picture[" + foto1 + "]"); 	
	var f1 = document.getElementById('f1');
				
	eval("document['foto2'].src=Picture[" + foto2 + "]");	
	var f2 = document.getElementById('f2');	

}

function cargarImagen(nombreFoto) {
	clearTimeout(timer);
	eval("document['PictureBox'].src=document['" + nombreFoto + "'].src");
}