/***************************************************************************
* 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('213844');
	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('213844');
	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)) {
		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 + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = 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(212487,'18705','','gallery','http://www1.clikpic.com/ajphotography/images/candle poster.jpg',266,400,'Choir stalls','http://www1.clikpic.com/ajphotography/images/candle poster_thumb.jpg',130, 195,0, 0,'','','Tony Hall','St Matthews Church, Blackmoor and Whitehill Parish, Hampshire, Uk','','');
photos[1] = new photo(212488,'18705','','gallery','http://www1.clikpic.com/ajphotography/images/The cross of Christ.jpg',267,400,'Cross of Christ','http://www1.clikpic.com/ajphotography/images/The cross of Christ_thumb.jpg',130, 195,0, 0,'','','Tony Hall','St Matthews Church, Blackmoor and Whitehill Parish, Hampshire, Uk','','');
photos[2] = new photo(212492,'18705','','gallery','http://www1.clikpic.com/ajphotography/images/Church organ.jpg',400,266,'Church Organ','http://www1.clikpic.com/ajphotography/images/Church organ_thumb.jpg',130, 86,0, 0,'','','Tony Hall','','','');
photos[3] = new photo(212496,'18705','','gallery','http://www1.clikpic.com/ajphotography/images/Church tower.jpg',400,320,'Church Tower','http://www1.clikpic.com/ajphotography/images/Church tower_thumb.jpg',130, 104,0, 1,'','','Tony Hall','','','');
photos[4] = new photo(212500,'18705','','gallery','http://www1.clikpic.com/ajphotography/images/I am the vine.jpg',300,400,'I am the vine','http://www1.clikpic.com/ajphotography/images/I am the vine_thumb.jpg',130, 173,0, 0,'Harvest festival, St Matthews, Blackmoor. Hampshire','','Tony Hall','St Matthews Church, Blackmoor and Whitehill Parish, Hampshire, Uk','','');
photos[5] = new photo(212508,'18705','','gallery','http://www1.clikpic.com/ajphotography/images/My grace.jpg',400,283,'My grace','http://www1.clikpic.com/ajphotography/images/My grace_thumb.jpg',130, 92,0, 1,'','','Fiona Hall ','','','');
photos[6] = new photo(213838,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Angel of the North.jpg',266,400,'Angel of the North','http://www1.clikpic.com/ajphotography/images/Angel of the North_thumb.jpg',130, 195,0, 0,'','','Fiona','Gateshead','','');
photos[7] = new photo(213862,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Florence.jpg',400,266,'Florence','http://www1.clikpic.com/ajphotography/images/Florence_thumb.jpg',130, 86,0, 1,'','','Tony Hall','Florence','','');
photos[8] = new photo(213870,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/French lavendar.jpg',267,400,'French lavendar','http://www1.clikpic.com/ajphotography/images/French lavendar_thumb.jpg',130, 195,0, 0,'','','Tony Hall ','','','');
photos[9] = new photo(213881,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Italian senore.jpg',400,266,'Italian lady','http://www1.clikpic.com/ajphotography/images/Italian senore_thumb.jpg',130, 86,0, 0,'Resident of San Gimignano','','Fiona Hall','San Gimignano','','');
photos[10] = new photo(213883,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Lindisfarne boats.jpg',400,268,'Upturned boat sheds at Lindisfarne','http://www1.clikpic.com/ajphotography/images/Lindisfarne boats_thumb.jpg',130, 87,0, 0,'','','Fiona Hall','Lindisfarne Island','','');
photos[11] = new photo(213902,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Sienna.jpg',400,266,'Sienna','http://www1.clikpic.com/ajphotography/images/Sienna_thumb.jpg',130, 86,0, 0,'View from the town hall','','Tony Hall','Sienna','','');
photos[12] = new photo(213910,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/South Shields.jpg',400,158,'Cormorants at South Shields','http://www1.clikpic.com/ajphotography/images/South Shields_thumb.jpg',130, 51,0, 0,'','','Fiona Hall','Island off coast at South sheilds','','');
photos[13] = new photo(558475,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Akoroa copy.jpg',492,369,'Akaroa, New Zealand','http://www1.clikpic.com/ajphotography/images/Akoroa copy_thumb.jpg',130, 98,0, 0,'','','Tony Hall','Akaroa, South island, NZ','','');
photos[14] = new photo(558482,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/Clematis copy.jpg',600,402,'Clematis flower','http://www1.clikpic.com/ajphotography/images/Clematis copy_thumb.jpg',130, 87,0, 0,'Clematis flower','','Tony Hall','','','');
photos[15] = new photo(558486,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Eiffel b&w  copy.jpg',576,576,'Eiffel Tower, Paris','http://www1.clikpic.com/ajphotography/images/Eiffel b&w  copy_thumb.jpg',130, 130,0, 0,'','','Tony Halll','','','');
photos[16] = new photo(558501,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/Female Comma copy.jpg',600,402,'Comma butterfly','http://www1.clikpic.com/ajphotography/images/Female Comma copy_thumb.jpg',130, 87,0, 1,'','','Tony Hall','','','');
photos[17] = new photo(558508,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/Jungfrau at duskcopy.jpg',600,281,'The Jungfrau mountain range, Switzerland','http://www1.clikpic.com/ajphotography/images/Jungfrau at duskcopy_thumb.jpg',130, 61,0, 0,'','','Fiona Hall','Switzerland','','');
photos[18] = new photo(558519,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/Monkey business copy.jpg',600,450,'Ring-tailed Lemur monkeys','http://www1.clikpic.com/ajphotography/images/Monkey business copy_thumb.jpg',130, 98,0, 0,'','','Fiona Hall','','','');
photos[19] = new photo(558528,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/moon arc de triomphe copy.jpg',600,450,'Arc de Triomphe,Paris','http://www1.clikpic.com/ajphotography/images/moon arc de triomphe copy_thumb.jpg',130, 98,0, 0,'Arc de triomphe at night','','Tony Hall ','Paris','','');
photos[20] = new photo(558557,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/NZ Food baskets from Gods copy.jpg',600,278,'\'Food baskets from the Gods\'<br>\nMoeraki, New Zealand','http://www1.clikpic.com/ajphotography/images/NZ Food baskets from Gods copy_thumb.jpg',130, 60,0, 0,'','','Fiona Hall','Moeraki, South Island, NZ','','');
photos[21] = new photo(558731,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/pink orchid copy.jpg',600,402,'Pink orchid','http://www1.clikpic.com/ajphotography/images/pink orchid copy_thumb.jpg',130, 87,0, 0,'','','Tony Hall','','','');
photos[22] = new photo(558757,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/Ray and Pat copy.jpg',402,600,'','http://www1.clikpic.com/ajphotography/images/Ray and Pat copy_thumb.jpg',130, 194,0, 0,'','','Tony Hall','','','');
photos[23] = new photo(558761,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/Sleeping cat copy.jpg',600,402,'Purrfect sleep','http://www1.clikpic.com/ajphotography/images/Sleeping cat copy_thumb.jpg',130, 87,0, 0,'','','Tony Hall','','','');
photos[24] = new photo(560245,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/South Downs copy.jpg',600,450,'The South Downs, Hampshire','http://www1.clikpic.com/ajphotography/images/South Downs copy_thumb.jpg',130, 98,0, 1,'','','Tony Hall','','','');
photos[25] = new photo(560250,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/haytor copy.jpg',600,325,'Haytor','http://www1.clikpic.com/ajphotography/images/haytor copy_thumb.jpg',130, 70,0, 0,'','','Tony Hall ','Dartmoor, Devon','','');
photos[26] = new photo(560255,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/Tigger copy.jpg',600,393,'Tom cat','http://www1.clikpic.com/ajphotography/images/Tigger copy_thumb.jpg',130, 85,0, 0,'','','Tony Hall','','','');
photos[27] = new photo(560260,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/The Blinking Eye Newcastle copy.jpg',600,399,'The Blinking Eye','http://www1.clikpic.com/ajphotography/images/The Blinking Eye Newcastle copy_thumb.jpg',130, 86,0, 0,'','','Tony Hall','Newcastle','','');
photos[28] = new photo(560277,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/Woodland copy.jpg',600,310,'Forest','http://www1.clikpic.com/ajphotography/images/Woodland copy_thumb.jpg',130, 67,0, 0,'','','Tony Hall','Alice Holt Forest, Hampshire','','');
photos[29] = new photo(560311,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/fiddler portrait.jpg',600,429,'','http://www1.clikpic.com/ajphotography/images/fiddler portrait_thumb.jpg',130, 93,0, 0,'','','Tony Hall ','','','');
photos[30] = new photo(560320,'18706','','gallery','http://www1.clikpic.com/ajphotography/images/brixham copy.jpg',600,429,'Fishing boats','http://www1.clikpic.com/ajphotography/images/brixham copy_thumb.jpg',130, 93,0, 0,'','','Tony Hall','Brixham harbour, Devon','','');
photos[31] = new photo(560331,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/White orchid copy.jpg',600,402,'Orchid','http://www1.clikpic.com/ajphotography/images/White orchid copy_thumb.jpg',130, 87,0, 1,'','','Tony Hall','','','');
photos[32] = new photo(1708409,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/DSCF0021.jpg',600,401,'Chive ','http://www1.clikpic.com/ajphotography/images/DSCF0021_thumb.jpg',130, 87,0, 0,'Chive Flower','','Tony Hall','','','');
photos[33] = new photo(1722077,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/elliott bw.jpg',600,897,'','http://www1.clikpic.com/ajphotography/images/elliott bw_thumb.jpg',130, 194,0, 0,'','','Tony Hall','Studio','','');
photos[34] = new photo(1756103,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_2774.jpg',600,773,'','http://www1.clikpic.com/ajphotography/images/DSC_2774_thumb.jpg',130, 167,0, 0,'','','Tony Hall','','','');
photos[35] = new photo(1756106,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/hand.jpg',600,422,'','http://www1.clikpic.com/ajphotography/images/hand_thumb.jpg',130, 91,0, 0,'','','Tony Hall','','','');
photos[36] = new photo(1756112,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/maternity.jpg',600,347,'','http://www1.clikpic.com/ajphotography/images/maternity_thumb.jpg',130, 75,0, 0,'','','Tony Hall','','','');
photos[37] = new photo(1756117,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/Untitled1.jpg',300,453,'','http://www1.clikpic.com/ajphotography/images/Untitled1_thumb.jpg',130, 196,0, 0,'','','Tony Hall','','','');
photos[38] = new photo(206868,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/jane.jpg',310,400,'','http://www1.clikpic.com/ajphotography/images/jane_thumb.jpg',130, 168,0, 0,'jane','','Tony Hall ','','','');
photos[39] = new photo(206835,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/sunflower.jpg',400,266,'Sunflower','http://www1.clikpic.com/ajphotography/images/sunflower_thumb.jpg',130, 86,0, 0,'','','Tony Hall','','','');
photos[40] = new photo(206847,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_0453.jpg',400,266,'Felicia amelloides','http://www1.clikpic.com/ajphotography/images/DSC_0453_thumb.jpg',130, 86,0, 0,'','','Fiona Hall','','','');
photos[41] = new photo(206853,'18704','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_4771.jpg',400,266,'Gerbera','http://www1.clikpic.com/ajphotography/images/DSC_4771_thumb.jpg',130, 86,0, 0,'','','Tony Hall','','','');
photos[42] = new photo(206858,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/soft focus 2.jpg',400,276,'','http://www1.clikpic.com/ajphotography/images/soft focus 2_thumb.jpg',130, 90,0, 0,'','','Tony Hall','','','');
photos[43] = new photo(206864,'18703','','gallery','http://www1.clikpic.com/ajphotography/images/soft bw.jpg',400,266,'','http://www1.clikpic.com/ajphotography/images/soft bw_thumb.jpg',130, 86,0, 1,'','','Tony Hall','','','');
photos[44] = new photo(213841,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Bride and Father.jpg',400,267,'','http://www1.clikpic.com/ajphotography/images/Bride and Father_thumb.jpg',130, 87,0, 0,'','','Tony','New Forest','','');
photos[45] = new photo(213844,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Brides maids.jpg',400,300,'','http://www1.clikpic.com/ajphotography/images/Brides maids_thumb.jpg',130, 98,1, 0,'','','Tony Hall','Headley, Hampshire','','');
photos[46] = new photo(213856,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_2674.jpg',400,300,'','http://www1.clikpic.com/ajphotography/images/DSC_2674_thumb.jpg',130, 98,0, 0,'','','Tony Hall','Basingstoke','','');
photos[47] = new photo(213868,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/flower basket.jpg',266,400,'','http://www1.clikpic.com/ajphotography/images/flower basket_thumb.jpg',130, 195,0, 0,'','','Tony Hall','Gomshall','','');
photos[48] = new photo(213886,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Liz.jpg',400,533,'','http://www1.clikpic.com/ajphotography/images/Liz_thumb.jpg',130, 173,0, 0,'','','Tony Hall','Willerby, Hull','','');
photos[49] = new photo(213889,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/ME028.jpg',400,300,'','http://www1.clikpic.com/ajphotography/images/ME028_thumb.jpg',130, 98,0, 0,'','','Tony Hall','Binsted, Hampshire','','');
photos[50] = new photo(213894,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Robert and Sarah.jpg',400,300,'','http://www1.clikpic.com/ajphotography/images/Robert and Sarah_thumb.jpg',130, 98,0, 0,'','','Tony Hall','Guildford, Surrey','','');
photos[51] = new photo(213934,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/TL067.jpg',400,300,'','http://www1.clikpic.com/ajphotography/images/TL067_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[52] = new photo(1708496,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_6231.jpg',600,399,'','http://www1.clikpic.com/ajphotography/images/DSC_6231_thumb.jpg',130, 86,0, 0,'','','Tony Hall','South Warnborugh,Hampshire','','');
photos[53] = new photo(1708501,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/331.jpg',600,450,'','http://www1.clikpic.com/ajphotography/images/331_thumb.jpg',130, 98,0, 0,'','','Tony Hall','Alton Hampshire','','');
photos[54] = new photo(1737732,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_0206 copy1.jpg',600,399,'','http://www1.clikpic.com/ajphotography/images/DSC_0206 copy1_thumb.jpg',130, 86,0, 0,'','','Tony Hall','','','');
photos[55] = new photo(1737733,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_1338 copy1.jpg',500,752,'','http://www1.clikpic.com/ajphotography/images/DSC_1338 copy1_thumb.jpg',130, 196,0, 0,'','','Tony Hall','','','');
photos[56] = new photo(1737736,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_2316.jpg',400,335,'','http://www1.clikpic.com/ajphotography/images/DSC_2316_thumb.jpg',130, 109,0, 0,'','','Tony Hall','','','');
photos[57] = new photo(1737742,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSC_2687.jpg',600,902,'','http://www1.clikpic.com/ajphotography/images/DSC_2687_thumb.jpg',130, 195,0, 0,'','','Tony Hall','','','');
photos[58] = new photo(1737748,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSCF0003 copy.jpg',600,900,'','http://www1.clikpic.com/ajphotography/images/DSCF0003 copy_thumb.jpg',130, 195,0, 0,'','','Tony Hall','','','');
photos[59] = new photo(1737751,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/DSCF0165 copy.jpg',600,400,'','http://www1.clikpic.com/ajphotography/images/DSCF0165 copy_thumb.jpg',130, 87,0, 0,'','','Tony Hall','','','');
photos[60] = new photo(1737756,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/sim011.JPG',600,429,'','http://www1.clikpic.com/ajphotography/images/sim011_thumb.JPG',130, 93,0, 0,'','','Tony Hall','','','');
photos[61] = new photo(1737757,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/vicar.jpg',600,442,'','http://www1.clikpic.com/ajphotography/images/vicar_thumb.jpg',130, 96,0, 0,'','','Tony Hall','','','');
photos[62] = new photo(206052,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Brian and Fiona.jpg',303,400,'','http://www1.clikpic.com/ajphotography/images/Brian and Fiona_thumb.jpg',130, 172,0, 0,'','','Tony Hall','Alton, Hampshire','','');
photos[63] = new photo(206058,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Matt and Emma.jpg',400,300,'','http://www1.clikpic.com/ajphotography/images/Matt and Emma_thumb.jpg',130, 98,0, 1,'','','Tony Hall','Farnham Castle','','');
photos[64] = new photo(206065,'18702','','gallery','http://www1.clikpic.com/ajphotography/images/Peeping.jpg',400,267,'','http://www1.clikpic.com/ajphotography/images/Peeping_thumb.jpg',130, 87,0, 0,'','','Tony Hall','Headley, Hampshire','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(18704,'560331,560245,558501','Nature','gallery');
galleries[1] = new gallery(18703,'206864','Portraits','gallery');
galleries[2] = new gallery(18705,'212508,212496','Religion','gallery');
galleries[3] = new gallery(18706,'213862','Travel','gallery');
galleries[4] = new gallery(18702,'206058','Weddings','gallery');

