/***************************************************************************
* 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('2432465,2432464,2432463,2432461,2432460,2432457,2432455,2432453,2432449,2432445,2432444,2432443,2432437,2432370,2432367,2432366,2432364,2432361,2432360,2432358');
	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('2432465,2432464,2432463,2432461,2432460,2432457,2432455,2432453,2432449,2432445,2432444,2432443,2432437,2432370,2432367,2432366,2432364,2432361,2432360,2432358');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('section199763' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="section199763.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 ('section199763' != '') {
				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(1761207,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/DUNE45_P1.jpg',400,294,'Dune 45','http://www1.clikpic.com/bobpearson/images/DUNE45_P1_thumb.jpg',130, 96,0, 0,'Found along the route from Sesriem to Sossusvlei, one of the most easily recognised and most photographed dunes, Dune 45 in the early evening light looks at its best','','','','','');
photos[1] = new photo(1761221,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Sand-Pattern1.jpg',400,226,'Sand Pattern','http://www1.clikpic.com/bobpearson/images/Sand-Pattern1_thumb.jpg',130, 73,0, 0,'The ripples in the sand form beautiful patterns on the small dune in this image taken in Wolvedans in the Namib Rand Nature Reserve,Namibia','','','','','');
photos[2] = new photo(1761259,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/DUNES10_P1.jpg',400,210,'Dunes','http://www1.clikpic.com/bobpearson/images/DUNES10_P1_thumb.jpg',130, 68,0, 0,'The very first light over the Sand Sea at Sossusvlei','','','','','');
photos[3] = new photo(1761153,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Dead-tree-against-tufted-gr1.jpg',266,400,'Dead Vlei, Dead Tree','http://www1.clikpic.com/bobpearson/images/Dead-tree-against-tufted-gr1_thumb.jpg',130, 195,0, 1,'The light has now changed, striking the tufts of grass clinging to the dunes and giving a pale apricot glow','','','','','');
photos[4] = new photo(1761033,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/DEAD_VLEI_MD3_P6.jpg',400,268,'Changing Colours','http://www1.clikpic.com/bobpearson/images/DEAD_VLEI_MD3_P6_thumb.jpg',130, 87,0, 0,'For a brief period in the early morning, the reflected light from the opposite sunlit dunes of Dead Vlei pan turns the blue shadows violet','','','','','');
photos[5] = new photo(1761281,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/WOLVERDANS6_MOD1.jpg',400,267,'Tree','http://www1.clikpic.com/bobpearson/images/WOLVERDANS6_MOD1_thumb.jpg',130, 87,0, 0,'This image was taken in Wolwedans in the Namib Rand Nature Reserve.  The orange dune, golden grasses and subdued green of the tree complement the mauve hue taken on by the background dunes - a combination of shadow and reflected blue light from the morning sky','','','','','');
photos[6] = new photo(1761275,'16532','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/WOLVERDANS2_3P1.jpg',400,238,'Wolwedans','http://www1.clikpic.com/bobpearson/images/WOLVERDANS2_3P1_thumb.jpg',130, 77,0, 0,'Dawn over Chateau Plains, Wolwedans in the Namib Rand Nature Reserve.  This is the quality of light just before it floods over the plain at dawn','','','','','');
photos[7] = new photo(336438,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/ZEBRA.jpg',264,400,'Burchell\'s Zebra','http://www1.clikpic.com/bobpearson/images/ZEBRA_thumb.jpg',130, 197,0, 0,'Burchell\'s Zebra with Oxpecker','','','','','');
photos[8] = new photo(335598,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/LION.jpg',277,400,'Lion cub','http://www1.clikpic.com/bobpearson/images/LION_thumb.jpg',130, 188,0, 0,'A lion cub makes its way across a flooded area in Moremi Game Reserve.','','','','','');
photos[9] = new photo(335601,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/LIONS.jpg',400,302,'Lioness and Cub','http://www1.clikpic.com/bobpearson/images/LIONS_thumb.jpg',130, 98,0, 1,'A Lioness and her cub at rest','','','','','');
photos[10] = new photo(336365,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/WILD_DOG21.jpg',400,298,'African Wild Dog','http://www1.clikpic.com/bobpearson/images/WILD_DOG21_thumb.jpg',130, 97,0, 0,'One of a family of six wild dogs near Xakanaxa, Moremi Game Reserve.','','','','','');
photos[11] = new photo(336383,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/W_DOG.jpg',400,298,'African Wild Dog - portrait','http://www1.clikpic.com/bobpearson/images/W_DOG_thumb.jpg',130, 97,0, 0,'Taken during the time watching the pack.','','','','','');
photos[12] = new photo(336469,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/LOURIE.jpg',251,400,'Grey Lourie','http://www1.clikpic.com/bobpearson/images/LOURIE_thumb.jpg',130, 207,0, 0,'In Moremi Game Reserve','','','','','');
photos[13] = new photo(336473,'28112','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/ROLLER.jpg',248,400,'Lilac-breasted Roller','http://www1.clikpic.com/bobpearson/images/ROLLER_thumb.jpg',130, 210,0, 0,'','','','','','');
photos[14] = new photo(1761409,'116682','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob61383.jpg',271,400,'Japanese Macaques - Adult and Young','http://www1.clikpic.com/bobpearson/images/_bob61383_thumb.jpg',130, 192,0, 0,'','','','','','');
photos[15] = new photo(1761349,'116682','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob98681.jpg',400,271,'Steller\'s Sea Eagle Landing','http://www1.clikpic.com/bobpearson/images/_bob98681_thumb.jpg',130, 88,0, 1,'Awarded 33rd Smethwick International Exhibition of Photography PSA Silver Medal (Nature Projected Images)','','','','','');
photos[16] = new photo(1761352,'116682','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob9985-Edit2.jpg',400,261,'Steller\'s Sea Eagle taking off','http://www1.clikpic.com/bobpearson/images/_bob9985-Edit2_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[17] = new photo(2456517,'116682','','gallery','http://www1.clikpic.com/bobpearson/images/Macaques-Grooming1.jpg',400,270,'Macaques_Grooming','http://www1.clikpic.com/bobpearson/images/Macaques-Grooming1_thumb.jpg',130, 88,0, 0,'33rd Smethwick International Exhibition of Photography 2008 FIAP Gold Medal (Nature Prints)','','','','','');
photos[18] = new photo(1761393,'116682','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob6260-Edit1.jpg',400,263,'Japanese Macaque Jumping','http://www1.clikpic.com/bobpearson/images/_bob6260-Edit1_thumb.jpg',130, 85,0, 0,'Snow Monkey jumping out of the hot spring pool.  Image awarded PSA Ribbon in the 33rd Smethwick International Exhibition of Photography 2008','','','','','');
photos[19] = new photo(2453628,'116682','','gallery','http://www1.clikpic.com/bobpearson/images/Whooper-Swans.jpg',400,283,'Whooper Swans','http://www1.clikpic.com/bobpearson/images/Whooper-Swans_thumb.jpg',130, 92,0, 0,'Awarded 33rd Smethwick International Exhibition of Photography PSA Gold Medal (Nature Projected Images)','','','','','');
photos[20] = new photo(1761419,'116682','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob59473.jpg',271,400,'Japanese Macaque Portrait','http://www1.clikpic.com/bobpearson/images/_bob59473_thumb.jpg',130, 192,0, 0,'(Snow Monkey)','','','','','');
photos[21] = new photo(2432358,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/1_albatross2.jpg',400,248,'Waved Albatross and Moon','http://www1.clikpic.com/bobpearson/images/1_albatross2_thumb.jpg',130, 81,1, 0,'','','','Punta Suarez, Espanola','','');
photos[22] = new photo(2452136,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Winter_Tree1.jpg',282,400,'Winter Tree','http://www1.clikpic.com/bobpearson/images/Winter_Tree1_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[23] = new photo(2452125,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Solitude1.jpg',400,270,'Solitude','http://www1.clikpic.com/bobpearson/images/Solitude1_thumb.jpg',130, 88,0, 1,'This print has been accepted in the RPS 151st International Print Exhibition 2008, sponsored by Allen & Overy LLP','','','','','');
photos[24] = new photo(2452118,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Lone_Tree1.jpg',400,270,'Lone Tree','http://www1.clikpic.com/bobpearson/images/Lone_Tree1_thumb.jpg',130, 88,0, 1,'Bristol Salon of Photography 62nd International Exhbition 2008 RPS Gold Medal Best Landscape','','','','','');
photos[25] = new photo(2432360,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/2_Swallowtail1.jpg',400,285,'Swallow Tailed Gull','http://www1.clikpic.com/bobpearson/images/2_Swallowtail1_thumb.jpg',130, 93,1, 0,'','','','Punta Suarez, Espanola','','');
photos[26] = new photo(2452310,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Four_Trees3.jpg',400,235,'Four Trees','http://www1.clikpic.com/bobpearson/images/Four_Trees3_thumb.jpg',130, 76,0, 0,'','','','','','');
photos[27] = new photo(2452304,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Barren_trees2.jpg',400,270,'Barren Trees','http://www1.clikpic.com/bobpearson/images/Barren_trees2_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[28] = new photo(2432361,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/3_Hawk1.jpg',400,282,'Galapagos Hawk','http://www1.clikpic.com/bobpearson/images/3_Hawk1_thumb.jpg',130, 92,1, 1,'','','','Punta Tortuga Negra, Isabella','','');
photos[29] = new photo(2432364,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/4_diving_booby1.jpg',273,400,'Blue Footed Booby Diving','http://www1.clikpic.com/bobpearson/images/4_diving_booby1_thumb.jpg',130, 190,1, 0,'','','','Urvina Bay, Isabella','','');
photos[30] = new photo(2452131,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Tree&Hillside.jpg',400,270,'Tree and Hillside','http://www1.clikpic.com/bobpearson/images/Tree&Hillside_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[31] = new photo(2432366,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/5_Tropic_Bird1.jpg',400,285,'Red-billed Tropicbird','http://www1.clikpic.com/bobpearson/images/5_Tropic_Bird1_thumb.jpg',130, 93,1, 0,'','','','South Plaza','','');
photos[32] = new photo(2452715,'158078','','gallery','http://www1.clikpic.com/bobpearson/images/Bison-in-the-Landscape.jpg',270,400,'Bison in the Landscape','http://www1.clikpic.com/bobpearson/images/Bison-in-the-Landscape_thumb.jpg',130, 193,0, 0,'','','','','','');
photos[33] = new photo(2432367,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/6_Pelicans1.jpg',400,276,'Brown Pelicans','http://www1.clikpic.com/bobpearson/images/6_Pelicans1_thumb.jpg',130, 90,1, 0,'','','','Mosquera','','');
photos[34] = new photo(2432370,'157069','','section199763','http://www1.clikpic.com/bobpearson/images/7_Albatross_flying1.jpg',400,285,'Waved Albatross in Flight','http://www1.clikpic.com/bobpearson/images/7_Albatross_flying1_thumb.jpg',130, 93,1, 0,'','','','Punta Suarez, Espanola','','');
photos[35] = new photo(2452127,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/Three_Tree_Trunks1.jpg',400,260,'Three Tree Trunks','http://www1.clikpic.com/bobpearson/images/Three_Tree_Trunks1_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[36] = new photo(2452313,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/mammoth1.jpg',400,270,'Mammoth','http://www1.clikpic.com/bobpearson/images/mammoth1_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[37] = new photo(2452123,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/Snow_Laden_Tree1.jpg',400,270,'Snow-laden Tree','http://www1.clikpic.com/bobpearson/images/Snow_Laden_Tree1_thumb.jpg',130, 88,0, 1,'','','','','','');
photos[38] = new photo(2452113,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/Burnt-Pines1.jpg',400,220,'Burnt Pines','http://www1.clikpic.com/bobpearson/images/Burnt-Pines1_thumb.jpg',130, 72,0, 0,'','','','','','');
photos[39] = new photo(2452132,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/Tree&Pool1.jpg',400,270,'Trees and Pool','http://www1.clikpic.com/bobpearson/images/Tree&Pool1_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[40] = new photo(2452122,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/Snow_Contour1.jpg',400,270,'Snow Contours','http://www1.clikpic.com/bobpearson/images/Snow_Contour1_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[41] = new photo(2452135,'157666','','gallery','http://www1.clikpic.com/bobpearson/images/Tree_Shadows1.jpg',400,270,'Tree Shadows','http://www1.clikpic.com/bobpearson/images/Tree_Shadows1_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[42] = new photo(2432437,'157082','','section199763','http://www1.clikpic.com/bobpearson/images/8_lizard.jpg',270,400,'Lava Lizard on uplifted coral head','http://www1.clikpic.com/bobpearson/images/8_lizard_thumb.jpg',130, 193,1, 0,'','','','Urvina Bay, Isabella','','');
photos[43] = new photo(2432443,'157082','','section199763','http://www1.clikpic.com/bobpearson/images/9_sea_lions_surfing.jpg',400,260,'Galapagos Sea Lions surfing','http://www1.clikpic.com/bobpearson/images/9_sea_lions_surfing_thumb.jpg',130, 85,1, 0,'','','','Punta Suarez, Espanola','','');
photos[44] = new photo(2432444,'157082','','section199763','http://www1.clikpic.com/bobpearson/images/10_crab.jpg',400,285,'Sally Lightfoot Crab in surf','http://www1.clikpic.com/bobpearson/images/10_crab_thumb.jpg',130, 93,1, 1,'','','','Bartholome, Santiago','','');
photos[45] = new photo(2432445,'157082','','section199763','http://www1.clikpic.com/bobpearson/images/11_flamingo.jpg',400,247,'Greater Flamingo','http://www1.clikpic.com/bobpearson/images/11_flamingo_thumb.jpg',130, 80,1, 0,'','','','Punta Cormoran, Floreana','','');
photos[46] = new photo(2432449,'157082','','section199763','http://www1.clikpic.com/bobpearson/images/12_heron.jpg',400,268,'Striated Heron with catch','http://www1.clikpic.com/bobpearson/images/12_heron_thumb.jpg',130, 87,1, 0,'','','','Punta Espinosa, Fernandina','','');
photos[47] = new photo(2432453,'157082','','section199763','http://www1.clikpic.com/bobpearson/images/13_iguana.jpg',286,400,'Land Iguana feeding','http://www1.clikpic.com/bobpearson/images/13_iguana_thumb.jpg',130, 182,1, 0,'','','','South Plaza','','');
photos[48] = new photo(1761427,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob7731-Edit-21.jpg',400,272,'Cold Light','http://www1.clikpic.com/bobpearson/images/_bob7731-Edit-21_thumb.jpg',130, 88,0, 0,'','','','Svalbard','','');
photos[49] = new photo(1761434,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob6865-Edit2.jpg',400,291,'Svalbard Ptarmigan (Male)','http://www1.clikpic.com/bobpearson/images/_bob6865-Edit2_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[50] = new photo(1761732,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob70241.jpg',400,271,'Brunnick\'s Guillemots','http://www1.clikpic.com/bobpearson/images/_bob70241_thumb.jpg',130, 88,0, 0,'On Sea Ice','','','Svalbard','','');
photos[51] = new photo(1761719,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob8346.jpg',400,271,'Fulmar Skimming','http://www1.clikpic.com/bobpearson/images/_bob8346_thumb.jpg',130, 88,0, 0,'A mirror-like sea','','','Svalbard','','');
photos[52] = new photo(1761484,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob80021.jpg',400,234,'Little Auks queue to rock-hop','http://www1.clikpic.com/bobpearson/images/_bob80021_thumb.jpg',130, 76,0, 0,'','','','Svalbard','','');
photos[53] = new photo(1761468,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob8075-Edit2.jpg',400,312,'Little Auk about to take off','http://www1.clikpic.com/bobpearson/images/_bob8075-Edit2_thumb.jpg',130, 101,0, 1,'','','','Svalbard','','');
photos[54] = new photo(1761680,'116234','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_bob6275.jpg',400,271,'Svalbard','http://www1.clikpic.com/bobpearson/images/_bob6275_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[55] = new photo(185033,'17046','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Ephemeral_Light1.jpg',400,265,'Ephemeral Light','http://www1.clikpic.com/bobpearson/images/Ephemeral_Light1_thumb.jpg',130, 86,0, 1,'Strong winds blow clouds of sand in the Valley of Death in the Atacama Desert in Northern Chile.  The light breaks through the sand storm momentarily to light the dunes and rocks.','','','','','');
photos[56] = new photo(185086,'17046','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/EL_TATIO_NT_SH.jpg',400,286,'Dawn, El Tatio Geysers','http://www1.clikpic.com/bobpearson/images/EL_TATIO_NT_SH_thumb.jpg',130, 93,0, 0,'This photograph shows the combination of dawn light, broken clouds and reflections in the pools of water laying in the terraced pools formed by mineral deposits.  The geyser field is at 4300 metres in the altiplano in Northern Chile.','','','','','');
photos[57] = new photo(185018,'17046','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Herding-Sheep1.jpg',400,204,'Herding Sheep','http://www1.clikpic.com/bobpearson/images/Herding-Sheep1_thumb.jpg',130, 66,0, 0,'At the end of the day the sheep are being driven along the track in Lauca National Park.','','','','','');
photos[58] = new photo(185094,'17046','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/PARINOCOTA_SUNRISE_NI_SH_P.jpg',400,200,'Sunrise over Parinacota','http://www1.clikpic.com/bobpearson/images/PARINOCOTA_SUNRISE_NI_SH_P_thumb.jpg',130, 65,0, 0,'High in Lauca National Park in the far North of Chile is the volcano of Parinacota.','','','','','');
photos[59] = new photo(185093,'17046','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/PARINOCOTA_NT_SH.jpg',400,298,'Towards Parinacota','http://www1.clikpic.com/bobpearson/images/PARINOCOTA_NT_SH_thumb.jpg',130, 97,0, 0,'Looking towards the volcano, the ice is visible in the water on the shores of the lake.','','','','','');
photos[60] = new photo(1761994,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_BOB05331.jpg',271,400,'Bluebells #2','http://www1.clikpic.com/bobpearson/images/_BOB05331_thumb.jpg',130, 192,0, 0,'Green contrasts and shadows','','','','','');
photos[61] = new photo(184408,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Golden_daisies2_P1.jpg',400,255,'Golden Glow','http://www1.clikpic.com/bobpearson/images/Golden_daisies2_P1_thumb.jpg',130, 83,0, 0,'Osteospurnums','','','','','');
photos[62] = new photo(184418,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Mellow_yellow_P1.jpg',400,264,'Hosta Leaves','http://www1.clikpic.com/bobpearson/images/Mellow_yellow_P1_thumb.jpg',130, 86,0, 0,'Mellow yellowing Hosta leaves caught by an early Autumn frost.','','','','','');
photos[63] = new photo(184954,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Inflorescence3.jpg',266,400,'Inflorescence','http://www1.clikpic.com/bobpearson/images/Inflorescence3_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[64] = new photo(184423,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/NATURES3_A3P1.jpg',400,288,'Colours of Nature','http://www1.clikpic.com/bobpearson/images/NATURES3_A3P1_thumb.jpg',130, 94,0, 0,'Blue Himalayan Poppy flowers and leaves against the bare brown earth.','','','','','');
photos[65] = new photo(185040,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/sis_poppies_P1.jpg',400,267,'In the White Garden','http://www1.clikpic.com/bobpearson/images/sis_poppies_P1_thumb.jpg',130, 87,0, 0,'Poppies taken in the White Garden at Sissinghurst','','','','','');
photos[66] = new photo(1761740,'16832','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_BOB04961.jpg',271,400,'Bluebells','http://www1.clikpic.com/bobpearson/images/_BOB04961_thumb.jpg',130, 192,0, 1,'','','','','','');
photos[67] = new photo(2432455,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/14_frigate.jpg',400,267,'Magnificent Frigatebird (female) on nest','http://www1.clikpic.com/bobpearson/images/14_frigate_thumb.jpg',130, 87,1, 0,'','','','North Seymour','','');
photos[68] = new photo(2432457,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/15_Booby&chick.jpg',400,277,'Blue Footed Booby with chick','http://www1.clikpic.com/bobpearson/images/15_Booby&chick_thumb.jpg',130, 90,1, 0,'','','','North Seymour','','');
photos[69] = new photo(2432460,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/16_Albatross_pair.jpg',400,285,'Waved Albatross pair display','http://www1.clikpic.com/bobpearson/images/16_Albatross_pair_thumb.jpg',130, 93,1, 0,'','','','Punta Suarez, Espanola','','');
photos[70] = new photo(2432461,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/17_Penguins.jpg',294,400,'Galapagos Penguins courtship','http://www1.clikpic.com/bobpearson/images/17_Penguins_thumb.jpg',130, 177,1, 0,'','','','Bartholome, Santiago','','');
photos[71] = new photo(2432463,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/18_Toitoise.jpg',400,285,'Galapagos Giant Tortoise on tuff','http://www1.clikpic.com/bobpearson/images/18_Toitoise_thumb.jpg',130, 93,1, 0,'','','','Dried lake, caldera, San Cristobal','','');
photos[72] = new photo(2432464,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/19_cormorants.jpg',400,280,'Flightless or Galapagos Cormorants courtship','http://www1.clikpic.com/bobpearson/images/19_cormorants_thumb.jpg',130, 91,1, 0,'','','','Punta Albamarle, Isabella','','');
photos[73] = new photo(2432465,'157083','','section199763','http://www1.clikpic.com/bobpearson/images/20_frigates.jpg',400,282,'Male Great Frigatebird attracting female to nest','http://www1.clikpic.com/bobpearson/images/20_frigates_thumb.jpg',130, 92,1, 1,'','','','Darwin Bay, Genovesa','','');
photos[74] = new photo(2452700,'158086','','gallery','http://www1.clikpic.com/bobpearson/images/Bison.jpg',400,270,'Bison','http://www1.clikpic.com/bobpearson/images/Bison_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[75] = new photo(185155,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Bee_Orchid.jpg',271,400,'Bee Orchid','http://www1.clikpic.com/bobpearson/images/Bee_Orchid_thumb.jpg',130, 192,0, 1,'<i>Ophrys apifera</i>','','','','','');
photos[76] = new photo(2452731,'158086','','gallery','http://www1.clikpic.com/bobpearson/images/Two-Bison.jpg',400,270,'Two Bison','http://www1.clikpic.com/bobpearson/images/Two-Bison_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[77] = new photo(185159,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Early_Marsh_Orchid.jpg',278,400,'Early Marsh Orchid','http://www1.clikpic.com/bobpearson/images/Early_Marsh_Orchid_thumb.jpg',130, 187,0, 0,'<i>Dactylorhiza incarnata ssp. pulchella</i>','','','','','');
photos[78] = new photo(2452711,'158086','','gallery','http://www1.clikpic.com/bobpearson/images/Bison-in-hot-outflow.jpg',400,290,'Bison in Outflow','http://www1.clikpic.com/bobpearson/images/Bison-in-hot-outflow_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[79] = new photo(2452718,'158086','','gallery','http://www1.clikpic.com/bobpearson/images/Head-to-Head.jpg',400,308,'Head to Head','http://www1.clikpic.com/bobpearson/images/Head-to-Head_thumb.jpg',130, 100,0, 1,'','','','','','');
photos[80] = new photo(186324,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/sand_crocus.jpg',400,319,'Sand Crocus','http://www1.clikpic.com/bobpearson/images/sand_crocus_thumb.jpg',130, 104,0, 0,'<i>Romulea columnae</i><br />\r\n<br />\r\nA macro view of the rare and very small Sand Crocus.','','','','','');
photos[81] = new photo(185166,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Heath_spotted_orchid.jpg',269,400,'Heath Spotted Orchid','http://www1.clikpic.com/bobpearson/images/Heath_spotted_orchid_thumb.jpg',130, 193,0, 0,'<i>Dactylorhiza maculata ssp ericetorum</i>','','','','','');
photos[82] = new photo(185170,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Heath_Speedwell.jpg',287,400,'Heath Speedwell','http://www1.clikpic.com/bobpearson/images/Heath_Speedwell_thumb.jpg',130, 181,0, 0,'<i>Veronica officinalis</i>','','','','','');
photos[83] = new photo(187628,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Bog_pimpernel.jpg',400,254,'Bog Pimpernel','http://www1.clikpic.com/bobpearson/images/Bog_pimpernel_thumb.jpg',130, 83,0, 0,'<i>Anagallis tenella</i>','','','','','');
photos[84] = new photo(185157,'17051','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Butterfly_orchid.jpg',269,400,'Lesser Butterfly Orchid','http://www1.clikpic.com/bobpearson/images/Butterfly_orchid_thumb.jpg',130, 193,0, 0,'<i>Platanthera bifolia</i>','','','','','');
photos[85] = new photo(185177,'17053','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/MEMORIE21.jpg',400,264,'Memories','http://www1.clikpic.com/bobpearson/images/MEMORIE21_thumb.jpg',130, 86,0, 1,'Memories of times past.  The colour washed walls and ceiling retain an intensity of colour in this abandoned house in a village in Spain. Before taking the image I adjusted the window opening slightly to balance the light within the overall scene.<br />\r\n(Royal Photographic Society International Slide Exhibition 1998 Silver Medal)','','','','','');
photos[86] = new photo(185184,'17053','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/LUDERITZ_MOD2_NEAT.jpg',400,232,'Sands of Time','http://www1.clikpic.com/bobpearson/images/LUDERITZ_MOD2_NEAT_thumb.jpg',130, 75,0, 0,'Sand has formed drifts in every room in this abandoned house in Luderitz in Namibia.','','','','','');
photos[87] = new photo(1762585,'17053','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/4048-40502.jpg',400,291,'Derelict','http://www1.clikpic.com/bobpearson/images/4048-40502_thumb.jpg',130, 95,0, 0,'Interior of old wooden building by an abandoned mine near Silverton in the USA','','','','','');
photos[88] = new photo(2453937,'158150','','gallery','http://www1.clikpic.com/bobpearson/images/Elegnce.jpg',298,400,'\"Elegance\"','http://www1.clikpic.com/bobpearson/images/Elegnce_thumb.jpg',130, 174,0, 1,'','','','','','');
photos[89] = new photo(1763797,'16854','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_BOB2891-Edit-22.jpg',257,400,'Webs','http://www1.clikpic.com/bobpearson/images/_BOB2891-Edit-22_thumb.jpg',130, 202,0, 0,'Lit by early light','','','','','');
photos[90] = new photo(185055,'16854','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/AUTUMN_L1.jpg',400,271,'Beech Trees','http://www1.clikpic.com/bobpearson/images/AUTUMN_L1_thumb.jpg',130, 88,0, 0,'An image of the autumn beech wood near Brussels','','','','','');
photos[91] = new photo(2456596,'16854','','gallery','http://www1.clikpic.com/bobpearson/images/Rannoch-Moor-Tree.jpg',400,270,'Rannoch-Moor-Tree','http://www1.clikpic.com/bobpearson/images/Rannoch-Moor-Tree_thumb.jpg',130, 88,0, 1,'','','','','','');
photos[92] = new photo(2457689,'16854','','gallery','http://www1.clikpic.com/bobpearson/images/Bison in the Mist.jpg',400,275,'Bison in the Mist','http://www1.clikpic.com/bobpearson/images/Bison in the Mist_thumb.jpg',130, 89,0, 0,'','','','','','');
photos[93] = new photo(1762668,'16854','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_BOB3449-Edit-21.jpg',400,271,'Wood Sculpture','http://www1.clikpic.com/bobpearson/images/_BOB3449-Edit-21_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[94] = new photo(1762659,'16854','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/_BOB3427-Edit-21.jpg',400,271,'Grasses in the Mist','http://www1.clikpic.com/bobpearson/images/_BOB3427-Edit-21_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[95] = new photo(185051,'16854','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/trees5_mod_quad_P2.jpg',260,400,'Cathedral Trees','http://www1.clikpic.com/bobpearson/images/trees5_mod_quad_P2_thumb.jpg',130, 200,0, 0,'A cathedral of trees lining an avenue in Provence. This is has been photographed on infra-red film and then toned.','','','','','');
photos[96] = new photo(2453640,'16843','','gallery','http://www1.clikpic.com/bobpearson/images/Tropicana.jpg',257,400,'Cabaret Dancer','http://www1.clikpic.com/bobpearson/images/Tropicana_thumb.jpg',130, 202,0, 0,'','','','','','');
photos[97] = new photo(186181,'16843','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Ballet-School1.jpg',328,400,'Ballet School','http://www1.clikpic.com/bobpearson/images/Ballet-School1_thumb.jpg',130, 159,0, 0,'Dancer practising in the studio at the Cuban Ballet School in Havana','','','','','');
photos[98] = new photo(186229,'16843','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/JACKPOT_2.jpg',400,269,'Jackpot Roping','http://www1.clikpic.com/bobpearson/images/JACKPOT_2_thumb.jpg',130, 87,0, 1,'Roping steers against the clock provides lots of action and much betting on the outcome. Taken in the USA.','','','','','');
photos[99] = new photo(185203,'16843','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/SIMPLY_R1.jpg',400,381,'Simply Red','http://www1.clikpic.com/bobpearson/images/SIMPLY_R1_thumb.jpg',130, 124,0, 0,'Taken at a public promotion for a new car these figures in their red sunglasses against the patterns of the more distant backdrop form a dynamic image.','','','','','');
photos[100] = new photo(335561,'28114','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Tale-Bridge-from-south.jpg',400,266,'Bridge over the River Tale','http://www1.clikpic.com/bobpearson/images/Tale-Bridge-from-south_thumb.jpg',130, 86,0, 1,'A winter view of the village bridge across the River Tale.','','','','','');
photos[101] = new photo(335556,'28114','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/St-Andrews.jpg',400,265,'St Andrew\'s Church','http://www1.clikpic.com/bobpearson/images/St-Andrews_thumb.jpg',130, 86,0, 0,'The village church - a monochrome infra-red image.','','','','','');
photos[102] = new photo(335568,'28114','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Drewe-Arms.jpg',400,184,'Misty Morning #1','http://www1.clikpic.com/bobpearson/images/Drewe-Arms_thumb.jpg',130, 60,0, 0,'The War Memorial, village square and the Drewe Arms in the heart of the village.','','','','','');
photos[103] = new photo(335567,'28114','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Post-Office-&-street.jpg',400,165,'Misty Morning #2','http://www1.clikpic.com/bobpearson/images/Post-Office-&-street_thumb.jpg',130, 54,0, 0,'The heart of Broadhembury - the square, main street, village shop and post office.','','','','','');
photos[104] = new photo(335563,'28114','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Tale-Bridge-from-north.jpg',400,193,'Misty Morning #3','http://www1.clikpic.com/bobpearson/images/Tale-Bridge-from-north_thumb.jpg',130, 63,0, 0,'Bridge over the Tale.','','','','','');
photos[105] = new photo(335550,'28114','Copyright Bob Pearson','gallery','http://www1.clikpic.com/bobpearson/images/Thatched-Cottages.jpg',400,266,'Thatched Cottages','http://www1.clikpic.com/bobpearson/images/Thatched-Cottages_thumb.jpg',130, 86,0, 0,'Summer in the Village - Cob and Thatch Cottages','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(16532,'1761153','NAMIBIA','gallery');
galleries[1] = new gallery(28112,'335601','BOTSWANA','gallery');
galleries[2] = new gallery(116682,'1761349','JAPAN','gallery');
galleries[3] = new gallery(158079,'2452718,2452125,2452123,2452118','YELLOWSTONE WINTER','gallery');
galleries[4] = new gallery(158078,'2452125,2452118','Selection 1','gallery');
galleries[5] = new gallery(157069,'2432361','Top Row','section199763');
galleries[6] = new gallery(157082,'2432444','Middle Row','section199763');
galleries[7] = new gallery(157666,'2452123','Selection 2','gallery');
galleries[8] = new gallery(116234,'1761468','ARCTIC','gallery');
galleries[9] = new gallery(17046,'185033','CHILE','gallery');
galleries[10] = new gallery(157083,'2432465','Bottom Row','section199763');
galleries[11] = new gallery(16832,'1761740','FLOWERS 1','gallery');
galleries[12] = new gallery(17051,'185155','FLOWERS 2','gallery');
galleries[13] = new gallery(158086,'2452718','Selection 3','gallery');
galleries[14] = new gallery(17053,'185177','PASSAGE OF TIME','gallery');
galleries[15] = new gallery(158150,'2453937','ELEGANCE','gallery');
galleries[16] = new gallery(16854,'2456596','LANDSCAPE','gallery');
galleries[17] = new gallery(16843,'186229','PEOPLE','gallery');
galleries[18] = new gallery(28114,'335561','BROADHEMBURY','gallery');

