/***************************************************************************
* 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('883920,622846,444808,407092');
	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('883920,622846,444808,407092');
	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)) {
		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(428269,'','SFS - BW - 014 Arundel Castle ','','http://www1.clikpic.com/px200/images/SFS - BW - 014 Arundel Castle1.JPG',400,533,'Arundel Castle ','http://www1.clikpic.com/px200/images/SFS - BW - 014 Arundel Castle1_thumb.JPG',100, 133,0, 0,'','','','','','');
photos[1] = new photo(477036,'32811','','gallery','http://www1.clikpic.com/px200/images/download 021 162X200.jpg',162,200,'Mountboard -  A huge choice of colours thickness and textures','http://www1.clikpic.com/px200/images/download 021 162X200_thumb.jpg',130, 160,0, 1,'','','','','','');
photos[2] = new photo(477030,'32811','','gallery','http://www1.clikpic.com/px200/images/download 008 150X200.jpg',150,200,'Mouldings - Large selection of classic and traditional through to contemporary styles finishes and colours','http://www1.clikpic.com/px200/images/download 008 150X200_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[3] = new photo(407092,'32739','SFS - BW - 001 Worthing Pier Amusements at Dusk','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 001 Worthing Pier Amusements at dusk1.JPG',600,450,'Worthing Pier Amusements at Dusk','http://www1.clikpic.com/px200/images/SFS - BW - 001 Worthing Pier Amusements at dusk1_thumb.JPG',130, 98,1, 0,'','','','','','');
photos[4] = new photo(407102,'32739','SFS - WF - 001 Trio of Worthing Pier','gallery','http://www1.clikpic.com/px200/images/SFS - WF - 001 Ash framed trio of Worthing Pier (left).JPG',600,450,'Worthing Pier','http://www1.clikpic.com/px200/images/SFS - WF - 001 Ash framed trio of Worthing Pier (left)_thumb.JPG',130, 98,0, 0,'A hazy sunset looking across from the East Beach to the Pier','','','','','');
photos[5] = new photo(407096,'32739','SFS - BW - 002 Boats at East Worthing','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 002 Boat at East Worthing.JPG',600,450,'Boats at East Worthing','http://www1.clikpic.com/px200/images/SFS - BW - 002 Boat at East Worthing_thumb.JPG',130, 98,0, 0,'Fishing boats are still active off of East Worthing Beach; this looks across to the Pier in the background','','','','','');
photos[6] = new photo(413635,'32739','SFS - C - 010 New Amusements','gallery','http://www1.clikpic.com/px200/images/SFS- C - 010 New Amusements.JPG',400,300,'New Amusements','http://www1.clikpic.com/px200/images/SFS- C - 010 New Amusements_thumb.JPG',130, 98,0, 0,'Taken during the final momeents of daylight on this beautiful award winning Pier at Worthing - note the \"New Amusements\" sign has since been replaced','','','','','');
photos[7] = new photo(883920,'32739','SFS - C - 027 Worthing Lido','gallery','http://www1.clikpic.com/px200/images/download 025 Large Web view.jpg',600,408,'Worthing Lido','http://www1.clikpic.com/px200/images/download 025 Large Web view_thumb.jpg',130, 88,1, 0,'The wonderfully Art Deco Worthing Lido captured at Dusk when (unusually) all the neon lights were working!','','','','','');
photos[8] = new photo(407099,'32739','SFS - C - 002 Worthing Pier in Symmetry','gallery','http://www1.clikpic.com/px200/images/SFS - C - 002 Worthing Pier in Symmetry.JPG',600,800,'Worthing Pier in Symmetry','http://www1.clikpic.com/px200/images/SFS - C - 002 Worthing Pier in Symmetry_thumb.JPG',130, 173,0, 1,'Great Symmetry designed in to my favourite Worthing landmark','','','','','');
photos[9] = new photo(413652,'32739','SFS - C - 009 Pillar','gallery','http://www1.clikpic.com/px200/images/SFS - C - 009 Pillar1.JPG',400,533,'Pillar','http://www1.clikpic.com/px200/images/SFS - C - 009 Pillar1_thumb.JPG',130, 173,0, 0,'Typical Art Deco detailling on this very underrated South Coast landmark','','','','','');
photos[10] = new photo(1855315,'32739','','gallery','http://www1.clikpic.com/px200/images/DSC_0510.jpg',245,360,'On the Pier','http://www1.clikpic.com/px200/images/DSC_0510_thumb.jpg',130, 191,0, 0,'The English Seaside','','','','','');
photos[11] = new photo(407135,'32745','SFS - BW - 003 Old and New','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 003 Old and New Wood.JPG',600,800,'\"Old and New\" ','http://www1.clikpic.com/px200/images/SFS - BW - 003 Old and New Wood_thumb.JPG',130, 173,0, 0,'The power of the sea, salt, shingle and surf demonstrated clearly','','','','','');
photos[12] = new photo(413585,'32745','SFS - C - 007 Groyne','gallery','http://www1.clikpic.com/px200/images/SFS - C - 007 Groyne.JPG',400,546,'Groyne','http://www1.clikpic.com/px200/images/SFS - C - 007 Groyne_thumb.JPG',130, 177,0, 0,'Eroded Groynes near the Sea Lane Cafe in Goring.  This clearly shows the power of the tide on the relatively calm South Coast','','','','','');
photos[13] = new photo(413584,'32745','SFS - BW - 006 Sky at Goring Gap','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 006 Sky at Goring Gap.JPG',400,533,'Sky at Goring Gap','http://www1.clikpic.com/px200/images/SFS - BW - 006 Sky at Goring Gap_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[14] = new photo(407146,'32745','SFS - C - 005 8 Knots','gallery','http://www1.clikpic.com/px200/images/SFS - C - 005 8 Knots.JPG',600,829,'8 Knots at Goring beach!','http://www1.clikpic.com/px200/images/SFS - C - 005 8 Knots_thumb.JPG',130, 180,0, 1,'','','','','','');
photos[15] = new photo(413602,'32745','SFS - BW - 008 Beach Huts','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 008 Beach Huts.JPG',400,591,'Beach Huts','http://www1.clikpic.com/px200/images/SFS - BW - 008 Beach Huts_thumb.JPG',130, 192,0, 0,'','','','','','');
photos[16] = new photo(623061,'32745','SFS - C - 021 Beach Huts 2','gallery','http://www1.clikpic.com/px200/images/SFS - C - 021 Beach Huts 2 Large Web view.jpg',600,384,'Beach Huts 2','http://www1.clikpic.com/px200/images/SFS - C - 021 Beach Huts 2 Large Web view_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[17] = new photo(407138,'32745','SFS - C - 001 Red boat at Goring Gap','gallery','http://www1.clikpic.com/px200/images/SFS - C - 001 Red boat at Goring Gap.JPG',600,450,'Red boat at the Goring Gap','http://www1.clikpic.com/px200/images/SFS - C - 001 Red boat at Goring Gap_thumb.JPG',130, 98,0, 0,'This Red boat stands out against the Sky and glorious backdrop of Highdown - it has since been renovated','','','','','');
photos[18] = new photo(413580,'32745','SFS - BW - 007 Rock','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 007 Rock.JPG',400,300,'Rock','http://www1.clikpic.com/px200/images/SFS - BW - 007 Rock_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[19] = new photo(623068,'32745','SFS - C - 026 Goring Sunset','gallery','http://www1.clikpic.com/px200/images/SFS - C - 026 Goring Sunset 660X441.jpg',600,401,'Goring Sunset','http://www1.clikpic.com/px200/images/SFS - C - 026 Goring Sunset 660X441_thumb.jpg',130, 87,0, 0,'This amazing (totally un Photoshopped) sunset was taken on November 5th 2006 off of the beach at the Greensward','','','','','');
photos[20] = new photo(883921,'32745','SFS - C - 028 Goring Rainbow','gallery','http://www1.clikpic.com/px200/images/Copy (4) of download 013 Large Web view.jpg',600,380,'Goring Rainbow','http://www1.clikpic.com/px200/images/Copy (4) of download 013 Large Web view_thumb.jpg',130, 82,0, 0,'A wonderful rainbow; looking from Goring across to Worthing Pier - needless to say; we were drenched 5 minutes later!','','','','','');
photos[21] = new photo(1855431,'32745','','gallery','http://www1.clikpic.com/px200/images/DSC_0009.jpg',360,264,'Rough Sea at the Gap','http://www1.clikpic.com/px200/images/DSC_0009_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[22] = new photo(410915,'32662','SFS - C - 003 Seagulls at Sunset','gallery','http://www1.clikpic.com/px200/images/SFS - C - 003 Seagulls at Sunset.JPG',400,533,'Seagulls at Sunset','http://www1.clikpic.com/px200/images/SFS - C - 003 Seagulls at Sunset_thumb.JPG',130, 173,0, 1,'Seagulls near the Bluebird Cafe taking to flight at low tide','','','','','');
photos[23] = new photo(413645,'32662','SFS - C - 008 Ferring beach at sunset 2','gallery','http://www1.clikpic.com/px200/images/SFS - C - 008 Ferring Beach at Sunset 22.JPG',400,533,'Ferring Beach at Sunset 2','http://www1.clikpic.com/px200/images/SFS - C - 008 Ferring Beach at Sunset 22_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[24] = new photo(410916,'32662','SFS - C - 004 Ferring at Sunset','gallery','http://www1.clikpic.com/px200/images/SFS - C - 004 Ferring at Sunset.JPG',400,533,'Ferring at Sunset','http://www1.clikpic.com/px200/images/SFS - C - 004 Ferring at Sunset_thumb.JPG',130, 173,0, 0,'Ferring, sunset, beach','','','','','');
photos[25] = new photo(883923,'32662','SFS - C - 029 Dusk at the Gap','gallery','http://www1.clikpic.com/px200/images/DSC_0216 Large Web view.jpg',428,640,'Dusk at the Gap','http://www1.clikpic.com/px200/images/DSC_0216 Large Web view_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[26] = new photo(622846,'32662','SFS - C - 024 High tide','gallery','http://www1.clikpic.com/px200/images/SFS - C - 024 High Tide 680X450.jpg',600,397,'High tide','http://www1.clikpic.com/px200/images/SFS - C - 024 High Tide 680X450_thumb.jpg',130, 86,1, 0,'Taken at the highest tide in 2006 at the Goring Gap','','','','','');
photos[27] = new photo(622848,'32662','SFS - C - 025 Ferring at Sunset 2','gallery','http://www1.clikpic.com/px200/images/SFS - C - 025 Ferring at Sunset 2.JPG',450,301,'Ferring at Sunset 2','http://www1.clikpic.com/px200/images/SFS - C - 025 Ferring at Sunset 2_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[28] = new photo(410917,'32662','SFS - C - 006 Ferring Groyne at Sunset','gallery','http://www1.clikpic.com/px200/images/download 085.JPG',400,300,'Ferring Groyne at Sunset','http://www1.clikpic.com/px200/images/download 085_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[29] = new photo(413671,'32812','SFS - C - 014 Arundel Castle 1','gallery','http://www1.clikpic.com/px200/images/SFS - C - 014 Arundel Castle 1.JPG',450,599,'Arundel Castle 1','http://www1.clikpic.com/px200/images/SFS - C - 014 Arundel Castle 1_thumb.JPG',130, 173,0, 1,'','','','','','');
photos[30] = new photo(418221,'32812','SFS - BW - 014 Arundel Castle','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 014 Arundel Castle.JPG',450,599,'Arundel Castle 2','http://www1.clikpic.com/px200/images/SFS - BW - 014 Arundel Castle_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[31] = new photo(1855389,'32812','','gallery','http://www1.clikpic.com/px200/images/DSC_0190.jpg',360,240,'church carvings','http://www1.clikpic.com/px200/images/DSC_0190_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[32] = new photo(418244,'33228','SFS - C - 013 Spinnaker','gallery','http://www1.clikpic.com/px200/images/SFS - C - 013 Spinnaker.JPG',450,599,'Spinnaker tower','http://www1.clikpic.com/px200/images/SFS - C - 013 Spinnaker_thumb.JPG',130, 173,0, 1,'The Spinnaker Tower on a bitterly cold and cloudless December 2006 day','','','','','');
photos[33] = new photo(884521,'33228','SFS - BW - 025 Jill minus Jack','gallery','http://www1.clikpic.com/px200/images/Copy (3) of download 013 Large Web view.jpg',508,640,'Jill (minus Jack) ','http://www1.clikpic.com/px200/images/Copy (3) of download 013 Large Web view_thumb.jpg',130, 164,0, 0,'Jill in silhouette against a winter sky at Clayton in West Sussex','','','','','');
photos[34] = new photo(418247,'33228','SFS -C - 012 Needles','gallery','http://www1.clikpic.com/px200/images/SFS - C - 012 Needles 670X444.jpg',600,398,'The Needles','http://www1.clikpic.com/px200/images/SFS - C - 012 Needles 670X444_thumb.jpg',130, 86,0, 0,'Totally calm seas around the Needles - relatively unusual!','','','','','');
photos[35] = new photo(444803,'33228','SFS - C - 017 Jurassic Coast 1','gallery','http://www1.clikpic.com/px200/images/SFS - C - 017 Jurassic Coast 1.JPG',400,519,'Jurassic Coast 1','http://www1.clikpic.com/px200/images/SFS - C - 017 Jurassic Coast 1_thumb.JPG',100, 130,0, 1,'Looking across from the cliffs above Durdle Dor in Dorset.  Polarizing filters accentuate the the the cloud forms.','','','','','');
photos[36] = new photo(444808,'33228','SFS - C - 018 Jurassic Coast 2','gallery','http://www1.clikpic.com/px200/images/SFS - C - 018 Jurassic Coast 2 660X462.jpg',600,420,'Jurassic Coast 2','http://www1.clikpic.com/px200/images/SFS - C - 018 Jurassic Coast 2 660X462_thumb.jpg',130, 91,1, 0,'','','','','','');
photos[37] = new photo(418252,'33228','SFS- BW - 011 The Needles','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 011 Needles.JPG',450,338,'The Needles','http://www1.clikpic.com/px200/images/SFS - BW - 011 Needles_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[38] = new photo(884541,'33153','SFS - BW - 026 Bushy Park','gallery','http://www1.clikpic.com/px200/images/DSCF0595 Large Web view.jpg',407,640,'Bushy Park - Hampton (W. London)','http://www1.clikpic.com/px200/images/DSCF0595 Large Web view_thumb.jpg',130, 204,0, 0,'A Royal Park; Bushy Park in West London; home to a wonderful lake, deer, and eye catching reflections.','','','','','');
photos[39] = new photo(884535,'33153','SFS - BW - 027 Brittany Pink Granite','gallery','http://www1.clikpic.com/px200/images/DSC_0096 Large Web view.jpg',428,640,'Brittany - Pink Granite coast','http://www1.clikpic.com/px200/images/DSC_0096 Large Web view_thumb.jpg',130, 194,0, 0,'Taken on Brttanys beautiful unspoilt Pink Granite coastline','','','','','');
photos[40] = new photo(418255,'33153','SFS - BW - 010 Rapids','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 010 Rapids.JPG',450,600,'Rapids - Pyrenees','http://www1.clikpic.com/px200/images/SFS - BW - 010 Rapids_thumb.JPG',130, 173,0, 1,'','','','','','');
photos[41] = new photo(444800,'33153','SFS - BW - 024 Findon Hay 2','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 024 Findon Hay 2.JPG',400,533,'Findon Hay 2','http://www1.clikpic.com/px200/images/SFS - BW - 024 Findon Hay 2_thumb.JPG',100, 133,0, 0,'','','','','','');
photos[42] = new photo(884518,'33153','SFS - BW - 028 Nr Chanctonbury Ring','gallery','http://www1.clikpic.com/px200/images/DSC_0788 Large Web view.jpg',600,420,'Nr Chanctonbury ring - W. Sussex','http://www1.clikpic.com/px200/images/DSC_0788 Large Web view_thumb.jpg',130, 91,0, 0,'Chanctonbury Ring feels like a wild and mystical place','','','','','');
photos[43] = new photo(444788,'33153','SFS - C - 019 Findon Hay 1','gallery','http://www1.clikpic.com/px200/images/SFS - C - 019 Findon Hay 1 Large Web view.jpg',600,450,'Findon Hay 1','http://www1.clikpic.com/px200/images/SFS - C - 019 Findon Hay 1 Large Web view_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[44] = new photo(418737,'33229','SFS - BW - 016 Chrhysler','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 016 Chrysler.JPG',450,599,'Chrysler Building - NYC','http://www1.clikpic.com/px200/images/SFS - BW - 016 Chrysler_thumb.JPG',130, 173,0, 1,'A real architectural gem and almost beautiful compared to the Empire State','','','','','');
photos[45] = new photo(881930,'33229','SFS - C - 030 St Pauls','gallery','http://www1.clikpic.com/px200/images/download 084 Large Web view.jpg',489,640,'St Pauls - London','http://www1.clikpic.com/px200/images/download 084 Large Web view_thumb.jpg',130, 170,0, 0,'','','','','','');
photos[46] = new photo(418748,'33229','SFS - C- 015 - Chrysler blue','gallery','http://www1.clikpic.com/px200/images/SFS - C - 015 Chryler - Blue.JPG',450,609,'Chrysler Building - Blue','http://www1.clikpic.com/px200/images/SFS - C - 015 Chryler - Blue_thumb.JPG',130, 176,0, 0,'Designed by William Van Alen and opened in May 1930; the truly iconic Chrysler building was the tallest building in the world for less than one year.','','','','','');
photos[47] = new photo(418736,'33229','SFS - BW - 013 Battersea','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 013 Battersea.JPG',450,600,'Battersea Power Station ','http://www1.clikpic.com/px200/images/SFS - BW - 013 Battersea_thumb.JPG',130, 173,0, 0,'Completed in 1939 the Sir Giles Gilbert Scott designed Power Station has had an uncertain future for some time - I personally hope it retains its Industrial bleakness!','','','','','');
photos[48] = new photo(418754,'33229','SFS - C - 011 Gondolas','gallery','http://www1.clikpic.com/px200/images/SFS - C - 011 Gondolas.JPG',450,600,'Gondolas - Venice','http://www1.clikpic.com/px200/images/SFS - C - 011 Gondolas_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[49] = new photo(418738,'33229','SFS - BW - 018 Atlas','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 018 Atlas.JPG',450,599,'Atlas - NYC','http://www1.clikpic.com/px200/images/SFS - BW - 018 Atlas_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[50] = new photo(418744,'33229','SFS - BW - 015 Chrysler Gargoyle','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 015 Chrysler Gargoyle.JPG',450,338,'Chrysler Gargoyle - NYC','http://www1.clikpic.com/px200/images/SFS - BW - 015 Chrysler Gargoyle_thumb.JPG',130, 98,0, 0,'These gargoyles were meant to represent the \"hood\" or bonnet emblems on Chrysler cars - also see stunning photographs of these by Margaret Bourke White','','','','','');
photos[51] = new photo(418735,'33229','SFS - BW - 012 Lloyds','gallery','http://www1.clikpic.com/px200/images/SFS - BW- 012 Lloyds.JPG',450,338,'Lloyds building - London','http://www1.clikpic.com/px200/images/SFS - BW- 012 Lloyds_thumb.JPG',130, 98,0, 0,'Designed by Sir Richard Rogers; the Lloyds of London building has managed to amaze me since its opening in 1986','','','','','');
photos[52] = new photo(418752,'33229','SFS - BW - 017 Albert Memorial','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 017 Albert Memorial.JPG',450,338,'Albert Memorial - London','http://www1.clikpic.com/px200/images/SFS - BW - 017 Albert Memorial_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[53] = new photo(881864,'33229','SFS - BW - 029 St Marys Axe','gallery','http://www1.clikpic.com/px200/images/download 023.JPG',600,478,'St Marys Axe - London','http://www1.clikpic.com/px200/images/download 023_thumb.JPG',130, 104,0, 0,'Contrasting old and new; the stunning Sir Norman Foster designed and Stirling Prize winning Swiss Re building contrasted against St Marys Church','','','','','');
photos[54] = new photo(881883,'33229','SFS - BW - 030 Tate Modern','gallery','http://www1.clikpic.com/px200/images/download 079.JPG',600,461,'Tate modern','http://www1.clikpic.com/px200/images/download 079_thumb.JPG',130, 100,0, 0,'Opened in 2000 the Sir Giles Gilbert Scott designed Bankside Power station (1947) has proven a massive hit','','','','','');
photos[55] = new photo(881938,'33229','SFS - C - 031 St Nazaire; Tin Tin','gallery','http://www1.clikpic.com/px200/images/2004_0408party0021 Large Web view1.jpg',600,450,'France - St Nazaire - Tin Tin','http://www1.clikpic.com/px200/images/2004_0408party0021 Large Web view1_thumb.jpg',130, 98,0, 0,'Surreal Tin Tin advertising hoarding at St Nazaire Dockyard in Western France','','','','','');
photos[56] = new photo(884543,'33582','SFS - BW - 031 Jill and Betty','gallery','http://www1.clikpic.com/px200/images/download 015 Large Web view.jpg',480,640,'Jill and Betty (Bus)','http://www1.clikpic.com/px200/images/download 015 Large Web view_thumb.jpg',130, 173,0, 0,'Jack and Jill windmills at Clayton West Sussex are a real treat - this is Jill posing by our \"Splitty\"','','','','','');
photos[57] = new photo(1855444,'33582','','gallery','http://www1.clikpic.com/px200/images/DSC_0051.jpg',240,360,'Italian chrome','http://www1.clikpic.com/px200/images/DSC_0051_thumb.jpg',130, 195,0, 0,'Scooters at 07 Goodwood Revival','','','','','');
photos[58] = new photo(418809,'33582','SFS - BW - 023 Auto Union 3','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 023 Auto Union 3.JPG',400,555,'Auto Union 3','http://www1.clikpic.com/px200/images/SFS - BW - 023 Auto Union 3_thumb.JPG',100, 139,0, 1,'Incredible Auto Unions at 2006 Goodwood Festival of speed - types C and D I think','','','','','');
photos[59] = new photo(418810,'33582','SFS - C - 022 Auto Union 4','gallery','http://www1.clikpic.com/px200/images/SFS - C - 016 Auto Union 4.JPG',400,503,'Auto Union 4','http://www1.clikpic.com/px200/images/SFS - C - 016 Auto Union 4_thumb.JPG',100, 126,0, 0,'Auto Union - Automotive and Grand Prix engineering par excellence','','','','','');
photos[60] = new photo(418808,'33582','SFS - BW - 022 Auto Union 2','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 022 Auto Union 2.JPG',400,502,'Auto Union 2','http://www1.clikpic.com/px200/images/SFS - BW - 022 Auto Union 2_thumb.JPG',100, 126,0, 0,'When they fired up the Auto Unions it was the ultimate petrol head experience - bleeding ears, shaking ribcage and the smell of ...ethanol; or some form of hi performance mix - rocket fuel perhaps?','','','','','');
photos[61] = new photo(418805,'33582','SFS - BW - 019 Alfa Romeo 1','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 019 Alfa Romeo 1.JPG',400,533,'Alfa Romeo 1 ','http://www1.clikpic.com/px200/images/SFS - BW - 019 Alfa Romeo 1_thumb.JPG',100, 133,0, 0,'Photographed at the 2006 Goodwood Festival of Speed Concours D\'Elegance; an unfortunately very wet Alfa Romeo','','','','','');
photos[62] = new photo(418807,'33582','SFS - BW - 020 Alfa Romeo 2','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 020 Alfa Romeo 2.JPG',400,540,'Alfa Romeo 2','http://www1.clikpic.com/px200/images/SFS - BW - 020 Alfa Romeo 2_thumb.JPG',100, 135,0, 0,'The same (very) wet Alfa!','','','','','');
photos[63] = new photo(418811,'33582','SFS - BW - 021 Auto Union 1','gallery','http://www1.clikpic.com/px200/images/SFS - BW - 021 Auto Union 1 Large Web view.jpg',600,450,'Auto Union 1','http://www1.clikpic.com/px200/images/SFS - BW - 021 Auto Union 1 Large Web view_thumb.jpg',130, 98,0, 0,'2006 Goodwood Festival of Speed - Lord March had just finished posing in this one (type C I think)','','','','','');
photos[64] = new photo(884544,'33582','SFS - C - 032 Loire Sunflowers','gallery','http://www1.clikpic.com/px200/images/download 067 Large Web view.jpg',600,449,'Loire Sunflowers','http://www1.clikpic.com/px200/images/download 067 Large Web view_thumb.jpg',130, 97,0, 0,'Exact location is unclear; but this is somewhere around the Loire in Western France as we rushed north to Cherbourg - the sky and sunflowers were just right','','','','','');
photos[65] = new photo(1855448,'33582','','gallery','http://www1.clikpic.com/px200/images/DSC_0121.jpg',360,240,'Ferrari !!!','http://www1.clikpic.com/px200/images/DSC_0121_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[66] = new photo(1855449,'33582','','gallery','http://www1.clikpic.com/px200/images/DSC_0035.jpg',360,240,'Mercedes SL','http://www1.clikpic.com/px200/images/DSC_0035_thumb.jpg',130, 87,0, 0,'SL at 07 Goodwood revival - sublime','','','','','');
photos[67] = new photo(622841,'33582','SFS - C - 023 Dodge','gallery','http://www1.clikpic.com/px200/images/SFS - C - 023 Dodge.jpg',400,600,'Dodge Charger','http://www1.clikpic.com/px200/images/SFS - C - 023 Dodge_thumb.jpg',130, 195,0, 0,'Pure American Musclecar madness - late 60\'s Dodge Charger','','','','','');
photos[68] = new photo(975289,'71481','','gallery','http://www1.clikpic.com/px200/images/download 377 461X640.jpg',461,640,'\"A Dome\" Hiroshima','http://www1.clikpic.com/px200/images/download 377 461X640_thumb.jpg',130, 180,0, 0,'','','','','','');
photos[69] = new photo(975292,'71481','','gallery','http://www1.clikpic.com/px200/images/download 023 428X640.jpg',428,640,'Imperial Palace detail - Kyoto','http://www1.clikpic.com/px200/images/download 023 428X640_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[70] = new photo(975302,'71481','','gallery','http://www1.clikpic.com/px200/images/download 044 428X640.jpg',428,640,'Kasuga Taishu shrine \"3000 lanterns\" - Nara','http://www1.clikpic.com/px200/images/download 044 428X640_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[71] = new photo(975307,'71481','','gallery','http://www1.clikpic.com/px200/images/download 015 396X640.jpg',396,640,'Golden Pavilion - Kyoto','http://www1.clikpic.com/px200/images/download 015 396X640_thumb.jpg',130, 210,0, 0,'','','','','','');
photos[72] = new photo(975311,'71481','','gallery','http://www1.clikpic.com/px200/images/download 073 428X640.jpg',428,640,'Cherry Blossom in Takayama','http://www1.clikpic.com/px200/images/download 073 428X640_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[73] = new photo(975314,'71481','','gallery','http://www1.clikpic.com/px200/images/download 011 848X640.jpg',600,453,'Maiko in the Gion  - Kyoto','http://www1.clikpic.com/px200/images/download 011 848X640_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[74] = new photo(975315,'71481','','gallery','http://www1.clikpic.com/px200/images/download 190 963X640.jpg',600,399,'Tokyo Tower','http://www1.clikpic.com/px200/images/download 190 963X640_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[75] = new photo(975316,'71481','','gallery','http://www1.clikpic.com/px200/images/download 259 919X640.jpg',600,418,'Himeji Castle','http://www1.clikpic.com/px200/images/download 259 919X640_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[76] = new photo(975318,'71481','','gallery','http://www1.clikpic.com/px200/images/download 229 956X640.jpg',600,402,'Toshu-gu Shrine - Nikko','http://www1.clikpic.com/px200/images/download 229 956X640_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[77] = new photo(975322,'71481','','gallery','http://www1.clikpic.com/px200/images/download 316 956X640.jpg',600,402,'2700m up Mount Fuji','http://www1.clikpic.com/px200/images/download 316 956X640_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[78] = new photo(975325,'71481','','gallery','http://www1.clikpic.com/px200/images/download 202 447X640.jpg',447,640,'Himeji Castle in Bloom','http://www1.clikpic.com/px200/images/download 202 447X640_thumb.jpg',130, 186,0, 0,'','','','','','');
photos[79] = new photo(975327,'71481','','gallery','http://www1.clikpic.com/px200/images/download 271 428X640.jpg',428,640,'Kannon Temple Asakusa Tokyo','http://www1.clikpic.com/px200/images/download 271 428X640_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[80] = new photo(975330,'71481','','gallery','http://www1.clikpic.com/px200/images/download 372 428X640.jpg',428,640,'Miwajima Island','http://www1.clikpic.com/px200/images/download 372 428X640_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[81] = new photo(975335,'71481','','gallery','http://www1.clikpic.com/px200/images/download 051 971X640.jpg',600,395,'46th floor of the Park Hyatt Tokyo','http://www1.clikpic.com/px200/images/download 051 971X640_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[82] = new photo(975332,'71481','','gallery','http://www1.clikpic.com/px200/images/download 043 956X640.jpg',600,402,'Takayama Temple','http://www1.clikpic.com/px200/images/download 043 956X640_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[83] = new photo(975342,'71481','','gallery','http://www1.clikpic.com/px200/images/download 148 916X640.jpg',600,419,'Taizo-in shrine Kyoto','http://www1.clikpic.com/px200/images/download 148 916X640_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[84] = new photo(975349,'71481','','gallery','http://www1.clikpic.com/px200/images/download 303 956X640.jpg',600,402,'Sake at Toshu-gu shrine','http://www1.clikpic.com/px200/images/download 303 956X640_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[85] = new photo(975355,'71481','','gallery','http://www1.clikpic.com/px200/images/download 327 791X640.jpg',600,485,'Lanterns at Nikko','http://www1.clikpic.com/px200/images/download 327 791X640_thumb.jpg',130, 105,0, 0,'','','','','','');
photos[86] = new photo(1855194,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0443.jpg',360,240,'Empire State 1','http://www1.clikpic.com/px200/images/DSC_0443_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[87] = new photo(1855200,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0448.jpg',360,240,'Empire State 2','http://www1.clikpic.com/px200/images/DSC_0448_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[88] = new photo(1855204,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0447.jpg',240,360,'Empire State 3','http://www1.clikpic.com/px200/images/DSC_0447_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[89] = new photo(1855208,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0442.jpg',360,240,'Empire State 4','http://www1.clikpic.com/px200/images/DSC_0442_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[90] = new photo(1855209,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0324.jpg',360,240,'Statue of Liberty','http://www1.clikpic.com/px200/images/DSC_0324_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[91] = new photo(1855214,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0174.jpg',360,240,'Guggenheim Rooflights','http://www1.clikpic.com/px200/images/DSC_0174_thumb.jpg',130, 87,0, 0,'Looking up to the roof of Frank Lloyd Wrights masterpiece - The Guggenheim','','','','','');
photos[92] = new photo(1855216,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0231.jpg',360,240,'Brooklyn Bridge','http://www1.clikpic.com/px200/images/DSC_0231_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[93] = new photo(1855218,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0215.jpg',360,240,'The New Yorker','http://www1.clikpic.com/px200/images/DSC_0215_thumb.jpg',130, 87,0, 0,'Once the largest hotel in the world!','','','','','');
photos[94] = new photo(1855221,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0213.jpg',360,240,'John Lennon - Strawberry Fields','http://www1.clikpic.com/px200/images/DSC_0213_thumb.jpg',130, 87,0, 0,'John Lennon memorial in Central Park','','','','','');
photos[95] = new photo(1855268,'124869','','gallery','http://www1.clikpic.com/px200/images/DSC_0207.jpg',240,360,'Century Apartments - NYC','http://www1.clikpic.com/px200/images/DSC_0207_thumb.jpg',130, 195,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(32811,'477036','Mounting and Framing artwork','gallery');
galleries[1] = new gallery(32739,'407099','Worthing','gallery');
galleries[2] = new gallery(32745,'407146','Goring by Sea','gallery');
galleries[3] = new gallery(32662,'410915','Ferring - Beach and Sunsets','gallery');
galleries[4] = new gallery(32812,'413671','Arundel','gallery');
galleries[5] = new gallery(33228,'444803,418244','South Coast','gallery');
galleries[6] = new gallery(33153,'418255','Countryside & Sussex Downs','gallery');
galleries[7] = new gallery(33229,'418737','Cities + Misc!','gallery');
galleries[8] = new gallery(33582,'418809','Automotive','gallery');
galleries[9] = new gallery(71481,'975327','Japan','gallery');
galleries[10] = new gallery(124869,'1855268,1855221,1855218,1855216,1855214,1855209,1855208,1855204,1855200,1855194','New York 07','gallery');

