window.thumbnails = {};
															thumbnails[9037937] = clik.newPhoto({"id":9037937,"src":"resized_and_cropped_for_clic_pic_holy_island_causeway_thumb_DD33AC07-1EC9-DFB6-0948C8686827DB3C.jpg","galleries_id":267546,"server_id":18,"link":"photo_9037937.html","width":130,"caption":"The Holy Island of Lindisfarne causeway.","height":66});
															thumbnails[5297347] = clik.newPhoto({"id":5297347,"src":"farnes_acrylic_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_5297347.html","width":130,"caption":"Farne Islands","height":98});
															thumbnails[4626926] = clik.newPhoto({"id":4626926,"src":"longstone_lighthouse_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4626926.html","width":130,"caption":"longstone lighthouse. Acrylic. Image size 300mm x 300mm (Framed price £250 )","height":125});
															thumbnails[4635963] = clik.newPhoto({"id":4635963,"src":"port_logan_sunset_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4635963.html","width":130,"caption":"port logan sunset<br>\r\n(Sold)","height":47});
															thumbnails[4636335] = clik.newPhoto({"id":4636335,"src":"Cove_harbour_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4636335.html","width":130,"caption":"Cove Harbour. ( Sold )","height":98});
															thumbnails[4641451] = clik.newPhoto({"id":4641451,"src":"Rain_squall_over_Bass_Rock_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4641451.html","width":130,"caption":"Rain squall over Bass Rock. ( Sold )","height":55});
															thumbnails[4644318] = clik.newPhoto({"id":4644318,"src":"Lidisfarne_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4644318.html","width":130,"caption":"Lindisfarne Castle ( acrylic on canvas, image size 300 x 400 ) Sold","height":98});
															thumbnails[4783287] = clik.newPhoto({"id":4783287,"src":"Berwick_bay_from_Cocklawburn_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4783287.html","width":130,"caption":"Berwick bay from Cocklawburn","height":50});
															thumbnails[4818579] = clik.newPhoto({"id":4818579,"src":"bamburgh_dawn_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4818579.html","width":130,"caption":"Bamburgh dawn Acrylic on canvas 30cm x 30cm  Sold","height":129});
															thumbnails[4818592] = clik.newPhoto({"id":4818592,"src":"Holy_island_from_ross_sands_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_4818592.html","width":130,"caption":"Holy island from ross sands, passing showers.","height":63});
															thumbnails[5304544] = clik.newPhoto({"id":5304544,"src":"burnmouth_acrylic_dec_2009_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_5304544.html","width":130,"caption":"Burnmouth","height":50});
															thumbnails[5794858] = clik.newPhoto({"id":5794858,"src":"Bamburgh_watercolour_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_5794858.html","width":130,"caption":"Rain squall over Bamburgh Castle. Water colour.  ( sold )","height":61});
															thumbnails[5794874] = clik.newPhoto({"id":5794874,"src":"stmarys_island_and_lighthouse_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_5794874.html","width":130,"caption":"St Marys Island and Light House. Water soluble graphite sketch. Sold","height":88});
															thumbnails[5794882] = clik.newPhoto({"id":5794882,"src":"Maidenstone_nr_Burnmouth_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_5794882.html","width":130,"caption":"The Maidens Stone. Nr. Burnmouth. ( £120 Framed ) Watercolour on Saunders waterford paper.","height":62});
															thumbnails[6317671] = clik.newPhoto({"id":6317671,"src":"Dunstanburgh_from_Low_Newton_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_6317671.html","width":130,"caption":"Dunstanburgh Castle from Low Newton. Acrylic on Canvas 75cm x 49cm £480 Framed","height":87});
															thumbnails[6317694] = clik.newPhoto({"id":6317694,"src":"Lumburn_sheil_and_the_maidenstone_nr_Burnmouth_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_6317694.html","width":130,"caption":"Lumburn Sheil and the Maidenstone Nr Burnmouth. Watercolour on Saunders Waterford paper. 36cm x 22cm Sold","height":80});
															thumbnails[6433015] = clik.newPhoto({"id":6433015,"src":"Coquet_island_moods_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_6433015.html","width":130,"caption":"Coquet Island, atmospheric skies.  Watercolour on saunders waterford paper.  ( £120  Framed )","height":56});
															thumbnails[6817901] = clik.newPhoto({"id":6817901,"src":"Moonlight_on_Lindaisfarne_Harbour_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_6817901.html","width":130,"caption":"Moonlight on Lindisfarne #2","height":56});
															thumbnails[7001026] = clik.newPhoto({"id":7001026,"src":"dunstanburgh_reduced_resolution_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_7001026.html","width":130,"caption":"Dunstanburgh Castle From the North","height":72});
															thumbnails[7001042] = clik.newPhoto({"id":7001042,"src":"Burnmouth_sea_front_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_7001042.html","width":130,"caption":"A View of the sea defence wall and Old Lobster House at Burnmouth.","height":76});
															thumbnails[7009440] = clik.newPhoto({"id":7009440,"src":"Untitled-1The_Maiden_Stone_Nr_Burnmouth_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_7009440.html","width":130,"caption":"The Maiden Stone Nr Burnmouth","height":128});
															thumbnails[7137188] = clik.newPhoto({"id":7137188,"src":"low_res_for_web_craster12_thumb.JPG","galleries_id":267546,"server_id":18,"link":"photo_7137188.html","width":130,"caption":"A Watercolour of Craster Harbour and haven Hill.","height":98});
															thumbnails[7391509] = clik.newPhoto({"id":7391509,"src":"Longstone_light_and_Glad_tidings_v_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_7391509.html","width":130,"caption":"Farne Islands and Longstone Lighthouse.","height":87});
															thumbnails[8846197] = clik.newPhoto({"id":8846197,"src":"20111117_01_thumb.JPG","galleries_id":267546,"server_id":18,"link":"photo_8846197.html","width":130,"caption":"Lindisfarne ","height":67});
															thumbnails[8851816] = clik.newPhoto({"id":8851816,"src":"coldingham__stabbs_for_web_thumb.jpg","galleries_id":267546,"server_id":18,"link":"photo_8851816.html","width":130,"caption":"A view towards Coldingham Bay & St Abbs head.","height":64});
															thumbnails[7147152] = clik.newPhoto({"id":7147152,"src":"todhillrig_farm_in_snow_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_7147152.html","width":130,"caption":"Todhillrig Farm. Watercolour on Saunders waterford paper.","height":80});
															thumbnails[5160576] = clik.newPhoto({"id":5160576,"src":"Berwick_walls_summer_house_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5160576.html","width":130,"caption":"The summer House Near the Ness Gate on Berwick on Tweeds Famous walls.","height":95});
															thumbnails[5142303] = clik.newPhoto({"id":5142303,"src":"Ness_gate_berwick_cropped_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5142303.html","width":130,"caption":"Ness Gate Berwick on Tweed. Water soluble Graphite on Saunders waterford Paper.  Sold","height":70});
															thumbnails[4636226] = clik.newPhoto({"id":4636226,"src":"Poacher_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_4636226.html","width":130,"caption":"An atmospheric image of the local poacher on his way back from the river with his nights work! ( Sold )","height":173});
															thumbnails[4644292] = clik.newPhoto({"id":4644292,"src":"A_Lauderdale_Farm_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_4644292.html","width":130,"caption":"A farm in Lauderdale. ( Sold )","height":82});
															thumbnails[4703693] = clik.newPhoto({"id":4703693,"src":"high_sweden_bridge_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_4703693.html","width":130,"caption":"High Sweden Bridge","height":93});
															thumbnails[4852037] = clik.newPhoto({"id":4852037,"src":"Edinburgh_west_port_old_town_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_4852037.html","width":130,"caption":"Edinburgh Old Town, West port. Image size 340mm x 280mm Sold","height":98});
															thumbnails[5096170] = clik.newPhoto({"id":5096170,"src":"alnwick_castle_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5096170.html","width":130,"caption":"Alnwick castle ( water colour ) Sold","height":77});
															thumbnails[5139173] = clik.newPhoto({"id":5139173,"src":"west_end_cropped_resize_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5139173.html","width":130,"caption":"Coldstream West end, Acrylic on Canvas. Sold","height":101});
															thumbnails[5160581] = clik.newPhoto({"id":5160581,"src":"Berwick_walls_summer_house_figure_detail_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5160581.html","width":130,"caption":"Summer house, detail of figure with newspaper.","height":98});
															thumbnails[5210200] = clik.newPhoto({"id":5210200,"src":"Tweed_bridge_wcol_2009_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5210200.html","width":130,"caption":"Getting ready for a days salmon fishing below the tweed bridge at coldstream.","height":74});
															thumbnails[5484479] = clik.newPhoto({"id":5484479,"src":"red_brolly1_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_5484479.html","width":130,"caption":"Red Brolly #1","height":181});
															thumbnails[6040934] = clik.newPhoto({"id":6040934,"src":"the_besom_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_6040934.html","width":130,"caption":"The Besom Coldstream","height":98});
															thumbnails[6112603] = clik.newPhoto({"id":6112603,"src":"tweed_bridge_morning_light_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_6112603.html","width":130,"caption":"Tweed Bridge Coldstream, Early morning light.","height":55});
															thumbnails[6817920] = clik.newPhoto({"id":6817920,"src":"Longback_Cottage_Kirk_Newton_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_6817920.html","width":130,"caption":"Longback Cottage Nr Kirknewton in the Cheviot Hill. Painted as a demonstration piece for Coldstream Watercolour group.","height":98});
															thumbnails[7055813] = clik.newPhoto({"id":7055813,"src":"Duddo_stanes_thumb.jpg","galleries_id":267562,"server_id":18,"link":"photo_7055813.html","width":130,"caption":"Duddo Stanes. A watercolour on Saunders Waterford paper. ( £150 framed )","height":68});
															thumbnails[7001905] = clik.newPhoto({"id":7001905,"src":"step_1_thumb.jpg","galleries_id":379398,"server_id":18,"link":"photo_7001905.html","width":130,"caption":"Step 1","height":96});
															thumbnails[7027875] = clik.newPhoto({"id":7027875,"src":"Step_2_thumb.jpg","galleries_id":379398,"server_id":18,"link":"photo_7027875.html","width":130,"caption":"Step 2","height":97});
															thumbnails[7027880] = clik.newPhoto({"id":7027880,"src":"Step_3_thumb.jpg","galleries_id":379398,"server_id":18,"link":"photo_7027880.html","width":130,"caption":"Step 3","height":92});
															thumbnails[7027884] = clik.newPhoto({"id":7027884,"src":"Step_4_thumb.jpg","galleries_id":379398,"server_id":18,"link":"photo_7027884.html","width":130,"caption":"Step 4.","height":97});
															thumbnails[7027887] = clik.newPhoto({"id":7027887,"src":"Step_4_Showing_more_detail_thumb.jpg","galleries_id":379398,"server_id":18,"link":"photo_7027887.html","width":130,"caption":"Step 4 More detail.","height":98});
															thumbnails[7027888] = clik.newPhoto({"id":7027888,"src":"Step_5_thumb.jpg","galleries_id":379398,"server_id":18,"link":"photo_7027888.html","width":130,"caption":"Step 5 Finished image.","height":94});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[379398] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Demonstrations","link":"section451427.html","maxRecords":0.0,"photoIDs":[7001905.0,7027875.0,7027880.0,7027884.0,7027887.0,7027888.0],"skipIndex":0,"section_code":"section451427","featured_images":"7027888,7027887,7027884,7027880,7027875,7001905","id":379398,"singleSection":true});				  						galleries[267562] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"landscapes","link":"section322112.html","maxRecords":0.0,"photoIDs":[7147152.0,5160576.0,5142303.0,4636226.0,4644292.0,4703693.0,4852037.0,5096170.0,5139173.0,5160581.0,5210200.0,5484479.0,6040934.0,6112603.0,6817920.0,7055813.0],"skipIndex":0,"section_code":"section322112","featured_images":7055813.0,"id":267562,"singleSection":true});				  						galleries[267546] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"seascapes","link":"section322060.html","maxRecords":0.0,"photoIDs":[9037937.0,5297347.0,4626926.0,4635963.0,4636335.0,4641451.0,4644318.0,4783287.0,4818579.0,4818592.0,5304544.0,5794858.0,5794874.0,5794882.0,6317671.0,6317694.0,6433015.0,6817901.0,7001026.0,7001042.0,7009440.0,7137188.0,7391509.0,8846197.0,8851816.0],"skipIndex":0,"section_code":"section322060","featured_images":"9037937,8851816,8846197,7391509,7137188,7009440,7001042,7001026,6817901,6433015","id":267546,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9037937,7391509,7137188,7055813,7009440,7001042,7001026,6817920,6817901,6433015,6317694,6317671,6112603,6040934,4852037,4636226';
imageSets[2] = '7055813';
imageSets[3] = '9037937,8851816,8846197,7391509,7147152,7137188,7055813,7027888,7027887,7027884,7027880,7027875,7009440,7001905,7001042,7001026,6817920,6817901,6433015,6317694,6317671,6112603,6040934,5794882,5794874,5794858,5484479,5304544,5297347,5210200,5160581,5160576,5142303,5139173,5096170,4852037,4818592,4818579,4783287,4703693,4644318,4644292,4641451,4636335,4636226,4635963,4626926';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/brianjt/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/brianjt/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/brianjt/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/brianjt/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/brianjt/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/brianjt/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/brianjt/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/brianjt/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 += 'section322060.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 && 'section322060' != '') {
					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 = 'Brian J Turnbull: ' + 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;
	}
}

			

