window.thumbnails = {};
															thumbnails[1490635] = clik.newPhoto({"id":1490635,"src":"father-figure_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Father Figure","height":100});
															thumbnails[1504031] = clik.newPhoto({"id":1504031,"src":"christopher-noulton-_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":62});
															thumbnails[1514160] = clik.newPhoto({"id":1514160,"src":"seaside-affair4_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1514160.html","width":130,"caption":"SEASIDE AFFAIR","height":100});
															thumbnails[1514213] = clik.newPhoto({"id":1514213,"src":"father-figure5_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1514213.html","width":130,"caption":"FATHER FIGURE","height":100});
															thumbnails[1514246] = clik.newPhoto({"id":1514246,"src":"local-hero_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1514246.html","width":130,"caption":"LOCAL HERO","height":100});
															thumbnails[1517249] = clik.newPhoto({"id":1517249,"src":"standing-stone-and-milkman_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1517249.html","width":130,"caption":"STANDING STONE AND MILKMAN","height":100});
															thumbnails[1517250] = clik.newPhoto({"id":1517250,"src":"little-red_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1517250.html","width":130,"caption":"LITTLE RED","height":100});
															thumbnails[1517254] = clik.newPhoto({"id":1517254,"src":"the-bottle-boys1_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1517254.html","width":130,"caption":"THE BOTTLE BOYS","height":100});
															thumbnails[1517281] = clik.newPhoto({"id":1517281,"src":"doorstep-blooms_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1517281.html","width":130,"caption":"DOORSTEP BLOOMS","height":100});
															thumbnails[1517301] = clik.newPhoto({"id":1517301,"src":"the-return-of-little-red_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1517301.html","width":130,"caption":"THE RETURN OF LITTLE RED","height":100});
															thumbnails[1520001] = clik.newPhoto({"id":1520001,"src":"she's-leaving-town_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1520001.html","width":130,"caption":"SHE'S LEAVING TOWN","height":100});
															thumbnails[1520010] = clik.newPhoto({"id":1520010,"src":"the-milk-boys_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1520010.html","width":130,"caption":"THE MILK BOYS","height":100});
															thumbnails[1520018] = clik.newPhoto({"id":1520018,"src":"little-red-night_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1520018.html","width":130,"caption":"LITTLE RED NIGHT","height":100});
															thumbnails[1520074] = clik.newPhoto({"id":1520074,"src":"float-on_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1520074.html","width":130,"caption":"FLOAT ON","height":100});
															thumbnails[1520075] = clik.newPhoto({"id":1520075,"src":"davey's-on-the-road-again-2_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1520075.html","width":130,"caption":"DAVEY'S ON THE ROAD AGAIN 2","height":100});
															thumbnails[1520076] = clik.newPhoto({"id":1520076,"src":"davey-takes-the-scenic-rout_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1520076.html","width":130,"caption":"DAVEY TAKES THE SCENIC ROUTE","height":100});
															thumbnails[1520093] = clik.newPhoto({"id":1520093,"src":"balcony-life1_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1520093.html","width":130,"caption":"","height":130});
															thumbnails[1540983] = clik.newPhoto({"id":1540983,"src":"housewives-choice_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1540983.html","width":130,"caption":"HOUSEWIVES' CHOICE","height":65});
															thumbnails[1541007] = clik.newPhoto({"id":1541007,"src":"pagan-davey1_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1541007.html","width":130,"caption":"PAGAN DAVEY","height":105});
															thumbnails[1541192] = clik.newPhoto({"id":1541192,"src":"the-milkmans-daughter_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1541192.html","width":130,"caption":"THE MILKMAN'S DAUGHTER","height":163});
															thumbnails[1541215] = clik.newPhoto({"id":1541215,"src":"a-short-cut-for-little-red_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1541215.html","width":130,"caption":"A SHORT CUT FOR LITTLE RED","height":100});
															thumbnails[1541277] = clik.newPhoto({"id":1541277,"src":"davey's-on-the-road-again7_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1541277.html","width":130,"caption":"DAVEY'S ON THE ROAD AGAIN","height":98});
															thumbnails[1558987] = clik.newPhoto({"id":1558987,"src":"davey's-on-the-road-again-3_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1558987.html","width":130,"caption":"DAVEY'S ON THE ROAD AGAIN 3","height":100});
															thumbnails[1559169] = clik.newPhoto({"id":1559169,"src":"top-hat_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1559169.html","width":130,"caption":"TOP HAT","height":130});
															thumbnails[1559180] = clik.newPhoto({"id":1559180,"src":"the-hat_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1559180.html","width":130,"caption":"THE HAT","height":90});
															thumbnails[1559184] = clik.newPhoto({"id":1559184,"src":"milk-round_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1559184.html","width":130,"caption":"MILK ROUND","height":69});
															thumbnails[1559234] = clik.newPhoto({"id":1559234,"src":"balcony-study-3_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1559234.html","width":130,"caption":"BALCONY STUDY 3","height":130});
															thumbnails[1559252] = clik.newPhoto({"id":1559252,"src":"milko_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1559252.html","width":130,"caption":"MILKO","height":201});
															thumbnails[1567035] = clik.newPhoto({"id":1567035,"src":"the-three-berties_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1567035.html","width":130,"caption":"THE THREE BERTIES","height":130});
															thumbnails[1567064] = clik.newPhoto({"id":1567064,"src":"sit_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1567064.html","width":130,"caption":"SIT!","height":130});
															thumbnails[1567226] = clik.newPhoto({"id":1567226,"src":"the-rise-of-the-swingers_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1567226.html","width":130,"caption":"THE RISE OF THE SWINGERS","height":100});
															thumbnails[1567277] = clik.newPhoto({"id":1567277,"src":"welcome-to-our-world_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1567277.html","width":130,"caption":"WELCOME TO OUR WORLD","height":100});
															thumbnails[1567302] = clik.newPhoto({"id":1567302,"src":"the-girl-with-the-white-dog-2_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1567302.html","width":130,"caption":"the girl with the white dog","height":131});
															thumbnails[1567315] = clik.newPhoto({"id":1567315,"src":"play-away1_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1567315.html","width":130,"caption":"PLAY AWAY","height":100});
															thumbnails[1567374] = clik.newPhoto({"id":1567374,"src":"factory-girl1_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1567374.html","width":130,"caption":"FACTORY GIRL","height":100});
															thumbnails[1583997] = clik.newPhoto({"id":1583997,"src":"mr-bowdery-rewires-the-hous1_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1583997.html","width":130,"caption":"MR BOWDERY REWIRES THE HOUSE","height":261});
															thumbnails[1584352] = clik.newPhoto({"id":1584352,"src":"home-movie1_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1584352.html","width":130,"caption":"HOME MOVIE","height":103});
															thumbnails[1584354] = clik.newPhoto({"id":1584354,"src":"home-movie-21_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1584354.html","width":130,"caption":"HOME MOVIE 2","height":104});
															thumbnails[1584355] = clik.newPhoto({"id":1584355,"src":"ours-is-a-nice-house1_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1584355.html","width":130,"caption":"OURS IS A NICE HOUSE","height":105});
															thumbnails[1584396] = clik.newPhoto({"id":1584396,"src":"lost-boy_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1584396.html","width":130,"caption":"LOST BOY","height":105});
															thumbnails[1584397] = clik.newPhoto({"id":1584397,"src":"coach-party_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1584397.html","width":130,"caption":"COACH PARTY","height":130});
															thumbnails[1584398] = clik.newPhoto({"id":1584398,"src":"coach-party-2_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1584398.html","width":130,"caption":"COACH PARTY 2","height":130});
															thumbnails[1587462] = clik.newPhoto({"id":1587462,"src":"backseat-driver_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1587462.html","width":130,"caption":"BACK SEAT DRIVER","height":130});
															thumbnails[1587466] = clik.newPhoto({"id":1587466,"src":"seven-thirty-pm_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1587466.html","width":130,"caption":"SEVEN-THIRTY PM","height":130});
															thumbnails[1587467] = clik.newPhoto({"id":1587467,"src":"house_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1587467.html","width":130,"caption":"HOUSE","height":130});
															thumbnails[1587700] = clik.newPhoto({"id":1587700,"src":"pride-o'-the-village_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1587700.html","width":130,"caption":"PRIDE O' THE VILLAGE","height":78});
															thumbnails[1587710] = clik.newPhoto({"id":1587710,"src":"camera-club_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1587710.html","width":130,"caption":"CAMERA CLUB","height":128});
															thumbnails[1587711] = clik.newPhoto({"id":1587711,"src":"vacuum-cleaners_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1587711.html","width":130,"caption":"VACUUM CLEANERS","height":130});
															thumbnails[1591398] = clik.newPhoto({"id":1591398,"src":"pride-o'-the-yard_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1591398.html","width":130,"caption":"PRIDE O' THE YARD","height":100});
															thumbnails[1591399] = clik.newPhoto({"id":1591399,"src":"breakfast-in-bed_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1591399.html","width":130,"caption":"BREAKFAST IN BED","height":99});
															thumbnails[1699677] = clik.newPhoto({"id":1699677,"src":"film-town-dog_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1699677.html","width":130,"caption":"FILM TOWN DOG","height":100});
															thumbnails[1699745] = clik.newPhoto({"id":1699745,"src":"harvest-babies1_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1699745.html","width":130,"caption":"HARVEST BABIES","height":70});
															thumbnails[1878109] = clik.newPhoto({"id":1878109,"src":"the-goodbye-girl_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1878109.html","width":130,"caption":"THE GOODBYE GIRL","height":100});
															thumbnails[1878110] = clik.newPhoto({"id":1878110,"src":"doorstep-blooms-2_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1878110.html","width":130,"caption":"DOORSTEP BLOOMS 2","height":101});
															thumbnails[1878162] = clik.newPhoto({"id":1878162,"src":"a-rural-affair_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1878162.html","width":130,"caption":"A RURAL AFFAIR","height":100});
															thumbnails[1878213] = clik.newPhoto({"id":1878213,"src":"the-sons-of-little-red_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_1878213.html","width":130,"caption":"THE SONS OF LITTLE RED","height":100});
															thumbnails[1878214] = clik.newPhoto({"id":1878214,"src":"watching-the-detectives_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_1878214.html","width":130,"caption":"WATCHING THE DETECTIVES","height":100});
															thumbnails[1913810] = clik.newPhoto({"id":1913810,"src":"embassy-court-commission-_thumb.jpg","galleries_id":102969,"server_id":1,"link":"photo_1913810.html","width":130,"caption":"EMBASSY COURT","height":130});
															thumbnails[2552155] = clik.newPhoto({"id":2552155,"src":"the-milk-round2_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_2552155.html","width":130,"caption":"gallery 1","height":130});
															thumbnails[3517116] = clik.newPhoto({"id":3517116,"src":"forget-me-not-eyes_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_3517116.html","width":130,"caption":"FORGET ME NOT EYES","height":132});
															thumbnails[3517234] = clik.newPhoto({"id":3517234,"src":"moving-story_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_3517234.html","width":130,"caption":"MOVING STORY","height":131});
															thumbnails[5315911] = clik.newPhoto({"id":5315911,"src":"father-figure-_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_5315911.html","width":130,"caption":"FATHER FIGURE 2","height":84});
															thumbnails[5315924] = clik.newPhoto({"id":5315924,"src":"tunnel-of-love-_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_5315924.html","width":130,"caption":"TUNNEL OF LOVE","height":101});
															thumbnails[5315930] = clik.newPhoto({"id":5315930,"src":"the-right-stuff-_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_5315930.html","width":130,"caption":"THE RIGHT STUFF","height":84});
															thumbnails[5315933] = clik.newPhoto({"id":5315933,"src":"fanfare-for-the-common-man_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_5315933.html","width":130,"caption":"FANFARE FOR THE COMMON MAN","height":84});
															thumbnails[7881255] = clik.newPhoto({"id":7881255,"src":"London-Waiting_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_7881255.html","width":130,"caption":"LONDON WAITING","height":87});
															thumbnails[7881392] = clik.newPhoto({"id":7881392,"src":"Reasons-To-Be-Cheerful_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_7881392.html","width":130,"caption":"REASONS TO BE CHEERFUL","height":86});
															thumbnails[7881497] = clik.newPhoto({"id":7881497,"src":"Working-Class-Hero_thumb.jpg","galleries_id":102970,"server_id":1,"link":"photo_7881497.html","width":130,"caption":"WORKING CLASS HERO","height":86});
															thumbnails[7889342] = clik.newPhoto({"id":7889342,"src":"justified-and-ancient1_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_7889342.html","width":130,"caption":"JUSTIFIED AND ANCIENT","height":86});
															thumbnails[7889347] = clik.newPhoto({"id":7889347,"src":"Little-Red-And-The-Tunnel_Of_Love1_thumb.jpg","galleries_id":102968,"server_id":1,"link":"photo_7889347.html","width":130,"caption":"LITTLE RED AND THE TUNNEL OF LOVE","height":88});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[102968] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"gallery 1    ","link":"gallery_102968.html","maxRecords":0.0,"photoIDs":[1514160.0,1514213.0,1514246.0,1517249.0,1517250.0,1517254.0,1517281.0,1517301.0,1520001.0,1520010.0,1520018.0,1520074.0,1520075.0,1520076.0,1540983.0,1541007.0,1541192.0,1541215.0,1541277.0,1558987.0,1591398.0,1591399.0,1878109.0,1878110.0,1878162.0,1878213.0,2552155.0,5315911.0,5315924.0,5315930.0,7889342.0,7889347.0],"skipIndex":0,"section_code":"gallery","featured_images":2552155.0,"id":102968,"singleSection":false});				  						galleries[102969] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"gallery 2","link":"gallery_102969.html","maxRecords":0.0,"photoIDs":[1520093.0,1559169.0,1559180.0,1559184.0,1559234.0,1559252.0,1567035.0,1567064.0,1913810.0],"skipIndex":0,"section_code":"gallery","featured_images":1520093.0,"id":102969,"singleSection":false});				  						galleries[102970] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"gallery 3","link":"gallery_102970.html","maxRecords":0.0,"photoIDs":[1567226.0,1567277.0,1567302.0,1567315.0,1567374.0,1583997.0,1584352.0,1584354.0,1584355.0,1584396.0,1584397.0,1584398.0,1587462.0,1587466.0,1587467.0,1587700.0,1587710.0,1587711.0,1699677.0,1699745.0,1878214.0,3517116.0,3517234.0,5315933.0,7881255.0,7881392.0,7881497.0],"skipIndex":0,"section_code":"gallery","featured_images":1567302.0,"id":102970,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1490635';
imageSets[2] = '2552155,1567302,1520093';
imageSets[3] = '7889347,7889342,7881497,7881392,7881255,5315933,5315930,5315924,5315911,3517234,3517116,2552155,1913810,1878214,1878213,1878162,1878110,1878109,1699745,1699677,1591399,1591398,1587711,1587710,1587700,1587467,1587466,1587462,1584398,1584397,1584396,1584355,1584354,1584352,1583997,1567374,1567315,1567302,1567277,1567226,1567064,1567035,1559252,1559234,1559184,1559180,1559169,1558987,1541277,1541215';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/christopher/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/christopher/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/christopher/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/christopher/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/christopher/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/christopher/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/christopher/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/christopher/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 = 'christopher noulton artist: ' + 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;
	}
}

			

