window.thumbnails = {};
															thumbnails[3395493] = clik.newPhoto({"id":3395493,"src":"_MG_3554a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395497] = clik.newPhoto({"id":3395497,"src":"_MG_3533a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395501] = clik.newPhoto({"id":3395501,"src":"_MG_3574a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395540] = clik.newPhoto({"id":3395540,"src":"_MG_3613a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395565] = clik.newPhoto({"id":3395565,"src":"_MG_3665a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395544] = clik.newPhoto({"id":3395544,"src":"_MG_3651a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395547] = clik.newPhoto({"id":3395547,"src":"_MG_3658a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395550] = clik.newPhoto({"id":3395550,"src":"cpyrt_MG_3680a_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3395553] = clik.newPhoto({"id":3395553,"src":"_MG_3676a1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3388419] = clik.newPhoto({"id":3388419,"src":"cpyrtinvisiblecities_1_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3388419.html","width":130,"caption":"","height":195});
															thumbnails[3389145] = clik.newPhoto({"id":3389145,"src":"invisiblecities_2_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389145.html","width":130,"caption":"","height":195});
															thumbnails[3389146] = clik.newPhoto({"id":3389146,"src":"invisiblecities_71_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389146.html","width":130,"caption":"","height":195});
															thumbnails[3389148] = clik.newPhoto({"id":3389148,"src":"invisiblecities_13_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389148.html","width":130,"caption":"","height":195});
															thumbnails[3389149] = clik.newPhoto({"id":3389149,"src":"invisiblecities_14_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389149.html","width":130,"caption":"","height":195});
															thumbnails[3389154] = clik.newPhoto({"id":3389154,"src":"invisiblecities_151_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389154.html","width":130,"caption":"","height":195});
															thumbnails[3389156] = clik.newPhoto({"id":3389156,"src":"invisiblecities_31_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389156.html","width":130,"caption":"","height":87});
															thumbnails[3389158] = clik.newPhoto({"id":3389158,"src":"invisiblecities_41_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389158.html","width":130,"caption":"","height":87});
															thumbnails[3389159] = clik.newPhoto({"id":3389159,"src":"invisiblecities_11_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389159.html","width":130,"caption":"","height":87});
															thumbnails[3389161] = clik.newPhoto({"id":3389161,"src":"invisiblecities_17_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389161.html","width":130,"caption":"","height":87});
															thumbnails[3389162] = clik.newPhoto({"id":3389162,"src":"swansea_MG_99221_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389162.html","width":130,"caption":"","height":87});
															thumbnails[3389163] = clik.newPhoto({"id":3389163,"src":"swansea_MG_99251_thumb.jpg","galleries_id":195422,"server_id":5,"link":"photo_3389163.html","width":130,"caption":"","height":87});
															thumbnails[3390929] = clik.newPhoto({"id":3390929,"src":"cpyrgt2print_MG_4463-1812_thumb.jpg","galleries_id":195423,"server_id":5,"link":"photo_3390929.html","width":130,"caption":"","height":87});
															thumbnails[3390932] = clik.newPhoto({"id":3390932,"src":"print_MG_4236aa1812a1_thumb.jpg","galleries_id":195423,"server_id":5,"link":"photo_3390932.html","width":130,"caption":"","height":87});
															thumbnails[3390936] = clik.newPhoto({"id":3390936,"src":"print_MG_3812-1812b1_thumb.jpg","galleries_id":195423,"server_id":5,"link":"photo_3390936.html","width":130,"caption":"","height":87});
															thumbnails[3390939] = clik.newPhoto({"id":3390939,"src":"print_MG_4480-18121_thumb.jpg","galleries_id":195423,"server_id":5,"link":"photo_3390939.html","width":130,"caption":"","height":87});
															thumbnails[3390943] = clik.newPhoto({"id":3390943,"src":"print_MG_4368aa1_thumb.jpg","galleries_id":195423,"server_id":5,"link":"photo_3390943.html","width":130,"caption":"","height":87});
															thumbnails[3390945] = clik.newPhoto({"id":3390945,"src":"printy_MG_4199-18121_thumb.jpg","galleries_id":195423,"server_id":5,"link":"photo_3390945.html","width":130,"caption":"","height":87});
															thumbnails[3391140] = clik.newPhoto({"id":3391140,"src":"cpyrtplate1_1_thumb.jpg","galleries_id":195947,"server_id":5,"link":"photo_3391140.html","width":130,"caption":"","height":87});
															thumbnails[3391142] = clik.newPhoto({"id":3391142,"src":"plate1_2_thumb.jpg","galleries_id":195947,"server_id":5,"link":"photo_3391142.html","width":130,"caption":"","height":87});
															thumbnails[3391144] = clik.newPhoto({"id":3391144,"src":"plate2_11_thumb.jpg","galleries_id":195947,"server_id":5,"link":"photo_3391144.html","width":130,"caption":"","height":87});
															thumbnails[3391145] = clik.newPhoto({"id":3391145,"src":"plate3_21_thumb.jpg","galleries_id":195947,"server_id":5,"link":"photo_3391145.html","width":130,"caption":"","height":87});
															thumbnails[3391157] = clik.newPhoto({"id":3391157,"src":"plate4_1_thumb.jpg","galleries_id":195947,"server_id":5,"link":"photo_3391157.html","width":130,"caption":"","height":195});
															thumbnails[3391176] = clik.newPhoto({"id":3391176,"src":"plate3_1_thumb.jpg","galleries_id":195947,"server_id":5,"link":"photo_3391176.html","width":130,"caption":"","height":195});
															thumbnails[3395462] = clik.newPhoto({"id":3395462,"src":"012_thumb.jpg","galleries_id":195429,"server_id":5,"link":"photo_3395462.html","width":130,"caption":"","height":156});
															thumbnails[3395467] = clik.newPhoto({"id":3395467,"src":"031_thumb.jpg","galleries_id":195429,"server_id":5,"link":"photo_3395467.html","width":130,"caption":"","height":156});
															thumbnails[3395469] = clik.newPhoto({"id":3395469,"src":"091_thumb.jpg","galleries_id":195429,"server_id":5,"link":"photo_3395469.html","width":130,"caption":"","height":156});
															thumbnails[3395473] = clik.newPhoto({"id":3395473,"src":"061_thumb.jpg","galleries_id":195429,"server_id":5,"link":"photo_3395473.html","width":130,"caption":"","height":156});
															thumbnails[3395478] = clik.newPhoto({"id":3395478,"src":"101_thumb.jpg","galleries_id":195429,"server_id":5,"link":"photo_3395478.html","width":130,"caption":"","height":156});
															thumbnails[3395483] = clik.newPhoto({"id":3395483,"src":"131_thumb.jpg","galleries_id":195429,"server_id":5,"link":"photo_3395483.html","width":130,"caption":"","height":156});
															thumbnails[3395612] = clik.newPhoto({"id":3395612,"src":"_MG_3030e22_thumb.jpg","galleries_id":195426,"server_id":5,"link":"photo_3395612.html","width":130,"caption":"","height":195});
															thumbnails[3395614] = clik.newPhoto({"id":3395614,"src":"_MG_3195i2small1_thumb.jpg","galleries_id":195426,"server_id":5,"link":"photo_3395614.html","width":130,"caption":"","height":195});
															thumbnails[3395615] = clik.newPhoto({"id":3395615,"src":"_MG_3217d2small1_thumb.jpg","galleries_id":195426,"server_id":5,"link":"photo_3395615.html","width":130,"caption":"","height":195});
															thumbnails[3395617] = clik.newPhoto({"id":3395617,"src":"_MG_3247g21_thumb.jpg","galleries_id":195426,"server_id":5,"link":"photo_3395617.html","width":130,"caption":"","height":195});
															thumbnails[3395619] = clik.newPhoto({"id":3395619,"src":"_MG_3328d2_thumb.jpg","galleries_id":195426,"server_id":5,"link":"photo_3395619.html","width":130,"caption":"","height":195});
															thumbnails[3395621] = clik.newPhoto({"id":3395621,"src":"_MG_3378c2small2_thumb.jpg","galleries_id":195426,"server_id":5,"link":"photo_3395621.html","width":130,"caption":"","height":195});
															thumbnails[4873909] = clik.newPhoto({"id":4873909,"src":"_MG_0703c_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_4873909.html","width":130,"caption":"","height":130});
															thumbnails[4873911] = clik.newPhoto({"id":4873911,"src":"_MG_0744b_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_4873911.html","width":130,"caption":"","height":130});
															thumbnails[4873923] = clik.newPhoto({"id":4873923,"src":"_MG_0436c_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_4873923.html","width":130,"caption":"","height":130});
															thumbnails[6406232] = clik.newPhoto({"id":6406232,"src":"_MG_0313b_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_6406232.html","width":130,"caption":"","height":130});
															thumbnails[6406234] = clik.newPhoto({"id":6406234,"src":"_MG_0321b_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_6406234.html","width":130,"caption":"","height":130});
															thumbnails[6406235] = clik.newPhoto({"id":6406235,"src":"_MG_0581b_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_6406235.html","width":130,"caption":"","height":130});
															thumbnails[6406236] = clik.newPhoto({"id":6406236,"src":"_MG_0693c_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_6406236.html","width":130,"caption":"","height":130});
															thumbnails[6406237] = clik.newPhoto({"id":6406237,"src":"_MG_8377a_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_6406237.html","width":130,"caption":"","height":130});
															thumbnails[6406238] = clik.newPhoto({"id":6406238,"src":"_MG_9144b_thumb.jpg","galleries_id":278048,"server_id":5,"link":"photo_6406238.html","width":130,"caption":"","height":130});
															thumbnails[6406260] = clik.newPhoto({"id":6406260,"src":"Screenlight0011_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_6406260.html","width":130,"caption":"","height":130});
															thumbnails[6406262] = clik.newPhoto({"id":6406262,"src":"Screenlight002_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_6406262.html","width":130,"caption":"","height":130});
															thumbnails[6406264] = clik.newPhoto({"id":6406264,"src":"Screenlight007_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_6406264.html","width":130,"caption":"","height":130});
															thumbnails[6406265] = clik.newPhoto({"id":6406265,"src":"Screenlight008_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_6406265.html","width":130,"caption":"","height":130});
															thumbnails[6406267] = clik.newPhoto({"id":6406267,"src":"Screenlight009_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_6406267.html","width":130,"caption":"","height":130});
															thumbnails[6406269] = clik.newPhoto({"id":6406269,"src":"Screenlight010_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_6406269.html","width":130,"caption":"","height":130});
															thumbnails[6406354] = clik.newPhoto({"id":6406354,"src":"sewbox009_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406354.html","width":130,"caption":"","height":195});
															thumbnails[6406358] = clik.newPhoto({"id":6406358,"src":"sewbox014b_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406358.html","width":130,"caption":"","height":195});
															thumbnails[6406359] = clik.newPhoto({"id":6406359,"src":"sewbox021_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406359.html","width":130,"caption":"","height":195});
															thumbnails[6406360] = clik.newPhoto({"id":6406360,"src":"sewbox055_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406360.html","width":130,"caption":"","height":195});
															thumbnails[6406361] = clik.newPhoto({"id":6406361,"src":"sewbox078_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406361.html","width":130,"caption":"","height":195});
															thumbnails[6406362] = clik.newPhoto({"id":6406362,"src":"sewbox091_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406362.html","width":130,"caption":"","height":195});
															thumbnails[6406363] = clik.newPhoto({"id":6406363,"src":"sewbox099_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406363.html","width":130,"caption":"","height":195});
															thumbnails[6406364] = clik.newPhoto({"id":6406364,"src":"sewbox109_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406364.html","width":130,"caption":"","height":195});
															thumbnails[6406365] = clik.newPhoto({"id":6406365,"src":"sewbox068_thumb.jpg","galleries_id":353983,"server_id":5,"link":"photo_6406365.html","width":130,"caption":"","height":195});
															thumbnails[3395592] = clik.newPhoto({"id":3395592,"src":"_MG_2541b1_thumb.jpg","galleries_id":195555,"server_id":5,"link":"photo_3395592.html","width":130,"caption":"","height":195});
															thumbnails[3395801] = clik.newPhoto({"id":3395801,"src":"John18c1_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_3395801.html","width":130,"caption":"","height":130});
															thumbnails[3395591] = clik.newPhoto({"id":3395591,"src":"_MG_2529b1_thumb.jpg","galleries_id":195555,"server_id":5,"link":"photo_3395591.html","width":130,"caption":"","height":195});
															thumbnails[3395805] = clik.newPhoto({"id":3395805,"src":"print_MG_4665d_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_3395805.html","width":130,"caption":"","height":130});
															thumbnails[3395589] = clik.newPhoto({"id":3395589,"src":"_MG_2405b1_thumb.jpg","galleries_id":195555,"server_id":5,"link":"photo_3395589.html","width":130,"caption":"","height":195});
															thumbnails[3395808] = clik.newPhoto({"id":3395808,"src":"NewJane4969_thumb.jpg","galleries_id":207334,"server_id":5,"link":"photo_3395808.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[195422] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Invisible Cities","link":"gallery_195422.html","maxRecords":0.0,"photoIDs":[3388419.0,3389145.0,3389146.0,3389148.0,3389149.0,3389154.0,3389156.0,3389158.0,3389159.0,3389161.0,3389162.0,3389163.0],"skipIndex":0,"section_code":"gallery","featured_images":"3389163,3389162,3389161,3389159,3389158,3389156,3389154,3389149,3389148,3389146","id":195422,"singleSection":false});				  						galleries[353983] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sew On","link":"section240846_353983.html","maxRecords":0.0,"photoIDs":[6406354.0,6406358.0,6406359.0,6406360.0,6406361.0,6406362.0,6406363.0,6406364.0,6406365.0],"skipIndex":0,"section_code":"section240846","featured_images":"6406365,6406364,6406363,6406362,6406361,6406360,6406359,6406358,6406354","id":353983,"singleSection":false});				  						galleries[278048] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mobile","link":"section240846_278048.html","maxRecords":0.0,"photoIDs":[4873909.0,4873911.0,4873923.0,6406232.0,6406234.0,6406235.0,6406236.0,6406237.0,6406238.0],"skipIndex":0,"section_code":"section240846","featured_images":"6406238,6406237,6406236,6406235","id":278048,"singleSection":false});				  						galleries[195947] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"A Place of My Own","link":"gallery_195947.html","maxRecords":0.0,"photoIDs":[3391140.0,3391142.0,3391144.0,3391145.0,3391157.0,3391176.0],"skipIndex":0,"section_code":"gallery","featured_images":"3391176,3391157,3391145,3391144,3391142,3391140","id":195947,"singleSection":false});				  						galleries[207334] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Screenlight","link":"section240846_207334.html","maxRecords":0.0,"photoIDs":[6406260.0,6406262.0,6406264.0,6406265.0,6406267.0,6406269.0,3395801.0,3395805.0,3395808.0],"skipIndex":0,"section_code":"section240846","featured_images":"6406269,6406267,6406265,6406264,6406262,6406260","id":207334,"singleSection":false});				  						galleries[195429] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Contemplation","link":"section240846_195429.html","maxRecords":0.0,"photoIDs":[3395462.0,3395467.0,3395469.0,3395473.0,3395478.0,3395483.0],"skipIndex":0,"section_code":"section240846","featured_images":"3395483,3395478,3395473,3395469,3395467,3395462","id":195429,"singleSection":false});				  						galleries[195423] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Thresholds of Light","link":"gallery_195423.html","maxRecords":0.0,"photoIDs":[3390929.0,3390932.0,3390936.0,3390939.0,3390943.0,3390945.0],"skipIndex":0,"section_code":"gallery","featured_images":"3390945,3390943,3390939,3390936,3390932,3390929","id":195423,"singleSection":false});				  						galleries[195555] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fabulous Fruit ","link":"section240846_195555.html","maxRecords":0.0,"photoIDs":[3395592.0,3395591.0,3395589.0],"skipIndex":0,"section_code":"section240846","featured_images":"3395592,3395591,3395589","id":195555,"singleSection":false});				  						galleries[195426] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Polka Dot Narratives","link":"section240846_195426.html","maxRecords":0.0,"photoIDs":[3395612.0,3395614.0,3395615.0,3395617.0,3395619.0,3395621.0],"skipIndex":0,"section_code":"section240846","featured_images":"3395621,3395619,3395617,3395615,3395614,3395612","id":195426,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6406365,6406363,6406362,6406359,6406354,6406264,6406262,6406260,6406238,6406237,6406236,6406235,6406232,4873923,4873911,4873909,3395621,3395619,3395617,3395612,3395478,3395473,3395469,3395467,3395462,3391157,3391145,3391140,3390945,3390943,3390936,3390932,3390929,3389161,3389158,3389156,3389148,3389146,3389145,3395801,3395592,3395805,3395591,3395808,3395589';
imageSets[2] = '6406365,6406364,6406363,6406362,6406361,6406360,6406359,6406358,6406354,6406269,6406267,6406265,6406264,6406262,6406260,6406238,6406237,6406236,6406235';
imageSets[3] = '6406365,6406364,6406363,6406362,6406361,6406360,6406359,6406358,6406354,6406269,6406267,6406265,6406264,6406262,6406260,6406238,6406237,6406236,6406235,6406234,6406232,4873923,4873911,4873909,3395808,3395805,3395801,3395621,3395619,3395617,3395615,3395614,3395612,3395592,3395591,3395589,3395565,3395553,3395550,3395547,3395544,3395540,3395501,3395497,3395493,3395483,3395478,3395473,3395469,3395467';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/paulandhelen/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/paulandhelen/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 = 'Thresholds 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;
	}
}

			

