window.thumbnails = {};
															thumbnails[1625070] = clik.newPhoto({"id":1625070,"src":"IMG_0725_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1625093] = clik.newPhoto({"id":1625093,"src":"IMG_0765_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"burnished black earthenware flask","height":87});
															thumbnails[1905178] = clik.newPhoto({"id":1905178,"src":"pottery 2007 010_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1905181] = clik.newPhoto({"id":1905181,"src":"pottery 2007 011_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1905182] = clik.newPhoto({"id":1905182,"src":"pottery 2007 0131_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1905356] = clik.newPhoto({"id":1905356,"src":"roller blading 018_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1988210] = clik.newPhoto({"id":1988210,"src":"roller blading 005 resized1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[2002623] = clik.newPhoto({"id":2002623,"src":"My pottery 2007 034_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"black earthenware with hardwood branch","height":183});
															thumbnails[2122575] = clik.newPhoto({"id":2122575,"src":"descicated fish 2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"desiccated tailess stoneware fish","height":98});
															thumbnails[2174048] = clik.newPhoto({"id":2174048,"src":"exotic birds_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"exotic birds","height":98});
															thumbnails[2755366] = clik.newPhoto({"id":2755366,"src":"websize 3 jade bowls_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[2755415] = clik.newPhoto({"id":2755415,"src":"websize jug and 2 bowls_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[2755429] = clik.newPhoto({"id":2755429,"src":"websize cock and hen jugs_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[3971647] = clik.newPhoto({"id":3971647,"src":"pottery_2007_027_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"fishbone on driftwood","height":98});
															thumbnails[4655518] = clik.newPhoto({"id":4655518,"src":"026_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Dog alert","height":98});
															thumbnails[4655527] = clik.newPhoto({"id":4655527,"src":"029_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"mixed clay stoneware pot","height":98});
															thumbnails[4655646] = clik.newPhoto({"id":4655646,"src":"030_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"stoneware dish","height":98});
															thumbnails[4655657] = clik.newPhoto({"id":4655657,"src":"032_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"two unglazed  bowls","height":98});
															thumbnails[4655721] = clik.newPhoto({"id":4655721,"src":"050_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Only Legs. (study 1)","height":98});
															thumbnails[4655728] = clik.newPhoto({"id":4655728,"src":"052_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Only Legs (study 2)","height":98});
															thumbnails[4655750] = clik.newPhoto({"id":4655750,"src":"036_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"jade bowl","height":98});
															thumbnails[4655780] = clik.newPhoto({"id":4655780,"src":"039_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"two stoneware bowls","height":98});
															thumbnails[4670781] = clik.newPhoto({"id":4670781,"src":"websize_fish_dish_jade_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[4670790] = clik.newPhoto({"id":4670790,"src":"websize_fish_dish_white_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[4670821] = clik.newPhoto({"id":4670821,"src":"websize_circular_fish_dish1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[5214284] = clik.newPhoto({"id":5214284,"src":"rooster_and_hens_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"rooster and hens","height":98});
															thumbnails[5214310] = clik.newPhoto({"id":5214310,"src":"tails_2_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"\"heads or tails\"","height":98});
															thumbnails[5214312] = clik.newPhoto({"id":5214312,"src":"gutted_fish_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"\"gutted\"","height":98});
															thumbnails[5509310] = clik.newPhoto({"id":5509310,"src":"gutted_crank_fish_reverse_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"gutted fish","height":98});
															thumbnails[5764868] = clik.newPhoto({"id":5764868,"src":"IMGP0382_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"garlic","height":98});
															thumbnails[5770677] = clik.newPhoto({"id":5770677,"src":"Autumn_leaf_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Autumn leaf","height":98});
															thumbnails[5770678] = clik.newPhoto({"id":5770678,"src":"Autumn_leaf_underside_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Autumn leaf underside","height":98});
															thumbnails[5976948] = clik.newPhoto({"id":5976948,"src":"IMGP0407_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"partially  decayed fish 2","height":98});
															thumbnails[6123426] = clik.newPhoto({"id":6123426,"src":"bird_bowl_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[6123437] = clik.newPhoto({"id":6123437,"src":"fish_bowl_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[6183048] = clik.newPhoto({"id":6183048,"src":"partial_decay_reverse_4_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"partially decayed fish (3)","height":98});
															thumbnails[6183059] = clik.newPhoto({"id":6183059,"src":"partial_decay_4_websize1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"partially decayed (3)","height":98});
															thumbnails[8443663] = clik.newPhoto({"id":8443663,"src":"3_garlic_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"3 garlic","height":98});
															thumbnails[8443691] = clik.newPhoto({"id":8443691,"src":"pods_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Seed pods.","height":98});
															thumbnails[8443693] = clik.newPhoto({"id":8443693,"src":"011_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"mushrooms","height":98});
															thumbnails[2996974] = clik.newPhoto({"id":2996974,"src":"websize skeletal fish_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"skeletal fish","height":98});
															thumbnails[1625038] = clik.newPhoto({"id":1625038,"src":"IMG_0581_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"half moon stoneware vase","height":87});
															thumbnails[1905346] = clik.newPhoto({"id":1905346,"src":"pottery 2008 010_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":4.0,"height":98});
															thumbnails[1625057] = clik.newPhoto({"id":1625057,"src":"IMG_0600_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"tulip stoneware vase","height":87});
															thumbnails[1625064] = clik.newPhoto({"id":1625064,"src":"IMG_0663_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":1.0,"height":87});
															thumbnails[2991742] = clik.newPhoto({"id":2991742,"src":"websize hen teapot and jug_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Hen teapot and jug","height":98});
															thumbnails[1625066] = clik.newPhoto({"id":1625066,"src":"IMG_0693_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":2.0,"height":87});
															thumbnails[2761429] = clik.newPhoto({"id":2761429,"src":"webssize seaweed vase_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"black earthenware seapod vase","height":98});
															thumbnails[1905339] = clik.newPhoto({"id":1905339,"src":"pottery 2007 016_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":3.0,"height":98});
															thumbnails[2755493] = clik.newPhoto({"id":2755493,"src":"websize fish tail vases_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"stoneware fishtail vases","height":195});
															thumbnails[2761276] = clik.newPhoto({"id":2761276,"src":"websize desicated fish 3_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":" desiccated whole stoneware fish","height":98});
															thumbnails[2755181] = clik.newPhoto({"id":2755181,"src":"websize gourd black clay_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":" black earthenware gourd vase","height":195});
															thumbnails[2755269] = clik.newPhoto({"id":2755269,"src":"websize pair figs_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":6.0,"height":98});
															thumbnails[2861501] = clik.newPhoto({"id":2861501,"src":"websize spent fish1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":129,"caption":"Stoneware spent fish","height":97});
															thumbnails[1625051] = clik.newPhoto({"id":1625051,"src":"IMG_0585_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"bell shaped stoneware vase","height":195});
															thumbnails[2755280] = clik.newPhoto({"id":2755280,"src":"websize 4 gourds white_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":7.0,"height":87});
															thumbnails[2754539] = clik.newPhoto({"id":2754539,"src":"websize pair small green gourds_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":5.0,"height":98});
															thumbnails[2761278] = clik.newPhoto({"id":2761278,"src":"websize onion_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"stoneware onion","height":98});
															thumbnails[2755287] = clik.newPhoto({"id":2755287,"src":"web size large fig_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":8.0,"height":98});
															thumbnails[1905351] = clik.newPhoto({"id":1905351,"src":"pottery 2008 018_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Headless fish 2","height":98});
															thumbnails[2755291] = clik.newPhoto({"id":2755291,"src":"web size large fig underside_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":9.0,"height":98});
															thumbnails[5509304] = clik.newPhoto({"id":5509304,"src":"desiccated_fish_bone_on_driftwood_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"desiccated fishbone on driftwood","height":98});
															thumbnails[8443629] = clik.newPhoto({"id":8443629,"src":"ribbed_fish_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Ribbed fish","height":86});
															thumbnails[8443630] = clik.newPhoto({"id":8443630,"src":"fishbone_-front_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Fishbone","height":86});
															thumbnails[5214290] = clik.newPhoto({"id":5214290,"src":"stoned_fish_thumb.JPG","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"stoned fish","height":98});
															thumbnails[8443189] = clik.newPhoto({"id":8443189,"src":"gutted_fish_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"gutted fish","height":86});
															thumbnails[8443631] = clik.newPhoto({"id":8443631,"src":"red-fish-tale4_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Desiccated fish \"tails\"","height":86});
															thumbnails[8443642] = clik.newPhoto({"id":8443642,"src":"red-fish-tale_websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Desiccated fish \"tails\"","height":86});
															thumbnails[8443647] = clik.newPhoto({"id":8443647,"src":"white-fish1websize_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"\"Upstream\" fish","height":86});
															thumbnails[8443653] = clik.newPhoto({"id":8443653,"src":"white-fish7_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"\"Upstream\" fish","height":87});
															thumbnails[8443656] = clik.newPhoto({"id":8443656,"src":"websize_spent_fish_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"\"Spent\" fish","height":98});
															thumbnails[8685288] = clik.newPhoto({"id":8685288,"src":"012_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685288.html","width":130,"caption":"","height":98});
															thumbnails[8685301] = clik.newPhoto({"id":8685301,"src":"rooster_and_hen_jugs_thumb.jpg","galleries_id":450116,"server_id":18,"link":"photo_8685301.html","width":130,"caption":"","height":98});
															thumbnails[8685229] = clik.newPhoto({"id":8685229,"src":"0191_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685229.html","width":130,"caption":"","height":98});
															thumbnails[8685303] = clik.newPhoto({"id":8685303,"src":"067_thumb.JPG","galleries_id":450116,"server_id":18,"link":"photo_8685303.html","width":130,"caption":"","height":173});
															thumbnails[8685188] = clik.newPhoto({"id":8685188,"src":"IMGP0382_4CB58A51-1E4F-37DC-71B764194C43868A_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685188.html","width":130,"caption":"","height":98});
															thumbnails[8685304] = clik.newPhoto({"id":8685304,"src":"017_thumb.JPG","galleries_id":450116,"server_id":18,"link":"photo_8685304.html","width":130,"caption":"","height":98});
															thumbnails[8685107] = clik.newPhoto({"id":8685107,"src":"002_3_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685107.html","width":130,"caption":"","height":98});
															thumbnails[8685340] = clik.newPhoto({"id":8685340,"src":"websize_3_jade_bowls_thumb.jpg","galleries_id":450116,"server_id":18,"link":"photo_8685340.html","width":130,"caption":"","height":98});
															thumbnails[8685373] = clik.newPhoto({"id":8685373,"src":"007_2_thumb.JPG","galleries_id":450116,"server_id":18,"link":"photo_8685373.html","width":130,"caption":"","height":173});
															thumbnails[8696373] = clik.newPhoto({"id":8696373,"src":"003_2_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8696373.html","width":130,"caption":"","height":98});
															thumbnails[8685374] = clik.newPhoto({"id":8685374,"src":"websize_exotic_jade_platter_1_thumb.jpg","galleries_id":450116,"server_id":18,"link":"photo_8685374.html","width":130,"caption":"","height":98});
															thumbnails[8696375] = clik.newPhoto({"id":8696375,"src":"005_4_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8696375.html","width":130,"caption":"","height":173});
															thumbnails[8685113] = clik.newPhoto({"id":8685113,"src":"013_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685113.html","width":130,"caption":"","height":98});
															thumbnails[8685111] = clik.newPhoto({"id":8685111,"src":"010_2_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685111.html","width":130,"caption":"","height":98});
															thumbnails[8696360] = clik.newPhoto({"id":8696360,"src":"012_3_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8696360.html","width":130,"caption":"","height":173});
															thumbnails[8685110] = clik.newPhoto({"id":8685110,"src":"006_4_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685110.html","width":130,"caption":"","height":173});
															thumbnails[8696261] = clik.newPhoto({"id":8696261,"src":"009_2_thumb.JPG","galleries_id":450116,"server_id":18,"link":"photo_8696261.html","width":130,"caption":"","height":98});
															thumbnails[8685294] = clik.newPhoto({"id":8685294,"src":"007_3_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685294.html","width":130,"caption":"","height":173});
															thumbnails[8696262] = clik.newPhoto({"id":8696262,"src":"029_59A630CE-1E4F-37DC-71FA71F6D7F9327B_thumb.JPG","galleries_id":450116,"server_id":18,"link":"photo_8696262.html","width":130,"caption":"","height":98});
															thumbnails[8685295] = clik.newPhoto({"id":8685295,"src":"008_3_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685295.html","width":130,"caption":"","height":173});
															thumbnails[8696303] = clik.newPhoto({"id":8696303,"src":"001_thumb.JPG","galleries_id":450116,"server_id":18,"link":"photo_8696303.html","width":130,"caption":"","height":98});
															thumbnails[8685114] = clik.newPhoto({"id":8685114,"src":"019_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685114.html","width":130,"caption":"","height":173});
															thumbnails[8685296] = clik.newPhoto({"id":8685296,"src":"018_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685296.html","width":130,"caption":"","height":173});
															thumbnails[8685116] = clik.newPhoto({"id":8685116,"src":"023_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685116.html","width":130,"caption":"","height":98});
															thumbnails[8685123] = clik.newPhoto({"id":8685123,"src":"sentinel_5_2_thumb.jpg","galleries_id":450115,"server_id":18,"link":"photo_8685123.html","width":130,"caption":"","height":173});
															thumbnails[8685120] = clik.newPhoto({"id":8685120,"src":"sentinel_4_2_thumb.jpg","galleries_id":450115,"server_id":18,"link":"photo_8685120.html","width":130,"caption":"","height":98});
															thumbnails[8685375] = clik.newPhoto({"id":8685375,"src":"sentinel_4_51_thumb.JPG","galleries_id":450115,"server_id":18,"link":"photo_8685375.html","width":130,"caption":"","height":173});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[450116] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Functional","link":"gallery_450116.html","maxRecords":0.0,"photoIDs":[8685301.0,8685303.0,8685304.0,8685340.0,8685373.0,8685374.0,8696261.0,8696262.0,8696303.0],"skipIndex":0,"section_code":"gallery","featured_images":"8696303,8696262,8696261,8685374,8685373,8685340,8685304,8685303,8685301","id":450116,"singleSection":false});				  						galleries[450115] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sculptural","link":"gallery_450115.html","maxRecords":0.0,"photoIDs":[8685288.0,8685229.0,8685188.0,8685107.0,8696373.0,8696375.0,8685113.0,8685111.0,8696360.0,8685110.0,8685294.0,8685295.0,8685114.0,8685296.0,8685116.0,8685123.0,8685120.0,8685375.0],"skipIndex":0,"section_code":"gallery","featured_images":"8696375,8696373,8696360,8685375,8685296,8685295,8685294,8685288,8685229,8685188","id":450115,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1625066';
imageSets[2] = '2122575,1905178,1625066';
imageSets[3] = '8696375,8696373,8696360,8696303,8696262,8696261,8685375,8685374,8685373,8685340,8685304,8685303,8685301,8685296,8685295,8685294,8685288,8685229,8685188,8685123,8685120,8685116,8685114,8685113,8685111,8685110,8685107,8443693,8443691,8443663,8443656,8443653,8443647,8443642,8443631,8443630,8443629,8443189,6183059,6183048,6123437,6123426,5976948,5770678,5770677,5764868,5509310,5509304,5214312,5214310';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/clairefinlay/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/clairefinlay/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 = 'clairefinlay: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.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 += '<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;
	}
}

			

