window.thumbnails = {};
thumbnails[7633692] = clik.newPhoto({"link":"#","caption":"","height":173,"id":7633692,"server_id":31,"src":"Poles_apart_from_reeality_perhaps_thumb.jpg","galleries_id":"","width":130});
thumbnails[9158290] = clik.newPhoto({"link":"photo_9158290.html","caption":"","height":108,"id":9158290,"server_id":31,"src":"Lumix_moon_three_1_thumb.jpg","galleries_id":409816,"width":130});
thumbnails[9158292] = clik.newPhoto({"link":"photo_9158292.html","caption":"","height":154,"id":9158292,"server_id":31,"src":"moon_jupiter_programme_1_thumb.jpg","galleries_id":409816,"width":130});
thumbnails[7634442] = clik.newPhoto({"link":"photo_7634442.html","caption":"","height":185,"id":7634442,"server_id":31,"src":"use_seventeen_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634448] = clik.newPhoto({"link":"photo_7634448.html","caption":"","height":87,"id":7634448,"server_id":31,"src":"use_sixty_six_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[9158288] = clik.newPhoto({"link":"photo_9158288.html","caption":"","height":103,"id":9158288,"server_id":31,"src":"New_moonJanuary_2013_thumb.jpg","galleries_id":409816,"width":130});
thumbnails[7633574] = clik.newPhoto({"link":"photo_7633574.html","caption":"","height":196,"id":7633574,"server_id":31,"src":"Colours_of_a_nation_set_free_perhaps_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633558] = clik.newPhoto({"link":"photo_7633558.html","caption":"","height":100,"id":7633558,"server_id":31,"src":"Andromeda_thumb.jpg","galleries_id":409816,"width":130});
thumbnails[7633585] = clik.newPhoto({"link":"photo_7633585.html","caption":"","height":173,"id":7633585,"server_id":31,"src":"dragging_away_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781372] = clik.newPhoto({"link":"photo_7781372.html","caption":"","height":136,"id":7781372,"server_id":31,"src":"Derby_from_bulk_trip_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633577] = clik.newPhoto({"link":"photo_7633577.html","caption":"","height":115,"id":7633577,"server_id":31,"src":"covered_moon_thumb.jpg","galleries_id":409816,"width":130});
thumbnails[7792431] = clik.newPhoto({"link":"photo_7792431.html","caption":"","height":185,"id":7792431,"server_id":31,"src":"green_yoke_from_two_hour_bash1_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633690] = clik.newPhoto({"link":"photo_7633690.html","caption":"","height":128,"id":7633690,"server_id":31,"src":"moon_edited_raw_convert_thumb.jpg","galleries_id":409816,"width":130});
thumbnails[7633803] = clik.newPhoto({"link":"photo_7633803.html","caption":"","height":194,"id":7633803,"server_id":31,"src":"time_in_flux_once_more_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633643] = clik.newPhoto({"link":"photo_7633643.html","caption":"","height":194,"id":7633643,"server_id":31,"src":"ghostey_flow_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633623] = clik.newPhoto({"link":"photo_7633623.html","caption":"","height":194,"id":7633623,"server_id":31,"src":"Get_nature_involved_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7796380] = clik.newPhoto({"link":"photo_7796380.html","caption":"","height":246,"id":7796380,"server_id":31,"src":"William_Corry_blue_print_Belfast_ginger_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7781387] = clik.newPhoto({"link":"photo_7781387.html","caption":"","height":218,"id":7781387,"server_id":31,"src":"Rosss_Royal_old_style_brewed_ginger_beer_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633582] = clik.newPhoto({"link":"photo_7633582.html","caption":"","height":187,"id":7633582,"server_id":31,"src":"curves_curves_abstract_curves_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7820954] = clik.newPhoto({"link":"photo_7820954.html","caption":"","height":216,"id":7820954,"server_id":31,"src":"ginger_two_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633500] = clik.newPhoto({"link":"photo_7633500.html","caption":"","height":187,"id":7633500,"server_id":31,"src":"abstracts_more_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7792424] = clik.newPhoto({"link":"photo_7792424.html","caption":"","height":242,"id":7792424,"server_id":31,"src":"Grattan_and_Co_ginger_beer_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[8788506] = clik.newPhoto({"link":"photo_8788506.html","caption":"","height":232,"id":8788506,"server_id":31,"src":"Neal_Carlins_two..._thumb.jpg","galleries_id":420364,"width":130});
thumbnails[8788525] = clik.newPhoto({"link":"photo_8788525.html","caption":"","height":275,"id":8788525,"server_id":31,"src":"Newry_mineral_water_company_ginger_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634470] = clik.newPhoto({"link":"photo_7634470.html","caption":"","height":196,"id":7634470,"server_id":31,"src":"yes_another_abstract_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7792429] = clik.newPhoto({"link":"photo_7792429.html","caption":"","height":173,"id":7792429,"server_id":31,"src":"Grattan_glass_ginger_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634465] = clik.newPhoto({"link":"photo_7634465.html","caption":"","height":196,"id":7634465,"server_id":31,"src":"Vertical_in_abstractjpg_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781407] = clik.newPhoto({"link":"photo_7781407.html","caption":"","height":113,"id":7781407,"server_id":31,"src":"Three_Londonderry_gingers_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634387] = clik.newPhoto({"link":"photo_7634387.html","caption":"","height":184,"id":7634387,"server_id":31,"src":"use_fourteen_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781409] = clik.newPhoto({"link":"photo_7781409.html","caption":"","height":122,"id":7781409,"server_id":31,"src":"three_lovely_blue_transfer_gingers_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7781402] = clik.newPhoto({"link":"photo_7781402.html","caption":"","height":55,"id":7781402,"server_id":31,"src":"Soda_water_Taylors_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634364] = clik.newPhoto({"link":"photo_7634364.html","caption":"","height":171,"id":7634364,"server_id":31,"src":"use_forty_six_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781364] = clik.newPhoto({"link":"photo_7781364.html","caption":"","height":292,"id":7781364,"server_id":31,"src":"amber_globe_codd_one_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634324] = clik.newPhoto({"link":"photo_7634324.html","caption":"","height":194,"id":7634324,"server_id":31,"src":"use_fifty_seven_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7792422] = clik.newPhoto({"link":"photo_7792422.html","caption":"","height":199,"id":7792422,"server_id":31,"src":"Globe_front_and_back_copy_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634321] = clik.newPhoto({"link":"photo_7634321.html","caption":"","height":194,"id":7634321,"server_id":31,"src":"use_fifty_one_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7796386] = clik.newPhoto({"link":"photo_7796386.html","caption":"","height":288,"id":7796386,"server_id":31,"src":"William_Dully_and_sons_ten_ounce_codd_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634316] = clik.newPhoto({"link":"photo_7634316.html","caption":"","height":194,"id":7634316,"server_id":31,"src":"use_fifty_eight_thumb.jpg","galleries_id":462724,"width":130});
thumbnails[7781384] = clik.newPhoto({"link":"photo_7781384.html","caption":"","height":274,"id":7781384,"server_id":31,"src":"Rinko_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633750] = clik.newPhoto({"link":"photo_7633750.html","caption":"","height":196,"id":7633750,"server_id":31,"src":"rock_abstracts_forever_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781405] = clik.newPhoto({"link":"photo_7781405.html","caption":"","height":128,"id":7781405,"server_id":31,"src":"three_Codds_three_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633748] = clik.newPhoto({"link":"photo_7633748.html","caption":"","height":187,"id":7633748,"server_id":31,"src":"rich_striations_of_the_mind_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7792433] = clik.newPhoto({"link":"photo_7792433.html","caption":"","height":272,"id":7792433,"server_id":31,"src":"J_S_Clarke_Ipswich_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633671] = clik.newPhoto({"link":"photo_7633671.html","caption":"","height":196,"id":7633671,"server_id":31,"src":"lovely_abstract_again_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7796392] = clik.newPhoto({"link":"photo_7796392.html","caption":"","height":210,"id":7796392,"server_id":31,"src":"Dumpy_mineral_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633589] = clik.newPhoto({"link":"photo_7633589.html","caption":"","height":187,"id":7633589,"server_id":31,"src":"geological_abstracted_context_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781375] = clik.newPhoto({"link":"photo_7781375.html","caption":"","height":320,"id":7781375,"server_id":31,"src":"jacks_mineral_waters_Belfast_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7792441] = clik.newPhoto({"link":"photo_7792441.html","caption":"","height":124,"id":7792441,"server_id":31,"src":"three_cylinders_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7781404] = clik.newPhoto({"link":"photo_7781404.html","caption":"","height":122,"id":7781404,"server_id":31,"src":"Stotherts_trio_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634456] = clik.newPhoto({"link":"photo_7634456.html","caption":"","height":194,"id":7634456,"server_id":31,"src":"use_thirty_nine_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781378] = clik.newPhoto({"link":"photo_7781378.html","caption":"","height":284,"id":7781378,"server_id":31,"src":"fdfsfdsfdsfd_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[8788533] = clik.newPhoto({"link":"photo_8788533.html","caption":"","height":230,"id":8788533,"server_id":31,"src":"J.A.Lomax_Chicago_Hutchinson_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7634399] = clik.newPhoto({"link":"photo_7634399.html","caption":"","height":185,"id":7634399,"server_id":31,"src":"use_seven_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7781390] = clik.newPhoto({"link":"photo_7781390.html","caption":"","height":201,"id":7781390,"server_id":31,"src":"Shrewsbury_Virol_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7781388] = clik.newPhoto({"link":"photo_7781388.html","caption":"","height":173,"id":7781388,"server_id":31,"src":"Sepia_Stranraer_two_thumb.jpg","galleries_id":420364,"width":130});
thumbnails[7633715] = clik.newPhoto({"link":"photo_7633715.html","caption":"","height":187,"id":7633715,"server_id":31,"src":"reasoning_never_to_decay1_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633765] = clik.newPhoto({"link":"photo_7633765.html","caption":"","height":196,"id":7633765,"server_id":31,"src":"scary_rock_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633668] = clik.newPhoto({"link":"photo_7633668.html","caption":"","height":196,"id":7633668,"server_id":31,"src":"hooks_of_time_exposed_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633662] = clik.newPhoto({"link":"photo_7633662.html","caption":"","height":194,"id":7633662,"server_id":31,"src":"hare_art_three_thumb.jpg","galleries_id":462724,"width":130});
thumbnails[7633664] = clik.newPhoto({"link":"photo_7633664.html","caption":"","height":172,"id":7633664,"server_id":31,"src":"hares_art_two_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633660] = clik.newPhoto({"link":"photo_7633660.html","caption":"","height":200,"id":7633660,"server_id":31,"src":"hare_art_five_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633587] = clik.newPhoto({"link":"photo_7633587.html","caption":"","height":187,"id":7633587,"server_id":31,"src":"face_of_Autumn_exposed_edited-1001_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633544] = clik.newPhoto({"link":"photo_7633544.html","caption":"","height":194,"id":7633544,"server_id":31,"src":"amazing_abstract_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633666] = clik.newPhoto({"link":"photo_7633666.html","caption":"","height":187,"id":7633666,"server_id":31,"src":"Hill_of_geological_contexts_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633678] = clik.newPhoto({"link":"photo_7633678.html","caption":"","height":191,"id":7633678,"server_id":31,"src":"Makeral_rock_study_one_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633688] = clik.newPhoto({"link":"photo_7633688.html","caption":"","height":173,"id":7633688,"server_id":31,"src":"martello_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634350] = clik.newPhoto({"link":"photo_7634350.html","caption":"","height":185,"id":7634350,"server_id":31,"src":"use_five_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634444] = clik.newPhoto({"link":"photo_7634444.html","caption":"","height":185,"id":7634444,"server_id":31,"src":"use_sixteen_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7633810] = clik.newPhoto({"link":"photo_7633810.html","caption":"","height":194,"id":7633810,"server_id":31,"src":"use_fifteen_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634458] = clik.newPhoto({"link":"photo_7634458.html","caption":"","height":185,"id":7634458,"server_id":31,"src":"use_twenty_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7796400] = clik.newPhoto({"link":"photo_7796400.html","caption":"","height":173,"id":7796400,"server_id":31,"src":"majorca_for_webbie_four_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7819698] = clik.newPhoto({"link":"photo_7819698.html","caption":"","height":76,"id":7819698,"server_id":31,"src":"majorca_for_webbie_eight_thumb.jpg","galleries_id":462724,"width":130});
thumbnails[7634467] = clik.newPhoto({"link":"photo_7634467.html","caption":"","height":87,"id":7634467,"server_id":31,"src":"weird_iron_art_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634461] = clik.newPhoto({"link":"photo_7634461.html","caption":"","height":87,"id":7634461,"server_id":31,"src":"use_twenty_seven_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634455] = clik.newPhoto({"link":"photo_7634455.html","caption":"","height":87,"id":7634455,"server_id":31,"src":"use_thirty_five_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634452] = clik.newPhoto({"link":"photo_7634452.html","caption":"","height":87,"id":7634452,"server_id":31,"src":"use_thirty_eight_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634450] = clik.newPhoto({"link":"photo_7634450.html","caption":"","height":87,"id":7634450,"server_id":31,"src":"use_thirty_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634397] = clik.newPhoto({"link":"photo_7634397.html","caption":"","height":87,"id":7634397,"server_id":31,"src":"use_one_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634358] = clik.newPhoto({"link":"photo_7634358.html","caption":"","height":87,"id":7634358,"server_id":31,"src":"use_forty_one_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634355] = clik.newPhoto({"link":"photo_7634355.html","caption":"","height":194,"id":7634355,"server_id":31,"src":"use_forty_four_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7634330] = clik.newPhoto({"link":"photo_7634330.html","caption":"","height":133,"id":7634330,"server_id":31,"src":"use_fifty_two_thumb.jpg","galleries_id":462724,"width":130});
thumbnails[7634319] = clik.newPhoto({"link":"photo_7634319.html","caption":"","height":87,"id":7634319,"server_id":31,"src":"use_fifty_five_thumb.jpg","galleries_id":462724,"width":130});
thumbnails[7633806] = clik.newPhoto({"link":"photo_7633806.html","caption":"","height":86,"id":7633806,"server_id":31,"src":"timeless_abstracts_of_geological_turmoil_thumb.jpg","galleries_id":409815,"width":130});
thumbnails[7566868] = clik.newPhoto({"link":"photo_7566868.html","caption":"","height":98,"id":7566868,"server_id":31,"src":"rockscape_one_thumb.jpg","galleries_id":409815,"width":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
galleries[409815] = clik.newGallery({"photoIDs":[7634442,7634448,7633574,7633585,7633803,7633643,7633623,7633582,7633500,7634470,7634465,7634387,7634364,7634324,7634321,7633750,7633748,7633671,7633589,7634456,7634399,7633715,7633765,7633668,7633664,7633660,7633587,7633544,7633666,7633678,7633688,7634350,7634444,7633810,7634458,7796400,7634467,7634461,7634455,7634452,7634450,7634397,7634358,7634355,7633806,7566868],"link":"gallery_409815.html","skipIndex":0,"section_code":"gallery","id":409815,"parentGallery":"","featured_images":"7634470,7634456,7634399,7634324,7634321,7633810,7633748,7633715,7633671,7633668,7633589,7633585,7633582,7633574,7633500","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Main gallery"});galleries[462724] = clik.newGallery({"photoIDs":[7634316,7633662,7819698,7634330,7634319],"link":"gallery_462724.html","skipIndex":0,"section_code":"gallery","id":462724,"parentGallery":"","featured_images":"7634316,7633662","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Monochrome photography"});galleries[409816] = clik.newGallery({"photoIDs":[9158290,9158292,9158288,7633558,7633577,7633690],"link":"gallery_409816.html","skipIndex":0,"section_code":"gallery","id":409816,"parentGallery":"","featured_images":"7633577,7633558","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Astronomy"});galleries[420364] = clik.newGallery({"photoIDs":[7781372,7792431,7796380,7781387,7820954,7792424,8788506,8788525,7792429,7781407,7781409,7781402,7781364,7792422,7796386,7781384,7781405,7792433,7796392,7781375,7792441,7781404,7781378,8788533,7781390,7781388],"link":"gallery_420364.html","skipIndex":0,"section_code":"gallery","id":420364,"parentGallery":"","featured_images":"7792441,7792431,7781388","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Bottle collecting"});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[3] = '7634448,7634442,7633574,7781372,7633585,7633558,7792431,7633692,7633577,7633690,7633643,7796380,7633623,7781387,7633582,7820954,7792424,7633500,7792429,7634470,7781407,7634465,7781409,7634387,7781402,7781364,7634364,7792422,7634324,7796386,7634321,7781384,7634316,7781405,7633750,7792433,7633748,7796392,7633671,7781375,7633589,7792441,7781404,7781378,7634456,7781390,7634399,7781388,7633715,7633765,7633668,7633662,7633664,7633660,7633587,7633544,7633666,7633678,7633688,7634350,7634444,7633810,7634458,7796400,7819698,7634467,7634461,7634455,7634452,7634450,7634397,7634358,7634355,7634330,7634319,7633806,7566868';
imageSets[2] = '7633574,7633585,7633558,7792431,7633577,7633582,7633500,7634470,7634324,7634321,7634316,7633748,7633671,7633589,7792441,7634456,7634399,7781388,7633715,7633668,7633662,7633810';
imageSets[1] = '7633574,7633585,7633643,7633623,7633582,7633500,7634387,7634321,7634316,7633748,7633671,7633589,7634456,7634399,7633668,7633662,7633810,7634458,7634467,7634461,7634452,7634358,7634330';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/timeforcreation/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/timeforcreation/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = (backgrounds || photos || {})[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
				  document.title = 'timewithphotos.com: ' + 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> &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.item_price !== '') {
			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;
	}
}

		

