window.thumbnails = {};
															thumbnails[5065673] = clik.newPhoto({"id":5065673,"src":"elipse_1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":67,"caption":"Elipse Building (SA1 Swansea)","height":100});
															thumbnails[8245672] = clik.newPhoto({"id":8245672,"src":"dynevor_park_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":66,"caption":"Dynevor Park","height":100});
															thumbnails[3830447] = clik.newPhoto({"id":3830447,"src":"millenium_centre_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_3830447.html","width":100,"caption":"Millenium Theatre","height":76});
															thumbnails[3831732] = clik.newPhoto({"id":3831732,"src":"tower_bridge_1_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_3831732.html","width":67,"caption":"Tower Bridge","height":100});
															thumbnails[4836395] = clik.newPhoto({"id":4836395,"src":"97930004_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_4836395.html","width":88,"caption":"","height":100});
															thumbnails[4836396] = clik.newPhoto({"id":4836396,"src":"97930020_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_4836396.html","width":52,"caption":"","height":100});
															thumbnails[4836397] = clik.newPhoto({"id":4836397,"src":"97930033_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_4836397.html","width":79,"caption":"","height":100});
															thumbnails[5046712] = clik.newPhoto({"id":5046712,"src":"bay_cinema1_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5046712.html","width":100,"caption":"Red Dragon Centre ( Cardiff Bay)","height":77});
															thumbnails[5046994] = clik.newPhoto({"id":5046994,"src":"bay_12_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5046994.html","width":67,"caption":"Cardiff Bay Barrage","height":100});
															thumbnails[5047038] = clik.newPhoto({"id":5047038,"src":"bay_10_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5047038.html","width":67,"caption":"Bay Apartments","height":100});
															thumbnails[5047043] = clik.newPhoto({"id":5047043,"src":"canary_wharf_tube_station_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5047043.html","width":100,"caption":"Canary Wharf Tube Station","height":89});
															thumbnails[5047048] = clik.newPhoto({"id":5047048,"src":"sky_view_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5047048.html","width":74,"caption":"Skylight","height":100});
															thumbnails[5047112] = clik.newPhoto({"id":5047112,"src":"bay_hotel1_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5047112.html","width":72,"caption":"St Davids Hotel (Cardiff Bay)","height":100});
															thumbnails[5047126] = clik.newPhoto({"id":5047126,"src":"technium_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5047126.html","width":79,"caption":"Technium (SA1 Swansea)","height":100});
															thumbnails[5047339] = clik.newPhoto({"id":5047339,"src":"london_eye_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5047339.html","width":67,"caption":"The Eye at Night","height":100});
															thumbnails[5047379] = clik.newPhoto({"id":5047379,"src":"mumbles_head_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5047379.html","width":100,"caption":"Mumbles Head","height":52});
															thumbnails[5047380] = clik.newPhoto({"id":5047380,"src":"mumbles_infared_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5047380.html","width":100,"caption":"Mumbles Pier (infared)","height":67});
															thumbnails[5047384] = clik.newPhoto({"id":5047384,"src":"whitford_point_lighthouse_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5047384.html","width":68,"caption":"Whitford Point Lighthouse","height":100});
															thumbnails[5047457] = clik.newPhoto({"id":5047457,"src":"kidwelly_castle_1_thumb.jpg","galleries_id":234888,"server_id":15,"link":"photo_5047457.html","width":100,"caption":"Kidwelly Castle","height":68});
															thumbnails[5047459] = clik.newPhoto({"id":5047459,"src":"north_thumb.jpg","galleries_id":234888,"server_id":15,"link":"photo_5047459.html","width":100,"caption":"North Dock Llanelli","height":69});
															thumbnails[5047460] = clik.newPhoto({"id":5047460,"src":"park_howard_infared_sepia_thumb.jpg","galleries_id":234888,"server_id":15,"link":"photo_5047460.html","width":100,"caption":"Park Howard (infared)","height":69});
															thumbnails[5047461] = clik.newPhoto({"id":5047461,"src":"swiss_valley_thumb.jpg","galleries_id":234888,"server_id":15,"link":"photo_5047461.html","width":100,"caption":"Swiss valley ","height":69});
															thumbnails[5047463] = clik.newPhoto({"id":5047463,"src":"burry_port_light_house1_thumb.jpg","galleries_id":234888,"server_id":15,"link":"photo_5047463.html","width":68,"caption":"Burryport Lighthouse","height":100});
															thumbnails[5047464] = clik.newPhoto({"id":5047464,"src":"costal_path_thumb.jpg","galleries_id":234888,"server_id":15,"link":"photo_5047464.html","width":100,"caption":" Coastal Path Vistors Centre","height":68});
															thumbnails[5051442] = clik.newPhoto({"id":5051442,"src":"Dryslwyn_castle_1_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5051442.html","width":100,"caption":"Misty Dawn","height":67});
															thumbnails[5051449] = clik.newPhoto({"id":5051449,"src":"cader_valley1_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5051449.html","width":77,"caption":"Corris Valley","height":100});
															thumbnails[5051452] = clik.newPhoto({"id":5051452,"src":"misty_river1_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5051452.html","width":100,"caption":"Reflections Of Dawn","height":67});
															thumbnails[5051475] = clik.newPhoto({"id":5051475,"src":"Rhandirmyn1_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5051475.html","width":67,"caption":"Autumn Glory","height":100});
															thumbnails[5058911] = clik.newPhoto({"id":5058911,"src":"blue_green_anole_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058911.html","width":68,"caption":"Blue Green Anole","height":100});
															thumbnails[5058914] = clik.newPhoto({"id":5058914,"src":"buzzard_2_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058914.html","width":100,"caption":"Buzzard","height":63});
															thumbnails[5058915] = clik.newPhoto({"id":5058915,"src":"gery_seal1_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058915.html","width":80,"caption":"Atlantic Grey Seal","height":100});
															thumbnails[5058919] = clik.newPhoto({"id":5058919,"src":"Green_heron_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058919.html","width":68,"caption":"Green Heron","height":100});
															thumbnails[5058922] = clik.newPhoto({"id":5058922,"src":"grey_fly_catcher_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058922.html","width":100,"caption":"Grey Flycatcher","height":67});
															thumbnails[5058923] = clik.newPhoto({"id":5058923,"src":"Hispaniolan_woodpecker_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058923.html","width":62,"caption":"Hispaniolan Woodpecker","height":100});
															thumbnails[5058932] = clik.newPhoto({"id":5058932,"src":"little_egret_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058932.html","width":100,"caption":"Little Egret","height":83});
															thumbnails[5058934] = clik.newPhoto({"id":5058934,"src":"Praying_mantis_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058934.html","width":100,"caption":"Praying Mantis","height":67});
															thumbnails[5058935] = clik.newPhoto({"id":5058935,"src":"Spiny_tailed_lizard_uromastyx_Acanthinurus_thumb.jpg","galleries_id":232883,"server_id":15,"link":"photo_5058935.html","width":100,"caption":"Spiny Tailed Lizard","height":59});
															thumbnails[5058958] = clik.newPhoto({"id":5058958,"src":"storm_in_the_city_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5058958.html","width":100,"caption":"Storm In The City","height":53});
															thumbnails[5058979] = clik.newPhoto({"id":5058979,"src":"56_chevrolet_2_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058979.html","width":100,"caption":"56 chevi","height":79});
															thumbnails[5058981] = clik.newPhoto({"id":5058981,"src":"begger_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058981.html","width":58,"caption":"Child Of The Revolution","height":100});
															thumbnails[5058983] = clik.newPhoto({"id":5058983,"src":"Blue_boat_thumb.JPG","galleries_id":232747,"server_id":15,"link":"photo_5058983.html","width":67,"caption":"Blue Boat","height":100});
															thumbnails[5058986] = clik.newPhoto({"id":5058986,"src":"Burber_woman_2_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058986.html","width":80,"caption":"Berber Woman","height":100});
															thumbnails[5058987] = clik.newPhoto({"id":5058987,"src":"Camel_Herder_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058987.html","width":100,"caption":"Camel Herder","height":67});
															thumbnails[5058989] = clik.newPhoto({"id":5058989,"src":"El-Jem_6_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058989.html","width":100,"caption":"El Jem","height":67});
															thumbnails[5058990] = clik.newPhoto({"id":5058990,"src":"gone_fishing_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058990.html","width":67,"caption":"Gone Fishing","height":100});
															thumbnails[5058992] = clik.newPhoto({"id":5058992,"src":"Guardalavaca_2_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058992.html","width":67,"caption":"Guardalavaca Beach (Cuba)","height":100});
															thumbnails[5058994] = clik.newPhoto({"id":5058994,"src":"ismalar_at_night_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058994.html","width":100,"caption":"Reflections of Icmeler ","height":45});
															thumbnails[5058997] = clik.newPhoto({"id":5058997,"src":"majorca_10_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058997.html","width":61,"caption":"Alcudia","height":100});
															thumbnails[5058998] = clik.newPhoto({"id":5058998,"src":"majorca_44_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5058998.html","width":67,"caption":"Just The Spot","height":100});
															thumbnails[5058999] = clik.newPhoto({"id":5058999,"src":"Old_bike_thumb.JPG","galleries_id":232747,"server_id":15,"link":"photo_5058999.html","width":67,"caption":"Old Bike","height":100});
															thumbnails[5059000] = clik.newPhoto({"id":5059000,"src":"Rheythmno_Harbour_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059000.html","width":100,"caption":"Reythmno Harbour ","height":67});
															thumbnails[5059001] = clik.newPhoto({"id":5059001,"src":"Rimondi_Fountian_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059001.html","width":100,"caption":"Rimondi Fountian","height":67});
															thumbnails[5059003] = clik.newPhoto({"id":5059003,"src":"sandiago_de_cuba_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059003.html","width":67,"caption":"Moncada Berracks (Cuba)","height":100});
															thumbnails[5059009] = clik.newPhoto({"id":5059009,"src":"sandiago_de_cuba_cathedral_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059009.html","width":100,"caption":"Sandiargo de cuba catherdral","height":75});
															thumbnails[5059011] = clik.newPhoto({"id":5059011,"src":"Santorni_4_thumb.JPG","galleries_id":232747,"server_id":15,"link":"photo_5059011.html","width":67,"caption":"Catherderal of St John The Baptist (Santorini)","height":100});
															thumbnails[5059013] = clik.newPhoto({"id":5059013,"src":"Santorni_5_thumb.JPG","galleries_id":232747,"server_id":15,"link":"photo_5059013.html","width":74,"caption":"A Place In The Sun","height":100});
															thumbnails[5059014] = clik.newPhoto({"id":5059014,"src":"sugar_cane_worker_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059014.html","width":67,"caption":"Suger Cane Workers","height":100});
															thumbnails[5059015] = clik.newPhoto({"id":5059015,"src":"The_card_game_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059015.html","width":100,"caption":"The Card Game","height":79});
															thumbnails[5059017] = clik.newPhoto({"id":5059017,"src":"Thera_thumb.JPG","galleries_id":232747,"server_id":15,"link":"photo_5059017.html","width":75,"caption":"Thera","height":100});
															thumbnails[5059020] = clik.newPhoto({"id":5059020,"src":"Twareg_2_thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5059020.html","width":65,"caption":"Twerag","height":100});
															thumbnails[5059992] = clik.newPhoto({"id":5059992,"src":"26580010_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5059992.html","width":100,"caption":"","height":66});
															thumbnails[5059993] = clik.newPhoto({"id":5059993,"src":"26580020_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5059993.html","width":66,"caption":"","height":100});
															thumbnails[5059996] = clik.newPhoto({"id":5059996,"src":"26580022_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5059996.html","width":66,"caption":"","height":100});
															thumbnails[5059999] = clik.newPhoto({"id":5059999,"src":"32970004_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5059999.html","width":66,"caption":"","height":100});
															thumbnails[5060001] = clik.newPhoto({"id":5060001,"src":"32970032_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5060001.html","width":66,"caption":"","height":100});
															thumbnails[5060004] = clik.newPhoto({"id":5060004,"src":"32980007_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5060004.html","width":100,"caption":"","height":66});
															thumbnails[5060005] = clik.newPhoto({"id":5060005,"src":"32980029_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5060005.html","width":100,"caption":"","height":66});
															thumbnails[5060020] = clik.newPhoto({"id":5060020,"src":"247100271_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5060020.html","width":66,"caption":"","height":100});
															thumbnails[5060021] = clik.newPhoto({"id":5060021,"src":"247200191_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5060021.html","width":66,"caption":"","height":100});
															thumbnails[5060025] = clik.newPhoto({"id":5060025,"src":"265900351_thumb.jpg","galleries_id":232748,"server_id":15,"link":"photo_5060025.html","width":66,"caption":"","height":100});
															thumbnails[5060088] = clik.newPhoto({"id":5060088,"src":"a4_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_5060088.html","width":100,"caption":"","height":69});
															thumbnails[5060089] = clik.newPhoto({"id":5060089,"src":"DSC_0025_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_5060089.html","width":100,"caption":"","height":66});
															thumbnails[5060090] = clik.newPhoto({"id":5060090,"src":"ivan_28_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_5060090.html","width":100,"caption":"","height":67});
															thumbnails[5060091] = clik.newPhoto({"id":5060091,"src":"model_shot_13_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_5060091.html","width":100,"caption":"","height":67});
															thumbnails[5060127] = clik.newPhoto({"id":5060127,"src":"dandilion_2_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5060127.html","width":100,"caption":"Dandilion Clock","height":59});
															thumbnails[5060129] = clik.newPhoto({"id":5060129,"src":"ilston_church_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5060129.html","width":67,"caption":"Ilston Church (Infared)","height":100});
															thumbnails[5060131] = clik.newPhoto({"id":5060131,"src":"polerized_protractor_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5060131.html","width":67,"caption":"Protractor","height":100});
															thumbnails[5060134] = clik.newPhoto({"id":5060134,"src":"red_arrows_2_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5060134.html","width":100,"caption":"Red Diamond","height":66});
															thumbnails[5064623] = clik.newPhoto({"id":5064623,"src":"warpath_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_5064623.html","width":73,"caption":"","height":100});
															thumbnails[5064890] = clik.newPhoto({"id":5064890,"src":"ferry_side_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5064890.html","width":71,"caption":"Ferryside At Dusk","height":100});
															thumbnails[5064909] = clik.newPhoto({"id":5064909,"src":"abercastle1_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5064909.html","width":100,"caption":"Abercastle","height":42});
															thumbnails[5064928] = clik.newPhoto({"id":5064928,"src":"tenby_at_night_thumb.jpg","galleries_id":232863,"server_id":15,"link":"photo_5064928.html","width":100,"caption":"Harbour Lights","height":67});
															thumbnails[5065344] = clik.newPhoto({"id":5065344,"src":"majorca__thumb.jpg","galleries_id":232747,"server_id":15,"link":"photo_5065344.html","width":69,"caption":"Shadows At Sunset","height":100});
															thumbnails[5065676] = clik.newPhoto({"id":5065676,"src":"sail_bridge_thumb.jpg","galleries_id":232952,"server_id":15,"link":"photo_5065676.html","width":66,"caption":"Sail Bridge (Swansea Marina)","height":100});
															thumbnails[5702937] = clik.newPhoto({"id":5702937,"src":"contemplation_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_5702937.html","width":67,"caption":"","height":100});
															thumbnails[5702959] = clik.newPhoto({"id":5702959,"src":"lower_slaughter_mill__thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5702959.html","width":64,"caption":"","height":100});
															thumbnails[5702969] = clik.newPhoto({"id":5702969,"src":"The_Violinist_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5702969.html","width":70,"caption":"The Fiddler","height":100});
															thumbnails[5702981] = clik.newPhoto({"id":5702981,"src":"amonite_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5702981.html","width":100,"caption":"","height":82});
															thumbnails[5742357] = clik.newPhoto({"id":5742357,"src":"clyne_bridge123_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_5742357.html","width":100,"caption":"","height":63});
															thumbnails[6092610] = clik.newPhoto({"id":6092610,"src":"chloie_thumb.jpg","galleries_id":232864,"server_id":15,"link":"photo_6092610.html","width":100,"caption":"","height":67});
															thumbnails[6092616] = clik.newPhoto({"id":6092616,"src":"tulip2_thumb.jpg","galleries_id":268420,"server_id":15,"link":"photo_6092616.html","width":64,"caption":"","height":100});
															thumbnails[8245442] = clik.newPhoto({"id":8245442,"src":"red_arrows_thumb.jpg","galleries_id":268420,"server_id":38,"link":"photo_8245442.html","width":67,"caption":"Red Arrows","height":100});
															thumbnails[8245667] = clik.newPhoto({"id":8245667,"src":"maridian_tower_thumb.jpg","galleries_id":268420,"server_id":38,"link":"photo_8245667.html","width":67,"caption":"Maridian Tower ","height":100});
															thumbnails[8245669] = clik.newPhoto({"id":8245669,"src":"paddling_through_thumb.jpg","galleries_id":268420,"server_id":38,"link":"photo_8245669.html","width":66,"caption":"Paddling Through","height":100});
															thumbnails[8245670] = clik.newPhoto({"id":8245670,"src":"mumbles_thumb.jpg","galleries_id":232863,"server_id":38,"link":"photo_8245670.html","width":100,"caption":"Mumbles","height":36});
															thumbnails[8245673] = clik.newPhoto({"id":8245673,"src":"Turkey_thumb.jpg","galleries_id":232747,"server_id":38,"link":"photo_8245673.html","width":100,"caption":"Icmeler Sunrise","height":67});
															thumbnails[8245674] = clik.newPhoto({"id":8245674,"src":"icmeler_Canal_thumb.jpg","galleries_id":232747,"server_id":38,"link":"photo_8245674.html","width":100,"caption":"Icmeler Canal","height":67});
															thumbnails[8245678] = clik.newPhoto({"id":8245678,"src":"mountian_geko_thumb.jpg","galleries_id":232883,"server_id":38,"link":"photo_8245678.html","width":100,"caption":"Mountian Gecko","height":75});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[232952] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture","link":"gallery_232952.html","maxRecords":0.0,"photoIDs":[3830447.0,3831732.0,5046712.0,5046994.0,5047038.0,5047043.0,5047048.0,5047112.0,5047126.0,5065676.0],"skipIndex":0,"section_code":"gallery","featured_images":"5065676,5047126,5047112,5047048,5047043,5047038,5046994,5046712,3831732,3830447","id":232952,"singleSection":false});				  						galleries[234888] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commissions","link":"gallery_234888.html","maxRecords":0.0,"photoIDs":[5047457.0,5047459.0,5047460.0,5047461.0,5047463.0,5047464.0],"skipIndex":0,"section_code":"gallery","featured_images":"5047464,5047463,5047461,5047460,5047459,5047457","id":234888,"singleSection":false});				  						galleries[232863] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_232863.html","maxRecords":0.0,"photoIDs":[5047339.0,5047379.0,5047380.0,5047384.0,5051442.0,5051449.0,5051452.0,5051475.0,5058958.0,5064890.0,5064909.0,5064928.0,8245670.0],"skipIndex":0,"section_code":"gallery","featured_images":"8245670,5064928,5064909,5064890,5058958,5051475,5051452,5051449,5051442,5047384","id":232863,"singleSection":false});				  						galleries[232883] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Natural History","link":"gallery_232883.html","maxRecords":0.0,"photoIDs":[5058911.0,5058914.0,5058915.0,5058919.0,5058922.0,5058923.0,5058932.0,5058934.0,5058935.0,8245678.0],"skipIndex":0,"section_code":"gallery","featured_images":"8245678,5058935,5058934,5058932,5058923,5058922,5058919,5058915,5058914,5058911","id":232883,"singleSection":false});				  						galleries[232864] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_232864.html","maxRecords":0.0,"photoIDs":[5060088.0,5060089.0,5060090.0,5060091.0,5064623.0,5702937.0,6092610.0],"skipIndex":0,"section_code":"gallery","featured_images":"6092610,5702937,5064623,5060091,5060090,5060089,5060088","id":232864,"singleSection":false});				  						galleries[268420] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"various","link":"gallery_268420.html","maxRecords":0.0,"photoIDs":[5060127.0,5060129.0,5060131.0,5060134.0,5702959.0,5702969.0,5702981.0,5742357.0,6092616.0,8245442.0,8245667.0,8245669.0],"skipIndex":0,"section_code":"gallery","featured_images":"8245669,8245667,8245442,6092616,5742357,5702981,5702969,5702959,5060134,5060131","id":268420,"singleSection":false});				  						galleries[232747] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Travel","link":"gallery_232747.html","maxRecords":0.0,"photoIDs":[5058979.0,5058981.0,5058983.0,5058986.0,5058987.0,5058989.0,5058990.0,5058992.0,5058994.0,5058997.0,5058998.0,5058999.0,5059000.0,5059001.0,5059003.0,5059009.0,5059011.0,5059013.0,5059014.0,5059015.0,5059017.0,5059020.0,5065344.0,8245673.0,8245674.0],"skipIndex":0,"section_code":"gallery","featured_images":"8245674,8245673,5065344,5059020,5059017,5059015,5059014,5059013,5059011,5059009","id":232747,"singleSection":false});				  						galleries[232748] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"weddings","link":"gallery_232748.html","maxRecords":0.0,"photoIDs":[4836395.0,4836396.0,4836397.0,5059992.0,5059993.0,5059996.0,5059999.0,5060001.0,5060004.0,5060005.0,5060020.0,5060021.0,5060025.0],"skipIndex":0,"section_code":"gallery","featured_images":"5060025,5060021,5060020,5060005,5060004,5060001,5059999,5059996,5059993,5059992","id":232748,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8245678,8245674,8245673,8245672,8245670,8245669,8245667,8245442,6092616,6092610,5742357,5702981,5702969,5702959,5702937,5065676,5065673,5065344,5064928,5064909,5064890,5064623,5060134,5060131,5060129,5060127,5060091,5060090,5060089,5060088,5060025,5060021,5060020,5060005,5060004,5060001,5059999,5059996,5059993,5059992,5059020,5059017,5059015,5059014,5059013,5059011,5059009,5059003,5059001,5059000';
imageSets[3] = '8245678,8245674,8245673,8245672,8245670,8245669,8245667,8245442,6092616,6092610,5742357,5702981,5702969,5702959,5702937,5065676,5065673,5065344,5064928,5064909,5064890,5064623,5060134,5060131,5060129,5060127,5060091,5060090,5060089,5060088,5060025,5060021,5060020,5060005,5060004,5060001,5059999,5059996,5059993,5059992,5059020,5059017,5059015,5059014,5059013,5059011,5059009,5059003,5059001,5059000';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/keithjohn/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/keithjohn/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 && backgrounds[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 = 'Chroma-Photography: ' + 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.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 += '<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;
	}
}

			

