﻿var ImgDia=new Array();
var linkDia=new Array();
var dest=new Array();
var whichImgDia=0;

//Specify whether images should be linked or not (1=linked)
//var linkornot=0;
var linkImg=1;

var nueva = 0;

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
/*photoslink[0]="a.com";
photoslink[1]="b.com";
photoslink[2]="c.com";*/

var pieImg = new Array();
/*pie[0]="pie uno";
pie[1]="pie dos";
pie[2]="pie tres";*/

//do NOT edit pass this line

function keeptrackImg(){
    if (document.all)
	{
        document.getElementById("PieImg").innerText = pieImg[whichImgDia];
		document.getElementById("cantImg").innerText = (whichImgDia+1) + " de " + ImgDia.length;
	}
    else
	{
        document.getElementById("PieImg").textContent = pieImg[whichImgDia];
		document.getElementById('cantImg').textContent = (whichImgDia+1) + " de " + ImgDia.length;
	}
}

function backwardImg(){    
    if (whichImgDia>0)
        whichImgDia--;
    else
        whichImgDia = ImgDia.length -1;
    document.images.ImgDia.src=ImgDia[whichImgDia];
    keeptrackImg();
}

function forwardImg(){
    if (whichImgDia<ImgDia.length-1)
        whichImgDia++;	
    else
        whichImgDia = 0;
    document.images.ImgDia.src=ImgDia[whichImgDia];
    keeptrackImg();
}

function Siguiente()
{
	if (whichImgDia<ImgDia.length-1)
        whichImgDia++;	
    else
        whichImgDia = 0;
    document.images.ImgDia.src=ImgDia[whichImgDia];
    keeptrackImg();
}

function transportImgDia() {
	if (dest[whichImgDia]=='_blank')
		window.open(linkDia[whichImgDia]);
	else
		window.location=linkDia[whichImgDia];
}
