var srcFile = new Array();
srcFile[0] = "70s";
srcFile[1] = "ayres_rock";
srcFile[2] = "books";
srcFile[3] = "buddha";
srcFile[4] = "bungee";
srcFile[5] = "coffee";
srcFile[6] = "food";
srcFile[7] = "footprints";
srcFile[8] = "friends";
srcFile[9] = "landscape";
srcFile[10] = "music";
srcFile[11] = "sunrise";
srcFile[12] = "travelling";
srcFile[13] = "wave";
srcFile[14] = "wine";

var altTag = new Array();
altTag[0] = "70's&hellip; inspiration era";
altTag[1] = "ayres rock&hellip; natureal beauty";
altTag[2] = "books&hellip; knowledge is power";
altTag[3] = "buddha&hellip; widom";
altTag[4] = "bungee&hellip; you can't beat a good bungee";
altTag[5] = "coffee&hellip; kick start your day with a good mocha";
altTag[6] = "food&hellip; welsh rack of lamb, new potatoes, rosemary&hellip; food for thought";
altTag[7] = "foorprints&hellip; footprints in the sand";
altTag[8] = "friends&hellip; our friends inspire us";
altTag[9] = "landscape&hellip; into the unknown";
altTag[10] = "music&hellip; lifts the soul";
altTag[11] = "sunrise&hellip; inspiring";
altTag[12] = "travelling&hellip; travel broadens the mind";
altTag[13] = "wave&hellip; nature's power harnessed";
altTag[14] = "wine&hellip; many a creative idea originates from a fine red";

function photo() {
	
	var randomNumber = Math.floor(Math.random()*15);
	document.getElementById('MainPic').innerHTML = "<img src=\"images/photos/" + srcFile[randomNumber] + ".jpg\" width=\"290\" height=\"300\" alt=\"" + altTag[randomNumber] + "\" />";

}

var currentPhoto = '';

if (document.images) {
  var gallerySrcFile = new Array();
	gallerySrcFile[0] = new Image(448,242); 
  gallerySrcFile[0].src = "images/photo_gallery/door.jpg";
	gallerySrcFile[1] = new Image(448,242); 
  gallerySrcFile[1].src = "images/photo_gallery/wave.jpg";
	gallerySrcFile[2] = new Image(448,242); 
  gallerySrcFile[2].src = "images/photo_gallery/bottles.jpg";
	gallerySrcFile[3] = new Image(448,242); 
  gallerySrcFile[3].src = "images/photo_gallery/horizon.jpg";
	gallerySrcFile[4] = new Image(448,242); 
  gallerySrcFile[4].src = "images/photo_gallery/cows.jpg";
	gallerySrcFile[5] = new Image(448,242); 
  gallerySrcFile[5].src = "images/photo_gallery/fridge.jpg";
}

var galleryTitle = new Array();
galleryTitle[0] = "Door";
galleryTitle[1] = "Wave";
galleryTitle[2] = "Bottles";
galleryTitle[3] = "Horizon";
galleryTitle[4] = "Cows";
galleryTitle[5] = "Fridge";

function showGallery(i) {
	document.getElementById('GalleryPhoto').innerHTML = '<img src="' + gallerySrcFile[i].src + '" width="448" height="242" alt="' + galleryTitle[i] + '" />';
	document.getElementById('GalleryControl').innerHTML = '<span id="GalleryTitle">' + galleryTitle[i] + '</span> <span class="Links"><a href="javascript:previousGallery();" class="Previous">previous</a> | <a href="javascript:closeGallery();">close</a> | <a href="javascript:nextGallery();" class="Next">next</a></span>';
	document.getElementById('GalleryBackground').style.display = 'block';
	document.getElementById('PhotoGallery').style.display = 'block';
	currentPhoto = i;
}
function closeGallery() {
	document.getElementById('GalleryPhoto').innerHTML = '<!-- clear -->';
	document.getElementById('GalleryControl').innerHTML = '<!-- clear -->';
	document.getElementById('PhotoGallery').style.display = 'none';
	document.getElementById('GalleryBackground').style.display = 'none';
}
function nextGallery() {
	currentPhoto = currentPhoto + 1
	if(currentPhoto > 5) {
		currentPhoto = 0;
	}
	document.getElementById('GalleryPhoto').innerHTML = '<img src="' + gallerySrcFile[currentPhoto].src + '" width="448" height="242" alt="' + galleryTitle[currentPhoto] + '" />';
	document.getElementById('GalleryTitle').innerHTML = galleryTitle[currentPhoto];
}
function previousGallery() {
	currentPhoto = currentPhoto - 1
	if(currentPhoto < 0) {
		currentPhoto = 5;
	}
	document.getElementById('GalleryPhoto').innerHTML = '<img src="' + gallerySrcFile[currentPhoto].src + '" width="448" height="242" alt="' + galleryTitle[currentPhoto] + '" />';
	document.getElementById('GalleryTitle').innerHTML = galleryTitle[currentPhoto];
}