/***************************************************************************
* 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('448901');
	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('448901');
	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 = '\'f8 Images\' - Peter Simmonds Photography: ' + photos[nextImg].caption;
										/* apply 'blank' classname to element where */			if ( photos[nextImg].caption == '') {
				document.getElementById('imageTitle').style.className = 'blank';
			}
			else {
				document.getElementById('imageTitle').style.className = 'normal';
			}
						temp = '';
			if (photos[nextImg].description != '') {
				temp = temp +  '<p id="imageDescription">' + photos[nextImg].description + '</p>';
			}
						if (photos[nextImg].photo_ref != '') {
				temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + photos[nextImg].photo_ref + '</p>';
			}
						if (photos[nextImg].takendate != '') {
				debug('Resetting taken date');
				temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + photos[nextImg].takendate + '</p>';
			}
			
			if (photos[nextImg].location != '') {
				debug('Resetting location');
				temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  photos[nextImg].location + '</p>';
			}
			
			if (photos[nextImg].photographer != '') {
				debug('Resetting photographer');
				temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.display = 'none';
		}
		else {
			document.getElementById('imageDetails').style.display = 'block';
		}
		document.getElementById('imageDetails').innerHTML =temp;	
		
	}
	else {
		debug('Redirecting to id ' + photos[nextImg].id);
		window.location = 'photo_' + photos[nextImg].id + '.html';
	}
}

/***************************************************************************
* Show the previous image for a gallery. field = hidden field containing   *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function previous(field,img) {


	imageID = field.value;
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k = j -1;
	while (nextImg < 0) {
		for (; k >= 0; k--) {
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				break;
			}
		}
		if (nextImg == -1) {
			k = photos.length -1;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);	
	}
}

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.
        *
* Gallery_id = id of gallery to choose                                     *
* 
 img = reference to html image                                       *
* in which to show image                                                   *
***************************************************************************/
function showGalleryImage(gallery_id, img) {
	debug('Gallery = ' + gallery_id);
	for (i = 0; i < galleries.length; i++) {
		if (galleries[i].id == gallery_id) {
			imageID = randomListVal(galleries[i].featured_images);
				for (j = 0; j < photos.length; j++) {
					if (photos[j].id == imageID) {
						
						img.src = photos[j].thumbnail;
						img.width = photos[j].thumbnail_width;
						img.height = photos[j].thumbnail_height;
						
						break;
					}
				}
			break;
		}
	} 
	}

