window.thumbnails = {};
															thumbnails[2348007] = clik.newPhoto({"id":2348007,"src":"bw camera_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348007.html","width":130,"caption":"","height":87});
															thumbnails[2351205] = clik.newPhoto({"id":2351205,"src":"col ferg_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351205.html","width":130,"caption":"","height":204});
															thumbnails[2368900] = clik.newPhoto({"id":2368900,"src":"IMG_5569tr1_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368900.html","width":130,"caption":"","height":87});
															thumbnails[2347955] = clik.newPhoto({"id":2347955,"src":"b iz bear_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347955.html","width":130,"caption":"","height":79});
															thumbnails[2347999] = clik.newPhoto({"id":2347999,"src":"bw bum_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2347999.html","width":130,"caption":"","height":130});
															thumbnails[2368905] = clik.newPhoto({"id":2368905,"src":"IMG_5583tr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368905.html","width":130,"caption":"","height":87});
															thumbnails[2347981] = clik.newPhoto({"id":2347981,"src":"bw arch_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347981.html","width":130,"caption":"","height":92});
															thumbnails[2350192] = clik.newPhoto({"id":2350192,"src":"jenny-front-col-port_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2350192.html","width":130,"caption":"","height":87});
															thumbnails[2368903] = clik.newPhoto({"id":2368903,"src":"IMG_5581atr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368903.html","width":130,"caption":"","height":88});
															thumbnails[2348019] = clik.newPhoto({"id":2348019,"src":"bw iz scr_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348019.html","width":130,"caption":"","height":87});
															thumbnails[2351202] = clik.newPhoto({"id":2351202,"src":"col eva fel1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351202.html","width":130,"caption":"","height":195});
															thumbnails[2368907] = clik.newPhoto({"id":2368907,"src":"IMG_5605atr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368907.html","width":130,"caption":"","height":59});
															thumbnails[2348011] = clik.newPhoto({"id":2348011,"src":"bw evie_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348011.html","width":130,"caption":"","height":91});
															thumbnails[2348059] = clik.newPhoto({"id":2348059,"src":"col bump_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348059.html","width":130,"caption":"","height":74});
															thumbnails[2368910] = clik.newPhoto({"id":2368910,"src":"IMG_5652tr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368910.html","width":130,"caption":"","height":192});
															thumbnails[2348064] = clik.newPhoto({"id":2348064,"src":"col ev fel bil iz_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348064.html","width":130,"caption":"","height":87});
															thumbnails[2351191] = clik.newPhoto({"id":2351191,"src":"bw rog max1_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2351191.html","width":130,"caption":"","height":168});
															thumbnails[2368930] = clik.newPhoto({"id":2368930,"src":"IMG_5606tr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368930.html","width":130,"caption":"","height":63});
															thumbnails[2348138] = clik.newPhoto({"id":2348138,"src":"col mil chaire_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348138.html","width":130,"caption":"","height":87});
															thumbnails[2351189] = clik.newPhoto({"id":2351189,"src":"bw jules george1_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2351189.html","width":130,"caption":"","height":176});
															thumbnails[2368933] = clik.newPhoto({"id":2368933,"src":"tr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368933.html","width":130,"caption":"","height":59});
															thumbnails[2347975] = clik.newPhoto({"id":2347975,"src":"b iz bunches_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347975.html","width":130,"caption":"","height":87});
															thumbnails[2368938] = clik.newPhoto({"id":2368938,"src":"IMG_5671tr_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368938.html","width":130,"caption":"","height":188});
															thumbnails[2351118] = clik.newPhoto({"id":2351118,"src":"b jake1_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2351118.html","width":130,"caption":"","height":195});
															thumbnails[2369031] = clik.newPhoto({"id":2369031,"src":"CNV00009_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369031.html","width":130,"caption":"Malecon, Havana, Cuba","height":58});
															thumbnails[3207420] = clik.newPhoto({"id":3207420,"src":"three ferretts few pigs web_thumb.jpg","galleries_id":196023,"server_id":32,"link":"photo_3207420.html","width":130,"caption":"King Bladud's Pigs in Bath","height":98});
															thumbnails[2347984] = clik.newPhoto({"id":2347984,"src":"bw blacks_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347984.html","width":130,"caption":"","height":76});
															thumbnails[2348075] = clik.newPhoto({"id":2348075,"src":"col fi sam john rub_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348075.html","width":130,"caption":"","height":87});
															thumbnails[2369034] = clik.newPhoto({"id":2369034,"src":"CNV00011_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369034.html","width":130,"caption":"Malecon, Havana, Cuba","height":54});
															thumbnails[2348026] = clik.newPhoto({"id":2348026,"src":"bw kerrs_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348026.html","width":130,"caption":"","height":77});
															thumbnails[2350064] = clik.newPhoto({"id":2350064,"src":"col niam sofa_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2350064.html","width":130,"caption":"","height":65});
															thumbnails[2351184] = clik.newPhoto({"id":2351184,"src":"bw bump1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351184.html","width":130,"caption":"","height":193});
															thumbnails[2369033] = clik.newPhoto({"id":2369033,"src":"CNV00010_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369033.html","width":130,"caption":"Malecon, Havana, Cuba","height":54});
															thumbnails[2348136] = clik.newPhoto({"id":2348136,"src":"col Jenna birthday wish_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348136.html","width":130,"caption":"","height":87});
															thumbnails[2351219] = clik.newPhoto({"id":2351219,"src":"izzy-front-bw-port1_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2351219.html","width":130,"caption":"","height":181});
															thumbnails[2369028] = clik.newPhoto({"id":2369028,"src":"CNV00008_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369028.html","width":130,"caption":"Malecon, Havana<br>\r\n","height":53});
															thumbnails[2348034] = clik.newPhoto({"id":2348034,"src":"bw ollie_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348034.html","width":130,"caption":"","height":96});
															thumbnails[2351203] = clik.newPhoto({"id":2351203,"src":"col evie fer1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351203.html","width":130,"caption":"","height":201});
															thumbnails[2369044] = clik.newPhoto({"id":2369044,"src":"CNV00017_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369044.html","width":130,"caption":"Havana, Cuba","height":56});
															thumbnails[2348009] = clik.newPhoto({"id":2348009,"src":"bw charl_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348009.html","width":130,"caption":"","height":130});
															thumbnails[2369048] = clik.newPhoto({"id":2369048,"src":"CNV00019_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369048.html","width":130,"caption":"Antigua, Guatemala","height":49});
															thumbnails[2348018] = clik.newPhoto({"id":2348018,"src":"bw hands_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348018.html","width":130,"caption":"","height":130});
															thumbnails[2348088] = clik.newPhoto({"id":2348088,"src":"col iz billy_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348088.html","width":130,"caption":"","height":87});
															thumbnails[2369041] = clik.newPhoto({"id":2369041,"src":"CNV00015_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369041.html","width":130,"caption":"Belize","height":51});
															thumbnails[2348054] = clik.newPhoto({"id":2348054,"src":"c tear_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348054.html","width":130,"caption":"","height":88});
															thumbnails[2351190] = clik.newPhoto({"id":2351190,"src":"bw max1_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2351190.html","width":130,"caption":"","height":165});
															thumbnails[2351208] = clik.newPhoto({"id":2351208,"src":"col iz mil street1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351208.html","width":130,"caption":"","height":199});
															thumbnails[2369002] = clik.newPhoto({"id":2369002,"src":"CNV00005a_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369002.html","width":130,"caption":"Sossusvlei, Namibia","height":53});
															thumbnails[2348084] = clik.newPhoto({"id":2348084,"src":"col first kiss_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348084.html","width":130,"caption":"","height":130});
															thumbnails[2369026] = clik.newPhoto({"id":2369026,"src":"CNV00007_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369026.html","width":130,"caption":"Table Mountain, Cape Town","height":66});
															thumbnails[2368995] = clik.newPhoto({"id":2368995,"src":"CNV00001_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368995.html","width":130,"caption":"On Safari, South Africa","height":161});
															thumbnails[2368999] = clik.newPhoto({"id":2368999,"src":"CNV00003_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2368999.html","width":130,"caption":"Havana, Cuba","height":93});
															thumbnails[2369043] = clik.newPhoto({"id":2369043,"src":"CNV00016_thumb.jpg","galleries_id":152995,"server_id":32,"link":"photo_2369043.html","width":130,"caption":"Havana, Cuba","height":182});
															thumbnails[2350090] = clik.newPhoto({"id":2350090,"src":"col george1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2350090.html","width":130,"caption":"","height":80});
															thumbnails[2347978] = clik.newPhoto({"id":2347978,"src":"b steps_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347978.html","width":130,"caption":"","height":89});
															thumbnails[2347973] = clik.newPhoto({"id":2347973,"src":"b iz biscuit_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347973.html","width":130,"caption":"","height":101});
															thumbnails[2348140] = clik.newPhoto({"id":2348140,"src":"col mil glasses_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348140.html","width":130,"caption":"","height":87});
															thumbnails[2348093] = clik.newPhoto({"id":2348093,"src":"col iz scr ball_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348093.html","width":130,"caption":"","height":82});
															thumbnails[2348012] = clik.newPhoto({"id":2348012,"src":"bw george_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2348012.html","width":130,"caption":"","height":89});
															thumbnails[2348133] = clik.newPhoto({"id":2348133,"src":"col jake_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2348133.html","width":130,"caption":"","height":87});
															thumbnails[2350066] = clik.newPhoto({"id":2350066,"src":"col niamh hat_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2350066.html","width":130,"caption":"","height":87});
															thumbnails[2345767] = clik.newPhoto({"id":2345767,"src":"france-kids-homepage-cover2_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2345767.html","width":130,"caption":"","height":89});
															thumbnails[2351217] = clik.newPhoto({"id":2351217,"src":"col scr iz1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351217.html","width":130,"caption":"","height":195});
															thumbnails[2351210] = clik.newPhoto({"id":2351210,"src":"col mil wall1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351210.html","width":130,"caption":"","height":195});
															thumbnails[2351199] = clik.newPhoto({"id":2351199,"src":"c pool1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351199.html","width":130,"caption":"","height":195});
															thumbnails[2347979] = clik.newPhoto({"id":2347979,"src":"bw ali ferg_thumb.jpg","galleries_id":152993,"server_id":32,"link":"photo_2347979.html","width":130,"caption":"","height":89});
															thumbnails[2350100] = clik.newPhoto({"id":2350100,"src":"col p barn feet_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2350100.html","width":130,"caption":"","height":130});
															thumbnails[2351207] = clik.newPhoto({"id":2351207,"src":"col finn1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351207.html","width":130,"caption":"","height":213});
															thumbnails[2351201] = clik.newPhoto({"id":2351201,"src":"co millie hat1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351201.html","width":130,"caption":"","height":195});
															thumbnails[2351216] = clik.newPhoto({"id":2351216,"src":"col niamh infront door_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351216.html","width":130,"caption":"","height":195});
															thumbnails[2351218] = clik.newPhoto({"id":2351218,"src":"col stripes_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351218.html","width":130,"caption":"","height":195});
															thumbnails[2351192] = clik.newPhoto({"id":2351192,"src":"c niam foot1_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2351192.html","width":130,"caption":"","height":195});
															thumbnails[2368897] = clik.newPhoto({"id":2368897,"src":"CNV00019acolkid_thumb.jpg","galleries_id":152994,"server_id":32,"link":"photo_2368897.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[152993] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTRAITS - B&W","link":"section195219_152993.html","maxRecords":0.0,"photoIDs":[2348007.0,2347955.0,2347981.0,2348019.0,2348011.0,2351191.0,2351189.0,2347975.0,2351118.0,2347984.0,2348026.0,2351219.0,2348034.0,2348009.0,2348018.0,2351190.0,2347978.0,2347973.0,2348012.0,2347979.0],"skipIndex":0,"section_code":"section195219","featured_images":2351219.0,"id":152993,"singleSection":false});				  						galleries[152994] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTRAITS - Colour","link":"section195219_152994.html","maxRecords":0.0,"photoIDs":[2351205.0,2347999.0,2350192.0,2351202.0,2348059.0,2348064.0,2348138.0,2348075.0,2350064.0,2351184.0,2348136.0,2351203.0,2348088.0,2348054.0,2351208.0,2348084.0,2350090.0,2348140.0,2348093.0,2348133.0,2350066.0,2345767.0,2351217.0,2351210.0,2351199.0,2350100.0,2351207.0,2351201.0,2351216.0,2351218.0,2351192.0,2368897.0],"skipIndex":0,"section_code":"section195219","featured_images":2351203.0,"id":152994,"singleSection":false});				  						galleries[152995] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"TRAVEL","link":"section195219_152995.html","maxRecords":0.0,"photoIDs":[2368900.0,2368905.0,2368903.0,2368907.0,2368910.0,2368930.0,2368933.0,2368938.0,2369031.0,2369034.0,2369033.0,2369028.0,2369044.0,2369048.0,2369041.0,2369002.0,2369026.0,2368995.0,2368999.0,2369043.0],"skipIndex":0,"section_code":"section195219","featured_images":2368938.0,"id":152995,"singleSection":false});				  						galleries[196023] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"COLLAGE","link":"section195219_196023.html","maxRecords":0.0,"photoIDs":[3207420.0],"skipIndex":0,"section_code":"section195219","featured_images":3207420.0,"id":196023,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2345767';
imageSets[2] = '2368938,3207420,2351219,2351203';
imageSets[3] = '3207420,2369048,2369044,2369043,2369041,2369034,2369033,2369031,2369028,2369026,2369002,2368999,2368995,2368938,2368933,2368930,2368910,2368907,2368905,2368903,2368900,2368897,2351219,2351218,2351217,2351216,2351210,2351208,2351207,2351205,2351203,2351202,2351201,2351199,2351192,2351191,2351190,2351189,2351184,2351118,2350192,2350100,2350090,2350066,2350064,2348140,2348138,2348136,2348133,2348093';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/vferrett/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/vferrett/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/vferrett/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/vferrett/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/vferrett/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/vferrett/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/vferrett/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 += 'section195219.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 && 'section195219' != '') {
					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 = 'Vanessa    Ferrett    Photography: ' + 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 !== '' || 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;
	}
}

			

