window.thumbnails = {};
															thumbnails[1216940] = clik.newPhoto({"id":1216940,"src":"nyclick4004_thumb.jpg","galleries_id":87189,"server_id":1,"link":"photo_1216940.html","width":130,"caption":"Brooklyn Bridge and Downtown Manhattan","height":74});
															thumbnails[2114367] = clik.newPhoto({"id":2114367,"src":"nyclick4349 copy_thumb.jpg","galleries_id":87189,"server_id":1,"link":"photo_2114367.html","width":130,"caption":"Central Park Lullaby","height":104});
															thumbnails[2114369] = clik.newPhoto({"id":2114369,"src":"nyclickIMG_3889_thumb.jpg","galleries_id":87189,"server_id":1,"link":"photo_2114369.html","width":130,"caption":"Times Square","height":104});
															thumbnails[2114371] = clik.newPhoto({"id":2114371,"src":"nyclick4183_thumb.jpg","galleries_id":87189,"server_id":1,"link":"photo_2114371.html","width":130,"caption":"Subway","height":163});
															thumbnails[3199397] = clik.newPhoto({"id":3199397,"src":"IMG_6546_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_3199397.html","width":130,"caption":"","height":104});
															thumbnails[3199398] = clik.newPhoto({"id":3199398,"src":"IMG_4442_thumb.JPG","galleries_id":87187,"server_id":1,"link":"photo_3199398.html","width":130,"caption":"","height":163});
															thumbnails[4117098] = clik.newPhoto({"id":4117098,"src":"IMG_3338_copy_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_4117098.html","width":130,"caption":"Stitchwort","height":163});
															thumbnails[2067837] = clik.newPhoto({"id":2067837,"src":"IMG_3076 copy_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_2067837.html","width":130,"caption":"","height":87});
															thumbnails[2067840] = clik.newPhoto({"id":2067840,"src":"IMG_3454 copy_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_2067840.html","width":130,"caption":"","height":104});
															thumbnails[1216760] = clik.newPhoto({"id":1216760,"src":"CLICK2_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_1216760.html","width":130,"caption":"Sunrise","height":87});
															thumbnails[1216762] = clik.newPhoto({"id":1216762,"src":"Click4_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_1216762.html","width":130,"caption":"Two Lips","height":100});
															thumbnails[1216763] = clik.newPhoto({"id":1216763,"src":"IMG_16223_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_1216763.html","width":130,"caption":"Snowdrop 2","height":209});
															thumbnails[1304556] = clik.newPhoto({"id":1304556,"src":"IMG_1634_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_1304556.html","width":130,"caption":"Snowdrop","height":104});
															thumbnails[4655420] = clik.newPhoto({"id":4655420,"src":"IMG_5642_copy_copyclick_thumb.jpg","galleries_id":87187,"server_id":1,"link":"photo_4655420.html","width":130,"caption":"Maggs and Fox","height":87});
															thumbnails[1216945] = clik.newPhoto({"id":1216945,"src":"CLICK18_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1216945.html","width":130,"caption":"Wastwater","height":52});
															thumbnails[1216947] = clik.newPhoto({"id":1216947,"src":"CLICK19_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1216947.html","width":130,"caption":"Coniston","height":163});
															thumbnails[1216957] = clik.newPhoto({"id":1216957,"src":"CLICK21_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1216957.html","width":130,"caption":"Padley Gorge I","height":85});
															thumbnails[1216959] = clik.newPhoto({"id":1216959,"src":"CLICK22_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1216959.html","width":130,"caption":"Padley Gorge II","height":72});
															thumbnails[1217205] = clik.newPhoto({"id":1217205,"src":"Click27_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1217205.html","width":130,"caption":"Under Humber","height":126});
															thumbnails[1304553] = clik.newPhoto({"id":1304553,"src":"click43_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1304553.html","width":130,"caption":"New Brighton","height":62});
															thumbnails[1216936] = clik.newPhoto({"id":1216936,"src":"CLICK13_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1216936.html","width":130,"caption":"Lowry","height":93});
															thumbnails[1216939] = clik.newPhoto({"id":1216939,"src":"CLICK14_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1216939.html","width":130,"caption":"Night Time","height":78});
															thumbnails[1358505] = clik.newPhoto({"id":1358505,"src":"Click45_thumb.jpg","galleries_id":87191,"server_id":1,"link":"photo_1358505.html","width":130,"caption":"A Grave Situation","height":88});
															thumbnails[1575369] = clik.newPhoto({"id":1575369,"src":"click52_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_1575369.html","width":130,"caption":"At the end of the day","height":95});
															thumbnails[1575373] = clik.newPhoto({"id":1575373,"src":"click51_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_1575373.html","width":130,"caption":"","height":217});
															thumbnails[1575381] = clik.newPhoto({"id":1575381,"src":"click12_1_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_1575381.html","width":130,"caption":"Rehearsal","height":87});
															thumbnails[3306083] = clik.newPhoto({"id":3306083,"src":"IMG_5720 click_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_3306083.html","width":130,"caption":"Dont look back","height":135});
															thumbnails[3306086] = clik.newPhoto({"id":3306086,"src":"IMG_5724 click_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_3306086.html","width":130,"caption":"Before and after?","height":104});
															thumbnails[3984564] = clik.newPhoto({"id":3984564,"src":"IMG_2999_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_3984564.html","width":130,"caption":"BCU European Championships","height":104});
															thumbnails[3984567] = clik.newPhoto({"id":3984567,"src":"IMG_2954_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_3984567.html","width":130,"caption":"BCU European Championships","height":163});
															thumbnails[3984583] = clik.newPhoto({"id":3984583,"src":"IMG_3204_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_3984583.html","width":130,"caption":"BCU European Championships","height":163});
															thumbnails[3984589] = clik.newPhoto({"id":3984589,"src":"IMG_3081_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_3984589.html","width":130,"caption":"BCU European Championships","height":104});
															thumbnails[6544368] = clik.newPhoto({"id":6544368,"src":"KJ0Z2971_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544368.html","width":130,"caption":"","height":195});
															thumbnails[6544369] = clik.newPhoto({"id":6544369,"src":"KJ0Z3057_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544369.html","width":130,"caption":"","height":195});
															thumbnails[6544387] = clik.newPhoto({"id":6544387,"src":"KJ0Z3212_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544387.html","width":130,"caption":"","height":195});
															thumbnails[6544390] = clik.newPhoto({"id":6544390,"src":"KJ0Z3009_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544390.html","width":130,"caption":"","height":87});
															thumbnails[6544445] = clik.newPhoto({"id":6544445,"src":"KJ0Z3078_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544445.html","width":130,"caption":"","height":87});
															thumbnails[6544454] = clik.newPhoto({"id":6544454,"src":"KJ0Z3116_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544454.html","width":130,"caption":"","height":87});
															thumbnails[6544457] = clik.newPhoto({"id":6544457,"src":"KJ0Z3129_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544457.html","width":130,"caption":"","height":87});
															thumbnails[6544460] = clik.newPhoto({"id":6544460,"src":"KJ0Z3204_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544460.html","width":130,"caption":"","height":87});
															thumbnails[6544470] = clik.newPhoto({"id":6544470,"src":"KJ0Z3091_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6544470.html","width":130,"caption":"","height":87});
															thumbnails[6537715] = clik.newPhoto({"id":6537715,"src":"KJ0Z2730_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6537715.html","width":130,"caption":"","height":195});
															thumbnails[6537727] = clik.newPhoto({"id":6537727,"src":"KJ0Z2723_copy_thumb.jpg","galleries_id":87192,"server_id":1,"link":"photo_6537727.html","width":130,"caption":"","height":87});
															thumbnails[8235518] = clik.newPhoto({"id":8235518,"src":"KJ0Z4532eps_thumb.jpg","galleries_id":87193,"server_id":37,"link":"photo_8235518.html","width":130,"caption":"Pyrate Treasure","height":195});
															thumbnails[8251277] = clik.newPhoto({"id":8251277,"src":"KJ0Z4865eclick_thumb.jpg","galleries_id":87193,"server_id":37,"link":"photo_8251277.html","width":130,"caption":"Emmy","height":195});
															thumbnails[6537762] = clik.newPhoto({"id":6537762,"src":"KJ0Z29291_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6537762.html","width":130,"caption":"Sarah Lewis","height":195});
															thumbnails[6654516] = clik.newPhoto({"id":6654516,"src":"KJ0Z3429_copy_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6654516.html","width":130,"caption":"Victoria Vendettaa","height":195});
															thumbnails[6654518] = clik.newPhoto({"id":6654518,"src":"KJ0Z3440_copy_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6654518.html","width":130,"caption":"Victoria Vendettaa","height":195});
															thumbnails[6233755] = clik.newPhoto({"id":6233755,"src":"Click-005_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6233755.html","width":130,"caption":"FreakyGemma","height":163});
															thumbnails[6233790] = clik.newPhoto({"id":6233790,"src":"Click-009_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6233790.html","width":130,"caption":"Halo Haynes","height":195});
															thumbnails[6233805] = clik.newPhoto({"id":6233805,"src":"Click-012_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6233805.html","width":130,"caption":"Jo Jo  Crowder","height":163});
															thumbnails[6233828] = clik.newPhoto({"id":6233828,"src":"Click-014_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6233828.html","width":130,"caption":"Samantha Alexandra","height":163});
															thumbnails[6233839] = clik.newPhoto({"id":6233839,"src":"Click-016_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6233839.html","width":130,"caption":"Samantha Alexandra","height":195});
															thumbnails[6233849] = clik.newPhoto({"id":6233849,"src":"Click-020_thumb.jpg","galleries_id":87193,"server_id":1,"link":"photo_6233849.html","width":130,"caption":"Hay","height":104});
															thumbnails[6350037] = clik.newPhoto({"id":6350037,"src":"KJ0Z2204_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350037.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[6350041] = clik.newPhoto({"id":6350041,"src":"KJ0Z2216_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350041.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[6350043] = clik.newPhoto({"id":6350043,"src":"KJ0Z2220_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350043.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[6350045] = clik.newPhoto({"id":6350045,"src":"KJ0Z2221_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350045.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[6350047] = clik.newPhoto({"id":6350047,"src":"KJ0Z2224_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350047.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[6350053] = clik.newPhoto({"id":6350053,"src":"KJ0Z2233_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350053.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[6350056] = clik.newPhoto({"id":6350056,"src":"KJ0Z2237_copy_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_6350056.html","width":130,"caption":"Becky & Rob","height":195});
															thumbnails[7654507] = clik.newPhoto({"id":7654507,"src":"KJ0Z16041c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654507.html","width":130,"caption":"Craig","height":195});
															thumbnails[7654511] = clik.newPhoto({"id":7654511,"src":"KJ0Z16181c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654511.html","width":130,"caption":"Jo","height":195});
															thumbnails[7654515] = clik.newPhoto({"id":7654515,"src":"KJ0Z16341c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654515.html","width":130,"caption":"Jo","height":195});
															thumbnails[7654517] = clik.newPhoto({"id":7654517,"src":"KJ0Z16401c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654517.html","width":130,"caption":"Jo and Craig","height":87});
															thumbnails[7654521] = clik.newPhoto({"id":7654521,"src":"KJ0Z16561c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654521.html","width":130,"caption":"Jo and Craig","height":87});
															thumbnails[7654523] = clik.newPhoto({"id":7654523,"src":"KJ0Z16801c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654523.html","width":130,"caption":"Jo and Craig","height":87});
															thumbnails[7654527] = clik.newPhoto({"id":7654527,"src":"KJ0Z17991c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654527.html","width":130,"caption":"Jo and Craig","height":195});
															thumbnails[7654529] = clik.newPhoto({"id":7654529,"src":"KJ0Z197011c_thumb.jpg","galleries_id":351825,"server_id":1,"link":"photo_7654529.html","width":130,"caption":"Jo and Craig","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[87193] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Glamour","link":"section119550.html","maxRecords":0.0,"photoIDs":[8235518.0,8251277.0,6537762.0,6654516.0,6654518.0,6233755.0,6233790.0,6233805.0,6233828.0,6233839.0,6233849.0],"skipIndex":0,"section_code":"section119550","featured_images":"8251277,8235518,6654518,6654516,6537762,6233849,6233839,6233828,6233805,6233790","id":87193,"singleSection":true});				  						galleries[87191] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape","link":"section119547.html","maxRecords":0.0,"photoIDs":[1216945.0,1216947.0,1216957.0,1216959.0,1217205.0,1304553.0,1216936.0,1216939.0,1358505.0],"skipIndex":0,"section_code":"section119547","featured_images":"1358505,1304553,1217205,1216959,1216957,1216947,1216945,1216939,1216936","id":87191,"singleSection":true});				  						galleries[87189] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"New York","link":"section119546.html","maxRecords":0.0,"photoIDs":[1216940.0,2114367.0,2114369.0,2114371.0],"skipIndex":0,"section_code":"section119546","featured_images":"2114371,2114369,2114367,1216940","id":87189,"singleSection":true});				  						galleries[87192] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"section119549.html","maxRecords":0.0,"photoIDs":[1575369.0,1575373.0,1575381.0,3306083.0,3306086.0,3984564.0,3984567.0,3984583.0,3984589.0,6544368.0,6544369.0,6544387.0,6544390.0,6544445.0,6544454.0,6544457.0,6544460.0,6544470.0,6537715.0,6537727.0],"skipIndex":0,"section_code":"section119549","featured_images":"6544470,6544460,6544457,6544454,6544445,6544390,6544387,6544369,6544368,6537727","id":87192,"singleSection":true});				  						galleries[87187] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Still Life","link":"section119545.html","maxRecords":0.0,"photoIDs":[3199397.0,3199398.0,4117098.0,2067837.0,2067840.0,1216760.0,1216762.0,1216763.0,1304556.0,4655420.0],"skipIndex":0,"section_code":"section119545","featured_images":"4655420,4117098,3199398,3199397,2067840,2067837,1304556,1216763,1216762,1216760","id":87187,"singleSection":true});				  						galleries[351825] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"section419826.html","maxRecords":0.0,"photoIDs":[6350037.0,6350041.0,6350043.0,6350045.0,6350047.0,6350053.0,6350056.0,7654507.0,7654511.0,7654515.0,7654517.0,7654521.0,7654523.0,7654527.0,7654529.0],"skipIndex":0,"section_code":"section419826","featured_images":"7654529,7654527,7654523,7654521,7654517,7654515,7654511,7654507,6350056,6350053","id":351825,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6654518,6654516,6544470,6544460,6544457,6544454,6544445,6544390,6544387,6544369,6544368,6537762,6537727,6537715,6350056,6350053,6350047,6350045,6350043,6350041,6350037,4655420,3984589,3984567,3984564';
imageSets[3] = '6544454,6544445,6544390,6544369,6233755';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mounters/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mounters/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mounters/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mounters/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mounters/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mounters/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mounters/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 && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'section119546.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 && 'section119546' != '') {
					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 = 'Mounters photography: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="john1961@btinternet.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="john1961@btinternet.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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({					href: thumbnails[imageID].fnGalleryLink(gallery_id),					title: galleries[gallery_id].title				});
			}
		}
	}
}

/***************************************************************************
* 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;
	}
}

			

