/***************************************************************************
* 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('3490762,3490711,3490708,3490706,3490705,3490702,3490694,3490693,3490686,3490679,3490677,3490674,3490669,3490667,3490663,3490632,3490630,3490626,1811924,1811919,1811910,1811903,1811902,1142913,1112789,1112784,1112779,1112767,1112760,1112749');
	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('3490762,3490711,3490708,3490706,3490705,3490702,3490694,3490693,3490686,3490679,3490677,3490674,3490669,3490667,3490663,3490632,3490630,3490626,1811924,1811919,1811910,1811903,1811902,1142913,1112789,1112784,1112779,1112767,1112760,1112749');
	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 = 'Avocet Images: ' + 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(1112749,'81577','','gallery','http://www1.clikpic.com/martinjohnson/images/Chalkhillblue.jpg',400,320,'Chalkhill Blue (Royston, Herts)','http://www1.clikpic.com/martinjohnson/images/Chalkhillblue_thumb.jpg',130, 104,1, 0,'','','','','','');
photos[1] = new photo(1112760,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/Darter.jpg',400,500,'Darter Reflection, Australia','http://www1.clikpic.com/martinjohnson/images/Darter_thumb.jpg',130, 163,1, 0,'','','','','','');
photos[2] = new photo(1112767,'81578','','gallery','http://www1.clikpic.com/martinjohnson/images/Staticcrane.jpg',400,533,'Crane on a building site, reflected in the Regents Canal, London','http://www1.clikpic.com/martinjohnson/images/Staticcrane_thumb.jpg',130, 173,1, 1,'','','','','','');
photos[3] = new photo(1112774,'81575','','gallery','http://www1.clikpic.com/martinjohnson/images/Dartfordwarbler.jpg',400,320,'Dartford Warbler, Surrey','http://www1.clikpic.com/martinjohnson/images/Dartfordwarbler_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[4] = new photo(1112775,'81575','','gallery','http://www1.clikpic.com/martinjohnson/images/Gannet.jpg',400,500,'Gannet in flight, Bempton Cliffs, Yorkshire','http://www1.clikpic.com/martinjohnson/images/Gannet_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[5] = new photo(1112779,'81575','','gallery','http://www1.clikpic.com/martinjohnson/images/Oystercatcher.jpg',400,320,'Oystercatcher, Inner Farne, Northumberland','http://www1.clikpic.com/martinjohnson/images/Oystercatcher_thumb.jpg',130, 104,1, 1,'','','','','','');
photos[6] = new photo(1112780,'81575','','gallery','http://www1.clikpic.com/martinjohnson/images/Puffins.jpg',400,320,'Puffins, Inner Farne, Northumberland','http://www1.clikpic.com/martinjohnson/images/Puffins_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[7] = new photo(1112784,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/Americankestrel.jpg',400,500,'American Kestrel, St Lucia','http://www1.clikpic.com/martinjohnson/images/Americankestrel_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[8] = new photo(1112786,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/Honeyeater.jpg',400,320,'Blue-faced Honeyeater, Australia','http://www1.clikpic.com/martinjohnson/images/Honeyeater_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[9] = new photo(1112789,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/Sardinianwarbler.jpg',400,320,'Sardinian Warbler Young (Sitting on Tyre!), Spain','http://www1.clikpic.com/martinjohnson/images/Sardinianwarbler_thumb.jpg',130, 104,1, 1,'','','','','','');
photos[10] = new photo(1142913,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/Spoonbill.jpg',400,500,'Yellow-billed Spoonbill, Australia','http://www1.clikpic.com/martinjohnson/images/Spoonbill_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[11] = new photo(1811903,'121786','','gallery','http://www1.clikpic.com/martinjohnson/images/nathistorymus.jpg',400,300,'A night in the (Natural History) Museum','http://www1.clikpic.com/martinjohnson/images/nathistorymus_thumb.jpg',130, 98,1, 0,'','','','','','');
photos[12] = new photo(1811904,'121786','','gallery','http://www1.clikpic.com/martinjohnson/images/fireworks.jpg',400,286,'Fireworks at Alexandra Palace November 2007','http://www1.clikpic.com/martinjohnson/images/fireworks_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[13] = new photo(1811908,'121786','','gallery','http://www1.clikpic.com/martinjohnson/images/fairylight.jpg',400,560,'Christmas Fairy Lights, London','http://www1.clikpic.com/martinjohnson/images/fairylight_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[14] = new photo(1811909,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/daurianredstart.jpg',400,499,'Daurian Redstart, China','http://www1.clikpic.com/martinjohnson/images/daurianredstart_thumb.jpg',130, 162,0, 0,'','','','','','');
photos[15] = new photo(1811910,'81576','','gallery','http://www1.clikpic.com/martinjohnson/images/pacificplover.jpg',400,320,'Pacific Golden Plover, China','http://www1.clikpic.com/martinjohnson/images/pacificplover_thumb.jpg',130, 104,1, 1,'','','','','','');
photos[16] = new photo(1811919,'81578','','gallery','http://www1.clikpic.com/martinjohnson/images/defense1.jpg',400,400,'Window Reflection, Defense (Paris)','http://www1.clikpic.com/martinjohnson/images/defense1_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[17] = new photo(1811921,'81578','','gallery','http://www1.clikpic.com/martinjohnson/images/gasometer.jpg',400,320,'Gasometer support reflection, Regent\'s Canal, London','http://www1.clikpic.com/martinjohnson/images/gasometer_thumb.jpg',130, 104,0, 1,'','','','','','');
photos[18] = new photo(1811923,'81578','','gallery','http://www1.clikpic.com/martinjohnson/images/regencyhouse.jpg',400,300,'Old House by the Regent\'s Canal, London','http://www1.clikpic.com/martinjohnson/images/regencyhouse_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[19] = new photo(1811924,'121786','','gallery','http://www1.clikpic.com/martinjohnson/images/butterflywing.jpg',400,500,'Owl Butterfly Wing Pattern<br>\r\n(London Zoo)','http://www1.clikpic.com/martinjohnson/images/butterflywing_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[20] = new photo(1811925,'121786','','gallery','http://www1.clikpic.com/martinjohnson/images/peacock_1.jpg',400,500,'Detail from a Peacock\'s wing<br>\r\n(Bedfordshire)','http://www1.clikpic.com/martinjohnson/images/peacock_1_thumb.jpg',130, 163,0, 1,'','','','','','');
photos[21] = new photo(3490618,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Dinosaurbridge.jpg',400,286,'Dinosaur Bridge, Amsterdam','http://admin.clikpic.com/martinjohnson/images/Dinosaurbridge_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[22] = new photo(3490623,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Horseyseal.jpg',400,320,'Seal at Horsey (Norfolk)','http://admin.clikpic.com/martinjohnson/images/Horseyseal_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[23] = new photo(3490626,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Kewsculpture.jpg',400,533,'Detail of a Sculpture at Kew Gardens, London','http://admin.clikpic.com/martinjohnson/images/Kewsculpture_thumb.jpg',130, 173,1, 1,'','','','','','');
photos[24] = new photo(3490630,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Ringingwet.jpg',400,500,'\"Ringing Wet\"! Bicycle Bell, Amsterdam','http://admin.clikpic.com/martinjohnson/images/Ringingwet_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[25] = new photo(3490632,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Silentmovie.jpg',400,500,'\"Silent Movie\" (France)','http://admin.clikpic.com/martinjohnson/images/Silentmovie_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[26] = new photo(3490634,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Underthepylon.jpg',400,320,'Under the Pylon (London)','http://admin.clikpic.com/martinjohnson/images/Underthepylon_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[27] = new photo(3490663,'81574','','gallery','http://admin.clikpic.com/martinjohnson/images/Weepingmadonna.jpg',400,560,'\"Weeping Madonna\" (Epstein Sculpture, Glenkiln, Scotland)','http://admin.clikpic.com/martinjohnson/images/Weepingmadonna_thumb.jpg',130, 182,1, 1,'','','','','','');
photos[28] = new photo(3490665,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Amaryllis.jpg',400,286,'Helen\'s Amaryllis (London)','http://admin.clikpic.com/martinjohnson/images/Amaryllis_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[29] = new photo(3490667,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Blowfly.jpg',400,320,'Blow-fly on Thistle (Royston, Herts)','http://admin.clikpic.com/martinjohnson/images/Blowfly_thumb.jpg',130, 104,1, 1,'','','','','','');
photos[30] = new photo(3490669,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Bushcricket.jpg',400,286,'Speckled Bush-cricket (Cambridge)','http://admin.clikpic.com/martinjohnson/images/Bushcricket_thumb.jpg',130, 93,1, 1,'','','','','','');
photos[31] = new photo(3490670,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Commonblue.jpg',400,560,'Common Blue Butterfly on Lavender (France)','http://admin.clikpic.com/martinjohnson/images/Commonblue_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[32] = new photo(3490672,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Hoverfly.jpg',400,560,'Hoverfly on Anemone Plant (Royston, Herts)','http://admin.clikpic.com/martinjohnson/images/Hoverfly_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[33] = new photo(3490674,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Lurkingspider.jpg',400,500,'Lurking Spider! (Suffolk)','http://admin.clikpic.com/martinjohnson/images/Lurkingspider_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[34] = new photo(3490675,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Peacock.jpg',400,500,'Peacock Butterfly (Royston, Herts)','http://admin.clikpic.com/martinjohnson/images/Peacock_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[35] = new photo(3490677,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Southernhawker.jpg',400,560,'Southern Hawker Dragonfly (Hertfordshire)','http://admin.clikpic.com/martinjohnson/images/Southernhawker_thumb.jpg',130, 182,1, 1,'','','','','','');
photos[36] = new photo(3490679,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Swallowtail.jpg',400,286,'Swallowtail Butterfly (France)','http://admin.clikpic.com/martinjohnson/images/Swallowtail_thumb.jpg',130, 93,1, 1,'','','','','','');
photos[37] = new photo(3490681,'81577','','gallery','http://admin.clikpic.com/martinjohnson/images/Treefungi.jpg',400,286,'Tree Fungi (Cambridgeshire)','http://admin.clikpic.com/martinjohnson/images/Treefungi_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[38] = new photo(3490683,'81575','','gallery','http://admin.clikpic.com/martinjohnson/images/Dunnock.jpg',400,320,'Dunnock (London)','http://admin.clikpic.com/martinjohnson/images/Dunnock_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[39] = new photo(3490686,'81575','','gallery','http://admin.clikpic.com/martinjohnson/images/Greenheron.jpg',400,560,'Green Heron (a rare migrant to Britain, photographed at Hythe in Kent)','http://admin.clikpic.com/martinjohnson/images/Greenheron_thumb.jpg',130, 182,1, 1,'','','','','','');
photos[40] = new photo(3490688,'81575','','gallery','http://admin.clikpic.com/martinjohnson/images/Kestrel.jpg',400,500,'Kestrel (Royston, Herts)','http://admin.clikpic.com/martinjohnson/images/Kestrel_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[41] = new photo(3490690,'81575','','gallery','http://admin.clikpic.com/martinjohnson/images/Kittiwake.jpg',400,320,'Kittiwake (Inner Farne, Northumberland)','http://admin.clikpic.com/martinjohnson/images/Kittiwake_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[42] = new photo(3490691,'81575','','gallery','http://admin.clikpic.com/martinjohnson/images/Starling.jpg',400,320,'Starling (London)','http://admin.clikpic.com/martinjohnson/images/Starling_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[43] = new photo(3490693,'81576','','gallery','http://admin.clikpic.com/martinjohnson/images/Crossbill.jpg',400,500,'Common Crossbill (Ronda, Spain)','http://admin.clikpic.com/martinjohnson/images/Crossbill_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[44] = new photo(3490694,'81576','','gallery','http://admin.clikpic.com/martinjohnson/images/Piedstarling.jpg',400,320,'Asian Pied Starling (Mumbai, India)','http://admin.clikpic.com/martinjohnson/images/Piedstarling_thumb.jpg',130, 104,1, 1,'','','','','','');
photos[45] = new photo(3490696,'81576','','gallery','http://admin.clikpic.com/martinjohnson/images/Pondheron.jpg',400,500,'Indian Pond Heron (Mumbai, India)','http://admin.clikpic.com/martinjohnson/images/Pondheron_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[46] = new photo(3490700,'81576','','gallery','http://admin.clikpic.com/martinjohnson/images/Madgreywag.jpg',400,320,'Madeiran Grey Wagtail (Madeira!)','http://admin.clikpic.com/martinjohnson/images/Madgreywag_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[47] = new photo(3490701,'81576','','gallery','http://admin.clikpic.com/martinjohnson/images/Baldeagle.jpg',400,500,'Bald Eagle (Captive Bird, UK)','http://admin.clikpic.com/martinjohnson/images/Baldeagle_thumb.jpg',130, 163,0, 1,'','','','','','');
photos[48] = new photo(3490702,'81576','','gallery','http://admin.clikpic.com/martinjohnson/images/Roller.jpg',400,300,'Lilac-breasted Roller (captive bird, UK)','http://admin.clikpic.com/martinjohnson/images/Roller_thumb.jpg',130, 98,1, 1,'','','','','','');
photos[49] = new photo(3490703,'81578','','gallery','http://admin.clikpic.com/martinjohnson/images/Amsterdam.jpg',400,320,'Amsterdam Canal Reflection','http://admin.clikpic.com/martinjohnson/images/Amsterdam_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[50] = new photo(3490705,'81578','','gallery','http://admin.clikpic.com/martinjohnson/images/Bmwbonnet.jpg',400,320,'Reflection in the bonnet of a BMW!','http://admin.clikpic.com/martinjohnson/images/Bmwbonnet_thumb.jpg',130, 104,1, 1,'','','','','','');
photos[51] = new photo(3490706,'81578','','gallery','http://admin.clikpic.com/martinjohnson/images/Londoneye.jpg',400,500,'The London Eye!','http://admin.clikpic.com/martinjohnson/images/Londoneye_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[52] = new photo(3490708,'81578','','gallery','http://admin.clikpic.com/martinjohnson/images/Windowworld.jpg',400,500,'\"Window World\", Regents Canal, London','http://admin.clikpic.com/martinjohnson/images/Windowworld_thumb.jpg',130, 163,1, 1,'','','','','','');
photos[53] = new photo(3490711,'81578','','gallery','http://admin.clikpic.com/martinjohnson/images/Nicepuddle.jpg',400,533,'Puddle reflection, Nice (France)','http://admin.clikpic.com/martinjohnson/images/Nicepuddle_thumb.jpg',130, 173,1, 1,'','','','','','');
photos[54] = new photo(3490762,'121786','','gallery','http://admin.clikpic.com/martinjohnson/images/Autumnleaves.jpg',400,300,'Autumn Leaves (Still Life)','http://admin.clikpic.com/martinjohnson/images/Autumnleaves_thumb.jpg',130, 98,1, 1,'','','','','','');
photos[55] = new photo(3490771,'121786','','gallery','http://admin.clikpic.com/martinjohnson/images/Mountpandim.jpg',400,286,'Mount Pandim, Sikkim','http://admin.clikpic.com/martinjohnson/images/Mountpandim_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[56] = new photo(3490772,'121786','','gallery','http://admin.clikpic.com/martinjohnson/images/Pineconedetail.jpg',400,320,'Pine Cone detail','http://admin.clikpic.com/martinjohnson/images/Pineconedetail_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[57] = new photo(3490774,'121786','','gallery','http://admin.clikpic.com/martinjohnson/images/Salfordquays.jpg',400,320,'Salford Quays bridge, Manchester','http://admin.clikpic.com/martinjohnson/images/Salfordquays_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[58] = new photo(3490776,'121786','','gallery','http://admin.clikpic.com/martinjohnson/images/Scottishtrawler.jpg',400,320,'Trawler returning to port, Portpatrick, Scotland','http://admin.clikpic.com/martinjohnson/images/Scottishtrawler_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[59] = new photo(1811902,'121786','','gallery','http://www1.clikpic.com/martinjohnson/images/docklandsrope.jpg',400,533,'A sunset in London\'s Docklands','http://www1.clikpic.com/martinjohnson/images/docklandsrope_thumb.jpg',130, 173,1, 1,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(81577,'3490679,3490677,3490674,3490669,3490667','Macro Photography of Insects and Plants','gallery');
galleries[1] = new gallery(81574,'3490663,3490632,3490630,3490626','Monochrome','gallery');
galleries[2] = new gallery(81578,'3490711,3490708,3490706,3490705,1811921,1811919,1112767','Reflections','gallery');
galleries[3] = new gallery(121786,'3490762,1811925,1811924,1811902','Rural and Urban Landscapes, Travel and Patterns','gallery');
galleries[4] = new gallery(81575,'3490686,1112779','UK Birds','gallery');
galleries[5] = new gallery(81576,'3490702,3490701,3490694,3490693,1811910,1142913,1112789,1112784','World Birds','gallery');

