/***************************************************************************
* 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('4046778,4046619,4046594,4046593,4046587,4046581,1676250,499586,483847,483846,483845,483844,324595');
	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('4046778,4046619,4046594,4046593,4046587,4046581,1676250,499586,483847,483846,483845,483844,324595');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('section295986' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="section295986.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 ('section295986' != '') {
				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 = 'Richard Stern 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(324595,'243693','','section295986','http://www1.clikpic.com/richardstern/images/cafe-scene-copy-cp.jpg',400,400,'Venice Cafe Scene','http://www1.clikpic.com/richardstern/images/cafe-scene-copy-cp_thumb.jpg',130, 130,1, 0,'','','','','','');
photos[1] = new photo(332081,'243685','','section295986','http://www1.clikpic.com/richardstern/images/chelsea-house-boats-man-edg.jpg',400,400,'London Chelsea Boats','http://www1.clikpic.com/richardstern/images/chelsea-house-boats-man-edg_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[2] = new photo(332086,'243685','','section295986','http://www1.clikpic.com/richardstern/images/chelsea-houseboats-man-walk.jpg',400,400,'London Chelsea Man','http://www1.clikpic.com/richardstern/images/chelsea-houseboats-man-walk_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[3] = new photo(332088,'243685','','section295986','http://www1.clikpic.com/richardstern/images/chelsea-pensioner-BC1.jpg',400,400,'London Chelsea Pensioner','http://www1.clikpic.com/richardstern/images/chelsea-pensioner-BC1_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[4] = new photo(332089,'243685','','section295986','http://www1.clikpic.com/richardstern/images/denmark-st-taxi-woman-BC-.jpg',400,400,'London Denmark Street','http://www1.clikpic.com/richardstern/images/denmark-st-taxi-woman-BC-_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[5] = new photo(332091,'243693','','section295986','http://www1.clikpic.com/richardstern/images/friedrichstrasse-BC.jpg',400,400,'Berlin Friedrichstrasse','http://www1.clikpic.com/richardstern/images/friedrichstrasse-BC_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[6] = new photo(332093,'243688','','section295986','http://www1.clikpic.com/richardstern/images/girl-lying-versailles-res-B.jpg',400,400,'Paris Versailles','http://www1.clikpic.com/richardstern/images/girl-lying-versailles-res-B_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[7] = new photo(332103,'243688','','section295986','http://www1.clikpic.com/richardstern/images/paris-cafe-cp1.jpg',400,400,'Paris, cafe at night','http://www1.clikpic.com/richardstern/images/paris-cafe-cp1_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[8] = new photo(332104,'243688','','section295986','http://www1.clikpic.com/richardstern/images/paris-street-BC.jpg',400,400,'Paris Street','http://www1.clikpic.com/richardstern/images/paris-street-BC_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[9] = new photo(332105,'243688','','section295986','http://www1.clikpic.com/richardstern/images/paris-woman-cafe-chairs-edi.jpg',400,400,'Paris cafe rain','http://www1.clikpic.com/richardstern/images/paris-woman-cafe-chairs-edi_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[10] = new photo(332107,'243685','','section295986','http://www1.clikpic.com/richardstern/images/southwark-wet-night-BC.jpg',400,400,'London Southwark Night','http://www1.clikpic.com/richardstern/images/southwark-wet-night-BC_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[11] = new photo(332110,'243685','','section295986','http://www1.clikpic.com/richardstern/images/waitress-reflections-window.jpg',400,400,'London Wandsworth Cafe','http://www1.clikpic.com/richardstern/images/waitress-reflections-window_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[12] = new photo(332111,'243693','','section295986','http://www1.clikpic.com/richardstern/images/wedding-couple-BC.jpg',400,400,'Rome Wedding','http://www1.clikpic.com/richardstern/images/wedding-couple-BC_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[13] = new photo(332112,'243688','','section295986','http://www1.clikpic.com/richardstern/images/woman-umbrella-paris-BC.jpg',400,400,'Paris Woman Umbrella','http://www1.clikpic.com/richardstern/images/woman-umbrella-paris-BC_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[14] = new photo(335525,'243685','','section295986','http://www1.clikpic.com/richardstern/images/balham-frame3-BC.jpg',400,400,'London, Balham','http://www1.clikpic.com/richardstern/images/balham-frame3-BC_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[15] = new photo(410036,'243693','','section295986','http://www1.clikpic.com/richardstern/images/man woman bike blurr.jpg',600,400,'Cyclists, Amsterdam, Holland','http://www1.clikpic.com/richardstern/images/man woman bike blurr_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[16] = new photo(413912,'243685','','section295986','http://www1.clikpic.com/richardstern/images/hair brixton.jpg',600,455,'Hair Shop, Brixton, London','http://www1.clikpic.com/richardstern/images/hair brixton_thumb.jpg',130, 99,0, 0,'','','','','','');
photos[17] = new photo(430080,'243693','','section295986','http://www1.clikpic.com/richardstern/images/man and dog amsterdam1.jpg',600,400,'Man and dog, Amsterdam','http://www1.clikpic.com/richardstern/images/man and dog amsterdam1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(483844,'243685','','section295986','http://www1.clikpic.com/richardstern/images/3 people seated busy1.jpg',600,393,'People reading,Southbank, London','http://www1.clikpic.com/richardstern/images/3 people seated busy1_thumb.jpg',130, 85,1, 1,'','','','London','','');
photos[19] = new photo(483845,'243685','','section295986','http://www1.clikpic.com/richardstern/images/5 figures water1.jpg',600,403,'Water Sculpture 1','http://www1.clikpic.com/richardstern/images/5 figures water1_thumb.jpg',130, 87,1, 0,'','','','Southbank, London','','');
photos[20] = new photo(483846,'243685','','section295986','http://www1.clikpic.com/richardstern/images/couple water kids1.jpg',600,394,'Water Sculpture 2','http://www1.clikpic.com/richardstern/images/couple water kids1_thumb.jpg',130, 85,1, 0,'','','','London, Southbank','','');
photos[21] = new photo(483847,'243685','','section295986','http://www1.clikpic.com/richardstern/images/girls move water1.jpg',600,417,'Water Sculpture 3','http://www1.clikpic.com/richardstern/images/girls move water1_thumb.jpg',130, 90,1, 0,'','','','London, Southbank','','');
photos[22] = new photo(607694,'243685','','section295986','http://www1.clikpic.com/richardstern/images/blonde crossing street b&w.jpg',600,525,'WAIT','http://www1.clikpic.com/richardstern/images/blonde crossing street b&w_thumb.jpg',130, 114,0, 0,'','','','','','');
photos[23] = new photo(607696,'243685','','section295986','http://www1.clikpic.com/richardstern/images/girl pink jacket b&w.jpg',600,400,'girl running','http://www1.clikpic.com/richardstern/images/girl pink jacket b&w_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[24] = new photo(607697,'243685','','section295986','http://www1.clikpic.com/richardstern/images/man newspaper hat b& w.jpg',600,400,'man mystery','http://www1.clikpic.com/richardstern/images/man newspaper hat b& w_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[25] = new photo(607698,'243685','','section295986','http://www1.clikpic.com/richardstern/images/man umbrella looking crop b&w.jpg',600,430,'man\'s gaze','http://www1.clikpic.com/richardstern/images/man umbrella looking crop b&w_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[26] = new photo(716959,'243688','','section295986','http://www1.clikpic.com/richardstern/images/table feet rain paris.jpg',600,524,'Paris in rain January 07','http://www1.clikpic.com/richardstern/images/table feet rain paris_thumb.jpg',130, 114,0, 0,'','','','','','');
photos[27] = new photo(716980,'243688','','section295986','http://www1.clikpic.com/richardstern/images/girl cig cafe paris.jpg',600,514,'','http://www1.clikpic.com/richardstern/images/girl cig cafe paris_thumb.jpg',130, 111,0, 0,'','','','','','');
photos[28] = new photo(740485,'243688','','section295986','http://www1.clikpic.com/richardstern/images/girls reflects paris cafe no crop1.jpg',600,390,'','http://www1.clikpic.com/richardstern/images/girls reflects paris cafe no crop1_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[29] = new photo(1022179,'243694','','section295986','http://www1.clikpic.com/richardstern/images/blue ropes crab pots.jpg',500,773,'','http://www1.clikpic.com/richardstern/images/blue ropes crab pots_thumb.jpg',130, 201,0, 0,'','','','','','');
photos[30] = new photo(1472108,'243694','','section295986','http://www1.clikpic.com/richardstern/images/boat-in-mud-rope.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/boat-in-mud-rope_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[31] = new photo(1472111,'243694','','section295986','http://www1.clikpic.com/richardstern/images/brown-&-white-dog.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/brown-&-white-dog_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[32] = new photo(1472115,'243694','','section295986','http://www1.clikpic.com/richardstern/images/family-sunbathing-on-quay.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/family-sunbathing-on-quay_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[33] = new photo(1472121,'243694','','section295986','http://www1.clikpic.com/richardstern/images/my-feet-and-boats.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/my-feet-and-boats_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[34] = new photo(1472124,'243694','','section295986','http://www1.clikpic.com/richardstern/images/sand-pattern-low-tide-east-.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/sand-pattern-low-tide-east-_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[35] = new photo(1472131,'243694','','section295986','http://www1.clikpic.com/richardstern/images/small-boat-patterns.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/small-boat-patterns_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[36] = new photo(1472133,'243694','','section295986','http://www1.clikpic.com/richardstern/images/three-people-hat.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/three-people-hat_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[37] = new photo(1472355,'243683','','section295986','http://www1.clikpic.com/richardstern/images/girl-silhouette-arles.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/girl-silhouette-arles_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[38] = new photo(1676222,'243685','','section295986','http://www1.clikpic.com/richardstern/images/couple-bus-stop1.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/couple-bus-stop1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[39] = new photo(1676228,'243685','','section295986','http://www1.clikpic.com/richardstern/images/couple-man-grimace1.jpg',600,417,'','http://www1.clikpic.com/richardstern/images/couple-man-grimace1_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[40] = new photo(1676230,'243685','','section295986','http://www1.clikpic.com/richardstern/images/blue-man-bus-clapham-junct-bridge2.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/blue-man-bus-clapham-junct-bridge2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[41] = new photo(1676231,'243685','','section295986','http://www1.clikpic.com/richardstern/images/four-people-walking-bus-behind.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/four-people-walking-bus-behind_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[42] = new photo(1676233,'243685','','section295986','http://www1.clikpic.com/richardstern/images/lady-bus-orange-and-turban.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/lady-bus-orange-and-turban_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[43] = new photo(1676238,'243685','','section295986','http://www1.clikpic.com/richardstern/images/man-reflects-wall-blue.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/man-reflects-wall-blue_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[44] = new photo(1676239,'243685','','section295986','http://www1.clikpic.com/richardstern/images/man-woman-red-bag-column-crop.jpg',400,540,'','http://www1.clikpic.com/richardstern/images/man-woman-red-bag-column-crop_thumb.jpg',130, 176,0, 0,'','','','','','');
photos[45] = new photo(1676241,'243685','','section295986','http://www1.clikpic.com/richardstern/images/mother-&-kid-play-here.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/mother-&-kid-play-here_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[46] = new photo(1676242,'243685','','section295986','http://www1.clikpic.com/richardstern/images/red-coat-outside-lloyds.jpg',600,455,'','http://www1.clikpic.com/richardstern/images/red-coat-outside-lloyds_thumb.jpg',130, 99,0, 0,'','','','','','');
photos[47] = new photo(1676244,'243685','','section295986','http://www1.clikpic.com/richardstern/images/red-manniquin-chelsea.jpg',600,393,'','http://www1.clikpic.com/richardstern/images/red-manniquin-chelsea_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[48] = new photo(1676245,'243685','','section295986','http://www1.clikpic.com/richardstern/images/two-women-white-cap.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/two-women-white-cap_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[49] = new photo(1676247,'243685','','section295986','http://www1.clikpic.com/richardstern/images/white-t-shirt-reflected.jpg',600,451,'','http://www1.clikpic.com/richardstern/images/white-t-shirt-reflected_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[50] = new photo(1676248,'243685','','section295986','http://www1.clikpic.com/richardstern/images/woman-red-jacket-city.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/woman-red-jacket-city_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[51] = new photo(1676250,'243685','','section295986','http://www1.clikpic.com/richardstern/images/woman-red-shirt.jpg',600,524,'','http://www1.clikpic.com/richardstern/images/woman-red-shirt_thumb.jpg',130, 114,1, 1,'','','','','','');
photos[52] = new photo(2471322,'243683','','section295986','http://www1.clikpic.com/richardstern/images/Avingnon-old-signage-plus-bottle.jpg',600,800,'','http://www1.clikpic.com/richardstern/images/Avingnon-old-signage-plus-bottle_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[53] = new photo(2471323,'243683','','section295986','http://www1.clikpic.com/richardstern/images/girl-looks-cafe-arles_1.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/girl-looks-cafe-arles_1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[54] = new photo(2471324,'243683','','section295986','http://www1.clikpic.com/richardstern/images/girl-montpelier-plus-maillol.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/girl-montpelier-plus-maillol_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[55] = new photo(2471348,'243683','','section295986','http://www1.clikpic.com/richardstern/images/woman-dog-balls-ceret.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/woman-dog-balls-ceret_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[56] = new photo(2471351,'243683','','section295986','http://www1.clikpic.com/richardstern/images/two-girls-2-men.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/two-girls-2-men_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[57] = new photo(2471352,'243683','','section295986','http://www1.clikpic.com/richardstern/images/students-five-montpelier.jpg',600,453,'','http://www1.clikpic.com/richardstern/images/students-five-montpelier_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[58] = new photo(2471358,'243683','','section295986','http://www1.clikpic.com/richardstern/images/skate-boarder-avignon-crop.jpg',600,523,'','http://www1.clikpic.com/richardstern/images/skate-boarder-avignon-crop_thumb.jpg',130, 113,0, 0,'','','','','','');
photos[59] = new photo(2471362,'243683','','section295986','http://www1.clikpic.com/richardstern/images/maillol-double-blendstif.jpg',600,806,'','http://www1.clikpic.com/richardstern/images/maillol-double-blendstif_thumb.jpg',130, 175,0, 0,'','','','','','');
photos[60] = new photo(2471365,'243683','','section295986','http://www1.clikpic.com/richardstern/images/jeans-white-top-montpelier-plus-girl.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/jeans-white-top-montpelier-plus-girl_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[61] = new photo(2471367,'243683','','section295986','http://www1.clikpic.com/richardstern/images/interior-restaurant.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/interior-restaurant_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[62] = new photo(2471369,'243683','','section295986','http://www1.clikpic.com/richardstern/images/glass-carafe-hand.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/glass-carafe-hand_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[63] = new photo(2471376,'243683','','section295986','http://www1.clikpic.com/richardstern/images/girl-mobile-montpelier-plus-girl-walking-blend1.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/girl-mobile-montpelier-plus-girl-walking-blend1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[64] = new photo(2471847,'243683','','section295986','http://www1.clikpic.com/richardstern/images/people-cafe-reflections-arles.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/people-cafe-reflections-arles_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[65] = new photo(2471919,'243685','','section295986','http://www1.clikpic.com/richardstern/images/d street.jpg',576,384,'','http://www1.clikpic.com/richardstern/images/d street_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[66] = new photo(2471928,'243685','','section295986','http://www1.clikpic.com/richardstern/images/y street.jpg',576,384,'','http://www1.clikpic.com/richardstern/images/y street_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[67] = new photo(4046567,'243686','','section295986','http://www1.clikpic.com/richardstern/images/5_breast_shape_fruit_cahuita_garden.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/5_breast_shape_fruit_cahuita_garden_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[68] = new photo(4046572,'243686','','section295986','http://www1.clikpic.com/richardstern/images/bananas_blue_bird_cahuita.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/bananas_blue_bird_cahuita_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[69] = new photo(4046577,'243686','','section295986','http://www1.clikpic.com/richardstern/images/bicycle_from_robertos_cahuita.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/bicycle_from_robertos_cahuita_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[70] = new photo(4046581,'243686','','section295986','http://www1.clikpic.com/richardstern/images/blue_street_St_Helena.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/blue_street_St_Helena_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[71] = new photo(4046584,'243686','','section295986','http://www1.clikpic.com/richardstern/images/bridge_symetrical.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/bridge_symetrical_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[72] = new photo(4046587,'243686','','section295986','http://www1.clikpic.com/richardstern/images/cahuita_coco_cola_sign_safari.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/cahuita_coco_cola_sign_safari_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[73] = new photo(4046593,'243686','','section295986','http://www1.clikpic.com/richardstern/images/cloudy_forest_monteverdi.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/cloudy_forest_monteverdi_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[74] = new photo(4046594,'243686','','section295986','http://www1.clikpic.com/richardstern/images/frog_monteverdi.jpg',600,629,'','http://www1.clikpic.com/richardstern/images/frog_monteverdi_thumb.jpg',130, 136,1, 1,'','','','','','');
photos[75] = new photo(4046595,'243686','','section295986','http://www1.clikpic.com/richardstern/images/humming_bird_better_c_balance.jpg',600,581,'','http://www1.clikpic.com/richardstern/images/humming_bird_better_c_balance_thumb.jpg',130, 126,0, 0,'','','','','','');
photos[76] = new photo(4046598,'243686','','section295986','http://www1.clikpic.com/richardstern/images/J__S_bridge_monteverdi.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/J__S_bridge_monteverdi_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[77] = new photo(4046613,'243686','','section295986','http://www1.clikpic.com/richardstern/images/laundry_closer_cahuita.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/laundry_closer_cahuita_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[78] = new photo(4046615,'243686','','section295986','http://www1.clikpic.com/richardstern/images/mandolin_hammock.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/mandolin_hammock_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[79] = new photo(4046617,'243686','','section295986','http://www1.clikpic.com/richardstern/images/menu_pattern_closed_cafe_cahuita.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/menu_pattern_closed_cafe_cahuita_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[80] = new photo(4046619,'243686','','section295986','http://www1.clikpic.com/richardstern/images/Ox_sugar_cane_farm.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/Ox_sugar_cane_farm_thumb.jpg',130, 195,1, 0,'','','','','','');
photos[81] = new photo(4046621,'243686','','section295986','http://www1.clikpic.com/richardstern/images/painted_cart_with_oxen_sugar_cane_farm.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/painted_cart_with_oxen_sugar_cane_farm_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[82] = new photo(4046626,'243686','','section295986','http://www1.clikpic.com/richardstern/images/park_entrance_sign_cahuita.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/park_entrance_sign_cahuita_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[83] = new photo(4046641,'243686','','section295986','http://www1.clikpic.com/richardstern/images/Petronella_and_her_daughter.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/Petronella_and_her_daughter_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[84] = new photo(4046642,'243686','','section295986','http://www1.clikpic.com/richardstern/images/Petronella_banana_leaf_fire.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/Petronella_banana_leaf_fire_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[85] = new photo(4046646,'243686','','section295986','http://www1.clikpic.com/richardstern/images/two_oxen_yoked.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/two_oxen_yoked_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[86] = new photo(4046647,'243686','','section295986','http://www1.clikpic.com/richardstern/images/washing_huts_cahuita.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/washing_huts_cahuita_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[87] = new photo(4046778,'243686','','section295986','http://www1.clikpic.com/richardstern/images/jonny-mandelin-bus-station-San-Jose.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/jonny-mandelin-bus-station-San-Jose_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[88] = new photo(4046824,'243686','','section295986','http://www1.clikpic.com/richardstern/images/street-St-Helena-cowboy.jpg',600,900,'','http://www1.clikpic.com/richardstern/images/street-St-Helena-cowboy_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[89] = new photo(4053972,'243685','','section295986','http://www1.clikpic.com/richardstern/images/3-girls-one-read-head2.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/3-girls-one-read-head2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[90] = new photo(4053975,'243685','','section295986','http://www1.clikpic.com/richardstern/images/bus-interior-stopping.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/bus-interior-stopping_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[91] = new photo(4053977,'243685','','section295986','http://www1.clikpic.com/richardstern/images/chelsea-girl-shadow-lingery.jpg',432,600,'','http://www1.clikpic.com/richardstern/images/chelsea-girl-shadow-lingery_thumb.jpg',130, 181,0, 0,'','','','','','');
photos[92] = new photo(4053978,'243685','','section295986','http://www1.clikpic.com/richardstern/images/couples-on-tube-train.jpg',600,448,'','http://www1.clikpic.com/richardstern/images/couples-on-tube-train_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[93] = new photo(4053980,'243685','','section295986','http://www1.clikpic.com/richardstern/images/fat-man-crossing-street-BW.jpg',600,551,'','http://www1.clikpic.com/richardstern/images/fat-man-crossing-street-BW_thumb.jpg',130, 119,0, 0,'','','','','','');
photos[94] = new photo(4053992,'243685','','section295986','http://www1.clikpic.com/richardstern/images/four-seats-on-tube-train.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/four-seats-on-tube-train_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[95] = new photo(4053994,'243685','','section295986','http://www1.clikpic.com/richardstern/images/girl-walk-taxi-plus-girl-cello.jpg',600,407,'','http://www1.clikpic.com/richardstern/images/girl-walk-taxi-plus-girl-cello_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[96] = new photo(4053995,'243685','','section295986','http://www1.clikpic.com/richardstern/images/gormleys-doubled.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/gormleys-doubled_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[97] = new photo(4053997,'243685','','section295986','http://www1.clikpic.com/richardstern/images/hitchcock-like-ad-on-side-house.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/hitchcock-like-ad-on-side-house_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[98] = new photo(4053998,'243685','','section295986','http://www1.clikpic.com/richardstern/images/old--young-diag.jpg',400,600,'','http://www1.clikpic.com/richardstern/images/old--young-diag_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[99] = new photo(4054006,'243685','','section295986','http://www1.clikpic.com/richardstern/images/pink-hat-blurr.jpg',600,535,'','http://www1.clikpic.com/richardstern/images/pink-hat-blurr_thumb.jpg',130, 116,0, 0,'','','','','','');
photos[100] = new photo(4054012,'243685','','section295986','http://www1.clikpic.com/richardstern/images/two-girls-peekaboo.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/two-girls-peekaboo_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[101] = new photo(4054044,'243685','','section295986','http://www1.clikpic.com/richardstern/images/wooden-hand-northern-line.jpg',600,400,'','http://www1.clikpic.com/richardstern/images/wooden-hand-northern-line_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[102] = new photo(429712,'243685','','section295986','http://www1.clikpic.com/richardstern/images/abstract umbrellas1.jpg',600,386,'2','http://www1.clikpic.com/richardstern/images/abstract umbrellas1_thumb.jpg',130, 84,0, 0,'','','','','','');
photos[103] = new photo(429713,'243685','','section295986','http://www1.clikpic.com/richardstern/images/couple approaching umbrellas1.jpg',600,418,'4','http://www1.clikpic.com/richardstern/images/couple approaching umbrellas1_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[104] = new photo(410028,'243693','','section295986','http://www1.clikpic.com/richardstern/images/barcelona graphitti man rain crop.jpg',600,780,'Rain and Graffiti, Barcelona, Spain','http://www1.clikpic.com/richardstern/images/barcelona graphitti man rain crop_thumb.jpg',130, 169,0, 0,'','','','','','');
photos[105] = new photo(499586,'243685','','section295986','http://www1.clikpic.com/richardstern/images/man-umbrella-cig.jpg',600,388,'8','http://www1.clikpic.com/richardstern/images/man-umbrella-cig_thumb.jpg',130, 84,1, 1,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(243693,'430080,410036,410028,332111,332091,324595','CITIES','section295986');
galleries[1] = new gallery(243686,'4046778,4046594,4046593,4046587,4046581','COSTA RICA','section295986');
galleries[2] = new gallery(243685,'1676250,499586,483844','LONDON','section295986');
galleries[3] = new gallery(243688,'740485,716980,716959,332112,332105,332104,332103,332093','PARIS','section295986');
galleries[4] = new gallery(243683,'2471847,2471376,2471369,2471367,2471365,2471362,2471358,2471352,2471351,2471348','SOUTH OF FRANCE','section295986');
galleries[5] = new gallery(243694,'1472133,1472131,1472124,1472121,1472115,1472111,1472108,1022179','WELLS-NEXT-THE-SEA','section295986');

