/**
 * Stations
 **/
 
// Image class
function image(fileName, romanNum, caption)
{
 this.fileName = fileName;
 this.romanNum = romanNum;
 this.caption = caption;
}

// Image collection
var ImageCollection = new Array();

function loadImgs()
{
 if ( ImageCollection.length == 0 )
 {
 		ImageCollection[0] = new image("station1.jpg", "I",  "Jesus is sentenced to death");
		ImageCollection[1] = new image("station2.jpg", "II",  "Jesus takes his cross");
		ImageCollection[2] = new image("station3.jpg", "III", "Jesus falls the first time");
		ImageCollection[3] = new image("station4.jpg", "IV", "Jesus meets his blessed mother");
		ImageCollection[4] = new image("station5.jpg", "V", "Simon helps Jesus to carry His cross");
		ImageCollection[5] = new image("station6.jpg", "VI", "Veronica wipes the face of Jesus");
		ImageCollection[6] = new image("station7.jpg", "VII", "Jesus falls the second time");
		ImageCollection[7] = new image("station8.jpg", "VIII", "Jesus speaks to the holy women");
		ImageCollection[8] = new image("station9.jpg", "IX", "Jesus falls the third time");
		ImageCollection[9] = new image("station10.jpg", "X", "Jesus is stripped of his garments");
		ImageCollection[10] = new image("station11.jpg", "XI", "Jesus is nailed to the cross");
		ImageCollection[11] = new image("station12.jpg", "XII", "Jesus dies on the cross");
		ImageCollection[12] = new image("station13.jpg", "XIII", "Jesus is taken down from the cross");
		ImageCollection[13] = new image("station14.jpg", "XIV", "Jesus is laid in the sepulchre");
 } 
}

function indexPick(visitCount)
{
	return visitCount % ImageCollection.length;
}

// Use mod divide to return the index of the image for this visit
function stationVisited(visitCount)
{
  var htmlString = "";
  loadImgs();
 	if ( visitCount == 0 )
	{
	 	 return ImageCollection[0];
	}
	else
	{
	 	return ImageCollection[ indexPick(visitCount) ];
	}
}




