function runSlideShow(){
	j = j + 1
	if (j > (p1 + p2-1)) {
		j = 0;
	}
		 
	if (document.all) {
		document.images.SlideShow.style.filter = "blendTrans (duration = 2)";
		document.getElementById("contadorImagenes").style.filter = "blendTrans (duration = 2)";
		document.images.SlideShow.style.filter = "blendTrans (duration = crossFadeDuration)";
		document.getElementById("contadorImagenes").style.filter = "blendTrans (duration = crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
		document.getElementById("contadorImagenes").filters.blendTrans.Apply();
	 }
		 
	 document.images.SlideShow.src = preLoad[j].src;
	 document.getElementById("tituloFoto").innerHTML = preLoadTit[j].innerHTML;
	 document.getElementById("contadorImagenes").innerHTML = (j+1) + "/" + (Pic1.length + Pic2.length);
	 document.getElementById("enlaceProducto").innerHTML = preLoadTienda[j].innerHTML;
   	 document.getElementById("enlaceTienda").innerHTML = preLoadProducto[j].innerHTML;
		 
	 if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
		document.getElementById("contadorImagenes").filters.blendTrans.Play();
	 }
	 
	 t = setTimeout("runSlideShow();", slideShowSpeed);
}
	  
function detenerAutomatico() {
	clearTimeout(t);
}

function iniciarAutomatico() {
	clearTimeout(t);
	t = setTimeout("runSlideShow();", 1);
}
	  
function siguiente(){
	j = j + 1
	if (j > (p1 + p2 - 1)) {
		j = 0;
	}
 
	if (document.all) {
		document.images.SlideShow.style.filter = "blendTrans (duration = 2)";
		document.getElementById("contadorImagenes").style.filter = "blendTrans (duration = 2)";
		document.images.SlideShow.style.filter = "blendTrans (duration = crossFadeDuration)";
		document.getElementById("contadorImagenes").style.filter = "blendTrans (duration = crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
		document.getElementById("contadorImagenes").filters.blendTrans.Apply();
	 }
	 document.images.SlideShow.src = preLoad[j].src;
	 document.getElementById("tituloFoto").innerHTML = preLoadTit[j].innerHTML;
	 document.getElementById("contadorImagenes").innerHTML = (j+1) + "/" + (Pic1.length + Pic2.length);
	 document.getElementById("enlaceProducto").innerHTML = preLoadTienda[j].innerHTML;
   	 document.getElementById("enlaceTienda").innerHTML = preLoadProducto[j].innerHTML;
		
		 
	 if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
		document.getElementById("contadorImagenes").filters.blendTrans.Play();
	 }
}
	  
function anterior(){

	j = j - 1;
	if (j < 0) {
		j = (Pic1.length + Pic2.length)-1;
	}
 
	if (document.all) {
		document.images.SlideShow.style.filter = "blendTrans (duration = 2)";
		document.getElementById("contadorImagenes").style.filter = "blendTrans (duration = 2)";
		document.images.SlideShow.style.filter = "blendTrans (duration = crossFadeDuration)";
		document.getElementById("contadorImagenes").style.filter = "blendTrans (duration = crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
		document.getElementById("contadorImagenes").filters.blendTrans.Apply();
	}
 
	document.images.SlideShow.src = preLoad[j].src;
	document.getElementById("tituloFoto").innerHTML = preLoadTit[j].innerHTML;         
	document.getElementById("contadorImagenes").innerHTML = (j+1) + "/" + (Pic1.length + Pic2.length);
	document.getElementById("enlaceProducto").innerHTML = preLoadTienda[j].innerHTML;
   	document.getElementById("enlaceTienda").innerHTML = preLoadProducto[j].innerHTML;
 
	if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
		document.getElementById("contadorImagenes").filters.blendTrans.Play();
	}
}
