window.thumbnails = {};
															thumbnails[8060720] = clik.newPhoto({"id":8060720,"src":"Vermeer-iPhone4_thumb.JPG","galleries_id":432134,"server_id":32,"link":"photo_8060720.html","width":160,"caption":"Young Girl with an iPhone","height":183});
															thumbnails[8060803] = clik.newPhoto({"id":8060803,"src":"Wild_Bean_Cafe_2__thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060803.html","width":160,"caption":"Wild Bean Cafe","height":128});
															thumbnails[2159405] = clik.newPhoto({"id":2159405,"src":"014_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2159405.html","width":130,"caption":"VENICE FROM BURANO","height":87});
															thumbnails[2159722] = clik.newPhoto({"id":2159722,"src":"016_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_2159722.html","width":130,"caption":"STAR AND GARTER","height":143});
															thumbnails[2159903] = clik.newPhoto({"id":2159903,"src":"022_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2159903.html","width":130,"caption":"FROM SAN MARCO","height":87});
															thumbnails[2159904] = clik.newPhoto({"id":2159904,"src":"023_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2159904.html","width":130,"caption":"SALUTE","height":126});
															thumbnails[2160317] = clik.newPhoto({"id":2160317,"src":"027_thumb.jpg","galleries_id":143162,"server_id":32,"link":"photo_2160317.html","width":130,"caption":"VIEW FROM STINCHCOMBE","height":65});
															thumbnails[2160436] = clik.newPhoto({"id":2160436,"src":"034_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160436.html","width":130,"caption":"BELL'S DINER","height":190});
															thumbnails[2160525] = clik.newPhoto({"id":2160525,"src":"038_thumb.jpg","galleries_id":143162,"server_id":32,"link":"photo_2160525.html","width":130,"caption":"TYNDALE MONUMENT","height":71});
															thumbnails[2160529] = clik.newPhoto({"id":2160529,"src":"039_thumb.jpg","galleries_id":143162,"server_id":32,"link":"photo_2160529.html","width":130,"caption":"TYNDALE MONUMENT - NORTH NIBLEY","height":73});
															thumbnails[2160576] = clik.newPhoto({"id":2160576,"src":"044_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2160576.html","width":130,"caption":"VENICE FROM BURANO","height":86});
															thumbnails[3025577] = clik.newPhoto({"id":3025577,"src":"IMG_6944_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025577.html","width":130,"caption":"Mousehole Harbour","height":75});
															thumbnails[3025602] = clik.newPhoto({"id":3025602,"src":"IMG_6950_2_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025602.html","width":130,"caption":"Cars at Sennen","height":65});
															thumbnails[3025612] = clik.newPhoto({"id":3025612,"src":"IMG_6936_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025612.html","width":130,"caption":"Penzance 5 Miles","height":104});
															thumbnails[3025613] = clik.newPhoto({"id":3025613,"src":"IMG_6942_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025613.html","width":130,"caption":"St. Ives","height":282});
															thumbnails[3025615] = clik.newPhoto({"id":3025615,"src":"IMG_6956_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025615.html","width":130,"caption":"Godrevy","height":63});
															thumbnails[3025616] = clik.newPhoto({"id":3025616,"src":"IMG_6939_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025616.html","width":130,"caption":"Mounts Bay","height":159});
															thumbnails[3025619] = clik.newPhoto({"id":3025619,"src":"IMG_6946_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025619.html","width":130,"caption":"PENZANCE","height":102});
															thumbnails[3025620] = clik.newPhoto({"id":3025620,"src":"IMG_6947_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3025620.html","width":130,"caption":"St. Buryan","height":26});
															thumbnails[3026533] = clik.newPhoto({"id":3026533,"src":"IMG_6952_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3026533.html","width":130,"caption":"Tombstoning","height":90});
															thumbnails[3026535] = clik.newPhoto({"id":3026535,"src":"IMG_6962_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3026535.html","width":130,"caption":"St.Michael's Mount","height":172});
															thumbnails[3026537] = clik.newPhoto({"id":3026537,"src":"IMG_6974_3_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3026537.html","width":130,"caption":"MERRY MAIDENS","height":103});
															thumbnails[3026542] = clik.newPhoto({"id":3026542,"src":"IMG_6979_thumb.jpg","galleries_id":186092,"server_id":32,"link":"photo_3026542.html","width":130,"caption":"Bus Station - Penzance","height":26});
															thumbnails[5820903] = clik.newPhoto({"id":5820903,"src":"IMG_0360JPG_copy_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_5820903.html","width":130,"caption":"WADE STREET CHIP SHOP","height":212});
															thumbnails[5820941] = clik.newPhoto({"id":5820941,"src":"IMG_0361_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_5820941.html","width":130,"caption":"WHITE SCOOTER","height":203});
															thumbnails[5821057] = clik.newPhoto({"id":5821057,"src":"IMG_0362_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_5821057.html","width":130,"caption":"MONTPELLIER","height":211});
															thumbnails[5821066] = clik.newPhoto({"id":5821066,"src":"IMG_0363_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_5821066.html","width":130,"caption":"PARK STREET","height":187});
															thumbnails[5821074] = clik.newPhoto({"id":5821074,"src":"IMG_0365_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_5821074.html","width":130,"caption":"PICTON MEWS","height":85});
															thumbnails[5821080] = clik.newPhoto({"id":5821080,"src":"IMG_0366_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_5821080.html","width":130,"caption":"Bell's Diner 2","height":140});
															thumbnails[5821082] = clik.newPhoto({"id":5821082,"src":"IMG_0367_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_5821082.html","width":130,"caption":"SUSPENSION BRIDGE<br>\r\n","height":200});
															thumbnails[5821094] = clik.newPhoto({"id":5821094,"src":"IMG_8262_thumb.JPG","galleries_id":279433,"server_id":32,"link":"photo_5821094.html","width":130,"caption":"BENZ BARBERS","height":253});
															thumbnails[5821134] = clik.newPhoto({"id":5821134,"src":"IMG_8263_thumb.JPG","galleries_id":279433,"server_id":32,"link":"photo_5821134.html","width":130,"caption":"FRIAR STREET","height":164});
															thumbnails[5821140] = clik.newPhoto({"id":5821140,"src":"IMG_8264_thumb.JPG","galleries_id":279433,"server_id":32,"link":"photo_5821140.html","width":130,"caption":"GREEN DOOR","height":188});
															thumbnails[5936398] = clik.newPhoto({"id":5936398,"src":"IMG_8348JPG_copy_thumb.jpg","galleries_id":279433,"server_id":32,"link":"photo_5936398.html","width":130,"caption":"GUITAR SHOP","height":234});
															thumbnails[5936401] = clik.newPhoto({"id":5936401,"src":"IMG_8266JPG_copy_thumb.jpg","galleries_id":279433,"server_id":32,"link":"photo_5936401.html","width":130,"caption":"CRISPY COD","height":83});
															thumbnails[5936407] = clik.newPhoto({"id":5936407,"src":"IMG_8356_thumb.JPG","galleries_id":279433,"server_id":32,"link":"photo_5936407.html","width":130,"caption":"OPEN DOOR","height":183});
															thumbnails[5936414] = clik.newPhoto({"id":5936414,"src":"IMG_8347JPG_copy_thumb.jpg","galleries_id":279433,"server_id":32,"link":"photo_5936414.html","width":130,"caption":"DESIGN ICONS","height":87});
															thumbnails[5936420] = clik.newPhoto({"id":5936420,"src":"IMG_8265_thumb.JPG","galleries_id":279433,"server_id":32,"link":"photo_5936420.html","width":130,"caption":"PAINTING","height":200});
															thumbnails[5936423] = clik.newPhoto({"id":5936423,"src":"IMG_8358JPG_copy_thumb.jpg","galleries_id":279433,"server_id":32,"link":"photo_5936423.html","width":130,"caption":"PAWN","height":197});
															thumbnails[5936424] = clik.newPhoto({"id":5936424,"src":"IMG_8349_thumb.JPG","galleries_id":279433,"server_id":32,"link":"photo_5936424.html","width":130,"caption":"PORN","height":84});
															thumbnails[6979976] = clik.newPhoto({"id":6979976,"src":"York_Road__thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_6979976.html","width":130,"caption":"York Road","height":98});
															thumbnails[6979977] = clik.newPhoto({"id":6979977,"src":"Queen_Vic_thumb.JPG","galleries_id":378313,"server_id":32,"link":"photo_6979977.html","width":130,"caption":"Queen Vic","height":115});
															thumbnails[6979979] = clik.newPhoto({"id":6979979,"src":"The_Phoenix_thumb.JPG","galleries_id":378313,"server_id":32,"link":"photo_6979979.html","width":130,"caption":"The Phoenix","height":88});
															thumbnails[6980022] = clik.newPhoto({"id":6980022,"src":"Hare_on_the_Hill_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_6980022.html","width":130,"caption":"Hare on the Hill","height":95});
															thumbnails[6980025] = clik.newPhoto({"id":6980025,"src":"The_Lion_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_6980025.html","width":130,"caption":"The Lion","height":93});
															thumbnails[6980064] = clik.newPhoto({"id":6980064,"src":"Hare_on_the_Hill1_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_6980064.html","width":130,"caption":"Hare on the Hill","height":95});
															thumbnails[8060898] = clik.newPhoto({"id":8060898,"src":"Filling_Station_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060898.html","width":160,"caption":"Filling Station","height":122});
															thumbnails[8060907] = clik.newPhoto({"id":8060907,"src":"BP_Shipping_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060907.html","width":160,"caption":"BP Shipping","height":101});
															thumbnails[8060913] = clik.newPhoto({"id":8060913,"src":"BP_Wind_Farm_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060913.html","width":160,"caption":"BP Wind Farm","height":88});
															thumbnails[8060922] = clik.newPhoto({"id":8060922,"src":"Turner_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060922.html","width":160,"caption":"Wind Energy, Steam and Rain","height":127});
															thumbnails[8060932] = clik.newPhoto({"id":8060932,"src":"Beach_After_Manet_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060932.html","width":160,"caption":"Offshore Energy","height":129});
															thumbnails[8060935] = clik.newPhoto({"id":8060935,"src":"Rabbit_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060935.html","width":160,"caption":"Photovoltaic Rabbit","height":100});
															thumbnails[8060940] = clik.newPhoto({"id":8060940,"src":"Wind_Power_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060940.html","width":160,"caption":"BP Wind Power","height":163});
															thumbnails[8060961] = clik.newPhoto({"id":8060961,"src":"Biofuel_thumb.jpg","galleries_id":432136,"server_id":32,"link":"photo_8060961.html","width":160,"caption":"Biofuel Research","height":235});
															thumbnails[8772297] = clik.newPhoto({"id":8772297,"src":"Clicpic_Port_of_Call_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_8772297.html","width":160,"caption":"Port of Call","height":238});
															thumbnails[8772346] = clik.newPhoto({"id":8772346,"src":"Sale_-_clikpic_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_8772346.html","width":160,"caption":"SALE","height":106});
															thumbnails[8772583] = clik.newPhoto({"id":8772583,"src":"White_Hart_clikpic_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_8772583.html","width":160,"caption":"WHITE HART","height":94});
															thumbnails[8772646] = clik.newPhoto({"id":8772646,"src":"Bridge_clikpic_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_8772646.html","width":160,"caption":"BRIDGE","height":182});
															thumbnails[8772722] = clik.newPhoto({"id":8772722,"src":"Seahorse_clikpic_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_8772722.html","width":160,"caption":"SEAHORSE","height":116});
															thumbnails[8772743] = clik.newPhoto({"id":8772743,"src":"BIKE_clicpic_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_8772743.html","width":160,"caption":"MY WHITE BICYCLE","height":272});
															thumbnails[2156747] = clik.newPhoto({"id":2156747,"src":"06_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2156747.html","width":130,"caption":"NEIL","height":196});
															thumbnails[2159388] = clik.newPhoto({"id":2159388,"src":"011_thumb.jpg","galleries_id":143144,"server_id":32,"link":"photo_2159388.html","width":130,"caption":"SALFORD 1948","height":171});
															thumbnails[2160301] = clik.newPhoto({"id":2160301,"src":"026_thumb.jpg","galleries_id":143162,"server_id":32,"link":"photo_2160301.html","width":130,"caption":"COTSWOLD WAY","height":225});
															thumbnails[8772288] = clik.newPhoto({"id":8772288,"src":"IMG_1140_thumb.JPG","galleries_id":143142,"server_id":32,"link":"photo_8772288.html","width":160,"caption":10.0,"height":149});
															thumbnails[2159382] = clik.newPhoto({"id":2159382,"src":"09_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2159382.html","width":130,"caption":"Dad's Cabs","height":203});
															thumbnails[2159889] = clik.newPhoto({"id":2159889,"src":"020_thumb.jpg","galleries_id":143144,"server_id":32,"link":"photo_2159889.html","width":130,"caption":"GLASGOW 1957","height":164});
															thumbnails[2159897] = clik.newPhoto({"id":2159897,"src":"021_thumb.jpg","galleries_id":143144,"server_id":32,"link":"photo_2159897.html","width":130,"caption":"TESCO TULIPS","height":183});
															thumbnails[2160357] = clik.newPhoto({"id":2160357,"src":"029_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160357.html","width":130,"caption":"WAITING","height":147});
															thumbnails[2156722] = clik.newPhoto({"id":2156722,"src":"04_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2156722.html","width":130,"caption":"LET THEM EAT CULTURE","height":202});
															thumbnails[2160370] = clik.newPhoto({"id":2160370,"src":"032_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160370.html","width":130,"caption":"NO ENTRY","height":197});
															thumbnails[2159376] = clik.newPhoto({"id":2159376,"src":"08_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_2159376.html","width":130,"caption":"DUKE OF SUSSEX","height":198});
															thumbnails[2159392] = clik.newPhoto({"id":2159392,"src":"012_thumb.jpg","galleries_id":143144,"server_id":32,"link":"photo_2159392.html","width":130,"caption":"Village of Voisins 1872","height":90});
															thumbnails[2159371] = clik.newPhoto({"id":2159371,"src":"07_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2159371.html","width":130,"caption":"NO RUBBISH","height":86});
															thumbnails[2160351] = clik.newPhoto({"id":2160351,"src":"028_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160351.html","width":130,"caption":"FEED THE CHILDREN","height":66});
															thumbnails[2159729] = clik.newPhoto({"id":2159729,"src":"017_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2159729.html","width":130,"caption":"REPAIR","height":77});
															thumbnails[2160542] = clik.newPhoto({"id":2160542,"src":"040_thumb.jpg","galleries_id":143144,"server_id":32,"link":"photo_2160542.html","width":130,"caption":"POMEGRANATES AND TESCO BAG","height":87});
															thumbnails[2159385] = clik.newPhoto({"id":2159385,"src":"010_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2159385.html","width":130,"caption":"DUR DUR SHOP","height":85});
															thumbnails[2160365] = clik.newPhoto({"id":2160365,"src":"031_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_2160365.html","width":130,"caption":"GEORGE AND DRAGON","height":276});
															thumbnails[2160427] = clik.newPhoto({"id":2160427,"src":"033_thumb.jpg","galleries_id":378313,"server_id":32,"link":"photo_2160427.html","width":130,"caption":"QUEEN VIC","height":260});
															thumbnails[2160440] = clik.newPhoto({"id":2160440,"src":"035_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160440.html","width":130,"caption":"WIG SHOP","height":87});
															thumbnails[2160565] = clik.newPhoto({"id":2160565,"src":"042_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2160565.html","width":130,"caption":"THE GHETTO - EARLY MORNING","height":88});
															thumbnails[2160445] = clik.newPhoto({"id":2160445,"src":"036_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160445.html","width":130,"caption":"ST. JAMES BARTON","height":42});
															thumbnails[2160571] = clik.newPhoto({"id":2160571,"src":"043_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2160571.html","width":130,"caption":"BURANO HOUSES","height":109});
															thumbnails[2160449] = clik.newPhoto({"id":2160449,"src":"037_thumb.jpg","galleries_id":143142,"server_id":32,"link":"photo_2160449.html","width":130,"caption":"CAR WASH","height":79});
															thumbnails[2160556] = clik.newPhoto({"id":2160556,"src":"041_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2160556.html","width":130,"caption":"BURANO PEOPLE","height":104});
															thumbnails[2160587] = clik.newPhoto({"id":2160587,"src":"045_thumb.jpg","galleries_id":143146,"server_id":32,"link":"photo_2160587.html","width":130,"caption":"THE GHETTO","height":106});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[279433] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"A MOMENT IN WORCESTER","link":"gallery_279433.html","maxRecords":0.0,"photoIDs":[5821094.0,5821134.0,5821140.0,5936398.0,5936401.0,5936407.0,5936414.0,5936420.0,5936423.0,5936424.0],"skipIndex":0,"section_code":"gallery","featured_images":"5936424,5936423,5936420,5936414,5936407,5936401,5936398,5821140,5821134,5821094","id":279433,"singleSection":false});				  						galleries[432134] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"APPLE","link":"gallery_432134.html","maxRecords":0.0,"photoIDs":[8060720.0],"skipIndex":0,"section_code":"gallery","featured_images":8060720.0,"id":432134,"singleSection":false});				  						galleries[432136] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"BP","link":"gallery_432136.html","maxRecords":0.0,"photoIDs":[8060803.0,8060898.0,8060907.0,8060913.0,8060922.0,8060932.0,8060935.0,8060940.0,8060961.0],"skipIndex":0,"section_code":"gallery","featured_images":"8060961,8060940,8060935,8060932,8060922,8060913,8060907,8060898,8060803","id":432136,"singleSection":false});				  						galleries[186092] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CORNWALL","link":"gallery_186092.html","maxRecords":0.0,"photoIDs":[3025577.0,3025602.0,3025612.0,3025613.0,3025615.0,3025616.0,3025619.0,3025620.0,3026533.0,3026535.0,3026537.0,3026542.0],"skipIndex":0,"section_code":"gallery","featured_images":3025577.0,"id":186092,"singleSection":false});				  						galleries[143142] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"BRISTOL","link":"gallery_143142.html","maxRecords":0.0,"photoIDs":[2160436.0,5820903.0,5820941.0,5821057.0,5821066.0,5821074.0,5821080.0,5821082.0,6979976.0,8772346.0,8772646.0,8772743.0,2156747.0,8772288.0,2159382.0,2160357.0,2156722.0,2160370.0,2159371.0,2160351.0,2159729.0,2159385.0,2160440.0,2160445.0,2160449.0],"skipIndex":0,"section_code":"gallery","featured_images":2160370.0,"id":143142,"singleSection":false});				  						galleries[378313] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"BRISTOL PUBS","link":"gallery_378313.html","maxRecords":0.0,"photoIDs":[2159722.0,6979977.0,6979979.0,6980022.0,6980025.0,6980064.0,8772297.0,8772583.0,8772722.0,2159376.0,2160365.0,2160427.0],"skipIndex":0,"section_code":"gallery","featured_images":"8772722,8772583,8772297,6980064,6980025,6980022,6979979,6979977,2160427,2160365","id":378313,"singleSection":false});				  						galleries[143144] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"TESCO","link":"gallery_143144.html","maxRecords":0.0,"photoIDs":[2159388.0,2159889.0,2159897.0,2159392.0,2160542.0],"skipIndex":0,"section_code":"gallery","featured_images":2159388.0,"id":143144,"singleSection":false});				  						galleries[143146] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"VENICE","link":"gallery_143146.html","maxRecords":0.0,"photoIDs":[2159405.0,2159903.0,2159904.0,2160576.0,2160565.0,2160571.0,2160556.0,2160587.0],"skipIndex":0,"section_code":"gallery","featured_images":2159405.0,"id":143146,"singleSection":false});				  						galleries[143162] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"COTSWOLDS","link":"gallery_143162.html","maxRecords":0.0,"photoIDs":[2160317.0,2160525.0,2160529.0,2160301.0],"skipIndex":0,"section_code":"gallery","featured_images":2160301.0,"id":143162,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3025615,3025613,2160436,2159722,2160301,2159388,2159889,2159897,2160370,2156722,2159376,2159371,2159729,2159385';
imageSets[2] = '3025577,2159405,2160301,2159388,2160370';
imageSets[3] = '8772743,8772722,8772646,8772583,8772346,8772297,8772288,8060961,8060940,8060935,8060932,8060922,8060913,8060907,8060898,8060803,8060720,6980064,6980025,6980022,6979979,6979977,6979976,5936424,5936423,5936420,5936414,5936407,5936401,5936398,5821140,5821134,5821094,5821082,5821080,5821074,5821066,5821057,5820941,5820903,3026542,3026537,3026535,3026533,3025620,3025619,3025616,3025615,3025613,3025612';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/tomwhi/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/tomwhi/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 += '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 = 'Great White Art: ' + 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="TOMWHI">';
			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;
	}
}

			

