window.thumbnails = {};
															thumbnails[7682386] = clik.newPhoto({"id":7682386,"src":"ATOLL_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682386.html","width":130,"caption":"","height":196});
															thumbnails[6368356] = clik.newPhoto({"id":6368356,"src":"SCOTLAND_CALLING_thumb.jpg","galleries_id":352423,"server_id":32,"link":"photo_6368356.html","width":130,"caption":"","height":195});
															thumbnails[6331241] = clik.newPhoto({"id":6331241,"src":"AFTER-THE-RAIN3_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6331241.html","width":130,"caption":"","height":196});
															thumbnails[6331286] = clik.newPhoto({"id":6331286,"src":"ANOTHER_PLANET_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6331286.html","width":130,"caption":"","height":195});
															thumbnails[6333194] = clik.newPhoto({"id":6333194,"src":"HARBOUR_BLUES_2_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333194.html","width":130,"caption":"","height":195});
															thumbnails[6331290] = clik.newPhoto({"id":6331290,"src":"BLUE_LAGOON_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6331290.html","width":130,"caption":"","height":195});
															thumbnails[6365990] = clik.newPhoto({"id":6365990,"src":"ENSIGN_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6365990.html","width":130,"caption":"","height":195});
															thumbnails[6331293] = clik.newPhoto({"id":6331293,"src":"CARSAIG_II_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6331293.html","width":130,"caption":"","height":195});
															thumbnails[6331294] = clik.newPhoto({"id":6331294,"src":"CARSAIG_III_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6331294.html","width":130,"caption":"","height":195});
															thumbnails[6331296] = clik.newPhoto({"id":6331296,"src":"CARSIAG_I_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6331296.html","width":130,"caption":"","height":195});
															thumbnails[6331388] = clik.newPhoto({"id":6331388,"src":"CURTAINS_DOWN_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6331388.html","width":130,"caption":"","height":195});
															thumbnails[6333160] = clik.newPhoto({"id":6333160,"src":"WHITEHAVEN_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333160.html","width":130,"caption":"","height":195});
															thumbnails[6333163] = clik.newPhoto({"id":6333163,"src":"SUNSET_OVER_PARADISE_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333163.html","width":130,"caption":"","height":195});
															thumbnails[6333176] = clik.newPhoto({"id":6333176,"src":"MARYPORT_RED_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333176.html","width":130,"caption":"","height":195});
															thumbnails[6366262] = clik.newPhoto({"id":6366262,"src":"Peeling_Green_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366262.html","width":130,"caption":"","height":195});
															thumbnails[6333168] = clik.newPhoto({"id":6333168,"src":"SEA_STREAM_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333168.html","width":130,"caption":"","height":195});
															thumbnails[6333189] = clik.newPhoto({"id":6333189,"src":"MARINE_LACE_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333189.html","width":130,"caption":"","height":195});
															thumbnails[6365670] = clik.newPhoto({"id":6365670,"src":"GRASSY-FIELDS_thumb.jpg","galleries_id":352423,"server_id":32,"link":"photo_6365670.html","width":130,"caption":"","height":87});
															thumbnails[6365726] = clik.newPhoto({"id":6365726,"src":"EBB_TIDE_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365726.html","width":130,"caption":"","height":195});
															thumbnails[6365734] = clik.newPhoto({"id":6365734,"src":"beach_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365734.html","width":130,"caption":"","height":195});
															thumbnails[6365754] = clik.newPhoto({"id":6365754,"src":"COOL_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365754.html","width":130,"caption":"","height":195});
															thumbnails[6365768] = clik.newPhoto({"id":6365768,"src":"KNOCK_VOLOGAN_11_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365768.html","width":130,"caption":"","height":195});
															thumbnails[6365774] = clik.newPhoto({"id":6365774,"src":"FOUR_YOU_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365774.html","width":130,"caption":"","height":195});
															thumbnails[6365785] = clik.newPhoto({"id":6365785,"src":"MUNCHS_ROCK_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365785.html","width":130,"caption":"","height":195});
															thumbnails[6365806] = clik.newPhoto({"id":6365806,"src":"SHARDS_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365806.html","width":130,"caption":"","height":195});
															thumbnails[6365849] = clik.newPhoto({"id":6365849,"src":"THE_HANDSHAKE_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365849.html","width":130,"caption":"","height":195});
															thumbnails[6365869] = clik.newPhoto({"id":6365869,"src":"THE_INNER_SANCTUM_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365869.html","width":130,"caption":"","height":195});
															thumbnails[6365872] = clik.newPhoto({"id":6365872,"src":"STONE_FOLDS_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365872.html","width":130,"caption":"","height":195});
															thumbnails[6365880] = clik.newPhoto({"id":6365880,"src":"THE_LAST_FRONTIER_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6365880.html","width":130,"caption":"","height":195});
															thumbnails[6365997] = clik.newPhoto({"id":6365997,"src":"FRENCH_BLUE_feb_2010_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6365997.html","width":130,"caption":"","height":195});
															thumbnails[6366536] = clik.newPhoto({"id":6366536,"src":"HEART_ACHE_apr_20101_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6366536.html","width":130,"caption":"","height":195});
															thumbnails[6333183] = clik.newPhoto({"id":6333183,"src":"STORMY_SEA_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6333183.html","width":130,"caption":"","height":195});
															thumbnails[6366276] = clik.newPhoto({"id":6366276,"src":"SOMME_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366276.html","width":130,"caption":"","height":195});
															thumbnails[6366291] = clik.newPhoto({"id":6366291,"src":"UP_OR_DOWN_feb_2010_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366291.html","width":130,"caption":"","height":195});
															thumbnails[6366538] = clik.newPhoto({"id":6366538,"src":"LEAVE_ONLY_FOOTPRINTS_apr_2010_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6366538.html","width":130,"caption":"","height":195});
															thumbnails[6366322] = clik.newPhoto({"id":6366322,"src":"MARS_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366322.html","width":130,"caption":"","height":195});
															thumbnails[6366540] = clik.newPhoto({"id":6366540,"src":"THE_TRIP_apr_2010_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6366540.html","width":130,"caption":"","height":195});
															thumbnails[6366326] = clik.newPhoto({"id":6366326,"src":"FANTASY_ICE_feb_2010_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366326.html","width":130,"caption":"","height":195});
															thumbnails[6366367] = clik.newPhoto({"id":6366367,"src":"MOLEY_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366367.html","width":130,"caption":"","height":195});
															thumbnails[6366456] = clik.newPhoto({"id":6366456,"src":"MARYPORT_BARREL_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366456.html","width":130,"caption":"","height":195});
															thumbnails[6366455] = clik.newPhoto({"id":6366455,"src":"LONG_GONE_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366455.html","width":130,"caption":"","height":195});
															thumbnails[6366457] = clik.newPhoto({"id":6366457,"src":"OIL_DRUM_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366457.html","width":130,"caption":"","height":195});
															thumbnails[6366469] = clik.newPhoto({"id":6366469,"src":"MUSCLE_BOUND_apr_2010_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366469.html","width":130,"caption":"","height":195});
															thumbnails[6366472] = clik.newPhoto({"id":6366472,"src":"SLOWLY_smaller_apr_2010_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366472.html","width":130,"caption":"","height":195});
															thumbnails[6366475] = clik.newPhoto({"id":6366475,"src":"DANCING_HIPPO_feb_2010_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366475.html","width":130,"caption":"","height":195});
															thumbnails[6366483] = clik.newPhoto({"id":6366483,"src":"SAND_FIRE_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366483.html","width":130,"caption":"","height":195});
															thumbnails[6366487] = clik.newPhoto({"id":6366487,"src":"SCRAPED_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366487.html","width":130,"caption":"","height":195});
															thumbnails[8406859] = clik.newPhoto({"id":8406859,"src":"VIEW-FROM-BLENCATHRA_thumb.jpg","galleries_id":352423,"server_id":32,"link":"photo_8406859.html","width":130,"caption":"","height":83});
															thumbnails[6366491] = clik.newPhoto({"id":6366491,"src":"SAYE_ALDERNEY_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366491.html","width":130,"caption":"","height":195});
															thumbnails[6366509] = clik.newPhoto({"id":6366509,"src":"DESERTED_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366509.html","width":130,"caption":"","height":195});
															thumbnails[6366522] = clik.newPhoto({"id":6366522,"src":"The_Gairs_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366522.html","width":130,"caption":"","height":195});
															thumbnails[6366523] = clik.newPhoto({"id":6366523,"src":"MY_SPACE_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6366523.html","width":130,"caption":"","height":195});
															thumbnails[6368024] = clik.newPhoto({"id":6368024,"src":"SUNARTS_LAST_POST_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368024.html","width":130,"caption":"","height":195});
															thumbnails[6368030] = clik.newPhoto({"id":6368030,"src":"TEARNAT_BOUND_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368030.html","width":130,"caption":"","height":195});
															thumbnails[6368075] = clik.newPhoto({"id":6368075,"src":"THE_BLACK_TUD_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368075.html","width":130,"caption":"","height":195});
															thumbnails[6368196] = clik.newPhoto({"id":6368196,"src":"TORNADO_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_6368196.html","width":130,"caption":"","height":195});
															thumbnails[6368247] = clik.newPhoto({"id":6368247,"src":"OVERLAP_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368247.html","width":130,"caption":"","height":195});
															thumbnails[6368249] = clik.newPhoto({"id":6368249,"src":"ANDYS_WINDOW_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368249.html","width":130,"caption":"","height":195});
															thumbnails[6368322] = clik.newPhoto({"id":6368322,"src":"SET_IN_STONE_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368322.html","width":130,"caption":"","height":195});
															thumbnails[6368351] = clik.newPhoto({"id":6368351,"src":"BLUE_BARGE1_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368351.html","width":130,"caption":"","height":195});
															thumbnails[6368251] = clik.newPhoto({"id":6368251,"src":"CRINAN_RED_BOAT_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368251.html","width":130,"caption":"","height":195});
															thumbnails[6368275] = clik.newPhoto({"id":6368275,"src":"FLORIAGE_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368275.html","width":130,"caption":"","height":195});
															thumbnails[6368306] = clik.newPhoto({"id":6368306,"src":"CRINAN_BLUE_BOAT_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368306.html","width":130,"caption":"","height":195});
															thumbnails[6368311] = clik.newPhoto({"id":6368311,"src":"GHOST_SHIP_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368311.html","width":130,"caption":"","height":195});
															thumbnails[6368313] = clik.newPhoto({"id":6368313,"src":"RAVENGLASS_BOAT_thumb.jpg","galleries_id":347774,"server_id":32,"link":"photo_6368313.html","width":130,"caption":"","height":195});
															thumbnails[7611688] = clik.newPhoto({"id":7611688,"src":"ECLIPSE_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7611688.html","width":130,"caption":"","height":196});
															thumbnails[7682390] = clik.newPhoto({"id":7682390,"src":"BASKING-SHARK_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682390.html","width":130,"caption":"","height":196});
															thumbnails[7682447] = clik.newPhoto({"id":7682447,"src":"STORM-BREWING_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682447.html","width":130,"caption":"","height":196});
															thumbnails[7611693] = clik.newPhoto({"id":7611693,"src":"JAPAN_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7611693.html","width":130,"caption":"","height":196});
															thumbnails[7682454] = clik.newPhoto({"id":7682454,"src":"OLDER-NOW_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682454.html","width":130,"caption":"","height":196});
															thumbnails[7682455] = clik.newPhoto({"id":7682455,"src":"KRILL_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682455.html","width":130,"caption":"","height":196});
															thumbnails[7611722] = clik.newPhoto({"id":7611722,"src":"STAINED-GLASS-WALL_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7611722.html","width":130,"caption":"","height":196});
															thumbnails[7682457] = clik.newPhoto({"id":7682457,"src":"THE-DEEP_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682457.html","width":130,"caption":"","height":196});
															thumbnails[7682496] = clik.newPhoto({"id":7682496,"src":"ISLAND-OF-LEBANON_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682496.html","width":130,"caption":"","height":196});
															thumbnails[7682497] = clik.newPhoto({"id":7682497,"src":"SAPLINGS_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682497.html","width":130,"caption":"","height":196});
															thumbnails[7682498] = clik.newPhoto({"id":7682498,"src":"BOATYARD-TARTAN_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7682498.html","width":130,"caption":"","height":196});
															thumbnails[7611728] = clik.newPhoto({"id":7611728,"src":"SYMPHONY_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7611728.html","width":130,"caption":"","height":196});
															thumbnails[7611733] = clik.newPhoto({"id":7611733,"src":"GIDEONS-MACK_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7611733.html","width":130,"caption":"","height":196});
															thumbnails[7611742] = clik.newPhoto({"id":7611742,"src":"LAN-COLOURS-2_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_7611742.html","width":130,"caption":"","height":146});
															thumbnails[7682513] = clik.newPhoto({"id":7682513,"src":"THE-FARMERS-ART_thumb.jpg","galleries_id":352423,"server_id":32,"link":"photo_7682513.html","width":130,"caption":"","height":196});
															thumbnails[7682515] = clik.newPhoto({"id":7682515,"src":"PLOUGHED-OAK_thumb.jpg","galleries_id":352423,"server_id":32,"link":"photo_7682515.html","width":130,"caption":"","height":196});
															thumbnails[8012666] = clik.newPhoto({"id":8012666,"src":"ARDCHRANICS-BAR_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_8012666.html","width":130,"caption":"","height":195});
															thumbnails[8012670] = clik.newPhoto({"id":8012670,"src":"THE_SHED_thumb.jpg","galleries_id":347773,"server_id":32,"link":"photo_8012670.html","width":130,"caption":"","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[347773] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"THE ABSTRACT GALLERY","link":"gallery_347773.html","maxRecords":0.0,"photoIDs":[7682386.0,6331241.0,6331286.0,6333194.0,6365990.0,6331388.0,6333160.0,6333163.0,6333176.0,6366262.0,6333168.0,6333189.0,6365997.0,6333183.0,6366276.0,6366291.0,6366322.0,6366326.0,6366367.0,6366456.0,6366455.0,6366457.0,6366469.0,6366472.0,6366475.0,6366483.0,6366487.0,6366491.0,6366509.0,6366522.0,6366523.0,6368196.0,7611688.0,7682390.0,7682447.0,7611693.0,7682454.0,7682455.0,7611722.0,7682457.0,7682496.0,7682497.0,7682498.0,7611728.0,7611733.0,7611742.0,8012666.0,8012670.0],"skipIndex":0,"section_code":"gallery","featured_images":"8012670,8012666,7682496,7682457,7682455,7682447,7682390,7682386,7611742,7611733,7611722,7611693,7611688,6368196,6366523,6366522,6366491,6366483,6366472,6366469,6366456,6366455,6366367,6366326,6366322,6333194,6333189,6333183,6333168,6331286,6331241","id":347773,"singleSection":false});				  						galleries[347774] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ROCKS, BEACHES AND BOATS","link":"gallery_347774.html","maxRecords":0.0,"photoIDs":[6331290.0,6331293.0,6331294.0,6331296.0,6365726.0,6365734.0,6365754.0,6365768.0,6365774.0,6365785.0,6365806.0,6365849.0,6365869.0,6365872.0,6365880.0,6366536.0,6366538.0,6366540.0,6368024.0,6368030.0,6368075.0,6368247.0,6368249.0,6368322.0,6368351.0,6368251.0,6368275.0,6368306.0,6368311.0,6368313.0],"skipIndex":0,"section_code":"gallery","featured_images":"6368351,6368275,6368251,6368249,6368024,6366540,6366538,6366536,6365754,6331296","id":347774,"singleSection":false});				  						galleries[352423] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"LANDSCAPES","link":"gallery_352423.html","maxRecords":0.0,"photoIDs":[6368356.0,6365670.0,8406859.0,7682513.0,7682515.0],"skipIndex":0,"section_code":"gallery","featured_images":"8406859,7682513,6368356","id":352423,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7682386,6368356,6365768,6365754,6365774,6365806,6365785,6365872,6365880,6366536,6365997,6366538,6366291,6366276,6366540,6366322,6366326,6366367,6366456,6366455,6366469,6366483,6366472,8406859,6366491,6366522,6366523,6368024,6368196,6368249,6368351,6368251,6368275,7682390,7682447,7611693,7682455,7682457,7611722,7682496,7611733,7611742,8012666,8012670';
imageSets[2] = '7682386,6368356,6331241,6333194,6331286,6331296,6333189,6333168,6365754,6366536,6333183,6366538,6366540,6366322,6366326,6366367,6366456,6366455,6366469,6366483,6366472,8406859,6366491,6366522,6366523,6368024,6368196,6368249,6368351,6368251,6368275,7682390,7611688,7682447,7611693,7682455,7682457,7611722,7682496,7611733,7611742,7682513,8012666,8012670';
imageSets[3] = '7682386,8406859,7682390,7682447,7611693,7682455,7682457,7611722,7682496,8012666,8012670';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/triciameynell/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/triciameynell/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 = 'Tricia Meynell 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('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.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;
	}
}

			

