/***************************************************************************
* 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('3083673,3083672,3083665,3083661,3083639,3083629,3083626,3083625,2723978,2723971,2723967,2723959,2723952,2723948,2723937,2723925,2561599,2561593,2561584,2561563,2561559,2561550,2561546,2561536,2561532,2561529,2561526,2561523,2561517,2561510,2561508,2561499,2561496,2561493,2561487,2561484,2416457,2416452,2416425,2413607,2413579,2413546,2413541,2413526,2413507,2413495,2390516,2390507,2390503,2390414,2390407,2390406,2390405,2390401,2390397,2390360,2390350,2390341');
	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('3083673,3083672,3083665,3083661,3083639,3083629,3083626,3083625,2723978,2723971,2723967,2723959,2723952,2723948,2723937,2723925,2561599,2561593,2561584,2561563,2561559,2561550,2561546,2561536,2561532,2561529,2561526,2561523,2561517,2561510,2561508,2561499,2561496,2561493,2561487,2561484,2416457,2416452,2416425,2413607,2413579,2413546,2413541,2413526,2413507,2413495,2390516,2390507,2390503,2390414,2390407,2390406,2390405,2390401,2390397,2390360,2390350,2390341');
	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 = 'Alan Woollard 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>Alan Woollard. </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(2390405,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_6744---Hemmington.jpg',500,333,'Forget-me-not','http://admin2.clikpic.com/woolly1962/images/IMG_6744---Hemmington_thumb.jpg',130, 87,1, 0,'A Somerset Forget-me-not.','','Alan Woollard.','Hemmington, Somerset, England.','','');
photos[1] = new photo(2390503,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/york1.jpg',500,375,'Station Roof - 1','http://admin2.clikpic.com/woolly1962/images/york1_thumb.jpg',130, 98,1, 0,'Railway Station roof.','','Alan Woollard.','York, England.','','');
photos[2] = new photo(2390507,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/york2.jpg',500,333,'Station Roof - 2','http://admin2.clikpic.com/woolly1962/images/york2_thumb.jpg',130, 87,1, 0,'Railway Station roof.','','Alan Woollard.','York, England.','','');
photos[3] = new photo(2390511,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/york7.jpg',500,333,'Station Roof - 3','http://admin2.clikpic.com/woolly1962/images/york7_thumb.jpg',130, 87,0, 0,'Railway Station roof.','','Alan Woollard.','York, England.','','');
photos[4] = new photo(2413541,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_1815---Emirates.jpg',500,375,'Reflections','http://admin2.clikpic.com/woolly1962/images/IMG_1815---Emirates_thumb.jpg',130, 98,1, 0,'Sunset reflections in stadium windows.','','Alan Woollard.','Emirates Stadium, London.','','');
photos[5] = new photo(2413579,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5335---Posts.jpg',500,333,'Posts - 1','http://admin2.clikpic.com/woolly1962/images/IMG_5335---Posts_thumb.jpg',130, 87,1, 0,'Beach posts.','','Alan Woollard.','Calais, France.','','');
photos[6] = new photo(2413607,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7027---London.jpg',500,333,'Windows','http://admin2.clikpic.com/woolly1962/images/IMG_7027---London_thumb.jpg',130, 87,1, 0,'White windows contrast with the red brick.','','Alan Woollard.','London, England.','','');
photos[7] = new photo(2416425,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5367_2.jpg',500,333,'Lonely Surfer','http://admin2.clikpic.com/woolly1962/images/IMG_5367_2_thumb.jpg',130, 87,1, 0,'A lonely surfer looks for the perfect wave.','','Alan Woollard.','Calais, France.','','');
photos[8] = new photo(2416457,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7032.jpg',500,333,'Ferrari','http://admin2.clikpic.com/woolly1962/images/IMG_7032_thumb.jpg',130, 87,1, 0,'Reflective patterns on a Ferrari bonnet.','','Alan Woollard.','London, England.','','');
photos[9] = new photo(2561493,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0095_2.jpg',500,333,'The harbour','http://admin2.clikpic.com/woolly1962/images/IMG_0095_2_thumb.jpg',130, 87,1, 0,'A view of the harbour','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[10] = new photo(2561496,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0096.jpg',500,333,'The harbour 2','http://admin2.clikpic.com/woolly1962/images/IMG_0096_thumb.jpg',130, 87,1, 0,'Another view of the harbour','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[11] = new photo(2561499,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0097.jpg',500,333,'A harbour view','http://admin2.clikpic.com/woolly1962/images/IMG_0097_thumb.jpg',130, 87,1, 0,'A view of the harbour','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[12] = new photo(2561508,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0149.jpg',500,333,'Yacht','http://admin2.clikpic.com/woolly1962/images/IMG_0149_thumb.jpg',130, 87,1, 0,'A yacht moored in the harbour','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[13] = new photo(2561510,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0218_2.jpg',500,333,'Pebble in rock','http://admin2.clikpic.com/woolly1962/images/IMG_0218_2_thumb.jpg',130, 87,1, 0,'A pebble stuck in a rock','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[14] = new photo(2561517,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0326_2.jpg',500,333,'Beach huts','http://admin2.clikpic.com/woolly1962/images/IMG_0326_2_thumb.jpg',130, 87,1, 0,'Colourful beach huts','','Alan Woollard.','Woolacombe, Devon, England.','','');
photos[15] = new photo(2561523,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_3709wsm.jpg',500,333,'A walk on the beach','http://admin2.clikpic.com/woolly1962/images/IMG_3709wsm_thumb.jpg',130, 87,1, 0,'A lone walker on the beach','','Alan Woollard.','Weston-super-Mare, Somerset, England.','','');
photos[16] = new photo(2561529,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_4698_2.jpg',500,333,'Clear waters','http://admin2.clikpic.com/woolly1962/images/IMG_4698_2_thumb.jpg',130, 87,1, 0,'A view from the harbour','','Alan Woollard.','Porto Rafael, Sardinia, Italy.','','');
photos[17] = new photo(2561532,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5502gent_2.jpg',500,378,'Gent centre','http://admin2.clikpic.com/woolly1962/images/IMG_5502gent_2_thumb.jpg',130, 98,1, 0,'The picturesque centre of Gent','','Alan Woollard.','Gent, Belgium.','','');
photos[18] = new photo(2561536,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5829_2.jpg',500,333,'Rope tunnel','http://admin2.clikpic.com/woolly1962/images/IMG_5829_2_thumb.jpg',130, 87,1, 0,'A rope tunnel','','Alan Woollard.','Longleat, Wiltshire, England.','','');
photos[19] = new photo(2561546,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_6461_2.jpg',500,333,'Porto Rafael 2','http://admin2.clikpic.com/woolly1962/images/IMG_6461_2_thumb.jpg',130, 87,1, 0,'Another view of the harbour','','Alan Woollard.','Porto Rafael, Sardinia, Italy.','','');
photos[20] = new photo(2561550,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_6775_2.jpg',500,333,'Beach posts','http://admin2.clikpic.com/woolly1962/images/IMG_6775_2_thumb.jpg',130, 87,1, 0,'Sea weathered beach posts','','Alan Woollard.','Bembridge, Isle of White, England.','','');
photos[21] = new photo(2561563,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_6834_2.jpg',500,333,'Tunnel vision','http://admin2.clikpic.com/woolly1962/images/IMG_6834_2_thumb.jpg',130, 87,1, 0,'An unusual view of the pier','','Alan Woollard.','Bembridge, Isle of White, England.','','');
photos[22] = new photo(2561584,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7532_2.jpg',500,333,'The Tor','http://admin2.clikpic.com/woolly1962/images/IMG_7532_2_thumb.jpg',130, 87,1, 0,'A view of the Tor','','Alan Woollard.','Glastonbury, Somerset, England.','','');
photos[23] = new photo(2561593,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7921.jpg',500,333,'Nightime','http://admin2.clikpic.com/woolly1962/images/IMG_7921_thumb.jpg',130, 87,1, 0,'Bruges at night','','Alan Woollard.','Bruges, Belgium.','','');
photos[24] = new photo(2561599,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7933.jpg',500,333,'Nightime 2','http://admin2.clikpic.com/woolly1962/images/IMG_7933_thumb.jpg',130, 87,1, 0,'A view of the old hospital','','Alan Woollard.','Bruges, Belgium.','','');
photos[25] = new photo(2723925,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/Weymouth IMG_8810.jpg',500,333,'Faces','http://admin2.clikpic.com/woolly1962/images/Weymouth IMG_8810_thumb.jpg',130, 87,1, 0,'Facial patterns on paddle boats','','Alan Woollard.','Weymouth, Dorset, England.','','');
photos[26] = new photo(2723937,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/Weymouth IMG_88171.jpg',500,333,'Red, white & blue','http://admin2.clikpic.com/woolly1962/images/Weymouth IMG_88171_thumb.jpg',130, 87,1, 0,'Red, white and blue painted wood','','Alan Woollard.','Weymouth, Dorset, England.','','');
photos[27] = new photo(2723948,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/Lower Slaughter IMG_5619.jpg',500,333,'Welcome','http://admin2.clikpic.com/woolly1962/images/Lower Slaughter IMG_5619_thumb.jpg',130, 87,1, 0,'A welcome sign','','Alan Woollard.','Lower Slaughter, The Cotswolds, Gloucestershire, England.','','');
photos[28] = new photo(2723952,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/Le Touquet IMG_0599.jpg',500,333,'Balconies','http://admin2.clikpic.com/woolly1962/images/Le Touquet IMG_0599_thumb.jpg',130, 87,1, 0,'Colourful balconies','','Alan Woollard.','Le Touquet, France.','','');
photos[29] = new photo(2723959,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/calais IMG_5676.jpg',500,333,'Seagulls','http://admin2.clikpic.com/woolly1962/images/calais IMG_5676_thumb.jpg',130, 87,1, 0,'Three wise seagulls','','Alan Woollard.','Calais, France.','','');
photos[30] = new photo(2723967,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/Calais IMG_2953_2.jpg',500,334,'Eyes','http://admin2.clikpic.com/woolly1962/images/Calais IMG_2953_2_thumb.jpg',130, 87,1, 0,'Streetlamp eyes in the sky','','Alan Woollard.','Calais, France.','','');
photos[31] = new photo(2723971,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/Gent IMG_5534.jpg',500,333,'Angles','http://admin2.clikpic.com/woolly1962/images/Gent IMG_5534_thumb.jpg',130, 87,1, 0,'Small windows in a Belgian roof.','','Alan Woollard.','Gent, Belgium.','','');
photos[32] = new photo(2723978,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/Lamps.jpg',500,375,'Lamposts','http://admin2.clikpic.com/woolly1962/images/Lamps_thumb.jpg',130, 98,1, 0,'Glass lamposts','','Alan Woollard.','London, England.','','');
photos[33] = new photo(3083625,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_2652_2.jpg',500,333,'Red Leaves','http://admin2.clikpic.com/woolly1962/images/IMG_2652_2_thumb.jpg',130, 87,1, 0,'Autumn leaves','','Alan Woollard.','Westonbirt Arboretum, Gloucestershire, England.','','');
photos[34] = new photo(3083626,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_2653_2.jpg',500,333,'Red leaves 2','http://admin2.clikpic.com/woolly1962/images/IMG_2653_2_thumb.jpg',130, 87,1, 0,'Autumn colours','','Alan Woollard.','Westonbirt Arboretum, Gloucestershire, England.','','');
photos[35] = new photo(3083629,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_2655_2.jpg',500,333,'Red leaves 3','http://admin2.clikpic.com/woolly1962/images/IMG_2655_2_thumb.jpg',130, 87,1, 0,'Autumn colours','','Alan Woollard.','Westonbirt Arboretum, Gloucestershire, England.','','');
photos[36] = new photo(3083639,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_2681_2.jpg',500,333,'Autumn tree','http://admin2.clikpic.com/woolly1962/images/IMG_2681_2_thumb.jpg',130, 87,1, 0,'An Autumn tree','','Alan Woollard.','Westonbirt Arboretum, Gloucestershire, England.','','');
photos[37] = new photo(3083661,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_2985_21.jpg',500,333,'Leaves on ground','http://admin2.clikpic.com/woolly1962/images/IMG_2985_21_thumb.jpg',130, 87,1, 0,'Golden leaves on Dutch cobble stone.','','Alan Woollard.','Maastricht, Holland.','','');
photos[38] = new photo(3083665,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_3337_2.jpg',500,333,'Autumn colours','http://admin2.clikpic.com/woolly1962/images/IMG_3337_2_thumb.jpg',130, 87,1, 0,'Autumn leaves showing their full colour','','Alan Woollard.','Doulting, Somerset, England.','','');
photos[39] = new photo(3083672,'155073','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_3547.jpg',500,333,'Autumn mist','http://admin2.clikpic.com/woolly1962/images/IMG_3547_thumb.jpg',130, 87,1, 0,'A tree in the Autumn mist.','','Alan Woollard.','Doulting, Somerset, England.','','');
photos[40] = new photo(3083673,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_3603.jpg',500,333,'The Tor at Sunset','http://admin2.clikpic.com/woolly1962/images/IMG_3603_thumb.jpg',130, 87,1, 0,'A view of Glastonbury Tor at sunset.','','Alan Woollard.','Croscombe, Somerset, England.','','');
photos[41] = new photo(3370713,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/BrutonA2_4.jpg',500,373,'Medieval Threesome','http://admin2.clikpic.com/woolly1962/images/BrutonA2_4_thumb.jpg',130, 97,0, 0,'A lord, his wife and his lover.','','Alan woollard','Bruton, Somerset, England','','');
photos[42] = new photo(3370720,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Chewton-MendipB2.jpg',500,375,'Reclining Knight','http://admin2.clikpic.com/woolly1962/images/Chewton-MendipB2_thumb.jpg',130, 98,0, 0,'A Knight at rest','','Alan Woollard','Chewton Mendip, Somerset, England.','','');
photos[43] = new photo(3370733,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Frome38.jpg',500,386,'Set in Stone','http://admin2.clikpic.com/woolly1962/images/Frome38_thumb.jpg',130, 100,0, 0,'A small part of the wonderful series of carvings depicting the last days of Christ','','Alan woollard.','Frome, Somerset, England.','','');
photos[44] = new photo(3370735,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Frome47.jpg',500,386,'Christ','http://admin2.clikpic.com/woolly1962/images/Frome47_thumb.jpg',130, 100,0, 0,'A close up of the Frome carvings','','Alan Woollard.','Frome, Somerset, England.','','');
photos[45] = new photo(3370737,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Hinton CharterhouseC9.jpg',500,371,'The Key','http://admin2.clikpic.com/woolly1962/images/Hinton CharterhouseC9_thumb.jpg',130, 96,0, 0,'A good book and the Key','','Alan Woollard.','Hinton Charterhouse, Somerset, England.','','');
photos[46] = new photo(3370739,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/LimingtonC2.jpg',500,388,'Sleeping Knight','http://admin2.clikpic.com/woolly1962/images/LimingtonC2_thumb.jpg',130, 101,0, 0,'A Limington Knight','','Alan Woollard.','Limington, Somerset, England.','','');
photos[47] = new photo(3370825,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Lower-Slaughter24.jpg',500,383,'Gargoyle','http://admin2.clikpic.com/woolly1962/images/Lower-Slaughter24_thumb.jpg',130, 100,0, 0,'A Gargoyle sitting on a bench in the Cotswolds','','Alan Woollard.','Lower Slaughter, Gloucestershire, England.','','');
photos[48] = new photo(3370826,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Marston-HouseA1_8.jpg',500,366,'Leaves and Trees','http://admin2.clikpic.com/woolly1962/images/Marston-HouseA1_8_thumb.jpg',130, 95,0, 0,'An autumn woodland','','Alan Woollard.','Marston House, Somerset, England.','','');
photos[49] = new photo(3370827,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/MellsF1.jpg',500,363,'Bridge','http://admin2.clikpic.com/woolly1962/images/MellsF1_thumb.jpg',130, 94,0, 0,'A river runs through it.','','Alan Woollard.','Mells, Somerset, England.','','');
photos[50] = new photo(3370829,'205898','','gallery','http://admin2.clikpic.com/woolly1962/images/Shepton-Mallet1.jpg',500,398,'Mr Mallet','http://admin2.clikpic.com/woolly1962/images/Shepton-Mallet1_thumb.jpg',130, 103,0, 0,'A member of the Mallet family','','Alan Woollard.','shepton Mallet, Somerset, England.','','');
photos[51] = new photo(2390341,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_4554_2.jpg',500,333,'Sunlight on the sea','http://admin2.clikpic.com/woolly1962/images/IMG_4554_2_thumb.jpg',130, 87,1, 0,'Sun spotlights on a silver sea.','','Alan Woollard.','Isle of Wight, England.','','');
photos[52] = new photo(2390397,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5947---Sardinia.jpg',500,333,'A Sardinian Heart','http://admin2.clikpic.com/woolly1962/images/IMG_5947---Sardinia_thumb.jpg',130, 87,1, 0,'A heart in the Sardinian sand.','','Alan Woollard.','La Maddalena, Sardinia.','','');
photos[53] = new photo(2561484,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0080.jpg',500,333,'A walk to the town','http://admin2.clikpic.com/woolly1962/images/IMG_0080_thumb.jpg',130, 87,1, 0,'A view of Ilracombe from the nearby hill','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[54] = new photo(2416452,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5894.jpg',500,333,'Secret Swim','http://admin2.clikpic.com/woolly1962/images/IMG_5894_thumb.jpg',130, 87,1, 0,'A secret swim at sunset.','','Alan Woollard.','La Maddalena Islands, Sardinia.','','');
photos[55] = new photo(2390360,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_5900---Sardinia.jpg',500,333,'Sardinian Sunset','http://admin2.clikpic.com/woolly1962/images/IMG_5900---Sardinia_thumb.jpg',130, 87,1, 0,'A Sardinian sunset.','','Alan Woollard.','La Maddalena Islands, Sardinia.','','');
photos[56] = new photo(2390401,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_6456---Sardinia.jpg',500,333,'Porto Rafael','http://admin2.clikpic.com/woolly1962/images/IMG_6456---Sardinia_thumb.jpg',130, 87,1, 0,'A view of the Porto Rafael Harbour.','','Alan Woollard.','Porto Rafael, Sardinia.','','');
photos[57] = new photo(2561487,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_0083_2.jpg',500,750,'A summer walk','http://admin2.clikpic.com/woolly1962/images/IMG_0083_2_thumb.jpg',130, 195,1, 0,'Another view of the habour','','Alan Woollard.','Ilfracombe, Devon, England.','','');
photos[58] = new photo(2390350,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_4732---Sardinia.jpg',500,333,'Harbour view','http://admin2.clikpic.com/woolly1962/images/IMG_4732---Sardinia_thumb.jpg',130, 87,1, 0,'A view of the liner Arcadia from a Sardinian rooftop.','','Alan Woollard.','Porto Rafael, Sardinia.','','');
photos[59] = new photo(2390516,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/yorkrailings3.jpg',500,333,'Railings','http://admin2.clikpic.com/woolly1962/images/yorkrailings3_thumb.jpg',130, 87,1, 0,'','','Alan Woollard.','York, England.','','');
photos[60] = new photo(2413546,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_1834---Emirates.jpg',500,375,'Arsenal','http://admin2.clikpic.com/woolly1962/images/IMG_1834---Emirates_thumb.jpg',130, 98,1, 0,'A nightime shot of the Arsenal FC stadium.','','Alan Woollard.','Emirates Stadium, London.','','');
photos[61] = new photo(2413495,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/100_0057---Lyme-Regis.jpg',500,375,'Ropes','http://admin2.clikpic.com/woolly1962/images/100_0057---Lyme-Regis_thumb.jpg',130, 98,1, 0,'A view of the harbour entrance.','','Alan Woollard.','Lyme Regis, Dorset, England.','','');
photos[62] = new photo(2390414,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_9156_2---Salcombe.jpg',500,333,'Natural Harbour','http://admin2.clikpic.com/woolly1962/images/IMG_9156_2---Salcombe_thumb.jpg',130, 87,1, 0,'A beautiful natural harbour.','','Alan Woollard.','Salcombe, Devon, England.','','');
photos[63] = new photo(2413507,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/101_0118---Sainte-Marine.jpg',500,375,'Harbour view','http://admin2.clikpic.com/woolly1962/images/101_0118---Sainte-Marine_thumb.jpg',130, 98,1, 0,'A wonderful view of the harbour.','','Alan Woollard.','Sainte Marine, France.','','');
photos[64] = new photo(2413526,'155072','','gallery','http://admin2.clikpic.com/woolly1962/images/101_0154_r1---fire-rainbow.jpg',500,667,'Fire Rainbow - 2','http://admin2.clikpic.com/woolly1962/images/101_0154_r1---fire-rainbow_thumb.jpg',130, 173,1, 0,'A beautiful fire rainbow above the beach.','','Alan Woollard.','Sainte Marine, France.','','');
photos[65] = new photo(2390406,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7868---Calais.jpg',500,333,'Sand Patterns - 1','http://admin2.clikpic.com/woolly1962/images/IMG_7868---Calais_thumb.jpg',130, 87,1, 0,'Patterns in the sand.','','Alan Woollard.','Calais, France.','','');
photos[66] = new photo(2390407,'155074','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_7869---Calais.jpg',500,333,'Sand Patterns - 2','http://admin2.clikpic.com/woolly1962/images/IMG_7869---Calais_thumb.jpg',130, 87,1, 0,'Patterns in the sand.','','Alan Woollard.','Calais, France.','','');
photos[67] = new photo(2561559,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_6802_2.jpg',500,750,'Pebbles and posts','http://admin2.clikpic.com/woolly1962/images/IMG_6802_2_thumb.jpg',130, 195,1, 0,'Pebbles trapped between posts','','Alan Woollard.','Bembridge, Isle of White, England.','','');
photos[68] = new photo(2561526,'156031','','gallery','http://admin2.clikpic.com/woolly1962/images/IMG_3746wsm_2.jpg',500,750,'Posts','http://admin2.clikpic.com/woolly1962/images/IMG_3746wsm_2_thumb.jpg',130, 195,1, 0,'Posts in the sand','','Alan Woollard.','Calais, France.','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(155074,'3083661,2723978,2723971,2723967,2723952,2723937,2723925,2561563,2416457,2413607','Abstract','gallery');
galleries[1] = new gallery(205898,'3370829,3370827,3370826,3370825,3370739,3370737,3370735,3370733,3370720,3370713','Anaglyphs','gallery');
galleries[2] = new gallery(156031,'2561559,2561550,2561536,2561526,2561523,2561510,2416425,2413579','Black & White','gallery');
galleries[3] = new gallery(155073,'3083672,3083665,3083639,3083629,3083626,3083625,2723959,2390405','Nature','gallery');
galleries[4] = new gallery(155072,'3083673,2723948,2561599,2561593,2561584,2561546,2561532,2561529,2561517,2561508','Travel','gallery');