/***************************************************************************
* If we have dynamic HTML                                                  *
*  replace the galleries link with a list that                             *
* doesn't include the current gallery                                      *
***************************************************************************/
function showGalleries(gallery_id) {
	debug('Showing links for gallery ' + gallery_id);
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
			debug('Testing gallery ' + galleries[i].id);
			
			if (galleries[i].id != gallery_id) {
				debug('Adding link');
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="gallery_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}
/***************************************************************************
* Create the array of Photo objects                                        *
***************************************************************************/
photos = new Array();
photos[0] = new photo(170077,'','','','http://www1.clikpic.com/peterlondon/images/Breezy-with-Lady.jpg',400,266,'','http://www1.clikpic.com/peterlondon/images/Breezy-with-Lady_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[1] = new photo(177058,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/DSC_9546-crop.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/DSC_9546-crop_thumb.jpg',130, 195,0, 0,'Familiar Sight – Most 100 year old cars spend their lives in museums. But not Boanerges owned by Imperial College Motor Club. The students aim to keep the car roadworthy all year round and it is a familiar sight on London’s roads. Seen here crossing Westminster Bridge while road testing following repairs.','','','','','');
photos[2] = new photo(177059,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/DSC_7964--crop.jpg',306,400,'','http://www1.clikpic.com/peterlondon/images/DSC_7964--crop_thumb.jpg',130, 170,0, 1,'Attention to details - 2002 Bo driver Dan Lehmann helping with final preparations. A long standing custom of the club is that new drivers are elected by a panel of previous drivers. On the day of the London Brighton event the old boys provide help and support to the current team.','','','','','');
photos[3] = new photo(177061,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/_DSC0104.jpg',267,400,'','http://www1.clikpic.com/peterlondon/images/_DSC0104_thumb.jpg',130, 195,0, 0,'Where’s the starter motor? – Mechanic’s from Eaton Square garage look on with fascination at Bo’s 103 year old engine. By today’s standards 9hp from 2.5 litres doesn’t sound impressive but in 1902 it was at the leading edge of development.','','','','','');
photos[4] = new photo(177065,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/DSC_8834-sharpened-autumn-l.jpg',400,267,'','http://www1.clikpic.com/peterlondon/images/DSC_8834-sharpened-autumn-l_thumb.jpg',130, 87,0, 0,'Open Road - Boanerges, or Bo as he is affectionately known, is a 9 horse power 1902 James and Browne built in Hammersmith, West London, and is one of only two surviving cars made by James and Browne. Seen here on the open roads of Sussex. Inset a picture of Bo with one of its original owners in 1904.','','','','','');
photos[5] = new photo(191114,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/Moment.jpg',400,267,'','http://www1.clikpic.com/peterlondon/images/Moment_thumb.jpg',130, 87,0, 0,'Magic moment  - the crew of Bo are constantly rewarded with smiles, cheers, toots and appluase as well courtesy from other drivers  - something today’s BMW driver is unlikely to encounter.','','','','','');
photos[6] = new photo(177069,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/Under-Car.jpg',267,400,'','http://www1.clikpic.com/peterlondon/images/Under-Car_thumb.jpg',130, 195,0, 0,'Final Checks  - On the pavement outside on of London’s most valuable lock up gargages David Horton working hard on preparing the car for the 2005 london to Brighton run.','','','','','');
photos[7] = new photo(177070,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/DSC_8935-sharpened-v2.jpg',400,270,'','http://www1.clikpic.com/peterlondon/images/DSC_8935-sharpened-v2_thumb.jpg',130, 88,0, 0,'Brighton 3.25pm – Finish Line: Winds gusting almost 40 knots and clouds nearly at sea level the end of run fly past by vintage aircraft was cancelled. David and team Bo were soon off for a well earned beer and a chance to warm up.','','','','','');
photos[8] = new photo(177066,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/Team-Bo-Portrait-layers-v9.jpg',283,400,'','http://www1.clikpic.com/peterlondon/images/Team-Bo-Portrait-layers-v9_thumb.jpg',130, 184,0, 0,'Team Bo 2005 -  led by  Bo\' Driver, David Horton 22, a final year mechanical engineering student (top left). The Bo\' Driver is elected annually and is ultimately responsible for the condition of the car. The co-drivers were clockwise  Huw Blackwell, aged 23, 1st year Postgraduate in department of Electrical and Electronic Engineering, Matt Harris aged 21, 2nd year Chemical Engineering, and Simon Hamlin aged 20, 3rd year Geology','','','','','');
photos[9] = new photo(191113,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/mr 90.jpg',400,267,'','http://www1.clikpic.com/peterlondon/images/mr 90_thumb.jpg',130, 87,0, 0,'VIP Passenger – Rodgers Knight who was one of the first team Bo drivers in 1937 getting into the car for the first time in 68 years. He was picked up and taken from his home near Eaton Sq and taken to a special 90th birthday celebration with the rector of Imperial College.','','','','','');
photos[10] = new photo(177071,'16300','','gallery','http://www1.clikpic.com/peterlondon/images/DSC_8157-sharpened.jpg',400,266,'','http://www1.clikpic.com/peterlondon/images/DSC_8157-sharpened_thumb.jpg',130, 86,0, 0,'End of the day - The trademark top hats of the Imperial College Motor Club hang from the roof of the Kensington lock up that is home to Bo and doubles up as the clubhouse, an alladins cave of memorabilia from nearly 70 years of London to Brighton runs.','','','','','');
photos[11] = new photo(448901,'26425','','gallery','http://www1.clikpic.com/peterlondon/images/Fit to burst Cover.jpg',458,600,'Copies available now £25','http://www1.clikpic.com/peterlondon/images/Fit to burst Cover_thumb.jpg',130, 170,1, 1,'','','','','','');
photos[12] = new photo(306848,'26425','','gallery','http://www1.clikpic.com/peterlondon/images/Powerlifting 2.jpg',284,400,'British Powerlifting Championships 2006','http://www1.clikpic.com/peterlondon/images/Powerlifting 2_thumb.jpg',130, 183,0, 0,'','','','','','');
photos[13] = new photo(307084,'26425','','gallery','http://www1.clikpic.com/peterlondon/images/Dave 455kg B&W 400pix.jpg',400,284,'1003lbs lift by Dave Bulldog Beattie','http://www1.clikpic.com/peterlondon/images/Dave 455kg B&W 400pix_thumb.jpg',130, 92,0, 0,'','','Micheala Doneava','','','');
photos[14] = new photo(307234,'26425','','gallery','http://www1.clikpic.com/peterlondon/images/_DSC3186 denis fisheye.jpg',266,400,'British Powerlifting Championships 2006','http://www1.clikpic.com/peterlondon/images/_DSC3186 denis fisheye_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[15] = new photo(189974,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/sharon stone.jpg',286,400,'Sharon Stone','http://www1.clikpic.com/peterlondon/images/sharon stone_thumb.jpg',130, 182,0, 1,'Sharon Stone arriving at the premier of her new film Basic Instinct 2 in London\'s Leicester Sq on March 15th 2006','','','','','');
photos[16] = new photo(170149,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Judy-dench.jpg',280,400,'Judi Dench','http://www1.clikpic.com/peterlondon/images/Judy-dench_thumb.jpg',130, 186,0, 0,'Judi Dench at the premier of Mrs Henderson Presents, Vue cinema, Leicester Sq, London. 23rd November 2005','','','','','');
photos[17] = new photo(187926,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Atkinson.jpg',344,400,'Rowan Atkinson','http://www1.clikpic.com/peterlondon/images/Atkinson_thumb.jpg',130, 151,0, 0,'Rowan Atkinson, posing for photographers prior to the premier of the film Keeping Mum. The premier took place in London’s Leicester Square in November 2005.','','','','','');
photos[18] = new photo(170150,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Ken-Portrait.jpg',280,400,'Ken Livingstone, Mayor of London','http://www1.clikpic.com/peterlondon/images/Ken-Portrait_thumb.jpg',130, 186,0, 0,'Ken Livingstone, Mayor of London, surveying his initiative to turn Oxford Street, London, into a pedestrian zone on Saturday 1st October 2005. The event titled dress to impress was a day of retail-led events combining in-store and on-street fashion, music, celebrity and street entertainment, with the main focus on fashion','','','','','');
photos[19] = new photo(170151,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Patrick-Swayze-2.jpg',280,400,'Patrick Swayze','http://www1.clikpic.com/peterlondon/images/Patrick-Swayze-2_thumb.jpg',130, 186,0, 0,'Patrick Swayze, posing for photographers prior to the premier of the film Keeping Mum. The premier took place in London’s Leicester Square in November 2005.','','','','','');
photos[20] = new photo(187930,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Charles Dance.jpg',287,400,'Charles Dance','http://www1.clikpic.com/peterlondon/images/Charles Dance_thumb.jpg',130, 181,0, 0,'Charles Dance, posing for photographers prior to the premier of the film Keeping Mum. The premier took place in London’s Leicester Square in November 2005.','','','','','');
photos[21] = new photo(176967,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Chemmy.jpg',266,400,'Chemmy Alcott','http://www1.clikpic.com/peterlondon/images/Chemmy_thumb.jpg',130, 195,0, 0,'Chemmy Alcott receiving the trophy for the British Downhill Ski Championship in Meribel, France. March 2005','','','','','');
photos[22] = new photo(187934,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Hoey.jpg',282,400,'Kate Hoey MP','http://www1.clikpic.com/peterlondon/images/Hoey_thumb.jpg',130, 184,0, 0,'Kate Hoey MP remonstrates with officials from Lambeth following complaints from residents about the destruction of a memorial rose garden during the landscaping of Archbishops Park SE1.','','','','','');
photos[23] = new photo(170154,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Dogs-Life.jpg',400,300,'Tony Baldry MP & Torres','http://www1.clikpic.com/peterlondon/images/Dogs-Life_thumb.jpg',130, 98,0, 0,'Westminster Dog of the Year Competition 27th October 2005, sponsored by the Kennel Club. 22 MP’s and Lords took part in the competition which highlights the special relationship between a dog and their owner, and helps to promote responsible dog ownership in a positive and light-hearted way. Open to all dog-owning parliamentarians from both Houses, the dogs are judged on their good deeds and behaviour, rather than their looks or pedigree. the winner of the 2005 Westminster Dog of the Year Award was Torres, an 18-month-old Pug owned by Tony Baldry, Conservative MP for Banbury','','','','','');
photos[24] = new photo(187924,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Will Young.jpg',400,292,'Will Young','http://www1.clikpic.com/peterlondon/images/Will Young_thumb.jpg',130, 95,0, 0,'Will Young, posing for photographers prior to the premier the film Mrs Henderson Presents. The premier took place at the Vue Cinema in London’s Leicester Square on 23rd November 2005.','','','','','');
photos[25] = new photo(168737,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Tate.jpg',400,300,'Rachel Whiteread Exhibit, Tate Modern','http://www1.clikpic.com/peterlondon/images/Tate_thumb.jpg',130, 98,0, 0,'Visitor the Unilever/Rachel Whitread exhibition on the opening day in October 2005.','','','','','');
photos[26] = new photo(188568,'15666','','gallery','http://www1.clikpic.com/peterlondon/images/Richard Young.jpg',400,289,'Richard Young','http://www1.clikpic.com/peterlondon/images/Richard Young_thumb.jpg',130, 94,0, 0,'World famous celebrity photographer Richard Young takes time out from his busy schedule to talk to MA Photojournalism students at University of Westminster. 14th March 2006. Richard is seen here reviewing the portfolio of Katie Collins.','','','','','');
photos[27] = new photo(168741,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Noel Grainy Cross Process 2.jpg',321,400,'','http://www1.clikpic.com/peterlondon/images/Noel Grainy Cross Process 2_thumb.jpg',130, 162,0, 1,'','','','','','');
photos[28] = new photo(169834,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Russian-Lady-2.jpg',272,400,'','http://www1.clikpic.com/peterlondon/images/Russian-Lady-2_thumb.jpg',130, 191,0, 0,'','','','','','');
photos[29] = new photo(169832,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Fred.jpg',269,400,'','http://www1.clikpic.com/peterlondon/images/Fred_thumb.jpg',130, 193,0, 0,'','','','','','');
photos[30] = new photo(169950,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Headshot.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/Headshot_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[31] = new photo(169949,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Bob-the-book.jpg',280,400,'','http://www1.clikpic.com/peterlondon/images/Bob-the-book_thumb.jpg',130, 186,0, 0,'','','','','','');
photos[32] = new photo(169830,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Pink-Lady.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/Pink-Lady_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[33] = new photo(169831,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Russian Lady.jpg',256,400,'','http://www1.clikpic.com/peterlondon/images/Russian Lady_thumb.jpg',130, 203,0, 0,'','','','','','');
photos[34] = new photo(169944,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Becky.jpg',301,400,'','http://www1.clikpic.com/peterlondon/images/Becky_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[35] = new photo(169945,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Tennis.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/Tennis_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[36] = new photo(169946,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Man-with-stick.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/Man-with-stick_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[37] = new photo(169948,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/bars.jpg',268,400,'','http://www1.clikpic.com/peterlondon/images/bars_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[38] = new photo(170094,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/ B&W Architect.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/ B&W Architect_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[39] = new photo(170074,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Breezy-Bike.jpg',400,400,'','http://www1.clikpic.com/peterlondon/images/Breezy-Bike_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[40] = new photo(170072,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Robin1.jpg',400,400,'','http://www1.clikpic.com/peterlondon/images/Robin1_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[41] = new photo(170084,'15661','','gallery','http://www1.clikpic.com/peterlondon/images/Breezy-Sitting.jpg',400,400,'','http://www1.clikpic.com/peterlondon/images/Breezy-Sitting_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[42] = new photo(169757,'15665','','gallery','http://www1.clikpic.com/peterlondon/images/Tree-&-Lifebouy.jpg',264,400,'','http://www1.clikpic.com/peterlondon/images/Tree-&-Lifebouy_thumb.jpg',130, 197,0, 1,'','','','','','');
photos[43] = new photo(168731,'15665','','gallery','http://www1.clikpic.com/peterlondon/images/Winter-Morning-Snowdonia.jpg',400,318,'','http://www1.clikpic.com/peterlondon/images/Winter-Morning-Snowdonia_thumb.jpg',130, 103,0, 0,'','','','','','');
photos[44] = new photo(176834,'15665','','gallery','http://www1.clikpic.com/peterlondon/images/Misty-Morning1.jpg',400,255,'','http://www1.clikpic.com/peterlondon/images/Misty-Morning1_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[45] = new photo(176981,'15665','','gallery','http://www1.clikpic.com/peterlondon/images/rowers.jpg',400,264,'','http://www1.clikpic.com/peterlondon/images/rowers_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[46] = new photo(177021,'15665','','gallery','http://www1.clikpic.com/peterlondon/images/Haltwhistle.jpg',400,288,'','http://www1.clikpic.com/peterlondon/images/Haltwhistle_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[47] = new photo(177022,'15665','','gallery','http://www1.clikpic.com/peterlondon/images/Haltwhistle-2.jpg',400,288,'','http://www1.clikpic.com/peterlondon/images/Haltwhistle-2_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[48] = new photo(2931489,'15665','','gallery','http://admin.clikpic.com/peterlondon/images/IMG_1750 crop for web 700.jpg',600,372,'Autumn at Harleyford','http://admin.clikpic.com/peterlondon/images/IMG_1750 crop for web 700_thumb.jpg',130, 80,0, 0,'','','','Harleyford','','');
photos[49] = new photo(168728,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/Runner.jpg',291,400,'','http://www1.clikpic.com/peterlondon/images/Runner_thumb.jpg',130, 179,0, 1,'','','','','','');
photos[50] = new photo(176964,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/Greyhound.jpg',400,267,'','http://www1.clikpic.com/peterlondon/images/Greyhound_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[51] = new photo(176968,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/Skier.jpg',400,266,'','http://www1.clikpic.com/peterlondon/images/Skier_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[52] = new photo(176969,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/Rugby.jpg',311,400,'','http://www1.clikpic.com/peterlondon/images/Rugby_thumb.jpg',130, 167,0, 0,'','','','','','');
photos[53] = new photo(176970,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/Rugby-2.jpg',400,282,'','http://www1.clikpic.com/peterlondon/images/Rugby-2_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[54] = new photo(177025,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/Form-Guide-web.jpg',400,280,'','http://www1.clikpic.com/peterlondon/images/Form-Guide-web_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[55] = new photo(177010,'15667','','gallery','http://www1.clikpic.com/peterlondon/images/fun-run.jpg',400,267,'','http://www1.clikpic.com/peterlondon/images/fun-run_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[56] = new photo(176992,'15664','','gallery','http://www1.clikpic.com/peterlondon/images/Sage Stairs.jpg',264,400,'','http://www1.clikpic.com/peterlondon/images/Sage Stairs_thumb.jpg',130, 197,0, 1,'','','','','','');
photos[57] = new photo(177006,'15664','','gallery','http://www1.clikpic.com/peterlondon/images/London-Eye.jpg',400,283,'','http://www1.clikpic.com/peterlondon/images/London-Eye_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[58] = new photo(176991,'15664','','gallery','http://www1.clikpic.com/peterlondon/images/Blue-Eye.jpg',266,400,'','http://www1.clikpic.com/peterlondon/images/Blue-Eye_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[59] = new photo(168691,'15664','','gallery','http://www1.clikpic.com/peterlondon/images/Parliament.jpg',400,261,'Parliament 2005','http://www1.clikpic.com/peterlondon/images/Parliament_thumb.jpg',130, 85,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(16300,'177059','London Brighton','gallery');
galleries[1] = new gallery(23646,'177059','Picture Essays','gallery');
galleries[2] = new gallery(26425,'448901','Powerlifting','gallery');
galleries[3] = new gallery(15666,'189974','Celebrity','gallery');
galleries[4] = new gallery(15661,'168741','Portraits','gallery');
galleries[5] = new gallery(15665,'169757','Landscape','gallery');
galleries[6] = new gallery(15667,'168728','Sport','gallery');
galleries[7] = new gallery(15664,'176992','Buildings','gallery');

