/***************************************************************************
* 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('2176398,2168519,2168510,2168503,2168501,2168500,2168488,2163524,2163520,2163510,2163481,2163398,2163377,2163364,2163316,2163313,2163293,2163266,2163251,2161809,2161799,2161655,2161653,2161651,2161650,2161649,2161647,2161646,2161644,2161639,2161637,2161634,2161633,2161623,2161618,2161612,2159858,2159732,2157964,2157959,2155355');
	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('2176398,2168519,2168510,2168503,2168501,2168500,2168488,2163524,2163520,2163510,2163481,2163398,2163377,2163364,2163316,2163313,2163293,2163266,2163251,2161809,2161799,2161655,2161653,2161651,2161650,2161649,2161647,2161646,2161644,2161639,2161637,2161634,2161633,2161623,2161618,2161612,2159858,2159732,2157964,2157959,2155355');
	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) || (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 = 'Dorset Coastal 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(2163524,'143067','','gallery','http://www2.clikpic.com/petervanallen/images/b web Tulips and Deckchairs.jpg',500,353,'Tulips and Deckchairs','http://www2.clikpic.com/petervanallen/images/b web Tulips and Deckchairs_thumb.jpg',130, 92,1, 0,'Spring Tulips and deckchairs on Weymouth Esplanade','11/04/08','Peter Van Allen','Weymouth Esplanade, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[1] = new photo(2161649,'142963','','gallery','http://www2.clikpic.com/petervanallen/images/a web Sunfisher.jpg',500,353,'Sunfisher','http://www2.clikpic.com/petervanallen/images/a web Sunfisher_thumb.jpg',130, 92,1, 0,'Fishing boat on Chesil Beach at sunset','11/02/08','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[2] = new photo(2161623,'142963','','gallery','http://www2.clikpic.com/petervanallen/images/a web Evening Walk along the Beach.jpg',500,353,'An Evening Walk Along the Beach','http://www2.clikpic.com/petervanallen/images/a web Evening Walk along the Beach_thumb.jpg',130, 92,1, 0,'An evening walk along the top of the Chesil Beach at Portland','27/01/08','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[3] = new photo(2163520,'142963','','gallery','http://www2.clikpic.com/petervanallen/images/b web windswept.jpg',500,353,'Windswept','http://www2.clikpic.com/petervanallen/images/b web windswept_thumb.jpg',130, 92,1, 0,'Fishing boat at sunset on Chesil Beach, Portland','13/11/07','Peter Van Allen','Chesil Beach, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[4] = new photo(2161637,'142963','','gallery','http://www2.clikpic.com/petervanallen/images/a web Pebbles and the Sky.jpg',500,353,'Pebbles and the Sky','http://www2.clikpic.com/petervanallen/images/a web Pebbles and the Sky_thumb.jpg',130, 92,1, 0,'Two fishing boats at Chesil Beach, Portland','14/08/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[5] = new photo(2161650,'142963','','gallery','http://www2.clikpic.com/petervanallen/images/a web Sunset on Chesil Beach.jpg',500,353,'Sunset on Chesil Beach','http://www2.clikpic.com/petervanallen/images/a web Sunset on Chesil Beach_thumb.jpg',130, 92,1, 0,'Sunset on Chesil Beach from Portland Heights','08/08/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[6] = new photo(2176398,'143067','','gallery','http://www2.clikpic.com/petervanallen/images/z Esplanade Reflections.jpg',500,353,'Beach reflections','http://www2.clikpic.com/petervanallen/images/z Esplanade Reflections_thumb.jpg',130, 92,1, 0,'Weymouth Seafront reflected in the calm waters of Weymouth Bay','04/08/07','Peter Van Allen','Weymouth Beach, Weymouth, Dorset',15.00,'A4 (297mm X 210mm) unmounted glossy lab print');
photos[7] = new photo(2168510,'143067','','gallery','http://www2.clikpic.com/petervanallen/images/y shelter.jpg',500,353,'Esplanade Shelter','http://www2.clikpic.com/petervanallen/images/y shelter_thumb.jpg',130, 92,1, 0,'Refurbished Victorian Shelter on Weymouth Esplanade','07/07/07','Peter Van Allen','Weymouth Esplanade, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[8] = new photo(2161809,'143067','','gallery','http://www2.clikpic.com/petervanallen/images/a web Candy Floss.jpg',500,353,'Candy Floss','http://www2.clikpic.com/petervanallen/images/a web Candy Floss_thumb.jpg',130, 92,1, 0,'Beach Shop on Weymouth Beach','14/05/07','Peter Van Allen','Weymouth Beach',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[9] = new photo(2161655,'142963','','gallery','http://www2.clikpic.com/petervanallen/images/a web Yellow and White.jpg',500,353,'Yellow and White','http://www2.clikpic.com/petervanallen/images/a web Yellow and White_thumb.jpg',130, 92,1, 0,'Boats on the Chesil Beach at Portland','27/04/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[10] = new photo(2161612,'143067','','gallery','http://www2.clikpic.com/petervanallen/images/a web Cloud beach.jpg',500,353,'Cloud Beach','http://www2.clikpic.com/petervanallen/images/a web Cloud beach_thumb.jpg',130, 92,1, 0,'Cloud reflected on the beach at Greenhill in Weymouth','07/03/07','Peter Van Allen','Greenhill Beach, Weymouth',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[11] = new photo(2168500,'143067','','gallery','http://www2.clikpic.com/petervanallen/images/y esplanade.jpg',500,353,'Esplanade Lights','http://www2.clikpic.com/petervanallen/images/y esplanade_thumb.jpg',130, 92,1, 0,'The evening lights of Weymouth Esplande reflected in the still waters of Weymouth Bay','26/02/07','Peter Van Allen','Weymouth Esplanade, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[12] = new photo(3019665,'185784','','gallery','http://www2.clikpic.com/petervanallen/images/here comes the flood.jpg',332,500,'Here comes the flood','http://www2.clikpic.com/petervanallen/images/here comes the flood_thumb.jpg',86, 130,0, 0,'Stranded starfish have nowhere to hide, waiting for the swollen Easter tide','03/10/08','Peter Van Allen','Chesil Beach, Portland, UK',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[13] = new photo(3019686,'185784','','gallery','http://www2.clikpic.com/petervanallen/images/icarus undone 2.jpg',500,389,'Icarus undone...','http://www2.clikpic.com/petervanallen/images/icarus undone 2_thumb.jpg',130, 101,0, 0,'...he flew too close to the sun','23/09/08','Peter Van Allen','Chesil Beach, Portland, Dorset, UK',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[14] = new photo(3019697,'185784','','gallery','http://www2.clikpic.com/petervanallen/images/remains of the day.jpg',334,500,'Remains of the day','http://www2.clikpic.com/petervanallen/images/remains of the day_thumb.jpg',87, 130,0, 0,'and all that was left was a feather','','Peter Van Allen','Chesil Beach, Portland, Dorset, UK',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[15] = new photo(2163364,'143303','','gallery','http://www2.clikpic.com/petervanallen/images/b web oh what a night.jpg',500,353,'Oh, What a Night','http://www2.clikpic.com/petervanallen/images/b web oh what a night_thumb.jpg',130, 92,1, 0,'Fishing Boat on Chesil Beach, Portland at sunset','25/11/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[16] = new photo(2163266,'143303','','gallery','http://www2.clikpic.com/petervanallen/images/x Chesil Cove night time.jpg',500,353,'Chesil Cove night time','http://www2.clikpic.com/petervanallen/images/x Chesil Cove night time_thumb.jpg',130, 92,1, 0,'Night time at Chesil Cove, Portland','07/10/07','Peter Van Allen','Chesil Cove, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[17] = new photo(2159858,'143303','','gallery','http://www2.clikpic.com/petervanallen/images/a web Fishing Boat with Lobster Pot.jpg',500,353,'Fishing Boat with Lobster Pot','http://www2.clikpic.com/petervanallen/images/a web Fishing Boat with Lobster Pot_thumb.jpg',130, 92,1, 0,'Fishing Boat with Lobster Pot','11/07/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[18] = new photo(2161799,'143303','','gallery','http://www2.clikpic.com/petervanallen/images/a web Copper Sunset.jpg',500,353,'Copper Sunset','http://www2.clikpic.com/petervanallen/images/a web Copper Sunset_thumb.jpg',130, 92,1, 0,'Fishing boats at sunset on Chesil Beach, Portland','21/05/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[19] = new photo(2157959,'143303','','gallery','http://www2.clikpic.com/petervanallen/images/a web Chesil Beach at Portland.jpg',500,353,'The Chesil Beach at Portland, Jurassic Coast World Heritage Site','http://www2.clikpic.com/petervanallen/images/a web Chesil Beach at Portland_thumb.jpg',130, 92,1, 0,'A summer\'s evening on the Chesil Beach at Portland','06/05/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[20] = new photo(2155355,'143303','','gallery','http://www2.clikpic.com/petervanallen/images/a web If at First You Don\'t Succeed.jpg',500,353,'If at First You Don\'t Succeed...','http://www2.clikpic.com/petervanallen/images/a web If at First You Don\'t Succeed_thumb.jpg',130, 92,1, 0,'A spring sunset at Chesil Beach, Portland','18/04/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[21] = new photo(2161609,'143395','','gallery','http://www2.clikpic.com/petervanallen/images/a web beach onion.jpg',353,500,'Beach Onion','http://www2.clikpic.com/petervanallen/images/a web beach onion_thumb.jpg',92, 130,0, 0,'Dynamic view of a fishing boat on Chesil Beach, Portland','22/03/08','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[22] = new photo(2161632,'143395','','gallery','http://www2.clikpic.com/petervanallen/images/a web Low.jpg',353,500,'Low','http://www2.clikpic.com/petervanallen/images/a web Low_thumb.jpg',92, 130,0, 0,'Dynamic view of a fishing boat at Chesil Beach, Portland','19/03/08','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[23] = new photo(2163493,'143395','','gallery','http://www2.clikpic.com/petervanallen/images/b web sun set.jpg',353,500,'Sun Set','http://www2.clikpic.com/petervanallen/images/b web sun set_thumb.jpg',92, 130,0, 0,'Fishing boat at sunset on Chesil Beach, Portland','22/02/08','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[24] = new photo(2163313,'143395','','gallery','http://www2.clikpic.com/petervanallen/images/b web crash.jpg',500,353,'Crash !','http://www2.clikpic.com/petervanallen/images/b web crash_thumb.jpg',130, 92,1, 0,'Waves crashing onto the Chesil Beach at Portland, Dorset','30/01/08','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[25] = new photo(2163318,'143395','','gallery','http://www2.clikpic.com/petervanallen/images/b web green spar.jpg',353,500,'Green Spar','http://www2.clikpic.com/petervanallen/images/b web green spar_thumb.jpg',92, 130,0, 0,'Fishing boat with reflection on Chesil Beach, Portland at Sunset','25/11/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 unmounted glossy lab print');
photos[26] = new photo(2163510,'143395','','gallery','http://www2.clikpic.com/petervanallen/images/b web tools of the trade.jpg',500,353,'Tools of the Trade','http://www2.clikpic.com/petervanallen/images/b web tools of the trade_thumb.jpg',130, 92,1, 0,'A tangle of fishing boat ropes, nets and buoys on Chesil Beach, Portland','19/11/07','Peter Van Allen','Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[27] = new photo(2163398,'143066','','gallery','http://www2.clikpic.com/petervanallen/images/b web red boat.jpg',500,353,'Red Boat','http://www2.clikpic.com/petervanallen/images/b web red boat_thumb.jpg',130, 92,1, 0,'Red Boat in Weymouth Marina, Weymouth, Dorset','05/02/08','Peter Van Allen','Weymouth Harbour, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[28] = new photo(2163377,'143063','','gallery','http://www2.clikpic.com/petervanallen/images/b web Olive crane.jpg',500,353,'Olive Crane','http://www2.clikpic.com/petervanallen/images/b web Olive crane_thumb.jpg',130, 92,1, 0,'Fisherman\'s crane at Portland Bill, Dorset on a winter\'s day','23/01/08','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[29] = new photo(2161644,'143063','','gallery','http://www2.clikpic.com/petervanallen/images/a web Pulpit Rock looking south1.jpg',500,353,'Pulpit Rock, looking south','http://www2.clikpic.com/petervanallen/images/a web Pulpit Rock looking south1_thumb.jpg',130, 92,1, 0,'Pulpit Rock, Portland Bill from the north looking south','13/10/07','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[30] = new photo(2161634,'143066','','gallery','http://www2.clikpic.com/petervanallen/images/a web Orange and Green.jpg',500,353,'Orange and Green','http://www2.clikpic.com/petervanallen/images/a web Orange and Green_thumb.jpg',130, 92,1, 0,'Sunset on the moored boats in Weymouth Harbour','09/10/07','Peter Van Allen','Weymouth Harbour, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[31] = new photo(2161638,'143063','','gallery','http://www2.clikpic.com/petervanallen/images/a web Portland Bill Lighthouse reflection.jpg',353,500,'Lighthouse Reflection','http://www2.clikpic.com/petervanallen/images/a web Portland Bill Lighthouse reflection_thumb.jpg',92, 130,0, 0,'Portland Bill lighthouse reflected in the water at low tide','02/09/07','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[32] = new photo(2161646,'143066','','gallery','http://www2.clikpic.com/petervanallen/images/a web Rope.jpg',500,353,'Rope','http://www2.clikpic.com/petervanallen/images/a web Rope_thumb.jpg',130, 92,1, 0,'Fishing boat ropes in Weymouth Harbour','19/08/07','Peter Van Allen','Weymouth Harbour, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[33] = new photo(2161647,'143063','','gallery','http://www2.clikpic.com/petervanallen/images/a web Stormy Weather.jpg',500,353,'Stormy Weather','http://www2.clikpic.com/petervanallen/images/a web Stormy Weather_thumb.jpg',130, 92,1, 0,'A rough day at Portland Bill, Portland, Dorset','11/08/07','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[34] = new photo(2161651,'143066','','gallery','http://www2.clikpic.com/petervanallen/images/a web Trinity Street.jpg',500,353,'Trinity Street, Weymouth','http://www2.clikpic.com/petervanallen/images/a web Trinity Street_thumb.jpg',130, 92,1, 0,'Harbour reflections at Weymouth, Dorset','22/05/07','Peter Van Allen','Weymouth Harbour, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[35] = new photo(2161643,'143063','','gallery','http://www2.clikpic.com/petervanallen/images/a web Pulpit Rock looking north.jpg',353,500,'Pulpit Rock, looking north','http://www2.clikpic.com/petervanallen/images/a web Pulpit Rock looking north_thumb.jpg',92, 130,0, 0,'Pulpit Rock, Portland Bill from the south looking north','02/05/07','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[36] = new photo(2161630,'143066','','gallery','http://www2.clikpic.com/petervanallen/images/a web Harvest Moon Over the Bay.jpg',353,500,'Harvest Moon over the Bay','http://www2.clikpic.com/petervanallen/images/a web Harvest Moon Over the Bay_thumb.jpg',92, 130,0, 0,'Reflection of a fishing boat buoy in Weymouth Marina','12/04/07','Peter Van Allen','Weymouth Harbour, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[37] = new photo(2157964,'143066','','gallery','http://www2.clikpic.com/petervanallen/images/a web Primary Boats.jpg',500,353,'Primary Boats','http://www2.clikpic.com/petervanallen/images/a web Primary Boats_thumb.jpg',130, 92,1, 0,'The red, blue and yellow hulls of boats in Weymouth Marina','02/04/07','Peter Van Allen','Weymouth Marina, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[38] = new photo(2168501,'143063','','gallery','http://www2.clikpic.com/petervanallen/images/y ground zero 030307.jpg',500,353,'Ground Zero','http://www2.clikpic.com/petervanallen/images/y ground zero 030307_thumb.jpg',130, 92,1, 0,'Evening sun at Portland Bill, Dorset','04/03/07','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[39] = new photo(2161626,'143398','','gallery','http://www2.clikpic.com/petervanallen/images/a web Harbour Antiques.jpg',353,500,'Harbour Antiques','http://www2.clikpic.com/petervanallen/images/a web Harbour Antiques_thumb.jpg',92, 130,0, 0,'A view of Weymouth Harbour, Dorset','23/08/07','Peter Van Allen','Weymouth Harbour, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[40] = new photo(2168503,'143398','','gallery','http://www2.clikpic.com/petervanallen/images/y marina reflection.jpg',500,353,'Marina Reflection','http://www2.clikpic.com/petervanallen/images/y marina reflection_thumb.jpg',130, 92,1, 0,'Reflections of waterside buildings in the still water of Weymouth Marina','05/04/07','Peter Van Allen','Weymouth Harbour, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[41] = new photo(2163258,'143068','','gallery','http://www2.clikpic.com/petervanallen/images/b web Beach Narcissi.jpg',353,500,'Beach Narcissi','http://www2.clikpic.com/petervanallen/images/b web Beach Narcissi_thumb.jpg',92, 130,0, 0,'Daffodils and beach huts at Greenhill Gardens, Weymouth','05/03/08','Peter Van Allen','Greenhill Gardens, Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[42] = new photo(2163316,'143068','','gallery','http://www2.clikpic.com/petervanallen/images/b web forest trail.jpg',500,353,'The Forest Trail','http://www2.clikpic.com/petervanallen/images/b web forest trail_thumb.jpg',130, 92,1, 0,'The Rodwell Trail at Weymouth, Dorset','05/02/08','Peter Van Allen','Weymouth, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[43] = new photo(2168488,'143068','','gallery','http://www2.clikpic.com/petervanallen/images/y 032807 tulips.jpg',500,353,'Tulips','http://www2.clikpic.com/petervanallen/images/y 032807 tulips_thumb.jpg',130, 92,1, 0,'Spring tulips at Greenhill Gardens, Weymouth','28/03/07','Peter Van Allen','Greenhill Gardens, Weymouth',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[44] = new photo(2163481,'143064','','gallery','http://www2.clikpic.com/petervanallen/images/b web south mill.jpg',500,353,'South Mill','http://www2.clikpic.com/petervanallen/images/b web south mill_thumb.jpg',130, 92,1, 0,'Old Medieval windmill at Portland, Dorset','18/04/08','Peter Van Allen','South Mill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[45] = new photo(2161639,'143064','','gallery','http://www2.clikpic.com/petervanallen/images/a web Portland Crane I.jpg',500,353,'Portland Crane I','http://www2.clikpic.com/petervanallen/images/a web Portland Crane I_thumb.jpg',130, 92,1, 0,'The old crane at Durdle Pier, Portland','07/01/08','Peter Van Allen','Durdle Pier, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[46] = new photo(2163251,'143064','','gallery','http://www2.clikpic.com/petervanallen/images/b web antique windmill.jpg',500,353,'Antique Windmill','http://www2.clikpic.com/petervanallen/images/b web antique windmill_thumb.jpg',130, 92,1, 0,'Old Medieval windmill at Portland, Dorset','31/12/07','Peter Van Allen','South Mill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[47] = new photo(2163293,'143064','','gallery','http://www2.clikpic.com/petervanallen/images/b web Church Ope Rocks.jpg',500,353,'Church Ope rocks','http://www2.clikpic.com/petervanallen/images/b web Church Ope Rocks_thumb.jpg',130, 92,1, 0,'Rocks at Church Ope Cove, Portland, Dorset captured using a long exposure','14/10/07','Peter Van Allen','Church Ope Cove, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[48] = new photo(2161618,'143064','','gallery','http://www2.clikpic.com/petervanallen/images/a web Durdle Pier.jpg',500,353,'Durdle Pier','http://www2.clikpic.com/petervanallen/images/a web Durdle Pier_thumb.jpg',130, 92,1, 0,'Durdle Pier at Portland, Dorset','28/07/07','Peter Van Allen','Durdle Pier, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[49] = new photo(2159732,'143064','','gallery','http://www2.clikpic.com/petervanallen/images/a web Faraway So Close.jpg',500,353,'Faraway, So Close','http://www2.clikpic.com/petervanallen/images/a web Faraway So Close_thumb.jpg',130, 92,1, 0,'Overlooking Chesil Beach from Portland Heights','05/06/07','Peter Van Allen','Portland Heights, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[50] = new photo(2250356,'143406','','gallery','http://www2.clikpic.com/petervanallen/images/Chesil Beach new.jpg',353,500,'Approaching rain','http://www2.clikpic.com/petervanallen/images/Chesil Beach new_thumb.jpg',92, 130,0, 0,'Fishing boats on Chesil Beach, Portland','30/05/08','Peter Van Allen','Chesil Beach, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[51] = new photo(2161633,'143406','','gallery','http://www2.clikpic.com/petervanallen/images/a web Lyme Bay Sunset.jpg',500,353,'Lyme Bay Sunset','http://www2.clikpic.com/petervanallen/images/a web Lyme Bay Sunset_thumb.jpg',130, 92,1, 0,'Sunset over Lyme Bay from Chesil Beach, Portland','03/03/08','Peter Van Allen','Lyme Bay, Chesil Beach, Portland',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[52] = new photo(2161641,'143406','','gallery','http://www2.clikpic.com/petervanallen/images/a web Portland Crane II.jpg',353,500,'Portland Crane II','http://www2.clikpic.com/petervanallen/images/a web Portland Crane II_thumb.jpg',92, 130,0, 0,'The old crane at Durdle Pier, Portland','21/02/08','Peter Van Allen','Durdle Pier, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[53] = new photo(2161653,'143406','','gallery','http://www2.clikpic.com/petervanallen/images/a web With an Eye to the Sea.jpg',500,353,'An Eye to the Sea','http://www2.clikpic.com/petervanallen/images/a web With an Eye to the Sea_thumb.jpg',130, 92,1, 0,'Iron ring in the rocks at Portland Bill, Portland, Dorset','13/09/07','Peter Van Allen','Portland Bill, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[54] = new photo(2161783,'143406','','gallery','http://www2.clikpic.com/petervanallen/images/a web Coastal Bokeh.jpg',353,500,'Coastal Bokeh','http://www2.clikpic.com/petervanallen/images/a web Coastal Bokeh_thumb.jpg',92, 130,0, 0,'Yellow flowers on the cliffs at Portland, Dorset','05/08/07','Peter Van Allen','East Cliffs, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');
photos[55] = new photo(2168519,'143406','','gallery','http://www2.clikpic.com/petervanallen/images/y thrift.jpg',500,353,'Thrift','http://www2.clikpic.com/petervanallen/images/y thrift_thumb.jpg',130, 92,1, 0,'Thrift or Sea Pink on Chesil Beach, Portland, early spring','17/04/07','Peter Van Allen','Chesil Beach, Portland, Dorset',15.00,'A4 (29.7cm x 21cm) unmounted glossy lab print');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(142963,'2163520,2161655,2161650,2161649,2161637,2161623','Chesil Beach I','gallery');
galleries[1] = new gallery(185784,'3019697,3019686,3019665','NEW IMAGES','gallery');
galleries[2] = new gallery(143065,'2176398,2168510,2168503,2168500,2168488,2163524,2163398,2163316,2163258,2161809','Weymouth','gallery');
galleries[3] = new gallery(143067,'2176398,2168510,2168500,2163524,2161809,2161612','Weymouth Beach I','gallery');
galleries[4] = new gallery(143303,'2163364,2163266,2161799,2159858,2157959,2155355','Chesil Beach II','gallery');
galleries[5] = new gallery(142974,'2250356,2168519,2168501,2163520,2163510,2163493,2163481,2163377,2163364,2163318','Portland','gallery');
galleries[6] = new gallery(143395,'2163510,2163493,2163318,2163313,2161632,2161609','Chesil Beach III','gallery');
galleries[7] = new gallery(143063,'2168501,2163377,2161647,2161644,2161643,2161638','Portland Bill','gallery');
galleries[8] = new gallery(143066,'2163398,2161651,2161646,2161634,2161630,2157964','Weymouth Harbour I','gallery');
galleries[9] = new gallery(143398,'2168503,2161626','Weymouth Harbour II','gallery');
galleries[10] = new gallery(143068,'2168488,2163316,2163258','Other','gallery');
galleries[11] = new gallery(143064,'2163481,2163293,2163251,2161639,2161618,2159732','Other I','gallery');
galleries[12] = new gallery(143406,'2250356,2168519,2161783,2161653,2161641,2161633','Other II','gallery');

