window.thumbnails = {};
															thumbnails[6085042] = clik.newPhoto({"id":6085042,"src":"falkirk_wheel_2WEB1_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_6085042.html","width":130,"caption":"Steamotion","height":130});
															thumbnails[6085658] = clik.newPhoto({"id":6085658,"src":"kingdomWEB_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_6085658.html","width":130,"caption":"Kingdom","height":130});
															thumbnails[6085680] = clik.newPhoto({"id":6085680,"src":"stake_netsWEB_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_6085680.html","width":130,"caption":"Stake Nets","height":130});
															thumbnails[7136194] = clik.newPhoto({"id":7136194,"src":"queens_view_WEB_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_7136194.html","width":130,"caption":"Queen's View","height":130});
															thumbnails[6085668] = clik.newPhoto({"id":6085668,"src":"sennan_coveWEB_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_6085668.html","width":130,"caption":"Sennen Cove","height":130});
															thumbnails[6085653] = clik.newPhoto({"id":6085653,"src":"feasting_shadows_newWEB_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_6085653.html","width":130,"caption":"Feasting Shadows","height":130});
															thumbnails[7885056] = clik.newPhoto({"id":7885056,"src":"depicture_WEB_thumb.JPG","galleries_id":341003,"server_id":32,"link":"photo_7885056.html","width":130,"caption":"Depicture","height":130});
															thumbnails[7684118] = clik.newPhoto({"id":7684118,"src":"meridian_shallows_WEB_thumb.JPG","galleries_id":341003,"server_id":32,"link":"photo_7684118.html","width":130,"caption":"Meridian Shallows","height":130});
															thumbnails[7282079] = clik.newPhoto({"id":7282079,"src":"wonderland_WEB_thumb.jpg","galleries_id":341003,"server_id":32,"link":"photo_7282079.html","width":130,"caption":"Root and Branch","height":130});
															thumbnails[6084661] = clik.newPhoto({"id":6084661,"src":"salvation_bluesWEB12_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084661.html","width":130,"caption":"Salvation Blues","height":130});
															thumbnails[7716550] = clik.newPhoto({"id":7716550,"src":"tobermory_WEB1_thumb.JPG","galleries_id":341003,"server_id":32,"link":"photo_7716550.html","width":130,"caption":"Tobermory Panorama","height":130});
															thumbnails[8060407] = clik.newPhoto({"id":8060407,"src":"Caerbannog_WEB_thumb.JPG","galleries_id":341003,"server_id":32,"link":"photo_8060407.html","width":130,"caption":"Caerbannog","height":130});
															thumbnails[6929873] = clik.newPhoto({"id":6929873,"src":"the_black_sands_of_scotland_2_WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6929873.html","width":130,"caption":"The Black Sands of Scotland","height":130});
															thumbnails[6990294] = clik.newPhoto({"id":6990294,"src":"the_eight_count_WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6990294.html","width":130,"caption":"The Eight Count","height":130});
															thumbnails[6084688] = clik.newPhoto({"id":6084688,"src":"ghost_repeater_bluesWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084688.html","width":130,"caption":"Old Dolo Blues","height":130});
															thumbnails[6084702] = clik.newPhoto({"id":6084702,"src":"onceWEB1_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084702.html","width":130,"caption":"Once","height":130});
															thumbnails[6084716] = clik.newPhoto({"id":6084716,"src":"trading_day_bluesWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084716.html","width":130,"caption":"Trading Day","height":130});
															thumbnails[6705364] = clik.newPhoto({"id":6705364,"src":"gravity_gate_WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6705364.html","width":130,"caption":"Bruar Falls","height":130});
															thumbnails[6215202] = clik.newPhoto({"id":6215202,"src":"the_melancholy_tidesWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6215202.html","width":130,"caption":"The Melancholy Tides","height":130});
															thumbnails[6085667] = clik.newPhoto({"id":6085667,"src":"reverieWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085667.html","width":130,"caption":"Reverie","height":130});
															thumbnails[7500025] = clik.newPhoto({"id":7500025,"src":"the_rabbit_hat_WEB_thumb.JPG","galleries_id":341002,"server_id":32,"link":"photo_7500025.html","width":130,"caption":"The Rabbit Hat Trick","height":130});
															thumbnails[6085682] = clik.newPhoto({"id":6085682,"src":"the_last_lineWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085682.html","width":130,"caption":"The Last Line","height":130});
															thumbnails[6085633] = clik.newPhoto({"id":6085633,"src":"echoesWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085633.html","width":130,"caption":"Echoes","height":130});
															thumbnails[6085649] = clik.newPhoto({"id":6085649,"src":"cramond_isleWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085649.html","width":130,"caption":"The Thin Red Line","height":130});
															thumbnails[6084701] = clik.newPhoto({"id":6084701,"src":"of_an_unseen_ocean_and_the_new_day_bluesWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084701.html","width":130,"caption":"Quietus","height":130});
															thumbnails[6084700] = clik.newPhoto({"id":6084700,"src":"night_comes_falling_from_the_skyWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084700.html","width":130,"caption":"Night Comes Falling","height":130});
															thumbnails[6085627] = clik.newPhoto({"id":6085627,"src":"snakes_and_laddersWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085627.html","width":130,"caption":"Snakes and Ladders","height":130});
															thumbnails[6085660] = clik.newPhoto({"id":6085660,"src":"lostWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085660.html","width":130,"caption":"Lost","height":130});
															thumbnails[6085656] = clik.newPhoto({"id":6085656,"src":"Hush_2WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085656.html","width":130,"caption":"Hush","height":130});
															thumbnails[6085665] = clik.newPhoto({"id":6085665,"src":"regard_the_endWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085665.html","width":130,"caption":"Regard The End","height":130});
															thumbnails[6084692] = clik.newPhoto({"id":6084692,"src":"trawlermans_blues_WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084692.html","width":130,"caption":"Trawlerman's Blues","height":130});
															thumbnails[6085048] = clik.newPhoto({"id":6085048,"src":"witnessWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085048.html","width":130,"caption":"Witness","height":130});
															thumbnails[6084710] = clik.newPhoto({"id":6084710,"src":"the_blues_of_brokenheart_bayWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084710.html","width":130,"caption":"The Blues of Brokenheart Bay","height":130});
															thumbnails[6085039] = clik.newPhoto({"id":6085039,"src":"dwarfedWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085039.html","width":130,"caption":"The Other Place","height":130});
															thumbnails[6084699] = clik.newPhoto({"id":6084699,"src":"labrosones_bluesWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084699.html","width":130,"caption":"Labrosones Blues","height":130});
															thumbnails[6951477] = clik.newPhoto({"id":6951477,"src":"hunters_WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6951477.html","width":130,"caption":"Hunters","height":130});
															thumbnails[6084712] = clik.newPhoto({"id":6084712,"src":"the_quivering_shoreWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084712.html","width":130,"caption":"The Quivering Shore","height":130});
															thumbnails[6253910] = clik.newPhoto({"id":6253910,"src":"tantallon_harbour_WEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6253910.html","width":130,"caption":"The Ballad of Squire Douglas Scoughall","height":130});
															thumbnails[6085661] = clik.newPhoto({"id":6085661,"src":"passing_silenceWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6085661.html","width":130,"caption":"Passing Silence","height":130});
															thumbnails[6084671] = clik.newPhoto({"id":6084671,"src":"blood_steamWEB_thumb.jpg","galleries_id":341002,"server_id":32,"link":"photo_6084671.html","width":130,"caption":"Blood Stream","height":130});
															thumbnails[8017036] = clik.newPhoto({"id":8017036,"src":"gloom_WEB_thumb.JPG","galleries_id":341002,"server_id":32,"link":"photo_8017036.html","width":130,"caption":"Gloom","height":130});
															thumbnails[7681301] = clik.newPhoto({"id":7681301,"src":"slide_WEB_thumb.JPG","galleries_id":341002,"server_id":32,"link":"photo_7681301.html","width":130,"caption":"Slide","height":130});
															thumbnails[9087778] = clik.newPhoto({"id":9087778,"src":"motion_capture_LARGE_THUMB_1.jpg","galleries_id":347750,"server_id":35,"link":"photo_9087778.html","width":130,"caption":"Motion Capture","height":130});
															thumbnails[9047364] = clik.newPhoto({"id":9047364,"src":"the_ascent_WEB1_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_9047364.html","width":130,"caption":"The Ascent","height":130});
															thumbnails[9028284] = clik.newPhoto({"id":9028284,"src":"amethystine_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_9028284.html","width":130,"caption":"Amethystine","height":130});
															thumbnails[9027007] = clik.newPhoto({"id":9027007,"src":"third_frost_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_9027007.html","width":130,"caption":"Third Frost","height":130});
															thumbnails[8993518] = clik.newPhoto({"id":8993518,"src":"the_wreckage_part_1_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8993518.html","width":130,"caption":"The Wreckage, Part 1","height":130});
															thumbnails[8923814] = clik.newPhoto({"id":8923814,"src":"st_monans_drift_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8923814.html","width":130,"caption":"St. Monan's Drift","height":130});
															thumbnails[8921970] = clik.newPhoto({"id":8921970,"src":"winters_pass_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8921970.html","width":130,"caption":"Winter's Pass","height":130});
															thumbnails[8790616] = clik.newPhoto({"id":8790616,"src":"a_study_in_contrast_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8790616.html","width":130,"caption":"A Study in Contrast","height":130});
															thumbnails[8774511] = clik.newPhoto({"id":8774511,"src":"to_autumn_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8774511.html","width":130,"caption":"To Autumn","height":130});
															thumbnails[8707185] = clik.newPhoto({"id":8707185,"src":"life_in_the_woods_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8707185.html","width":130,"caption":"Life in The Woods","height":130});
															thumbnails[8700748] = clik.newPhoto({"id":8700748,"src":"mirror_mirror_2_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8700748.html","width":130,"caption":"Mirror : rorriM","height":130});
															thumbnails[8701135] = clik.newPhoto({"id":8701135,"src":"inception_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8701135.html","width":130,"caption":"Inception","height":130});
															thumbnails[8640708] = clik.newPhoto({"id":8640708,"src":"the_valley_filled_with_shadows_WEB1_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8640708.html","width":130,"caption":"The Valley Filled With Shadows","height":130});
															thumbnails[8178186] = clik.newPhoto({"id":8178186,"src":"minus_one_WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8178186.html","width":130,"caption":"The Boy","height":130});
															thumbnails[8238704] = clik.newPhoto({"id":8238704,"src":"ode_WEB12_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8238704.html","width":130,"caption":"Ode","height":130});
															thumbnails[8411572] = clik.newPhoto({"id":8411572,"src":"tay_bridge_WEB_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8411572.html","width":130,"caption":"Superelevation","height":130});
															thumbnails[8426465] = clik.newPhoto({"id":8426465,"src":"coriolanus_WEB1_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8426465.html","width":130,"caption":"Coriolanus","height":130});
															thumbnails[8433075] = clik.newPhoto({"id":8433075,"src":"time_out_of_mind_WEB_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8433075.html","width":130,"caption":"Time Out of Mind","height":130});
															thumbnails[8412214] = clik.newPhoto({"id":8412214,"src":"the_solemn_decorations_WEB_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8412214.html","width":130,"caption":"The Solemn Decorations","height":130});
															thumbnails[8177972] = clik.newPhoto({"id":8177972,"src":"glenshee-WEB_thumb.jpg","galleries_id":347750,"server_id":32,"link":"photo_8177972.html","width":130,"caption":"Hithaeglir","height":130});
															thumbnails[8416638] = clik.newPhoto({"id":8416638,"src":"skateraw_WEB_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8416638.html","width":130,"caption":"Skateraw","height":130});
															thumbnails[8411621] = clik.newPhoto({"id":8411621,"src":"bow_fiddle_rock_WEB_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8411621.html","width":130,"caption":"Bow Fiddle Rock","height":130});
															thumbnails[8178405] = clik.newPhoto({"id":8178405,"src":"st_abbs_lifeboat_WEB_thumb.JPG","galleries_id":347750,"server_id":32,"link":"photo_8178405.html","width":130,"caption":"St. Abbs RNLI Lifeboat Station","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[341002] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"poetographs","link":"gallery_341002.html","maxRecords":0.0,"photoIDs":[6084661.0,6929873.0,6990294.0,6084688.0,6084702.0,6084716.0,6705364.0,6215202.0,6085667.0,7500025.0,6085682.0,6085633.0,6085649.0,6084701.0,6084700.0,6085627.0,6085660.0,6085656.0,6085665.0,6084692.0,6085048.0,6084710.0,6085039.0,6084699.0,6951477.0,6084712.0,6253910.0,6085661.0,6084671.0,8017036.0,7681301.0],"skipIndex":0,"section_code":"gallery","featured_images":6084661.0,"id":341002,"singleSection":false});				  						galleries[341003] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"quotographs","link":"gallery_341003.html","maxRecords":0.0,"photoIDs":[6085042.0,6085658.0,6085680.0,7136194.0,6085668.0,6085653.0,7885056.0,7684118.0,7282079.0,7716550.0,8060407.0],"skipIndex":0,"section_code":"gallery","featured_images":6085042.0,"id":341003,"singleSection":false});				  						galleries[347750] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"latest","link":"gallery_347750.html","maxRecords":0.0,"photoIDs":[9087778.0,9047364.0,9028284.0,9027007.0,8993518.0,8923814.0,8921970.0,8790616.0,8774511.0,8707185.0,8700748.0,8701135.0,8640708.0,8178186.0,8238704.0,8411572.0,8426465.0,8433075.0,8412214.0,8177972.0,8416638.0,8411621.0,8178405.0],"skipIndex":0,"section_code":"gallery","featured_images":9087778.0,"id":347750,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6084661';
imageSets[2] = '6085042,6084661,9087778';
imageSets[3] = '6085633,6085661';
imageSets[244065] = '6084661,6929873,6990294,6084688,6084702,6084716,6705364,6215202,6085667,7500025,6085682,6085633,6085649,6084701,6084700,6085627,6085660,6085656,6085665,6084692,6085048,6084710,6085039,6084699,6951477,6084712,6253910,6084671,8017036,7681301,9027007,8921970';
imageSets[244066] = '6085042,6085658,6085680,7136194,6085668,6085653,7885056,7684118,7282079,8060407,7716550,9047364,9028284,8993518,8923814,8790616,8774511,8707185,8700748,8701135,8640708,8178186,8238704,8411572,8426465,8433075,8412214,8177972,8416638,8411621,8178405';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/monophotography/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/monophotography/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/monophotography/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/monophotography/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/monophotography/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/monophotography/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/monophotography/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/monophotography/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 = 'Black & White Mono Photography by Donald Cameron: ' + 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.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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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>&nbsp;</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="MONOPHOTOGRAPHY">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

