/***************************************************************************
* 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('1024140');
	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('1024140');
	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 = 'Grant Timms 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(82637,'7860','','gallery','http://www3.clikpic.com/granttimms/images/GlowingSheep.jpg',400,208,'Glowing sheep','http://www3.clikpic.com/granttimms/images/GlowingSheep_thumb.jpg',130, 68,0, 1,'','','','','','');
photos[1] = new photo(82638,'7860','','gallery','http://www3.clikpic.com/granttimms/images/LochNaver.jpg',400,254,'Early mist Loch naver','http://www3.clikpic.com/granttimms/images/LochNaver_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[2] = new photo(102617,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3103.jpg',400,308,'Alpaca close up','http://www3.clikpic.com/granttimms/images/IMG_3103_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[3] = new photo(102621,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3134.11.jpg',190,300,'Little posers','http://www3.clikpic.com/granttimms/images/IMG_3134_thumb.11.jpg',130, 205,0, 0,'','','','','','');
photos[4] = new photo(102624,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3202.1.jpg',268,300,'Lady and hat floating islands','http://www3.clikpic.com/granttimms/images/IMG_3202_thumb.1.jpg',130, 146,0, 0,'','','','','','');
photos[5] = new photo(102625,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3225.1.jpg',400,298,'Totora Reed Sailing boat','http://www3.clikpic.com/granttimms/images/IMG_3225_thumb.1.jpg',130, 97,0, 0,'','','','','','');
photos[6] = new photo(102626,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3262.jpg',400,317,'Dancers Taquile Island','http://www3.clikpic.com/granttimms/images/IMG_3262_thumb.jpg',130, 103,0, 0,'','','','','','');
photos[7] = new photo(102627,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3282.jpg',400,267,'Peru Rail Puno to Cusco','http://www3.clikpic.com/granttimms/images/IMG_3282_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[8] = new photo(102629,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_3340.1.jpg',400,157,'Sacsayhuaman','http://www3.clikpic.com/granttimms/images/IMG_3340_thumb.1.jpg',130, 51,0, 0,'','','','','','');
photos[9] = new photo(102632,'7901','','gallery','http://www3.clikpic.com/granttimms/images/IMG_34741.jpg',400,260,'Machu Picchu in the clouds','http://www3.clikpic.com/granttimms/images/IMG_34741_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[10] = new photo(126346,'7860','','gallery','http://www3.clikpic.com/granttimms/images/Evening light Mawddach estuary.jpg',400,272,'Evening light Mawddach Estuary','http://www3.clikpic.com/granttimms/images/Evening light Mawddach estuary_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[11] = new photo(196812,'7860','','gallery','http://www3.clikpic.com/granttimms/images/Slate road.jpg',400,215,'Slate Road Cwmorthin','http://www3.clikpic.com/granttimms/images/Slate road_thumb.jpg',130, 70,0, 0,'','','','','','');
photos[12] = new photo(196813,'7860','','gallery','http://www3.clikpic.com/granttimms/images/Llyn Llydaw.jpg',400,272,'Llyn Llydaw','http://www3.clikpic.com/granttimms/images/Llyn Llydaw_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[13] = new photo(196994,'17967','','gallery','http://www3.clikpic.com/granttimms/images/Glowing Wreck Final.jpg',400,275,'Glowing Wreck Rossbeigh Bay','http://www3.clikpic.com/granttimms/images/Glowing Wreck Final_thumb.jpg',130, 89,0, 1,'','','','','','');
photos[14] = new photo(196996,'17967','','gallery','http://www3.clikpic.com/granttimms/images/Kicking up the leaves.jpg',400,272,'Kicking up the leaves','http://www3.clikpic.com/granttimms/images/Kicking up the leaves_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[15] = new photo(196997,'17967','','gallery','http://www3.clikpic.com/granttimms/images/LakeTekapo2 copy.jpg',400,200,'Lake Tekapo New Zealand','http://www3.clikpic.com/granttimms/images/LakeTekapo2 copy_thumb.jpg',130, 65,0, 0,'Loopins growing at Lake Tekapo','','','','','');
photos[16] = new photo(196999,'17967','','gallery','http://www3.clikpic.com/granttimms/images/Loch Naver Tree 2.jpg',400,215,'Early Mist Loch Naver','http://www3.clikpic.com/granttimms/images/Loch Naver Tree 2_thumb.jpg',130, 70,0, 0,'','','','','','');
photos[17] = new photo(197002,'17967','','gallery','http://www3.clikpic.com/granttimms/images/Sossouvlei1.jpg',400,269,'Sossusvlei Namibia','http://www3.clikpic.com/granttimms/images/Sossouvlei1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(197006,'17967','','gallery','http://www3.clikpic.com/granttimms/images/Sunset Whitesands bay final.jpg',400,165,'Sunset Whitesands Bay, Pembrokeshire','http://www3.clikpic.com/granttimms/images/Sunset Whitesands bay final_thumb.jpg',130, 54,0, 0,'','','','','','');
photos[19] = new photo(456667,'36204','','gallery','http://www3.clikpic.com/granttimms/images/3 White Seats.jpg',400,299,'3 White Seats','http://www3.clikpic.com/granttimms/images/3 White Seats_thumb.jpg',130, 97,0, 1,'3 White seat at Lost Gardens of Heligan','','','Cornwall','','');
photos[20] = new photo(456672,'36204','','gallery','http://www3.clikpic.com/granttimms/images/Boat pattern textured copy.jpg',400,269,'Boats for hire Chenonceaux','http://www3.clikpic.com/granttimms/images/Boat pattern textured copy_thumb.jpg',130, 87,0, 0,'Boats for hire at Chenonceaux, France','','','','','');
photos[21] = new photo(456675,'36204','','gallery','http://www3.clikpic.com/granttimms/images/CRW_4776.jpg',400,286,'Chateau Chenonceaux Fountain','http://www3.clikpic.com/granttimms/images/CRW_4776_thumb.jpg',130, 93,0, 0,'Chateau Chenonceaux from fountain garden','','','','','');
photos[22] = new photo(456685,'36204','','gallery','http://www3.clikpic.com/granttimms/images/D\'Eyrinach 8.jpg',210,300,'Cat in the spotlight','http://www3.clikpic.com/granttimms/images/D\'Eyrinach 8_thumb.jpg',130, 186,0, 0,'Cat at the chapel in Les Jardins du Manoir D\'Eyrignac','','','','','');
photos[23] = new photo(456689,'36204','','gallery','http://www3.clikpic.com/granttimms/images/Totem poles & leaf.jpg',227,300,'Totem poles and leaf','http://www3.clikpic.com/granttimms/images/Totem poles & leaf_thumb.jpg',130, 172,0, 0,'Totem poles Humid Tropics Biome, Eden Project','','','','','');
photos[24] = new photo(456695,'36204','','gallery','http://www3.clikpic.com/granttimms/images/Marqueyssac 2 copy.jpg',400,288,'Topiary at Marqueyssac','http://www3.clikpic.com/granttimms/images/Marqueyssac 2 copy_thumb.jpg',130, 94,0, 0,'Topiary at Les Jardins de Marqueyssac,Dordogne, France','','','','','');
photos[25] = new photo(456703,'36205','','gallery','http://www3.clikpic.com/granttimms/images/Boy on beach.jpg',207,300,'Boy and Misty Lighthouse','http://www3.clikpic.com/granttimms/images/Boy on beach_thumb.jpg',130, 188,0, 0,'Boy on beach and misty lighthouse St.Ives, Cornwall','','','','','');
photos[26] = new photo(456707,'36205','','gallery','http://www3.clikpic.com/granttimms/images/Gate & wall shpd.jpg',400,267,'Gate & wall Coast path Cornwall','http://www3.clikpic.com/granttimms/images/Gate & wall shpd_thumb.jpg',130, 87,0, 0,'Gate post, wall and thrift on coast path, Cornwall','','','','','');
photos[27] = new photo(456722,'36205','','gallery','http://www3.clikpic.com/granttimms/images/On the beach.jpg',400,207,'On the beach','http://www3.clikpic.com/granttimms/images/On the beach_thumb.jpg',130, 67,0, 0,'On the beach St.Ives, Cornwall','','','','','');
photos[28] = new photo(456725,'36203','','gallery','http://www3.clikpic.com/granttimms/images/Roque Gageac 9 copy.jpg',400,267,'La Roque Gageac, Dordogne','http://www3.clikpic.com/granttimms/images/Roque Gageac 9 copy_thumb.jpg',130, 87,0, 0,'La Roque Gageac, Dordonge, France','','','','','');
photos[29] = new photo(456726,'36203','','gallery','http://www3.clikpic.com/granttimms/images/Martignac 1 copy.jpg',400,267,'Martignac','http://www3.clikpic.com/granttimms/images/Martignac 1 copy_thumb.jpg',130, 87,0, 0,'Martignac, Dordogne, France','','','','','');
photos[30] = new photo(456727,'36203','','gallery','http://www3.clikpic.com/granttimms/images/Rocamadour 11.jpg',214,300,'Rocamadour','http://www3.clikpic.com/granttimms/images/Rocamadour 11_thumb.jpg',130, 182,0, 0,'Rocamadour, Dordogne, France','','','','','');
photos[31] = new photo(456773,'36203','','gallery','http://www3.clikpic.com/granttimms/images/Sarlat 4 copy.jpg',400,298,'Restaurant, Sarlat','http://www3.clikpic.com/granttimms/images/Sarlat 4 copy_thumb.jpg',130, 97,0, 0,'Outdoor Restaurant, Sarlat, Dordogne, France','','','','','');
photos[32] = new photo(456774,'36203','','gallery','http://www3.clikpic.com/granttimms/images/Sarlat painter.jpg',234,300,'Painting the geese','http://www3.clikpic.com/granttimms/images/Sarlat painter_thumb.jpg',130, 167,0, 0,'Painting the bronze geese, Sarlat, Dordogne, France','','','','','');
photos[33] = new photo(456776,'36203','','gallery','http://www3.clikpic.com/granttimms/images/Terrasson 1 copy.jpg',400,267,'Bridge at Terrasson','http://www3.clikpic.com/granttimms/images/Terrasson 1 copy_thumb.jpg',130, 87,0, 0,'Bridge and reflection at Terrasson, Dordogne, France','','','','','');
photos[34] = new photo(456777,'36203','','gallery','http://www3.clikpic.com/granttimms/images/CRW_4547 copy.jpg',400,267,'Farm buildings Dordogne','http://www3.clikpic.com/granttimms/images/CRW_4547 copy_thumb.jpg',130, 87,0, 0,'Farm buildings near Allas les Mines, Dordogne, France','','','','','');
photos[35] = new photo(1023968,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Bryce 1web.jpg',600,414,'Tree at Sunset Bryce Canyon','http://www3.clikpic.com/granttimms/images/Bryce 1web_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[36] = new photo(1023973,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Bryce 7web.jpg',415,600,'Lone Tree Bryce Canyon','http://www3.clikpic.com/granttimms/images/Bryce 7web_thumb.jpg',130, 188,0, 0,'','','','','','');
photos[37] = new photo(1023974,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Bryce 16web.jpg',546,600,'Hoodoos at Bryce Canyon','http://www3.clikpic.com/granttimms/images/Bryce 16web_thumb.jpg',130, 143,0, 0,'','','','','','');
photos[38] = new photo(1023993,'76512','','gallery','http://www3.clikpic.com/granttimms/images/GC62web.jpg',600,381,'Evening light Grand Canyon','http://www3.clikpic.com/granttimms/images/GC62web_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[39] = new photo(1024024,'76512','','gallery','http://www3.clikpic.com/granttimms/images/GC 32web.jpg',600,414,'Rim Tree Grand Canyon','http://www3.clikpic.com/granttimms/images/GC 32web_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[40] = new photo(1024029,'76512','','gallery','http://www3.clikpic.com/granttimms/images/GC 56web.jpg',600,335,'Passing storm Grand Canyon','http://www3.clikpic.com/granttimms/images/GC 56web_thumb.jpg',130, 73,0, 0,'','','','','','');
photos[41] = new photo(1024030,'76512','','gallery','http://www3.clikpic.com/granttimms/images/GC 62web.jpg',600,383,'Sunset Grand Canyon','http://www3.clikpic.com/granttimms/images/GC 62web_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[42] = new photo(1024035,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Monument sunset 2web.jpg',600,205,'Sunset Monument Valley','http://www3.clikpic.com/granttimms/images/Monument sunset 2web_thumb.jpg',130, 44,0, 0,'','','','','','');
photos[43] = new photo(1024039,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Monument Valley sunset web.jpg',600,293,'Monument Valley Sunset No.2','http://www3.clikpic.com/granttimms/images/Monument Valley sunset web_thumb.jpg',130, 63,0, 0,'','','','','','');
photos[44] = new photo(1024044,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Zion Tree web.jpg',417,600,'Zion Park Tree and moon','http://www3.clikpic.com/granttimms/images/Zion Tree web_thumb.jpg',130, 187,0, 0,'','','','','','');
photos[45] = new photo(1024060,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Zion 13 web.jpg',600,400,'Virgin River at Zion Park','http://www3.clikpic.com/granttimms/images/Zion 13 web_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[46] = new photo(1024061,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Zion 21web.jpg',600,386,'Rock Strata Zion Park','http://www3.clikpic.com/granttimms/images/Zion 21web_thumb.jpg',130, 84,0, 0,'','','','','','');
photos[47] = new photo(1024067,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Death Valley 5web.jpg',600,377,'Zabriskie Point, Death Valley','http://www3.clikpic.com/granttimms/images/Death Valley 5web_thumb.jpg',130, 82,0, 0,'','','','','','');
photos[48] = new photo(1024084,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Death Valley 9web.jpg',600,378,'Clouds over Death Valley','http://www3.clikpic.com/granttimms/images/Death Valley 9web_thumb.jpg',130, 82,0, 0,'','','','','','');
photos[49] = new photo(1024086,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Death Valley 19web.jpg',600,368,'Artists Drive, Death Valley','http://www3.clikpic.com/granttimms/images/Death Valley 19web_thumb.jpg',130, 80,0, 0,'','','','','','');
photos[50] = new photo(1024101,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Death Valley 31web.jpg',600,400,'Salt Pan Death Valley','http://www3.clikpic.com/granttimms/images/Death Valley 31web_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[51] = new photo(1024107,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Monument valley 14web.jpg',600,398,'Desert Tree Monument Valley','http://www3.clikpic.com/granttimms/images/Monument valley 14web_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[52] = new photo(1024115,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Yosemite 14web.jpg',600,400,'Half Dome Yosemite','http://www3.clikpic.com/granttimms/images/Yosemite 14web_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[53] = new photo(1024138,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Yosemite 20web.jpg',421,600,'Lone Tree Yosemite','http://www3.clikpic.com/granttimms/images/Yosemite 20web_thumb.jpg',130, 185,0, 0,'','','','','','');
photos[54] = new photo(1024140,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Yosemite 21web.jpg',600,400,'Tree and Rock Yosemite','http://www3.clikpic.com/granttimms/images/Yosemite 21web_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[55] = new photo(1024143,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Lake Powell 2web.jpg',600,266,'Passing Storm near Lake Powell','http://www3.clikpic.com/granttimms/images/Lake Powell 2web_thumb.jpg',130, 58,0, 0,'','','','','','');
photos[56] = new photo(1024150,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Lake Powell 9web.jpg',600,354,'Clouds over Lake Powell','http://www3.clikpic.com/granttimms/images/Lake Powell 9web_thumb.jpg',130, 77,0, 0,'','','','','','');
photos[57] = new photo(1024155,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Lake Powell 19web.jpg',600,327,'Sunset Lake Powell','http://www3.clikpic.com/granttimms/images/Lake Powell 19web_thumb.jpg',130, 71,0, 0,'','','','','','');
photos[58] = new photo(1024168,'76512','','gallery','http://www3.clikpic.com/granttimms/images/Lake Powell 21web.jpg',600,324,'Lake Powell Moorings','http://www3.clikpic.com/granttimms/images/Lake Powell 21web_thumb.jpg',130, 70,0, 0,'','','','','','');
photos[59] = new photo(3395792,'207332','','gallery','http://www3.clikpic.com/granttimms/images/Port-Haliguen-at-sunset.gif',600,282,'Port Haliguen at Sunset','http://www3.clikpic.com/granttimms/images/Port-Haliguen-at-sunset_thumb.gif',130, 61,0, 0,'Port Haliguen at Sunset','','','Quiberon, Brittany, France','','');
photos[60] = new photo(3395794,'207332','','gallery','http://www3.clikpic.com/granttimms/images/Le-Mont-St-MIchel-at-night.gif',600,342,'Le Mont St. Michel at night','http://www3.clikpic.com/granttimms/images/Le-Mont-St-MIchel-at-night_thumb.gif',130, 74,0, 1,'Le Mont St.Michel at night','','','','','');
photos[61] = new photo(3395795,'207332','','gallery','http://www3.clikpic.com/granttimms/images/BN-29.gif',248,400,'Phare d\'Eckmuhl','http://www3.clikpic.com/granttimms/images/BN-29_thumb.gif',130, 210,0, 0,'Phare d\'Eckmuhl','','','','','');
photos[62] = new photo(3395796,'207332','','gallery','http://www3.clikpic.com/granttimms/images/BB-5.gif',256,400,'Vannes street light','http://www3.clikpic.com/granttimms/images/BB-5_thumb.gif',130, 203,0, 0,'Vannes street light','','','','','');
photos[63] = new photo(3395797,'207332','','gallery','http://www3.clikpic.com/granttimms/images/Artist\'s-impression.gif',329,400,'Painter Vannes harbour','http://www3.clikpic.com/granttimms/images/Artist\'s-impression_thumb.gif',130, 158,0, 0,'Painter Vannes harbour','','','','','');
photos[64] = new photo(3395799,'207332','','gallery','http://www3.clikpic.com/granttimms/images/BC-12.gif',331,400,'Lost hat','http://www3.clikpic.com/granttimms/images/BC-12_thumb.gif',130, 157,0, 0,'Lost hat','','','','','');
photos[65] = new photo(3395802,'207332','','gallery','http://www3.clikpic.com/granttimms/images/BS-24.gif',600,385,'Chandlers Iles aux Moines','http://www3.clikpic.com/granttimms/images/BS-24_thumb.gif',130, 83,0, 0,'Chandlers Ile aux Moines','','','','','');
photos[66] = new photo(3395804,'207332','','gallery','http://www3.clikpic.com/granttimms/images/Dinan-16.gif',245,400,'Window pattern Dinan','http://www3.clikpic.com/granttimms/images/Dinan-16_thumb.gif',130, 212,0, 0,'Window pattern Dinan','','','','','');
photos[67] = new photo(3395807,'207332','','gallery','http://www3.clikpic.com/granttimms/images/FL-48.gif',267,400,'Auray','http://www3.clikpic.com/granttimms/images/FL-48_thumb.gif',130, 195,0, 0,'Auray','','','','','');
photos[68] = new photo(3395810,'207332','','gallery','http://www3.clikpic.com/granttimms/images/FL-4.gif',267,400,'Fountains Quimper','http://www3.clikpic.com/granttimms/images/FL-4_thumb.gif',130, 195,0, 0,'Fountains Quimper','','','','','');
photos[69] = new photo(3397109,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_1229.gif',600,350,'Sunset at Bidart','http://www3.clikpic.com/granttimms/images/_MG_1229_thumb.gif',130, 76,0, 0,'Sunset at Bidart','','','','','');
photos[70] = new photo(3397111,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_1235.gif',600,346,'Evening light Bidart','http://www3.clikpic.com/granttimms/images/_MG_1235_thumb.gif',130, 75,0, 0,'Evening light Bidart','','','','','');
photos[71] = new photo(3397113,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_0774.gif',600,367,'Tour de France replicas Col d\'Aubisque','http://www3.clikpic.com/granttimms/images/_MG_0774_thumb.gif',130, 80,0, 0,'Tour de France replicas Col d\'Aubisque','','','','','');
photos[72] = new photo(3397120,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_1055-01.gif',600,368,'Orgues Ille sur Tet','http://www3.clikpic.com/granttimms/images/_MG_1055-01_thumb.gif',130, 80,0, 0,'Orgues Ille sur Tet','','','','','');
photos[73] = new photo(3397123,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_1150.gif',267,400,'Twin towers of La Romieu at sunset','http://www3.clikpic.com/granttimms/images/_MG_1150_thumb.gif',130, 195,0, 0,'Twin towers of La Romieu at sunset','','','','','');
photos[74] = new photo(3397136,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_1040.gif',267,400,'Abbey St Martin Canigou','http://www3.clikpic.com/granttimms/images/_MG_1040_thumb.gif',130, 195,0, 0,'Abbey St Martin Canigou','','','','','');
photos[75] = new photo(3397144,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_0790.gif',600,400,'Petit Train d\'Artouste','http://www3.clikpic.com/granttimms/images/_MG_0790_thumb.gif',130, 87,0, 0,'Petit Train d\'Artouste','','','','','');
photos[76] = new photo(3397148,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_0934.gif',600,400,'Collioure harbour','http://www3.clikpic.com/granttimms/images/_MG_0934_thumb.gif',130, 87,0, 0,'Collioure harbour','','','','','');
photos[77] = new photo(3397156,'207396','','gallery','http://www3.clikpic.com/granttimms/images/Lamp-&-shutter.gif',267,400,'Abbey lamp','http://www3.clikpic.com/granttimms/images/Lamp-&-shutter_thumb.gif',130, 195,0, 0,'Abbey Lamp','','','','','');
photos[78] = new photo(3397261,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_0916.gif',550,367,'Canal du Midi Toulouse','http://www3.clikpic.com/granttimms/images/_MG_0916_thumb.gif',130, 87,0, 0,'Canal du Midi Toulouse','','','','','');
photos[79] = new photo(3397264,'207396','','gallery','http://www3.clikpic.com/granttimms/images/_MG_0855.gif',580,387,'Goat','http://www3.clikpic.com/granttimms/images/_MG_0855_thumb.gif',130, 87,0, 0,'Goat','','','','','');
photos[80] = new photo(3399465,'207541','','gallery','http://www3.clikpic.com/granttimms/images/A-grey-day-in-the-fall.gif',600,264,'Autumn reflections Sturbridge','http://www3.clikpic.com/granttimms/images/A-grey-day-in-the-fall_thumb.gif',130, 57,0, 0,'Autumn reflections Sturbridge','','','','','');
photos[81] = new photo(3399466,'207541','','gallery','http://www3.clikpic.com/granttimms/images/AU3.gif',308,400,'Autumn view Shelburne Museum','http://www3.clikpic.com/granttimms/images/AU3_thumb.gif',130, 169,0, 0,'Autumn view Shelburne Museum','','','','','');
photos[82] = new photo(3399476,'207541','','gallery','http://www3.clikpic.com/granttimms/images/AU11.gif',600,369,'Autumn leaves','http://www3.clikpic.com/granttimms/images/AU11_thumb.gif',130, 80,0, 0,'Autumn leaves','','','','','');
photos[83] = new photo(3399508,'207541','','gallery','http://www3.clikpic.com/granttimms/images/AU37.gif',600,363,'Echo Lake','http://www3.clikpic.com/granttimms/images/AU37_thumb.gif',130, 79,0, 0,'Echo Lake in Autumn','','','','','');
photos[84] = new photo(3399511,'207541','','gallery','http://www3.clikpic.com/granttimms/images/CC8.gif',600,349,'Nubble Lighthouse','http://www3.clikpic.com/granttimms/images/CC8_thumb.gif',130, 76,0, 0,'Nubble Lighthouse, York Beach','','','','','');
photos[85] = new photo(3399513,'207541','','gallery','http://www3.clikpic.com/granttimms/images/CC14.gif',600,374,'Marginal Way walk','http://www3.clikpic.com/granttimms/images/CC14_thumb.gif',130, 81,0, 0,'Marginal way walk, Ogunquit','','','','','');
photos[86] = new photo(3399515,'207541','','gallery','http://www3.clikpic.com/granttimms/images/H7.gif',600,414,'Halloween cameo','http://www3.clikpic.com/granttimms/images/H7_thumb.gif',130, 90,0, 0,'Halloween cameo','','','','','');
photos[87] = new photo(3399517,'207541','','gallery','http://www3.clikpic.com/granttimms/images/Boston-8.gif',600,437,'Barbers shop, Boston','http://www3.clikpic.com/granttimms/images/Boston-8_thumb.gif',130, 95,0, 0,'Barbers shop Boston','','','','','');
photos[88] = new photo(3399587,'207541','','gallery','http://www3.clikpic.com/granttimms/images/AU18.gif',580,413,'Jackson','http://www3.clikpic.com/granttimms/images/AU18_thumb.gif',130, 93,0, 0,'Jackson lake','','','','','');
photos[89] = new photo(3399628,'207541','','gallery','http://www3.clikpic.com/granttimms/images/AU7.gif',550,334,'Autumn glade','http://www3.clikpic.com/granttimms/images/AU7_thumb.gif',130, 79,0, 0,'Autumn glade','','','','','');
photos[90] = new photo(3399632,'207541','','gallery','http://www3.clikpic.com/granttimms/images/AU10.gif',550,343,'Autumn carpet','http://www3.clikpic.com/granttimms/images/AU10_thumb.gif',130, 81,0, 0,'Autumn carpet','','','','','');
photos[91] = new photo(3399635,'207541','','gallery','http://www3.clikpic.com/granttimms/images/H13.gif',550,427,'Beatles Abbey Road Halloween Cameo','http://www3.clikpic.com/granttimms/images/H13_thumb.gif',130, 101,0, 0,'Beatles Abbey Road Halloween Cameo','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(207332,'3395794','Brittany','gallery');
galleries[1] = new gallery(36204,'456667','Castles & Gardens','gallery');
galleries[2] = new gallery(36205,'456722,456707,456703','Cornwall','gallery');
galleries[3] = new gallery(36203,'456777,456776,456774,456773,456727,456726,456725','Dordogne','gallery');
galleries[4] = new gallery(7860,'82637','Monochrome','gallery');
galleries[5] = new gallery(17967,'196994','My Favourites','gallery');
galleries[6] = new gallery(207541,'3399635,3399632,3399628,3399587,3399517,3399515,3399513,3399511,3399508,3399476','New England in the Fall','gallery');
galleries[7] = new gallery(7901,'102632,102629,102627,102626,102625,102624,102621,102617','Peru','gallery');
galleries[8] = new gallery(207396,'3397264,3397261,3397156,3397148,3397144,3397136,3397123,3397120,3397113,3397111','Pyrenees','gallery');
galleries[9] = new gallery(76512,'1024140','USA National Parks','gallery');

