/***************************************************************************
* 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('1852605,1443357,1440173,1416821,1416753,672259,632835,575242,568270,544987,525662,203437,203416,203398');
	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('1852605,1443357,1440173,1416821,1416753,672259,632835,575242,568270,544987,525662,203437,203416,203398');
	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 = 'Ed Rhodes 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(203374,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/CitySkylineatNightBostonUSA.jpg',400,266,'Boston Skyline at Night','http://www4.clikpic.com/edrhodes/images/CitySkylineatNightBostonUSA_thumb.jpg',130, 86,0, 0,'','','','Boston Massachusetts USA','','');
photos[1] = new photo(203398,'18477','','gallery','http://www4.clikpic.com/edrhodes/images/WintersNightAtPerchRockLighthouseNew BrightonTheWirralNearLiverpoolMerseysideUK.jpg',400,270,'Winters Night At Perch Rock Lighthouse','http://www4.clikpic.com/edrhodes/images/WintersNightAtPerchRockLighthouseNew BrightonTheWirralNearLiverpoolMerseysideUK_thumb.jpg',130, 88,1, 0,'','','','The Wirral Near Liverpool Merseyside UK','','');
photos[2] = new photo(203411,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/Impending Beach Storm Koh Samui Thailand.jpg',284,400,'Impending Beach Storm','http://www4.clikpic.com/edrhodes/images/Impending Beach Storm Koh Samui Thailand_thumb.jpg',130, 183,0, 0,'','','',' Koh Samui Thailand','','');
photos[3] = new photo(203416,'18477','','gallery','http://www4.clikpic.com/edrhodes/images/Perch Rock Lighthouse New Brighton The Wirral Merseyside UK.jpg',266,400,'Perch Rock Lighthouse New Brighton','http://www4.clikpic.com/edrhodes/images/Perch Rock Lighthouse New Brighton The Wirral Merseyside UK_thumb.jpg',130, 195,1, 0,'','','','New Brighton The Wirral Merseyside UK','','');
photos[4] = new photo(203425,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/Scaleber Force Waterfall Near Settle North Yorkshire UK.jpg',322,400,'Scaleber Force Waterfall','http://www4.clikpic.com/edrhodes/images/Scaleber Force Waterfall Near Settle North Yorkshire UK_thumb.jpg',130, 161,0, 0,'','','','Near Settle North Yorkshire UK','','');
photos[5] = new photo(203431,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/Approaching Beach Storm Koh Samui Thailand.jpg',284,400,'Approaching Beach Storm','http://www4.clikpic.com/edrhodes/images/Approaching Beach Storm Koh Samui Thailand_thumb.jpg',130, 183,0, 0,'','','',' Koh Samui Thailand','','');
photos[6] = new photo(203435,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/Sunrise at Chaweng Beach Koh Samui Thailand.jpg',400,264,'Sunrise at Chaweng Beach','http://www4.clikpic.com/edrhodes/images/Sunrise at Chaweng Beach Koh Samui Thailand_thumb.jpg',130, 86,0, 0,'','','','Koh Samui Thailand','','');
photos[7] = new photo(203437,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Sunset at The Roaches Staffordshire UK.jpg',400,266,'Sunset at The Roaches','http://www4.clikpic.com/edrhodes/images/Sunset at The Roaches Staffordshire UK_thumb.jpg',130, 86,1, 0,'','','','The Roaches Staffordshire UK','','');
photos[8] = new photo(203441,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/The Runcorn Road Bridge at Sunset Runcorn Cheshire UK.jpg',368,400,'The Runcorn Road Bridge at Sunset','http://www4.clikpic.com/edrhodes/images/The Runcorn Road Bridge at Sunset Runcorn Cheshire UK_thumb.jpg',130, 141,0, 0,'','','','Runcorn Cheshire UK','','');
photos[9] = new photo(203444,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/Winter View in Snow of Shutlinsloe Cheshire Uk.jpg',400,266,'Winter View in Snow of Shutlinsloe','http://www4.clikpic.com/edrhodes/images/Winter View in Snow of Shutlinsloe Cheshire Uk_thumb.jpg',130, 86,0, 0,'','','','Shutlinsloe Cheshire Uk','','');
photos[10] = new photo(203447,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/Autumn View of Shutlinsloe Cheshire UK.jpg',400,266,'Autumn View of Shutlinsloe','http://www4.clikpic.com/edrhodes/images/Autumn View of Shutlinsloe Cheshire UK_thumb.jpg',130, 86,0, 0,'','','','Shutlinsloe Cheshire UK','','');
photos[11] = new photo(203452,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/Little Moreton Hall in Winter Nr Congleton Chesire UK.jpg',400,279,'Little Moreton Hall in Winter','http://www4.clikpic.com/edrhodes/images/Little Moreton Hall in Winter Nr Congleton Chesire UK_thumb.jpg',130, 91,0, 0,'The first sun rays of winter sun lighting the famous building.','','','Nr Congleton Cheshire UK','','');
photos[12] = new photo(203458,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Golden Riverbed at Black Clough Derbyshire UK.jpg',400,281,'Golden Riverbed','http://www4.clikpic.com/edrhodes/images/Golden Riverbed at Black Clough Derbyshire UK_thumb.jpg',130, 91,0, 0,'','','','Black Clough Derbyshire UK','','');
photos[13] = new photo(203461,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/Winters Morning at Little Moreton Hall Nr Congleton Cheshire UK.jpg',400,266,'Winters Morning at Little Moreton','http://www4.clikpic.com/edrhodes/images/Winters Morning at Little Moreton Hall Nr Congleton Cheshire UK_thumb.jpg',130, 86,0, 0,'','','',' Nr Congleton Cheshire UK','','');
photos[14] = new photo(203463,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/Trig Point at Cloudside Nr Congleton Cheshire UK.jpg',265,400,'Trig Point','http://www4.clikpic.com/edrhodes/images/Trig Point at Cloudside Nr Congleton Cheshire UK_thumb.jpg',130, 196,0, 0,'','','','Cloudside Nr Congleton Cheshire UK','','');
photos[15] = new photo(203464,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Evening Light on Derelict Barn in The Peak District Staffordshire UK.jpg',400,266,'Evening Light on Derelict Barn','http://www4.clikpic.com/edrhodes/images/Evening Light on Derelict Barn in The Peak District Staffordshire UK_thumb.jpg',130, 86,0, 0,'','','','The Peak District Staffordshire UK','','');
photos[16] = new photo(203465,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/First Light On Cheweng Beach Thailand.jpg',265,400,'First Light','http://www4.clikpic.com/edrhodes/images/First Light On Cheweng Beach Thailand_thumb.jpg',130, 196,0, 0,'','','','Cheweng Beach Koh Samui Thailand','','');
photos[17] = new photo(203466,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Evening Snow on Derelict Barn in The Peak District Staffordshire UK.jpg',400,266,'Evening Snow on Derelict Barn','http://www4.clikpic.com/edrhodes/images/Evening Snow on Derelict Barn in The Peak District Staffordshire UK_thumb.jpg',130, 86,0, 0,'','','','The Peak District Staffordshire UK','','');
photos[18] = new photo(204331,'18477','','gallery','http://www4.clikpic.com/edrhodes/images/Grassed Walkway Southport UK.jpg',400,265,'Grassed Walkway','http://www4.clikpic.com/edrhodes/images/Grassed Walkway Southport UK_thumb.jpg',130, 86,0, 0,'','','','Southport UK','','');
photos[19] = new photo(204334,'18617','','gallery','http://www4.clikpic.com/edrhodes/images/Winter Sun at Ashness Bridge and Catbells Near Keswick Lake District National Park Cumbria UK.jpg',358,400,'Ashness Bridge','http://www4.clikpic.com/edrhodes/images/Winter Sun at Ashness Bridge and Catbells Near Keswick Lake District National Park Cumbria UK_thumb.jpg',130, 145,0, 0,'','','','Near Keswick Lake District National Park Cumbria UK','','');
photos[20] = new photo(212018,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/Water Flow Over Riverbed Yorkshire Dales UK.jpg',303,400,'Water Flow Over Riverbed','http://www4.clikpic.com/edrhodes/images/Water Flow Over Riverbed Yorkshire Dales UK_thumb.jpg',130, 172,0, 0,'Water Flow Over Riverbed Yorkshire Dales UK','','','','','');
photos[21] = new photo(212025,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/Moving Flowers in Meadow Yorkshire Dales UK.jpg',400,266,'Moving Flowers in Meadow','http://www4.clikpic.com/edrhodes/images/Moving Flowers in Meadow Yorkshire Dales UK_thumb.jpg',130, 86,0, 0,'Moving Flowers in Meadow Yorkshire Dales UK','','','','','');
photos[22] = new photo(212035,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/Torrevieja by Night Costa Blanca Spain.jpg',400,198,'Torrevieja by Night','http://www4.clikpic.com/edrhodes/images/Torrevieja by Night Costa Blanca Spain_thumb.jpg',130, 64,0, 0,'Torrevieja by Night Costa Blanca Spain','','','','','');
photos[23] = new photo(233513,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_0654 Old Millstones At Stanage Edge Peak District Derbyshire UK.jpg',400,268,'Old Millstones At Stanage Edge Peak District Derbyshire','http://www4.clikpic.com/edrhodes/images/EDR_0654 Old Millstones At Stanage Edge Peak District Derbyshire UK_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[24] = new photo(233516,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_0647 View of Ladybower Resevoir From Baslow Edge Derbyshire UK.jpg',268,400,'Ladybower Reservoir  From Baslow Edge Derbyshire','http://www4.clikpic.com/edrhodes/images/EDR_0647 View of Ladybower Resevoir From Baslow Edge Derbyshire UK_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[25] = new photo(236037,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/DSC_4559 Boston.jpg',400,266,'Boston','http://www4.clikpic.com/edrhodes/images/DSC_4559 Boston_thumb.jpg',130, 86,0, 0,'Boston Massachusetts USA','','','','','');
photos[26] = new photo(238379,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_0711 Canal Boat Moored By Cottage Cheshire UK .jpg',400,259,'Boat moored by cottage in evening sunshine on the Cheshire Canal','http://www4.clikpic.com/edrhodes/images/EDR_0711 Canal Boat Moored By Cottage Cheshire UK _thumb.jpg',130, 84,0, 0,'','','','','','');
photos[27] = new photo(238380,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_0744 Setting Sun On Cloudside Viewed From Bosley Locks Cheshire UK.jpg',402,600,'Setting sun on Cloudside viewed from Bosley locks Cheshire UK','http://www4.clikpic.com/edrhodes/images/EDR_0744 Setting Sun On Cloudside Viewed From Bosley Locks Cheshire UK_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[28] = new photo(264878,'18477','','gallery','http://www4.clikpic.com/edrhodes/images/DSC_2634 Perch Rock Lighthouse New Brighton.jpg',399,600,'Perch Rock Lighthouse New Brighton','http://www4.clikpic.com/edrhodes/images/DSC_2634 Perch Rock Lighthouse New Brighton_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[29] = new photo(278680,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/DSC_5983 Cologne Cathedral .jpg',600,406,'Cologne Cathedral Germany','http://www4.clikpic.com/edrhodes/images/DSC_5983 Cologne Cathedral _thumb.jpg',130, 88,0, 0,'The famous Cathedral in Cologne was 600 years in the making, with a break of 300 years due to lack of funds. This shot shows the lead in using the steel rail bridge just outside of Cologne central train station.','','','Cologne Germany','','');
photos[30] = new photo(325838,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_1957 The Burj Al Arab Hotel At Night Dubai United Arab Emirates.jpg',402,600,'The Burj Al Arab','http://www4.clikpic.com/edrhodes/images/EDR_1957 The Burj Al Arab Hotel At Night Dubai United Arab Emirates_thumb.jpg',130, 194,0, 0,'The Burj Al Arab Hotel At Night Dubai United Arab Emirates','','','Dubai United Arab Emirates','','');
photos[31] = new photo(339293,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_2163 Hay Bales at Jodrell Bank Cheshire UK.jpg',402,600,'Hay Bales at Jodrell Bank Cheshire','http://www4.clikpic.com/edrhodes/images/EDR_2163 Hay Bales at Jodrell Bank Cheshire UK_thumb.jpg',130, 194,0, 0,'Jodrell Bank Radio Telescope Near Goostrey Cheshire','','','Jodrell Bank Cheshire','','');
photos[32] = new photo(366774,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_2395Jodrell Bank With Blue Skies.jpg',402,600,'Jodrell Bank Radio Telescope','http://www4.clikpic.com/edrhodes/images/EDR_2395Jodrell Bank With Blue Skies_thumb.jpg',130, 194,0, 0,'Jodrell Bank Radio Telescope With Ripe Crop Field','','','Near Goostrey Cheshire ','','');
photos[33] = new photo(463874,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_2981 Old Shed With Red Rusty Roof And Dark Sky East Coast Barbados W 2.jpg',600,331,'Disused shed','http://www4.clikpic.com/edrhodes/images/EDR_2981 Old Shed With Red Rusty Roof And Dark Sky East Coast Barbados W 2_thumb.jpg',130, 72,0, 0,'Old Shed With Red Rusty Roof, taken on the East Coast','','','Barbados West Indies','','');
photos[34] = new photo(482762,'18617','','gallery','http://www4.clikpic.com/edrhodes/images/81 Morning Light at Pooley Bridge Boathouse Ullswater Lake District Cumbria UK.jpg',332,500,'Pooley Bridge Boathouse','http://www4.clikpic.com/edrhodes/images/81 Morning Light at Pooley Bridge Boathouse Ullswater Lake District Cumbria UK_thumb.jpg',130, 196,0, 0,'Morning Light at Pooley Bridge Boathouse Ullswater Lake District Cumbria','','','Ullswater Lake District Cumbria ','','');
photos[35] = new photo(500199,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3357 First light At Bottoms Reservoir With Croker Hill On The Horizon Langley Nr Macclesfield Cheshire UK.jpg',600,414,'First light','http://www4.clikpic.com/edrhodes/images/EDR_3357 First light At Bottoms Reservoir With Croker Hill On The Horizon Langley Nr Macclesfield Cheshire UK_thumb.jpg',130, 90,0, 0,'First light At Bottoms Reservoir With Croker Hill On The Horizon','','',' Langley Nr Macclesfield Cheshire UK','','');
photos[36] = new photo(500200,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3370 Waterfall At Scaleber Force Yorkshire UK.jpg',600,400,'Waterfall','http://www4.clikpic.com/edrhodes/images/EDR_3370 Waterfall At Scaleber Force Yorkshire UK_thumb.jpg',130, 87,0, 0,'Autumn At Scaleber Force','','','Scaleber Force  Nr Settle Yorkshire ','','');
photos[37] = new photo(525662,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3425 Moss Covered Rock At Scaleber Force Yorkshire UK.jpg',402,600,'Moss Covered Rock At Scaleber','http://www4.clikpic.com/edrhodes/images/EDR_3425 Moss Covered Rock At Scaleber Force Yorkshire UK_thumb.jpg',130, 194,1, 0,'Moss Covered Rock At Scaleber Force Yorkshire','','','Scaleber Force Yorkshire UK','','');
photos[38] = new photo(525670,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3441 Scaleber Force Settle Yorkshire UK.jpg',600,402,'Scaleber Force','http://www4.clikpic.com/edrhodes/images/EDR_3441 Scaleber Force Settle Yorkshire UK_thumb.jpg',130, 87,0, 0,'Scaleber Force in Full Flow','','','Scaleber Force nr Settlr Yorkshire','','');
photos[39] = new photo(544987,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/368 Sunrise At Cloudside With Heather Nr Congleton Cheshire UK.jpg',600,406,'Sunrise At Cloudside','http://www4.clikpic.com/edrhodes/images/368 Sunrise At Cloudside With Heather Nr Congleton Cheshire UK_thumb.jpg',130, 88,1, 0,'Sunrise At Cloudside With Heather Nr Congleton Cheshire UK','','','Cloudside Cheshire','','');
photos[40] = new photo(568270,'18617','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3906 Autumn At Derwent Water Lake District Cumbria UK.jpg',600,406,'Autumn At Derwent Water Lake District Cumbria','http://www4.clikpic.com/edrhodes/images/EDR_3906 Autumn At Derwent Water Lake District Cumbria UK_thumb.jpg',130, 88,1, 0,'','','','Derwent Water Lake District Cumbria ','','');
photos[41] = new photo(575242,'18617','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3864 Icy log On Derwent Water With View Of Catbells Lake District Cumbria UK.jpg',403,600,'Icy log On Derwent Water With View Of Catbells','http://www4.clikpic.com/edrhodes/images/EDR_3864 Icy log On Derwent Water With View Of Catbells Lake District Cumbria UK_thumb.jpg',130, 194,1, 0,'Icy log On Derwent Water With View Of Catbells','','','Lake District Cumbria UK','','');
photos[42] = new photo(596198,'18617','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_3836 Frosted Wooden Rowing Boat At Derwentwater Lake District UK .jpg',402,600,'Wooden Rowing Boat','http://www4.clikpic.com/edrhodes/images/EDR_3836 Frosted Wooden Rowing Boat At Derwentwater Lake District UK _thumb.jpg',130, 194,0, 0,'Wooden Rowing Boat at Derwentwater on a Frosty Morning with Low Lying Mist','','','Derwentwater Lake District Cumbria','','');
photos[43] = new photo(632832,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/482 The Packhorse Bridge and River Dane At Three Shires Head Peak District National Park UK.jpg',402,600,'Packhorse Bridge','http://www4.clikpic.com/edrhodes/images/482 The Packhorse Bridge and River Dane At Three Shires Head Peak District National Park UK_thumb.jpg',130, 194,0, 0,'The Packhorse Bridge and River Dane At Three Shires Head Peak District National Park','','','Three Shires Head Peak District National Park ','','');
photos[44] = new photo(632835,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/483 Old Packhorse Bridge and River Dane Three Shires Head Peak District National Park UK.jpg',600,402,'Old Packhorse Bridge and River Dane','http://www4.clikpic.com/edrhodes/images/483 Old Packhorse Bridge and River Dane Three Shires Head Peak District National Park UK_thumb.jpg',130, 87,1, 0,'Old Packhorse Bridge and River Dane Three Shires Head Peak District National Park UK','','','Three Shires Head Peak District National Park','','');
photos[45] = new photo(646170,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_4159 Kaiser Wilhelm Memorial By Night With Light Trails Berlin Germany.jpg',600,399,'Kaiser Wilhelm Memorial By Night With Light Trails','http://www4.clikpic.com/edrhodes/images/EDR_4159 Kaiser Wilhelm Memorial By Night With Light Trails Berlin Germany_thumb.jpg',130, 86,0, 0,'Kaiser Wilhelm Memorial Church Berlin Germany','','','Berlin Germany','','');
photos[46] = new photo(672259,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/481 Old Packhorse Bridge and River Dane At Three Shires Head Peak District National Park UK.jpg',402,600,'Old Packhorse Bridge and River Dane At Three Shires Head Peak District National Park','http://www4.clikpic.com/edrhodes/images/481 Old Packhorse Bridge and River Dane At Three Shires Head Peak District National Park UK_thumb.jpg',130, 194,1, 0,'','','','Three Shires Head Peak District ','','');
photos[47] = new photo(996773,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_5086 Outdoor Ice Rink At Night Nathan Phillips Square Toronto Canada.jpg',600,397,'Ice Rink At Night','http://www4.clikpic.com/edrhodes/images/EDR_5086 Outdoor Ice Rink At Night Nathan Phillips Square Toronto Canada_thumb.jpg',130, 86,0, 0,'Outdoor Ice Rink At Night Nathan Phillips Square Toronto Canada','','','Toronto Canada','','');
photos[48] = new photo(996776,'18475','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_5353 Imax Theatre And CN Tower At Night Entertainment District Toronto Canada.jpg',600,402,'Imax Theatre And CN Tower','http://www4.clikpic.com/edrhodes/images/EDR_5353 Imax Theatre And CN Tower At Night Entertainment District Toronto Canada_thumb.jpg',130, 87,0, 0,'Imax Theatre And CN Tower At Night Entertainment District Toronto Canada','','','Toronto Canada','','');
photos[49] = new photo(996790,'18473','','gallery','http://www4.clikpic.com/edrhodes/images/EDR_4927 Sunset At The Jodrell Bank Mark One Radio Telescope Near Goostrey Cheshire.jpg',600,305,'Jodrell Sunset','http://www4.clikpic.com/edrhodes/images/EDR_4927 Sunset At The Jodrell Bank Mark One Radio Telescope Near Goostrey Cheshire_thumb.jpg',130, 66,0, 0,'Sunset At The Jodrell Bank Mark One Radio Telescope Near Goostrey Cheshire','','','Goostrey Cheshire','','');
photos[50] = new photo(1416753,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Back Tor Losehill.jpg',600,402,'Back Tor Losehill','http://www4.clikpic.com/edrhodes/images/Back Tor Losehill_thumb.jpg',130, 87,1, 0,'First light on a cold Autumnal morning, the view of Back Tor surrounded by a cloud inversion, a sight to behold.','','Ed Rhodes','Mam Tor Derbyshire','','');
photos[51] = new photo(1416821,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Curbar Edge Fisrt Light.jpg',402,600,'Rock Formation','http://www4.clikpic.com/edrhodes/images/Curbar Edge Fisrt Light_thumb.jpg',130, 194,1, 0,'The Famous rocks at Curbar Edge with the valley beyond shrouded with a cloud inversion.','','Ed Rhodes','Curbar Edge Derbyshire','','');
photos[52] = new photo(1440173,'18474','','gallery','http://www4.clikpic.com/edrhodes/images/Back Tor.jpg',402,600,'Three Peaks','http://www4.clikpic.com/edrhodes/images/Back Tor_thumb.jpg',130, 194,1, 0,'Sunrise at Mam Tor looking back towards Back Tor with a cloud inversion either side of the three peaks. A sight to behold.','','Ed Rhodes','Mam Tor Derbyshire','','');
photos[53] = new photo(1443357,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/Sun Stones Tree.jpg',600,396,'Sun Stones & Tree','http://www4.clikpic.com/edrhodes/images/Sun Stones Tree_thumb.jpg',130, 86,1, 0,'A burst of sunshine illuminates a lone tree surrounded by a limestone pavement at Malham.','','Ed Rhodes','Malham North Yorkshire','','');
photos[54] = new photo(1852605,'18476','','gallery','http://www4.clikpic.com/edrhodes/images/1003 EDR_7615 Rainbow Over Lone Tree At Malham Yorkshire UK.jpg',402,600,'Rainbow Tree','http://www4.clikpic.com/edrhodes/images/1003 EDR_7615 Rainbow Over Lone Tree At Malham Yorkshire UK_thumb.jpg',130, 194,1, 0,'A rainbow is formed by a solitary tree after a rain storm at Malham','','Ed Rhodes','Malham North Yorkshire ','','');
photos[55] = new photo(203455,'18471','','gallery','http://www4.clikpic.com/edrhodes/images/Footbridge at Salford Quays Manchester UK.jpg',400,266,'Footbridge at Salford Quays','http://www4.clikpic.com/edrhodes/images/Footbridge at Salford Quays Manchester UK_thumb.jpg',130, 86,0, 0,'','','','Salford Quays Manchester UK','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(18473,'996790,672259,544987,500199,366774,339293,238380,238379,203463,203461','Cheshire','gallery');
galleries[1] = new gallery(18617,'596198,575242,568270,482762,204334','Cumbria/Lake District','gallery');
galleries[2] = new gallery(18474,'1440173,1416821,1416753,632835,632832,233516,233513,203466,203464,203458','Derbyshire','gallery');
galleries[3] = new gallery(18477,'264878,204331,203416,203398','The Wirral ','gallery');
galleries[4] = new gallery(18475,'996776,996773,646170,463874,325838,278680,236037,212035,203465,203435','Travel','gallery');
galleries[5] = new gallery(18476,'1852605,1443357,525670,525662,500200,212025,212018,203425','Yorkshire','gallery');
galleries[6] = new gallery(18471,'203455','Architecture','gallery');

