window.thumbnails = {};
															thumbnails[5825834] = clik.newPhoto({"id":5825834,"src":"Untitled-11_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":114});
															thumbnails[5843990] = clik.newPhoto({"id":5843990,"src":"CRW_1997_200_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":86});
															thumbnails[5877427] = clik.newPhoto({"id":5877427,"src":"_MG_12351_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877427.html","width":130,"caption":"","height":87});
															thumbnails[5884432] = clik.newPhoto({"id":5884432,"src":"_MG_7118_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884432.html","width":130,"caption":"","height":87});
															thumbnails[5884478] = clik.newPhoto({"id":5884478,"src":"CRW1010_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884478.html","width":130,"caption":"","height":87});
															thumbnails[5884516] = clik.newPhoto({"id":5884516,"src":"10102_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884516.html","width":130,"caption":"","height":87});
															thumbnails[5887122] = clik.newPhoto({"id":5887122,"src":"VM9W9318_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887122.html","width":130,"caption":"","height":87});
															thumbnails[9011629] = clik.newPhoto({"id":9011629,"src":"jf003_C60E6674-1EC9-DFB6-09E0E3C0C3F84C75_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011629.html","width":87,"caption":"","height":87});
															thumbnails[5877429] = clik.newPhoto({"id":5877429,"src":"_MG_12951_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877429.html","width":130,"caption":"","height":87});
															thumbnails[5884427] = clik.newPhoto({"id":5884427,"src":"_MG_6511_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884427.html","width":130,"caption":"","height":87});
															thumbnails[5884475] = clik.newPhoto({"id":5884475,"src":"_MG_9704_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884475.html","width":130,"caption":"","height":87});
															thumbnails[5884520] = clik.newPhoto({"id":5884520,"src":"11112_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884520.html","width":130,"caption":"","height":87});
															thumbnails[5887136] = clik.newPhoto({"id":5887136,"src":"_MG_0071_thumb.JPG","galleries_id":330659,"server_id":32,"link":"photo_5887136.html","width":130,"caption":"","height":87});
															thumbnails[9011630] = clik.newPhoto({"id":9011630,"src":"jf010_C6104942-1EC9-DFB6-09990F483AD9E45A_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011630.html","width":87,"caption":"","height":87});
															thumbnails[5877441] = clik.newPhoto({"id":5877441,"src":"_MG_1987_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877441.html","width":130,"caption":"","height":87});
															thumbnails[5884421] = clik.newPhoto({"id":5884421,"src":"_MG_2289_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884421.html","width":130,"caption":"","height":87});
															thumbnails[5884482] = clik.newPhoto({"id":5884482,"src":"CRW1987_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884482.html","width":130,"caption":"","height":87});
															thumbnails[5884502] = clik.newPhoto({"id":5884502,"src":"_MG_1113_thumb.JPG","galleries_id":330658,"server_id":32,"link":"photo_5884502.html","width":130,"caption":"","height":87});
															thumbnails[5887126] = clik.newPhoto({"id":5887126,"src":"106_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887126.html","width":130,"caption":"","height":87});
															thumbnails[9011635] = clik.newPhoto({"id":9011635,"src":"jf009_C612761A-1EC9-DFB6-09FA67F67570CF1F_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011635.html","width":87,"caption":"","height":87});
															thumbnails[5877433] = clik.newPhoto({"id":5877433,"src":"_MG_1567_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877433.html","width":130,"caption":"","height":87});
															thumbnails[5884425] = clik.newPhoto({"id":5884425,"src":"_MG_4098_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884425.html","width":130,"caption":"","height":87});
															thumbnails[5884462] = clik.newPhoto({"id":5884462,"src":"_MG_4545_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884462.html","width":130,"caption":"","height":87});
															thumbnails[5884509] = clik.newPhoto({"id":5884509,"src":"_MG_64871_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884509.html","width":130,"caption":"","height":87});
															thumbnails[5887129] = clik.newPhoto({"id":5887129,"src":"IMG_0220_1024_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887129.html","width":130,"caption":"","height":87});
															thumbnails[9011637] = clik.newPhoto({"id":9011637,"src":"jf004_C615ED08-1EC9-DFB6-097E45D4E6F73AEF_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011637.html","width":87,"caption":"","height":87});
															thumbnails[5877484] = clik.newPhoto({"id":5877484,"src":"VM9W9800_fp_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877484.html","width":130,"caption":"","height":87});
															thumbnails[5884416] = clik.newPhoto({"id":5884416,"src":"_MG_1267_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884416.html","width":130,"caption":"","height":87});
															thumbnails[5884471] = clik.newPhoto({"id":5884471,"src":"_MG_9361_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884471.html","width":130,"caption":"","height":87});
															thumbnails[5884511] = clik.newPhoto({"id":5884511,"src":"_MG_8802_1024g_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884511.html","width":130,"caption":"","height":87});
															thumbnails[5887144] = clik.newPhoto({"id":5887144,"src":"_MG_9711_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887144.html","width":130,"caption":"","height":87});
															thumbnails[9011640] = clik.newPhoto({"id":9011640,"src":"jf006_C618A263-1EC9-DFB6-0983C2EE25FDE574_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011640.html","width":87,"caption":"","height":87});
															thumbnails[5877472] = clik.newPhoto({"id":5877472,"src":"VM9W8822_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877472.html","width":130,"caption":"","height":87});
															thumbnails[5884423] = clik.newPhoto({"id":5884423,"src":"_MG_2348_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884423.html","width":130,"caption":"","height":87});
															thumbnails[5884470] = clik.newPhoto({"id":5884470,"src":"_MG_7896_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884470.html","width":130,"caption":"","height":87});
															thumbnails[5884522] = clik.newPhoto({"id":5884522,"src":"Himantoglossum_hircinum_1024_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884522.html","width":130,"caption":"","height":87});
															thumbnails[5887140] = clik.newPhoto({"id":5887140,"src":"_MG_5794_1500_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887140.html","width":130,"caption":"","height":87});
															thumbnails[9011644] = clik.newPhoto({"id":9011644,"src":"jf011_C61B90C7-1EC9-DFB6-0975DE18A714331A_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011644.html","width":87,"caption":"","height":87});
															thumbnails[5877442] = clik.newPhoto({"id":5877442,"src":"_MG_3452_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877442.html","width":130,"caption":"","height":87});
															thumbnails[5884414] = clik.newPhoto({"id":5884414,"src":"_MG_1010_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884414.html","width":130,"caption":"","height":87});
															thumbnails[5884489] = clik.newPhoto({"id":5884489,"src":"VM9W9058_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884489.html","width":130,"caption":"","height":87});
															thumbnails[5884517] = clik.newPhoto({"id":5884517,"src":"10103_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884517.html","width":87,"caption":"","height":130});
															thumbnails[5887141] = clik.newPhoto({"id":5887141,"src":"_MG_4049_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887141.html","width":130,"caption":"","height":87});
															thumbnails[9011645] = clik.newPhoto({"id":9011645,"src":"jf012_thumb_C5EBDD63-1EC9-DFB6-0931DC54D2995CDD.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011645.html","width":87,"caption":"","height":87});
															thumbnails[5877467] = clik.newPhoto({"id":5877467,"src":"VM9W8643_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877467.html","width":130,"caption":"","height":87});
															thumbnails[5884413] = clik.newPhoto({"id":5884413,"src":"_MG_0987_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884413.html","width":130,"caption":"","height":87});
															thumbnails[5884512] = clik.newPhoto({"id":5884512,"src":"10101_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884512.html","width":87,"caption":"","height":130});
															thumbnails[5887132] = clik.newPhoto({"id":5887132,"src":"101_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887132.html","width":130,"caption":"","height":86});
															thumbnails[5887169] = clik.newPhoto({"id":5887169,"src":"VM9W72971_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5887169.html","width":130,"caption":"","height":87});
															thumbnails[9011646] = clik.newPhoto({"id":9011646,"src":"jf008_C61E1228-1EC9-DFB6-0971957F0392AFC3_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011646.html","width":87,"caption":"","height":87});
															thumbnails[5877937] = clik.newPhoto({"id":5877937,"src":"_MG_90022_thumb.JPG","galleries_id":329314,"server_id":32,"link":"photo_5877937.html","width":130,"caption":"","height":87});
															thumbnails[5884411] = clik.newPhoto({"id":5884411,"src":"_MG_07991_thumb.JPG","galleries_id":329313,"server_id":32,"link":"photo_5884411.html","width":130,"caption":"","height":87});
															thumbnails[5884483] = clik.newPhoto({"id":5884483,"src":"CRW4512_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884483.html","width":130,"caption":"","height":87});
															thumbnails[5884552] = clik.newPhoto({"id":5884552,"src":"VM9W7778_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884552.html","width":87,"caption":"","height":130});
															thumbnails[5887149] = clik.newPhoto({"id":5887149,"src":"105_thumb.jpg","galleries_id":330659,"server_id":32,"link":"photo_5887149.html","width":130,"caption":"","height":87});
															thumbnails[9011648] = clik.newPhoto({"id":9011648,"src":"jf013_C6207893-1EC9-DFB6-09CF651712F48913_thumb.jpg","galleries_id":474900,"server_id":32,"link":"photo_9011648.html","width":87,"caption":"","height":87});
															thumbnails[5878897] = clik.newPhoto({"id":5878897,"src":"_MG_2031_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5878897.html","width":130,"caption":"","height":87});
															thumbnails[5884441] = clik.newPhoto({"id":5884441,"src":"CRW_3901__thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884441.html","width":87,"caption":"","height":130});
															thumbnails[5884459] = clik.newPhoto({"id":5884459,"src":"_MG_4048_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884459.html","width":130,"caption":"","height":87});
															thumbnails[5884525] = clik.newPhoto({"id":5884525,"src":"IMG_0636_800_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884525.html","width":87,"caption":"","height":130});
															thumbnails[5877456] = clik.newPhoto({"id":5877456,"src":"_MG_9035_thumb.JPG","galleries_id":329314,"server_id":32,"link":"photo_5877456.html","width":130,"caption":"","height":87});
															thumbnails[5884442] = clik.newPhoto({"id":5884442,"src":"VM9W6862_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884442.html","width":87,"caption":"","height":130});
															thumbnails[5884464] = clik.newPhoto({"id":5884464,"src":"_MG_6124__thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884464.html","width":130,"caption":"","height":87});
															thumbnails[5884527] = clik.newPhoto({"id":5884527,"src":"Oapifera_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884527.html","width":87,"caption":"","height":130});
															thumbnails[5877477] = clik.newPhoto({"id":5877477,"src":"VM9W9090_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877477.html","width":130,"caption":"","height":87});
															thumbnails[5884444] = clik.newPhoto({"id":5884444,"src":"VM9W8214__thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884444.html","width":87,"caption":"","height":130});
															thumbnails[5884481] = clik.newPhoto({"id":5884481,"src":"CRW1121_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884481.html","width":130,"caption":"","height":87});
															thumbnails[5884535] = clik.newPhoto({"id":5884535,"src":"Ophrys_insectifera_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884535.html","width":87,"caption":"","height":130});
															thumbnails[5877466] = clik.newPhoto({"id":5877466,"src":"VM9W8618_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877466.html","width":130,"caption":"","height":87});
															thumbnails[5884417] = clik.newPhoto({"id":5884417,"src":"_MG_1482_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884417.html","width":87,"caption":"","height":130});
															thumbnails[5884467] = clik.newPhoto({"id":5884467,"src":"_MG_6156__thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884467.html","width":87,"caption":"","height":130});
															thumbnails[5884539] = clik.newPhoto({"id":5884539,"src":"Ophrys_scolpax_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884539.html","width":87,"caption":"","height":130});
															thumbnails[5877471] = clik.newPhoto({"id":5877471,"src":"VM9W8817_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877471.html","width":130,"caption":"","height":87});
															thumbnails[5884430] = clik.newPhoto({"id":5884430,"src":"_MG_6776_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884430.html","width":87,"caption":"","height":130});
															thumbnails[5884474] = clik.newPhoto({"id":5884474,"src":"_MG_9656__thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884474.html","width":87,"caption":"","height":130});
															thumbnails[5884541] = clik.newPhoto({"id":5884541,"src":"Ophrys_speculum_2_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884541.html","width":87,"caption":"","height":130});
															thumbnails[5884409] = clik.newPhoto({"id":5884409,"src":"_MG_0782_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884409.html","width":87,"caption":"","height":130});
															thumbnails[5884486] = clik.newPhoto({"id":5884486,"src":"VM9W7975_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884486.html","width":87,"caption":"","height":130});
															thumbnails[5884545] = clik.newPhoto({"id":5884545,"src":"Orchis_morio_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884545.html","width":87,"caption":"","height":130});
															thumbnails[5887076] = clik.newPhoto({"id":5887076,"src":"_MG_91181_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5887076.html","width":130,"caption":"","height":87});
															thumbnails[5884438] = clik.newPhoto({"id":5884438,"src":"CRW_1379__thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884438.html","width":87,"caption":"","height":130});
															thumbnails[5884477] = clik.newPhoto({"id":5884477,"src":"11941279lH_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884477.html","width":87,"caption":"","height":130});
															thumbnails[5884547] = clik.newPhoto({"id":5884547,"src":"VM9W7721_Oficalhoana_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884547.html","width":87,"caption":"","height":130});
															thumbnails[5877935] = clik.newPhoto({"id":5877935,"src":"jf0191_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5877935.html","width":87,"caption":"","height":130});
															thumbnails[5884408] = clik.newPhoto({"id":5884408,"src":"_MG_0722_1024_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884408.html","width":87,"caption":"","height":130});
															thumbnails[5884468] = clik.newPhoto({"id":5884468,"src":"_MG_7761_thumb.jpg","galleries_id":330661,"server_id":32,"link":"photo_5884468.html","width":87,"caption":"","height":130});
															thumbnails[5884542] = clik.newPhoto({"id":5884542,"src":"Ophrys_subinsectifera_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5884542.html","width":87,"caption":"","height":130});
															thumbnails[5884406] = clik.newPhoto({"id":5884406,"src":"_MG_0112_thumb.jpg","galleries_id":329313,"server_id":32,"link":"photo_5884406.html","width":87,"caption":"","height":130});
															thumbnails[5887185] = clik.newPhoto({"id":5887185,"src":"VM9W9037_thumb.jpg","galleries_id":329314,"server_id":32,"link":"photo_5887185.html","width":87,"caption":"","height":130});
															thumbnails[5887345] = clik.newPhoto({"id":5887345,"src":"O_ten_thumb.jpg","galleries_id":330658,"server_id":32,"link":"photo_5887345.html","width":87,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[329313] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Marinas","link":"gallery_329313.html","maxRecords":0.0,"photoIDs":[5884432.0,5884427.0,5884421.0,5884425.0,5884416.0,5884423.0,5884414.0,5884413.0,5884411.0,5884441.0,5884442.0,5884444.0,5884417.0,5884430.0,5884409.0,5884438.0,5884408.0,5884406.0],"skipIndex":0,"section_code":"gallery","featured_images":5884414.0,"id":329313,"singleSection":false});				  						galleries[329314] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Bosque","link":"gallery_329314.html","maxRecords":0.0,"photoIDs":[5877427.0,5877429.0,5877441.0,5877433.0,5877484.0,5877472.0,5877442.0,5877467.0,5877937.0,5878897.0,5877456.0,5877477.0,5877466.0,5877471.0,5887076.0,5877935.0,5887185.0],"skipIndex":0,"section_code":"gallery","featured_images":5877472.0,"id":329314,"singleSection":false});				  						galleries[330661] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Montaña","link":"gallery_330661.html","maxRecords":0.0,"photoIDs":[5884478.0,5884475.0,5884482.0,5884462.0,5884471.0,5884470.0,5884489.0,5887169.0,5884483.0,5884459.0,5884464.0,5884481.0,5884467.0,5884474.0,5884486.0,5884477.0,5884468.0],"skipIndex":0,"section_code":"gallery","featured_images":5884459.0,"id":330661,"singleSection":false});				  						galleries[330658] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Macro","link":"gallery_330658.html","maxRecords":0.0,"photoIDs":[5884516.0,5884520.0,5884502.0,5884509.0,5884511.0,5884522.0,5884517.0,5884512.0,5884552.0,5884525.0,5884527.0,5884535.0,5884539.0,5884541.0,5884545.0,5884547.0,5884542.0,5887345.0],"skipIndex":0,"section_code":"gallery","featured_images":5884516.0,"id":330658,"singleSection":false});				  						galleries[330659] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Hombre y Naturaleza","link":"gallery_330659.html","maxRecords":0.0,"photoIDs":[5887122.0,5887136.0,5887126.0,5887129.0,5887144.0,5887140.0,5887141.0,5887132.0,5887149.0],"skipIndex":0,"section_code":"gallery","featured_images":5887122.0,"id":330659,"singleSection":false});				  						galleries[474900] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Galería Temporal: Rocas de Mar","link":"gallery_474900.html","maxRecords":0.0,"photoIDs":[9011629.0,9011630.0,9011635.0,9011637.0,9011640.0,9011644.0,9011645.0,9011646.0,9011648.0],"skipIndex":0,"section_code":"gallery","featured_images":9011645.0,"id":474900,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5887122,5884478,5884432,5877427,5884475,5884427,5884482,5877441,5877433,5884471,5877484,5884423,5877472,5884489,5884414,5877442,5887132,5884413,5877467,5884411,5877937,5878897,5884464,5877456,5884481,5877477,5877466,5877471';
imageSets[2] = '5887122,5884516,5877472,9011645,5884414,5884459';
imageSets[3] = '5825834';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/piazzoo/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/piazzoo/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 = 'Jep Flaqué. Fotografia  de Naturaleza: ' + 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;
	}
}

			

