window.thumbnails = {};
															thumbnails[3074196] = clik.newPhoto({"id":3074196,"src":"Image1-1cr12_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"PENDANT AND EARRINGS","height":182});
															thumbnails[3074209] = clik.newPhoto({"id":3074209,"src":"Image1-318_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"= RING =","height":164});
															thumbnails[3074224] = clik.newPhoto({"id":3074224,"src":"Image1-621_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"GOLDEN SET ","height":181});
															thumbnails[3074255] = clik.newPhoto({"id":3074255,"src":"Image1-924_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"PENDANTS","height":172});
															thumbnails[3074258] = clik.newPhoto({"id":3074258,"src":"Image1-1002_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"RINGS","height":235});
															thumbnails[3074266] = clik.newPhoto({"id":3074266,"src":"Image1-1406_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"=RING= ","height":187});
															thumbnails[3074282] = clik.newPhoto({"id":3074282,"src":"Image1-2317_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"= FIRST DRAUGHT =","height":172});
															thumbnails[5740716] = clik.newPhoto({"id":5740716,"src":"IMG_0001m_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"RING","height":210});
															thumbnails[8138102] = clik.newPhoto({"id":8138102,"src":"DSCN4815a_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"= BLUE  WAVE =","height":98});
															thumbnails[8138124] = clik.newPhoto({"id":8138124,"src":"DSCN4840a_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":93});
															thumbnails[8138229] = clik.newPhoto({"id":8138229,"src":"DSCN4864a_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":98});
															thumbnails[8192418] = clik.newPhoto({"id":8192418,"src":"DSCN4864b_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":98});
															thumbnails[8192461] = clik.newPhoto({"id":8192461,"src":"DSCN4815b_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":98});
															thumbnails[8771877] = clik.newPhoto({"id":8771877,"src":"2011-11-14_101.19.50a_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":101});
															thumbnails[8771879] = clik.newPhoto({"id":8771879,"src":"2011-11-14_101.20.41a_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":141});
															thumbnails[3074202] = clik.newPhoto({"id":3074202,"src":"Image1-213_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074202.html","width":130,"caption":"=EARRING= ","height":189});
															thumbnails[3074213] = clik.newPhoto({"id":3074213,"src":"Image1-419_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074213.html","width":130,"caption":"=PEARL BROOCH= ","height":180});
															thumbnails[3074214] = clik.newPhoto({"id":3074214,"src":"Image1-520_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074214.html","width":130,"caption":"=PEARL PINS= ","height":86});
															thumbnails[3074233] = clik.newPhoto({"id":3074233,"src":"Image1-722_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074233.html","width":130,"caption":"=PEARL NECKLACE=","height":165});
															thumbnails[3074251] = clik.newPhoto({"id":3074251,"src":"Image1-823_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074251.html","width":130,"caption":"=PEARL NECKLACE AND EARRINGS=","height":171});
															thumbnails[3074261] = clik.newPhoto({"id":3074261,"src":"Image1-1103_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074261.html","width":130,"caption":"=RING=","height":250});
															thumbnails[3074263] = clik.newPhoto({"id":3074263,"src":"Image1-1204_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074263.html","width":130,"caption":"=BROOCH AND EARRINS= ","height":184});
															thumbnails[3074265] = clik.newPhoto({"id":3074265,"src":"Image1-1305_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_3074265.html","width":130,"caption":"=NECKLACE=","height":167});
															thumbnails[3074269] = clik.newPhoto({"id":3074269,"src":"Image1-1608_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074269.html","width":130,"caption":"=KISS=","height":91});
															thumbnails[3074271] = clik.newPhoto({"id":3074271,"src":"Image1-1709_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074271.html","width":130,"caption":"=NEFERTITI=","height":194});
															thumbnails[3074272] = clik.newPhoto({"id":3074272,"src":"Image1-1810_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074272.html","width":130,"caption":"=PORTRAIT I=","height":188});
															thumbnails[3074275] = clik.newPhoto({"id":3074275,"src":"Image1-1911_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074275.html","width":130,"caption":"=PORTRAIT II=","height":189});
															thumbnails[3074276] = clik.newPhoto({"id":3074276,"src":"Image1-2014_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074276.html","width":130,"caption":"=PORTRAIT III=","height":196});
															thumbnails[3074277] = clik.newPhoto({"id":3074277,"src":"Image1-2115_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074277.html","width":130,"caption":"=TWINS=","height":186});
															thumbnails[3074279] = clik.newPhoto({"id":3074279,"src":"Image1-2216_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_3074279.html","width":130,"caption":"=JESKYNKY=","height":197});
															thumbnails[5740719] = clik.newPhoto({"id":5740719,"src":"IMG_0002m_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_5740719.html","width":130,"caption":"=ON THE BEACH=","height":184});
															thumbnails[5740722] = clik.newPhoto({"id":5740722,"src":"IMG_0005m_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_5740722.html","width":130,"caption":"=DANCING=","height":188});
															thumbnails[5740725] = clik.newPhoto({"id":5740725,"src":"IMG_0006m_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_5740725.html","width":130,"caption":"=RING=","height":206});
															thumbnails[5740729] = clik.newPhoto({"id":5740729,"src":"IMG_0003m_thumb.jpg","galleries_id":144781,"server_id":32,"link":"photo_5740729.html","width":130,"caption":"=RING=","height":210});
															thumbnails[7234216] = clik.newPhoto({"id":7234216,"src":"DSCN2771g_thumb.jpg","galleries_id":450007,"server_id":32,"link":"photo_7234216.html","width":130,"caption":"","height":143});
															thumbnails[8106720] = clik.newPhoto({"id":8106720,"src":"2011-06-19_181.40.11a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8106720.html","width":130,"caption":"= NECKLACE =","height":98});
															thumbnails[8106721] = clik.newPhoto({"id":8106721,"src":"2011-07-08_181.32.39a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8106721.html","width":130,"caption":"= NECKLACE = ","height":98});
															thumbnails[8106722] = clik.newPhoto({"id":8106722,"src":"2011-07-08_181.34.50a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8106722.html","width":130,"caption":"= NECKLACE =","height":98});
															thumbnails[8106726] = clik.newPhoto({"id":8106726,"src":"2011-07-08_181.41.10a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8106726.html","width":130,"caption":"= NECKLACE =","height":98});
															thumbnails[8106757] = clik.newPhoto({"id":8106757,"src":"2011-07-08_18.43.24a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8106757.html","width":130,"caption":"= 3D HEART =","height":99});
															thumbnails[8137811] = clik.newPhoto({"id":8137811,"src":"2011-06-19_18.34.23a_2552ECC2-1E4F-37DC-715C2C9FD1FDB9E5_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8137811.html","width":130,"caption":"= SNOWBALL =","height":102});
															thumbnails[8138073] = clik.newPhoto({"id":8138073,"src":"DSCN4797a_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_8138073.html","width":130,"caption":"=REDHEAD=","height":188});
															thumbnails[8138076] = clik.newPhoto({"id":8138076,"src":"DSCN4803a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138076.html","width":130,"caption":"= BLUE  WAVE =","height":138});
															thumbnails[8138081] = clik.newPhoto({"id":8138081,"src":"DSCN4814a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138081.html","width":130,"caption":"= BLUE  WAVE =","height":98});
															thumbnails[8138105] = clik.newPhoto({"id":8138105,"src":"DSCN4819a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138105.html","width":130,"caption":"= DOUBLE  WAVE =","height":106});
															thumbnails[8138109] = clik.newPhoto({"id":8138109,"src":"DSCN4823a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138109.html","width":130,"caption":"= DOUBLE  WAVE =","height":98});
															thumbnails[8138112] = clik.newPhoto({"id":8138112,"src":"DSCN4826a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138112.html","width":130,"caption":"=SPRING=","height":99});
															thumbnails[8138114] = clik.newPhoto({"id":8138114,"src":"DSCN4833a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138114.html","width":130,"caption":"=AUTUMN=","height":83});
															thumbnails[8138117] = clik.newPhoto({"id":8138117,"src":"DSCN4838a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138117.html","width":130,"caption":"=SUMMER=","height":98});
															thumbnails[8138125] = clik.newPhoto({"id":8138125,"src":"DSCN4841a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138125.html","width":130,"caption":"=WINTER=","height":98});
															thumbnails[8138126] = clik.newPhoto({"id":8138126,"src":"DSCN4845a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138126.html","width":130,"caption":"=MOVEMENT=","height":173});
															thumbnails[8138138] = clik.newPhoto({"id":8138138,"src":"DSCN4851a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138138.html","width":130,"caption":"=NECKLACE=","height":101});
															thumbnails[8138145] = clik.newPhoto({"id":8138145,"src":"DSCN4867a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8138145.html","width":130,"caption":"= WEDDING RING = ","height":108});
															thumbnails[8138150] = clik.newPhoto({"id":8138150,"src":"DSCN4880a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8138150.html","width":130,"caption":"= SEA SHELL =","height":118});
															thumbnails[8138178] = clik.newPhoto({"id":8138178,"src":"DSCN4858a_thumb.jpg","galleries_id":435202,"server_id":32,"link":"photo_8138178.html","width":130,"caption":"=NECKLACE=","height":126});
															thumbnails[8142350] = clik.newPhoto({"id":8142350,"src":"2011-07-14_17.02.50a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8142350.html","width":130,"caption":"= LOOP =","height":96});
															thumbnails[8142351] = clik.newPhoto({"id":8142351,"src":"2011-07-14_17.04.57a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8142351.html","width":130,"caption":"= PENDANT =","height":96});
															thumbnails[8508707] = clik.newPhoto({"id":8508707,"src":"scan400dpi_15_9_11-1a_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_8508707.html","width":130,"caption":"=VISION=","height":174});
															thumbnails[8771864] = clik.newPhoto({"id":8771864,"src":"2011-10-04_15.30.02a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771864.html","width":130,"caption":"= FLOWER PENDANT =","height":105});
															thumbnails[8771865] = clik.newPhoto({"id":8771865,"src":"2011-11-14_10.08.03a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771865.html","width":130,"caption":"= RED CAMPANULA =","height":98});
															thumbnails[8771868] = clik.newPhoto({"id":8771868,"src":"2011-11-14_101.11.12a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771868.html","width":130,"caption":"= BLUE CAMPANULA =","height":98});
															thumbnails[8771869] = clik.newPhoto({"id":8771869,"src":"2011-11-14_101.12.27a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771869.html","width":130,"caption":"= GREEN CAPANULA =","height":113});
															thumbnails[8771874] = clik.newPhoto({"id":8771874,"src":"2011-11-14_101.29.47a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771874.html","width":130,"caption":"= NECKLACE = ","height":90});
															thumbnails[8771875] = clik.newPhoto({"id":8771875,"src":"2011-11-14_101.15.52a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771875.html","width":130,"caption":"= SNOWFLAKE  BROOCH =","height":98});
															thumbnails[8771883] = clik.newPhoto({"id":8771883,"src":"2011-11-14_101.21.43a_thumb.jpg","galleries_id":133461,"server_id":32,"link":"photo_8771883.html","width":130,"caption":"= HEART  CHARM =","height":94});
															thumbnails[9036174] = clik.newPhoto({"id":9036174,"src":"2012-01-18_13.19.36a_thumb.jpg","galleries_id":144779,"server_id":32,"link":"photo_9036174.html","width":130,"caption":"=GET OUT OF MY FACE=","height":179});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  							galleries[133461] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"BESPOKE JEWELLERY","link":"photo_8106720.html","maxRecords":0.0,"photoIDs":[8106720.0,8106721.0,8106722.0,8106726.0,8106757.0,8137811.0,8138145.0,8138150.0,8142350.0,8142351.0,8771864.0,8771865.0,8771868.0,8771869.0,8771874.0,8771875.0,8771883.0],"skipIndex":true,"section_code":"gallery","featured_images":8771875.0,"id":133461,"singleSection":false});				  							galleries[435202] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SCHOOL WORK","link":"photo_8138076.html","maxRecords":0.0,"photoIDs":[8138076.0,8138081.0,8138105.0,8138109.0,8138112.0,8138114.0,8138117.0,8138125.0,8138126.0,8138138.0,8138178.0],"skipIndex":true,"section_code":"gallery","featured_images":"8138178,8138138,8138126,8138125,8138117,8138114,8138112,8138109,8138105,8138081","id":435202,"singleSection":false});				  							galleries[144781] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"JEWELLERY DESIGN","link":"photo_3074202.html","maxRecords":0.0,"photoIDs":[3074202.0,3074213.0,3074214.0,3074233.0,3074251.0,3074261.0,3074263.0,3074265.0,5740725.0,5740729.0],"skipIndex":true,"section_code":"gallery","featured_images":3074213.0,"id":144781,"singleSection":false});				  							galleries[144779] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"DRAWINGS ","link":"photo_3074269.html","maxRecords":0.0,"photoIDs":[3074269.0,3074271.0,3074272.0,3074275.0,3074276.0,3074277.0,3074279.0,5740719.0,5740722.0,8138073.0,8508707.0,9036174.0],"skipIndex":true,"section_code":"gallery","featured_images":9036174.0,"id":144779,"singleSection":false});				  							galleries[450007] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ABOUT","link":"photo_7234216.html","maxRecords":0.0,"photoIDs":[7234216.0],"skipIndex":true,"section_code":"gallery","featured_images":7234216.0,"id":450007,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8771879';
imageSets[2] = '9036174,8771875,8138124,3074213';
imageSets[3] = '8106721';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/LenkaKruse/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/LenkaKruse/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 || photos || {})[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 = 'Lenaurum             ';
			    }
        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.item_price !== '') {
			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;
	}
}

			

