/***************************************************************************
* Create a photo object                                                    *
***************************************************************************/
function photo(id, galleries_id, photo_ref, section_code, src, width, height, caption, thumbnail, thumbnail_width, thumbnail_height, home, gallery, description, takendate, photographer, location, item_price, purchase_instruction) {
	this.id = id;
	this.galleries_id = galleries_id;
	this.photo_ref = photo_ref;
	this.section_code = section_code;
	this.src = src;
	this.width = width;
	this.height = height;
	this.caption = caption;
	this.thumbnail = thumbnail;
	this.thumbnail_width = thumbnail_width;
	this.thumbnail_height = thumbnail_height;
	this.home = home;
	this.gallery = gallery;
	this.description = description;
	this.takendate = takendate;
	this.photographer = photographer;
	this.location = location;
	this.item_price = item_price;
	this.purchase_instruction = purchase_instruction;
}
/***************************************************************************
* Create a gallery object                                                  *
***************************************************************************/

function gallery(id,featured_images,title,section_code) {
	this.id = id;
	this.featured_images = featured_images;
	this.title = title;
	this.section_code = section_code;}

/***************************************************************************
* Select a random value from a comma separated list                        *
***************************************************************************/
function randomListVal(list) {
	arrayVals = list.split(',');
	pos = Math.round(Math.random() * (arrayVals.length - 1));
	debug('Returning ' + arrayVals[pos] + ' as random image');
	return arrayVals[pos];
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('900429');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = photos[j].src;
			img.width = photos[j].width;
			img.height = photos[j].height;
			}
			else {
				newImage = new Image(photos[j].width,photos[j].height);
				newImage.src = photos[j].src;
				document.images[img.name] = newImage;
				debug(newImage.src);
			}
			break;
		}
	}
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline() {
	
	imageID = randomListVal('900429');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !(0)) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
			document.title = photos[nextImg].caption;
			/* apply 'blank' classname to element where */			if ( photos[nextImg].caption == '') {
				document.getElementById('imageTitle').style.className = 'blank';
			}
			else {
				document.getElementById('imageTitle').style.className = 'normal';
			}
						temp = '';
			if (photos[nextImg].description != '') {
				temp = temp +  '<p id="imageDescription">' + photos[nextImg].description + '</p>';
			}
			if (photos[nextImg].photo_ref != '') {
				temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + photos[nextImg].photo_ref + '</p>';
			}
			if (photos[nextImg].takendate != '') {
				debug('Resetting taken date');
				temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + photos[nextImg].takendate + '</p>';
			}
			
			if (photos[nextImg].location != '') {
				debug('Resetting location');
				temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  photos[nextImg].location + '</p>';
			}
			
			if (photos[nextImg].photographer != '') {
				debug('Resetting photographer');
				temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.display = 'none';
		}
		else {
			document.getElementById('imageDetails').style.display = 'block';
		}
		document.getElementById('imageDetails').innerHTML =temp;	
		
	}
	else {
		debug('Redirecting to id ' + photos[nextImg].id);
		window.location = 'photo_' + photos[nextImg].id + '.html';
	}
}

/***************************************************************************
* Show the previous image for a gallery. field = hidden field containing   *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function previous(field,img) {


	imageID = field.value;
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k = j -1;
	while (nextImg < 0) {
		for (; k >= 0; k--) {
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				break;
			}
		}
		if (nextImg == -1) {
			k = photos.length -1;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);	
	}
}

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.
        *
* Gallery_id = id of gallery to choose                                     *
* 
 img = reference to html image                                       *
* in which to show image                                                   *
***************************************************************************/
function showGalleryImage(gallery_id, img) {
	debug('Gallery = ' + gallery_id);
	for (i = 0; i < galleries.length; i++) {
		if (galleries[i].id == gallery_id) {
			imageID = randomListVal(galleries[i].featured_images);
				for (j = 0; j < photos.length; j++) {
					if (photos[j].id == imageID) {
						
						img.src = photos[j].thumbnail;
						img.width = photos[j].thumbnail_width;
						img.height = photos[j].thumbnail_height;
						
						break;
					}
				}
			break;
		}
	} 
	}

