window.thumbnails = {};
															thumbnails[2940262] = clik.newPhoto({"id":2940262,"src":"No13__Rays_of_autumn_light_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_2940262.html","width":130,"caption":"","height":87});
															thumbnails[2940316] = clik.newPhoto({"id":2940316,"src":"No_29__Wavy_walk_thumb.jpg","galleries_id":204207,"server_id":1,"link":"photo_2940316.html","width":130,"caption":"","height":195});
															thumbnails[3017605] = clik.newPhoto({"id":3017605,"src":"A_Distant_View_of_The_Fells1_thumb.JPG","galleries_id":185650,"server_id":1,"link":"photo_3017605.html","width":130,"caption":"","height":86});
															thumbnails[3017610] = clik.newPhoto({"id":3017610,"src":"Distant_Fells_thumb.JPG","galleries_id":185650,"server_id":1,"link":"photo_3017610.html","width":130,"caption":"","height":86});
															thumbnails[3017627] = clik.newPhoto({"id":3017627,"src":"The_FellLake_View_thumb.JPG","galleries_id":185650,"server_id":1,"link":"photo_3017627.html","width":130,"caption":"","height":86});
															thumbnails[3017629] = clik.newPhoto({"id":3017629,"src":"The_Old_Walk_thumb.JPG","galleries_id":185650,"server_id":1,"link":"photo_3017629.html","width":130,"caption":"","height":86});
															thumbnails[3017631] = clik.newPhoto({"id":3017631,"src":"Winding_Walls_thumb.JPG","galleries_id":185650,"server_id":1,"link":"photo_3017631.html","width":130,"caption":"","height":86});
															thumbnails[3226299] = clik.newPhoto({"id":3226299,"src":"The_Climbing_Rose_1_a_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3226299.html","width":130,"caption":"","height":195});
															thumbnails[3228718] = clik.newPhoto({"id":3228718,"src":"The_peaceful_seat_thumb.JPG","galleries_id":185650,"server_id":1,"link":"photo_3228718.html","width":130,"caption":"","height":195});
															thumbnails[3232617] = clik.newPhoto({"id":3232617,"src":"The_Floral_Bunch_1_a_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3232617.html","width":130,"caption":"","height":87});
															thumbnails[3232751] = clik.newPhoto({"id":3232751,"src":"Rose_of_Droplets_1_a_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3232751.html","width":130,"caption":"","height":86});
															thumbnails[3300985] = clik.newPhoto({"id":3300985,"src":"the_three_Orchids_1_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3300985.html","width":130,"caption":"","height":87});
															thumbnails[3322573] = clik.newPhoto({"id":3322573,"src":"Mr_Heron_1a_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3322573.html","width":130,"caption":"","height":87});
															thumbnails[3322592] = clik.newPhoto({"id":3322592,"src":"Mr_P_1a_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3322592.html","width":130,"caption":"","height":86});
															thumbnails[3322598] = clik.newPhoto({"id":3322598,"src":"The_redshank_1a_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3322598.html","width":130,"caption":"","height":87});
															thumbnails[3330891] = clik.newPhoto({"id":3330891,"src":"Clouds_of_Visions_1a_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3330891.html","width":130,"caption":"","height":87});
															thumbnails[3346669] = clik.newPhoto({"id":3346669,"src":"The_old_boy_1a_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3346669.html","width":130,"caption":"","height":87});
															thumbnails[3522788] = clik.newPhoto({"id":3522788,"src":"Sunlit_Snowdrops_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3522788.html","width":130,"caption":"","height":87});
															thumbnails[3527877] = clik.newPhoto({"id":3527877,"src":"Strutting_Pheasant_a_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3527877.html","width":130,"caption":"","height":87});
															thumbnails[3644200] = clik.newPhoto({"id":3644200,"src":"Orchid_Bunch_A_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3644200.html","width":130,"caption":"","height":86});
															thumbnails[3744569] = clik.newPhoto({"id":3744569,"src":"Deer_Watching_A_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_3744569.html","width":130,"caption":"","height":87});
															thumbnails[3788279] = clik.newPhoto({"id":3788279,"src":"Close_Bluebell_Encounter_A_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_3788279.html","width":130,"caption":"","height":195});
															thumbnails[4070960] = clik.newPhoto({"id":4070960,"src":"Lavenham_Church_A_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_4070960.html","width":130,"caption":"","height":87});
															thumbnails[4070962] = clik.newPhoto({"id":4070962,"src":"Lavenham_View_1a_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_4070962.html","width":130,"caption":"","height":87});
															thumbnails[4070968] = clik.newPhoto({"id":4070968,"src":"Woodbridge_1a_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_4070968.html","width":130,"caption":"","height":87});
															thumbnails[4423818] = clik.newPhoto({"id":4423818,"src":"Landing_Avocet_Portrait_2_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_4423818.html","width":130,"caption":"","height":195});
															thumbnails[4423837] = clik.newPhoto({"id":4423837,"src":"Landind_Avocet_b1_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_4423837.html","width":130,"caption":"","height":87});
															thumbnails[4969346] = clik.newPhoto({"id":4969346,"src":"Blossoming_St_Gregories_1a_web_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_4969346.html","width":130,"caption":"","height":195});
															thumbnails[4969461] = clik.newPhoto({"id":4969461,"src":"Salmon_Leap_View_1web_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_4969461.html","width":130,"caption":"","height":62});
															thumbnails[4969704] = clik.newPhoto({"id":4969704,"src":"Red_wood_seat_web1_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_4969704.html","width":130,"caption":"","height":87});
															thumbnails[5285910] = clik.newPhoto({"id":5285910,"src":"snow_floodgate_A_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_5285910.html","width":130,"caption":"","height":86});
															thumbnails[5925032] = clik.newPhoto({"id":5925032,"src":"Mums_Camillia_A_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_5925032.html","width":130,"caption":"","height":87});
															thumbnails[5925034] = clik.newPhoto({"id":5925034,"src":"Gainsborough_a_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_5925034.html","width":130,"caption":"","height":87});
															thumbnails[5930643] = clik.newPhoto({"id":5930643,"src":"Viaduct_View_a_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_5930643.html","width":130,"caption":"","height":195});
															thumbnails[6482019] = clik.newPhoto({"id":6482019,"src":"Festival_Display_a_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_6482019.html","width":130,"caption":"","height":61});
															thumbnails[6504904] = clik.newPhoto({"id":6504904,"src":"Loves_Rose_b_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_6504904.html","width":130,"caption":"","height":167});
															thumbnails[6665044] = clik.newPhoto({"id":6665044,"src":"Evening_Ponies_A_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_6665044.html","width":130,"caption":"","height":86});
															thumbnails[6665045] = clik.newPhoto({"id":6665045,"src":"Reflections_ab_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_6665045.html","width":130,"caption":"","height":59});
															thumbnails[6665046] = clik.newPhoto({"id":6665046,"src":"Sunlit_woods_2a_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_6665046.html","width":130,"caption":"","height":86});
															thumbnails[6665049] = clik.newPhoto({"id":6665049,"src":"Apple_bridge_A_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_6665049.html","width":130,"caption":"","height":86});
															thumbnails[6665051] = clik.newPhoto({"id":6665051,"src":"Summer_Ford_a_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_6665051.html","width":130,"caption":"","height":86});
															thumbnails[6665153] = clik.newPhoto({"id":6665153,"src":"Daffodil_view_A_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_6665153.html","width":130,"caption":"","height":86});
															thumbnails[6665154] = clik.newPhoto({"id":6665154,"src":"Evenening_pool_2a1_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_6665154.html","width":130,"caption":"","height":86});
															thumbnails[6696094] = clik.newPhoto({"id":6696094,"src":"The_Meadow_Mist_A_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_6696094.html","width":130,"caption":"","height":54});
															thumbnails[6696097] = clik.newPhoto({"id":6696097,"src":"Meadow_bridge_A_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_6696097.html","width":130,"caption":"","height":86});
															thumbnails[6824293] = clik.newPhoto({"id":6824293,"src":"Cauesway_Waves_A_thumb.jpg","galleries_id":204207,"server_id":1,"link":"photo_6824293.html","width":130,"caption":"","height":86});
															thumbnails[6824296] = clik.newPhoto({"id":6824296,"src":"Causeway_beach_head_A_thumb.jpg","galleries_id":204207,"server_id":1,"link":"photo_6824296.html","width":130,"caption":"","height":86});
															thumbnails[6824298] = clik.newPhoto({"id":6824298,"src":"Causeway_Coast_A_thumb.jpg","galleries_id":204207,"server_id":1,"link":"photo_6824298.html","width":130,"caption":"","height":195});
															thumbnails[6824300] = clik.newPhoto({"id":6824300,"src":"Portrush_Morning_Fishing_D1_thumb.jpg","galleries_id":204207,"server_id":1,"link":"photo_6824300.html","width":130,"caption":"","height":86});
															thumbnails[7120650] = clik.newPhoto({"id":7120650,"src":"Autumn_Beech_Path_2B_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_7120650.html","width":130,"caption":"","height":195});
															thumbnails[7120653] = clik.newPhoto({"id":7120653,"src":"Through_the_Autumn_Beech_1B_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_7120653.html","width":130,"caption":"","height":86});
															thumbnails[7120688] = clik.newPhoto({"id":7120688,"src":"Puddle_in_the_path_1a_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_7120688.html","width":130,"caption":"","height":195});
															thumbnails[7120690] = clik.newPhoto({"id":7120690,"src":"The_Olde_Roman_Path_in_Autumn_1a_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_7120690.html","width":130,"caption":"","height":195});
															thumbnails[7229091] = clik.newPhoto({"id":7229091,"src":"bluebell_tree_a_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_7229091.html","width":130,"caption":"","height":59});
															thumbnails[7229094] = clik.newPhoto({"id":7229094,"src":"Blue_times_a1_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_7229094.html","width":130,"caption":"","height":58});
															thumbnails[7229095] = clik.newPhoto({"id":7229095,"src":"Through_the_bells_a_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_7229095.html","width":130,"caption":"","height":49});
															thumbnails[7229182] = clik.newPhoto({"id":7229182,"src":"Pathway_to_the_light_a_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_7229182.html","width":130,"caption":"","height":59});
															thumbnails[7467024] = clik.newPhoto({"id":7467024,"src":"Iris_Flower_a_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_7467024.html","width":130,"caption":"","height":86});
															thumbnails[7477579] = clik.newPhoto({"id":7477579,"src":"Coastal_Ruins_A_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_7477579.html","width":130,"caption":"","height":63});
															thumbnails[7477598] = clik.newPhoto({"id":7477598,"src":"Parked_up__A_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7477598.html","width":130,"caption":"","height":86});
															thumbnails[7477601] = clik.newPhoto({"id":7477601,"src":"Sepia_Wall_A_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7477601.html","width":130,"caption":"","height":86});
															thumbnails[7477603] = clik.newPhoto({"id":7477603,"src":"Olde_Boat_A_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7477603.html","width":130,"caption":"","height":86});
															thumbnails[7477606] = clik.newPhoto({"id":7477606,"src":"The_Anchor_A_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7477606.html","width":130,"caption":"","height":86});
															thumbnails[7477608] = clik.newPhoto({"id":7477608,"src":"Olde_Wall_A_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7477608.html","width":130,"caption":"","height":86});
															thumbnails[7533145] = clik.newPhoto({"id":7533145,"src":"Gerbera_Daisy_crop_2a_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_7533145.html","width":130,"caption":"","height":92});
															thumbnails[7533152] = clik.newPhoto({"id":7533152,"src":"Patunias_a_thumb.jpg","galleries_id":196910,"server_id":1,"link":"photo_7533152.html","width":130,"caption":"","height":195});
															thumbnails[7574263] = clik.newPhoto({"id":7574263,"src":"Awaiting_Bloom_a_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7574263.html","width":130,"caption":"","height":212});
															thumbnails[7574264] = clik.newPhoto({"id":7574264,"src":"Lone_Iris_a_thumb.jpg","galleries_id":405415,"server_id":1,"link":"photo_7574264.html","width":130,"caption":"","height":92});
															thumbnails[7575103] = clik.newPhoto({"id":7575103,"src":"St_Osyth_Old_Timer_A_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_7575103.html","width":130,"caption":"","height":64});
															thumbnails[7910874] = clik.newPhoto({"id":7910874,"src":"A_Evening_Frost_on_the_Mount__A_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_7910874.html","width":130,"caption":"","height":86});
															thumbnails[8066038] = clik.newPhoto({"id":8066038,"src":"Beached_A1_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_8066038.html","width":130,"caption":"","height":62});
															thumbnails[8212110] = clik.newPhoto({"id":8212110,"src":"Round_to_Ballingdon_Bridge_a_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_8212110.html","width":130,"caption":"","height":69});
															thumbnails[8212116] = clik.newPhoto({"id":8212116,"src":"Rushing_Salmon_Leap_a_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_8212116.html","width":130,"caption":"","height":86});
															thumbnails[8224842] = clik.newPhoto({"id":8224842,"src":"Autumn_Gate_1_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_8224842.html","width":130,"caption":"","height":195});
															thumbnails[8224844] = clik.newPhoto({"id":8224844,"src":"Olde_Oak_1_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_8224844.html","width":130,"caption":"","height":86});
															thumbnails[8224888] = clik.newPhoto({"id":8224888,"src":"A_Gulls_View_1_thumb.jpg","galleries_id":202504,"server_id":1,"link":"photo_8224888.html","width":130,"caption":"","height":195});
															thumbnails[8235074] = clik.newPhoto({"id":8235074,"src":"Light_in_the_bells_1_thumb.jpg","galleries_id":185650,"server_id":1,"link":"photo_8235074.html","width":130,"caption":"","height":195});
															thumbnails[8281107] = clik.newPhoto({"id":8281107,"src":"Out_on_the_river_A2_thumb.jpg","galleries_id":441496,"server_id":1,"link":"photo_8281107.html","width":130,"caption":"","height":69});
															thumbnails[8629793] = clik.newPhoto({"id":8629793,"src":"Moos_at_Mill_a_thumb.jpg","galleries_id":244783,"server_id":1,"link":"photo_8629793.html","width":130,"caption":"","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[405415] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"B&W and Sepia","link":"gallery_405415.html","maxRecords":0.0,"photoIDs":[4070962.0,4070968.0,7477598.0,7477601.0,7477603.0,7477606.0,7477608.0,7574263.0,7574264.0],"skipIndex":0,"section_code":"gallery","featured_images":"7574264,7574263,7477608,7477606,7477603,7477601,7477598,4070968,4070962","id":405415,"singleSection":false});				  						galleries[202504] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Birds & Animals","link":"gallery_202504.html","maxRecords":0.0,"photoIDs":[3322573.0,3322592.0,3322598.0,3330891.0,3346669.0,3527877.0,3744569.0,4423818.0,4423837.0,8224888.0],"skipIndex":0,"section_code":"gallery","featured_images":"8224888,4423837,4423818,3744569,3527877,3346669,3330891,3322598,3322592,3322573","id":202504,"singleSection":false});				  						galleries[204207] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Coastal","link":"gallery_204207.html","maxRecords":0.0,"photoIDs":[2940316.0,6824293.0,6824296.0,6824298.0,6824300.0],"skipIndex":0,"section_code":"gallery","featured_images":"6824300,6824298,6824296,6824293,2940316","id":204207,"singleSection":false});				  						galleries[244783] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"East Anglian Scenes","link":"gallery_244783.html","maxRecords":0.0,"photoIDs":[4070960.0,4969346.0,5925034.0,5930643.0,6665153.0,6665154.0,7910874.0,8212116.0,8629793.0],"skipIndex":0,"section_code":"gallery","featured_images":"8629793,8212116,7910874,6665154,6665153,5930643,5925034,4969346,4070960","id":244783,"singleSection":false});				  						galleries[196910] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Floral","link":"gallery_196910.html","maxRecords":0.0,"photoIDs":[3226299.0,3232617.0,3232751.0,3300985.0,3522788.0,3644200.0,3788279.0,5925032.0,6504904.0,7467024.0,7533145.0,7533152.0],"skipIndex":0,"section_code":"gallery","featured_images":"7533152,7533145,7467024,6504904,5925032,3788279,3644200,3522788,3300985,3232751","id":196910,"singleSection":false});				  						galleries[185650] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape","link":"gallery_185650.html","maxRecords":0.0,"photoIDs":[2940262.0,3017605.0,3017610.0,3017627.0,3017629.0,3017631.0,3228718.0,4969704.0,5285910.0,6665044.0,6665046.0,6665049.0,6665051.0,6696097.0,7120650.0,7120653.0,7120688.0,7120690.0,8224842.0,8224844.0,8235074.0],"skipIndex":0,"section_code":"gallery","featured_images":"8235074,8224844,8224842,7120690,7120688,7120653,7120650,6696097,6665051,6665049","id":185650,"singleSection":false});				  						galleries[441496] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Panoramics & Cropped","link":"gallery_441496.html","maxRecords":0.0,"photoIDs":[4969461.0,6482019.0,6665045.0,6696094.0,7229091.0,7229094.0,7229095.0,7229182.0,7477579.0,7575103.0,8066038.0,8212110.0,8281107.0],"skipIndex":0,"section_code":"gallery","featured_images":"8281107,8212110,8066038,7575103,7477579,7229182,7229095,7229094,7229091,6696094","id":441496,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3644200,3522788,3346669,3330891,3322573,3300985,3232617,3017627,2940262';
imageSets[3] = '8629793,8281107,8235074,8224888,8224844,8224842,8212116,8212110,8066038,7910874,7575103,7574264,7574263,7533152,7533145,7477608,7477606,7477603,7477601,7477598,7477579,7467024,7229182,7229095,7229094,7229091,7120690,7120688,7120653,7120650,6824300,6824298,6824296,6824293,6696097,6696094,6665154,6665153,6665051,6665049,6665046,6665045,6665044,6504904,6482019,5930643,5925034,5925032,5285910,4969704';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/trevburch/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/trevburch/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/trevburch/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/trevburch/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/trevburch/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/trevburch/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/trevburch/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 = 'Trevor Burch Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('remove').show();}
				else{
					$('#paymentConfirm', root).text('remove').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="TREVBURCH">';
			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">remove</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;
	}
}

			

