/***************************************************************************
* 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('2646674,2091015,1952870,1952725,1250754,794053');
	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('2646674,2091015,1952870,1952725,1250754,794053');
	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) || (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 + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'Ymzala Photography: ' + 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(794049,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia1.jpg',400,267,'Cheetah','http://www1.clikpic.com/portera/images/Namibia1_thumb.jpg',130, 87,0, 1,'A Cheetah from  Okonjima','','','Namibia','','');
photos[1] = new photo(794053,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia2.jpg',400,600,'Lion at Okonjima','http://www1.clikpic.com/portera/images/Namibia2_thumb.jpg',130, 195,1, 0,'A basking lion at Okonjima','','','','','');
photos[2] = new photo(794056,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia3.jpg',400,267,'Hyena','http://www1.clikpic.com/portera/images/Namibia3_thumb.jpg',130, 87,0, 0,'A bloody Hyena at Etosha','','','Etosha ','','');
photos[3] = new photo(794060,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia4.jpg',400,600,'Epupa Falls leaf','http://www1.clikpic.com/portera/images/Namibia4_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[4] = new photo(794062,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia5.jpg',400,267,'Bradenburg Mountains','http://www1.clikpic.com/portera/images/Namibia5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[5] = new photo(803046,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia8.jpg',400,267,'Etosha','http://www1.clikpic.com/portera/images/Namibia8_thumb.jpg',130, 87,0, 0,'A camel  thorn tree at Etosha National Park, Namibia. One of my favourite trees and a classic Namibian landscape.','','','','','');
photos[6] = new photo(803048,'61722','','gallery','http://www1.clikpic.com/portera/images/Namibia7.jpg',400,267,'Acacia','http://www1.clikpic.com/portera/images/Namibia7_thumb.jpg',130, 87,0, 0,'Acacia pods in the Namibian bush.','','','Namibia','','');
photos[7] = new photo(1250763,'61722','','gallery','http://www1.clikpic.com/portera/images/P3020116.jpg',500,375,'Epupa Falls, Namibia','http://www1.clikpic.com/portera/images/P3020116_thumb.jpg',130, 98,0, 0,'The Epupa falls are at the northern border of Namibia with Angola. They are exciting falls but difficult to get to and there are hardly any visitors.','','','Namibia','','');
photos[8] = new photo(1953439,'61722','','gallery','http://www1.clikpic.com/portera/images/IMG_3213.jpg',412,279,'Kuiseb','http://www1.clikpic.com/portera/images/IMG_3213_thumb.jpg',130, 88,0, 0,'The delightful Kuiseb river near Homeb. A remote place to camp and explore. This is on the extreme edge of the sand desert. North of here are the gravel plains.','','','Nasmibia','','');
photos[9] = new photo(1952748,'66758','','gallery','http://www1.clikpic.com/portera/images/IMG_5134.jpg',400,264,'The Walberswick Marsh near Southwold.','http://www1.clikpic.com/portera/images/IMG_5134_thumb.jpg',130, 86,0, 1,'The Walberswick Marsh is a wild place on the Suffolk coast. This photo was taken on the sea wall with the  beech to the left of the photo. There is a great danger that the coast will be eroded and the sea will wipe out this delightful marsh.','09/03/08','','Walberswick Marshes, Suffolk','','');
photos[10] = new photo(1952725,'66758','','gallery','http://www1.clikpic.com/portera/images/beech copy.jpg',400,251,'Sunset at Southwold','http://www1.clikpic.com/portera/images/beech copy_thumb.jpg',130, 82,1, 0,'February in Suffolk. The weather was warm and sunny all day so this sunset at Southwold was spectacular.<br>\r\nI used a long exposure to smooth out the waves to give a calm and peaceful effect.','11/02/08','Adrian Porter','Southwold, Sufffolk','','');
photos[11] = new photo(1952778,'66758','','gallery','http://www1.clikpic.com/portera/images/pylons.jpg',400,272,'Pylons at Snape','http://www1.clikpic.com/portera/images/pylons_thumb.jpg',130, 88,0, 0,'The early mornings in Suffolk were sunny with a ground mist. This made for excellent photography. I like this contrast of man made pylons striding over the agricultural countryside.','11/02/08','','Snape, Suffolk','','');
photos[12] = new photo(1952801,'66758','','gallery','http://www1.clikpic.com/portera/images/05.jpg',412,292,'Exmoor','http://www1.clikpic.com/portera/images/05_thumb.jpg',130, 92,0, 0,'A cold but sunny day on a walk to Pinkworthy pond. One of my favourite walks on Exmoor. I did not see a soul all day except some deer. It was biting cold but I felt so good after the walk.','26/01/08','A Porter','Exmoor, Devon','','');
photos[13] = new photo(868557,'66758','','gallery','http://www1.clikpic.com/portera/images/Lakes1.jpg',400,267,'Derwentwater','http://www1.clikpic.com/portera/images/Lakes1_thumb.jpg',130, 87,0, 1,'','','','','','');
photos[14] = new photo(868559,'66758','','gallery','http://www1.clikpic.com/portera/images/Lakes2.jpg',400,250,'Falcon Crag','http://www1.clikpic.com/portera/images/Lakes2_thumb.jpg',130, 81,0, 0,'Falcon crag is above Dewentwater','','','','','');
photos[15] = new photo(868570,'66758','','gallery','http://www1.clikpic.com/portera/images/Lakes3.jpg',400,267,'Stone wall','http://www1.clikpic.com/portera/images/Lakes3_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[16] = new photo(868571,'66758','','gallery','http://www1.clikpic.com/portera/images/Lakes4.jpg',400,263,'Valley along Lonscale fell','http://www1.clikpic.com/portera/images/Lakes4_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[17] = new photo(868572,'66758','','gallery','http://www1.clikpic.com/portera/images/Lakes5.jpg',400,267,'Mungrisdale common','http://www1.clikpic.com/portera/images/Lakes5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(868573,'66758','','gallery','http://www1.clikpic.com/portera/images/Lakes6.jpg',400,267,'Cloud shapes from Mungrisdale','http://www1.clikpic.com/portera/images/Lakes6_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[19] = new photo(1250748,'66758','','gallery','http://www1.clikpic.com/portera/images/IMG_9637.jpg',500,333,'Montgolfier meets Turenne in France.','http://www1.clikpic.com/portera/images/IMG_9637_thumb.jpg',130, 87,0, 0,'I was up early in the morning to take photos of the mist. We were staying at the top of this fortress town so I just rolled out of bed. Then I heard the puffing of the balloon and tracked its progress over the town.','','','Turenne, France','','');
photos[20] = new photo(1484914,'66758','','gallery','http://www1.clikpic.com/portera/images/BleaTarn.JPG',400,267,'Blea Tarn','http://www1.clikpic.com/portera/images/BleaTarn_thumb.JPG',130, 87,0, 0,'Langdale Pikes from Blea Tarn','','','Lakes','','');
photos[21] = new photo(1484916,'66758','','gallery','http://www1.clikpic.com/portera/images/Derwentwater1.JPG',400,267,'Derwentwater','http://www1.clikpic.com/portera/images/Derwentwater1_thumb.JPG',130, 87,0, 0,'Clouds over Derwentwater from Friar\'s Crag','','','','','');
photos[22] = new photo(1484919,'66758','','gallery','http://www1.clikpic.com/portera/images/FrairsCrag.JPG',400,267,'Derwentwater','http://www1.clikpic.com/portera/images/FrairsCrag_thumb.JPG',130, 87,0, 0,'Looking along the lakes from Friars Crag to Castle Crag.','','','Lakes','','');
photos[23] = new photo(1484922,'66758','','gallery','http://www1.clikpic.com/portera/images/Langdalepikes.JPG',400,236,'The Langdale pikes from Loughrigg tarn','http://www1.clikpic.com/portera/images/Langdalepikes_thumb.JPG',130, 77,0, 0,'The Langdale pikes from Loughrigg tarn','','','Lakes','','');
photos[24] = new photo(1484924,'66758','','gallery','http://www1.clikpic.com/portera/images/waterreflections.JPG',400,267,'Water reflections','http://www1.clikpic.com/portera/images/waterreflections_thumb.JPG',130, 87,0, 0,'Water reflections in a river in the Lakes high up on the fells.','','','Lakes','','');
photos[25] = new photo(1655537,'66758','','gallery','http://www1.clikpic.com/portera/images/DSCF0711 copy.jpg',500,403,'Storm over the Chilterns','http://www1.clikpic.com/portera/images/DSCF0711 copy_thumb.jpg',130, 105,0, 0,'This is high up in the Chilterns near Freith.','','','','','');
photos[26] = new photo(1953277,'66758','','gallery','http://www1.clikpic.com/portera/images/12.jpg',400,299,'Chiltern lane','http://www1.clikpic.com/portera/images/12_thumb.jpg',130, 97,0, 1,'I like the tunnel effect of these trees and this is on one of my bike runs so I am always going up or down this lane.','','','Chilterns','','');
photos[27] = new photo(1953416,'66758','','gallery','http://www1.clikpic.com/portera/images/NDevon-1 copy.jpg',312,412,'North Devon coast','http://www1.clikpic.com/portera/images/NDevon-1 copy_thumb.jpg',130, 172,0, 1,'Near Heddon\'s Mouth - this is a delightful walk along the rugged north devon coast.','','','North Devon','','');
photos[28] = new photo(1953442,'66758','','gallery','http://www1.clikpic.com/portera/images/P1010028 copy copy.jpg',400,295,'Chilterns','http://www1.clikpic.com/portera/images/P1010028 copy copy_thumb.jpg',130, 96,0, 0,'A storm over the chilterns.','','','Chilterns','','');
photos[29] = new photo(1250754,'66758','','gallery','http://www1.clikpic.com/portera/images/IMG_9650.jpg',500,750,'Morannes, France','http://www1.clikpic.com/portera/images/IMG_9650_thumb.jpg',130, 195,1, 0,'It was a stormy evening and the clouds were most vivid. I used a polariser and grad filter to enhance the effect.','','','Morannes France','','');
photos[30] = new photo(2090927,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6159.jpg',335,450,'Portnahaven, Islay','http://www1.clikpic.com/portera/images/IMG_6159_thumb.jpg',130, 175,0, 1,'The lighthouse and village of Portnahaven. A delightful place on the end of the island of Islay. Seals bask around the shore just yards from the houses. The lighthouse is actually on its own island.','04/04/08','A Porter','Portnahaven, Isaly','','');
photos[31] = new photo(2090930,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6217.jpg',450,307,'Port Ellen, Islay','http://www1.clikpic.com/portera/images/IMG_6217_thumb.jpg',130, 89,0, 1,'It was getting dark as I was taking photos on the beach. Then the light suddenly struck these cottages and with the dark clouds behind it made a dramatic scene.','04/04/08','A Porter','Port Ellen, Islay','','');
photos[32] = new photo(2090937,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6229.psd.jpg',450,314,'Port Ellen, Islay','http://www1.clikpic.com/portera/images/IMG_6229_thumb.psd.jpg',130, 91,0, 0,'The distillery  of Port Ellen is no longer in operation. The smoke from the nearby maltings makes for some dramatic clouds.','04/04/08','A Porter','Port Ellen, Islay','','');
photos[33] = new photo(2090945,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6275.jpg',450,306,'Craighouse, Jura','http://www1.clikpic.com/portera/images/IMG_6275_thumb.jpg',130, 88,0, 0,'The weather was great when we went over to Jura. A delightful island. This is the main town of Craighouse and there are plenty of photo opportunities around the small harbour.','04/04/08','A Porter','Jura','','');
photos[34] = new photo(2090956,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6333.jpg',450,300,'The paps of Jura','http://www1.clikpic.com/portera/images/IMG_6333_thumb.jpg',130, 87,0, 0,'The three summits of Jura looking good with a small covering of snow on top.','04/04/08','A Porter','Jura','','');
photos[35] = new photo(2090962,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6356.jpg',450,306,'Lagg, Jura','http://www1.clikpic.com/portera/images/IMG_6356_thumb.jpg',130, 88,0, 0,'This is the old drover\'s inn at Lagg. This was once a port for the ferry to Knapdale on the mainland.','04/04/08','','Jura','','');
photos[36] = new photo(2090987,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6434.jpg',450,300,'An old boat, Jura.','http://www1.clikpic.com/portera/images/IMG_6434_thumb.jpg',130, 87,0, 0,'This old boat is for sale and is on the single track road that runs most of the length of the Island.','04/04/08','','Jura','','');
photos[37] = new photo(2090996,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6549.jpg',450,263,'Claggain Bay','http://www1.clikpic.com/portera/images/IMG_6549_thumb.jpg',130, 76,0, 0,'A deserted beach on the South West part of the Island with some beautiful stones.','04/04/08','','Islay','','');
photos[38] = new photo(2090999,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6369.jpg',450,306,'Jura','http://www1.clikpic.com/portera/images/IMG_6369_thumb.jpg',130, 88,0, 0,'You can see across to the west coast of Scotland from this point on Jura. The road is single track in places and is quite desolate north of Craighouse.','04/04/08','','Jura','','');
photos[39] = new photo(2091015,'139525','','gallery','http://www1.clikpic.com/portera/images/IMG_6648.JPG',300,450,'Lower Killeyan beach','http://www1.clikpic.com/portera/images/IMG_6648_thumb.JPG',130, 195,1, 1,'A hidden beach with many surprises and beautiful stones.','04/04/08','','Islay','','');
photos[40] = new photo(1952870,'102285','','gallery','http://www1.clikpic.com/portera/images/beechgrasses.jpg',272,400,'Beach grasses','http://www1.clikpic.com/portera/images/beechgrasses_thumb.jpg',130, 191,1, 0,'This was on a Suffolk beach near Aldeburgh. I love the contrast of sky, stones and grass.','16/03/08','','Aldeburgh Suffolk','','');
photos[41] = new photo(1952844,'102285','','gallery','http://www1.clikpic.com/portera/images/trees copy.jpg',400,250,'Misty Beeches','http://www1.clikpic.com/portera/images/trees copy_thumb.jpg',130, 81,0, 0,'This is on a calm morning\'s walk in the Warburg reserve in Oxfordshire. A stunning place to photography beech trees and to enjoy the beauty of the Chiltern woodlands.','28/01/08','','Warburg, Oxfordshire','','');
photos[42] = new photo(1609649,'102285','','gallery','http://www1.clikpic.com/portera/images/Oak14Oct07.jpg',500,331,'Oak tree.','http://www1.clikpic.com/portera/images/Oak14Oct07_thumb.jpg',130, 86,0, 0,'This is one of a series from my Tree in a year shoot.','','','Chilterns','','');
photos[43] = new photo(1609655,'102285','','gallery','http://www1.clikpic.com/portera/images/IMG_2699.JPG',500,334,'Light beams','http://www1.clikpic.com/portera/images/IMG_2699_thumb.JPG',130, 87,0, 0,'Light beams at dawn on Moorend Common','','','Chilterns','','');
photos[44] = new photo(1953420,'102285','','gallery','http://www1.clikpic.com/portera/images/IMG_2585.jpg',412,279,'Beech trees','http://www1.clikpic.com/portera/images/IMG_2585_thumb.jpg',130, 88,0, 0,'Beech trees in the Chilterns at Autumn time can be most spectacular.','','','Chilterns','','');
photos[45] = new photo(2320261,'102285','','gallery','http://www1.clikpic.com/portera/images/IMG_7572.jpg',400,272,'Bluebells','http://www1.clikpic.com/portera/images/IMG_7572_thumb.jpg',130, 88,0, 1,'Bluebells in the woods. This photo was taken from a tripod, with slow exposure and moving the camera vertically. I wanted to capture the essence of the flowers carpeting the woods.','','','Cowleaze  woods near Stokenchurch','','');
photos[46] = new photo(2656445,'102285','','gallery','http://www1.clikpic.com/portera/images/Meadow Brown.jpg',500,519,'Meadow Brown','http://www1.clikpic.com/portera/images/Meadow Brown_thumb.jpg',130, 135,0, 1,'These are abundant butterflies on MoorEnd Common','','A Porter','MoorEnd Common','','');
photos[47] = new photo(1952803,'131166','','gallery','http://www1.clikpic.com/portera/images/IMG_4681.jpg',412,284,'Hen Harrier at Otmoor','http://www1.clikpic.com/portera/images/IMG_4681_thumb.jpg',130, 90,0, 0,'A hen harrier swooping over the reeds at Otmoor. A delightful set of lakes and marshes near Oxford. It spend some time swooping over the marsh and diving down on prey.','03/02/08','','Otmoor Oxford','','');
photos[48] = new photo(1952876,'131166','','gallery','http://www1.clikpic.com/portera/images/Birds in a day.jpg',412,278,'Vultures','http://www1.clikpic.com/portera/images/Birds in a day_thumb.jpg',130, 88,0, 0,'These vultures were just by the side of the road eating a dead antelope.<br>\r\nThis photo won a prize in the local wildlife photography competition.','09/04/07','','Kruger South Africa','','');
photos[49] = new photo(2320188,'131166','','gallery','http://www1.clikpic.com/portera/images/IMG_8395.JPG',400,174,'Puffins','http://www1.clikpic.com/portera/images/IMG_8395_thumb.JPG',130, 57,0, 0,'These puffins were taken on the Farne Islands off the West coast of Northumberland.','','','Farne Islands','','');
photos[50] = new photo(2646674,'131166','','gallery','http://www1.clikpic.com/portera/images/Africa.JPG',500,375,'Pale Chanting Goshawk','http://www1.clikpic.com/portera/images/Africa_thumb.JPG',130, 98,1, 1,'These two were sitting in a tree above the Cheetah feeding station at Africat.','','Adrian Porter','Namibia','','');
photos[51] = new photo(769922,'59581','','gallery','http://www1.clikpic.com/portera/images/Gambia006.jpg',400,310,'','http://www1.clikpic.com/portera/images/Gambia006_thumb.jpg',130, 101,0, 1,'','','','','','');
photos[52] = new photo(769934,'59581','','gallery','http://www1.clikpic.com/portera/images/Gambia005.jpg',400,601,'','http://www1.clikpic.com/portera/images/Gambia005_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[53] = new photo(769935,'59581','','gallery','http://www1.clikpic.com/portera/images/Gambia0041.jpg',400,267,'','http://www1.clikpic.com/portera/images/Gambia0041_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[54] = new photo(769936,'59581','','gallery','http://www1.clikpic.com/portera/images/Gambia0031.jpg',400,332,'Osprey','http://www1.clikpic.com/portera/images/Gambia0031_thumb.jpg',130, 108,0, 0,'','','','','','');
photos[55] = new photo(769938,'59581','','gallery','http://www1.clikpic.com/portera/images/Gambia0021.jpg',400,630,'','http://www1.clikpic.com/portera/images/Gambia0021_thumb.jpg',130, 205,0, 0,'','','','','','');
photos[56] = new photo(1952797,'131162','','gallery','http://www1.clikpic.com/portera/images/orange&lemon.jpg',270,400,'Oranges and Lemons','http://www1.clikpic.com/portera/images/orange&lemon_thumb.jpg',130, 193,0, 0,'I like to make marmalade and this is a back lit and photo-shopped image of some lemons.','06/02/08','','Studio','','');
photos[57] = new photo(1952879,'131162','','gallery','http://www1.clikpic.com/portera/images/textures.jpg',400,300,'A study in textures','http://www1.clikpic.com/portera/images/textures_thumb.jpg',130, 98,0, 0,'A gold mining town that had been turned into a living museum. I woke up early on my first day and took this picture through the dawn mist. I have added textures in photoshop.','07/03/07','','South Africa','','');
photos[58] = new photo(802942,'131162','','gallery','http://www1.clikpic.com/portera/images/Stars2.jpg',400,343,'Series of the lunar eclipse 3rd March 2007','http://www1.clikpic.com/portera/images/Stars2_thumb.jpg',130, 111,0, 0,'','','','','','');
photos[59] = new photo(802952,'131162','','gallery','http://www1.clikpic.com/portera/images/Stars6.jpg',400,267,'Star trails','http://www1.clikpic.com/portera/images/Stars6_thumb.jpg',130, 87,0, 0,'A 40min exposure in Devon. The lights on the horizon are from South Molten over 7 miles away.','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(61722,'794049','Namibia','gallery');
galleries[1] = new gallery(66758,'1953416,1953277,1952748,868557','Landscapes','gallery');
galleries[2] = new gallery(139525,'2091015,2090930,2090927','Islay & Jura','gallery');
galleries[3] = new gallery(102285,'2656445,2320261','Trees and Nature','gallery');
galleries[4] = new gallery(131166,'2646674','Birds','gallery');
galleries[5] = new gallery(102280,'794049,769922','Africa','gallery');
galleries[6] = new gallery(59581,'769922','Gambia','gallery');
galleries[7] = new gallery(131162,'1952879,1952797,802952,802942','Varied','gallery');

