window.thumbnails = {};
															thumbnails[5721567] = clik.newPhoto({"id":5721567,"src":"052_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721567.html","width":130,"caption":"","height":172});
															thumbnails[5721570] = clik.newPhoto({"id":5721570,"src":"054_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721570.html","width":130,"caption":"","height":260});
															thumbnails[5721596] = clik.newPhoto({"id":5721596,"src":"056_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721596.html","width":130,"caption":"","height":88});
															thumbnails[5721599] = clik.newPhoto({"id":5721599,"src":"057_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721599.html","width":130,"caption":"","height":252});
															thumbnails[5721608] = clik.newPhoto({"id":5721608,"src":"063_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721608.html","width":130,"caption":"","height":151});
															thumbnails[5721627] = clik.newPhoto({"id":5721627,"src":"066_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721627.html","width":130,"caption":"","height":107});
															thumbnails[5721655] = clik.newPhoto({"id":5721655,"src":"069_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721655.html","width":130,"caption":"","height":250});
															thumbnails[5721658] = clik.newPhoto({"id":5721658,"src":"070_thumb.jpg","galleries_id":323428,"server_id":5,"link":"photo_5721658.html","width":130,"caption":"","height":161});
															thumbnails[5402289] = clik.newPhoto({"id":5402289,"src":"spike-pod_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402289.html","width":130,"caption":"Spike Pod","height":159});
															thumbnails[6398536] = clik.newPhoto({"id":6398536,"src":"069_FC490D17-1D09-001F-992E2B961759D29E_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398536.html","width":130,"caption":"Ladyhare.","height":262});
															thumbnails[5396215] = clik.newPhoto({"id":5396215,"src":"Flower_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5396215.html","width":130,"caption":"Flower","height":250});
															thumbnails[5934111] = clik.newPhoto({"id":5934111,"src":"226_thumb.jpg","galleries_id":334767,"server_id":5,"link":"photo_5934111.html","width":130,"caption":"","height":126});
															thumbnails[6398537] = clik.newPhoto({"id":6398537,"src":"070_FC49BF40-1D09-001F-99E7D4EF05EEF523_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398537.html","width":130,"caption":"Ladyhare ","height":259});
															thumbnails[5393719] = clik.newPhoto({"id":5393719,"src":"Large-Egg_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5393719.html","width":130,"caption":"Large Egg","height":223});
															thumbnails[5395085] = clik.newPhoto({"id":5395085,"src":"Reaching_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395085.html","width":130,"caption":"Reaching","height":194});
															thumbnails[6398540] = clik.newPhoto({"id":6398540,"src":"075_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398540.html","width":130,"caption":"Ladyhare (detail)","height":207});
															thumbnails[5395039] = clik.newPhoto({"id":5395039,"src":"Ovo-Pod_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395039.html","width":130,"caption":"Ovo-Pod","height":229});
															thumbnails[6398542] = clik.newPhoto({"id":6398542,"src":"103_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398542.html","width":130,"caption":"Thorny Ash (Pair) (SOLD)","height":300});
															thumbnails[5395050] = clik.newPhoto({"id":5395050,"src":"Tree-Pod_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395050.html","width":130,"caption":"Tree Pod","height":199});
															thumbnails[5402275] = clik.newPhoto({"id":5402275,"src":"Small-Egg_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402275.html","width":130,"caption":"Small Egg","height":232});
															thumbnails[6398546] = clik.newPhoto({"id":6398546,"src":"109_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398546.html","width":130,"caption":"Thorny Ash (detail)","height":193});
															thumbnails[5934104] = clik.newPhoto({"id":5934104,"src":"219_thumb.jpg","galleries_id":334767,"server_id":5,"link":"photo_5934104.html","width":130,"caption":"","height":123});
															thumbnails[5396219] = clik.newPhoto({"id":5396219,"src":"Trumpet_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5396219.html","width":130,"caption":"Trumpet","height":234});
															thumbnails[6398551] = clik.newPhoto({"id":6398551,"src":"090_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398551.html","width":130,"caption":"Fruit from the Cherry","height":227});
															thumbnails[5402246] = clik.newPhoto({"id":5402246,"src":"LuvPod_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402246.html","width":130,"caption":"LuvPod","height":182});
															thumbnails[5934101] = clik.newPhoto({"id":5934101,"src":"214_thumb.jpg","galleries_id":334767,"server_id":5,"link":"photo_5934101.html","width":130,"caption":"","height":121});
															thumbnails[5395198] = clik.newPhoto({"id":5395198,"src":"Fern_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395198.html","width":130,"caption":"Fern","height":294});
															thumbnails[5402263] = clik.newPhoto({"id":5402263,"src":"Promise-Tree-2_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402263.html","width":130,"caption":"Promise Tree #2","height":211});
															thumbnails[5402257] = clik.newPhoto({"id":5402257,"src":"plumpbuds_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402257.html","width":130,"caption":"Plumpbuds","height":211});
															thumbnails[5395093] = clik.newPhoto({"id":5395093,"src":"Promise-Tree_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395093.html","width":130,"caption":"Promise Tree","height":187});
															thumbnails[6398562] = clik.newPhoto({"id":6398562,"src":"spikepod_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398562.html","width":130,"caption":"Spikepod","height":154});
															thumbnails[5395149] = clik.newPhoto({"id":5395149,"src":"Red-Opening_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395149.html","width":130,"caption":"Red Opening","height":226});
															thumbnails[6398552] = clik.newPhoto({"id":6398552,"src":"123_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398552.html","width":130,"caption":"Ladyflower (Sold)","height":230});
															thumbnails[7678813] = clik.newPhoto({"id":7678813,"src":"P4184249_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678813.html","width":130,"caption":"Incised Egg","height":115});
															thumbnails[5395070] = clik.newPhoto({"id":5395070,"src":"New-Growth_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395070.html","width":130,"caption":"New Growth","height":216});
															thumbnails[7678814] = clik.newPhoto({"id":7678814,"src":"P4184251_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678814.html","width":130,"caption":"Incised Egg (rear)","height":110});
															thumbnails[5393991] = clik.newPhoto({"id":5393991,"src":"Ovum_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5393991.html","width":130,"caption":"Ovum","height":250});
															thumbnails[6398555] = clik.newPhoto({"id":6398555,"src":"so-many-mouths-to-feed-rea_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398555.html","width":130,"caption":"Ladyflower","height":231});
															thumbnails[7678816] = clik.newPhoto({"id":7678816,"src":"P4184255_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678816.html","width":130,"caption":"Incised Egg","height":102});
															thumbnails[7678820] = clik.newPhoto({"id":7678820,"src":"P4184256_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678820.html","width":130,"caption":"Incised Egg (rear)","height":102});
															thumbnails[5402294] = clik.newPhoto({"id":5402294,"src":"Spike-Pod-2_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402294.html","width":130,"caption":"Spike Pod","height":160});
															thumbnails[7678829] = clik.newPhoto({"id":7678829,"src":"P4184260_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678829.html","width":130,"caption":"Incised Egg","height":108});
															thumbnails[7678830] = clik.newPhoto({"id":7678830,"src":"P4184262_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678830.html","width":130,"caption":"Incised Egg (rear)","height":123});
															thumbnails[6398557] = clik.newPhoto({"id":6398557,"src":"kelp_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398557.html","width":130,"caption":"Kelp (SOLD)","height":314});
															thumbnails[7676914] = clik.newPhoto({"id":7676914,"src":"P4184226_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676914.html","width":130,"caption":"Lidded Urn","height":110});
															thumbnails[5395169] = clik.newPhoto({"id":5395169,"src":"Egg_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395169.html","width":130,"caption":"Egg","height":196});
															thumbnails[6398558] = clik.newPhoto({"id":6398558,"src":"kelp-detail_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398558.html","width":130,"caption":"Kelp (detail)","height":247});
															thumbnails[7676913] = clik.newPhoto({"id":7676913,"src":"P4184229_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676913.html","width":130,"caption":"Detail","height":108});
															thumbnails[7676936] = clik.newPhoto({"id":7676936,"src":"P4184227_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676936.html","width":130,"caption":"Lidded Urn","height":120});
															thumbnails[5395218] = clik.newPhoto({"id":5395218,"src":"Pod-31_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395218.html","width":130,"caption":"Pod #3","height":219});
															thumbnails[6398560] = clik.newPhoto({"id":6398560,"src":"kelp-detail-95_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398560.html","width":130,"caption":"Kelp (detail)","height":237});
															thumbnails[7676937] = clik.newPhoto({"id":7676937,"src":"P4184234_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676937.html","width":130,"caption":"Lidded Urn","height":127});
															thumbnails[7676926] = clik.newPhoto({"id":7676926,"src":"P4184233_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676926.html","width":130,"caption":"Lidded Urn","height":110});
															thumbnails[7676938] = clik.newPhoto({"id":7676938,"src":"P4184235_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676938.html","width":130,"caption":"Lidded Urn","height":114});
															thumbnails[6398563] = clik.newPhoto({"id":6398563,"src":"unfurling_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398563.html","width":130,"caption":"Unfurling (SOLD)","height":242});
															thumbnails[7676939] = clik.newPhoto({"id":7676939,"src":"P4184237_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676939.html","width":130,"caption":"Lidded Urn","height":115});
															thumbnails[6398564] = clik.newPhoto({"id":6398564,"src":"unfurling-2_thumb.jpg","galleries_id":353606,"server_id":5,"link":"photo_6398564.html","width":130,"caption":"Unfurling","height":207});
															thumbnails[7676942] = clik.newPhoto({"id":7676942,"src":"P4184243_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7676942.html","width":130,"caption":"Large Lidded Urn","height":107});
															thumbnails[7678832] = clik.newPhoto({"id":7678832,"src":"P4184266_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678832.html","width":130,"caption":"Lidded Urn","height":124});
															thumbnails[7678838] = clik.newPhoto({"id":7678838,"src":"P4184268_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678838.html","width":130,"caption":"Lidded Urn","height":116});
															thumbnails[7678859] = clik.newPhoto({"id":7678859,"src":"P4184270_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678859.html","width":130,"caption":"Rear View","height":114});
															thumbnails[5402241] = clik.newPhoto({"id":5402241,"src":"Duet_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402241.html","width":130,"caption":"Duet","height":238});
															thumbnails[7678840] = clik.newPhoto({"id":7678840,"src":"P4184279_thumb.jpg","galleries_id":353607,"server_id":5,"link":"photo_7678840.html","width":130,"caption":" Large Stone Form","height":101});
															thumbnails[5396213] = clik.newPhoto({"id":5396213,"src":"Bi-Pod_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5396213.html","width":130,"caption":"Bi-Pod","height":224});
															thumbnails[5396212] = clik.newPhoto({"id":5396212,"src":"Antenna_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5396212.html","width":130,"caption":"Antenna","height":212});
															thumbnails[5395290] = clik.newPhoto({"id":5395290,"src":"Flowerhead_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5395290.html","width":130,"caption":"Flowerhead","height":232});
															thumbnails[5402273] = clik.newPhoto({"id":5402273,"src":"Red-leggy-bowl_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5402273.html","width":130,"caption":"Red Tentacle","height":86});
															thumbnails[5393663] = clik.newPhoto({"id":5393663,"src":"green_leggy_bowl_thumb.jpg","galleries_id":304396,"server_id":5,"link":"photo_5393663.html","width":130,"caption":"Green Tentacle","height":92});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[353607] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Naked Raku","link":"gallery_353607.html","maxRecords":0.0,"photoIDs":[7678813.0,7678814.0,7678816.0,7678820.0,7678829.0,7678830.0,7676914.0,7676913.0,7676936.0,7676937.0,7676926.0,7676938.0,7676939.0,7676942.0,7678832.0,7678838.0,7678859.0,7678840.0],"skipIndex":0,"section_code":"gallery","featured_images":"7678813,7676913","id":353607,"singleSection":false});				  						galleries[353606] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sculptures 2010","link":"gallery_353606.html","maxRecords":0.0,"photoIDs":[6398536.0,6398537.0,6398540.0,6398542.0,6398546.0,6398551.0,6398562.0,6398552.0,6398555.0,6398557.0,6398558.0,6398560.0,6398563.0,6398564.0],"skipIndex":0,"section_code":"gallery","featured_images":"6398552,6398546,6398542,6398540,6398536","id":353606,"singleSection":false});				  						galleries[304396] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Archive","link":"gallery_304396.html","maxRecords":0.0,"photoIDs":[5402289.0,5396215.0,5393719.0,5395085.0,5395039.0,5395050.0,5402275.0,5396219.0,5402246.0,5395198.0,5402263.0,5402257.0,5395093.0,5395149.0,5395070.0,5393991.0,5402294.0,5395169.0,5395218.0,5402241.0,5396213.0,5396212.0,5395290.0,5402273.0,5393663.0],"skipIndex":0,"section_code":"gallery","featured_images":"5402289,5395085,5393719","id":304396,"singleSection":false});				  						galleries[334767] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Island Bowls","link":"gallery_334767.html","maxRecords":0.0,"photoIDs":[5934111.0,5934104.0,5934101.0],"skipIndex":0,"section_code":"gallery","featured_images":"5934111,5934104,5934101","id":334767,"singleSection":false});				  						galleries[323428] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Jewellery","link":"gallery_323428.html","maxRecords":0.0,"photoIDs":[5721567.0,5721570.0,5721596.0,5721599.0,5721608.0,5721627.0,5721655.0,5721658.0],"skipIndex":0,"section_code":"gallery","featured_images":5721627.0,"id":323428,"singleSection":false});				  						galleries[304397] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Raku","link":"gallery_304397.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":304397,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5402289,5393719,6398540,5395085,6398542,7678813,7676913';
imageSets[2] = '5721627,6398536,5402289,5393719,6398540,5395085,6398542,6398546,7678813,6398552,7676913';
imageSets[3] = '7678859,7678840,7678838,7678832,7678830,7678829,7678820,7678816,7678814,7678813,7676942,7676939,7676938,7676937,7676936,7676926,7676914,7676913,6398564,6398563,6398562,6398560,6398558,6398557,6398555,6398552,6398551,6398546,6398542,6398540,6398537,6398536,5934111,5934104,5934101,5721658,5721655,5721627,5721608,5721599,5721596,5721570,5721567,5402294,5402289,5402275,5402273,5402263,5402257,5402246';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/rakustar/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/rakustar/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/rakustar/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/rakustar/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/rakustar/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/rakustar/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/rakustar/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Michelle Young-Hares             Ceramics: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* 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, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

