/***************************************************************************
* 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('3800924,3794569,829283,823263,817442');
	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('3800924,3794569,829283,823263,817442');
	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 = 'Inspired Icing: ' + 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(3794569,'','','','http://admin.clikpic.com/inspiredicing/images/Brookfield_Wedding-1.jpg',600,762,'Candlelit Cake','http://admin.clikpic.com/inspiredicing/images/Brookfield_Wedding-1_thumb.jpg',130, 165,1, 0,'','','','','','');
photos[1] = new photo(3800924,'','','','http://admin.clikpic.com/inspiredicing/images/Kath_with_Cake.jpg',600,450,'Bride with Bouquet and Cake to match','http://admin.clikpic.com/inspiredicing/images/Kath_with_Cake_thumb.jpg',130, 98,1, 0,'','','','','','');
photos[2] = new photo(817365,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Aisha01.jpg',400,467,'Aisha\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Aisha01_thumb.jpg',130, 152,0, 0,'Stacked three tiers, quilted sides with edible pearls. Flowers are roses in blue and red, and white Cala lilies.','','','','','');
photos[3] = new photo(1363667,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Kath01.jpg',400,499,'Kath\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Kath01_thumb.jpg',130, 162,0, 0,'Three tiers on a curved stand. Passion roses, lisianthus and thistles.','','','','','');
photos[4] = new photo(817425,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Jenni01.jpg',400,498,'Jenni\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Jenni01_thumb.jpg',130, 162,0, 0,'Three tiers on tall curved stand. The red roses matched the bridesmaid\'s dresses, and the white for the Bride. Quilted sides are inset with edible pearls.','','','','','');
photos[5] = new photo(817442,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Lynsey01.jpg',400,531,'Lynsey\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Lynsey01_thumb.jpg',130, 173,1, 1,'Three tiers on rising curved stand. Flowers are white roses with thistles, ivy and beargrass.','','','','','');
photos[6] = new photo(3794940,'62251','','gallery','http://admin.clikpic.com/inspiredicing/images/Jill.jpg',400,599,'Jill\'s Wedding Cake','http://admin.clikpic.com/inspiredicing/images/Jill_thumb.jpg',130, 195,0, 1,'Four tier hexagonal wirh hand crafted sugar flowers and an acrylic seperator.','','','','','');
photos[7] = new photo(1363658,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Elaine011.jpg',400,533,'Elaine\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Elaine011_thumb.jpg',130, 173,0, 0,'A dramatic black and white stacked four tier cake complete with black flowers and crystal trimming.','','','','','');
photos[8] = new photo(817382,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Helen02.jpg',400,541,'Helen\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Helen02_thumb.jpg',130, 176,0, 0,'Three tiers on a rising curved stand. The flowers were made to match the Brides bouquet with Bianca roses and eucalyptos foliage.','','','','','');
photos[9] = new photo(1363663,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/JillB01.jpg',400,554,'Jill B\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/JillB01_thumb.jpg',130, 180,0, 0,'A sophisticated two tier cake with blue roses and butterflies.','','','','','');
photos[10] = new photo(817378,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Hazel01.jpg',400,563,'Hazel\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Hazel01_thumb.jpg',130, 183,0, 0,'Vertical three tier.  Flowers are white Cala lilies','','','','','');
photos[11] = new photo(819340,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Suzie01.jpg',400,574,'Suzie\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Suzie01_thumb.jpg',130, 187,0, 0,'Cala lilies with ivy foliage.','','','','','');
photos[12] = new photo(817447,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Maureen01.jpg',400,571,'Maureen\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Maureen01_thumb.jpg',130, 186,0, 0,'Two tiers on pillars.  Flowers are white Cala lilies with white rose buds.','','','','','');
photos[13] = new photo(817372,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Ellison01.jpg',400,583,'Ellison\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Ellison01_thumb.jpg',130, 189,0, 0,'Vertical three tier cake. Flowers are white roses with thistles and diamente sparkles. Trim is tartan to match the Groom\'s kilt.','','','','','');
photos[14] = new photo(819341,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/R&J01.jpg',400,597,'Rod and Jenny\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/R&J01_thumb.jpg',130, 194,0, 0,'Three tier cake with motifs to match wedding stationery. Flowers are red Cala lilies','','','','','');
photos[15] = new photo(817369,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Carol01.jpg',400,615,'Carol\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Carol01_thumb.jpg',130, 200,0, 0,'Simple two tier cake with pillars. Celtic motif on lower tier. Flowers are blue roses.','','','','','');
photos[16] = new photo(819332,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Naushad01.jpg',400,628,'Naush\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Naushad01_thumb.jpg',130, 204,0, 0,'Four tiers on vertical stand.  Tartan theme to match the Groom\'s kilt, roses coloured to match.','','','','','');
photos[17] = new photo(1363653,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Allison01.jpg',400,659,'Allison\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Allison01_thumb.jpg',130, 214,0, 0,'Three tiers with hearts and roses','','','','','');
photos[18] = new photo(817428,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Lorna01.jpg',400,650,'Lorna\'s Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Lorna01_thumb.jpg',130, 211,0, 0,'Three tiers on tall pillars. This cake travelled safely from Glasgow to the reception in Leeds. Flowers are parrot tulips to match the Bridal bouquet.  If the Bride wishes to have candles in her cake why not? The sides of the cakes are decorated with Garret frills.','','','','','');
photos[19] = new photo(3800877,'62251','','gallery','http://admin.clikpic.com/inspiredicing/images/Lego_Wedding.jpg',400,537,'Lego Wedding','http://admin.clikpic.com/inspiredicing/images/Lego_Wedding_thumb.jpg',130, 175,0, 0,'For the Groom, a Lego fan since childhood.','','','','','');
photos[20] = new photo(1377582,'62251','','gallery','http://www3.clikpic.com/inspiredicing/images/Glenda&Jim01.jpg',400,362,'Stac Pollaidh Wedding Cake','http://www3.clikpic.com/inspiredicing/images/Glenda&Jim01_thumb.jpg',130, 118,0, 0,'Stac Pollaidh, their favourite summit.','','','','','');
photos[21] = new photo(823232,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Elaine01.jpg',400,450,'Elaine\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Elaine01_thumb.jpg',130, 146,0, 0,'A significant birthday, but too much of a gentleman to say which.','','','','','');
photos[22] = new photo(823233,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Emily01.jpg',400,445,'Emily\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Emily01_thumb.jpg',130, 145,0, 1,'','','','','','');
photos[23] = new photo(823239,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Hazel011.jpg',400,510,'Hazel\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Hazel011_thumb.jpg',130, 166,0, 1,'','','','','','');
photos[24] = new photo(823243,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Jenifer01.jpg',400,443,'Jenifer\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Jenifer01_thumb.jpg',130, 144,0, 0,'','','','','','');
photos[25] = new photo(823244,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Muriel01.jpg',400,438,'Muriel\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Muriel01_thumb.jpg',130, 142,0, 0,'','','','','','');
photos[26] = new photo(823240,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Helen011.jpg',400,434,'Helen\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Helen011_thumb.jpg',130, 141,0, 0,'At 80 you deserve a decent cake.','','','','','');
photos[27] = new photo(823247,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Kirsty01.jpg',399,409,'Kirsty\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Kirsty01_thumb.jpg',130, 133,0, 0,'If you have had enough roses, here are sone lilies.','','','','','');
photos[28] = new photo(3794923,'63385','','gallery','http://admin.clikpic.com/inspiredicing/images/Iris.jpg',400,435,'Irises for Iris','http://admin.clikpic.com/inspiredicing/images/Iris_thumb.jpg',130, 141,0, 0,'What else could you put on a cake for Iris\'s special birthday.','','','','','');
photos[29] = new photo(832840,'63385','','gallery','http://www3.clikpic.com/inspiredicing/images/Jean01.jpg',400,404,'Jean\'s Birthday Cake','http://www3.clikpic.com/inspiredicing/images/Jean01_thumb.jpg',130, 131,0, 0,'','','','','','');
photos[30] = new photo(3794893,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Fairies.jpg',400,392,'Fairies for a Princess','http://admin.clikpic.com/inspiredicing/images/Fairies_thumb.jpg',130, 127,0, 0,'Every little girl\'s dream','','','','','');
photos[31] = new photo(3794931,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Jemima_Puddleduck.jpg',400,459,'Jemima Puddleduck','http://admin.clikpic.com/inspiredicing/images/Jemima_Puddleduck_thumb.jpg',130, 149,0, 0,'A beatrix Potter favourite for the literate youngster.','','','','','');
photos[32] = new photo(3794939,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Peter_Rabbit.jpg',400,449,'Peter Rabbit','http://admin.clikpic.com/inspiredicing/images/Peter_Rabbit_thumb.jpg',130, 146,0, 0,'Another Beatrix Potter favourite.','','','','','');
photos[33] = new photo(3800919,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Teddies.jpg',400,477,'Teddies','http://admin.clikpic.com/inspiredicing/images/Teddies_thumb.jpg',130, 155,0, 0,'Kids of all ages love teddy bears.','','','','','');
photos[34] = new photo(823263,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Hema_Glitter_Bear_01.jpg',400,399,'Ballerina Bear','http://www3.clikpic.com/inspiredicing/images/Hema_Glitter_Bear_01_thumb.jpg',130, 130,1, 1,'From a picture of the Ballerina Bear in Hema\'s favourite book by Pauline Siewert.','','','','','');
photos[35] = new photo(3800887,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/On_the_Cycl__Track.jpg',400,412,'On the Cycle Track','http://admin.clikpic.com/inspiredicing/images/On_the_Cycl__Track_thumb.jpg',130, 134,0, 0,'Still a cycling enthuiast?','','','','','');
photos[36] = new photo(823257,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Dav21-01.jpg',400,392,'Camping','http://www3.clikpic.com/inspiredicing/images/Dav21-01_thumb.jpg',130, 127,0, 0,'The occasion followed an expedition up the West Highland way.','','','','','');
photos[37] = new photo(3794901,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Fishing.jpg',600,559,'Fisherman','http://admin.clikpic.com/inspiredicing/images/Fishing_thumb.jpg',130, 121,0, 0,'Cake for a keen angler.','','','','','');
photos[38] = new photo(823278,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Ireland01.jpg',400,385,'TR7 on Ireland','http://www3.clikpic.com/inspiredicing/images/Ireland01_thumb.jpg',130, 125,0, 0,'What do you make for a chap who likes touring Ireland in his red TR7, and who also does a spot of fishing?','','','','','');
photos[39] = new photo(3794887,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Dogs_on_Mull.jpg',400,424,'Dogs on Mull','http://admin.clikpic.com/inspiredicing/images/Dogs_on_Mull_thumb.jpg',130, 138,0, 0,'for an Islander','','','','','');
photos[40] = new photo(824206,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Roderick01.jpg',400,471,'Crash Helmet','http://www3.clikpic.com/inspiredicing/images/Roderick01_thumb.jpg',130, 153,0, 0,'For the man who buys himself a motorbike for his **th birthday','','','','','');
photos[41] = new photo(3794904,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Gardner.jpg',400,428,'Garden Tools','http://admin.clikpic.com/inspiredicing/images/Gardner_thumb.jpg',130, 139,0, 0,'Cake for an enthusiastic gardener','','','','','');
photos[42] = new photo(3800921,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Toolbox.jpg',400,379,'Tool Box','http://admin.clikpic.com/inspiredicing/images/Toolbox_thumb.jpg',130, 123,0, 0,'Give the DIY man a day off on his Birthday.','','','','','');
photos[43] = new photo(3794909,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Golfer.jpg',400,468,'Golfer with Dog','http://admin.clikpic.com/inspiredicing/images/Golfer_thumb.jpg',130, 152,0, 0,'Well it is only a game they say.','','','','','');
photos[44] = new photo(823254,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Chris_Billy_the_dog_01.JPG',400,397,'Dog with Slipper','http://www3.clikpic.com/inspiredicing/images/Chris_Billy_the_dog_01_thumb.JPG',130, 129,0, 0,'Billy the dog is Chris\'s new pup.','','','','','');
photos[45] = new photo(3794874,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Djembe.jpg',400,409,'Djembe Drum','http://admin.clikpic.com/inspiredicing/images/Djembe_thumb.jpg',130, 133,0, 0,'Guitars on an African drum head','','','','','');
photos[46] = new photo(3800899,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Rickenbacker.jpg',400,375,'Rickenbacker Guitar','http://admin.clikpic.com/inspiredicing/images/Rickenbacker_thumb.jpg',130, 122,0, 0,'I think he got a real one too.','','','','','');
photos[47] = new photo(823287,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Lindsay_Beatles01.jpg',400,488,'Beatles','http://www3.clikpic.com/inspiredicing/images/Lindsay_Beatles01_thumb.jpg',130, 159,0, 0,'Usually, Beatles fans are older than 21!','','','','','');
photos[48] = new photo(824210,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Thomas_Fifth-element_01.jpg',400,394,'Fifth Element','http://www3.clikpic.com/inspiredicing/images/Thomas_Fifth-element_01_thumb.jpg',130, 128,0, 0,'For a fan of the sci-fi film The Fifth Element.','','','','','');
photos[49] = new photo(1363671,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Owain01.jpg',400,420,'Star Trek','http://www3.clikpic.com/inspiredicing/images/Owain01_thumb.jpg',130, 137,0, 0,'The Starship Enterprise, what every Trekky would appreciate.','','','','','');
photos[50] = new photo(823285,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Kevin_Celtic_Huddle_01.jpg',400,387,'Celtic Huddle','http://www3.clikpic.com/inspiredicing/images/Kevin_Celtic_Huddle_01_thumb.jpg',130, 126,0, 0,'We got into a huddle to design a cake for Celtic fan Kevin.','','','','','');
photos[51] = new photo(823276,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Ian_StMirran01.jpg',400,427,'St Mirren','http://www3.clikpic.com/inspiredicing/images/Ian_StMirran01_thumb.jpg',130, 139,0, 0,'Guess which team Ian supports.','','','','','');
photos[52] = new photo(824205,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Neil01.jpg',400,448,'A Plane Cake','http://www3.clikpic.com/inspiredicing/images/Neil01_thumb.jpg',130, 146,0, 0,'Even grown-ups like planes.','','','','','');
photos[53] = new photo(3794896,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Fairtrade.jpg',400,432,'Fairtrade','http://admin.clikpic.com/inspiredicing/images/Fairtrade_thumb.jpg',130, 140,0, 0,'Complete with fairtrade and environmentally friendly ingredients.','','','','','');
photos[54] = new photo(823258,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Douglas01.jpg',400,388,'Messy Bedroom','http://www3.clikpic.com/inspiredicing/images/Douglas01_thumb.jpg',130, 126,0, 0,'A messy bedroom, what else for a sixteen year old.','','','','','');
photos[55] = new photo(823260,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Dragons01.jpg',400,334,'Dragons\' Castle','http://www3.clikpic.com/inspiredicing/images/Dragons01_thumb.jpg',130, 109,0, 0,'This was a challenge. Two twenty-firsts, one dragon each.','','','','','');
photos[56] = new photo(823270,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Iain_Teapot01.jpg',400,350,'Claris Cliff Teapot','http://www3.clikpic.com/inspiredicing/images/Iain_Teapot01_thumb.jpg',130, 114,0, 0,'For Iain who always likes \"a wee cuppa tea\".','','','','','');
photos[57] = new photo(1377564,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Sandra&Gina01.jpg',400,397,'Handbag and Shoe','http://www3.clikpic.com/inspiredicing/images/Sandra&Gina01_thumb.jpg',130, 129,0, 0,'A Handbag for Sandra and a Shoe of Gina','','','','','');
photos[58] = new photo(1377562,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/RoseShoe01.jpg',400,418,'The Slipper and the Rose','http://www3.clikpic.com/inspiredicing/images/RoseShoe01_thumb.jpg',130, 136,0, 0,'A special shoe  - and a rose - for Rose.','','','','','');
photos[59] = new photo(829284,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Susannah01.jpg',400,455,'Stars','http://www3.clikpic.com/inspiredicing/images/Susannah01_thumb.jpg',130, 148,0, 0,'For a real star','','','','','');
photos[60] = new photo(3801295,'63800','','gallery','http://admin.clikpic.com/inspiredicing/images/Zoe_zing.jpg',400,583,'Pink Zing with Cupcakes','http://admin.clikpic.com/inspiredicing/images/Zoe_zing_thumb.jpg',130, 189,0, 0,'','','','','','');
photos[61] = new photo(832817,'63800','','gallery','http://www3.clikpic.com/inspiredicing/images/Jean02.jpg',400,517,'Zingy 60th Birthday','http://www3.clikpic.com/inspiredicing/images/Jean02_thumb.jpg',130, 168,0, 0,'For a party which goes with a Zing!','','','','','');
photos[62] = new photo(829091,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Ellie-may01.jpg',400,384,'Golden Christening Cake','http://www3.clikpic.com/inspiredicing/images/Ellie-may01_thumb.jpg',130, 125,0, 0,'Golden roses for a golden girl.','','','','','');
photos[63] = new photo(829056,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Rioghnach01.jpg',400,350,'Pink Celtic Christening cake','http://www3.clikpic.com/inspiredicing/images/Rioghnach01_thumb.jpg',130, 114,0, 0,'Celtic knotwork.','','','','','');
photos[64] = new photo(824212,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Dugald01.jpg',400,317,'Blue Celtic Christening Cake','http://www3.clikpic.com/inspiredicing/images/Dugald01_thumb.jpg',130, 103,0, 0,'Celtic cross and side panels.','','','','','');
photos[65] = new photo(1363681,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Jamie01.jpg',400,389,'Baby Feet Christening Cake','http://www3.clikpic.com/inspiredicing/images/Jamie01_thumb.jpg',130, 126,0, 0,'Baby footprints.','','','','','');
photos[66] = new photo(829283,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Liam01.jpg',400,381,'Teddy Christening Cake','http://www3.clikpic.com/inspiredicing/images/Liam01_thumb.jpg',130, 124,1, 1,'Teddy\'s a real favourite.','','','','','');
photos[67] = new photo(829281,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Maria&Neil01.jpg',400,386,'Silver Anniversary','http://www3.clikpic.com/inspiredicing/images/Maria&Neil01_thumb.jpg',130, 125,0, 0,'','','','','','');
photos[68] = new photo(3800906,'63387','','gallery','http://admin.clikpic.com/inspiredicing/images/Ruby_Anniversery.jpg',400,394,'Ruby Anniversary','http://admin.clikpic.com/inspiredicing/images/Ruby_Anniversery_thumb.jpg',130, 128,0, 0,'','','','','','');
photos[69] = new photo(829112,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Wilma&Ron01.jpg',400,391,'Golden Anniversary','http://www3.clikpic.com/inspiredicing/images/Wilma&Ron01_thumb.jpg',130, 127,0, 0,'Mackintosh theme for a celebration held in the House for an Art Lover','','','','','');
photos[70] = new photo(1377559,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Lee&Douglas.jpg',400,422,'Orchids for a Diamond Anniversary','http://www3.clikpic.com/inspiredicing/images/Lee&Douglas_thumb.jpg',130, 137,0, 0,'Orchids, Stephanotis - and Diamonds.','','','','','');
photos[71] = new photo(1377557,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Nana&Grandad.jpg',400,536,'Diamond Anniversary','http://www3.clikpic.com/inspiredicing/images/Nana&Grandad_thumb.jpg',130, 174,0, 0,'A Diamond Cake for a Diamond Pair','','','','','');
photos[72] = new photo(3794532,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/BB125.jpg',400,391,'Boys Brigade Celebrates 125 Years','http://www3.clikpic.com/inspiredicing/images/BB125_thumb.jpg',130, 127,0, 0,'Design copied from the official BB 125 years Logo.','','','','','');
photos[73] = new photo(829130,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Embroiderers_Centenary01.jpg',400,386,'Embroiderer\'s Centenary Cake','http://www3.clikpic.com/inspiredicing/images/Embroiderers_Centenary01_thumb.jpg',130, 125,0, 0,'','','','','','');
photos[74] = new photo(829119,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/EmbySchool01.jpg',400,401,'Embroidered School Cake','http://www3.clikpic.com/inspiredicing/images/EmbySchool01_thumb.jpg',130, 130,0, 0,'Based on a section of an embroidered hanging, made for the new Mearns Primary School.','','','','','');
photos[75] = new photo(829117,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/EG01.jpg',400,421,'Embroiderer\'s Guild Cake','http://www3.clikpic.com/inspiredicing/images/EG01_thumb.jpg',130, 137,0, 0,'','','','','','');
photos[76] = new photo(3800890,'63387','','gallery','http://admin.clikpic.com/inspiredicing/images/PMOS.jpg',400,382,'Musical Centenary','http://admin.clikpic.com/inspiredicing/images/PMOS_thumb.jpg',130, 124,0, 0,'A great big cake for a great group of singers.','','','','','');
photos[77] = new photo(1377575,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Christmas_Roses_01.jpg',400,437,'Christmas Roses','http://www3.clikpic.com/inspiredicing/images/Christmas_Roses_01_thumb.jpg',130, 142,0, 0,'....and Holly and Ivy','','','','','');
photos[78] = new photo(1377578,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/Love_Came_Down_01.jpg',400,418,'Love Came Down','http://www3.clikpic.com/inspiredicing/images/Love_Came_Down_01_thumb.jpg',130, 136,0, 0,'...at Christmas','','','','','');
photos[79] = new photo(1377580,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/MadonnaRocks01.jpg',400,437,'Mary\'s Boy Child','http://www3.clikpic.com/inspiredicing/images/MadonnaRocks01_thumb.jpg',130, 142,0, 0,'A detail from a Church Hanging','','','','','');
photos[80] = new photo(829108,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/DrDav01.jpg',400,382,'Graduation Cake','http://www3.clikpic.com/inspiredicing/images/DrDav01_thumb.jpg',130, 124,0, 0,'The theme is \"millimetre waves\" - don\'t ask!','','','','','');
photos[81] = new photo(829279,'63387','','gallery','http://www3.clikpic.com/inspiredicing/images/StMirran02.jpg',400,363,'St Mirren Promotion','http://www3.clikpic.com/inspiredicing/images/StMirran02_thumb.jpg',130, 118,0, 0,'This deserves a good cake.','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(62251,'3794940,817442','Wedding Cakes','gallery');
galleries[1] = new gallery(63385,'823239,823233','Flowery Birthday Cakes','gallery');
galleries[2] = new gallery(63800,'823263','Novelty Birthday Cakes','gallery');
galleries[3] = new gallery(63387,'829283','Cakes for Other Occasions','gallery');

