window.thumbnails = {};
															thumbnails[1859116] = clik.newPhoto({"id":1859116,"src":"Eyecon1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Eyecon - set of small 10cm x 10cm famous eyes","height":128});
															thumbnails[273217] = clik.newPhoto({"id":273217,"src":"DeannaSelfPortrait1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Deanna Self Portrait","height":186});
															thumbnails[5005698] = clik.newPhoto({"id":5005698,"src":"KillerHeels_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_5005698.html","width":130,"caption":"","height":111});
															thumbnails[273335] = clik.newPhoto({"id":273335,"src":"RaggaMuffinBuju_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_273335.html","width":130,"caption":"Ragga Muffin","height":161});
															thumbnails[281776] = clik.newPhoto({"id":281776,"src":"Primavera_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_281776.html","width":130,"caption":"Primavera","height":114});
															thumbnails[7659311] = clik.newPhoto({"id":7659311,"src":"HarryPatch_thumb.jpg","galleries_id":23181,"server_id":1,"link":"photo_7659311.html","width":130,"caption":"Harry Patch","height":161});
															thumbnails[818462] = clik.newPhoto({"id":818462,"src":"HughMasakela_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_818462.html","width":130,"caption":"Hugh Masekela","height":130});
															thumbnails[671643] = clik.newPhoto({"id":671643,"src":"neworleansrizinback_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_671643.html","width":130,"caption":"New Orleans Rizin","height":149});
															thumbnails[282079] = clik.newPhoto({"id":282079,"src":"BotticelliBoys1_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_282079.html","width":130,"caption":"Botticelli Boys","height":114});
															thumbnails[7659313] = clik.newPhoto({"id":7659313,"src":"DivingintotheBlue_thumb.jpg","galleries_id":23181,"server_id":1,"link":"photo_7659313.html","width":130,"caption":"Diving into the Blue","height":189});
															thumbnails[5005691] = clik.newPhoto({"id":5005691,"src":"ArchangelMiles_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_5005691.html","width":130,"caption":"","height":157});
															thumbnails[1195881] = clik.newPhoto({"id":1195881,"src":"CalledtotheBar_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_1195881.html","width":130,"caption":"Called to the Bar","height":179});
															thumbnails[671644] = clik.newPhoto({"id":671644,"src":"neworleansrizininside_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_671644.html","width":130,"caption":"New Orleans Rizin","height":151});
															thumbnails[818469] = clik.newPhoto({"id":818469,"src":"mindthegap_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_818469.html","width":130,"caption":"Mind the Gap","height":129});
															thumbnails[7659417] = clik.newPhoto({"id":7659417,"src":"MickLeonardo_thumb.jpg","galleries_id":23181,"server_id":1,"link":"photo_7659417.html","width":130,"caption":"Mick Leonardo","height":159});
															thumbnails[281432] = clik.newPhoto({"id":281432,"src":"ColombianCarnivalOpen_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_281432.html","width":130,"caption":"Colombian Carnival","height":132});
															thumbnails[818493] = clik.newPhoto({"id":818493,"src":"mamaafrica_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_818493.html","width":130,"caption":"Mama Africa","height":130});
															thumbnails[281429] = clik.newPhoto({"id":281429,"src":"ColumbiaBack_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_281429.html","width":130,"caption":"Colombian Carnival ","height":146});
															thumbnails[273209] = clik.newPhoto({"id":273209,"src":"ThievesofBaghdadCarpet_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_273209.html","width":130,"caption":"Iraqi Prayer Mat","height":95});
															thumbnails[7659418] = clik.newPhoto({"id":7659418,"src":"Tango_thumb.jpg","galleries_id":23181,"server_id":1,"link":"photo_7659418.html","width":130,"caption":"Tango Dancers","height":162});
															thumbnails[5005692] = clik.newPhoto({"id":5005692,"src":"BaabaMaal_9D785480-1D09-001F-99C5BD57375F6DBA_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_5005692.html","width":130,"caption":"Baaba Maal","height":78});
															thumbnails[1218160] = clik.newPhoto({"id":1218160,"src":"BaabaMaal_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_1218160.html","width":130,"caption":"Baaba Maal","height":155});
															thumbnails[281766] = clik.newPhoto({"id":281766,"src":"Stoned_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_281766.html","width":130,"caption":"Stoned","height":108});
															thumbnails[7659421] = clik.newPhoto({"id":7659421,"src":"AngelROSIE_thumb.jpg","galleries_id":23181,"server_id":1,"link":"photo_7659421.html","width":130,"caption":"Guardian Angel","height":160});
															thumbnails[6044689] = clik.newPhoto({"id":6044689,"src":"Alive-and-Kicking_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_6044689.html","width":130,"caption":"Alive and Kicking","height":186});
															thumbnails[6041673] = clik.newPhoto({"id":6041673,"src":"Yes_We_Can1_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_6041673.html","width":130,"caption":"'Yes We Can'","height":104});
															thumbnails[4035996] = clik.newPhoto({"id":4035996,"src":"CostingtheEarth6_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_4035996.html","width":130,"caption":"Costing the Earth","height":89});
															thumbnails[273425] = clik.newPhoto({"id":273425,"src":"PunchingJudy1_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273425.html","width":130,"caption":"Punching Judy Kimono","height":190});
															thumbnails[6037649] = clik.newPhoto({"id":6037649,"src":"Dee_Dee_Sings_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_6037649.html","width":130,"caption":"Dee Dee Bridgewater sings Billie Holiday","height":151});
															thumbnails[7652480] = clik.newPhoto({"id":7652480,"src":"FlightfromGoma_5C6088AA-1EC9-DFB6-0929E8450CAA5C1D_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_7652480.html","width":130,"caption":"Flight from Goma","height":87});
															thumbnails[273233] = clik.newPhoto({"id":273233,"src":"Aldeburgh Front2_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273233.html","width":130,"caption":"The Aldeburgh Kimono","height":145});
															thumbnails[7652567] = clik.newPhoto({"id":7652567,"src":"CarbonFootprint_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_7652567.html","width":130,"caption":"Carbon Footprint","height":100});
															thumbnails[273239] = clik.newPhoto({"id":273239,"src":"Aldeburgh Back2_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273239.html","width":130,"caption":"The Aldeburgh Kimono","height":148});
															thumbnails[6037659] = clik.newPhoto({"id":6037659,"src":"Sings_Billiephoto_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_6037659.html","width":130,"caption":"Billie Holiday","height":142});
															thumbnails[4035984] = clik.newPhoto({"id":4035984,"src":"DRCCongoBack_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_4035984.html","width":130,"caption":"DRC Congo Kimono","height":145});
															thumbnails[4036119] = clik.newPhoto({"id":4036119,"src":"DRCCongoFront_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_4036119.html","width":130,"caption":"DRC Congo Kimono","height":143});
															thumbnails[1457586] = clik.newPhoto({"id":1457586,"src":"AliFarkaToure_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_1457586.html","width":130,"caption":"Ali Farka Toure","height":130});
															thumbnails[281799] = clik.newPhoto({"id":281799,"src":"ColoursofRagtime_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_281799.html","width":130,"caption":"Colours of Ragtime","height":86});
															thumbnails[6041650] = clik.newPhoto({"id":6041650,"src":"Jimmyweb_thumb.jpg","galleries_id":23182,"server_id":1,"link":"photo_6041650.html","width":130,"caption":"Jimmy Hendrix","height":120});
															thumbnails[1858960] = clik.newPhoto({"id":1858960,"src":"KeithRichardWallhanging_thumb.jpg","galleries_id":23180,"server_id":1,"link":"photo_1858960.html","width":130,"caption":"'Pirate of the Caribbean' - Keef","height":195});
															thumbnails[273033] = clik.newPhoto({"id":273033,"src":"Harlequin&Columbine_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273033.html","width":130,"caption":"Cirque du Soleil Kimono","height":164});
															thumbnails[273339] = clik.newPhoto({"id":273339,"src":"MyGenerationFront_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273339.html","width":130,"caption":"Talkin Bout My Generation","height":155});
															thumbnails[1858999] = clik.newPhoto({"id":1858999,"src":"KarnoWarrier_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_1858999.html","width":130,"caption":"Karno Warrier","height":129});
															thumbnails[273341] = clik.newPhoto({"id":273341,"src":"MyGenerationBack_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273341.html","width":130,"caption":".... My Generation, back","height":156});
															thumbnails[5005700] = clik.newPhoto({"id":5005700,"src":"MugabiMatDetail_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_5005700.html","width":130,"caption":"","height":195});
															thumbnails[273433] = clik.newPhoto({"id":273433,"src":"SympathyBackOpen1_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273433.html","width":130,"caption":"Sympathy for the Devil, Back","height":139});
															thumbnails[273439] = clik.newPhoto({"id":273439,"src":"SympathyDevilFront1_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273439.html","width":130,"caption":"Sympathy for the Devil","height":155});
															thumbnails[273360] = clik.newPhoto({"id":273360,"src":"HarlequinBack_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273360.html","width":130,"caption":"Cirque du Soleil Back","height":146});
															thumbnails[6042247] = clik.newPhoto({"id":6042247,"src":"Our_Lady_Detailweb1_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_6042247.html","width":130,"caption":"Detail from Our Lady of Energy Consumption","height":192});
															thumbnails[282035] = clik.newPhoto({"id":282035,"src":"SouthwoldTentPunchJudy_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_282035.html","width":130,"caption":"The Universal Bully.","height":194});
															thumbnails[6034939] = clik.newPhoto({"id":6034939,"src":"Our_Lady_of_Guadalupeweb1_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_6034939.html","width":130,"caption":"Our Lady of Energy Consumption","height":145});
															thumbnails[273184] = clik.newPhoto({"id":273184,"src":"ThievesofBaghdad_thumb.jpg","galleries_id":23183,"server_id":1,"link":"photo_273184.html","width":130,"caption":"Thieves of Baghdad","height":95});
															thumbnails[273281] = clik.newPhoto({"id":273281,"src":"AfricaUhuruFront_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273281.html","width":130,"caption":"Africa Uhuru, Front","height":168});
															thumbnails[273278] = clik.newPhoto({"id":273278,"src":"AfricaUhuruDetail_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_273278.html","width":130,"caption":"Africa Uhuru, inside detail","height":195});
															thumbnails[281451] = clik.newPhoto({"id":281451,"src":"CloseComfort_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_281451.html","width":130,"caption":"Wearing Men","height":185});
															thumbnails[1457612] = clik.newPhoto({"id":1457612,"src":"Exodus400_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_1457612.html","width":130,"caption":"Exodus 400","height":173});
															thumbnails[1457616] = clik.newPhoto({"id":1457616,"src":"Exodus400Back_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_1457616.html","width":130,"caption":"Exodus 400 Back","height":173});
															thumbnails[281418] = clik.newPhoto({"id":281418,"src":"TeaCeremonyFront_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_281418.html","width":130,"caption":"A Social History of Tea","height":139});
															thumbnails[281423] = clik.newPhoto({"id":281423,"src":"TeaCeremonyBack_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_281423.html","width":130,"caption":"A Social History of Tea","height":119});
															thumbnails[281436] = clik.newPhoto({"id":281436,"src":"LostinTransBack_thumb.jpg","galleries_id":23170,"server_id":1,"link":"photo_281436.html","width":130,"caption":"Lost in Translation","height":159});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[23170] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Kimono","link":"gallery_23170.html","maxRecords":0.0,"photoIDs":[671643.0,671644.0,281432.0,281429.0,273425.0,273233.0,273239.0,4035984.0,4036119.0,273033.0,273339.0,273341.0,273433.0,273439.0,273360.0,6042247.0,6034939.0,273281.0,273278.0,281451.0,1457612.0,1457616.0,281418.0,281423.0,281436.0],"skipIndex":0,"section_code":"gallery","featured_images":"6042247,6034939,4036119,4035984,1457616,1457612,671644,671643,281451,281436","id":23170,"singleSection":false});				  						galleries[23180] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wall Hangings","link":"gallery_23180.html","maxRecords":0.0,"photoIDs":[281776.0,282079.0,1195881.0,273209.0,281766.0,6044689.0,7652480.0,7652567.0,281799.0,1858960.0],"skipIndex":0,"section_code":"gallery","featured_images":"7652567,7652480,6044689,1858960,1195881,282079,281799,281776,281766,273209","id":23180,"singleSection":false});				  						galleries[23181] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paper & Stitch","link":"gallery_23181.html","maxRecords":0.0,"photoIDs":[7659311.0,7659313.0,7659417.0,7659418.0,7659421.0],"skipIndex":0,"section_code":"gallery","featured_images":"7659421,7659418,7659417,7659313,7659311","id":23181,"singleSection":false});				  						galleries[23182] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Woven Portraits","link":"gallery_23182.html","maxRecords":0.0,"photoIDs":[273335.0,818462.0,818469.0,818493.0,1218160.0,6041673.0,6037649.0,6037659.0,1457586.0,6041650.0],"skipIndex":0,"section_code":"gallery","featured_images":"6041673,6041650,6037659,6037649,1457586,1218160,818493,818469,818462,273335","id":23182,"singleSection":false});				  						galleries[23183] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Recent Work","link":"gallery_23183.html","maxRecords":0.0,"photoIDs":[5005698.0,5005691.0,5005692.0,4035996.0,1858999.0,5005700.0,282035.0,273184.0],"skipIndex":0,"section_code":"gallery","featured_images":"5005700,5005698,5005692,5005691,4035996,1858999,282035,273184","id":23183,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '273217';
imageSets[3] = '7659421,7659418,7659417,7659313,7659311,7652567,7652480,6044689,6042247,6041673,6041650,6037659,6037649,6034939,5005700,5005698,5005692,5005691,4036119,4035996,4035984,1859116,1858999,1858960,1457616,1457612,1457586,1218160,1195881,818493,818469,818462,671644,671643,282079,282035,281799,281776,281766,281451,281436,281432,281429,281423,281418,273439,273433,273425,273360,273341';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/deannatyson/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/deannatyson/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 = 'Deanna Tyson FRSA: ' + 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.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;
	}
}

			

