window.thumbnails = {};
															thumbnails[581912] = clik.newPhoto({"id":581912,"src":"perth railway bidge_thumb.jpg","galleries_id":44814,"server_id":15,"link":"photo_581912.html","width":130,"caption":"misty river tay","height":192});
															thumbnails[581913] = clik.newPhoto({"id":581913,"src":"barriers 11_thumb.jpg","galleries_id":44814,"server_id":15,"link":"photo_581913.html","width":130,"caption":"versteh' ich nicht","height":87});
															thumbnails[581915] = clik.newPhoto({"id":581915,"src":"no a101_thumb.jpg","galleries_id":44814,"server_id":15,"link":"photo_581915.html","width":130,"caption":"Berliner Funkturm","height":173});
															thumbnails[581917] = clik.newPhoto({"id":581917,"src":"floating past_thumb.jpg","galleries_id":44814,"server_id":15,"link":"photo_581917.html","width":130,"caption":"floating past","height":197});
															thumbnails[757789] = clik.newPhoto({"id":757789,"src":"frosty rose_thumb.jpg","galleries_id":44814,"server_id":15,"link":"photo_757789.html","width":130,"caption":"frosty rose","height":173});
															thumbnails[757813] = clik.newPhoto({"id":757813,"src":"floodings_thumb.jpg","galleries_id":44814,"server_id":15,"link":"photo_757813.html","width":130,"caption":"floodings","height":173});
															thumbnails[757814] = clik.newPhoto({"id":757814,"src":"lost in thought_thumb.jpg","galleries_id":8482,"server_id":15,"link":"photo_757814.html","width":130,"caption":"lost in thought","height":98});
															thumbnails[1463828] = clik.newPhoto({"id":1463828,"src":"lily_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_1463828.html","width":130,"caption":"daring to intrude","height":173});
															thumbnails[2429315] = clik.newPhoto({"id":2429315,"src":"staircase elcho castle_thumb.jpg","galleries_id":8476,"server_id":15,"link":"photo_2429315.html","width":130,"caption":"Staircase in Elcho Castle","height":98});
															thumbnails[2429382] = clik.newPhoto({"id":2429382,"src":"calm sea_thumb.jpg","galleries_id":8488,"server_id":15,"link":"photo_2429382.html","width":130,"caption":"Calm Sea","height":98});
															thumbnails[2429405] = clik.newPhoto({"id":2429405,"src":"stecker_thumb.jpg","galleries_id":218937,"server_id":15,"link":"photo_2429405.html","width":130,"caption":"Leaking plug","height":73});
															thumbnails[2429485] = clik.newPhoto({"id":2429485,"src":"img_0158_thumb.jpg","galleries_id":8487,"server_id":15,"link":"photo_2429485.html","width":130,"caption":"Before the concert","height":98});
															thumbnails[3581541] = clik.newPhoto({"id":3581541,"src":"060177_woods_scaled_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_3581541.html","width":130,"caption":"into the woods","height":173});
															thumbnails[3581548] = clik.newPhoto({"id":3581548,"src":"img_1853_manip_scaled_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_3581548.html","width":130,"caption":"frozen in hope","height":87});
															thumbnails[3581568] = clik.newPhoto({"id":3581568,"src":"img_0564_manip2_scaled_thumb.jpg","galleries_id":218948,"server_id":15,"link":"photo_3581568.html","width":130,"caption":"Guy Fawkes Night in Perth","height":52});
															thumbnails[3581574] = clik.newPhoto({"id":3581574,"src":"img_1162_manip_scaled_thumb.jpg","galleries_id":218948,"server_id":15,"link":"photo_3581574.html","width":130,"caption":"yellow and cold","height":43});
															thumbnails[3582048] = clik.newPhoto({"id":3582048,"src":"img_1587_scaled_thumb.jpg","galleries_id":218937,"server_id":15,"link":"photo_3582048.html","width":130,"caption":"twisted","height":88});
															thumbnails[8929863] = clik.newPhoto({"id":8929863,"src":"IMG_0732_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929863.html","width":130,"caption":"bicycles","height":99});
															thumbnails[8929868] = clik.newPhoto({"id":8929868,"src":"IMG_1110_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929868.html","width":130,"caption":"Summer in the City","height":87});
															thumbnails[8929870] = clik.newPhoto({"id":8929870,"src":"IMG_0655_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929870.html","width":130,"caption":"Having a break","height":83});
															thumbnails[8929871] = clik.newPhoto({"id":8929871,"src":"IMG_0747_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929871.html","width":130,"caption":"Jesus loves you","height":66});
															thumbnails[8929872] = clik.newPhoto({"id":8929872,"src":"IMG_0578_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929872.html","width":130,"caption":"U Bahn","height":75});
															thumbnails[8929876] = clik.newPhoto({"id":8929876,"src":"IMG_9727_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929876.html","width":130,"caption":"Relaxing near the water","height":87});
															thumbnails[8929878] = clik.newPhoto({"id":8929878,"src":"IMG_0670_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929878.html","width":130,"caption":"BSR on tour","height":80});
															thumbnails[8929879] = clik.newPhoto({"id":8929879,"src":"IMG_1135_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929879.html","width":130,"caption":"En passant","height":67});
															thumbnails[8929882] = clik.newPhoto({"id":8929882,"src":"IMG_1214_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929882.html","width":130,"caption":"blocks clever","height":71});
															thumbnails[8929885] = clik.newPhoto({"id":8929885,"src":"IMG_0775_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929885.html","width":130,"caption":"Café Kranzler","height":61});
															thumbnails[8929895] = clik.newPhoto({"id":8929895,"src":"IMG_9855_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8929895.html","width":130,"caption":"Oberbaumbrücke","height":53});
															thumbnails[8929899] = clik.newPhoto({"id":8929899,"src":"IMG_9742_thumb.JPG","galleries_id":8488,"server_id":15,"link":"photo_8929899.html","width":130,"caption":"directions","height":65});
															thumbnails[8929900] = clik.newPhoto({"id":8929900,"src":"on_track_thumb.jpg","galleries_id":8488,"server_id":15,"link":"photo_8929900.html","width":130,"caption":"on track","height":49});
															thumbnails[8929901] = clik.newPhoto({"id":8929901,"src":"IMG_0645_thumb.JPG","galleries_id":8488,"server_id":15,"link":"photo_8929901.html","width":130,"caption":"lights","height":87});
															thumbnails[8929904] = clik.newPhoto({"id":8929904,"src":"IMG_6678_thumb.JPG","galleries_id":8488,"server_id":15,"link":"photo_8929904.html","width":130,"caption":"I'm cold!","height":87});
															thumbnails[8929905] = clik.newPhoto({"id":8929905,"src":"img_4259_scaled_thumb.jpg","galleries_id":8488,"server_id":15,"link":"photo_8929905.html","width":130,"caption":"Genie in a bowl","height":121});
															thumbnails[8929910] = clik.newPhoto({"id":8929910,"src":"hommage_to_kertesz_thumb.jpg","galleries_id":8488,"server_id":15,"link":"photo_8929910.html","width":130,"caption":"hommage to kertesz","height":92});
															thumbnails[8929912] = clik.newPhoto({"id":8929912,"src":"nichtsdestoweniger_bw_thumb.jpg","galleries_id":8488,"server_id":15,"link":"photo_8929912.html","width":130,"caption":"train of thought","height":98});
															thumbnails[8929914] = clik.newPhoto({"id":8929914,"src":"img_3221_manip_2_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_8929914.html","width":130,"caption":"young fern","height":118});
															thumbnails[8929916] = clik.newPhoto({"id":8929916,"src":"img_7760_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_8929916.html","width":130,"caption":"hungry mallards","height":87});
															thumbnails[8929918] = clik.newPhoto({"id":8929918,"src":"img_3027_manip_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_8929918.html","width":130,"caption":"fresh bramble","height":87});
															thumbnails[8929919] = clik.newPhoto({"id":8929919,"src":"img_7171_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_8929919.html","width":130,"caption":"Can I eat that?","height":110});
															thumbnails[8929922] = clik.newPhoto({"id":8929922,"src":"img_5045_scaled_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_8929922.html","width":130,"caption":"Kinnoul Hill Woods","height":87});
															thumbnails[8929924] = clik.newPhoto({"id":8929924,"src":"img_3075_cropped_thumb.jpg","galleries_id":8484,"server_id":15,"link":"photo_8929924.html","width":130,"caption":"delicate detail","height":95});
															thumbnails[8929926] = clik.newPhoto({"id":8929926,"src":"img_5827_thumb.jpg","galleries_id":218948,"server_id":15,"link":"photo_8929926.html","width":130,"caption":"Enchanted woods","height":88});
															thumbnails[8929929] = clik.newPhoto({"id":8929929,"src":"img_0595_manip_thumb.jpg","galleries_id":218948,"server_id":15,"link":"photo_8929929.html","width":130,"caption":"Perth fireworks","height":87});
															thumbnails[8929930] = clik.newPhoto({"id":8929930,"src":"img_4408_scaled_thumb.jpg","galleries_id":218948,"server_id":15,"link":"photo_8929930.html","width":130,"caption":"riding the ghost train","height":87});
															thumbnails[8929931] = clik.newPhoto({"id":8929931,"src":"img_4395_scaled_thumb.jpg","galleries_id":218948,"server_id":15,"link":"photo_8929931.html","width":130,"caption":"a gathering of like-minded people","height":65});
															thumbnails[8929932] = clik.newPhoto({"id":8929932,"src":"IMG_0037_thumb.JPG","galleries_id":218948,"server_id":15,"link":"photo_8929932.html","width":130,"caption":"Spree at night","height":58});
															thumbnails[8929935] = clik.newPhoto({"id":8929935,"src":"img_4885_manip_thumb.jpg","galleries_id":8476,"server_id":15,"link":"photo_8929935.html","width":130,"caption":"Fern","height":53});
															thumbnails[8929940] = clik.newPhoto({"id":8929940,"src":"IMG_1261_thumb.JPG","galleries_id":8487,"server_id":15,"link":"photo_8929940.html","width":130,"caption":"firmly in sight","height":60});
															thumbnails[8929941] = clik.newPhoto({"id":8929941,"src":"img_5479_full_thumb.jpg","galleries_id":8487,"server_id":15,"link":"photo_8929941.html","width":130,"caption":"Hello","height":81});
															thumbnails[8929943] = clik.newPhoto({"id":8929943,"src":"IMG_9939_thumb.JPG","galleries_id":8487,"server_id":15,"link":"photo_8929943.html","width":130,"caption":"at the end of the day","height":57});
															thumbnails[8929944] = clik.newPhoto({"id":8929944,"src":"IMG_0560_thumb.JPG","galleries_id":8487,"server_id":15,"link":"photo_8929944.html","width":130,"caption":"Santa Day in Dunkeld","height":74});
															thumbnails[8929945] = clik.newPhoto({"id":8929945,"src":"IMG_9921_thumb.JPG","galleries_id":8487,"server_id":15,"link":"photo_8929945.html","width":130,"caption":"smile please!","height":75});
															thumbnails[8929949] = clik.newPhoto({"id":8929949,"src":"SW_falls_of_bruar_II_thumb.jpg","galleries_id":8482,"server_id":15,"link":"photo_8929949.html","width":130,"caption":"Falls of Bruar","height":83});
															thumbnails[8929950] = clik.newPhoto({"id":8929950,"src":"img_8716_thumb.jpg","galleries_id":218937,"server_id":15,"link":"photo_8929950.html","width":130,"caption":"orange","height":109});
															thumbnails[8929951] = clik.newPhoto({"id":8929951,"src":"img_8528_thumb.jpg","galleries_id":218937,"server_id":15,"link":"photo_8929951.html","width":130,"caption":"Deutsche Post","height":87});
															thumbnails[8929952] = clik.newPhoto({"id":8929952,"src":"img_6926_thumb.jpg","galleries_id":218937,"server_id":15,"link":"photo_8929952.html","width":130,"caption":"lost and found","height":86});
															thumbnails[8929953] = clik.newPhoto({"id":8929953,"src":"120277_dayafter_thumb.jpg","galleries_id":218937,"server_id":15,"link":"photo_8929953.html","width":130,"caption":"the day after the night before","height":78});
															thumbnails[8929955] = clik.newPhoto({"id":8929955,"src":"IMG_1373_thumb.JPG","galleries_id":218937,"server_id":15,"link":"photo_8929955.html","width":130,"caption":"restrictions and regulations","height":76});
															thumbnails[8929956] = clik.newPhoto({"id":8929956,"src":"IMG_1500_thumb.JPG","galleries_id":218937,"server_id":15,"link":"photo_8929956.html","width":130,"caption":"It's all France to me ","height":67});
															thumbnails[8929960] = clik.newPhoto({"id":8929960,"src":"SW_garry_bridge_I1_thumb.jpg","galleries_id":8482,"server_id":15,"link":"photo_8929960.html","width":130,"caption":"The Pass of Killiecrankie","height":200});
															thumbnails[8929971] = clik.newPhoto({"id":8929971,"src":"IMG_2808_manip1_thumb.jpg","galleries_id":8482,"server_id":15,"link":"photo_8929971.html","width":130,"caption":"countryside gate","height":195});
															thumbnails[8929978] = clik.newPhoto({"id":8929978,"src":"IMG_08821_thumb.JPG","galleries_id":8482,"server_id":15,"link":"photo_8929978.html","width":130,"caption":"silence in winter","height":195});
															thumbnails[8929996] = clik.newPhoto({"id":8929996,"src":"town_house_bw1_thumb.jpg","galleries_id":8487,"server_id":15,"link":"photo_8929996.html","width":130,"caption":"town house","height":222});
															thumbnails[8929999] = clik.newPhoto({"id":8929999,"src":"true_rest1_thumb.jpg","galleries_id":8487,"server_id":15,"link":"photo_8929999.html","width":130,"caption":"true rest","height":285});
															thumbnails[8930003] = clik.newPhoto({"id":8930003,"src":"dougie_shadow1_thumb.jpg","galleries_id":8487,"server_id":15,"link":"photo_8930003.html","width":130,"caption":"Dougie","height":388});
															thumbnails[8930010] = clik.newPhoto({"id":8930010,"src":"IMG_07071_thumb.JPG","galleries_id":8476,"server_id":15,"link":"photo_8930010.html","width":130,"caption":"seasonal greetings","height":195});
															thumbnails[8930012] = clik.newPhoto({"id":8930012,"src":"img_2979_manip1_thumb.jpg","galleries_id":8476,"server_id":15,"link":"photo_8930012.html","width":130,"caption":"capsized","height":160});
															thumbnails[8930013] = clik.newPhoto({"id":8930013,"src":"IMG_03751_thumb.JPG","galleries_id":8476,"server_id":15,"link":"photo_8930013.html","width":130,"caption":"blue forest","height":195});
															thumbnails[8930016] = clik.newPhoto({"id":8930016,"src":"yellow2_thumb.jpg","galleries_id":8488,"server_id":15,"link":"photo_8930016.html","width":130,"caption":"yellow","height":431});
															thumbnails[8930033] = clik.newPhoto({"id":8930033,"src":"IMG_11621_thumb.JPG","galleries_id":469257,"server_id":15,"link":"photo_8930033.html","width":130,"caption":"Funkturm","height":325});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[44814] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"sold items","link":"gallery_44814.html","maxRecords":0.0,"photoIDs":[581912.0,581913.0,581915.0,581917.0,757789.0,757813.0],"skipIndex":0,"section_code":"gallery","featured_images":"757789,581915","id":44814,"singleSection":false});				  						galleries[8476] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"rhythm and pattern","link":"gallery_8476.html","maxRecords":0.0,"photoIDs":[2429315.0,8929935.0,8930010.0,8930012.0,8930013.0],"skipIndex":0,"section_code":"gallery","featured_images":"8930012,8929935,2429315","id":8476,"singleSection":false});				  						galleries[8482] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"tranquillity","link":"gallery_8482.html","maxRecords":0.0,"photoIDs":[757814.0,8929949.0,8929960.0,8929971.0,8929978.0],"skipIndex":0,"section_code":"gallery","featured_images":"8929978,8929949,757814","id":8482,"singleSection":false});				  						galleries[8484] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"nature","link":"gallery_8484.html","maxRecords":0.0,"photoIDs":[1463828.0,3581541.0,3581548.0,8929914.0,8929916.0,8929918.0,8929919.0,8929922.0,8929924.0],"skipIndex":0,"section_code":"gallery","featured_images":"8929922,8929919,8929918,8929914,3581548,3581541,1463828","id":8484,"singleSection":false});				  						galleries[8488] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"creative photography","link":"gallery_8488.html","maxRecords":0.0,"photoIDs":[2429382.0,8929899.0,8929900.0,8929901.0,8929904.0,8929905.0,8929910.0,8929912.0,8930016.0],"skipIndex":0,"section_code":"gallery","featured_images":"8929904,8929901,8929899,2429382","id":8488,"singleSection":false});				  						galleries[8487] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"sights","link":"gallery_8487.html","maxRecords":0.0,"photoIDs":[2429485.0,8929940.0,8929941.0,8929943.0,8929944.0,8929945.0,8929996.0,8929999.0,8930003.0],"skipIndex":0,"section_code":"gallery","featured_images":"8929999,8929943,8929940","id":8487,"singleSection":false});				  						galleries[218937] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"urban","link":"gallery_218937.html","maxRecords":0.0,"photoIDs":[2429405.0,3582048.0,8929950.0,8929951.0,8929952.0,8929953.0,8929955.0,8929956.0],"skipIndex":0,"section_code":"gallery","featured_images":"8929955,8929953,3582048,2429405","id":218937,"singleSection":false});				  						galleries[218948] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"night time","link":"gallery_218948.html","maxRecords":0.0,"photoIDs":[3581568.0,3581574.0,8929926.0,8929929.0,8929930.0,8929931.0,8929932.0],"skipIndex":0,"section_code":"gallery","featured_images":"8929930,3581568","id":218948,"singleSection":false});				  						galleries[469257] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Berlin mit ohne Brille - Berlin without glasses","link":"gallery_469257.html","maxRecords":0.0,"photoIDs":[8929863.0,8929868.0,8929870.0,8929871.0,8929872.0,8929876.0,8929878.0,8929879.0,8929882.0,8929885.0,8929895.0,8930033.0],"skipIndex":0,"section_code":"gallery","featured_images":"8930033,8929878,8929876,8929863","id":469257,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8930012,8929949,8929940,8929930,8929924,8929910,8929904,8929878,8929876,8929868,3582048,3581568,3581548,3581541,2429485,2429405,2429382,2429315,1463828,757814,581913';
imageSets[2] = '8930033,8930012,8929999,8929978,8929955,8929953,8929949,8929943,8929940,8929935,8929930,8929922,8929919,8929918,8929914,8929904,8929901,8929899,8929878,8929876,8929863,3582048,3581568,3581548,3581541,2429405,2429382,2429315,1463828,757814,757789,581915';
imageSets[3] = '8930033,8930016,8930013,8930012,8930010,8930003,8929999,8929996,8929978,8929971,8929960,8929956,8929955,8929953,8929952,8929951,8929950,8929949,8929945,8929944,8929943,8929941,8929940,8929935,8929932,8929931,8929930,8929929,8929926,8929924,8929922,8929919,8929918,8929916,8929914,8929912,8929910,8929905,8929904,8929901,8929900,8929899,8929895,8929885,8929882,8929879,8929878,8929876,8929872,8929871';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/seileasdar/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/seileasdar/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 = 'Photography by Sabrina Willekens: ' + 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="sabsw@web.de">';
					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="sabsw@web.de">';
				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;
	}
}

			

