window.thumbnails = {};
															thumbnails[5001142] = clik.newPhoto({"id":5001142,"src":"New_Faces_web_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_5001142.html","width":130,"caption":"New Faces","height":157});
															thumbnails[5001149] = clik.newPhoto({"id":5001149,"src":"Tabletop_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_5001149.html","width":130,"caption":"Tabletop","height":130});
															thumbnails[5001152] = clik.newPhoto({"id":5001152,"src":"Sunlight_and_foliage_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_5001152.html","width":130,"caption":"Sunlight and foliage","height":131});
															thumbnails[5001165] = clik.newPhoto({"id":5001165,"src":"Movment_in_blue_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_5001165.html","width":130,"caption":"Movement in blue \/ Sold","height":131});
															thumbnails[5001169] = clik.newPhoto({"id":5001169,"src":"Head_web_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_5001169.html","width":130,"caption":"Head","height":128});
															thumbnails[5001200] = clik.newPhoto({"id":5001200,"src":"Vals_garden_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_5001200.html","width":130,"caption":"Val's garden","height":130});
															thumbnails[5014141] = clik.newPhoto({"id":5014141,"src":"Polychrome_structure_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_5014141.html","width":130,"caption":"Polychrome structure","height":128});
															thumbnails[5014143] = clik.newPhoto({"id":5014143,"src":"Skyline_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_5014143.html","width":130,"caption":"Skyline","height":132});
															thumbnails[5302147] = clik.newPhoto({"id":5302147,"src":"Experiment_1_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_5302147.html","width":130,"caption":"Experiment 2","height":160});
															thumbnails[5302149] = clik.newPhoto({"id":5302149,"src":"Experiment_2_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_5302149.html","width":130,"caption":"Experiment 1","height":130});
															thumbnails[5359993] = clik.newPhoto({"id":5359993,"src":"eleven_thumb.JPG","galleries_id":414787,"server_id":18,"link":"photo_5359993.html","width":130,"caption":"Eleven","height":131});
															thumbnails[5362082] = clik.newPhoto({"id":5362082,"src":"Blue_yellow_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_5362082.html","width":130,"caption":"Blue yellow \/ Sold","height":129});
															thumbnails[5362087] = clik.newPhoto({"id":5362087,"src":"Equilibrium2_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_5362087.html","width":130,"caption":"Equilibrium#2","height":131});
															thumbnails[5727798] = clik.newPhoto({"id":5727798,"src":"Near_Upton_Black_Mill_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_5727798.html","width":130,"caption":"Near Upton Black Mill","height":173});
															thumbnails[5727805] = clik.newPhoto({"id":5727805,"src":"Old_Mill_pump_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_5727805.html","width":130,"caption":"Old Mill pump","height":144});
															thumbnails[5729161] = clik.newPhoto({"id":5729161,"src":"Detatched_iris_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_5729161.html","width":130,"caption":"Detatched Iris","height":134});
															thumbnails[5738012] = clik.newPhoto({"id":5738012,"src":"Fence_copy_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_5738012.html","width":130,"caption":"Fence on Upton Marsh","height":152});
															thumbnails[5750809] = clik.newPhoto({"id":5750809,"src":"Blue_Rose_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_5750809.html","width":130,"caption":"Blue Rose","height":146});
															thumbnails[5792735] = clik.newPhoto({"id":5792735,"src":"Sweet_Rose_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_5792735.html","width":130,"caption":"Sweet Rose","height":130});
															thumbnails[6051259] = clik.newPhoto({"id":6051259,"src":"Head_7_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_6051259.html","width":130,"caption":"Head seven.","height":193});
															thumbnails[6051278] = clik.newPhoto({"id":6051278,"src":"Head_8_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_6051278.html","width":130,"caption":"Head eight.","height":199});
															thumbnails[6051281] = clik.newPhoto({"id":6051281,"src":"head_9_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_6051281.html","width":130,"caption":"Head nine.","height":153});
															thumbnails[6285566] = clik.newPhoto({"id":6285566,"src":"Boat_on_Ranworth_Broad_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6285566.html","width":130,"caption":"Boat on Ranworth Broad","height":98});
															thumbnails[6285570] = clik.newPhoto({"id":6285570,"src":"Ranworth_Broad_4_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6285570.html","width":130,"caption":"Ranworth Broad 4","height":168});
															thumbnails[6285573] = clik.newPhoto({"id":6285573,"src":"Ranworth_Broad_2_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6285573.html","width":130,"caption":"Ranworth Broad 2","height":73});
															thumbnails[6313475] = clik.newPhoto({"id":6313475,"src":"post_mill_004_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6313475.html","width":130,"caption":"Post Mill 4","height":53});
															thumbnails[6347406] = clik.newPhoto({"id":6347406,"src":"Beach_pebbles_4_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6347406.html","width":130,"caption":"Beach pebbles","height":130});
															thumbnails[6400391] = clik.newPhoto({"id":6400391,"src":"winterton_004_web_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6400391.html","width":130,"caption":"Winterton Beach","height":61});
															thumbnails[6449829] = clik.newPhoto({"id":6449829,"src":"Dew_on_the_reeds_web_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6449829.html","width":130,"caption":"Dew on the reeds","height":130});
															thumbnails[6449831] = clik.newPhoto({"id":6449831,"src":"white_rose_2_web_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6449831.html","width":130,"caption":"White Rose","height":130});
															thumbnails[6449837] = clik.newPhoto({"id":6449837,"src":"TREE_TRUNK_web_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6449837.html","width":130,"caption":"Tree trunk","height":130});
															thumbnails[6631976] = clik.newPhoto({"id":6631976,"src":"Sunflower_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6631976.html","width":130,"caption":"Sunflower","height":145});
															thumbnails[6631977] = clik.newPhoto({"id":6631977,"src":"Three_pebbles_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_6631977.html","width":130,"caption":"Three pebbles","height":135});
															thumbnails[6631978] = clik.newPhoto({"id":6631978,"src":"Breydon_Water_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_6631978.html","width":130,"caption":"Breydon Water, Great Yarmouth.","height":129});
															thumbnails[6815822] = clik.newPhoto({"id":6815822,"src":"Garden_one_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_6815822.html","width":130,"caption":"Garden One","height":130});
															thumbnails[6815824] = clik.newPhoto({"id":6815824,"src":"Garden_two_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_6815824.html","width":130,"caption":"Garden Two","height":131});
															thumbnails[6840972] = clik.newPhoto({"id":6840972,"src":"new_abstract_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_6840972.html","width":130,"caption":"Two figures on black","height":132});
															thumbnails[6873612] = clik.newPhoto({"id":6873612,"src":"blackmill_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_6873612.html","width":130,"caption":"Upton Black Mill. Oil on pannel 30X30 cms \/ Sold.","height":130});
															thumbnails[6918027] = clik.newPhoto({"id":6918027,"src":"Garden_three_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_6918027.html","width":130,"caption":"Garden three. 35X35 cms. Acrylic on paper.","height":128});
															thumbnails[6977380] = clik.newPhoto({"id":6977380,"src":"Yachts_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_6977380.html","width":130,"caption":"Charcoal drawing. 43X43 cms.","height":131});
															thumbnails[7334218] = clik.newPhoto({"id":7334218,"src":"Another_Daisy_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_7334218.html","width":130,"caption":"Daisy","height":106});
															thumbnails[7415964] = clik.newPhoto({"id":7415964,"src":"Upturned_boats_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_7415964.html","width":130,"caption":"Upturned boats.","height":117});
															thumbnails[7415966] = clik.newPhoto({"id":7415966,"src":"dyke_bridge_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_7415966.html","width":130,"caption":"Bridge over the dyke","height":133});
															thumbnails[7504260] = clik.newPhoto({"id":7504260,"src":"Bowl_of_fruit_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_7504260.html","width":130,"caption":"Bowl of fruit. Acrylic on canvas 61X61 cms.","height":129});
															thumbnails[7541849] = clik.newPhoto({"id":7541849,"src":"SCREWDRIVER_4_PC_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_7541849.html","width":130,"caption":"Screwdriver","height":98});
															thumbnails[7725853] = clik.newPhoto({"id":7725853,"src":"abstract_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_7725853.html","width":130,"caption":"Abstract","height":122});
															thumbnails[7877064] = clik.newPhoto({"id":7877064,"src":"Remembering_Carnaby_Street_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_7877064.html","width":130,"caption":"Remembering Carnaby Street","height":131});
															thumbnails[8182634] = clik.newPhoto({"id":8182634,"src":"Grand_mothers_plate_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_8182634.html","width":130,"caption":"Grandmother's plate. \/ Sold","height":129});
															thumbnails[8223044] = clik.newPhoto({"id":8223044,"src":"Dancers_thumb.jpg","galleries_id":283646,"server_id":18,"link":"photo_8223044.html","width":130,"caption":"Dancers","height":179});
															thumbnails[8506394] = clik.newPhoto({"id":8506394,"src":"Blue_composition_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_8506394.html","width":130,"caption":"Blue composotion","height":130});
															thumbnails[8506396] = clik.newPhoto({"id":8506396,"src":"Composotion_orange_with_black_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_8506396.html","width":130,"caption":"Composotion orange with black","height":130});
															thumbnails[8508669] = clik.newPhoto({"id":8508669,"src":"bunch_of_flowers_5_thumb.jpg","galleries_id":414787,"server_id":18,"link":"photo_8508669.html","width":130,"caption":"Bunch of flowers","height":130});
															thumbnails[8661224] = clik.newPhoto({"id":8661224,"src":"Tin_face_2_thumb.jpg","galleries_id":298388,"server_id":18,"link":"photo_8661224.html","width":130,"caption":"Tin face","height":139});
															thumbnails[8778578] = clik.newPhoto({"id":8778578,"src":"Flower_border_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_8778578.html","width":130,"caption":"Flower border. ","height":127});
															thumbnails[9105473] = clik.newPhoto({"id":9105473,"src":"red_landscape_2_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_9105473.html","width":130,"caption":"Red landscape 1 \/ ten minute painting","height":130});
															thumbnails[9105474] = clik.newPhoto({"id":9105474,"src":"red_landscape_22_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_9105474.html","width":130,"caption":"Red landscape 2 \/ ten minute painting","height":131});
															thumbnails[9140775] = clik.newPhoto({"id":9140775,"src":"Suall_over_Upton_Black_Mill_1_thumb.jpg","galleries_id":283645,"server_id":18,"link":"photo_9140775.html","width":130,"caption":"Squall over Upton Black Mill","height":131});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[414787] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract","link":"gallery_414787.html","maxRecords":0.0,"photoIDs":[5001165.0,5014141.0,5014143.0,5359993.0,5362082.0,5362087.0,6840972.0,7725853.0,7877064.0,8506394.0,8506396.0,8508669.0],"skipIndex":0,"section_code":"gallery","featured_images":"8508669,8506396,8506394,7877064,7725853,6840972,5362087,5362082,5359993,5014143","id":414787,"singleSection":false});				  						galleries[298388] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photography","link":"gallery_298388.html","maxRecords":0.0,"photoIDs":[5727798.0,5727805.0,5729161.0,5738012.0,5750809.0,5792735.0,6285566.0,6285570.0,6285573.0,6313475.0,6347406.0,6400391.0,6449829.0,6449831.0,6449837.0,6631976.0,6631977.0,7334218.0,7415964.0,7415966.0,8661224.0],"skipIndex":0,"section_code":"gallery","featured_images":"8661224,7415966,7415964,7334218,6631977,6631976,6449837,6449831,6449829,6400391","id":298388,"singleSection":false});				  						galleries[283645] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape and Stilllife","link":"gallery_283645.html","maxRecords":0.0,"photoIDs":[5001149.0,5001152.0,5001200.0,5302147.0,5302149.0,6631978.0,6815822.0,6815824.0,6873612.0,6918027.0,6977380.0,7504260.0,8182634.0,8778578.0,9105473.0,9105474.0,9140775.0],"skipIndex":0,"section_code":"gallery","featured_images":"9140775,9105474,9105473,8778578,8182634,7504260,6977380,6918027,6873612,6815824","id":283645,"singleSection":false});				  						galleries[283646] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Figurative","link":"gallery_283646.html","maxRecords":0.0,"photoIDs":[5001142.0,5001169.0,6051259.0,6051278.0,6051281.0,7541849.0,8223044.0],"skipIndex":0,"section_code":"gallery","featured_images":"8223044,7541849,6051281,6051278,6051259,5001169,5001142","id":283646,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6977380,6918027,6873612,6840972,6815824,6815822,6631978,6631977,6631976,6449837,6449831,6449829,6400391,6347406,6313475,6285573,6285570,6285566,6051281,6051278,6051259,5792735,5750809,5738012,5729161,5727805,5727798,5362087,5362082,5359993,5302149,5302147,5014143,5014141,5001200,5001169,5001165,5001152,5001149,5001142';
imageSets[3] = '6977380,6918027,6873612,6840972,6815824,6815822,6631978,6631977,6631976,6449837,6449831,6449829,6400391,6347406,6313475,6285573,6285570,6285566,6051281,6051278,6051259,5792735,5750809,5738012,5729161,5727805,5727798,5362087,5362082,5359993,5302149,5302147,5014143,5014141,5001200,5001169,5001165,5001152,5001149,5001142';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/arnold/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/arnold/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/arnold/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/arnold/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/arnold/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/arnold/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/arnold/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/arnold/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 = 'Colin Giles Artist in Norfolk: ' + 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;
	}
}

			

