window.thumbnails = {};
															thumbnails[1786497] = clik.newPhoto({"id":1786497,"src":"web im 06_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":90});
															thumbnails[1786503] = clik.newPhoto({"id":1786503,"src":"web im 07_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":134});
															thumbnails[1785729] = clik.newPhoto({"id":1785729,"src":"web im 01_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_1785729.html","width":130,"caption":"","height":99});
															thumbnails[1786483] = clik.newPhoto({"id":1786483,"src":"Powder_Byrne_MB_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_1786483.html","width":130,"caption":"","height":90});
															thumbnails[1870605] = clik.newPhoto({"id":1870605,"src":"ski_052a_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_1870605.html","width":130,"caption":"","height":86});
															thumbnails[1870783] = clik.newPhoto({"id":1870783,"src":"n668746135_1607886_1186a_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_1870783.html","width":130,"caption":"","height":85});
															thumbnails[1870811] = clik.newPhoto({"id":1870811,"src":"Montana Powder1_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_1870811.html","width":130,"caption":"","height":136});
															thumbnails[3818567] = clik.newPhoto({"id":3818567,"src":"IMG_1307a1_thumb.jpg","galleries_id":232701,"server_id":1,"link":"photo_3818567.html","width":130,"caption":"","height":98});
															thumbnails[3818568] = clik.newPhoto({"id":3818568,"src":"IMG_1310a_thumb.jpg","galleries_id":232701,"server_id":1,"link":"photo_3818568.html","width":130,"caption":"","height":98});
															thumbnails[3818569] = clik.newPhoto({"id":3818569,"src":"IMG_1311a_thumb.jpg","galleries_id":232701,"server_id":1,"link":"photo_3818569.html","width":130,"caption":"","height":98});
															thumbnails[3818570] = clik.newPhoto({"id":3818570,"src":"IMG_1314a_thumb.jpg","galleries_id":232701,"server_id":1,"link":"photo_3818570.html","width":130,"caption":"","height":98});
															thumbnails[4232339] = clik.newPhoto({"id":4232339,"src":"DSC_92971_thumb.JPG","galleries_id":335523,"server_id":1,"link":"photo_4232339.html","width":130,"caption":"","height":86});
															thumbnails[4232383] = clik.newPhoto({"id":4232383,"src":"DMSPowder_thumb.JPG","galleries_id":335523,"server_id":1,"link":"photo_4232383.html","width":130,"caption":"","height":196});
															thumbnails[4232454] = clik.newPhoto({"id":4232454,"src":"WV5G6913a_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_4232454.html","width":130,"caption":"","height":103});
															thumbnails[4232469] = clik.newPhoto({"id":4232469,"src":"WV5G5811_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_4232469.html","width":130,"caption":"","height":195});
															thumbnails[4232476] = clik.newPhoto({"id":4232476,"src":"WV5G5613a_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_4232476.html","width":130,"caption":"","height":96});
															thumbnails[4232564] = clik.newPhoto({"id":4232564,"src":"IMG_0301a_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_4232564.html","width":130,"caption":"","height":147});
															thumbnails[4232581] = clik.newPhoto({"id":4232581,"src":"huttrip1b_thumb.JPG","galleries_id":335523,"server_id":1,"link":"photo_4232581.html","width":130,"caption":"","height":90});
															thumbnails[5551977] = clik.newPhoto({"id":5551977,"src":"IMG_2534-2_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551977.html","width":130,"caption":"","height":96});
															thumbnails[5551979] = clik.newPhoto({"id":5551979,"src":"1st_run_sat-1_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551979.html","width":130,"caption":"","height":106});
															thumbnails[5551980] = clik.newPhoto({"id":5551980,"src":"DSC_0113-2_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551980.html","width":130,"caption":"","height":99});
															thumbnails[5551982] = clik.newPhoto({"id":5551982,"src":"DSC_0036-2_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551982.html","width":130,"caption":"","height":91});
															thumbnails[5551984] = clik.newPhoto({"id":5551984,"src":"DSC_0037-1_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551984.html","width":130,"caption":"","height":92});
															thumbnails[5551985] = clik.newPhoto({"id":5551985,"src":"DSC_0038-2_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551985.html","width":130,"caption":"","height":100});
															thumbnails[5551987] = clik.newPhoto({"id":5551987,"src":"DSC_0061-1_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551987.html","width":130,"caption":"","height":108});
															thumbnails[5551989] = clik.newPhoto({"id":5551989,"src":"reece_mc-1_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5551989.html","width":130,"caption":"","height":104});
															thumbnails[5870318] = clik.newPhoto({"id":5870318,"src":"232323232fp_95_nu3234__9__74__WSNRCG335945674_33_nu0mrj-1_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_5870318.html","width":130,"caption":"","height":76});
															thumbnails[5902773] = clik.newPhoto({"id":5902773,"src":"reeceplaque-1_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_5902773.html","width":130,"caption":"","height":195});
															thumbnails[5946903] = clik.newPhoto({"id":5946903,"src":"WV5G2818-2_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_5946903.html","width":130,"caption":"","height":105});
															thumbnails[5946904] = clik.newPhoto({"id":5946904,"src":"WV5G2819-2_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_5946904.html","width":130,"caption":"","height":103});
															thumbnails[5946908] = clik.newPhoto({"id":5946908,"src":"WV5G3089-2_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_5946908.html","width":130,"caption":"","height":98});
															thumbnails[5946910] = clik.newPhoto({"id":5946910,"src":"WV5G3135-2_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_5946910.html","width":130,"caption":"","height":100});
															thumbnails[6997167] = clik.newPhoto({"id":6997167,"src":"Spenser_Pete_Dino_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_6997167.html","width":130,"caption":"Spenser, Pete, Dino","height":98});
															thumbnails[6997176] = clik.newPhoto({"id":6997176,"src":"synchro_shortswings_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_6997176.html","width":130,"caption":"","height":98});
															thumbnails[6997180] = clik.newPhoto({"id":6997180,"src":"Ocean_Village_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_6997180.html","width":130,"caption":"Ocean Village","height":98});
															thumbnails[6997216] = clik.newPhoto({"id":6997216,"src":"race_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_6997216.html","width":130,"caption":"","height":86});
															thumbnails[6997262] = clik.newPhoto({"id":6997262,"src":"Feb_2010_1_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997262.html","width":130,"caption":"","height":98});
															thumbnails[6997263] = clik.newPhoto({"id":6997263,"src":"Feb_2010_2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997263.html","width":130,"caption":"","height":98});
															thumbnails[6997265] = clik.newPhoto({"id":6997265,"src":"Apr_2010_1_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997265.html","width":130,"caption":"","height":98});
															thumbnails[6997266] = clik.newPhoto({"id":6997266,"src":"Apr_2010_2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997266.html","width":130,"caption":"","height":98});
															thumbnails[6997267] = clik.newPhoto({"id":6997267,"src":"Feb_2009_1_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997267.html","width":130,"caption":"","height":163});
															thumbnails[6997268] = clik.newPhoto({"id":6997268,"src":"Feb_2009_2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997268.html","width":130,"caption":"","height":98});
															thumbnails[6997269] = clik.newPhoto({"id":6997269,"src":"Feb_2009_3_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997269.html","width":130,"caption":"","height":98});
															thumbnails[6997271] = clik.newPhoto({"id":6997271,"src":"Feb_2009_4_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997271.html","width":130,"caption":"","height":98});
															thumbnails[6997272] = clik.newPhoto({"id":6997272,"src":"Feb_2009_5_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997272.html","width":130,"caption":"","height":98});
															thumbnails[6997274] = clik.newPhoto({"id":6997274,"src":"Apr_2009_1_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997274.html","width":130,"caption":"","height":98});
															thumbnails[6997276] = clik.newPhoto({"id":6997276,"src":"Apr_2009_2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997276.html","width":130,"caption":"","height":98});
															thumbnails[6997277] = clik.newPhoto({"id":6997277,"src":"Apr_2009_3_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_6997277.html","width":130,"caption":"","height":98});
															thumbnails[7011929] = clik.newPhoto({"id":7011929,"src":"box_jumps_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011929.html","width":130,"caption":"","height":98});
															thumbnails[7011930] = clik.newPhoto({"id":7011930,"src":"inlining_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011930.html","width":130,"caption":"","height":98});
															thumbnails[7011949] = clik.newPhoto({"id":7011949,"src":"warm-up_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011949.html","width":130,"caption":"","height":98});
															thumbnails[7011953] = clik.newPhoto({"id":7011953,"src":"warm-up_2_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011953.html","width":130,"caption":"","height":98});
															thumbnails[7011956] = clik.newPhoto({"id":7011956,"src":"race_2_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011956.html","width":130,"caption":"","height":97});
															thumbnails[7011960] = clik.newPhoto({"id":7011960,"src":"sprints_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011960.html","width":130,"caption":"","height":97});
															thumbnails[7011988] = clik.newPhoto({"id":7011988,"src":"crash_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011988.html","width":130,"caption":"","height":87});
															thumbnails[7011992] = clik.newPhoto({"id":7011992,"src":"IMG_1873_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011992.html","width":130,"caption":"","height":98});
															thumbnails[7011995] = clik.newPhoto({"id":7011995,"src":"All-England_podium_thumb.jpg","galleries_id":125731,"server_id":1,"link":"photo_7011995.html","width":130,"caption":"","height":98});
															thumbnails[7033048] = clik.newPhoto({"id":7033048,"src":"WV5G2851-3_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_7033048.html","width":130,"caption":"","height":104});
															thumbnails[7033051] = clik.newPhoto({"id":7033051,"src":"WV5G2873-4_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_7033051.html","width":130,"caption":"","height":101});
															thumbnails[7033056] = clik.newPhoto({"id":7033056,"src":"WV5G3087-2_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_7033056.html","width":130,"caption":"","height":93});
															thumbnails[7033060] = clik.newPhoto({"id":7033060,"src":"WV5G3240-1_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_7033060.html","width":130,"caption":"","height":87});
															thumbnails[7147133] = clik.newPhoto({"id":7147133,"src":"DSC00034-2_thumb.JPG","galleries_id":335523,"server_id":1,"link":"photo_7147133.html","width":130,"caption":"","height":94});
															thumbnails[7234905] = clik.newPhoto({"id":7234905,"src":"DSC_0045-2_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_7234905.html","width":130,"caption":"","height":109});
															thumbnails[7234906] = clik.newPhoto({"id":7234906,"src":"DSC_0048-2_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_7234906.html","width":130,"caption":"","height":106});
															thumbnails[7234907] = clik.newPhoto({"id":7234907,"src":"DSC_0151-2_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_7234907.html","width":130,"caption":"","height":103});
															thumbnails[7234908] = clik.newPhoto({"id":7234908,"src":"IMG_9203trim-2_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_7234908.html","width":130,"caption":"","height":98});
															thumbnails[7761565] = clik.newPhoto({"id":7761565,"src":"_BB24925-2_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_7761565.html","width":130,"caption":"","height":92});
															thumbnails[7761569] = clik.newPhoto({"id":7761569,"src":"_BB25666-1_thumb.JPG","galleries_id":335523,"server_id":1,"link":"photo_7761569.html","width":130,"caption":"","height":89});
															thumbnails[7761571] = clik.newPhoto({"id":7761571,"src":"_BB25643-1_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_7761571.html","width":130,"caption":"","height":93});
															thumbnails[7761575] = clik.newPhoto({"id":7761575,"src":"_BB25692-1_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_7761575.html","width":130,"caption":"","height":93});
															thumbnails[7761628] = clik.newPhoto({"id":7761628,"src":"IMG_0499-2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_7761628.html","width":130,"caption":"","height":100});
															thumbnails[7761631] = clik.newPhoto({"id":7761631,"src":"IMG_0501-2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_7761631.html","width":130,"caption":"","height":101});
															thumbnails[7761635] = clik.newPhoto({"id":7761635,"src":"IMG_0505-2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_7761635.html","width":130,"caption":"","height":96});
															thumbnails[7761638] = clik.newPhoto({"id":7761638,"src":"IMG_0512-2_thumb.jpg","galleries_id":120091,"server_id":1,"link":"photo_7761638.html","width":130,"caption":"","height":98});
															thumbnails[7998940] = clik.newPhoto({"id":7998940,"src":"Graham_Martin_armwrestle-1_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_7998940.html","width":130,"caption":"","height":50});
															thumbnails[8448816] = clik.newPhoto({"id":8448816,"src":"IMG_5143-1_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_8448816.html","width":130,"caption":"","height":86});
															thumbnails[8448817] = clik.newPhoto({"id":8448817,"src":"IMG_5214-1_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_8448817.html","width":130,"caption":"","height":97});
															thumbnails[8448818] = clik.newPhoto({"id":8448818,"src":"IMG_4975-1_thumb.JPG","galleries_id":314671,"server_id":1,"link":"photo_8448818.html","width":130,"caption":"","height":105});
															thumbnails[9026373] = clik.newPhoto({"id":9026373,"src":"gift-_CAM7938-1_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_9026373.html","width":130,"caption":"","height":87});
															thumbnails[9026377] = clik.newPhoto({"id":9026377,"src":"bridger-2_thumb.jpg","galleries_id":314671,"server_id":1,"link":"photo_9026377.html","width":130,"caption":"","height":86});
															thumbnails[7012043] = clik.newPhoto({"id":7012043,"src":"IMG_9786-1_thumb.JPG","galleries_id":335523,"server_id":1,"link":"photo_7012043.html","width":130,"caption":"","height":98});
															thumbnails[6994532] = clik.newPhoto({"id":6994532,"src":"Wengen85-1_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_6994532.html","width":130,"caption":"","height":98});
															thumbnails[7012052] = clik.newPhoto({"id":7012052,"src":"Drambuie4-1_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_7012052.html","width":130,"caption":"","height":173});
															thumbnails[4232506] = clik.newPhoto({"id":4232506,"src":"IMG_9792_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_4232506.html","width":130,"caption":"","height":92});
															thumbnails[4232349] = clik.newPhoto({"id":4232349,"src":"1231302a_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_4232349.html","width":130,"caption":"","height":79});
															thumbnails[6994529] = clik.newPhoto({"id":6994529,"src":"Gorner_Glacier3_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_6994529.html","width":130,"caption":"","height":79});
															thumbnails[5946940] = clik.newPhoto({"id":5946940,"src":"Pila4-1_thumb.jpg","galleries_id":335523,"server_id":1,"link":"photo_5946940.html","width":130,"caption":"","height":196});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[232701] = clik.newGallery({"parentGallery":"","usePopups":false,"title":" Snozone","link":"gallery_232701.html","maxRecords":0.0,"photoIDs":[3818567.0,3818568.0,3818569.0,3818570.0],"skipIndex":0,"section_code":"gallery","featured_images":"3818570,3818569,3818568,3818567","id":232701,"singleSection":false});				  						galleries[314671] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Reece Bell","link":"gallery_314671.html","maxRecords":0.0,"photoIDs":[5551977.0,5551979.0,5551980.0,5551982.0,5551984.0,5551985.0,5551987.0,5551989.0,5870318.0,5902773.0,7234905.0,7234906.0,7234907.0,7234908.0,7761565.0,7761571.0,7761575.0,8448816.0,8448817.0,8448818.0,9026373.0,9026377.0],"skipIndex":0,"section_code":"gallery","featured_images":"9026377,9026373,8448818,8448817,8448816,7761575,7761571,7761565,7234908,7234907","id":314671,"singleSection":false});				  						galleries[120091] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Powder Byrne Ski Camps","link":"gallery_120091.html","maxRecords":0.0,"photoIDs":[1786483.0,6997262.0,6997263.0,6997265.0,6997266.0,6997267.0,6997268.0,6997269.0,6997271.0,6997272.0,6997274.0,6997276.0,6997277.0,7761628.0,7761631.0,7761635.0,7761638.0],"skipIndex":0,"section_code":"gallery","featured_images":"7761638,7761635,7761631,7761628,6997277,6997276,6997274,6997272,6997271,6997269","id":120091,"singleSection":false});				  						galleries[125731] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Summer Camp Southampton","link":"gallery_125731.html","maxRecords":0.0,"photoIDs":[1870605.0,1870783.0,6997167.0,6997176.0,6997180.0,6997216.0,7011929.0,7011930.0,7011949.0,7011953.0,7011956.0,7011960.0,7011988.0,7011992.0,7011995.0],"skipIndex":0,"section_code":"gallery","featured_images":1870783.0,"id":125731,"singleSection":false});				  						galleries[335523] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Martin Bell","link":"gallery_335523.html","maxRecords":0.0,"photoIDs":[1785729.0,1870811.0,4232339.0,4232383.0,4232454.0,4232469.0,4232476.0,4232564.0,4232581.0,5946903.0,5946904.0,5946908.0,5946910.0,7033048.0,7033051.0,7033056.0,7033060.0,7147133.0,7761569.0,7998940.0,7012043.0,6994532.0,7012052.0,4232506.0,4232349.0,6994529.0,5946940.0],"skipIndex":0,"section_code":"gallery","featured_images":"7998940,7761569,7147133,7033060,7033056,7033051,7033048,7012052,7012043,6994532","id":335523,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5946910,5946908,5946904,5946903,4232581,4232564,4232476,4232469,4232454,4232383,4232339,1870811,1785729,4232506,4232349,5946940';
imageSets[2] = '1870783,1786497';
imageSets[3] = '1786503';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hughhast42/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/hughhast42/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 = 'Ski Martin Bell: ' + 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;
	}
}

			

