/***************************************************************************
* 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('3530789,3530786,3530779,3530768,3123794,3123492,3123491,3123489,2965420,2964570,2964569,2964566,2891384,2891369,2887924,2802856,2802853,2802851,2802850,2645936,2296023,2287904,2159079,2101400,2084140,2044771,2044716,2044713,2044711,2038987,2038983,2038982,2038981,2038980,2038977,2038973,2038966,2027467,2027342,2027314');
	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('3530789,3530786,3530779,3530768,3123794,3123492,3123491,3123489,2965420,2964570,2964569,2964566,2891384,2891369,2887924,2802856,2802853,2802851,2802850,2645936,2296023,2287904,2159079,2101400,2084140,2044771,2044716,2044713,2044711,2038987,2038983,2038982,2038981,2038980,2038977,2038973,2038966,2027467,2027342,2027314');
	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 = 'Mark Salter Images: ' + 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(2038985,'211420','','gallery','http://www2.clikpic.com/marksalter/images/lofoten-(119)-lofoten-(126)b.jpg',500,139,'Lofoten Panorama','http://www2.clikpic.com/marksalter/images/lofoten-(119)-lofoten-(126)b_thumb.jpg',130, 36,0, 0,'','','','','','');
photos[1] = new photo(2038994,'211420','','gallery','http://www2.clikpic.com/marksalter/images/lofoten-(266)-lofoten-(272)b.jpg',500,180,'Reine, Lofoten','http://www2.clikpic.com/marksalter/images/lofoten-(266)-lofoten-(272)b_thumb.jpg',130, 47,0, 0,'','','','','','');
photos[2] = new photo(2038996,'211420','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0108.jpg',500,177,'Lofoten Sunrise','http://www2.clikpic.com/marksalter/images/lofoten2007_0108_thumb.jpg',130, 46,0, 0,'','','','','','');
photos[3] = new photo(2084140,'191634','','gallery','http://www2.clikpic.com/marksalter/images/20081112_154037.jpg',500,335,'','http://www2.clikpic.com/marksalter/images/20081112_154037_thumb.jpg',130, 87,1, 0,'','','','Black Mountains','','');
photos[4] = new photo(2159079,'142542','','gallery','http://www2.clikpic.com/marksalter/images/20080505_120217.jpg',500,335,'Common Lizard','http://www2.clikpic.com/marksalter/images/20080505_120217_thumb.jpg',130, 87,1, 0,'','','','Pembrokeshire, Wales','','');
photos[5] = new photo(2287904,'142542','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0106.jpg',499,334,'Peregrine','http://www2.clikpic.com/marksalter/images/DSC_0106_thumb.jpg',130, 87,1, 0,'','','','Pembrokeshire, Wales','','');
photos[6] = new photo(2296005,'142542','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0056.jpg',500,332,'Arran Seal','http://www2.clikpic.com/marksalter/images/DSC_0056_thumb.jpg',130, 86,0, 0,'','','','Isle of Arran','','');
photos[7] = new photo(2296008,'142542','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0025.jpg',500,332,'Pheasant','http://www2.clikpic.com/marksalter/images/DSC_0025_thumb.jpg',130, 86,0, 0,'','','','Cardiff','','');
photos[8] = new photo(2296013,'142542','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0108.jpg',500,332,'Red Stag','http://www2.clikpic.com/marksalter/images/DSC_0108_thumb.jpg',130, 86,0, 0,'','','','Isle of Arran','','');
photos[9] = new photo(2296014,'142542','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0130.jpg',500,332,'Ferns','http://www2.clikpic.com/marksalter/images/DSC_0130_thumb.jpg',130, 86,0, 0,'','','','Malvern, Worcestershire','','');
photos[10] = new photo(2296017,'142542','','gallery','http://www2.clikpic.com/marksalter/images/image0005.jpg',500,326,'Goanna','http://www2.clikpic.com/marksalter/images/image0005_thumb.jpg',130, 85,0, 0,'','','','Sydney, Australia','','');
photos[11] = new photo(2296018,'142542','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0222.jpg',334,499,'Romantic Mushrooms!','http://www2.clikpic.com/marksalter/images/DSC_0222_thumb.jpg',87, 130,0, 0,'','','','North Wales','','');
photos[12] = new photo(2296023,'142542','','gallery','http://www2.clikpic.com/marksalter/images/20080821_163212.jpg',500,335,'Echinacea','http://www2.clikpic.com/marksalter/images/20080821_163212_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[13] = new photo(2645838,'160770','','gallery','http://www2.clikpic.com/marksalter/images/coiling.jpg',334,500,'Coiling ropes at sunset','http://www2.clikpic.com/marksalter/images/coiling_thumb.jpg',87, 130,0, 0,'','','','Gower, South Wales','','');
photos[14] = new photo(2645936,'160770','','gallery','http://www2.clikpic.com/marksalter/images/Image1.jpg',500,328,'Winter mountaineering in South Wales','http://www2.clikpic.com/marksalter/images/Image1_thumb.jpg',130, 85,1, 0,'','','','Pen y Fan, Brecon Beacons','','');
photos[15] = new photo(2891369,'160770','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0050.jpg',500,332,'Climbing \"Swallows Nest\" (VS 4c, 4b)','http://www2.clikpic.com/marksalter/images/DSC_0050_thumb.jpg',129, 86,1, 0,'This photo appears in the \"Lower Wye Valley\" climbing Guidebook','','','Fly Wall, Wintours Leap, Wye Valley','','');
photos[16] = new photo(2891384,'160770','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0065_2.jpg',500,333,'Climbing \"Freedom Direct\" (HVS 4b, 5b)','http://www2.clikpic.com/marksalter/images/DSC_0065_2_thumb.jpg',129, 86,1, 0,'This photo appears in the \"Lower Wye Valley\" climbing Guidebook','','','Fly Wall, Wintours Leap, Wye Valley','','');
photos[17] = new photo(2964570,'191656','','gallery','http://www2.clikpic.com/marksalter/images/20080923_182158.jpg',500,335,'Paddling around the Heritage Coast','http://www2.clikpic.com/marksalter/images/20080923_182158_thumb.jpg',130, 87,1, 0,'','','','Dunraven Bay, Vale of Glamorgan','','');
photos[18] = new photo(3076989,'160770','','gallery','http://www2.clikpic.com/marksalter/images/20060109_090734.jpg',332,500,'Cascade de Lillaz','http://www2.clikpic.com/marksalter/images/20060109_090734_thumb.jpg',86, 130,0, 0,'','','','Cogne, Italy','','');
photos[19] = new photo(3077006,'160770','','gallery','http://www2.clikpic.com/marksalter/images/image0013.jpg',326,500,'Solo climbing on Little Tor','http://www2.clikpic.com/marksalter/images/image0013_thumb.jpg',85, 130,0, 0,'','','','Gower, Wales','','');
photos[20] = new photo(3077007,'160770','','gallery','http://www2.clikpic.com/marksalter/images/Image2.jpg',326,500,'Box Bay cragging','http://www2.clikpic.com/marksalter/images/Image2_thumb.jpg',85, 130,0, 0,'','','','Porthcawl','','');
photos[21] = new photo(3123489,'191634','','gallery','http://www2.clikpic.com/marksalter/images/20081112_154631.jpg',500,333,'','http://www2.clikpic.com/marksalter/images/20081112_154631_thumb.jpg',130, 87,1, 0,'','','','Black Mountains','','');
photos[22] = new photo(3123491,'191634','','gallery','http://www2.clikpic.com/marksalter/images/activity (9).jpg',500,335,'','http://www2.clikpic.com/marksalter/images/activity (9)_thumb.jpg',130, 87,1, 0,'','','','Rhossili, Gower','','');
photos[23] = new photo(3123492,'142542','','gallery','http://www2.clikpic.com/marksalter/images/20081119_131355.jpg',500,335,'','http://www2.clikpic.com/marksalter/images/20081119_131355_thumb.jpg',130, 87,1, 0,'Fly Agaric','','','','','');
photos[24] = new photo(3123794,'142542','','gallery','http://www2.clikpic.com/marksalter/images/20081119_121548.jpg',500,335,'Yellow Stagshorn','http://www2.clikpic.com/marksalter/images/20081119_121548_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[25] = new photo(3530768,'211420','','gallery','http://admin.clikpic.com/marksalter/images/0.jpg',500,176,'Brecon Beacons','http://admin.clikpic.com/marksalter/images/0_thumb.jpg',130, 46,1, 0,'','','','','','');
photos[26] = new photo(3530775,'160770','','gallery','http://admin.clikpic.com/marksalter/images/20081230_104158.jpg',499,334,'Torpantau Falls','http://admin.clikpic.com/marksalter/images/20081230_104158_thumb.jpg',130, 87,0, 0,'','','','Brecon Beacons','','');
photos[27] = new photo(3530789,'211420','','gallery','http://admin.clikpic.com/marksalter/images/mountains_22.jpg',500,177,'Winter Beacons','http://admin.clikpic.com/marksalter/images/mountains_22_thumb.jpg',130, 46,1, 0,'','','','Brecon Beacons','','');
photos[28] = new photo(3530797,'160770','','gallery','http://admin.clikpic.com/marksalter/images/20081210_130911.jpg',334,499,'Hidden Gully','http://admin.clikpic.com/marksalter/images/20081210_130911_thumb.jpg',87, 130,0, 0,'','','','Cwm Cneifion','','');
photos[29] = new photo(2101246,'135866','','gallery','http://www2.clikpic.com/marksalter/images/WallyLucyWedding_138.jpg',499,334,'','http://www2.clikpic.com/marksalter/images/WallyLucyWedding_138_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[30] = new photo(2101250,'135866','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0028.jpg',334,499,'','http://www2.clikpic.com/marksalter/images/DSC_0028_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[31] = new photo(2044830,'135866','','gallery','http://www2.clikpic.com/marksalter/images/_DSC0061.jpg',335,500,'','http://www2.clikpic.com/marksalter/images/_DSC0061_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[32] = new photo(2101265,'135866','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0043.jpg',499,334,'','http://www2.clikpic.com/marksalter/images/DSC_0043_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[33] = new photo(2044832,'135866','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0078a.jpg',335,500,'','http://www2.clikpic.com/marksalter/images/DSC_0078a_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[34] = new photo(2101333,'135866','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0047.jpg',334,499,'','http://www2.clikpic.com/marksalter/images/DSC_0047_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[35] = new photo(2027314,'135839','','gallery','http://www2.clikpic.com/marksalter/images/nashpt0037.jpg',500,332,'Nash Point','http://www2.clikpic.com/marksalter/images/nashpt0037_thumb.jpg',130, 86,1, 0,'','','','Nash Point on the Heritage Coast, Vale of Glamorgan, South Wales','','');
photos[36] = new photo(2027340,'135839','','gallery','http://www2.clikpic.com/marksalter/images/_DSC0054.jpg',335,500,'Waterfall','http://www2.clikpic.com/marksalter/images/_DSC0054_thumb.jpg',87, 130,0, 0,'','','','Neath Valley','','');
photos[37] = new photo(2027342,'135839','','gallery','http://www2.clikpic.com/marksalter/images/_DSC0081_gf1.jpg',500,335,'Sgwd Uchaf Ddwli (Upper Ddwli Falls)','http://www2.clikpic.com/marksalter/images/_DSC0081_gf1_thumb.jpg',130, 87,1, 0,'','','','Neath Valley','','');
photos[38] = new photo(2027414,'135839','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0046.jpg',332,500,'Lighthouse','http://www2.clikpic.com/marksalter/images/DSC_0046_thumb.jpg',86, 130,0, 0,'','','','Nash Point, Vale of Glamorgan','','');
photos[39] = new photo(2038966,'135839','','gallery','http://www2.clikpic.com/marksalter/images/_DSC0033.jpg',500,335,'Nash Point','http://www2.clikpic.com/marksalter/images/_DSC0033_thumb.jpg',130, 87,1, 0,'','','','Nash Point on the Heritage Coast, Vale of Glamorgan, South Wales','','');
photos[40] = new photo(2038981,'135839','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0030.jpg',500,332,'Gospel Pass','http://www2.clikpic.com/marksalter/images/DSC_0030_thumb.jpg',130, 86,1, 0,'','','','Black Mountains','','');
photos[41] = new photo(2101400,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20080412_1435101.jpg',500,333,'Sugarloaf','http://www2.clikpic.com/marksalter/images/20080412_1435101_thumb.jpg',130, 87,1, 0,'','','','Black Mountains','','');
photos[42] = new photo(2802850,'135839','','gallery','http://www2.clikpic.com/marksalter/images/BerwynSunse.jpg',500,329,'Snowdon Sunset','http://www2.clikpic.com/marksalter/images/BerwynSunse_thumb.jpg',130, 86,1, 0,'','','','In the Berwyns','','');
photos[43] = new photo(2802851,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20080903_190611.jpg',500,333,'Storm Waves','http://www2.clikpic.com/marksalter/images/20080903_190611_thumb.jpg',130, 87,1, 0,'','','','Porthcawl','','');
photos[44] = new photo(2802853,'135839','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0041.jpg',500,333,'Pembrokeshire Coast','http://www2.clikpic.com/marksalter/images/DSC_0041_thumb.jpg',130, 87,1, 0,'','','','St Nons Bay, St Davids','','');
photos[45] = new photo(2802856,'135839','','gallery','http://www2.clikpic.com/marksalter/images/tryfan2.jpg',500,325,'Tryfan','http://www2.clikpic.com/marksalter/images/tryfan2_thumb.jpg',130, 85,1, 0,'','','','Ogwen Valley, Snowdonia','','');
photos[46] = new photo(2802859,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20060128_181205.jpg',333,500,'Nash Point Sunset','http://www2.clikpic.com/marksalter/images/20060128_181205_thumb.jpg',87, 130,0, 0,'','','','Vale of Glamorgan','','');
photos[47] = new photo(2802862,'135839','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0055.jpg',333,500,'Pembrokeshire Coastline','http://www2.clikpic.com/marksalter/images/DSC_0055_thumb.jpg',87, 130,0, 0,'','','','St Nons Bay, St Davids','','');
photos[48] = new photo(2803100,'135839','','gallery','http://www2.clikpic.com/marksalter/images/mountains-(2).jpg',500,333,'Snowdon','http://www2.clikpic.com/marksalter/images/mountains-(2)_thumb.jpg',130, 87,0, 0,'','','','Snowdonia','','');
photos[49] = new photo(2887924,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20080815_053512.jpg',500,335,'Sugarloaf Sunrise','http://www2.clikpic.com/marksalter/images/20080815_053512_thumb.jpg',129, 87,1, 0,'','','','Black Mountains','','');
photos[50] = new photo(2964566,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20080923_185538.jpg',500,333,'Sunset on the Heritage Coast','http://www2.clikpic.com/marksalter/images/20080923_185538_thumb.jpg',130, 87,1, 0,'','','','Dunraven Bay, Vale of Glamorgan','','');
photos[51] = new photo(2964569,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20081008_115104.jpg',500,335,'Three Cliffs Bay','http://www2.clikpic.com/marksalter/images/20081008_115104_thumb.jpg',130, 87,1, 0,'','','','Gower, South Wales','','');
photos[52] = new photo(2965420,'135839','','gallery','http://www2.clikpic.com/marksalter/images/20081012_132648.jpg',500,335,'Sgwd Isaf Ddwli (Lower Ddwli Falls)','http://www2.clikpic.com/marksalter/images/20081012_132648_thumb.jpg',130, 87,1, 0,'','','','Brecon Beacons','','');
photos[53] = new photo(3530776,'135839','','gallery','http://admin.clikpic.com/marksalter/images/coast_60.jpg',328,500,'Penarth Pier','http://admin.clikpic.com/marksalter/images/coast_60_thumb.jpg',85, 130,0, 0,'','','','','','');
photos[54] = new photo(3530783,'135839','','gallery','http://admin.clikpic.com/marksalter/images/20090118_121031.jpg',499,334,'Stormy Beach','http://admin.clikpic.com/marksalter/images/20090118_121031_thumb.jpg',130, 87,0, 0,'','','','Newborough Sands, Anglesey','','');
photos[55] = new photo(3530786,'135839','','gallery','http://admin.clikpic.com/marksalter/images/20090218_133515.jpg',499,334,'Pontneddfechan Waterfalls','http://admin.clikpic.com/marksalter/images/20090218_133515_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[56] = new photo(2038973,'135861','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0009.jpg',500,335,'Stob Corrie Nan Beith','http://www2.clikpic.com/marksalter/images/DSC_0009_thumb.jpg',130, 87,1, 0,'','','','Glen Coe','','');
photos[57] = new photo(2038977,'135861','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0010.jpg',500,335,'Glen Coe','http://www2.clikpic.com/marksalter/images/DSC_0010_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[58] = new photo(2038980,'135861','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0029.jpg',500,335,'Loch Leven','http://www2.clikpic.com/marksalter/images/DSC_0029_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[59] = new photo(2044711,'135861','','gallery','http://www2.clikpic.com/marksalter/images/DSC_0087.jpg',500,332,'Standing Stones','http://www2.clikpic.com/marksalter/images/DSC_0087_thumb.jpg',130, 86,1, 0,'','','','Machrie Moor, Isle of Arran','','');
photos[60] = new photo(3530779,'135861','','gallery','http://admin.clikpic.com/marksalter/images/20090107_143552.jpg',500,333,'Hoarfrost and Snowdrifts','http://admin.clikpic.com/marksalter/images/20090107_143552_thumb.jpg',130, 87,1, 0,'','','','Aonach Mor','','');
photos[61] = new photo(2027467,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0103.jpg',500,335,'Lofoten Sunrise','http://www2.clikpic.com/marksalter/images/lofoten2007_0103_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[62] = new photo(2038982,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0295.jpg',500,335,'Hamnoy, Lofoten','http://www2.clikpic.com/marksalter/images/lofoten2007_0295_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[63] = new photo(2038983,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0086.jpg',500,335,'Henningsvaer, Lofoten','http://www2.clikpic.com/marksalter/images/lofoten2007_0086_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[64] = new photo(2038987,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0244.jpg',500,335,'Buneset, Lofoten','http://www2.clikpic.com/marksalter/images/lofoten2007_0244_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[65] = new photo(2044713,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0102.jpg',500,335,'Lofoten Sunrise','http://www2.clikpic.com/marksalter/images/lofoten2007_0102_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[66] = new photo(2044716,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0128.jpg',500,335,'Lofoten Landscape','http://www2.clikpic.com/marksalter/images/lofoten2007_0128_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[67] = new photo(2044771,'135862','','gallery','http://www2.clikpic.com/marksalter/images/lofoten2007_0201.jpg',500,335,'Wild Camping, Å, Lofoten','http://www2.clikpic.com/marksalter/images/lofoten2007_0201_thumb.jpg',130, 87,1, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(191633,'3530797,3530775,3123491,3123489,3077007,3077006,3076989,2964570,2891384,2891369','Adventure','gallery');
galleries[1] = new gallery(160770,'3530797,3530775,3077007,3077006,3076989,2891384,2891369,2645936,2645838','Climbing','gallery');
galleries[2] = new gallery(191656,'2964570','Kayaking','gallery');
galleries[3] = new gallery(142541,'3530786,3530783,3530779,3530776,2965420,2964569,2964566,2887924,2803100,2802862','Landscapes','gallery');
galleries[4] = new gallery(142542,'3123794,3123492,2296023,2296018,2296017,2296014,2296013,2296008,2296005,2287904','Nature','gallery');
galleries[5] = new gallery(211420,'3530789,3530768,2038996,2038994,2038985','Panoramas','gallery');
galleries[6] = new gallery(191634,'3123491,3123489,2084140','Paragliding','gallery');
galleries[7] = new gallery(135866,'2101333,2101265,2101250,2101246,2044832,2044830','Weddings','gallery');
galleries[8] = new gallery(135839,'3530786,3530783,3530776,2965420,2964569,2964566,2887924,2803100,2802862,2802859','Wales','gallery');
galleries[9] = new gallery(135861,'3530779,2044711,2038980,2038977,2038973','Scotland','gallery');
galleries[10] = new gallery(135862,'2044771,2044716,2044713,2038987,2038983,2038982,2027467','Lofoten, Norway','gallery');

