/***************************************************************************
* 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('3406126,3406121,3406114,3406107,3406100,3406094,3406091,3405547,3405492,3405482,3405446,3405374,1691912,1691897,1691854,801752,801750,801748,801746,801745,801743,801688,801630,801626,801623,785418,785416,785412,785411,785410,785409,785408,785407,785405,785401,785397,785395,785393,785392,785389,785385,785380,785368,785358,785355,785352,785351,785349,785347,785346');
	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('3406126,3406121,3406114,3406107,3406100,3406094,3406091,3405547,3405492,3405482,3405446,3405374,1691912,1691897,1691854,801752,801750,801748,801746,801745,801743,801688,801630,801626,801623,785418,785416,785412,785411,785410,785409,785408,785407,785405,785401,785397,785395,785393,785392,785389,785385,785380,785368,785358,785355,785352,785351,785349,785347,785346');
	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 = 'David Kelly 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(3405374,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0484.JPG',600,544,'bald eagle I','http://www3.clikpic.com/DavidKelly/images/DSC_0484_thumb.JPG',130, 118,0, 1,'This female bald eagle was kept at the Ketchikan wildlife centre due to a damaged wing.','25/08/08','David Kelly','Ketchikan, Alaska','','');
photos[1] = new photo(3405446,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0069.JPG',600,438,'Kingfisher','http://www3.clikpic.com/DavidKelly/images/DSC_0069_thumb.JPG',130, 95,0, 0,'A Kingfisher in the rainforest watching the fish below','25/08/08','David Kelly','Ketchikan, Alaska','','');
photos[2] = new photo(3405492,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0278.JPG',580,581,'Reindeer I','http://www3.clikpic.com/DavidKelly/images/DSC_0278_thumb.JPG',130, 130,0, 0,'Reindeer at Ketchikan Wildlife Centre','25/08/08','David Kelly','Ketchikan, Alaska','','');
photos[3] = new photo(3405547,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0310.JPG',600,408,'Reindeer II','http://www3.clikpic.com/DavidKelly/images/DSC_0310_thumb.JPG',130, 88,0, 0,'Reindeer at Ketchikan wildlife Centre','25/08/08','David Kelly','Ketchikan, Alaska','','');
photos[4] = new photo(3406091,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0178.JPG',600,352,'Banff I','http://www3.clikpic.com/DavidKelly/images/DSC_0178_thumb.JPG',130, 76,0, 0,'Taken while eating our lunch in Banff just outside the town centre, not a bad view...','18/08/08','David Kelly','Banff, Canada','','');
photos[5] = new photo(3406094,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0178BW.JPG',600,352,'Banff I (B&W)','http://www3.clikpic.com/DavidKelly/images/DSC_0178BW_thumb.JPG',130, 76,0, 0,'Taken while eating our lunch in Banff just outside the town centre, not a bad view... very nice effect in black & white','18/08/08','David Kelly','Banff, Canada','','');
photos[6] = new photo(3406100,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0194.JPG',600,418,'How to travel in Banff','http://www3.clikpic.com/DavidKelly/images/DSC_0194_thumb.JPG',130, 91,0, 0,'','18/08/08','David Kelly','Banff, Canada','','');
photos[7] = new photo(3406107,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0237.JPG',600,802,'Chipmunk I','http://www3.clikpic.com/DavidKelly/images/DSC_0237_thumb.JPG',130, 174,0, 0,'Happy little chipmunk posing for the crowd','18/08/08','David Kelly','Banff, Canada','','');
photos[8] = new photo(3406114,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0274.JPG',500,739,'Banff II','http://www3.clikpic.com/DavidKelly/images/DSC_0274_thumb.JPG',130, 192,0, 0,'Looking over the woods and rivers while heading for the Banff Springs hotel','18/08/08','David Kelly','Banff, Canada','','');
photos[9] = new photo(3406121,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0280.JPG',600,407,'Chipmunk II','http://www3.clikpic.com/DavidKelly/images/DSC_0280_thumb.JPG',130, 88,0, 0,'Once the Chipmunk had finished posing he needed a snack','18/08/08','David Kelly','Banff, Canada','','');
photos[10] = new photo(3406126,'208057','','gallery','http://www3.clikpic.com/DavidKelly/images/DSC_0314.JPG',600,324,'Banff III','http://www3.clikpic.com/DavidKelly/images/DSC_0314_thumb.JPG',130, 70,0, 0,'Heading towards Banff Springs hotel, photo stop at the lake','18/08/08','David Kelly','Banff, Canada','','');
photos[11] = new photo(785257,'60932','','gallery','http://www3.clikpic.com/DavidKelly/images/Snow.jpg',600,395,'Seasons change','http://www3.clikpic.com/DavidKelly/images/Snow_thumb.jpg',130, 86,0, 0,'Here is a photo for when seasons change, even though it is simple i feel it is quite effective. (Nikon E3200)','08/02/07','David Kelly','Thorley','','');
photos[12] = new photo(785351,'60932','','gallery','http://www3.clikpic.com/DavidKelly/images/Flower_1.jpg',413,510,'Purple Shine','http://www3.clikpic.com/DavidKelly/images/Flower_1_thumb.jpg',130, 161,0, 0,'I called this one \'Purple Shine\' because the petals seem to be shining and it also has some nice details in the petals (Nikon E3200)','28/04/06','David Kelly','Bishop\'s Stortford','','');
photos[13] = new photo(785352,'60932','','gallery','http://www3.clikpic.com/DavidKelly/images/Flower_2.jpg',600,540,'Natural Fire','http://www3.clikpic.com/DavidKelly/images/Flower_2_thumb.jpg',130, 117,0, 0,'The colours in this flower are lovely and blend together well to give the feel of fire (Nikon E3200)','28/04/06','David Kelly','Bishop\'s Stortford','','');
photos[14] = new photo(785410,'60932','','gallery','http://www3.clikpic.com/DavidKelly/images/Trees.jpg',600,473,'Shing Through the Trees','http://www3.clikpic.com/DavidKelly/images/Trees_thumb.jpg',130, 102,0, 0,'The sun was shining perfectly so i thought i would take a photo under the trees and was very happy with the results (Nikon E3200)','08/05/05','David Kelly','Bishop\'s Stortford','','');
photos[15] = new photo(785416,'60932','','gallery','http://www3.clikpic.com/DavidKelly/images/weeping.jpg',600,473,'Sepia Weeping Willow','http://www3.clikpic.com/DavidKelly/images/weeping_thumb.jpg',130, 102,0, 0,'A weeping Willow in a Sepia tone.  (Nikon E3200)','30/03/05','David Kelly','Thorley','','');
photos[16] = new photo(1691854,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/LondonZoo(1) 039.jpg',600,484,'Time for Yoga','http://www3.clikpic.com/DavidKelly/images/LondonZoo(1) 039_thumb.jpg',130, 105,0, 0,'Taken in July at London Zoo (Nikon D80)','04/07/07','David Kelly','London Zoo','','');
photos[17] = new photo(1691897,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/LondonZoo(1) 024.jpg',600,543,'Vulture I','http://www3.clikpic.com/DavidKelly/images/LondonZoo(1) 024_thumb.jpg',130, 118,0, 0,'Vulture taken at London Zoo, sadly the head is a blurred but i love the pose.','04/07/07','David Kelly','London Zoo','','');
photos[18] = new photo(1691912,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/LondonZoo(1) 025.jpg',582,620,'Vulture II','http://www3.clikpic.com/DavidKelly/images/LondonZoo(1) 025_thumb.jpg',130, 138,0, 0,'Another taken at London Zoo, Am very happy with light and focus in this one','04/07/07','David Kelly','London Zoo','','');
photos[19] = new photo(3405482,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/LondonZoo(2) 050.jpg',600,404,'Monkey I','http://www3.clikpic.com/DavidKelly/images/LondonZoo(2) 050_thumb.jpg',130, 88,0, 0,'Lots of Monkeys jumping around this one stayed still compared to the others and got this lovely photo','04/07/07','David Kelly','London Zoo, England','','');
photos[20] = new photo(785342,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/Buzz_1.jpg',600,568,'Buzz I','http://www3.clikpic.com/DavidKelly/images/Buzz_1_thumb.jpg',130, 123,0, 0,'Decided to put this in animals has the bee is the main subject.  Sat taken photos of bees for over an hour but only two was i happy with.  (Nikon E3200)','15/08/06','David Kelly','Bishop\'s Stortford','','');
photos[21] = new photo(785346,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/Buzz_2.jpg',600,544,'Buzz II','http://www3.clikpic.com/DavidKelly/images/Buzz_2_thumb.jpg',130, 118,0, 0,'I like the detail in the bee on this one. (Nikon E3200)','15/08/06','David Kelly','Bishop\'s Stortford','','');
photos[22] = new photo(785349,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/Butterfly.jpg',600,464,'Camouflage','http://www3.clikpic.com/DavidKelly/images/Butterfly_thumb.jpg',130, 101,0, 0,'I was lucky i saw this little butterfly almost walk right passed him, the camouflage worked quite well then.  (Nikon E3200)','10/05/06','David Kelly','Bishop\'s Stortford','','');
photos[23] = new photo(785355,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/Meerkats_1.jpg',305,480,'Little and Large','http://www3.clikpic.com/DavidKelly/images/Meerkats_1_thumb.jpg',130, 205,0, 0,'Here is a photo of Meerkats at London Zoo (Nikon E3200)','25/01/06','David Kelly','London Zoo','','');
photos[24] = new photo(785358,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/Meerkats_2.jpg',582,503,'Meerkats','http://www3.clikpic.com/DavidKelly/images/Meerkats_2_thumb.jpg',130, 112,0, 0,'Meerkats at London Zoo (Nikon E3200)','25/01/06','David Kelly','London Zoo','','');
photos[25] = new photo(785401,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/Penguins.jpg',600,715,'Penguins','http://www3.clikpic.com/DavidKelly/images/Penguins_thumb.jpg',130, 155,0, 0,'Here is a photo of a couple of penguins at the Sea Life centre in Weymouth  (Nikon E3200)','15/08/05','David Kelly','Weymouth','','');
photos[26] = new photo(785393,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/birdonbush.jpg',600,473,'Look Around You','http://www3.clikpic.com/DavidKelly/images/birdonbush_thumb.jpg',130, 102,0, 0,'This bird stood there for quite a while letting me get some nice photographs of it.  (Nikon E3200)','14/08/05','David Kelly','Weymouth','','');
photos[27] = new photo(785395,'60945','','gallery','http://www3.clikpic.com/DavidKelly/images/birdonbush_2.jpg',600,473,'Bird on the Bush','http://www3.clikpic.com/DavidKelly/images/birdonbush_2_thumb.jpg',130, 102,0, 0,'This bird stood there for quite a while letting me get some nice photographs of it.  (Nikon E3200)','14/08/05','David Kelly','Weymouth','','');
photos[28] = new photo(801623,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarI.jpg',600,492,'Lunar Eclipse I','http://www3.clikpic.com/DavidKelly/images/LunarI_thumb.jpg',130, 107,0, 0,'Taken at the very start of the lunar eclipse.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[29] = new photo(801626,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarII.jpg',600,520,'Lunar Eclipse II','http://www3.clikpic.com/DavidKelly/images/LunarII_thumb.jpg',130, 113,0, 0,'The second in the series.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[30] = new photo(801630,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarIII.jpg',600,454,'Lunar Eclipse III','http://www3.clikpic.com/DavidKelly/images/LunarIII_thumb.jpg',130, 98,0, 0,'The third in the series, taken just before the full eclipse','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[31] = new photo(801688,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarIV.jpg',600,423,'Lunar Eclipse IV','http://www3.clikpic.com/DavidKelly/images/LunarIV_thumb.jpg',130, 92,0, 0,'Fourth in the series. First during the full eclipse.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[32] = new photo(801743,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarV.jpg',600,470,'Lunar Eclipse V','http://www3.clikpic.com/DavidKelly/images/LunarV_thumb.jpg',130, 102,0, 0,'Fifth in the Series.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[33] = new photo(801745,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarVI.jpg',600,499,'Lunar Eclipse VI','http://www3.clikpic.com/DavidKelly/images/LunarVI_thumb.jpg',130, 108,0, 0,'Sixth in the series.  Also my favorite of this series.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[34] = new photo(801746,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarVII.jpg',600,470,'Lunar Eclipse VII','http://www3.clikpic.com/DavidKelly/images/LunarVII_thumb.jpg',130, 102,0, 0,'Seventh in the series.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[35] = new photo(801748,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarVIII.jpg',600,514,'Lunar Eclipse VIII','http://www3.clikpic.com/DavidKelly/images/LunarVIII_thumb.jpg',130, 111,0, 0,'Eighth In the Series.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[36] = new photo(801750,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarIX.jpg',600,525,'Lunar Eclipse IX','http://www3.clikpic.com/DavidKelly/images/LunarIX_thumb.jpg',130, 114,0, 0,'Nineth in the series.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[37] = new photo(801752,'62188','','gallery','http://www3.clikpic.com/DavidKelly/images/LunarX.jpg',600,536,'Lunar Eclipse X','http://www3.clikpic.com/DavidKelly/images/LunarX_thumb.jpg',130, 116,0, 0,'The Tenth and Final Photograph of the Lunar Eclipse series. I hope you enjoyed them.','03/03/07','David Kelly','Bishop\'s Stortford','','');
photos[38] = new photo(785325,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/Sweets.jpg',600,450,'Sweets','http://www3.clikpic.com/DavidKelly/images/Sweets_thumb.jpg',130, 98,0, 1,'I try to do some still life photography a few months ago, wasn\'t happy with the results but edited the contrast and birghtness to get this interesting image. (Nikon E3200)','24/11/06','David Kelly','Bishop\'s Stortford','','');
photos[39] = new photo(785368,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/Flying_Colours.jpg',600,464,'Flying Colours','http://www3.clikpic.com/DavidKelly/images/Flying_Colours_thumb.jpg',130, 101,0, 0,'This was taken around christmas 2005, no editing has been done to this photo as i am completely happy with the colours (Nikon E3200)','19/12/05','David Kelly','London','','');
photos[40] = new photo(785397,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/Silhouette_1.jpg',380,520,'Electric Silhouette','http://www3.clikpic.com/DavidKelly/images/Silhouette_1_thumb.jpg',130, 178,0, 0,'This is part of a three-photo series all on the same photograph this one is called electric Silhouette.  (Nikon E3200)','08/05/05','David Kelly','Bishop\'s Stortford','','');
photos[41] = new photo(785405,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/Silhouette_2.jpg',380,510,'Horror Silhouette','http://www3.clikpic.com/DavidKelly/images/Silhouette_2_thumb.jpg',130, 174,0, 0,'This is part of a three-photo series of the same photograph, this one is call Horror Silhouette because it reminds me of a old horror movie (Nikon E3200)','08/05/05','David Kelly','Bishop\'s Stortford','','');
photos[42] = new photo(785407,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/Silhouette_3.jpg',380,510,'Silhouette','http://www3.clikpic.com/DavidKelly/images/Silhouette_3_thumb.jpg',130, 174,0, 0,'This is part of a three-photo series of the same photograph, as this was the first of the three it is simply called \'Silhouette\' (Nikon E3200)','08/05/05','David Kelly','Bishop\'s Stortford','','');
photos[43] = new photo(785411,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/yellowflower.jpg',600,473,'Yellow Flower I','http://www3.clikpic.com/DavidKelly/images/yellowflower_thumb.jpg',130, 102,0, 0,'This is a photo of a daffodil, i found it slightly boring so decided to muck around with the colours. (Nikon E3200)','30/03/05','David Kelly','Bishop\'s Stortford','','');
photos[44] = new photo(785412,'60950','','gallery','http://www3.clikpic.com/DavidKelly/images/yellowflower_2.jpg',509,520,'Yellow Flower','http://www3.clikpic.com/DavidKelly/images/yellowflower_2_thumb.jpg',130, 133,0, 0,'Found the image of a daffodil rather boring so edited it to this.  (Nikon E3200)','30/03/05','David Kelly','Bishop\'s Stortford','','');
photos[45] = new photo(785332,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Sunset.jpg',600,305,'Sunset in Sepia','http://www3.clikpic.com/DavidKelly/images/Sunset_thumb.jpg',130, 66,0, 0,'Here is a photo of a sunset that i decided to change to sepia has i think it gives it a nice feel (Nikon E3200)','09/11/06','David Kelly','Thorley','','');
photos[46] = new photo(785334,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Sunset_2.jpg',600,334,'Sunset I','http://www3.clikpic.com/DavidKelly/images/Sunset_2_thumb.jpg',130, 72,0, 0,'Here is a Sunset photo with more colour (Nikon E3200)','09/11/06','Bishop\'s Stortford','Thorley','','');
photos[47] = new photo(785336,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Sunset_3.jpg',600,305,'Sunset II','http://www3.clikpic.com/DavidKelly/images/Sunset_3_thumb.jpg',130, 66,0, 0,'Another sunset shot, this one has soft pastel colours which aren\'t sort after in sunset photos very much but i like it looks ok.  (Nikon E3200)','09/11/06','David Kelly','Thorley','','');
photos[48] = new photo(785347,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Grass.jpg',600,451,'Green Green Grass','http://www3.clikpic.com/DavidKelly/images/Grass_thumb.jpg',130, 98,0, 0,'I love that this is so simple but the green is so bright.  This is one of my favorites of my own photos','10/05/06','David Kelly','Bishop\'s Stortford','','');
photos[49] = new photo(785380,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Weymouth_1.jpg',600,373,'Inside the Cove','http://www3.clikpic.com/DavidKelly/images/Weymouth_1_thumb.jpg',130, 81,0, 0,'This was taken at Lulworth Cove near Weymouth, i use to visit here every year while on holiday in Weymouth (Nikon E3200)','17/08/05','David Kelly','Lulworth Cove','','');
photos[50] = new photo(785385,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Weymouth_2.jpg',600,381,'Out To Sea','http://www3.clikpic.com/DavidKelly/images/Weymouth_2_thumb.jpg',130, 83,0, 0,'Taken above Durdle Door (on the left of the photo) along the coastline  (Nikon E3200)','17/08/05','David Kelly','Durdle Door','','');
photos[51] = new photo(785389,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Weymouth_3.jpg',600,359,'Durdle Door II','http://www3.clikpic.com/DavidKelly/images/Weymouth_3_thumb.jpg',130, 78,0, 0,'My most popular photograph on deviantART looking out over Durdle Door   (Nikon E3200)','17/08/05','David Kelly','Durdle Door','','');
photos[52] = new photo(785392,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/Weymouth_4.jpg',600,473,'Durdle Door I','http://www3.clikpic.com/DavidKelly/images/Weymouth_4_thumb.jpg',130, 102,0, 0,'Durdle Door','17/08/05','David Kelly','Durdle Door','','');
photos[53] = new photo(785418,'60952','','gallery','http://www3.clikpic.com/DavidKelly/images/sepia.jpg',600,473,'Sepia Landscape','http://www3.clikpic.com/DavidKelly/images/sepia_thumb.jpg',130, 102,0, 0,'This landscape was very misty so decided to put it in a sepia tone and it gives it a nice old feel.   (Nikon E3200)','30/05/05','David Kelly','Bishop\'s stortford','','');
photos[54] = new photo(785408,'60954','','gallery','http://www3.clikpic.com/DavidKelly/images/church.jpg',600,450,'Gateway','http://www3.clikpic.com/DavidKelly/images/church_thumb.jpg',130, 98,0, 0,'This is St. James church in Thorley.  This photo was used on my Sister\'s wedding invites and order of service.  This photo was also published in my local paper, my first photo to be published.  (Nikon E3200)','08/05/05','David Kelly','Thorley','','');
photos[55] = new photo(785409,'60954','','gallery','http://www3.clikpic.com/DavidKelly/images/church_2.jpg',600,473,'Church View','http://www3.clikpic.com/DavidKelly/images/church_2_thumb.jpg',130, 102,0, 0,'This is a photograph of St. James church in Thorley from a distance','08/05/05','David Kelly','Thorley','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(208057,'3405374','Canada & Alaska','gallery');
galleries[1] = new gallery(60932,'785416,785410,785352,785351,785257','Plants & Flowers','gallery');
galleries[2] = new gallery(60945,'3405482,1691912,1691897,1691854,785401,785395,785393,785358,785355,785349','Animals','gallery');
galleries[3] = new gallery(62188,'801752,801750,801748,801746,801745,801743,801688,801630,801626,801623','Lunar Eclipse','gallery');
galleries[4] = new gallery(60950,'785325','Abstract','gallery');
galleries[5] = new gallery(60952,'785418,785392,785389,785385,785380,785347,785336,785334,785332','Landscapes & Waterscapes','gallery');
galleries[6] = new gallery(60954,'785409,785408','Other','gallery');

