// JavaScript Document

// carrusel de fotos
var fotoarray = new Array();
var piearray = new Array();


function irDerecha() {
    sl = document.getElementById('capa').scrollLeft;
    document.getElementById('capa').scrollLeft = (sl + 2);
    movedrcha = setTimeout("irDerecha()", 20)
}
function irIzquierda() {
    sl = document.getElementById('capa').scrollLeft;
    document.getElementById('capa').scrollLeft = (sl - 2);
    moveizda = setTimeout("irIzquierda()", 20)
}

function cambiaFoto(pos) {
    var ant = 0;
    var sig = fotoarray.length - 1;
    var objetoSPAN = document.getElementById("pieFoto");
    if ((pos * 1) < (fotoarray.length - 1)) {
        sig = (pos * 1) + 1;
    }
    if ((pos * 1) > 0) {
        ant = (pos * 1) - 1;
    }
    document.images["imgFoto"].src = "images/galeriaFotos/" + fotoarray[pos];
    document.images["imgFoto"].alt = piearray[pos];
    document.getElementById("siguiente").innerHTML = "<img style='cursor:pointer;' src='images/pelota_tenis_derecha.png' alt='siguiente' onclick=cambiaFoto('" + sig + "'); /> "
    document.getElementById("anterior").innerHTML = "<img style='cursor:pointer;' src='images/pelota_tenis_izq.png' alt='anterior' onclick=cambiaFoto('" + ant + "'); /> "
    objetoSPAN.innerHTML = piearray[pos];
    return true;
} 

//filtro de imagenes
function cambiofiltro(obj,num)
{
	if (num==1)
	{
	obj.style.filter='alpha(opacity=100)';
	obj.style.opacity='1';
	}
	else
	{
	obj.style.filter='alpha(opacity=50)';
	obj.style.opacity='0.50';
	}
}


