window.thumbnails = {};
															thumbnails[3488243] = clik.newPhoto({"id":3488243,"src":"D0903-036-A-2a_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"The Dude!","height":195});
															thumbnails[2623438] = clik.newPhoto({"id":2623438,"src":"Fsbimageslogo_sm1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[7291016] = clik.newPhoto({"id":7291016,"src":"D0920-002_v3_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[7415640] = clik.newPhoto({"id":7415640,"src":"Coyote1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":168});
															thumbnails[7415641] = clik.newPhoto({"id":7415641,"src":"D0901-130_v1-2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":100});
															thumbnails[8558807] = clik.newPhoto({"id":8558807,"src":"01_D1012-048_2012_Cover_Sm_Promo_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":100});
															thumbnails[8558879] = clik.newPhoto({"id":8558879,"src":"Cover_PARIS_2012_Sm_Promo_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":100});
															thumbnails[7302301] = clik.newPhoto({"id":7302301,"src":"04127_v1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7302303] = clik.newPhoto({"id":7302303,"src":"04135_v1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7302305] = clik.newPhoto({"id":7302305,"src":"04139_v1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7302306] = clik.newPhoto({"id":7302306,"src":"04156_v1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[8757581] = clik.newPhoto({"id":8757581,"src":"D1123-244_v1_thumb.jpg","galleries_id":368324,"server_id":1,"link":"photo_8757581.html","width":130,"caption":"Alcatraz island.","height":78});
															thumbnails[8757583] = clik.newPhoto({"id":8757583,"src":"D1123-319_v11_thumb.jpg","galleries_id":368324,"server_id":1,"link":"photo_8757583.html","width":130,"caption":"Sailing on the Bay.","height":163});
															thumbnails[8501650] = clik.newPhoto({"id":8501650,"src":"D1122-068_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8501650.html","width":130,"caption":"Hammer Thrower","height":195});
															thumbnails[8558923] = clik.newPhoto({"id":8558923,"src":"D1122-022_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8558923.html","width":130,"caption":"Highland Rocker","height":217});
															thumbnails[8558975] = clik.newPhoto({"id":8558975,"src":"D1122-110_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8558975.html","width":130,"caption":"Kilty Dog....","height":130});
															thumbnails[8558987] = clik.newPhoto({"id":8558987,"src":"D1122-030_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8558987.html","width":130,"caption":"Golden Bough","height":163});
															thumbnails[8203299] = clik.newPhoto({"id":8203299,"src":"D1116-152_v1_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8203299.html","width":130,"caption":"Upper Yosemite Falls.","height":195});
															thumbnails[2828557] = clik.newPhoto({"id":2828557,"src":"PARIS_08270_A_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_2828557.html","width":130,"caption":"Arc de Triomphe","height":130});
															thumbnails[2890017] = clik.newPhoto({"id":2890017,"src":"PARIS_08611_A_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_2890017.html","width":130,"caption":"La Tour Eiffel","height":195});
															thumbnails[454170] = clik.newPhoto({"id":454170,"src":"ARCH-001_thumb.jpg","galleries_id":395010,"server_id":1,"link":"photo_454170.html","width":130,"caption":"The Scottish Parliament Building.","height":193});
															thumbnails[6820856] = clik.newPhoto({"id":6820856,"src":"D1013-421_v1-72_copy_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_6820856.html","width":130,"caption":"Notre Dame de Paris - Interior.","height":130});
															thumbnails[7104688] = clik.newPhoto({"id":7104688,"src":"Walt_Disney_Concert_Hall_thumb.jpg","galleries_id":395010,"server_id":1,"link":"photo_7104688.html","width":130,"caption":"The Walt Disney Concert Hall.","height":130});
															thumbnails[8163927] = clik.newPhoto({"id":8163927,"src":"D1116-119_v11_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8163927.html","width":130,"caption":"Chipmunk","height":87});
															thumbnails[8203271] = clik.newPhoto({"id":8203271,"src":"D1116-155_v1_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8203271.html","width":130,"caption":"Upper Yosemite Falls.","height":86});
															thumbnails[8231252] = clik.newPhoto({"id":8231252,"src":"02_D1013-008_v2-72_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_8231252.html","width":130,"caption":"Palais du Luxomberg","height":100});
															thumbnails[8231253] = clik.newPhoto({"id":8231253,"src":"06_D1013-479_v2-72_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_8231253.html","width":130,"caption":"Petit Palais","height":100});
															thumbnails[8231254] = clik.newPhoto({"id":8231254,"src":"11_D1013-374_v1-72_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_8231254.html","width":130,"caption":"Notre Dame Cathederal","height":100});
															thumbnails[8231262] = clik.newPhoto({"id":8231262,"src":"D1116-085_v1-2_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8231262.html","width":130,"caption":"Half Dome - 1","height":130});
															thumbnails[8231263] = clik.newPhoto({"id":8231263,"src":"D1006-136_v1_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8231263.html","width":130,"caption":"Half Dome - 2","height":87});
															thumbnails[8231265] = clik.newPhoto({"id":8231265,"src":"D0911-116_v1-1_Squirrels_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8231265.html","width":130,"caption":"Squirrel","height":100});
															thumbnails[8243582] = clik.newPhoto({"id":8243582,"src":"D0901-077_v1_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_8243582.html","width":130,"caption":"Reflections","height":130});
															thumbnails[8243585] = clik.newPhoto({"id":8243585,"src":"D1012-139_v1_thumb.jpg","galleries_id":358071,"server_id":1,"link":"photo_8243585.html","width":130,"caption":"The Scott Monument","height":163});
															thumbnails[8247852] = clik.newPhoto({"id":8247852,"src":"D1012-695_v1_thumb.jpg","galleries_id":358071,"server_id":1,"link":"photo_8247852.html","width":130,"caption":"Souviners","height":130});
															thumbnails[8265497] = clik.newPhoto({"id":8265497,"src":"08_D1012-706_Street_Performer_v1_thumb.jpg","galleries_id":358071,"server_id":1,"link":"photo_8265497.html","width":130,"caption":"Festival Performer","height":100});
															thumbnails[8265499] = clik.newPhoto({"id":8265499,"src":"06_D1012-690_Bus_Stop_v1_thumb.jpg","galleries_id":358071,"server_id":1,"link":"photo_8265499.html","width":130,"caption":"City tour bus.","height":100});
															thumbnails[8316226] = clik.newPhoto({"id":8316226,"src":"EDI_Calton_Hill_10x8-300_D1012-091_v1_thumb.jpg","galleries_id":358071,"server_id":1,"link":"photo_8316226.html","width":130,"caption":"Calton Hill","height":104});
															thumbnails[8316229] = clik.newPhoto({"id":8316229,"src":"EDI_Ocean_Terminal_D1012-294-v1-2_thumb.jpg","galleries_id":358071,"server_id":1,"link":"photo_8316229.html","width":130,"caption":"Ocean Terminal","height":130});
															thumbnails[8788227] = clik.newPhoto({"id":8788227,"src":"05_52650011_v1_thumb.jpg","galleries_id":368324,"server_id":1,"link":"photo_8788227.html","width":130,"caption":"Golden Gate Bridge","height":100});
															thumbnails[6526660] = clik.newPhoto({"id":6526660,"src":"D1013-140_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_6526660.html","width":130,"caption":"The Grande Arch - La Défense.","height":195});
															thumbnails[6526658] = clik.newPhoto({"id":6526658,"src":"D1013-224_v1_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_6526658.html","width":130,"caption":"Musée du Louvre","height":182});
															thumbnails[8558977] = clik.newPhoto({"id":8558977,"src":"D1122-123_v1_C6B9CC7F-24E8-5EC4-4FED53BE5219399F_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8558977.html","width":130,"caption":1916.0,"height":93});
															thumbnails[6554254] = clik.newPhoto({"id":6554254,"src":"D1013-327_v72_thumb.jpg","galleries_id":166510,"server_id":1,"link":"photo_6554254.html","width":130,"caption":"The Inverted Pyramid.","height":87});
															thumbnails[8501652] = clik.newPhoto({"id":8501652,"src":"D1122-098_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8501652.html","width":130,"caption":1916.0,"height":195});
															thumbnails[8501651] = clik.newPhoto({"id":8501651,"src":"D1122-085_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8501651.html","width":130,"caption":1916.0,"height":86});
															thumbnails[8558925] = clik.newPhoto({"id":8558925,"src":"D1122-096_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8558925.html","width":130,"caption":1916.0,"height":86});
															thumbnails[8558990] = clik.newPhoto({"id":8558990,"src":"D1122-103_v1_thumb.jpg","galleries_id":449357,"server_id":1,"link":"photo_8558990.html","width":130,"caption":1916.0,"height":86});
															thumbnails[6554271] = clik.newPhoto({"id":6554271,"src":"D1013-248_v72_thumb.jpg","galleries_id":395010,"server_id":1,"link":"photo_6554271.html","width":130,"caption":"Interior - 4","height":195});
															thumbnails[702218] = clik.newPhoto({"id":702218,"src":"07083_A_thumb.jpg","galleries_id":395010,"server_id":1,"link":"photo_702218.html","width":130,"caption":"The Space Needle.","height":130});
															thumbnails[7415652] = clik.newPhoto({"id":7415652,"src":"D0901-142_v1_thumb.jpg","galleries_id":437701,"server_id":1,"link":"photo_7415652.html","width":130,"caption":"Coyote","height":100});
															thumbnails[448278] = clik.newPhoto({"id":448278,"src":"The Falkirk Wheel_thumb.jpg","galleries_id":395010,"server_id":1,"link":"photo_448278.html","width":130,"caption":"The Falkirk Wheel","height":130});
															thumbnails[6514731] = clik.newPhoto({"id":6514731,"src":"D1011-245_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514731.html","width":130,"caption":"","height":130});
															thumbnails[6514740] = clik.newPhoto({"id":6514740,"src":"D1011-231_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514740.html","width":130,"caption":"","height":195});
															thumbnails[6518917] = clik.newPhoto({"id":6518917,"src":"D1012-514_v1-2_thumb.jpg","galleries_id":358546,"server_id":1,"link":"photo_6518917.html","width":130,"caption":"Exterior - 1","height":86});
															thumbnails[6514744] = clik.newPhoto({"id":6514744,"src":"D1011-182_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514744.html","width":130,"caption":"","height":195});
															thumbnails[6514733] = clik.newPhoto({"id":6514733,"src":"D1011-148_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514733.html","width":130,"caption":"","height":87});
															thumbnails[6518865] = clik.newPhoto({"id":6518865,"src":"D1012-576_v1_thumb.jpg","galleries_id":358546,"server_id":1,"link":"photo_6518865.html","width":130,"caption":"Exterior - 2","height":87});
															thumbnails[6514777] = clik.newPhoto({"id":6514777,"src":"D1011-121_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514777.html","width":130,"caption":"","height":87});
															thumbnails[6647430] = clik.newPhoto({"id":6647430,"src":"D1011-113_v11_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6647430.html","width":130,"caption":"","height":163});
															thumbnails[6514779] = clik.newPhoto({"id":6514779,"src":"D1011-183_v11_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514779.html","width":130,"caption":"","height":130});
															thumbnails[6518859] = clik.newPhoto({"id":6518859,"src":"D1012-532_v1_thumb.jpg","galleries_id":358546,"server_id":1,"link":"photo_6518859.html","width":130,"caption":"Interior - 1","height":130});
															thumbnails[6514728] = clik.newPhoto({"id":6514728,"src":"D1011-160_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514728.html","width":130,"caption":"","height":87});
															thumbnails[6654383] = clik.newPhoto({"id":6654383,"src":"D1011-195_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6654383.html","width":130,"caption":"","height":195});
															thumbnails[6654382] = clik.newPhoto({"id":6654382,"src":"D1011-114_v1-11_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6654382.html","width":130,"caption":"","height":195});
															thumbnails[6654384] = clik.newPhoto({"id":6654384,"src":"D1011-172_v1-1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6654384.html","width":130,"caption":"","height":195});
															thumbnails[6518852] = clik.newPhoto({"id":6518852,"src":"D1012-566_v1_thumb.jpg","galleries_id":358546,"server_id":1,"link":"photo_6518852.html","width":130,"caption":"Interior - 2","height":182});
															thumbnails[6514729] = clik.newPhoto({"id":6514729,"src":"D1011-227_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514729.html","width":130,"caption":"","height":87});
															thumbnails[6530114] = clik.newPhoto({"id":6530114,"src":"D1011-194_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6530114.html","width":130,"caption":"","height":195});
															thumbnails[6514738] = clik.newPhoto({"id":6514738,"src":"D1011-400_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514738.html","width":130,"caption":"","height":86});
															thumbnails[6518908] = clik.newPhoto({"id":6518908,"src":"D1012-530_v1_thumb.jpg","galleries_id":358546,"server_id":1,"link":"photo_6518908.html","width":130,"caption":"Interior - 3","height":203});
															thumbnails[6514727] = clik.newPhoto({"id":6514727,"src":"D1011-295_v1_thumb.jpg","galleries_id":358200,"server_id":1,"link":"photo_6514727.html","width":130,"caption":"","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[336791] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTRAITS","link":"section136318_336791.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section136318","featured_images":"","id":336791,"singleSection":false});				  						galleries[358070] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SCOTLAND - Glasgow","link":"section136318_358070.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section136318","featured_images":"","id":358070,"singleSection":false});				  						galleries[358073] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SCOTLAND - Miscellaneous","link":"section136318_358073.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section136318","featured_images":"","id":358073,"singleSection":false});				  						galleries[469083] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"section136318_469083.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section136318","featured_images":"","id":469083,"singleSection":false});				  						galleries[368324] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CALIFORNIA - San Francisco","link":"gallery_368324.html","maxRecords":0.0,"photoIDs":[8757581.0,8757583.0,8788227.0],"skipIndex":0,"section_code":"gallery","featured_images":"8788227,8757583,8757581","id":368324,"singleSection":false});				  						galleries[449357] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CALIFORNIA - Scottish Highland Gathering and Games","link":"gallery_449357.html","maxRecords":0.0,"photoIDs":[8501650.0,8558923.0,8558975.0,8558987.0,8558977.0,8501652.0,8501651.0,8558925.0,8558990.0],"skipIndex":0,"section_code":"gallery","featured_images":"8558990,8558987,8558977,8558975,8558925,8558923,8501652,8501651,8501650","id":449357,"singleSection":false});				  						galleries[395010] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ARCHITECTURE - Buildings around the World.","link":"gallery_395010.html","maxRecords":0.0,"photoIDs":[454170.0,7104688.0,6554271.0,702218.0,448278.0],"skipIndex":0,"section_code":"gallery","featured_images":448278.0,"id":395010,"singleSection":false});				  						galleries[368323] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CALIFORNIA - Big Hat Day, Clovis.","link":"section136318_368323.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section136318","featured_images":"","id":368323,"singleSection":false});				  						galleries[166510] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"FRANCE - Paris","link":"gallery_166510.html","maxRecords":0.0,"photoIDs":[2828557.0,2890017.0,6820856.0,8231252.0,8231253.0,8231254.0,6526660.0,6526658.0,6554254.0],"skipIndex":0,"section_code":"gallery","featured_images":2828557.0,"id":166510,"singleSection":false});				  						galleries[358071] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SCOTLAND - Edinburgh","link":"gallery_358071.html","maxRecords":0.0,"photoIDs":[8243585.0,8247852.0,8265497.0,8265499.0,8316226.0,8316229.0],"skipIndex":0,"section_code":"gallery","featured_images":"8316229,8316226,8265499,8265497,8247852,8243585","id":358071,"singleSection":false});				  						galleries[437701] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CALIFORNIA - Yosemite National Park.","link":"gallery_437701.html","maxRecords":0.0,"photoIDs":[8203299.0,8163927.0,8203271.0,8231262.0,8231263.0,8231265.0,8243582.0,7415652.0],"skipIndex":0,"section_code":"gallery","featured_images":"8243582,8231265,8231263,8231262,8203299,8203271,8163927,7415652","id":437701,"singleSection":false});				  						galleries[35581] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"THE STATES","link":"section136318_35581.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section136318","featured_images":"","id":35581,"singleSection":false});				  						galleries[358546] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SCOTLAND - House for an Art Lover","link":"section136318_358546.html","maxRecords":0.0,"photoIDs":[6518917.0,6518865.0,6518859.0,6518852.0,6518908.0],"skipIndex":0,"section_code":"section136318","featured_images":"6518917,6518908,6518865,6518859,6518852","id":358546,"singleSection":false});				  						galleries[358200] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"THE WEDDING","link":"section136318_358200.html","maxRecords":0.0,"photoIDs":[6514731.0,6514740.0,6514744.0,6514733.0,6514777.0,6647430.0,6514779.0,6514728.0,6654383.0,6654382.0,6654384.0,6514729.0,6530114.0,6514738.0,6514727.0],"skipIndex":0,"section_code":"section136318","featured_images":"6654384,6654383,6654382,6647430,6530114,6514779,6514777,6514744,6514740,6514738","id":358200,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8231265,7291016,2623438,6518859';
imageSets[2] = '2828557,448278';
imageSets[3] = '6518859';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/FSBImages/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/FSBImages/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 = 'FSB Images: ' + 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;
	}
}

			

