/***************************************************************************
* 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('176819');
	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('176819');
	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 = 'TOM FORREST   FBIPP ARPS: ' + 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(16897,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Prospect-5-FIAS.jpg',400,300,'Prospect Housing','http://www4.clikpic.com/tomforrest/images/Prospect-5-FIAS_thumb.jpg',130, 98,0, 0,'LOCATION Edinburgh<br>\r\n<br>\r\nDESCRIPTION<br>\r\nStandard architectural exterior of the new Prospect office building at Wester Hails Edinburgh.','','','','','');
photos[1] = new photo(16899,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Tollcross-2.jpg',400,414,'Tollcross','http://www4.clikpic.com/tomforrest/images/Tollcross-2_thumb.jpg',130, 135,0, 0,'LOCATION   Edinburgh<br>\r\n<br>\r\nDESCRIPTION<br>\r\nPrinces Exchange,  Edinburgh was designed by Architects  Percy Johnson-Marshall & Partners and won the award for best new commercial project in Scotland for 2001. Standing on the busy Tollcross junction this photograph is a composite of several exposures combined to eliminate traffic and other unwanted elements.','','','','','');
photos[2] = new photo(17121,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Livingston-020302.jpg',400,283,'Livingston Primary School','http://www4.clikpic.com/tomforrest/images/Livingston-020302_thumb.jpg',130, 92,0, 0,'LOCATION Livingston Village Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nLivingston Primary School, taken from the boilerhouse end to show the Selkirk Metalbestos flues as an architectural feature','','','','','');
photos[3] = new photo(17122,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Kirkliston-003.jpg',400,268,'Kirkliston Medical Centre','http://www4.clikpic.com/tomforrest/images/Kirkliston-003_thumb.jpg',130, 87,0, 1,'LOCATION<br>\r\n<br>\r\nDESCRIPTION<br>\r\nSimple record shot of the recently completed Kirkliston Medical Centre. The sky was replaced and minor building artifacts tidied up in photoshop.','','','','','');
photos[4] = new photo(1187568,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Kirkcaldy-021.jpg',600,382,'S. Queensferry Medical Centre','http://www4.clikpic.com/tomforrest/images/Kirkcaldy-021_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[5] = new photo(1187598,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Slateford-Rads-1.jpg',600,434,'Slateford 1','http://www4.clikpic.com/tomforrest/images/Slateford-Rads-1_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[6] = new photo(1187601,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Slateford-Rads-6.jpg',600,604,'Slateford 2','http://www4.clikpic.com/tomforrest/images/Slateford-Rads-6_thumb.jpg',130, 131,0, 0,'','','','','','');
photos[7] = new photo(1187602,'2043','','gallery','http://www4.clikpic.com/tomforrest/images/Slateford-Rads-9.jpg',600,425,'Slateford 3','http://www4.clikpic.com/tomforrest/images/Slateford-Rads-9_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[8] = new photo(16882,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Larbert-church-3-Flat.jpg',400,527,'Larbert church','http://www4.clikpic.com/tomforrest/images/Larbert-church-3-Flat_thumb.jpg',130, 171,0, 0,'LOCATION  Larbert Scotland<br>\r\n<br>\r\nDESCRIPTION','','','','','');
photos[9] = new photo(16895,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Blacknessflat.jpg',400,284,'Blackness','http://www4.clikpic.com/tomforrest/images/Blacknessflat_thumb.jpg',130, 92,0, 1,'LOCATION<br>\r\n<br>\r\nDESCRIPTION<br>\r\nBlackness was built in the 15th century by the Crichton family and was used mainly as a garrison fortress and state prison. <br>\r\nAlthough the Castle\'s defences were strengthened in the 16th century it was  besieged and damaged in 1650 by Cromwell\'s army, and later, after  restoration, was used to incarcerate Covenanters.<br>\r\nIn the 1920s, the castle was conserved as an ancient monument.','','','','','');
photos[10] = new photo(17065,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/church-flat.jpg',400,596,'London Rd. Church','http://www4.clikpic.com/tomforrest/images/church-flat_thumb.jpg',130, 194,0, 0,'LOCATION  Edinburgh<br>\r\n<br>\r\nDESCRIPTION<br>\r\nSituated on a very busy junction this church was photographed for a retiring minister,but altered using several exposures to remove all cars, traffic signs etc. to give it a look of perhaps a few years back','','','','','');
photos[11] = new photo(17332,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Aberlady-church-2.jpg',400,512,'Aberlady Church','http://www4.clikpic.com/tomforrest/images/Aberlady-church-2_thumb.jpg',130, 166,0, 0,'LOCATION<br>\r\n<br>\r\nDESCRIPTION<br>\r\nAberlady Church  dates back as far as the 12th century but little remains even from the church of the 15th century. Refurbished in 1773 and then again  by the Earl of Wemyss in 1886.','','','','','');
photos[12] = new photo(17335,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Lecropt-church-fs.jpg',400,519,'Lecropt Church','http://www4.clikpic.com/tomforrest/images/Lecropt-church-fs_thumb.jpg',130, 169,0, 0,'LOCATION Bridge of Allan Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nDesigned with a Gothic style by architect William Stirling and built in 1827 just outside Bridge of Allan, this church overlooks the carse of Stirling and castle.','','','','','');
photos[13] = new photo(18315,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Fa\'side-Water-100101a.jpg',400,539,'Fa\'side Castle','http://www4.clikpic.com/tomforrest/images/Fa\'side-Water-100101a_thumb.jpg',130, 175,0, 0,'LOCATION  Tranent E. Lothian<br>\r\n<br>\r\nDESCRIPTION<br>\r\nFa’side Castle is a late 14th century tower   attached to a 16th century house surrounded by a barmkin wall. The tower is four story’s high with massively thick walls and parapet roof   accessed by a straight stair to the first floor then changing to spiral.','','','','','');
photos[14] = new photo(1187498,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Culross-Palace.jpg',600,314,'Culross Palace','http://www4.clikpic.com/tomforrest/images/Culross-Palace_thumb.jpg',130, 68,0, 0,'','','','','','');
photos[15] = new photo(1188081,'85338','','gallery','http://www4.clikpic.com/tomforrest/images/Glenap-interior.jpg',600,445,'Glenap interior','http://www4.clikpic.com/tomforrest/images/Glenap-interior_thumb.jpg',130, 96,0, 0,'','','','','','');
photos[16] = new photo(16871,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/museum-composite-flat.jpg',400,314,'Museum of Scotland','http://www4.clikpic.com/tomforrest/images/museum-composite-flat_thumb.jpg',130, 102,0, 0,'LOCATION Chambers St Edinburgh<br>\r\n<br>\r\nDESCRIPTION<br>\r\nIn 1991 architects Benson + Forsyth were the winners of the architectural competition to design the new Museum of Scotland .  The exterior walls are clad in golden Clashach sandstone from Morayshire, with natural figuring. The frame of the building is cathedral grade concrete, with limestone, beech, and smooth plaster used on the interior. this gives the building a great feeling of light and space.  .','','','','','');
photos[17] = new photo(16894,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/Tolbooth.jpg',400,415,'Tolbooth','http://www4.clikpic.com/tomforrest/images/Tolbooth_thumb.jpg',130, 135,0, 0,'LOCATION Stirling Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nDesigned by Sir William Bruce and built in 1703.  The A-listed Tollbooth and later additions of 1785 and 1811 served Stirling as council chambers, courthouse and jail.  <br>\r\nRichard Murphy won the architectural competition to transform the building into a centre for the musical arts which includes a 200 seat theatre, studio, bar and restaurant.','','','','','');
photos[18] = new photo(16896,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/Knox-flat-011231.jpg',400,504,'Knox','http://www4.clikpic.com/tomforrest/images/Knox-flat-011231_thumb.jpg',130, 164,0, 0,'LOCATION High St. Edinburgh<br>\r\n<br>\r\nDESCRIPTION<br>\r\nIn  the High Street Edinburgh stands John Knox house, built in the 15th century  and  largely unaltered since the 1550\'s when the Mosman family, Goldsmiths to Mary Queen of Scots, remodelled the house. John Knox was  founder of the Presbyterian Church but only  lived there for a short time before his death in 1572.','','','','','');
photos[19] = new photo(17333,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/Culross-2.jpg',400,320,'Culross Palace','http://www4.clikpic.com/tomforrest/images/Culross-2_thumb.jpg',130, 104,0, 0,'LOCATION  Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nCulross Palace in Fife, Airbrushed in photoshop','','','','','');
photos[20] = new photo(18322,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/S.Queensferry.jpg',400,258,'South Queensferry Medical Centre','http://www4.clikpic.com/tomforrest/images/S_thumb.Queensferry.jpg',130, 84,0, 0,'LOCATION South Queensferry Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nRecently completed medical centre given a look similar to the architects impression sketches prior to construction','','','','','');
photos[21] = new photo(176819,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/Cottrell-Building.jpg',600,438,'Cottrell Building','http://www4.clikpic.com/tomforrest/images/Cottrell-Building_thumb.jpg',130, 95,1, 0,'','','','','','');
photos[22] = new photo(1187248,'85340','','gallery','http://www4.clikpic.com/tomforrest/images/Clackmannan-tower-textured.jpg',600,418,'Clackmannan Tower','http://www4.clikpic.com/tomforrest/images/Clackmannan-tower-textured_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[23] = new photo(16874,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Knockhill-Super-bikes-003.jpg',400,300,'Legend','http://www4.clikpic.com/tomforrest/images/Knockhill-Super-bikes-003_thumb.jpg',130, 98,0, 1,'LOCATION Knochhill Fife<br>\r\n<br>\r\nDESCRIPTION<br>\r\nNo. 90  from Knockhill, one of Scotlegends racing legend cars. Wet day, so new sky added for effect.','','','','','');
photos[24] = new photo(16876,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Bently-2d.jpg',400,300,'Bentley','http://www4.clikpic.com/tomforrest/images/Bently-2d_thumb.jpg',130, 98,0, 0,'LOCATION East Fortune<br>\r\n<br>\r\nDESCRIPTION<br>\r\nThe original photograph was taken at the classic car show in East Fortune, with added smart blur and air brushing in photoshop. <br>\r\nThe final image was printed on canvas and mounted on 20” x 24” streachers, canvas wrap style.','','','','','');
photos[25] = new photo(16878,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Ferrari-F,I,S.jpg',400,298,'Ferrari','http://www4.clikpic.com/tomforrest/images/Ferrari-F,I,S_thumb.jpg',130, 97,0, 0,'LOCATION Musselburgh<br>\r\n<br>\r\nDESCRIPTION<br>\r\nBrochure type image of Michael Schumacher’s  F1 Ferrari. Photographed while on display during a stopover in Musselburgh','','','','','');
photos[26] = new photo(16879,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Triumph.jpg',400,293,'Triumph','http://www4.clikpic.com/tomforrest/images/Triumph_thumb.jpg',130, 95,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nBack on the scene for around 15 years now and proving popular. No more oil leaks. This 1200 Trophy my personal favour','','','','','');
photos[27] = new photo(17063,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Lagonda.jpg',600,463,'Lagonda','http://www4.clikpic.com/tomforrest/images/Lagonda_thumb.jpg',130, 100,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nAnother famous marque given the same treatment as the Bentley.','','','','','');
photos[28] = new photo(17120,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Corvette-600-pixels.jpg',600,412,'Corvette','http://www4.clikpic.com/tomforrest/images/Corvette-600-pixels_thumb.jpg',130, 89,0, 0,'LOCATION Florida USA<br>\r\n<br>\r\nDESCRIPTION<br>\r\nClassic American Corvette modified for drag racing. Photographed in Florida and used as the main feature for automotive montage.','','','','','');
photos[29] = new photo(176822,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/lotus.jpg',600,400,'Lotus 24','http://www4.clikpic.com/tomforrest/images/lotus_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[30] = new photo(1187250,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Jaguar-120.jpg',600,435,'Jaguar 120','http://www4.clikpic.com/tomforrest/images/Jaguar-120_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[31] = new photo(1187252,'2045','','gallery','http://www4.clikpic.com/tomforrest/images/Morgans.jpg',600,247,'Morgans','http://www4.clikpic.com/tomforrest/images/Morgans_thumb.jpg',130, 54,0, 0,'','','','','','');
photos[32] = new photo(176820,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/caledonia-68-b.jpg',600,368,'Caledonia 68','http://www4.clikpic.com/tomforrest/images/caledonia-68-b_thumb.jpg',130, 80,0, 0,'','','','','','');
photos[33] = new photo(176824,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/Triumph-last-attempt.jpg',600,460,'Triumph Speed triple','http://www4.clikpic.com/tomforrest/images/Triumph-last-attempt_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[34] = new photo(358245,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/Mini.jpg',600,413,'Mini No 4','http://www4.clikpic.com/tomforrest/images/Mini_thumb.jpg',130, 89,0, 0,'','','','','','');
photos[35] = new photo(1187247,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/BMW-v-Mustang.jpg',600,315,'BMW v Ford','http://www4.clikpic.com/tomforrest/images/BMW-v-Mustang_thumb.jpg',130, 68,0, 0,'','','','','','');
photos[36] = new photo(1187249,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/GT-350.jpg',600,363,'Mustang 350 GT','http://www4.clikpic.com/tomforrest/images/GT-350_thumb.jpg',130, 79,0, 0,'','','','','','');
photos[37] = new photo(1187251,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/Mechanic\'s-Choice.jpg',600,284,'J Clark','http://www4.clikpic.com/tomforrest/images/Mechanic\'s-Choice_thumb.jpg',130, 62,0, 0,'','','','','','');
photos[38] = new photo(1187253,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/Tyrrell-mechanic.jpg',600,766,'Tyrrell Mechanic','http://www4.clikpic.com/tomforrest/images/Tyrrell-mechanic_thumb.jpg',130, 166,0, 0,'','','','','','');
photos[39] = new photo(1187456,'85355','','gallery','http://www4.clikpic.com/tomforrest/images/Jackie-Stewart.jpg',600,278,'Jackie Stewart','http://www4.clikpic.com/tomforrest/images/Jackie-Stewart_thumb.jpg',130, 60,0, 0,'','','','','','');
photos[40] = new photo(17060,'85357','','gallery','http://www4.clikpic.com/tomforrest/images/Bedford1.jpg',400,356,'Leyland','http://www4.clikpic.com/tomforrest/images/Bedford1_thumb.jpg',130, 116,0, 1,'LOCATION Carse of Stirling<br>\r\n<br>\r\nDESCRIPTION<br>\r\nOld Leyland truck left to rot.','','','','','');
photos[41] = new photo(176823,'85357','','gallery','http://www4.clikpic.com/tomforrest/images/Tractor-2.jpg',400,257,'Case International','http://www4.clikpic.com/tomforrest/images/Tractor-2_thumb.jpg',130, 84,0, 0,'','','','','','');
photos[42] = new photo(1187246,'85357','','gallery','http://www4.clikpic.com/tomforrest/images/Fordson-2.jpg',400,534,'Fordson 2','http://www4.clikpic.com/tomforrest/images/Fordson-2_thumb.jpg',130, 174,0, 0,'','','','','','');
photos[43] = new photo(1187524,'85357','','gallery','http://www4.clikpic.com/tomforrest/images/Old-Trucks-0181.jpg',400,568,'','http://www4.clikpic.com/tomforrest/images/Old-Trucks-0181_thumb.jpg',130, 185,0, 0,'','','','','','');
photos[44] = new photo(17062,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/lighter-project2.jpg',400,440,'Zippo','http://www4.clikpic.com/tomforrest/images/lighter-project2_thumb.jpg',130, 143,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nThe classic American lighter, manufactured with hundreds of engraved images and logos.','','','','','');
photos[45] = new photo(17064,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/Poppies2.jpg',400,527,'Poppies','http://www4.clikpic.com/tomforrest/images/Poppies2_thumb.jpg',130, 171,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nOriginal art work, scanned in sections to produce a high resolution digital file,  printed on canvas and mounted on streachers 20” x 24”. An inexpensive way to have a limited edition art work.<br>\r\n<br>\r\nOriginal art by E. M. Forrest','','','','','');
photos[46] = new photo(17337,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/Scots-Measure-Violin.jpg',400,533,'Violin','http://www4.clikpic.com/tomforrest/images/Scots-Measure-Violin_thumb.jpg',130, 173,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nMontage for a violin, musical theme','','','','','');
photos[47] = new photo(18314,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/Bobby-redone.jpg',400,275,'Bobby','http://www4.clikpic.com/tomforrest/images/Bobby-redone_thumb.jpg',130, 89,0, 0,'LOCATION  Edinburgh<br>\r\n<br>\r\nDescription<br>\r\nGreyfriars Bobby, statue of famous dog who would not desert his owner.','','','','','');
photos[48] = new photo(18321,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/nikon.jpg',400,300,'Nikon','http://www4.clikpic.com/tomforrest/images/nikon_thumb.jpg',130, 98,0, 1,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nCompetition entry on an abstract theme','','','','','');
photos[49] = new photo(1188083,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/Scape-2.jpg',600,210,'Scape 2','http://www4.clikpic.com/tomforrest/images/Scape-2_thumb.jpg',130, 46,0, 0,'','','','','','');
photos[50] = new photo(1188084,'2056','','gallery','http://www4.clikpic.com/tomforrest/images/Scape-5.jpg',600,329,'Scape 5','http://www4.clikpic.com/tomforrest/images/Scape-5_thumb.jpg',130, 71,0, 0,'','','','','','');
photos[51] = new photo(17061,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/blackness-4-Pier-F,I,S.jpg',400,300,'Blackness pier','http://www4.clikpic.com/tomforrest/images/blackness-4-Pier-F,I,S_thumb.jpg',130, 98,0, 0,'LOCATION Blackness Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nBlackness castle taken from the jetty in the Firth of Forth looking South but completely altered in photoshop','','','','','');
photos[52] = new photo(17334,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/Grangemouth.jpg',400,257,'Grangemouth Refinary','http://www4.clikpic.com/tomforrest/images/Grangemouth_thumb.jpg',130, 84,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nOil refinery at Grangemouth Scotland , early evening,  simple record image of a popular subject.','','','','','');
photos[53] = new photo(17336,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/Pocket-watch-project-3_2.jpg',400,302,'Fusee','http://www4.clikpic.com/tomforrest/images/Pocket-watch-project-3_2_thumb.jpg',130, 98,0, 0,'LOCATION Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nAntique leaflet type shot of  a Fusee pocket watch. Background and double image photographs brought together in photoshop.','','','','','');
photos[54] = new photo(18319,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/Bruce140402.b.jpg',400,472,'Bruce','http://www4.clikpic.com/tomforrest/images/Bruce140402_thumb.b.jpg',130, 153,0, 0,'LOCATION Stirling Scotland<br>\r\n<br>\r\nDESCRIPTION<br>\r\nStatue of Robert the Bruce at Bannockburn','','','','','');
photos[55] = new photo(1188088,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/Universal2.jpg',600,424,'Universal','http://www4.clikpic.com/tomforrest/images/Universal2_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[56] = new photo(1188089,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/Fringe-Raider.jpg',400,532,'Fringe Raider','http://www4.clikpic.com/tomforrest/images/Fringe-Raider_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[57] = new photo(1188090,'2070','','gallery','http://www4.clikpic.com/tomforrest/images/Blue-girl.jpg',500,586,'Blue Girl','http://www4.clikpic.com/tomforrest/images/Blue-girl_thumb.jpg',130, 152,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(2043,'17122','Architecture 1','gallery');
galleries[1] = new gallery(85338,'16895','Architecture 2','gallery');
galleries[2] = new gallery(85340,'1187248,176819,18322,17333,16896,16894,16871','Architecture 3','gallery');
galleries[3] = new gallery(2045,'16874','Automotive 1','gallery');
galleries[4] = new gallery(85355,'1187456,1187253,1187251,1187249,1187247,358245,176824,176820','Automotive 2','gallery');
galleries[5] = new gallery(85357,'17060','Automotive 3','gallery');
galleries[6] = new gallery(2056,'18321','Photo / Art','gallery');
galleries[7] = new gallery(2070,'1188090,1188089,1188088,18319,17336,17334,17061','Miscellaneous','gallery');

