/***************************************************************************
* 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('2359274,1076583,1076580,1076431,1062551,1062549,1030488,1030480,1030474,1030470,494867,478411,478404,478401,478398,363687,363686,363683,363682,363677,351490,348612,345346,345300,345123,342998,342993,341482,334805,323065,323063,323062,323054');
	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('2359274,1076583,1076580,1076431,1062551,1062549,1030488,1030480,1030474,1030470,494867,478411,478404,478401,478398,363687,363686,363683,363682,363677,351490,348612,345346,345300,345123,342998,342993,341482,334805,323065,323063,323062,323054');
	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 = 'Pitlochry Gallery Association: ' + 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(323054,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Anne Wilson - Boating Station, Faskally Loch, Pitlochry..jpg',600,390,'Anne Wilson - Boating Station, Pitlochry','http://www4.clikpic.com/pgallery/images/Anne Wilson - Boating Station, Faskally Loch, Pitlochry_thumb..jpg',130, 85,1, 1,'','','','','','');
photos[1] = new photo(334806,'27474','','gallery','http://www4.clikpic.com/pgallery/images/St.Monan\'s Kirk by Jim Bowman.jpg',600,427,'St Monan\'s Kirk by Jim Bowman','http://www4.clikpic.com/pgallery/images/St_thumb.Monan\'s Kirk by Jim Bowman.jpg',130, 93,0, 0,'','','','','','');
photos[2] = new photo(340121,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Crathie Kirk by Jim Bowman.jpg',600,434,'Crathie Kirk by Jim Bowman','http://www4.clikpic.com/pgallery/images/Crathie Kirk by Jim Bowman_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[3] = new photo(345346,'27474','','gallery','http://www4.clikpic.com/pgallery/images/His & Hers Ron Forbes.jpg',586,420,'His & Hers by Ron Forbes','http://www4.clikpic.com/pgallery/images/His & Hers Ron Forbes_thumb.jpg',130, 93,1, 1,'Hats for gardening,table with basket/fruit/flowers','','','','','');
photos[4] = new photo(1030488,'27474','MFS','gallery','http://www4.clikpic.com/pgallery/images/MFS Lg Poppy Group copy.jpg',600,770,'Field Edge','http://www4.clikpic.com/pgallery/images/MFS Lg Poppy Group copy_thumb.jpg',130, 167,1, 1,'Field Poppies & Daisies','','','','','');
photos[5] = new photo(1498943,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Inveroran.jpg',446,324,'Inveroran<br>\r\nby Pat Gibb','http://www4.clikpic.com/pgallery/images/Inveroran_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[6] = new photo(334805,'27474','','gallery','http://www4.clikpic.com/pgallery/images/_Holyrood Palace by Jim Bowman.jpg',599,435,'Holyrood Palace by Jim Bowman','http://www4.clikpic.com/pgallery/images/_Holyrood Palace by Jim Bowman_thumb.jpg',130, 94,1, 1,'','','','','','');
photos[7] = new photo(363677,'27474','A4JB2','gallery','http://www4.clikpic.com/pgallery/images/_7170776.jpg',600,440,'Bobby in Greyfriar\'s Churchyard','http://www4.clikpic.com/pgallery/images/_7170776_thumb.jpg',130, 95,1, 0,'For sale framed @ £ 280','','','','','');
photos[8] = new photo(340119,'27472','','gallery','http://www4.clikpic.com/pgallery/images/Atholl Centre Entrance.jpg',599,447,'Atholl Centre Entrance','http://www4.clikpic.com/pgallery/images/Atholl Centre Entrance_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[9] = new photo(342993,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Festival Theatre & Dam, Pitlochry. Anne Wilson.jpg',600,442,'Festival Theatre & Dam, Pitlochry. Anne Wilson','http://www4.clikpic.com/pgallery/images/Festival Theatre & Dam, Pitlochry_thumb. Anne Wilson.jpg',130, 96,1, 0,'','','','','','');
photos[10] = new photo(1030480,'27474','MFS','gallery','http://www4.clikpic.com/pgallery/images/Multi Mecon WEB.jpg',599,427,'Meconopsis (multi heads)','http://www4.clikpic.com/pgallery/images/Multi Mecon WEB_thumb.jpg',130, 93,1, 1,'Himalayan Blue Poppies','','','','','');
photos[11] = new photo(345360,'27474','','gallery','http://www4.clikpic.com/pgallery/images/untitled Ron Forbes.jpg',597,420,'Soup Kitchen','http://www4.clikpic.com/pgallery/images/untitled Ron Forbes_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[12] = new photo(1030470,'27474','MFS','gallery','http://www4.clikpic.com/pgallery/images/MFS Redheads.jpg',599,792,'Redheads','http://www4.clikpic.com/pgallery/images/MFS Redheads_thumb.jpg',130, 172,1, 1,'','','','','','');
photos[13] = new photo(323065,'27474','','gallery','http://www4.clikpic.com/pgallery/images/kintyrejune 2006.Linda Lincoln.jpg',600,446,'Sharon MacDonald    Kintyre,June','http://www4.clikpic.com/pgallery/images/kintyrejune 2006_thumb.Linda Lincoln.jpg',130, 97,1, 0,'','','','','','');
photos[14] = new photo(341482,'27474','','gallery','http://www4.clikpic.com/pgallery/images/mallardswatercolour.jpg',577,424,'Mallards by Sharon MacDonald','http://www4.clikpic.com/pgallery/images/mallardswatercolour_thumb.jpg',130, 96,1, 1,'','','','','','');
photos[15] = new photo(1498942,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Sunset over Holy Isle, Arran.jpg',446,443,'Sunset over Holy Isle, Arran<br>\r\nby Pat Gibb','http://www4.clikpic.com/pgallery/images/Sunset over Holy Isle, Arran_thumb.jpg',130, 129,0, 0,'','','','','','');
photos[16] = new photo(2359276,'27474','Sharon MacDonald','gallery','http://www4.clikpic.com/pgallery/images/DSC00315.jpg',586,440,'Eilean Donan Castle<br>\r\n<br>\r\nby Sharon MacDonald','http://www4.clikpic.com/pgallery/images/DSC00315_thumb.jpg',130, 98,0, 0,'Size A2<br>\r\nNot for sale','','','','','');
photos[17] = new photo(323062,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Anne Wilson - Pennan,Cullykhan Bay.jpg',600,476,'Anne Wilson - Pennan,Cullykhan Bay','http://www4.clikpic.com/pgallery/images/Anne Wilson - Pennan,Cullykhan Bay_thumb.jpg',130, 103,1, 1,'','','','','','');
photos[18] = new photo(340120,'27474','','gallery','http://www4.clikpic.com/pgallery/images/Loch an Eilean by Jim Bowman.jpg',600,458,'Loch an Eilean by Jim Bowman','http://www4.clikpic.com/pgallery/images/Loch an Eilean by Jim Bowman_thumb.jpg',130, 99,0, 0,'','','','','','');
photos[19] = new photo(363682,'27474','','gallery','http://www4.clikpic.com/pgallery/images/_7170806.jpg',600,443,'Highland Cattle on Skye by Ron Forbes','http://www4.clikpic.com/pgallery/images/_7170806_thumb.jpg',130, 96,1, 1,'Framed<br>\r\nFor sale @ £ 165','','','','','');
photos[20] = new photo(323063,'27475','','gallery','http://www4.clikpic.com/pgallery/images/Moray Coast - Acrylic. Linda Lincoln.jpg',600,407,'Linda Lincoln - Moray Coast','http://www4.clikpic.com/pgallery/images/Moray Coast - Acrylic_thumb. Linda Lincoln.jpg',130, 88,1, 1,'','','','','','');
photos[21] = new photo(478398,'27475','','gallery','http://www4.clikpic.com/pgallery/images/Blue Studio by Peter Green.jpg',428,428,'Blue Studio by Peter Green','http://www4.clikpic.com/pgallery/images/Blue Studio by Peter Green_thumb.jpg',130, 130,1, 1,'Acrylic on canvas','','','','','');
photos[22] = new photo(478404,'27475','','gallery','http://www4.clikpic.com/pgallery/images/Lunch at the studio by Peter Green.jpg',428,597,'Lunch at the Studio by Peter Green','http://www4.clikpic.com/pgallery/images/Lunch at the studio by Peter Green_thumb.jpg',130, 181,1, 0,'Acrylic on canvas','','','','','');
photos[23] = new photo(345300,'27475','','gallery','http://www4.clikpic.com/pgallery/images/Still Life with Fruit Ron Forbes.jpg',599,420,'Still Life with Fruit by Ron Forbes','http://www4.clikpic.com/pgallery/images/Still Life with Fruit Ron Forbes_thumb.jpg',130, 91,1, 1,'Spode jug & bowl with oranges/grapes/nuts.<br>\r\nSOLD','','','','','');
photos[24] = new photo(363683,'27475','A75PG','gallery','http://www4.clikpic.com/pgallery/images/_7170823.jpg',600,444,'Festival Theatre, Pitlochy - Philip Greene','http://www4.clikpic.com/pgallery/images/_7170823_thumb.jpg',130, 96,1, 1,'Framed on sale @ £ 300<br>\r\nForthcoming feature on Philip\'s work','','','','','');
photos[25] = new photo(2359274,'27475','','gallery','http://www4.clikpic.com/pgallery/images/2007-11-26-1814-55.jpg',600,439,'Kintyre Shore<br>\r\n<br>\r\nby Sharon MacDonald','http://www4.clikpic.com/pgallery/images/2007-11-26-1814-55_thumb.jpg',130, 95,1, 1,'Acrylic    20\" x 18\"<br>\r\nFor sale framed in summer exhibition','','','','','');
photos[26] = new photo(345123,'27475','','gallery','http://www4.clikpic.com/pgallery/images/Gentle Giant Ron Forbes copy.jpg',509,419,'Gentle Giant by Ron Forbes-Oil','http://www4.clikpic.com/pgallery/images/Gentle Giant Ron Forbes copy_thumb.jpg',130, 107,1, 1,'Oil 24\" x 20\" in swept gilt frame.<br>\r\nCurrently for sale @ £450','','','','','');
photos[27] = new photo(342998,'27475','','gallery','http://www4.clikpic.com/pgallery/images/Still Life2 by Kate Kirby.jpg',399,300,'Still Life (blue table) by Kate Kirby','http://www4.clikpic.com/pgallery/images/Still Life2 by Kate Kirby_thumb.jpg',130, 98,1, 1,'Original SOLD<br>\r\nCards & prints available','','','','','');
photos[28] = new photo(348605,'27475','A11DB','gallery','http://www4.clikpic.com/pgallery/images/charlie.jpg',474,377,'Charlie by Dawn Brooks','http://www4.clikpic.com/pgallery/images/charlie_thumb.jpg',130, 103,0, 1,'Currently for sale @ £150<br>\r\nOil','','','','','');
photos[29] = new photo(494867,'27476','','gallery','http://www4.clikpic.com/pgallery/images/OMIHT.jpg',599,827,'One Man in his Time<br>\r\nby Jim Bowman','http://www4.clikpic.com/pgallery/images/OMIHT_thumb.jpg',130, 179,1, 1,'Available as a print & as a card by kind permission of Mrs Ann Martin - proceeds to fund summer exhibition & website','','','','','');
photos[30] = new photo(363686,'27476','A29KS2','gallery','http://www4.clikpic.com/pgallery/images/_7170834.jpg',512,464,'Garden Door with Irises by Karin D. Scott','http://www4.clikpic.com/pgallery/images/_7170834_thumb.jpg',130, 118,1, 1,'Chalk Pastels<br>\r\nFramed - for sale @ £ 160','','','','','');
photos[31] = new photo(363687,'27476','A29KS2','gallery','http://www4.clikpic.com/pgallery/images/_7170836.jpg',600,431,'Green Lane, Yorkshire by Karin D. Scott','http://www4.clikpic.com/pgallery/images/_7170836_thumb.jpg',130, 93,1, 0,'Chalk Pastels<br>\r\nFramed - for sale @ £ 210','','','','','');
photos[32] = new photo(1030474,'27476','MFS','gallery','http://www4.clikpic.com/pgallery/images/Golden Eagle MFS.jpg',459,427,'Golden Eagle','http://www4.clikpic.com/pgallery/images/Golden Eagle MFS_thumb.jpg',130, 121,1, 1,'Drawing','','','','','');
photos[33] = new photo(478411,'27476','','gallery','http://www4.clikpic.com/pgallery/images/The Salmon Leap & Falls of Tummel.jpg',600,427,'The Salmon Leap & Falls of Tummel<br>\r\nGraphite drawing by Alfred Marsh','http://www4.clikpic.com/pgallery/images/The Salmon Leap & Falls of Tummel_thumb.jpg',130, 93,1, 1,'Graphite drawing<br>\r\nPrints available','','','','','');
photos[34] = new photo(1030483,'27476','','gallery','http://www4.clikpic.com/pgallery/images/Osprey Head.jpg',427,518,'Osprey Head','http://www4.clikpic.com/pgallery/images/Osprey Head_thumb.jpg',130, 158,0, 1,'Drawing','','','','','');
photos[35] = new photo(478407,'27477','','gallery','http://www4.clikpic.com/pgallery/images/Lion at the gate, Mains of Edradour.JPG',428,570,'Lion at the Gate<br>\r\nMains of Edradour<br>\r\nPhotograph by Jan Moles','http://www4.clikpic.com/pgallery/images/Lion at the gate, Mains of Edradour_thumb.JPG',130, 173,0, 1,'','','','','','');
photos[36] = new photo(348612,'27477','A35SF','gallery','http://www4.clikpic.com/pgallery/images/OLDCOURSEINWINTER.jpg',600,412,'Old Course in Winter<br>\r\nStan Farrow Photography','http://www4.clikpic.com/pgallery/images/OLDCOURSEINWINTER_thumb.jpg',130, 89,1, 1,'Archive quality photographic print<br>\r\nFramed - for sale @ £ 82','','','','','');
photos[37] = new photo(478401,'27477','','gallery','http://www4.clikpic.com/pgallery/images/Birksforweb.jpg',400,598,'The Birks of Aberfeldy<br>\r\nStan Farrow Photography','http://www4.clikpic.com/pgallery/images/Birksforweb_thumb.jpg',130, 194,1, 0,'','','','','','');
photos[38] = new photo(1062549,'27477','','gallery','http://www4.clikpic.com/pgallery/images/FIRSTLIGHT.jpg',600,357,'First Light','http://www4.clikpic.com/pgallery/images/FIRSTLIGHT_thumb.jpg',130, 77,1, 1,'Stan Farrow Photography','','','','','');
photos[39] = new photo(1062550,'27477','','gallery','http://www4.clikpic.com/pgallery/images/NOCTURNE.jpg',600,294,'Nocturne','http://www4.clikpic.com/pgallery/images/NOCTURNE_thumb.jpg',130, 64,0, 1,'Stan Farrow Photography','','','River Tay','','');
photos[40] = new photo(1062551,'27477','','gallery','http://www4.clikpic.com/pgallery/images/SOLITUDE.jpg',600,338,'Solitude','http://www4.clikpic.com/pgallery/images/SOLITUDE_thumb.jpg',130, 73,1, 0,'Stan Farrow Photography','','','River Tay','','');
photos[41] = new photo(351464,'27477','','gallery','http://www4.clikpic.com/pgallery/images/Delphinium Head (buds) Jan Moles.jpg',600,800,'Delphinium Head (buds) Jan Moles','http://www4.clikpic.com/pgallery/images/Delphinium Head (buds) Jan Moles_thumb.jpg',130, 173,0, 1,'Fine Art Print/Card','','','','','');
photos[42] = new photo(334811,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Acrylic Display.jpg',599,514,'Photographic Greeting Cards by Jan Moles','http://www4.clikpic.com/pgallery/images/Acrylic Display_thumb.jpg',130, 112,0, 1,'','','','','','');
photos[43] = new photo(1076386,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Peet - Bargello Jewellery Box.jpg',448,336,'Bargello Jewellery Box<br>\r\nby Karl Peet','http://www4.clikpic.com/pgallery/images/Peet - Bargello Jewellery Box_thumb.jpg',130, 98,0, 1,'Bespoke wooden Boxes','','','','','');
photos[44] = new photo(1076582,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Jim Waite - Glass & Pyrography.jpg',388,517,'Pyrography and engraved glass<br>\r\nby Jim Waite','http://www4.clikpic.com/pgallery/images/Jim Waite - Glass & Pyrography_thumb.jpg',130, 173,0, 1,'','','','','','');
photos[45] = new photo(1076425,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Peet - Industrial Art - Jewellery Box.JPG',448,336,'Industrial Art Jewellery Box <br>\r\nby Karl Peet','http://www4.clikpic.com/pgallery/images/Peet - Industrial Art - Jewellery Box_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[46] = new photo(1076580,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Christine Keeter -Handpainted wooden crafts.jpg',388,517,'Hand painted American inspired wooden crafts<br>\r\nby Christine Keeter','http://www4.clikpic.com/pgallery/images/Christine Keeter -Handpainted wooden crafts_thumb.jpg',130, 173,1, 1,'','','','','','');
photos[47] = new photo(1076431,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Peet - Keepdake box in Yew.jpg',448,336,'Keepsake Box in Yew<br>\r\nby Karl Peet','http://www4.clikpic.com/pgallery/images/Peet - Keepdake box in Yew_thumb.jpg',130, 98,1, 1,'bespoke handrafted wooden boxes','','','','','');
photos[48] = new photo(1076581,'27478','','gallery','http://www4.clikpic.com/pgallery/images/Jim Waite - Engraved Glass.jpg',388,577,'Engraved Glass by Jim Waite','http://www4.clikpic.com/pgallery/images/Jim Waite - Engraved Glass_thumb.jpg',130, 193,0, 0,'Decanter and whisky dram','','','','','');
photos[49] = new photo(1076583,'27478','Jules Jewellery','gallery','http://www4.clikpic.com/pgallery/images/Julie Hay - Jules Jewellery.jpg',600,387,'Jewellery by Julie Hay','http://www4.clikpic.com/pgallery/images/Julie Hay - Jules Jewellery_thumb.jpg',130, 84,1, 1,'','','','','','');
photos[50] = new photo(351489,'27478','C34YA','gallery','http://www4.clikpic.com/pgallery/images/Yvonne Arton Blairgowrie_2.jpg',600,685,'Yvonne Arton, Blairgowrie','http://www4.clikpic.com/pgallery/images/Yvonne Arton Blairgowrie_2_thumb.jpg',130, 148,0, 1,'Decorated, hand painted glassware','','','','','');
photos[51] = new photo(351490,'27478','C34YA','gallery','http://www4.clikpic.com/pgallery/images/Yvonne Arton Blairgowrie.jpg',560,907,'Yvonne Arton, Blairgowrie','http://www4.clikpic.com/pgallery/images/Yvonne Arton Blairgowrie_thumb.jpg',130, 211,1, 1,'Decorated, hand painted glassware','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(27472,'340119','Summer Exhibition','gallery');
galleries[1] = new gallery(27474,'1030488,1030480,1030470,363682,345346,341482,334805,323062,323054','Watercolour - Gallery 1','gallery');
galleries[2] = new gallery(27475,'2359274,478398,363683,348605,345300,345123,342998,323063','Acrylic & Oil - Gallery 2','gallery');
galleries[3] = new gallery(27476,'1030483,1030474,494867,478411,363686','Mixed Media - Gallery 3','gallery');
galleries[4] = new gallery(27477,'1062550,1062549,478407,351464,348612','Photography - Gallery 4','gallery');
galleries[5] = new gallery(27478,'1076583,1076582,1076580,1076431,1076386,351490,351489,334811','Crafts - Gallery 5','gallery');

