window.thumbnails = {};
															thumbnails[5094296] = clik.newPhoto({"id":5094296,"src":"nicky_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Nicky","height":124});
															thumbnails[6038824] = clik.newPhoto({"id":6038824,"src":"web_image_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":117});
															thumbnails[9166073] = clik.newPhoto({"id":9166073,"src":"Back_Cover_1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":129});
															thumbnails[5039505] = clik.newPhoto({"id":5039505,"src":"Harbour_Boats1_thumb.jpg","galleries_id":282832,"server_id":18,"link":"photo_5039505.html","width":130,"caption":"Harbour Boats, St. Ives","height":107});
															thumbnails[5039516] = clik.newPhoto({"id":5039516,"src":"Summer_evening1_thumb.jpg","galleries_id":282832,"server_id":18,"link":"photo_5039516.html","width":130,"caption":"Summer Evening, St. Ives","height":107});
															thumbnails[5039519] = clik.newPhoto({"id":5039519,"src":"Rooftops1_thumb.jpg","galleries_id":282832,"server_id":18,"link":"photo_5039519.html","width":130,"caption":"Rooftops, St. Ives","height":106});
															thumbnails[5039526] = clik.newPhoto({"id":5039526,"src":"Morning_Boats1_thumb.jpg","galleries_id":282832,"server_id":18,"link":"photo_5039526.html","width":130,"caption":"Morning Boats, St Ives","height":105});
															thumbnails[5039530] = clik.newPhoto({"id":5039530,"src":"Sunlit_Harbour1_thumb.jpg","galleries_id":282832,"server_id":18,"link":"photo_5039530.html","width":130,"caption":"Sunlit Harbour, St. Ives","height":106});
															thumbnails[5667818] = clik.newPhoto({"id":5667818,"src":"nude_112_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667818.html","width":130,"caption":"Leaning Figure 1","height":86});
															thumbnails[5667829] = clik.newPhoto({"id":5667829,"src":"nude_21_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667829.html","width":130,"caption":"Seated Figure 1","height":115});
															thumbnails[5667833] = clik.newPhoto({"id":5667833,"src":"nude_31_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667833.html","width":130,"caption":"Lying figure 2","height":89});
															thumbnails[5667845] = clik.newPhoto({"id":5667845,"src":"nude_41_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667845.html","width":130,"caption":"Lying Figure 3","height":82});
															thumbnails[5667851] = clik.newPhoto({"id":5667851,"src":"nude_51_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667851.html","width":130,"caption":"Lying Figure 4","height":93});
															thumbnails[5667893] = clik.newPhoto({"id":5667893,"src":"nude_61_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667893.html","width":130,"caption":"Lying Figure 5","height":98});
															thumbnails[5667896] = clik.newPhoto({"id":5667896,"src":"nude_71_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667896.html","width":130,"caption":"Lying Figure 6","height":108});
															thumbnails[5667899] = clik.newPhoto({"id":5667899,"src":"nude_81_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667899.html","width":130,"caption":"Seated Figure 2","height":105});
															thumbnails[5667900] = clik.newPhoto({"id":5667900,"src":"nude_91_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667900.html","width":130,"caption":"Leaning Figure 2","height":141});
															thumbnails[5667902] = clik.newPhoto({"id":5667902,"src":"nude_101_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667902.html","width":130,"caption":"Lying Figure 7","height":107});
															thumbnails[5667904] = clik.newPhoto({"id":5667904,"src":"nude_111_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667904.html","width":130,"caption":"Lying Figures 1","height":87});
															thumbnails[5667906] = clik.newPhoto({"id":5667906,"src":"nude_121_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667906.html","width":130,"caption":"Lying Figure 8","height":104});
															thumbnails[5667907] = clik.newPhoto({"id":5667907,"src":"nude_131_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667907.html","width":130,"caption":"Lying Figure 9","height":99});
															thumbnails[5667910] = clik.newPhoto({"id":5667910,"src":"nude_141_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667910.html","width":130,"caption":"Lying Figure 10","height":88});
															thumbnails[5667913] = clik.newPhoto({"id":5667913,"src":"nude_151_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667913.html","width":130,"caption":"Seated Figure 3","height":185});
															thumbnails[5667916] = clik.newPhoto({"id":5667916,"src":"nude_161_thumb.jpg","galleries_id":321130,"server_id":18,"link":"photo_5667916.html","width":130,"caption":"Lying Figure 11","height":92});
															thumbnails[9166071] = clik.newPhoto({"id":9166071,"src":"Book_Cover_1_thumb.jpg","galleries_id":484190,"server_id":18,"link":"photo_9166071.html","width":130,"caption":"Godolphin Landscapes","height":130});
															thumbnails[5039136] = clik.newPhoto({"id":5039136,"src":"HH_1_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039136.html","width":130,"caption":"Harbour Heavyweight (minor)","height":168});
															thumbnails[5707043] = clik.newPhoto({"id":5707043,"src":"Mining_Mechanisms_Geevor1_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5707043.html","width":130,"caption":"Mining Mechanisms, Geevor","height":157});
															thumbnails[5039395] = clik.newPhoto({"id":5039395,"src":"Harbour_Heavyweight_2_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039395.html","width":130,"caption":"Harbour Heavyweight (major)","height":175});
															thumbnails[5706925] = clik.newPhoto({"id":5706925,"src":"Mining_Mechanisms_Geevor_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5706925.html","width":130,"caption":"Mining Mechanisms, Geevor","height":157});
															thumbnails[5039512] = clik.newPhoto({"id":5039512,"src":"The_Harbour1_thumb.jpg","galleries_id":282832,"server_id":18,"link":"photo_5039512.html","width":130,"caption":"The Harbour, St. Ives","height":166});
															thumbnails[5039547] = clik.newPhoto({"id":5039547,"src":"Cottage_2_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5039547.html","width":130,"caption":"The Shippons, Godolphin II","height":180});
															thumbnails[5094995] = clik.newPhoto({"id":5094995,"src":"HH_11_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5094995.html","width":130,"caption":"Harbour Heavyweight (minor)","height":168});
															thumbnails[9144569] = clik.newPhoto({"id":9144569,"src":"Granite_and_Gorse_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9144569.html","width":130,"caption":"Granite and Gorse","height":108});
															thumbnails[5039534] = clik.newPhoto({"id":5039534,"src":"Cider_House1_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5039534.html","width":130,"caption":"The Cider House, Godolphin","height":177});
															thumbnails[5707025] = clik.newPhoto({"id":5707025,"src":"Blue_Cog_A0BE4C70-24E8-5EC4-4FD3A65142EBB695_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5707025.html","width":130,"caption":"Harbour Heavyweight (major)","height":162});
															thumbnails[9144574] = clik.newPhoto({"id":9144574,"src":"Granite_Boundaries_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9144574.html","width":130,"caption":"Granite Boundaries","height":126});
															thumbnails[9145248] = clik.newPhoto({"id":9145248,"src":"Luminous_Silence_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9145248.html","width":130,"caption":"Luminous Silence","height":146});
															thumbnails[5039497] = clik.newPhoto({"id":5039497,"src":"Trees_6_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039497.html","width":130,"caption":"Tehidy Trinity","height":167});
															thumbnails[5039541] = clik.newPhoto({"id":5039541,"src":"Cottage1_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5039541.html","width":130,"caption":"The Shippons, Godolphin","height":186});
															thumbnails[9144575] = clik.newPhoto({"id":9144575,"src":"Gable_End_Godolphin_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9144575.html","width":130,"caption":"Gable End","height":88});
															thumbnails[5039390] = clik.newPhoto({"id":5039390,"src":"Blockley_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5039390.html","width":130,"caption":"Cottage in the Woods(after John Blockley)","height":184});
															thumbnails[6045208] = clik.newPhoto({"id":6045208,"src":"outbuilding_1_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_6045208.html","width":130,"caption":"Elmsleigh","height":89});
															thumbnails[6045211] = clik.newPhoto({"id":6045211,"src":"outbuilding_2_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_6045211.html","width":130,"caption":"The Stables, Godolphin","height":99});
															thumbnails[6045221] = clik.newPhoto({"id":6045221,"src":"chain_reaction_3_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_6045221.html","width":130,"caption":"Chain Reaction 3","height":130});
															thumbnails[6045229] = clik.newPhoto({"id":6045229,"src":"chain_reaction_4_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_6045229.html","width":130,"caption":"Chain Reaction 4","height":130});
															thumbnails[6045236] = clik.newPhoto({"id":6045236,"src":"chain_reaction_5_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_6045236.html","width":130,"caption":"Chain Reaction 5","height":129});
															thumbnails[6045240] = clik.newPhoto({"id":6045240,"src":"chain_reaction_6_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_6045240.html","width":130,"caption":"Chain Reaction 6","height":129});
															thumbnails[5039493] = clik.newPhoto({"id":5039493,"src":"Trees_5_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039493.html","width":130,"caption":"Copse on the Slips","height":113});
															thumbnails[5095000] = clik.newPhoto({"id":5095000,"src":"Turtle_Rock_Nanven_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5095000.html","width":130,"caption":"Turtle Rock, Nanven","height":133});
															thumbnails[9144576] = clik.newPhoto({"id":9144576,"src":"Felling_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9144576.html","width":130,"caption":"Felling","height":89});
															thumbnails[5773638] = clik.newPhoto({"id":5773638,"src":"Newlyn_Chains_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5773638.html","width":130,"caption":"Trammel, Newlyn","height":130});
															thumbnails[5773645] = clik.newPhoto({"id":5773645,"src":"Newlyn_Rust_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5773645.html","width":130,"caption":"Intersect, Newlyn","height":128});
															thumbnails[5937432] = clik.newPhoto({"id":5937432,"src":"chain_reaction_1_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5937432.html","width":130,"caption":"Chain Reaction I","height":129});
															thumbnails[5937593] = clik.newPhoto({"id":5937593,"src":"chain_reaction_2_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5937593.html","width":130,"caption":"Chain Reaction II","height":130});
															thumbnails[5773656] = clik.newPhoto({"id":5773656,"src":"Nanven_Heads_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5773656.html","width":130,"caption":"Rock Sculptures","height":90});
															thumbnails[5773658] = clik.newPhoto({"id":5773658,"src":"Nanven_Pool_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5773658.html","width":130,"caption":"Reclining Rock","height":148});
															thumbnails[5773659] = clik.newPhoto({"id":5773659,"src":"Nanven_Rocks_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5773659.html","width":130,"caption":"Rock Recumbent","height":90});
															thumbnails[5039473] = clik.newPhoto({"id":5039473,"src":"Trees_1_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039473.html","width":130,"caption":"Winter Sun, Clowance","height":104});
															thumbnails[5095214] = clik.newPhoto({"id":5095214,"src":"Nanven_Shallows_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5095214.html","width":130,"caption":"Nanven Shallows","height":130});
															thumbnails[5397805] = clik.newPhoto({"id":5397805,"src":"Magnolias_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397805.html","width":130,"caption":"Magnolia","height":130});
															thumbnails[9144578] = clik.newPhoto({"id":9144578,"src":"Cow_Parsley_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9144578.html","width":130,"caption":"Cow Parsley","height":89});
															thumbnails[5039477] = clik.newPhoto({"id":5039477,"src":"Trees_2_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039477.html","width":130,"caption":"Sages","height":170});
															thumbnails[5095006] = clik.newPhoto({"id":5095006,"src":"Freshwater_Nanven_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5095006.html","width":130,"caption":"Freshwater, Nanven","height":122});
															thumbnails[5397774] = clik.newPhoto({"id":5397774,"src":"Cosmos_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397774.html","width":130,"caption":"Cosmos","height":132});
															thumbnails[9144580] = clik.newPhoto({"id":9144580,"src":"Garden_Steps_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9144580.html","width":130,"caption":"Garden Steps","height":324});
															thumbnails[5039402] = clik.newPhoto({"id":5039402,"src":"Hill_Hawthorn_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5039402.html","width":130,"caption":"Hill Hawthorn","height":137});
															thumbnails[5039552] = clik.newPhoto({"id":5039552,"src":"Freshwater_Nanven1_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039552.html","width":130,"caption":"Freshwater, Nanven","height":122});
															thumbnails[5397785] = clik.newPhoto({"id":5397785,"src":"Dog_Roses_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397785.html","width":130,"caption":"Dog Rose","height":131});
															thumbnails[9151326] = clik.newPhoto({"id":9151326,"src":"Vanes_Godolphin_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9151326.html","width":130,"caption":"Vanes, Godolphin","height":128});
															thumbnails[5039551] = clik.newPhoto({"id":5039551,"src":"Storm_Force_Godrevy_thumb.jpg","galleries_id":283957,"server_id":18,"link":"photo_5039551.html","width":130,"caption":"Storm Force, Godrevy","height":205});
															thumbnails[5039567] = clik.newPhoto({"id":5039567,"src":"Turtle_Rock_Nanven1_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039567.html","width":130,"caption":"Turtle Rock, Nanven","height":133});
															thumbnails[5397835] = clik.newPhoto({"id":5397835,"src":"Lilies_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397835.html","width":130,"caption":"Lily","height":134});
															thumbnails[9151339] = clik.newPhoto({"id":9151339,"src":"Rooves_and_Windows_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9151339.html","width":130,"caption":"Rooves and Windows","height":129});
															thumbnails[5039416] = clik.newPhoto({"id":5039416,"src":"Dreamer_Nanven_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039416.html","width":130,"caption":"Shaded Depths, Nanven<br>\r\n","height":301});
															thumbnails[5397830] = clik.newPhoto({"id":5397830,"src":"Irises_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397830.html","width":130,"caption":"Iris","height":134});
															thumbnails[9151348] = clik.newPhoto({"id":9151348,"src":"Rock_Bronzes_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9151348.html","width":130,"caption":"Rock Bronzes","height":102});
															thumbnails[5397795] = clik.newPhoto({"id":5397795,"src":"Orchids_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397795.html","width":130,"caption":"Orchid","height":129});
															thumbnails[5397847] = clik.newPhoto({"id":5397847,"src":"Paeony_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397847.html","width":130,"caption":"Paeony","height":131});
															thumbnails[5039464] = clik.newPhoto({"id":5039464,"src":"Rust_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039464.html","width":130,"caption":"Rusty Relics","height":131});
															thumbnails[5397851] = clik.newPhoto({"id":5397851,"src":"Poppies_thumb.jpg","galleries_id":282830,"server_id":18,"link":"photo_5397851.html","width":130,"caption":"Poppy","height":126});
															thumbnails[5039467] = clik.newPhoto({"id":5039467,"src":"Shaded_Depths_Nanven_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039467.html","width":130,"caption":"Dreamer, Nanven","height":191});
															thumbnails[9151378] = clik.newPhoto({"id":9151378,"src":"Eclipsed_1_thumb.jpg","galleries_id":482846,"server_id":18,"link":"photo_9151378.html","width":130,"caption":"Eclipsed","height":131});
															thumbnails[5039411] = clik.newPhoto({"id":5039411,"src":"Hill-Hawthorn_II_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039411.html","width":130,"caption":"Hill Hawthorn II","height":186});
															thumbnails[5039423] = clik.newPhoto({"id":5039423,"src":"Minack_Steps_thumb.jpg","galleries_id":282513,"server_id":18,"link":"photo_5039423.html","width":130,"caption":"Minack Moon","height":192});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[482846] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"NEW FOR 2012","link":"gallery_482846.html","maxRecords":0.0,"photoIDs":[9144569.0,9144574.0,9145248.0,9144575.0,9144576.0,9144578.0,9144580.0,9151326.0,9151339.0,9151348.0,9151378.0],"skipIndex":0,"section_code":"gallery","featured_images":9144574.0,"id":482846,"singleSection":false});				  						galleries[484190] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Books","link":"gallery_484190.html","maxRecords":0.0,"photoIDs":[9166071.0],"skipIndex":0,"section_code":"gallery","featured_images":9166071.0,"id":484190,"singleSection":false});				  						galleries[282513] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Watercolours","link":"gallery_282513.html","maxRecords":0.0,"photoIDs":[5039136.0,5039395.0,5706925.0,5039497.0,5039493.0,5039473.0,5039477.0,5039552.0,5039567.0,5039416.0,5039464.0,5039467.0,5039411.0,5039423.0],"skipIndex":0,"section_code":"gallery","featured_images":5039136.0,"id":282513,"singleSection":false});				  						galleries[282830] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Watercolour and Ink","link":"gallery_282830.html","maxRecords":0.0,"photoIDs":[5039547.0,5039534.0,5039541.0,5039390.0,6045208.0,6045211.0,6045221.0,6045229.0,6045236.0,6045240.0,5773638.0,5773645.0,5937432.0,5937593.0,5773656.0,5773658.0,5773659.0,5397805.0,5397774.0,5397785.0,5397835.0,5397830.0,5397795.0,5397847.0,5397851.0],"skipIndex":0,"section_code":"gallery","featured_images":5039534.0,"id":282830,"singleSection":false});				  						galleries[283957] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Giclee Prints","link":"gallery_283957.html","maxRecords":0.0,"photoIDs":[5707043.0,5094995.0,5707025.0,5095000.0,5095214.0,5095006.0,5039402.0,5039551.0],"skipIndex":0,"section_code":"gallery","featured_images":5039402.0,"id":283957,"singleSection":false});				  						galleries[282832] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Limited Edition Prints","link":"gallery_282832.html","maxRecords":0.0,"photoIDs":[5039505.0,5039516.0,5039519.0,5039526.0,5039530.0,5039512.0],"skipIndex":0,"section_code":"gallery","featured_images":5039505.0,"id":282832,"singleSection":false});				  						galleries[321130] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Figures","link":"gallery_321130.html","maxRecords":0.0,"photoIDs":[5667818.0,5667829.0,5667833.0,5667845.0,5667851.0,5667893.0,5667896.0,5667899.0,5667900.0,5667902.0,5667904.0,5667906.0,5667907.0,5667910.0,5667913.0,5667916.0],"skipIndex":0,"section_code":"gallery","featured_images":"5667916,5667913,5667910,5667907,5667906,5667904,5667902,5667900,5667899,5667896","id":321130,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9144569,9144574,9145248';
imageSets[2] = '9166071,5039505,5039136,9144574,5039534,5039402';
imageSets[3] = '9144575,9144578,9144580,9151326,9151339,9151348,5039416,5039464,9151378';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/nickytilley/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/nickytilley/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 = 'Nicola Tilley: ' + 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="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="NICKYTILLEY">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

