window.thumbnails = {};
															thumbnails[8917419] = clik.newPhoto({"id":8917419,"src":"IMG_8537-1_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8917419.html","width":150,"caption":"","height":100});
															thumbnails[8917451] = clik.newPhoto({"id":8917451,"src":"IMG_4561_5x7_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8917451.html","width":150,"caption":"","height":107});
															thumbnails[8962433] = clik.newPhoto({"id":8962433,"src":"IMG_0327_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962433.html","width":150,"caption":"","height":107});
															thumbnails[8962436] = clik.newPhoto({"id":8962436,"src":"IMG_0569-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962436.html","width":150,"caption":"","height":87});
															thumbnails[8962441] = clik.newPhoto({"id":8962441,"src":"IMG_0599-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962441.html","width":150,"caption":"","height":132});
															thumbnails[8962445] = clik.newPhoto({"id":8962445,"src":"IMG_0612-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962445.html","width":150,"caption":"","height":259});
															thumbnails[8962447] = clik.newPhoto({"id":8962447,"src":"IMG_0659-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962447.html","width":150,"caption":"","height":256});
															thumbnails[8962448] = clik.newPhoto({"id":8962448,"src":"IMG_0668-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962448.html","width":150,"caption":"","height":292});
															thumbnails[8962449] = clik.newPhoto({"id":8962449,"src":"IMG_0676-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962449.html","width":150,"caption":"","height":153});
															thumbnails[8962450] = clik.newPhoto({"id":8962450,"src":"IMG_0681-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962450.html","width":150,"caption":"","height":121});
															thumbnails[8962452] = clik.newPhoto({"id":8962452,"src":"IMG_0700-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962452.html","width":150,"caption":"","height":103});
															thumbnails[8962453] = clik.newPhoto({"id":8962453,"src":"IMG_0715-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962453.html","width":150,"caption":"","height":225});
															thumbnails[8962457] = clik.newPhoto({"id":8962457,"src":"IMG_0720-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962457.html","width":150,"caption":"","height":231});
															thumbnails[8962458] = clik.newPhoto({"id":8962458,"src":"IMG_0722-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962458.html","width":150,"caption":"","height":204});
															thumbnails[8962459] = clik.newPhoto({"id":8962459,"src":"IMG_0726-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962459.html","width":150,"caption":"","height":250});
															thumbnails[8962460] = clik.newPhoto({"id":8962460,"src":"IMG_1223-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962460.html","width":150,"caption":"","height":186});
															thumbnails[8962461] = clik.newPhoto({"id":8962461,"src":"IMG_1234-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962461.html","width":150,"caption":"","height":100});
															thumbnails[8962462] = clik.newPhoto({"id":8962462,"src":"IMG_1304-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962462.html","width":150,"caption":"","height":300});
															thumbnails[8962463] = clik.newPhoto({"id":8962463,"src":"IMG_2530-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962463.html","width":150,"caption":"","height":96});
															thumbnails[8962465] = clik.newPhoto({"id":8962465,"src":"IMG_2612-2_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962465.html","width":150,"caption":"","height":100});
															thumbnails[8962466] = clik.newPhoto({"id":8962466,"src":"IMG_4535_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962466.html","width":150,"caption":"","height":225});
															thumbnails[8962469] = clik.newPhoto({"id":8962469,"src":"IMG_4646-for-web_40D4423F-1EC9-D45B-1C1CCF6142401760_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962469.html","width":150,"caption":"","height":100});
															thumbnails[8962470] = clik.newPhoto({"id":8962470,"src":"IMG_4906_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962470.html","width":150,"caption":"","height":100});
															thumbnails[8962471] = clik.newPhoto({"id":8962471,"src":"IMG_8498-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962471.html","width":150,"caption":"","height":194});
															thumbnails[8962472] = clik.newPhoto({"id":8962472,"src":"IMG_8522-2_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962472.html","width":150,"caption":"","height":91});
															thumbnails[8962474] = clik.newPhoto({"id":8962474,"src":"IMG_8537-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962474.html","width":150,"caption":"","height":100});
															thumbnails[8962475] = clik.newPhoto({"id":8962475,"src":"IMG_8597-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962475.html","width":150,"caption":"","height":127});
															thumbnails[8962476] = clik.newPhoto({"id":8962476,"src":"IMG_8606-1_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962476.html","width":150,"caption":"","height":200});
															thumbnails[8962478] = clik.newPhoto({"id":8962478,"src":"IMG_8955_for_web_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8962478.html","width":150,"caption":"","height":73});
															thumbnails[8962536] = clik.newPhoto({"id":8962536,"src":"IMG_0679-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962536.html","width":150,"caption":"","height":131});
															thumbnails[8962537] = clik.newPhoto({"id":8962537,"src":"IMG_0683-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962537.html","width":150,"caption":"","height":287});
															thumbnails[8962538] = clik.newPhoto({"id":8962538,"src":"IMG_0691-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962538.html","width":150,"caption":"","height":133});
															thumbnails[8962539] = clik.newPhoto({"id":8962539,"src":"IMG_0724-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962539.html","width":150,"caption":"","height":76});
															thumbnails[8962541] = clik.newPhoto({"id":8962541,"src":"IMG_0768-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962541.html","width":150,"caption":"","height":258});
															thumbnails[8962542] = clik.newPhoto({"id":8962542,"src":"IMG_0772-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962542.html","width":150,"caption":"","height":341});
															thumbnails[8962543] = clik.newPhoto({"id":8962543,"src":"IMG_1059-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962543.html","width":150,"caption":"","height":395});
															thumbnails[8962545] = clik.newPhoto({"id":8962545,"src":"IMG_2057-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962545.html","width":150,"caption":"","height":307});
															thumbnails[8962546] = clik.newPhoto({"id":8962546,"src":"IMG_2141-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962546.html","width":150,"caption":"","height":100});
															thumbnails[8962548] = clik.newPhoto({"id":8962548,"src":"IMG_2149-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962548.html","width":150,"caption":"","height":305});
															thumbnails[8962549] = clik.newPhoto({"id":8962549,"src":"IMG_2251-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962549.html","width":150,"caption":"","height":105});
															thumbnails[8962551] = clik.newPhoto({"id":8962551,"src":"IMG_2273-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962551.html","width":150,"caption":"","height":250});
															thumbnails[8962552] = clik.newPhoto({"id":8962552,"src":"IMG_2287-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962552.html","width":150,"caption":"","height":268});
															thumbnails[8962554] = clik.newPhoto({"id":8962554,"src":"IMG_4375_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962554.html","width":150,"caption":"","height":219});
															thumbnails[8962558] = clik.newPhoto({"id":8962558,"src":"IMG_4438_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962558.html","width":150,"caption":"","height":77});
															thumbnails[8962559] = clik.newPhoto({"id":8962559,"src":"IMG_4482_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962559.html","width":150,"caption":"","height":146});
															thumbnails[8962560] = clik.newPhoto({"id":8962560,"src":"IMG_4507_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962560.html","width":150,"caption":"","height":255});
															thumbnails[8962561] = clik.newPhoto({"id":8962561,"src":"IMG_4555_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962561.html","width":150,"caption":"","height":341});
															thumbnails[8962563] = clik.newPhoto({"id":8962563,"src":"IMG_4632_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962563.html","width":150,"caption":"","height":80});
															thumbnails[8962564] = clik.newPhoto({"id":8962564,"src":"IMG_4789_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962564.html","width":150,"caption":"","height":239});
															thumbnails[8962566] = clik.newPhoto({"id":8962566,"src":"IMG_4862_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962566.html","width":150,"caption":"","height":88});
															thumbnails[8962567] = clik.newPhoto({"id":8962567,"src":"IMG_4871_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962567.html","width":150,"caption":"","height":296});
															thumbnails[8962568] = clik.newPhoto({"id":8962568,"src":"IMG_4900_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962568.html","width":150,"caption":"","height":106});
															thumbnails[8962570] = clik.newPhoto({"id":8962570,"src":"IMG_5365-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962570.html","width":150,"caption":"","height":251});
															thumbnails[8962571] = clik.newPhoto({"id":8962571,"src":"IMG_5508_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962571.html","width":150,"caption":"","height":212});
															thumbnails[8962573] = clik.newPhoto({"id":8962573,"src":"IMG_5689_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962573.html","width":150,"caption":"","height":100});
															thumbnails[8962574] = clik.newPhoto({"id":8962574,"src":"IMG_5691_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962574.html","width":150,"caption":"","height":225});
															thumbnails[8962575] = clik.newPhoto({"id":8962575,"src":"IMG_5697-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962575.html","width":150,"caption":"","height":227});
															thumbnails[8962577] = clik.newPhoto({"id":8962577,"src":"IMG_5726_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962577.html","width":150,"caption":"","height":120});
															thumbnails[8962578] = clik.newPhoto({"id":8962578,"src":"IMG_7827-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962578.html","width":150,"caption":"","height":203});
															thumbnails[8962579] = clik.newPhoto({"id":8962579,"src":"IMG_7898-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962579.html","width":150,"caption":"","height":191});
															thumbnails[8962580] = clik.newPhoto({"id":8962580,"src":"IMG_8055_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962580.html","width":150,"caption":"","height":113});
															thumbnails[8962581] = clik.newPhoto({"id":8962581,"src":"IMG_9221_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962581.html","width":150,"caption":"","height":100});
															thumbnails[8962582] = clik.newPhoto({"id":8962582,"src":"IMG_9376-1_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962582.html","width":150,"caption":"","height":359});
															thumbnails[8962583] = clik.newPhoto({"id":8962583,"src":"IMG_9550_for_web_thumb.jpg","galleries_id":274817,"server_id":15,"link":"photo_8962583.html","width":150,"caption":"","height":253});
															thumbnails[8962616] = clik.newPhoto({"id":8962616,"src":"IMG_0496-1_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962616.html","width":150,"caption":"Ferne Cotton","height":114});
															thumbnails[8962621] = clik.newPhoto({"id":8962621,"src":"IMG_0504-1_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962621.html","width":150,"caption":"Gok Wan","height":222});
															thumbnails[8962628] = clik.newPhoto({"id":8962628,"src":"IMG_4205_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962628.html","width":150,"caption":"Maria Fowler & James 'Arg' Argent","height":111});
															thumbnails[8962634] = clik.newPhoto({"id":8962634,"src":"IMG_4225_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962634.html","width":150,"caption":"","height":116});
															thumbnails[8962638] = clik.newPhoto({"id":8962638,"src":"IMG_4306_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962638.html","width":150,"caption":"The Risk","height":100});
															thumbnails[8962645] = clik.newPhoto({"id":8962645,"src":"IMG_4758_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962645.html","width":150,"caption":"The Risk","height":220});
															thumbnails[8962650] = clik.newPhoto({"id":8962650,"src":"IMG_5021_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962650.html","width":150,"caption":"Kimberley Wyatt","height":202});
															thumbnails[8962656] = clik.newPhoto({"id":8962656,"src":"IMG_8224-2_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962656.html","width":150,"caption":"David Ginola","height":225});
															thumbnails[8962749] = clik.newPhoto({"id":8962749,"src":"IMG_0591-1_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962749.html","width":150,"caption":"","height":101});
															thumbnails[8962750] = clik.newPhoto({"id":8962750,"src":"IMG_4276_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962750.html","width":150,"caption":"","height":289});
															thumbnails[8962751] = clik.newPhoto({"id":8962751,"src":"IMG_4341_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962751.html","width":150,"caption":"","height":236});
															thumbnails[8962754] = clik.newPhoto({"id":8962754,"src":"IMG_4391_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962754.html","width":150,"caption":"","height":74});
															thumbnails[8962755] = clik.newPhoto({"id":8962755,"src":"IMG_4552_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962755.html","width":150,"caption":"Kimberley Wyatt","height":75});
															thumbnails[8962757] = clik.newPhoto({"id":8962757,"src":"IMG_4688_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962757.html","width":150,"caption":"","height":130});
															thumbnails[8962758] = clik.newPhoto({"id":8962758,"src":"IMG_4704_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962758.html","width":150,"caption":"","height":158});
															thumbnails[8962759] = clik.newPhoto({"id":8962759,"src":"IMG_4722_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962759.html","width":150,"caption":"","height":201});
															thumbnails[8962761] = clik.newPhoto({"id":8962761,"src":"IMG_4742_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962761.html","width":150,"caption":"","height":102});
															thumbnails[8962762] = clik.newPhoto({"id":8962762,"src":"IMG_4772_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962762.html","width":150,"caption":"","height":237});
															thumbnails[8962763] = clik.newPhoto({"id":8962763,"src":"IMG_4799_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962763.html","width":150,"caption":"","height":93});
															thumbnails[8962765] = clik.newPhoto({"id":8962765,"src":"IMG_4954_for_web_thumb.jpg","galleries_id":208674,"server_id":15,"link":"photo_8962765.html","width":150,"caption":"Karizma Krew","height":110});
															thumbnails[8962801] = clik.newPhoto({"id":8962801,"src":"IMG_0443-1_for_web_thumb.jpg","galleries_id":471729,"server_id":15,"link":"photo_8962801.html","width":150,"caption":"Hollyoaks Andrew Moss and Gemma Merna","height":166});
															thumbnails[8917388] = clik.newPhoto({"id":8917388,"src":"IMG_4556_5x7_thumb.jpg","galleries_id":201469,"server_id":15,"link":"photo_8917388.html","width":150,"caption":"","height":107});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[274817] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Catwalk","link":"gallery_274817.html","maxRecords":0.0,"photoIDs":[8962536.0,8962537.0,8962538.0,8962539.0,8962541.0,8962542.0,8962543.0,8962545.0,8962546.0,8962548.0,8962549.0,8962551.0,8962552.0,8962554.0,8962558.0,8962559.0,8962560.0,8962561.0,8962563.0,8962564.0,8962566.0,8962567.0,8962568.0,8962570.0,8962571.0,8962573.0,8962574.0,8962575.0,8962577.0,8962578.0,8962579.0,8962580.0,8962581.0,8962582.0,8962583.0],"skipIndex":0,"section_code":"gallery","featured_images":"8962583,8962582,8962581,8962580,8962579,8962578,8962577,8962575,8962574,8962573","id":274817,"singleSection":false});				  						galleries[208674] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Dance","link":"gallery_208674.html","maxRecords":0.0,"photoIDs":[8962749.0,8962750.0,8962751.0,8962754.0,8962755.0,8962757.0,8962758.0,8962759.0,8962761.0,8962762.0,8962763.0,8962765.0],"skipIndex":0,"section_code":"gallery","featured_images":"8962765,8962763,8962762,8962761,8962759,8962758,8962757,8962755,8962754,8962751","id":208674,"singleSection":false});				  						galleries[201469] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Portraits","link":"gallery_201469.html","maxRecords":0.0,"photoIDs":[8917419.0,8917451.0,8962433.0,8962436.0,8962441.0,8962445.0,8962447.0,8962448.0,8962449.0,8962450.0,8962452.0,8962453.0,8962457.0,8962458.0,8962459.0,8962460.0,8962461.0,8962462.0,8962463.0,8962465.0,8962466.0,8962469.0,8962470.0,8962471.0,8962472.0,8962474.0,8962475.0,8962476.0,8962478.0,8917388.0],"skipIndex":0,"section_code":"gallery","featured_images":"8962478,8962476,8962475,8962474,8962472,8962471,8962470,8962469,8962466,8962465","id":201469,"singleSection":false});				  						galleries[471729] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Celeb","link":"gallery_471729.html","maxRecords":0.0,"photoIDs":[8962616.0,8962621.0,8962628.0,8962634.0,8962638.0,8962645.0,8962650.0,8962656.0,8962801.0],"skipIndex":0,"section_code":"gallery","featured_images":"8962801,8962656,8962650,8962645,8962638,8962634,8962628,8962621,8962616","id":471729,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8917388';
imageSets[3] = '8962801,8962765,8962763,8962762,8962761,8962759,8962758,8962757,8962755,8962754,8962751,8962750,8962749,8962656,8962650,8962645,8962638,8962634,8962628,8962621,8962616,8962583,8962582,8962581,8962580,8962579,8962578,8962577,8962575,8962574,8962573,8962571,8962570,8962568,8962567,8962566,8962564,8962563,8962561,8962560,8962559,8962558,8962554,8962552,8962551,8962549,8962548,8962546,8962545,8962543';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/bluesden/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/bluesden/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/bluesden/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/bluesden/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/bluesden/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/bluesden/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/bluesden/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/bluesden/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 = 'BluesdenPhotography.com: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
											temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="BLUESDEN">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

