// JavaScript Document

function PictureLink(number) {
  var page = 'pix_85-143.html?value=' + number;
  window.location = page;
  getLink(page);
  
}

function getLink(str)
{
getParameter = str.indexOf("=") + 1;
value = str.substring(getParameter);
}



// This is for the Next and Previous of the images

archivesImages=new Array(); 

archivesImages[0]='images/title_history.gif';
archivesImages[1]='images/title_rules.gif';
archivesImages[2]='images/title_presidents.gif';
archivesImages[3]='images/title_press.gif';

archivesMessages=new Array()

archivesMessages[0]='We learn about our world through the 5 senses';
archivesMessages[1]='We use our eyes to see things';
archivesMessages[2]='Our ears to hear things';
archivesMessages[3]='And our sense of touch to feel things.';




imagesPreloaded = new Array(4) 
for (var i = 0; i < archivesImages.length ; i++) 

{
imagesPreloaded[i] = new Image()
imagesPreloaded[i].src = archivesImages[i]
}

function Message(index)
{
  var ctrl = document.getElementById("spanText");

	switch(index)
	{
		case 1:
			ctrl.innerHTML = "<b>One</b>";
			break;
		case 2:
			ctrl.innerHTML = "<b>Two</b>";
			break;
		case 3:
			ctrl.innerHTML = "<b>Threee</b>";
			break;
	}

}


function PreLoad(index){
currentIndx=index - 1;

document.theImage.src=imagesPreloaded[currentIndx].src

Message(currentIndx);
}



function Nexter(){ 
if (currentIndx<imagesPreloaded.length-1){

currentIndx=currentIndx+1;

document.theImage.src=imagesPreloaded[currentIndx].src

Message(currentIndx);

}

else {

currentIndx=0

document.theImage.src=imagesPreloaded[currentIndx].src

Message(currentIndx);

}

}



function Backer(){

if (currentIndx>0){

currentIndx=currentIndx-1;

document.theImage.src=imagesPreloaded[currentIndx].src

Message(currentIndx);

}

else {

currentIndx=3

document.theImage.src=imagesPreloaded[currentIndx].src

Message(currentIndx);

}

}
