window.thumbnails = {};
															thumbnails[4659623] = clik.newPhoto({"id":4659623,"src":"IMG_3704_2_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":231});
															thumbnails[4761985] = clik.newPhoto({"id":4761985,"src":"blueocoasnowcard_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"The Bluecoat in winter","height":108});
															thumbnails[4777188] = clik.newPhoto({"id":4777188,"src":"IMG_4840_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":51});
															thumbnails[6316552] = clik.newPhoto({"id":6316552,"src":"clock_and_liver_birdweb_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Clock and Liver Bird","height":148});
															thumbnails[6330113] = clik.newPhoto({"id":6330113,"src":"albert_dock_smaller_image_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":92});
															thumbnails[6330126] = clik.newPhoto({"id":6330126,"src":"Copy_of_st_georges_hall_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":115});
															thumbnails[6335605] = clik.newPhoto({"id":6335605,"src":"clikpic_A5B92AB8-1EC9-D45B-1C4A862B325BD591_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"Waterfront  Liverpool","height":38});
															thumbnails[6980248] = clik.newPhoto({"id":6980248,"src":"ANGLICANfor_clikpic12_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"Anglican Cathedral - Liverpool","height":107});
															thumbnails[7078061] = clik.newPhoto({"id":7078061,"src":"ferry_boat_xmas_cards_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":129});
															thumbnails[7078078] = clik.newPhoto({"id":7078078,"src":"LONG_XMAS_CARD1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":59});
															thumbnails[7131380] = clik.newPhoto({"id":7131380,"src":"ELLIOTS_HOUSE_2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":2010.0,"height":160});
															thumbnails[7265571] = clik.newPhoto({"id":7265571,"src":"everyman_for_clik_pic1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":99});
															thumbnails[7278018] = clik.newPhoto({"id":7278018,"src":"four_flowers12_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":145,"caption":"","height":200});
															thumbnails[7330409] = clik.newPhoto({"id":7330409,"src":"finished_image_everyman_for_click_pic2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":96});
															thumbnails[7383420] = clik.newPhoto({"id":7383420,"src":"st_lukes__church12_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":196});
															thumbnails[7383527] = clik.newPhoto({"id":7383527,"src":"concertina_mini_book12345_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":165});
															thumbnails[7383625] = clik.newPhoto({"id":7383625,"src":"metropolitan_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":147});
															thumbnails[7510459] = clik.newPhoto({"id":7510459,"src":"THREE_GRACES_large_3_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":107});
															thumbnails[7829704] = clik.newPhoto({"id":7829704,"src":"liver_building_pink_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":96,"caption":"","height":160});
															thumbnails[7916968] = clik.newPhoto({"id":7916968,"src":"FOUR_TULIPS_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"monoprint","height":160});
															thumbnails[8197739] = clik.newPhoto({"id":8197739,"src":"everyman2_614ACB86-24E8-5EC4-4FE581BD424726E3_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":160});
															thumbnails[4762080] = clik.newPhoto({"id":4762080,"src":"blueocoasnowcard1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":108});
															thumbnails[6328899] = clik.newPhoto({"id":6328899,"src":"clikpicferryboat_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"The ferry boat Liverpool","height":130});
															thumbnails[6329463] = clik.newPhoto({"id":6329463,"src":"BOOK_LIVER_BUILDING1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":95,"caption":"","height":130});
															thumbnails[6330054] = clik.newPhoto({"id":6330054,"src":"clikpic_C8A85804-24E8-5EC4-4F731B41E8AC21F9_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":123,"caption":"Liverpool waterfront","height":130});
															thumbnails[7606381] = clik.newPhoto({"id":7606381,"src":"playhouse_black_with_stars12345_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":160});
															thumbnails[7607257] = clik.newPhoto({"id":7607257,"src":"everyman2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":160});
															thumbnails[7607664] = clik.newPhoto({"id":7607664,"src":"yellow_bell_print_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":160});
															thumbnails[6329280] = clik.newPhoto({"id":6329280,"src":"BLUEOCVAT_SMALLER_IMAGE1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":77});
															thumbnails[7563682] = clik.newPhoto({"id":7563682,"src":"IMG_7204_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":150});
															thumbnails[5076357] = clik.newPhoto({"id":5076357,"src":"THE_OFFICE_PARTY_2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":188});
															thumbnails[7131392] = clik.newPhoto({"id":7131392,"src":"L1050635_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":93});
															thumbnails[7265563] = clik.newPhoto({"id":7265563,"src":"everyman_for_clik_pic_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":99});
															thumbnails[4762156] = clik.newPhoto({"id":4762156,"src":"clockrobin_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":147});
															thumbnails[7277874] = clik.newPhoto({"id":7277874,"src":"PRINTS_copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"","height":195});
															thumbnails[6316566] = clik.newPhoto({"id":6316566,"src":"red_tulips_for_click_pic1_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_6316566.html","width":160,"caption":"monoprint","height":160});
															thumbnails[7912365] = clik.newPhoto({"id":7912365,"src":"redumbrellaweb_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7912365.html","width":160,"caption":"The Red Umbrella Liverpool","height":160});
															thumbnails[7912439] = clik.newPhoto({"id":7912439,"src":"playhouse_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_7912439.html","width":160,"caption":"The Playhouse Theatre Liverpool","height":160});
															thumbnails[7912492] = clik.newPhoto({"id":7912492,"src":"ferryboatweb_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7912492.html","width":160,"caption":"The Ferry Boat - Liverpool","height":160});
															thumbnails[7912513] = clik.newPhoto({"id":7912513,"src":"everyman_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_7912513.html","width":160,"caption":"The Everyman Theatre  Liverpool","height":160});
															thumbnails[7912527] = clik.newPhoto({"id":7912527,"src":"Anglicanweb_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7912527.html","width":160,"caption":"Anglican Cathedral      Liverpool","height":160});
															thumbnails[7912532] = clik.newPhoto({"id":7912532,"src":"metropolitanweb_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7912532.html","width":160,"caption":"Metropolitan Cathedral     Liverpool","height":160});
															thumbnails[7912545] = clik.newPhoto({"id":7912545,"src":"yellowbellweb_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_7912545.html","width":160,"caption":"Anfield Road School     Liverpool","height":160});
															thumbnails[7919540] = clik.newPhoto({"id":7919540,"src":"liver_building_pink_669A2750-1E4F-37DC-71D64B68D983B99A_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7919540.html","width":160,"caption":"Royal Liver Building    Liverpool","height":160});
															thumbnails[7949210] = clik.newPhoto({"id":7949210,"src":"anglicancathedral_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7949210.html","width":160,"caption":"Anglican Cathedral    Liverpool","height":160});
															thumbnails[7949230] = clik.newPhoto({"id":7949230,"src":"threegracesweb_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7949230.html","width":160,"caption":"The Three Graces       Liverpool","height":160});
															thumbnails[7950426] = clik.newPhoto({"id":7950426,"src":"keiths_waterfront1_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_7950426.html","width":160,"caption":"Waterfront                  Liverpool","height":160});
															thumbnails[8094010] = clik.newPhoto({"id":8094010,"src":"rainy_day_in_liverpool_new_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_8094010.html","width":200,"caption":"A rainy day in Liverpool","height":200});
															thumbnails[8094023] = clik.newPhoto({"id":8094023,"src":"waterfront_blue12_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_8094023.html","width":160,"caption":"Waterfront - Liverpool","height":160});
															thumbnails[8094093] = clik.newPhoto({"id":8094093,"src":"playhouse_black_with_stars12345678_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_8094093.html","width":160,"caption":"The Playhouse Theatre      Liverpool","height":160});
															thumbnails[8094224] = clik.newPhoto({"id":8094224,"src":"everyman3_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_8094224.html","width":160,"caption":"The Everyman Theatre     Liverpool","height":160});
															thumbnails[8154968] = clik.newPhoto({"id":8154968,"src":"red_jug_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_8154968.html","width":111,"caption":"monoprint","height":160});
															thumbnails[8183538] = clik.newPhoto({"id":8183538,"src":"xfs_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_8183538.html","width":160,"caption":"St Francis Xavier's Church Liverpool","height":160});
															thumbnails[8299221] = clik.newPhoto({"id":8299221,"src":"ELLIOTS_HOUSE1_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_8299221.html","width":160,"caption":"","height":160});
															thumbnails[8299231] = clik.newPhoto({"id":8299231,"src":"snow_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_8299231.html","width":160,"caption":"","height":160});
															thumbnails[8544944] = clik.newPhoto({"id":8544944,"src":"PALM_HOUSE_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_8544944.html","width":160,"caption":"Palm House Sefton Park Liverpool","height":160});
															thumbnails[8788850] = clik.newPhoto({"id":8788850,"src":"clikpic_thumb.jpg","galleries_id":426616,"server_id":18,"link":"photo_8788850.html","width":160,"caption":"Merchant Taylors School","height":160});
															thumbnails[9048680] = clik.newPhoto({"id":9048680,"src":"finished_wedding_invite_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_9048680.html","width":200,"caption":"","height":200});
															thumbnails[9048989] = clik.newPhoto({"id":9048989,"src":"A4_amsterdam_thumb.jpg","galleries_id":477002,"server_id":18,"link":"photo_9048989.html","width":200,"caption":"","height":154});
															thumbnails[9067866] = clik.newPhoto({"id":9067866,"src":"racquet_club_new_thumb.jpg","galleries_id":426621,"server_id":18,"link":"photo_9067866.html","width":200,"caption":"","height":200});
															thumbnails[8153668] = clik.newPhoto({"id":8153668,"src":"daisy_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_8153668.html","width":159,"caption":"monoprint","height":160});
															thumbnails[7916798] = clik.newPhoto({"id":7916798,"src":"blue_jug1234_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_7916798.html","width":160,"caption":"monoprint","height":160});
															thumbnails[7916909] = clik.newPhoto({"id":7916909,"src":"jug_of_flowers12_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_7916909.html","width":160,"caption":"monoprint","height":160});
															thumbnails[7950114] = clik.newPhoto({"id":7950114,"src":"four_flowers_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_7950114.html","width":160,"caption":"screen print                   ","height":160});
															thumbnails[7919498] = clik.newPhoto({"id":7919498,"src":"waiting_for_a_bus_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_7919498.html","width":127,"caption":"monoprint","height":160});
															thumbnails[7919360] = clik.newPhoto({"id":7919360,"src":"liverbuildingmonoprint_thumb.jpg","galleries_id":426747,"server_id":18,"link":"photo_7919360.html","width":160,"caption":"monoprint","height":160});
															thumbnails[8562220] = clik.newPhoto({"id":8562220,"src":"waterfront_father_xmas_thumb.jpg","galleries_id":452549,"server_id":18,"link":"photo_8562220.html","width":160,"caption":"","height":160});
															thumbnails[8562309] = clik.newPhoto({"id":8562309,"src":"LIVER_BUILDING_XMAS_11_thumb.jpg","galleries_id":452549,"server_id":18,"link":"photo_8562309.html","width":160,"caption":"","height":160});
															thumbnails[8562394] = clik.newPhoto({"id":8562394,"src":"sefton_park_red_border_thumb.jpg","galleries_id":452549,"server_id":18,"link":"photo_8562394.html","width":160,"caption":"","height":160});
															thumbnails[8562426] = clik.newPhoto({"id":8562426,"src":"robin_and_liver_birdx12_thumb.jpg","galleries_id":452549,"server_id":18,"link":"photo_8562426.html","width":160,"caption":"","height":160});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[452549] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Christmas Cards 2011","link":"section544181.html","maxRecords":0.0,"photoIDs":[8562220.0,8562309.0,8562394.0,8562426.0],"skipIndex":0,"section_code":"section544181","featured_images":"8562426,8562394,8562309,8562220","id":452549,"singleSection":true});				  						galleries[477002] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Cities","link":"section512344_477002.html","maxRecords":0.0,"photoIDs":[9048989.0],"skipIndex":0,"section_code":"section512344","featured_images":9048989.0,"id":477002,"singleSection":false});				  						galleries[426621] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Commissions","link":"section512344_426621.html","maxRecords":0.0,"photoIDs":[7912439.0,7912513.0,7912545.0,8183538.0,8299221.0,8299231.0,9048680.0,9067866.0],"skipIndex":0,"section_code":"section512344","featured_images":7912439.0,"id":426621,"singleSection":false});				  						galleries[426616] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Liverpool","link":"section512344_426616.html","maxRecords":0.0,"photoIDs":[7912365.0,7912492.0,7912527.0,7912532.0,7919540.0,7949210.0,7949230.0,7950426.0,8094010.0,8094023.0,8094093.0,8094224.0,8544944.0,8788850.0],"skipIndex":0,"section_code":"section512344","featured_images":7912365.0,"id":426616,"singleSection":false});				  						galleries[426747] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Prints (editions)","link":"section512344_426747.html","maxRecords":0.0,"photoIDs":[6316566.0,8154968.0,8153668.0,7916798.0,7916909.0,7950114.0,7919498.0,7919360.0],"skipIndex":0,"section_code":"section512344","featured_images":6316566.0,"id":426747,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4659623';
imageSets[2] = '7916968,7912439,7912365,7383527,6316566,6329463,6328899,4762156';
imageSets[3] = '7919360';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/thePRINTMAKER/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/thePRINTMAKER/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 += 'section512344.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 && 'section512344' != '') {
					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 = 'www.freidamckitrick.co.uk: ' + 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>Artist and Printmaker </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;
	}
}

			

