window.thumbnails = {};
															thumbnails[5864488] = clik.newPhoto({"id":5864488,"src":"1002260324yambol_web_copy_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Kekerov Den <br>\r\nThis Old pagan ritual is performed ever year earlyBulgarian first spring. ","height":163});
															thumbnails[5995561] = clik.newPhoto({"id":5995561,"src":"Bee_Eater_web_0004_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Bee Eater in flight","height":87});
															thumbnails[5995620] = clik.newPhoto({"id":5995620,"src":"1002040021blue_tit_web__thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Blue TiT ","height":156});
															thumbnails[7078081] = clik.newPhoto({"id":7078081,"src":"kevovor_den__yambol_web__thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Play Acting","height":159});
															thumbnails[7078105] = clik.newPhoto({"id":7078105,"src":"kevovo_den__yambol_web___thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Dancing in the rain","height":86});
															thumbnails[7078114] = clik.newPhoto({"id":7078114,"src":"Kukerov_den_web__015_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Cow bells 2012","height":87});
															thumbnails[7078139] = clik.newPhoto({"id":7078139,"src":"1002260055_yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Moment in time","height":81});
															thumbnails[7078147] = clik.newPhoto({"id":7078147,"src":"1002260302_yambol__thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Police andd the priest","height":131});
															thumbnails[7078156] = clik.newPhoto({"id":7078156,"src":"1002260301yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Wooly man ","height":92});
															thumbnails[7078186] = clik.newPhoto({"id":7078186,"src":"1002260251yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Man and bear","height":94});
															thumbnails[7078227] = clik.newPhoto({"id":7078227,"src":"1002260062_yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Ladies in Traditional Dress","height":101});
															thumbnails[7078262] = clik.newPhoto({"id":7078262,"src":"1002260245_yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":159});
															thumbnails[7078268] = clik.newPhoto({"id":7078268,"src":"1002260303yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Paly acting ","height":87});
															thumbnails[7078270] = clik.newPhoto({"id":7078270,"src":"1002260056_yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Beat the drum","height":87});
															thumbnails[7078271] = clik.newPhoto({"id":7078271,"src":"1002260173_yambol_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Man in a mask","height":194});
															thumbnails[7090157] = clik.newPhoto({"id":7090157,"src":"tour_payments_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Payments","height":177});
															thumbnails[7171622] = clik.newPhoto({"id":7171622,"src":"Dragonfly_web_027_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Emperor Dragonfly  Anax imperator","height":87});
															thumbnails[9034317] = clik.newPhoto({"id":9034317,"src":"blog__header___thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":38});
															thumbnails[9090029] = clik.newPhoto({"id":9090029,"src":"headerweb___23_thumb.jpg","galleries_id":"","server_id":35,"link":"#","width":130,"caption":"Captured through the lens life in Bulgaria ","height":108});
															thumbnails[3707970] = clik.newPhoto({"id":3707970,"src":"DSCF3745_thumb.JPG","galleries_id":479577,"server_id":32,"link":"photo_3707970.html","width":130,"caption":"Village lady working ","height":194});
															thumbnails[4671818] = clik.newPhoto({"id":4671818,"src":"squacco_heron_feeds_on_fish_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_4671818.html","width":130,"caption":"Squacco Heron catching fish on the Vaya Lake","height":96});
															thumbnails[4672329] = clik.newPhoto({"id":4672329,"src":"cricket_thumb.jpg","galleries_id":479588,"server_id":32,"link":"photo_4672329.html","width":130,"caption":"Portrait of a cricket","height":106});
															thumbnails[5434906] = clik.newPhoto({"id":5434906,"src":"2010_0125tree_in_snowweb60013_thumb.jpg","galleries_id":479580,"server_id":32,"link":"photo_5434906.html","width":130,"caption":"Afternoon light on a snowy day.","height":164});
															thumbnails[5995541] = clik.newPhoto({"id":5995541,"src":"Vulture_web__036_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995541.html","width":130,"caption":"Egyptain Vulture on mountain meadow.","height":107});
															thumbnails[5995551] = clik.newPhoto({"id":5995551,"src":"bee_eater_0003_web__thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995551.html","width":130,"caption":"European Bee Eater, Merops apiaster,","height":87});
															thumbnails[5995555] = clik.newPhoto({"id":5995555,"src":"Bee_Eater_web_0021_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995555.html","width":130,"caption":"Bee Eaters ","height":90});
															thumbnails[5995563] = clik.newPhoto({"id":5995563,"src":"European_Roller_web_028_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995563.html","width":130,"caption":"European Roller ","height":95});
															thumbnails[5995600] = clik.newPhoto({"id":5995600,"src":"Woodchat_shrike_web__037_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995600.html","width":130,"caption":"Woodchat Shrike ","height":90});
															thumbnails[5995704] = clik.newPhoto({"id":5995704,"src":"Caspian_Tern_web__019_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995704.html","width":130,"caption":"CommonTern inflight ","height":88});
															thumbnails[5995816] = clik.newPhoto({"id":5995816,"src":"White_Storks_head__web_0704201063_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_5995816.html","width":130,"caption":"White Storks ","height":87});
															thumbnails[7067669] = clik.newPhoto({"id":7067669,"src":"Vulture__thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7067669.html","width":130,"caption":"Egyptain Vulture","height":133});
															thumbnails[7067829] = clik.newPhoto({"id":7067829,"src":"costume_front_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7067829.html","width":130,"caption":"Dance and Costume","height":123});
															thumbnails[7070206] = clik.newPhoto({"id":7070206,"src":"swallowtail_web_15_thumb.jpg","galleries_id":479589,"server_id":35,"link":"photo_7070206.html","width":130,"caption":"Swallowtail ,Iphiclides podalirius,","height":86});
															thumbnails[7070239] = clik.newPhoto({"id":7070239,"src":"stork__flight_web__thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7070239.html","width":130,"caption":"Stork in flight","height":91});
															thumbnails[7075573] = clik.newPhoto({"id":7075573,"src":"European_Ground_Squirrel_web_080_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7075573.html","width":130,"caption":"European ground Squirrel","height":105});
															thumbnails[7075597] = clik.newPhoto({"id":7075597,"src":"Siinging_Swallow__web_010_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7075597.html","width":130,"caption":"Singing Swallow","height":150});
															thumbnails[7078123] = clik.newPhoto({"id":7078123,"src":"Kukerov_den_web__39_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7078123.html","width":130,"caption":"Colection of Kukerov Den masks  2012","height":86});
															thumbnails[7078126] = clik.newPhoto({"id":7078126,"src":"1002260166_yambol_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7078126.html","width":130,"caption":"Even the young take part Kukerovo 2010","height":100});
															thumbnails[7078135] = clik.newPhoto({"id":7078135,"src":"Kukerov_den_web___0112_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7078135.html","width":130,"caption":"Line up Kukerovo 2011","height":87});
															thumbnails[7078215] = clik.newPhoto({"id":7078215,"src":"1002260254_yambol_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7078215.html","width":130,"caption":"The priest","height":87});
															thumbnails[7089697] = clik.newPhoto({"id":7089697,"src":"Evening_set__web_03_thumb.jpg","galleries_id":479590,"server_id":32,"link":"photo_7089697.html","width":130,"caption":"As the sun sets ","height":87});
															thumbnails[7089774] = clik.newPhoto({"id":7089774,"src":"village_shop_pig_46bw_web_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7089774.html","width":130,"caption":"Family and Friends ","height":98});
															thumbnails[7089984] = clik.newPhoto({"id":7089984,"src":"Cynthias_Fritillary_Butterfly_on_feaf_Butterfly_web_017_jpg_735BF0E8-1EC9-D45B-1C3FAD3BF3DCA6B7_thumb.jpg","galleries_id":479589,"server_id":32,"link":"photo_7089984.html","width":130,"caption":" Southern White Admiral","height":130});
															thumbnails[7090280] = clik.newPhoto({"id":7090280,"src":"Orange_flower_art_work_web_09_thumb.jpg","galleries_id":479580,"server_id":32,"link":"photo_7090280.html","width":130,"caption":"Close up photography ","height":78});
															thumbnails[7159272] = clik.newPhoto({"id":7159272,"src":"cows_cool_off_web__1479_thumb.jpg","galleries_id":479590,"server_id":32,"link":"photo_7159272.html","width":130,"caption":"Cows cool off ","height":95});
															thumbnails[7160323] = clik.newPhoto({"id":7160323,"src":"Watching_sheep_web_4438_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7160323.html","width":130,"caption":"Sheep herer on donkey ","height":91});
															thumbnails[7168336] = clik.newPhoto({"id":7168336,"src":"Dragonfly_web_214_thumb.jpg","galleries_id":479588,"server_id":32,"link":"photo_7168336.html","width":130,"caption":"Dragonfly ","height":105});
															thumbnails[7168345] = clik.newPhoto({"id":7168345,"src":"Wild_Mushrooms_web_master_9_thumb.jpg","galleries_id":479580,"server_id":32,"link":"photo_7168345.html","width":130,"caption":"Wild mushrooms ","height":87});
															thumbnails[7171569] = clik.newPhoto({"id":7171569,"src":"Lizard_on_rock_web_190_thumb.jpg","galleries_id":479588,"server_id":32,"link":"photo_7171569.html","width":130,"caption":"Portrait of a lizzard","height":108});
															thumbnails[7171587] = clik.newPhoto({"id":7171587,"src":"bird_of_prey_flight_web__1_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7171587.html","width":130,"caption":"Red Kite","height":92});
															thumbnails[7171631] = clik.newPhoto({"id":7171631,"src":"hen_hariar_web_0704201012_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7171631.html","width":130,"caption":"Montagu,s Harrier","height":87});
															thumbnails[7171649] = clik.newPhoto({"id":7171649,"src":"Gold_finches_in_snow_2_web__thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_7171649.html","width":130,"caption":"Goldfinches ","height":103});
															thumbnails[7171662] = clik.newPhoto({"id":7171662,"src":"woman_during_bulgaria_dance__web_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7171662.html","width":130,"caption":"Traditional Dress","height":87});
															thumbnails[7171669] = clik.newPhoto({"id":7171669,"src":"lifestyle_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7171669.html","width":130,"caption":"Clean sweep ","height":117});
															thumbnails[7277344] = clik.newPhoto({"id":7277344,"src":"Walking_home_after_a_days_work_in_the_fields_web__001912_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7277344.html","width":130,"caption":"Lady field worker ","height":87});
															thumbnails[7277650] = clik.newPhoto({"id":7277650,"src":"wild_orchid_web__1412_thumb.jpg","galleries_id":479580,"server_id":32,"link":"photo_7277650.html","width":130,"caption":"Wild Orchid ","height":87});
															thumbnails[7512153] = clik.newPhoto({"id":7512153,"src":"Kukerov_den_web_047_thumb.jpg","galleries_id":479577,"server_id":32,"link":"photo_7512153.html","width":130,"caption":"Enjoying the Festival fun ","height":186});
															thumbnails[9033925] = clik.newPhoto({"id":9033925,"src":"walk_in_the_park_grain_web__061_thumb.jpg","galleries_id":479590,"server_id":32,"link":"photo_9033925.html","width":130,"caption":"Golden light ","height":87});
															thumbnails[9036032] = clik.newPhoto({"id":9036032,"src":"Great_Reed_Warble_singing_in_reeds__3901_thumb.jpg","galleries_id":479579,"server_id":32,"link":"photo_9036032.html","width":130,"caption":"Spring time full in song ","height":195});
															thumbnails[9090132] = clik.newPhoto({"id":9090132,"src":"bee_Eater_feeding_web__137_thumb.jpg","galleries_id":479579,"server_id":35,"link":"photo_9090132.html","width":130,"caption":"Bee Eater feeding her young","height":104});
															thumbnails[9090256] = clik.newPhoto({"id":9090256,"src":"Hummingbird_Hawkmoth_web_37_thumb.jpg","galleries_id":479589,"server_id":35,"link":"photo_9090256.html","width":130,"caption":"Hummingbird Hawkmoth ","height":87});
															thumbnails[9090264] = clik.newPhoto({"id":9090264,"src":"close_up_Green_Hairstreak_Butterfly_on_flower_the_Holy_trinity_Monastery_web___35_thumb.jpg","galleries_id":479589,"server_id":35,"link":"photo_9090264.html","width":130,"caption":"Green Hairstreak ","height":98});
															thumbnails[9090353] = clik.newPhoto({"id":9090353,"src":"Praying_Mantis_web__16_thumb.jpg","galleries_id":479588,"server_id":35,"link":"photo_9090353.html","width":130,"caption":"Preying Mantis ","height":195});
															thumbnails[7070217] = clik.newPhoto({"id":7070217,"src":"Cynthias_Fritillary_Butterfly_on_feaf_Butterfly_web_017_jpg_thumb.jpg","galleries_id":382891,"server_id":32,"link":"photo_7070217.html","width":130,"caption":"Cynthias Fritillary","height":130});
															thumbnails[8341342] = clik.newPhoto({"id":8341342,"src":"flower_digital_art_web__14_thumb.jpg","galleries_id":382891,"server_id":32,"link":"photo_8341342.html","width":130,"caption":"Yellow flower","height":65});
															thumbnails[8341355] = clik.newPhoto({"id":8341355,"src":"Squocco_Heron_watercolour__ruff_09cn01_24_thumb.jpg","galleries_id":382891,"server_id":32,"link":"photo_8341355.html","width":130,"caption":"Squaccon Heron Fishing ","height":87});
															thumbnails[7294243] = clik.newPhoto({"id":7294243,"src":"Collection_of_Birds_web_thumb.jpg","galleries_id":402143,"server_id":32,"link":"photo_7294243.html","width":130,"caption":"<a href=\"http:\/\/f8gallery.viewbook.com\/\">Digital Downloads of Bulgaria<\/a>","height":135});
															thumbnails[7294490] = clik.newPhoto({"id":7294490,"src":"insects_collection_web_thumb.jpg","galleries_id":402143,"server_id":32,"link":"photo_7294490.html","width":130,"caption":"<a href=\"http:\/\/f8gallery.viewbook.com\/\">Digital Downloads of Bulgaria<\/a>","height":134});
															thumbnails[7294784] = clik.newPhoto({"id":7294784,"src":"culture_collection_web_thumb.jpg","galleries_id":402143,"server_id":32,"link":"photo_7294784.html","width":130,"caption":"<a href=\"http:\/\/f8gallery.viewbook.com\/\">Digital Downloads of Bulgaria<\/a>","height":134});
															thumbnails[7294885] = clik.newPhoto({"id":7294885,"src":"Butterfly_collectionweb__thumb.jpg","galleries_id":402143,"server_id":32,"link":"photo_7294885.html","width":130,"caption":"<a href=\"http:\/\/f8gallery.viewbook.com\/\">Digital Downloads of Bulgaria<\/a>","height":135});
															thumbnails[7294946] = clik.newPhoto({"id":7294946,"src":"dragonflies_collection_web_-1_thumb.jpg","galleries_id":402143,"server_id":32,"link":"photo_7294946.html","width":130,"caption":"<a href=\"http:\/\/f8gallery.viewbook.com\/\">Digital Downloads of Bulgaria<\/a>","height":133});
															thumbnails[7420286] = clik.newPhoto({"id":7420286,"src":"editorial_images1_edited-11_thumb.jpg","galleries_id":402143,"server_id":32,"link":"photo_7420286.html","width":130,"caption":"<a href=\"http:\/\/f8gallery.viewbook.com\/\">Digital Downloads of Bulgaria<\/a>","height":135});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[479589] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Butterflies and moths ","link":"section455120_479589.html","maxRecords":0.0,"photoIDs":[7070206.0,7089984.0,9090256.0,9090264.0],"skipIndex":0,"section_code":"section455120","featured_images":"9090256,7089984","id":479589,"singleSection":false});				  						galleries[479577] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Culture Photography  ","link":"section455120_479577.html","maxRecords":0.0,"photoIDs":[3707970.0,7078123.0,7078126.0,7078135.0,7078215.0,7089774.0,7160323.0,7171662.0,7171669.0,7277344.0,7512153.0],"skipIndex":0,"section_code":"section455120","featured_images":"7512153,3707970","id":479577,"singleSection":false});				  						galleries[479590] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape ","link":"section455120_479590.html","maxRecords":0.0,"photoIDs":[7089697.0,7159272.0,9033925.0],"skipIndex":0,"section_code":"section455120","featured_images":7089697.0,"id":479590,"singleSection":false});				  						galleries[479588] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lizards and Insects ","link":"section455120_479588.html","maxRecords":0.0,"photoIDs":[4672329.0,7168336.0,7171569.0,9090353.0],"skipIndex":0,"section_code":"section455120","featured_images":"9090353,7171569,7168336,4672329","id":479588,"singleSection":false});				  						galleries[479580] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Nature","link":"section455120_479580.html","maxRecords":0.0,"photoIDs":[5434906.0,7090280.0,7168345.0,7277650.0],"skipIndex":0,"section_code":"section455120","featured_images":"7277650,7168345,7090280,5434906","id":479580,"singleSection":false});				  						galleries[382891] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Prints Sales ","link":"section455426.html","maxRecords":0.0,"photoIDs":[7070217.0,8341342.0,8341355.0],"skipIndex":0,"section_code":"section455426","featured_images":"8341355,8341342,7070217","id":382891,"singleSection":true});				  						galleries[402143] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stock Library ","link":"section480098.html","maxRecords":0.0,"photoIDs":[7294243.0,7294490.0,7294784.0,7294885.0,7294946.0,7420286.0],"skipIndex":0,"section_code":"section480098","featured_images":"7420286,7294946,7294885,7294784,7294490,7294243","id":402143,"singleSection":true});				  						galleries[479579] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wildlife","link":"section455120_479579.html","maxRecords":0.0,"photoIDs":[4671818.0,5995541.0,5995551.0,5995555.0,5995563.0,5995600.0,5995704.0,5995816.0,7067669.0,7067829.0,7070239.0,7075573.0,7075597.0,7171587.0,7171631.0,7171649.0,9036032.0,9090132.0],"skipIndex":0,"section_code":"section455120","featured_images":"5995600,5995541","id":479579,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[247644] = '3707970';
imageSets[1] = '9090029';
imageSets[2] = '9090256,7512153,7089984,7089697,5995600,5995541,3707970';
imageSets[3] = '9090353,9090264,9090256,9090132,9090029,9036032,9034317,9033925,8341355,8341342,7512153,7420286,7294946,7294885,7294784,7294490,7294243,7277650,7277344,7171669,7171662,7171649,7171631,7171622,7171587,7171569,7168345,7168336,7160323,7159272,7090280,7090157,7089984,7089774,7089697,7078271,7078270,7078268,7078262,7078227,7078215,7078186,7078156,7078147,7078139,7078135,7078126,7078123,7078114,7078105';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/cliff/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/cliff/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/cliff/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/cliff/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/cliff/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/cliff/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/cliff/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/cliff/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 += 'section455120.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 && 'section455120' != '') {
					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 = 'Bulgaria Photo Holidays: ' + 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="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		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" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="nortoncliff@ymail.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="nortoncliff@ymail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

