/***************************************************************************
* 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('1841952');
	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('1841952');
	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 && !((1) || (1))) {
		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 = 'mpphotographics: ' + 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(3596557,'42104','60','gallery','http://www4.clikpic.com/mpphotos/images/11032009-006epz.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/11032009-006epz_thumb.jpg',130, 87,0, 0,'','11/03/09','Mark Pritchard','Marsden Beach, North East Coast','','');
photos[1] = new photo(3596559,'42104','61','gallery','http://www4.clikpic.com/mpphotos/images/11032009-030epz.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/11032009-030epz_thumb.jpg',130, 87,0, 0,'','11/03/09','Mark Pritchard','Marsden Beach, North East Coast','','');
photos[2] = new photo(3596561,'42104','62','gallery','http://www4.clikpic.com/mpphotos/images/11032009-044nw.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/11032009-044nw_thumb.jpg',130, 87,0, 0,'','11/03/09','Mark Pritchard','Marsden Beach, North East Coast','','');
photos[3] = new photo(3596555,'42104','59','gallery','http://www4.clikpic.com/mpphotos/images/09032009-024epz.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/09032009-024epz_thumb.jpg',130, 87,0, 0,'','09/03/09','Mark Pritchard','Marsden Beach, North East Coast','','');
photos[4] = new photo(3596543,'42104','57','gallery','http://www4.clikpic.com/mpphotos/images/snow-101epz.jpg',600,534,'','http://www4.clikpic.com/mpphotos/images/snow-101epz_thumb.jpg',130, 116,0, 0,'','05/01/09','Mark Pritchard','Waskerley Way, County Durham','','');
photos[5] = new photo(1841916,'42104','37','gallery','http://www4.clikpic.com/mpphotos/images/angel17.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/angel17_thumb.jpg',130, 98,0, 1,'','','Mark Pritchard','Angel of the North, Gateshead, NE England.','','');
photos[6] = new photo(1841917,'42104','38','gallery','http://www4.clikpic.com/mpphotos/images/angel20.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/angel20_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Angel of the North, Gateshead, NE England.','','');
photos[7] = new photo(1841929,'42104','39','gallery','http://www4.clikpic.com/mpphotos/images/020208snow-043.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/020208snow-043_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Waskerley Way, County Durham, NE England.','','');
photos[8] = new photo(1841930,'42104','40','gallery','http://www4.clikpic.com/mpphotos/images/020208snow-051.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/020208snow-051_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Waskerley Way, County Durham, NE England.','','');
photos[9] = new photo(1841932,'42104','41','gallery','http://www4.clikpic.com/mpphotos/images/020208snow-077.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/020208snow-077_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Waskerley Way, County Durham, NE England.','','');
photos[10] = new photo(1841935,'42104','42','gallery','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-021-edit.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-021-edit_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Beamish Woods, Near Stanley, County Durham, NE England.','','');
photos[11] = new photo(1841936,'42104','43','gallery','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-021-bw.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-021-bw_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Beamish Woods, Near Stanley, County Durham, NE England.','','');
photos[12] = new photo(1841937,'42104','44','gallery','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-034.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-034_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Beamish Woods, Near Stanley, County Durham, NE England.','','');
photos[13] = new photo(1841940,'42104','45','gallery','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-036.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Dec-05-snow-036_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Beamish Woods, Near Stanley, County Durham, NE England.','','');
photos[14] = new photo(1841941,'42104','46','gallery','http://www4.clikpic.com/mpphotos/images/mil.-br.-evening-4.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/mil_thumb.-br.-evening-4.jpg',130, 98,0, 0,'','','Mark Pritchard','Millenium Bridge, Gateshead, NE England.','','');
photos[15] = new photo(1841943,'42104','47','gallery','http://www4.clikpic.com/mpphotos/images/Pic-036.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/Pic-036_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Sage Music Centre, Gateshead, NE England.','','');
photos[16] = new photo(1841944,'42104','48','gallery','http://www4.clikpic.com/mpphotos/images/Picture-012.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/Picture-012_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Millenium Bridge, Gateshead, NE England.','','');
photos[17] = new photo(1841945,'42104','49','gallery','http://www4.clikpic.com/mpphotos/images/Picture-051.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/Picture-051_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Newcastle Quayside, NE England.','','');
photos[18] = new photo(1841947,'42104','51','gallery','http://www4.clikpic.com/mpphotos/images/snow-033ep.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/snow-033ep_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Waskerley Way, County Durham, NE England.','','');
photos[19] = new photo(1841948,'42104','52','gallery','http://www4.clikpic.com/mpphotos/images/SouthShields.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/SouthShields_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','South Shields, NE England.','','');
photos[20] = new photo(1841949,'42104','53','gallery','http://www4.clikpic.com/mpphotos/images/nwwaves-037.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/nwwaves-037_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','South Shields, NE England.','','');
photos[21] = new photo(1841950,'42104','54','gallery','http://www4.clikpic.com/mpphotos/images/Picture-077.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/Picture-077_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','South Shields, NE England.','','');
photos[22] = new photo(1841951,'42104','55','gallery','http://www4.clikpic.com/mpphotos/images/sunrise-050.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/sunrise-050_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Marsden Beach, NE England,','','');
photos[23] = new photo(1841952,'42104','56','gallery','http://www4.clikpic.com/mpphotos/images/sunrise-055.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/sunrise-055_thumb.jpg',130, 87,1, 1,'','','Mark Pritchard','Marsden Beach, NE England,','','');
photos[24] = new photo(1841953,'42104','57','gallery','http://www4.clikpic.com/mpphotos/images/tyne-bridge.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/tyne-bridge_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Newcastle Quayside, NE England.','','');
photos[25] = new photo(1841946,'42104','50','gallery','http://www4.clikpic.com/mpphotos/images/Picture-092-copy.jpg',498,600,'','http://www4.clikpic.com/mpphotos/images/Picture-092-copy_thumb.jpg',130, 157,0, 0,'','','Mark Pritchard','Beamish Woods, Near Stanley, County Durham, NE England.','','');
photos[26] = new photo(1841820,'42106','01','gallery','http://www4.clikpic.com/mpphotos/images/eos350d-011-web.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/eos350d-011-web_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Skiddaw, Nr Keswick, Lake District.','','');
photos[27] = new photo(1841824,'42106','02','gallery','http://www4.clikpic.com/mpphotos/images/ice-015-nw.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/ice-015-nw_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Near Ambleside, Lake District','','');
photos[28] = new photo(1841827,'42106','03','gallery','http://www4.clikpic.com/mpphotos/images/ice-031-nw.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/ice-031-nw_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Near Ambleside, Lake District','','');
photos[29] = new photo(1841828,'42106','04','gallery','http://www4.clikpic.com/mpphotos/images/ice-034-nw.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/ice-034-nw_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Near Ambleside, Lake District','','');
photos[30] = new photo(1841830,'42106','05','gallery','http://www4.clikpic.com/mpphotos/images/ice-047-nwbw.jpg',600,368,'','http://www4.clikpic.com/mpphotos/images/ice-047-nwbw_thumb.jpg',130, 80,0, 0,'','','Mark Pritchard','Near Ambleside, Lake District','','');
photos[31] = new photo(1841833,'42106','06','gallery','http://www4.clikpic.com/mpphotos/images/lakes-048-edit.jpg',600,236,'','http://www4.clikpic.com/mpphotos/images/lakes-048-edit_thumb.jpg',130, 51,0, 0,'','','Mark Pritchard','Derwent Water, Kewsick.','','');
photos[32] = new photo(1841836,'42106','07','gallery','http://www4.clikpic.com/mpphotos/images/lakes-105-edit2.jpg',600,159,'','http://www4.clikpic.com/mpphotos/images/lakes-105-edit2_thumb.jpg',130, 34,0, 0,'','','Mark Pritchard','Castlerigg Stone Circle, Near Keswick, Lake District.','','');
photos[33] = new photo(1841838,'42106','08','gallery','http://www4.clikpic.com/mpphotos/images/lakes-106-edit2.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/lakes-106-edit2_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Castlerigg Stone Circle, Near Keswick, Lake District.','','');
photos[34] = new photo(1841841,'42106','09','gallery','http://www4.clikpic.com/mpphotos/images/lakes-146-edit2.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/lakes-146-edit2_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Newlands Valley, Lake District.','','');
photos[35] = new photo(1841842,'42106','10','gallery','http://www4.clikpic.com/mpphotos/images/lakes-174-edit.jpg',600,397,'','http://www4.clikpic.com/mpphotos/images/lakes-174-edit_thumb.jpg',130, 86,0, 0,'','','Mark Pritchard','Buttermere, Lake District.','','');
photos[36] = new photo(1841847,'42106','11','gallery','http://www4.clikpic.com/mpphotos/images/Lakesfeb06-045-small.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Lakesfeb06-045-small_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Winlatter Visitor Centre, Near Keswick, Lake District.','','');
photos[37] = new photo(1841849,'42106','12','gallery','http://www4.clikpic.com/mpphotos/images/Lakesfeb06-048.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Lakesfeb06-048_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Winlatter Visitor Centre, Near Keswick, Lake District.','','');
photos[38] = new photo(1841850,'42106','13','gallery','http://www4.clikpic.com/mpphotos/images/nwlakes-041crop.jpg',600,264,'','http://www4.clikpic.com/mpphotos/images/nwlakes-041crop_thumb.jpg',130, 57,0, 0,'','','Mark Pritchard','Thirlmere, Lake District.','','');
photos[39] = new photo(1841851,'42106','14','gallery','http://www4.clikpic.com/mpphotos/images/nwlakes-061.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/nwlakes-061_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Thirlmere, Lake District.','','');
photos[40] = new photo(1841854,'42106','15','gallery','http://www4.clikpic.com/mpphotos/images/nwlakes-085.jpg',600,376,'','http://www4.clikpic.com/mpphotos/images/nwlakes-085_thumb.jpg',130, 81,0, 0,'','','Mark Pritchard','Catbells, Near Kewsick, Lake District,','','');
photos[41] = new photo(1841855,'42106','16','gallery','http://www4.clikpic.com/mpphotos/images/nwlakes-092.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/nwlakes-092_thumb.jpg',130, 87,0, 1,'','','Mark Pritchard','Catbells Summit, Near Kewsick, Lake District,','','');
photos[42] = new photo(1841856,'42106','17','gallery','http://www4.clikpic.com/mpphotos/images/nwlakes-104.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/nwlakes-104_thumb.jpg',130, 87,0, 1,'','','Mark Pritchard','Catbells Summit, Near Kewsick, Lake District,','','');
photos[43] = new photo(1841857,'42106','18','gallery','http://www4.clikpic.com/mpphotos/images/nwlakes-107.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/nwlakes-107_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Catbells, Near Kewsick, Lake District,','','');
photos[44] = new photo(1841858,'42106','19','gallery','http://www4.clikpic.com/mpphotos/images/Pictures-1-026.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/Pictures-1-026_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Mountains around Kewsick, Lake District.','','');
photos[45] = new photo(1841860,'42106','20','gallery','http://www4.clikpic.com/mpphotos/images/pictures-034.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/pictures-034_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Grasmere Lake, Lake District.','','');
photos[46] = new photo(1841861,'42105','21','gallery','http://www4.clikpic.com/mpphotos/images/holiday-001.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/holiday-001_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Killiecrankie, Near Pitlochry, Perthshire.','','');
photos[47] = new photo(1841864,'42105','23','gallery','http://www4.clikpic.com/mpphotos/images/Holiday-07-138-copy.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/Holiday-07-138-copy_thumb.jpg',130, 87,0, 1,'','','Mark Pritchard','Glencoe, Scotland.','','');
photos[48] = new photo(1841865,'42105','24','gallery','http://www4.clikpic.com/mpphotos/images/holiday-018.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/holiday-018_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');
photos[49] = new photo(1841894,'42105','26','gallery','http://www4.clikpic.com/mpphotos/images/holiday-027-O.jpg',600,236,'','http://www4.clikpic.com/mpphotos/images/holiday-027-O_thumb.jpg',130, 51,0, 0,'','','Mark Pritchard','Blackwater Reservior, Rannoch Moor, Scotland.','','');
photos[50] = new photo(1841900,'42105','28','gallery','http://www4.clikpic.com/mpphotos/images/holiday-080-O.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/holiday-080-O_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Near Glenshee Ski Centre, Near Braemar, Scotland.','','');
photos[51] = new photo(1841901,'42105','29','gallery','http://www4.clikpic.com/mpphotos/images/holiday-101-copy.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/holiday-101-copy_thumb.jpg',130, 87,0, 1,'','','Mark Pritchard','Birks of Aberfeldy, Perthshire.','','');
photos[52] = new photo(1841902,'42105','30','gallery','http://www4.clikpic.com/mpphotos/images/holiday-112-O.jpg',600,400,'','http://www4.clikpic.com/mpphotos/images/holiday-112-O_thumb.jpg',130, 87,0, 0,'','','Mark Pritchard','Killiecrankie, Near Pitlochry, Perthshire.','','');
photos[53] = new photo(1841908,'42105','33','gallery','http://www4.clikpic.com/mpphotos/images/RIMG0055.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/RIMG0055_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');
photos[54] = new photo(1841910,'42105','34','gallery','http://www4.clikpic.com/mpphotos/images/RIMG0065.jpg',600,416,'','http://www4.clikpic.com/mpphotos/images/RIMG0065_thumb.jpg',130, 90,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');
photos[55] = new photo(1841912,'42105','35','gallery','http://www4.clikpic.com/mpphotos/images/RIMG0084.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/RIMG0084_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Loch Tay, Perthshire.','','');
photos[56] = new photo(1841913,'42105','36','gallery','http://www4.clikpic.com/mpphotos/images/RIMG0116edited.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/RIMG0116edited_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Glencoe, Scotland.','','');
photos[57] = new photo(1841907,'42105','32','gallery','http://www4.clikpic.com/mpphotos/images/RIMG0054.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/RIMG0054_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');
photos[58] = new photo(1841905,'42105','31','gallery','http://www4.clikpic.com/mpphotos/images/RIMG0040.jpg',600,450,'','http://www4.clikpic.com/mpphotos/images/RIMG0040_thumb.jpg',130, 98,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');
photos[59] = new photo(1841896,'42105','27','gallery','http://www4.clikpic.com/mpphotos/images/holiday-080bw-O.jpg',481,600,'','http://www4.clikpic.com/mpphotos/images/holiday-080bw-O_thumb.jpg',130, 162,0, 0,'','','Mark Pritchard','Near Glenshee Ski Centre, Near Braemar, Scotland.','','');
photos[60] = new photo(1841863,'42105','22','gallery','http://www4.clikpic.com/mpphotos/images/Holiday-07-101.jpg',400,600,'','http://www4.clikpic.com/mpphotos/images/Holiday-07-101_thumb.jpg',130, 195,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');
photos[61] = new photo(1841871,'42105','25','gallery','http://www4.clikpic.com/mpphotos/images/holiday-022.jpg',450,600,'','http://www4.clikpic.com/mpphotos/images/holiday-022_thumb.jpg',130, 173,0, 0,'','','Mark Pritchard','Kenmore, Perthshire.','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(42104,'1841952,1841916','North East England','gallery');
galleries[1] = new gallery(42106,'1841856,1841855','Lake District','gallery');
galleries[2] = new gallery(42105,'1841901,1841864','Scotland','gallery');