/***************************************************************************
* If we have dynamic HTML                                                  *
*  replace the galleries link with a list that                             *
* doesn't include the current gallery                                      *
***************************************************************************/
function showGalleries(gallery_id) {
	debug('Showing links for gallery ' + gallery_id);
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
			debug('Testing gallery ' + galleries[i].id);
			
			if (galleries[i].id != gallery_id) {
				debug('Adding link');
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="gallery_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}
/***************************************************************************
* Create the array of Photo objects                                        *
***************************************************************************/
photos = new Array();
photos[0] = new photo(900642,'','','','http://www1.clikpic.com/KJWilliams/images/Kevin.jpg',495,330,'','http://www1.clikpic.com/KJWilliams/images/Kevin_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[1] = new photo(922935,'','','','http://www1.clikpic.com/KJWilliams/images/mont1.jpg',500,377,'','http://www1.clikpic.com/KJWilliams/images/mont1_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[2] = new photo(900457,'68835','BB10','gallery','http://www1.clikpic.com/KJWilliams/images/Peregrine11.jpg',495,330,'Peregrine Falcon','http://www1.clikpic.com/KJWilliams/images/Peregrine11_thumb.jpg',130, 87,0, 0,'I photographed this juvenile after stalking it for three hours. My wife was very patient.','17/07/06','K J Williams','Ramsay Island,Pembrokeshire, UK','','');
photos[3] = new photo(900458,'68835','BB20','gallery','http://www1.clikpic.com/KJWilliams/images/Peregrine21.jpg',495,343,'Peregrine Falcon','http://www1.clikpic.com/KJWilliams/images/Peregrine21_thumb.jpg',130, 90,0, 0,'This is the same juvenile Peregrine Falcon stepping around the cliff face on Ramsay. It was a beautiful day as you can tell by the intense blue sea.','17/07/06','Kevin J Williams','Ramsay Island, Pembrokeshire, UK','','');
photos[4] = new photo(900459,'68835','BB30','gallery','http://www1.clikpic.com/KJWilliams/images/Puffin11.jpg',495,322,'Puffin','http://www1.clikpic.com/KJWilliams/images/Puffin11_thumb.jpg',130, 85,0, 0,'Puffins nest in burrows and feed their chicks on Sand Eels at Skomer.','18/07/07','K J Williams','Skomer Island, Pembrokeshire, UK.','','');
photos[5] = new photo(900442,'68835','BB40','gallery','http://www1.clikpic.com/KJWilliams/images/Goldcrest11.jpg',495,362,'Goldcrest','http://www1.clikpic.com/KJWilliams/images/Goldcrest11_thumb.jpg',130, 95,0, 0,'It was too windy for the Dartford Warbler during my visit to Aylesbeare Heath but this Goldcrest popped out just long enough to photograph.','03/04/07','Kevin J Williams','Aylesbeare Heath, Devon, UK','','');
photos[6] = new photo(900453,'68835','BB50','gallery','http://www1.clikpic.com/KJWilliams/images/LongTailTit11.jpg',495,330,'Long Tail Tit','http://www1.clikpic.com/KJWilliams/images/LongTailTit11_thumb.jpg',130, 87,0, 0,'Long Tail Tits move in small flocks often visiting for only a short intense period before moving on.','04/04/07','Kevin J Williams','Berry Head, Brixham, Devon, UK','','');
photos[7] = new photo(900446,'68835','BB60','gallery','http://www1.clikpic.com/KJWilliams/images/Herring-Gull12.jpg',495,330,'Herring Gull','http://www1.clikpic.com/KJWilliams/images/Herring-Gull12_thumb.jpg',130, 87,0, 0,'I like the inquisitive look on this Herring Gull.','24/07/05','Kevin J Williams','Bempton Cliffs, Yorkshire, UK','','');
photos[8] = new photo(905823,'68835','BB70','gallery','http://www1.clikpic.com/KJWilliams/images/barnswallow1.jpg',500,329,'Barn Swallow','http://www1.clikpic.com/KJWilliams/images/barnswallow1_thumb.jpg',130, 86,0, 0,'Barn Swallow in full song at she Sluice, Minsmere. The fast frame rate on the 1D Mk II N helps to capture the right expression.','26/05/05','K J Williams','Minsmere, Suffolk, UK','','');
photos[9] = new photo(905837,'68835','BB80','gallery','http://www1.clikpic.com/KJWilliams/images/tern1.jpg',500,375,'Artic Tern','http://www1.clikpic.com/KJWilliams/images/tern1_thumb.jpg',130, 98,0, 0,'This was captured on a compact camera. The Terns defend their nest by pecking anybody getting too close. Take a hat if you go to the Farne Islands.','03/07/05','K J Williams','Inner Farne, Northumberland, UK','','');
photos[10] = new photo(905833,'68835','BB90','gallery','http://www1.clikpic.com/KJWilliams/images/GBBgull1.jpg',500,377,'Great Black Backed Gull','http://www1.clikpic.com/KJWilliams/images/GBBgull1_thumb.jpg',130, 98,0, 0,'This gull was on the attack and caught my head moments later.','16/07/06','K J Williams','Skomer, Pembrokeshire, UK','','');
photos[11] = new photo(905829,'68835','BB100','gallery','http://www1.clikpic.com/KJWilliams/images/gannet2.jpg',500,350,'Gannet','http://www1.clikpic.com/KJWilliams/images/gannet2_thumb.jpg',130, 91,0, 0,'Gannets have a 6 foot wingspan and are very impressive in flight.','27/07/05','K J Williams','Bempton Cliffs, Yorkshire, UK','','');
photos[12] = new photo(961920,'68835','BB105','gallery','http://www1.clikpic.com/KJWilliams/images/Mallard.jpg',495,372,'Mallard','http://www1.clikpic.com/KJWilliams/images/Mallard_thumb.jpg',130, 98,0, 0,'A shutter speed of 1/400 sec ensured the head was sharp and the wings blurred','21/10/06','K J Williams','Minsmere, Suffolk, UK','','');
photos[13] = new photo(920712,'68835','BB110','gallery','http://www1.clikpic.com/KJWilliams/images/Snipe11.jpg',495,371,'Common Snipe','http://www1.clikpic.com/KJWilliams/images/Snipe11_thumb.jpg',130, 97,0, 0,'','21/04/07','K J Williams','Minsmere, Suffolk, UK','','');
photos[14] = new photo(920715,'68835','BB120','gallery','http://www1.clikpic.com/KJWilliams/images/avocet1.jpg',495,343,'Avocet','http://www1.clikpic.com/KJWilliams/images/avocet1_thumb.jpg',130, 90,0, 0,'','21/04/07','K J Williams','Minsmere, Suffolk, UK','','');
photos[15] = new photo(2521267,'68835','BB122','gallery','http://www1.clikpic.com/KJWilliams/images/arctic tern.jpg',500,375,'Arctic Tern','http://www1.clikpic.com/KJWilliams/images/arctic tern_thumb.jpg',130, 98,0, 0,'Arctic Tern with sandeel.','21/07/08','Kevin Williams','Beadnell Bay, Northumbria, UK','','');
photos[16] = new photo(2220587,'68835','BB125','gallery','http://www1.clikpic.com/KJWilliams/images/Kittiwake.jpg',500,368,'Kittiwake','http://www1.clikpic.com/KJWilliams/images/Kittiwake_thumb.jpg',130, 96,0, 0,'','23/05/08','K Williams','RSPB Bemton Cliffs, Yorkshire UK','','');
photos[17] = new photo(2521278,'68835','BB126','gallery','http://www1.clikpic.com/KJWilliams/images/gannets feeding.jpg',500,343,'Gannets feeding','http://www1.clikpic.com/KJWilliams/images/gannets feeding_thumb.jpg',130, 89,0, 0,'Gannets diving for fish thrown from the boat.','22/07/08','Kevin Williams','Bass Rock, Scotland, UK','','');
photos[18] = new photo(2521281,'68835','BB128','gallery','http://www1.clikpic.com/KJWilliams/images/gannet view.jpg',500,353,'Gannet on Bass Rock','http://www1.clikpic.com/KJWilliams/images/gannet view_thumb.jpg',130, 92,0, 0,'Wide angle shot of Gannet on Bass Rock. I was within 2 feet of the bird after creeping up slow and low.','22/07/08','Kevin Williams','Bass Rock, Scotland, UK','','');
photos[19] = new photo(961839,'68835','BB130','gallery','http://www1.clikpic.com/KJWilliams/images/Heron1.jpg',495,313,'Grey Heron','http://www1.clikpic.com/KJWilliams/images/Heron1_thumb.jpg',130, 82,0, 0,'I was pleased with the motion blur on this image.','07/05/07','K J Williams','Minsmere, Suffolk, UK','','');
photos[20] = new photo(961844,'68835','BB140','gallery','http://www1.clikpic.com/KJWilliams/images/Heron2.jpg',495,370,'Grey Heron','http://www1.clikpic.com/KJWilliams/images/Heron2_thumb.jpg',130, 97,0, 0,'','07/05/07','K J Williams','Minsmere, Suffolk, UK','','');
photos[21] = new photo(2521284,'68835','BB142','gallery','http://www1.clikpic.com/KJWilliams/images/gannet pair.jpg',267,400,'Gannet Pair','http://www1.clikpic.com/KJWilliams/images/gannet pair_thumb.jpg',130, 195,0, 0,'Telephoto shot of a pair of nesting Gannets within the colony on Bass Rock.','22/07/08','Kevin Williams','Bass Rock Scotland, UK','','');
photos[22] = new photo(2521273,'68835','BB144','gallery','http://www1.clikpic.com/KJWilliams/images/terns.jpg',258,400,'Terns','http://www1.clikpic.com/KJWilliams/images/terns_thumb.jpg',130, 202,0, 0,'Pair of Terns scrapping','21/07/08','Kevin Williams','Beadnell Bay, Northumbria, UK','','');
photos[23] = new photo(1037638,'68835','BB150','gallery','http://www1.clikpic.com/KJWilliams/images/SedgeW.jpg',334,400,'Sedge Warbler','http://www1.clikpic.com/KJWilliams/images/SedgeW_thumb.jpg',130, 156,0, 0,'','03/06/07','K J Williams','Minsmere, Suffolk, UK','','');
photos[24] = new photo(900448,'68835','BB250','gallery','http://www1.clikpic.com/KJWilliams/images/Jackdaw11.jpg',267,400,'Jackdaw','http://www1.clikpic.com/KJWilliams/images/Jackdaw11_thumb.jpg',130, 195,0, 1,'This unfortunate Jackdaw had a crossed bill, even so he managed to get his share of any food on offer.','18/06/06','Kevin J Williams','Blakeney Point, Norfolk, UK','','');
photos[25] = new photo(957558,'68835','BB275','gallery','http://www1.clikpic.com/KJWilliams/images/blue_tit3.jpg',298,400,'Blue Tit','http://www1.clikpic.com/KJWilliams/images/blue_tit3_thumb.jpg',130, 174,0, 0,'Blue Tit','02/04/07','K J Williams','Brixham, Devon','','');
photos[26] = new photo(900438,'68835','BB300','gallery','http://www1.clikpic.com/KJWilliams/images/Gannet12.jpg',263,400,'Gannets','http://www1.clikpic.com/KJWilliams/images/Gannet12_thumb.jpg',130, 198,0, 0,'A Gannet couple in courtship, shaking heads and touching bills','24/07/05','Kevin J Williams','Bempton Cliffs, Yorkshire, UK','','');
photos[27] = new photo(2220588,'68835','BB320','gallery','http://www1.clikpic.com/KJWilliams/images/Guillemot.jpg',267,400,'Guilimot','http://www1.clikpic.com/KJWilliams/images/Guillemot_thumb.jpg',130, 195,0, 0,'','23/05/08','K J Williams','RSPB Bempton Cliffs, Yorkshire, UK','','');
photos[28] = new photo(905836,'68801','BEA5','gallery','http://www1.clikpic.com/KJWilliams/images/roller1.jpg',500,333,'Lilic Brested Roller','http://www1.clikpic.com/KJWilliams/images/roller1_thumb.jpg',130, 87,0, 0,'This bee eater has stunning plumage.','08/02/06','K J Williams','Masai Mara, Kenya.','','');
photos[29] = new photo(900825,'68801','BEA10','gallery','http://www1.clikpic.com/KJWilliams/images/BEagle1.jpg',500,371,'Bateleur Eagle','http://www1.clikpic.com/KJWilliams/images/BEagle1_thumb.jpg',130, 96,0, 0,'Don’t forget to look the wonderful eagles if you go to Kenya.','09/02/06','K J Williams. 400mm lens','Masai Mara, Kenya','','');
photos[30] = new photo(900827,'68801','BEA20','gallery','http://www1.clikpic.com/KJWilliams/images/BlackKite1.jpg',500,327,'Black Kite','http://www1.clikpic.com/KJWilliams/images/BlackKite1_thumb.jpg',130, 85,0, 0,'','13/02/07','K J Williams','Tsavo East, Kenya','','');
photos[31] = new photo(900435,'68801','BEA250','gallery','http://www1.clikpic.com/KJWilliams/images/FishEagle11.jpg',267,400,'Fish Eagle','http://www1.clikpic.com/KJWilliams/images/FishEagle11_thumb.jpg',130, 195,0, 0,'This shot was taken from a moving boat on Lake Naivasha.','05/02/06','K J Williams','Lake Naivasha, Kenya','','');
photos[32] = new photo(900450,'68801','BEA300','gallery','http://www1.clikpic.com/KJWilliams/images/Little-Egrit1.jpg',226,400,'Little Egret','http://www1.clikpic.com/KJWilliams/images/Little-Egrit1_thumb.jpg',130, 230,0, 0,'I love the reflection in this image, it seems to go on and on.','05/02/06','K J Williams','Lake Naivasha, Kenya','','');
photos[33] = new photo(900854,'68801','BEA400','gallery','http://www1.clikpic.com/KJWilliams/images/wire-tailed-swallow.jpg',259,400,'Wire Tailed Swallow','http://www1.clikpic.com/KJWilliams/images/wire-tailed-swallow_thumb.jpg',130, 201,0, 1,'The rich colours and the symmetry of the shot works well here.','06/02/06','K J Williams','Lake Naivasha, Kenya','','');
photos[34] = new photo(942966,'68801','BEA450','gallery','http://www1.clikpic.com/KJWilliams/images/Tawny Eagle.jpg',266,400,'Tawny Eagle','http://www1.clikpic.com/KJWilliams/images/Tawny Eagle_thumb.jpg',130, 195,0, 0,'','05/02/06','K J Williams','Lake Nakuru, Kenya','','');
photos[35] = new photo(900456,'68801','BEA500','gallery','http://www1.clikpic.com/KJWilliams/images/Pelican11.jpg',405,112,'Pelicans','http://www1.clikpic.com/KJWilliams/images/Pelican11_thumb.jpg',130, 36,0, 0,'Flocks of pelicans flew very close to our boat. It was a real treat.','05/02/06','Kevin J Williams','Lake Naivasha, Kenya','','');
photos[36] = new photo(900429,'68836','BM10','gallery','http://www1.clikpic.com/KJWilliams/images/Fox12.jpg',495,330,'Fox','http://www1.clikpic.com/KJWilliams/images/Fox12_thumb.jpg',130, 87,1, 0,'This was taken on an Andy Rouse workshop at the British Wildlife Centre.','02/03/07','Kevin J Williams','British Wildlife Centre','','');
photos[37] = new photo(900454,'68836','BM20','gallery','http://www1.clikpic.com/KJWilliams/images/Otter11.jpg',495,330,'Otter','http://www1.clikpic.com/KJWilliams/images/Otter11_thumb.jpg',130, 87,0, 0,'This image of an otter taken on an Andy Rouse workshop at the British Wildlife Centre.','02/03/07','Kevin J Williams','British Wildlife Centre','','');
photos[38] = new photo(900444,'68836','BM30','gallery','http://www1.clikpic.com/KJWilliams/images/GreySeal11.jpg',340,400,'Grey Seals','http://www1.clikpic.com/KJWilliams/images/GreySeal11_thumb.jpg',130, 153,0, 1,'This pup had just been born, mother is apprehensive and you can still see the blood on the pup.','18/11/06','K J Williams','Blakeney Point, Norfolk, UK','','');
photos[39] = new photo(1325603,'68836','BM4','gallery','http://www1.clikpic.com/KJWilliams/images/red squ 11.jpg',495,391,'Juvenile red squirrel','http://www1.clikpic.com/KJWilliams/images/red squ 11_thumb.jpg',130, 103,0, 0,'This juvenile red squirrel was attracted to feeders at the woods behind Killhope lead mine. There were a number of reds seen on a lovely walk The mine is also interesting and the staff very enthusiastic too. I have put the web site on my links page.','26/08/07','K Williams','Killhope mine, County Durham, UK','','');
photos[40] = new photo(900845,'68928','AEA10','gallery','http://www1.clikpic.com/KJWilliams/images/lion1.jpg',500,333,'Male Lion','http://www1.clikpic.com/KJWilliams/images/lion1_thumb.jpg',130, 87,0, 0,'This was one of two brothers, they were out of the pride and yet to challenge the alpha lion.','09/02/06','K J Williams','Masai Mara, Kenya','','');
photos[41] = new photo(904413,'68928','AEA20','gallery','http://www1.clikpic.com/KJWilliams/images/hippo2.jpg',500,333,'Hippopotamus','http://www1.clikpic.com/KJWilliams/images/hippo2_thumb.jpg',130, 87,0, 0,'Taken form a boat, you can get close to the hippo\'s on Lake Naivasha.','05/02/06','K J Williams','Lake Naivasha, Kenya','','');
photos[42] = new photo(900850,'68928','AEA30','gallery','http://www1.clikpic.com/KJWilliams/images/Wilderbeast1.jpg',500,333,'Wildebeest','http://www1.clikpic.com/KJWilliams/images/Wilderbeast1_thumb.jpg',130, 87,0, 0,'This group reminds me of meetings at work, ones looking away, ones scratching his head, ones only half interested and the one looking straight at you is actually concentrating on something more interesting!','09/02/06','K J Williams','Masai Mara, Kenya','','');
photos[43] = new photo(900831,'68928','AEA40','gallery','http://www1.clikpic.com/KJWilliams/images/Cheetah1.jpg',500,361,'Cheetah','http://www1.clikpic.com/KJWilliams/images/Cheetah1_thumb.jpg',130, 94,0, 0,'','07/02/06','K J Williams','Masai Mara, Kenya','','');
photos[44] = new photo(900847,'68928','AEA50','gallery','http://www1.clikpic.com/KJWilliams/images/lion2.jpg',416,400,'Lion Cub','http://www1.clikpic.com/KJWilliams/images/lion2_thumb.jpg',130, 125,0, 0,'','09/02/06','K J Williams','Masia Mara, Kenya','','');
photos[45] = new photo(900830,'68928','AEA60','gallery','http://www1.clikpic.com/KJWilliams/images/BlackRhino1.jpg',500,339,'Black Rhinoceros','http://www1.clikpic.com/KJWilliams/images/BlackRhino1_thumb.jpg',130, 88,0, 0,'','08/02/06','K J Williams','Masia Mara, Kenya','','');
photos[46] = new photo(905835,'68928','AEA200','gallery','http://www1.clikpic.com/KJWilliams/images/lion3.jpg',267,400,'Young Male Lion','http://www1.clikpic.com/KJWilliams/images/lion3_thumb.jpg',130, 195,0, 0,'A stunning image of a young male lion in Tsavo East, Kenya. See how red the soil is in Tsavo, the elephants are all this red colour.','14/02/07','K J Williams','Tsavo East, Kenya','','');
photos[47] = new photo(900841,'68928','AEA300','gallery','http://www1.clikpic.com/KJWilliams/images/Hippo1.jpg',267,400,'Hippopotamus and Calf','http://www1.clikpic.com/KJWilliams/images/Hippo1_thumb.jpg',130, 195,0, 1,'','07/02/07','K J Williams','Talek River, Masai Mara, Kenya','','');
photos[48] = new photo(904416,'68928','AEA400','gallery','http://www1.clikpic.com/KJWilliams/images/VervetMonkey1.jpg',267,400,'Vervet Monkey','http://www1.clikpic.com/KJWilliams/images/VervetMonkey1_thumb.jpg',130, 195,0, 0,'','05/02/07','K J Williams','Lake Naivasha, Kenya','','');
photos[49] = new photo(900833,'68928','AEA500','gallery','http://www1.clikpic.com/KJWilliams/images/Elephant12.jpg',495,256,'Elephants','http://www1.clikpic.com/KJWilliams/images/Elephant12_thumb.jpg',130, 67,0, 0,'This panoramic shows the red elephants of Tsavo against a backdrop of hills. The red colour comes from the red soil the elephants cake themselves in.','14/02/07','K J Williams','Tsavo East, Kenya','','');
photos[50] = new photo(900836,'68928','AEA510','gallery','http://www1.clikpic.com/KJWilliams/images/Elephant2.jpg',500,190,'Elephants','http://www1.clikpic.com/KJWilliams/images/Elephant2_thumb.jpg',130, 49,0, 0,'This panoramic shows the elephants of the Masai Mara on the plain. Compare their colouring with the elephants in Tsavo.','09/02/06','K J Williams','Masia Mara, Kenya','','');
photos[51] = new photo(900837,'68928','AEA520','gallery','http://www1.clikpic.com/KJWilliams/images/Giraffe1.jpg',500,146,'Giraffe','http://www1.clikpic.com/KJWilliams/images/Giraffe1_thumb.jpg',130, 38,0, 0,'','07/02/06','K J Williams','Masia Mara, Kenya','','');
photos[52] = new photo(904411,'69085','O10','gallery','http://www1.clikpic.com/KJWilliams/images/baldEagle1.jpg',500,333,'Bald Eagle','http://www1.clikpic.com/KJWilliams/images/baldEagle1_thumb.jpg',130, 87,0, 1,'The eagle is looking back over its shoulder','10/12/06','K J Williams','Banham Zoo, Norfolk','','');
photos[53] = new photo(905826,'69085','O20','gallery','http://www1.clikpic.com/KJWilliams/images/Dragonfly1.jpg',500,307,'Dragonfly','http://www1.clikpic.com/KJWilliams/images/Dragonfly1_thumb.jpg',130, 80,0, 0,'','03/07/05','K J Williams','Minsmere, Suffolk, UK','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(68835,'900448','British Birds','gallery');
galleries[1] = new gallery(68801,'900854','Birds East Africa','gallery');
galleries[2] = new gallery(68836,'900444','British mammals','gallery');
galleries[3] = new gallery(68928,'900841','Animals East Africa','gallery');
galleries[4] = new gallery(69085,'904411','Others','gallery');

