// JavaScript Document

function displayPics(){
	var photos = document.getElementById('gallery_thumbnails') ; // Get item for gallery_thumbnails id
	var links = photos.getElementsByTagName('a') ; // Get all links in gallery_thumbnails
	var big_photo = document.getElementById('big_pict') ; // Get item big_pict id, full size picture
	var photo_title = document.getElementById('photo').getElementsByTagName('dt')[0] ; // ull size picture title

	// loop on all links in gallery_thumbnails
	for (var i = 0 ; i < links.length ; ++i) {	// if click on a link
		links[i].onclick = function() {
			big_photo.src = this.href; // Change src of image to link value
			big_photo.alt = this.title; // Change title
			photo_title.firstChild.nodeValue = this.title; // Change text of photo title
		return false;
		};
	}
}

function automatically() {
	if (currentIndx < Messages.length){
			currentIndx = currentIndx;
	}else{
		 currentIndx = 0;
	}
	//document.form_testimony.text1.value=Messages[currentIndx];
	document.getElementById('testimony').innerHTML=Messages[currentIndx];
	document.getElementById('guest').innerHTML=Guest[currentIndx];
		currentIndx=currentIndx+1;
	var delay = setTimeout("automatically()",7000)
}

function start() {
  displayPics();
  automatically();
}

window.onload = start;

//window.onload = displayPics;
//window.onload = automatically;

