window.thumbnails = {};
															thumbnails[5006103] = clik.newPhoto({"id":5006103,"src":"clintportrait-34_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5127660] = clik.newPhoto({"id":5127660,"src":"unoptimised_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5127661] = clik.newPhoto({"id":5127661,"src":"optimised_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4311628] = clik.newPhoto({"id":4311628,"src":"261102CARmwayjunction001_thumb.JPG","galleries_id":254108,"server_id":18,"link":"photo_4311628.html","width":130,"caption":"","height":85});
															thumbnails[4319747] = clik.newPhoto({"id":4319747,"src":"ashchurch010408CAR009_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4319747.html","width":130,"caption":"","height":196});
															thumbnails[4319762] = clik.newPhoto({"id":4319762,"src":"cheese060109CAR009_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4319762.html","width":130,"caption":"","height":196});
															thumbnails[4319826] = clik.newPhoto({"id":4319826,"src":"compost200608CAR002_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4319826.html","width":130,"caption":"","height":196});
															thumbnails[4319919] = clik.newPhoto({"id":4319919,"src":"criticalcare071008CAR008_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4319919.html","width":130,"caption":"","height":87});
															thumbnails[4320009] = clik.newPhoto({"id":4320009,"src":"juris080408CAR017_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4320009.html","width":130,"caption":"","height":196});
															thumbnails[4320011] = clik.newPhoto({"id":4320011,"src":"londoncapetown011208CAR007_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4320011.html","width":130,"caption":"","height":87});
															thumbnails[4320018] = clik.newPhoto({"id":4320018,"src":"mistletoe071208CAR0011_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4320018.html","width":130,"caption":"","height":87});
															thumbnails[4320021] = clik.newPhoto({"id":4320021,"src":"omega090708CAR011_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4320021.html","width":130,"caption":"","height":86});
															thumbnails[4320024] = clik.newPhoto({"id":4320024,"src":"pilot121108CAR001_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4320024.html","width":130,"caption":"","height":87});
															thumbnails[4320025] = clik.newPhoto({"id":4320025,"src":"potatofarmer200808CAR005_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4320025.html","width":130,"caption":"","height":87});
															thumbnails[4320029] = clik.newPhoto({"id":4320029,"src":"scott281108CAR005_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4320029.html","width":130,"caption":"","height":196});
															thumbnails[4369317] = clik.newPhoto({"id":4369317,"src":"060405pieandmashCAR004_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4369317.html","width":130,"caption":"","height":202});
															thumbnails[4369489] = clik.newPhoto({"id":4369489,"src":"100507studio012_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4369489.html","width":130,"caption":"","height":196});
															thumbnails[4369539] = clik.newPhoto({"id":4369539,"src":"cheltenham130308CAR017_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4369539.html","width":130,"caption":"","height":196});
															thumbnails[4369560] = clik.newPhoto({"id":4369560,"src":"highways161107CAR002_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4369560.html","width":130,"caption":"","height":195});
															thumbnails[4369589] = clik.newPhoto({"id":4369589,"src":"stuntshow001_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4369589.html","width":130,"caption":"","height":130});
															thumbnails[4369691] = clik.newPhoto({"id":4369691,"src":"williams311007CAR006_copy_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4369691.html","width":130,"caption":"","height":130});
															thumbnails[4369725] = clik.newPhoto({"id":4369725,"src":"warburton056-copy_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4369725.html","width":130,"caption":"","height":196});
															thumbnails[4369742] = clik.newPhoto({"id":4369742,"src":"warburton044-copy_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4369742.html","width":130,"caption":"","height":86});
															thumbnails[4684522] = clik.newPhoto({"id":4684522,"src":"Alexhartley009-copy_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4684522.html","width":130,"caption":"","height":195});
															thumbnails[4684523] = clik.newPhoto({"id":4684523,"src":"lincoln145-copy_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4684523.html","width":130,"caption":"","height":195});
															thumbnails[4684524] = clik.newPhoto({"id":4684524,"src":"pumpsupplies054-copy_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4684524.html","width":130,"caption":"","height":87});
															thumbnails[4772311] = clik.newPhoto({"id":4772311,"src":"beaufort220608CAR006_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4772311.html","width":130,"caption":"","height":196});
															thumbnails[4772313] = clik.newPhoto({"id":4772313,"src":"prince-harry_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_4772313.html","width":130,"caption":"","height":87});
															thumbnails[4901361] = clik.newPhoto({"id":4901361,"src":"tomskating020_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_4901361.html","width":130,"caption":"","height":195});
															thumbnails[5116749] = clik.newPhoto({"id":5116749,"src":"120404chinnCAR003_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5116749.html","width":130,"caption":"","height":85});
															thumbnails[5116759] = clik.newPhoto({"id":5116759,"src":"26010bennettCAR-002_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5116759.html","width":130,"caption":"","height":85});
															thumbnails[5116768] = clik.newPhoto({"id":5116768,"src":"190804whitehartCAR004_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5116768.html","width":130,"caption":"","height":85});
															thumbnails[5116770] = clik.newPhoto({"id":5116770,"src":"jrkitchens007_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5116770.html","width":130,"caption":"","height":87});
															thumbnails[5116774] = clik.newPhoto({"id":5116774,"src":"jrkitchens037_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5116774.html","width":130,"caption":"","height":87});
															thumbnails[5116778] = clik.newPhoto({"id":5116778,"src":"cheese060109CAR017-copy_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5116778.html","width":130,"caption":"","height":132});
															thumbnails[5116784] = clik.newPhoto({"id":5116784,"src":"seneca078_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5116784.html","width":130,"caption":"","height":85});
															thumbnails[5116798] = clik.newPhoto({"id":5116798,"src":"bagnall574_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5116798.html","width":130,"caption":"","height":86});
															thumbnails[5122128] = clik.newPhoto({"id":5122128,"src":"paltek112_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5122128.html","width":130,"caption":"","height":87});
															thumbnails[5122135] = clik.newPhoto({"id":5122135,"src":"071202CARchepstow002_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5122135.html","width":130,"caption":"","height":75});
															thumbnails[5122140] = clik.newPhoto({"id":5122140,"src":"cognac2_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5122140.html","width":130,"caption":"","height":104});
															thumbnails[5122152] = clik.newPhoto({"id":5122152,"src":"bravissimo-bristol009_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5122152.html","width":130,"caption":"","height":87});
															thumbnails[5122153] = clik.newPhoto({"id":5122153,"src":"morrisons-nailsworths021_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5122153.html","width":130,"caption":"","height":87});
															thumbnails[5123373] = clik.newPhoto({"id":5123373,"src":"200804tailorCAR002A_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123373.html","width":130,"caption":"","height":85});
															thumbnails[5123382] = clik.newPhoto({"id":5123382,"src":"240205jillingsCAR010_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123382.html","width":130,"caption":"","height":85});
															thumbnails[5123385] = clik.newPhoto({"id":5123385,"src":"140504oddCAR029_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123385.html","width":130,"caption":"","height":85});
															thumbnails[5123387] = clik.newPhoto({"id":5123387,"src":"110204daviesCAR-004_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123387.html","width":130,"caption":"","height":198});
															thumbnails[5123389] = clik.newPhoto({"id":5123389,"src":"babbage_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123389.html","width":130,"caption":"","height":85});
															thumbnails[5123395] = clik.newPhoto({"id":5123395,"src":"230103lifeCAR004_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123395.html","width":130,"caption":"","height":68});
															thumbnails[5123431] = clik.newPhoto({"id":5123431,"src":"181202CARwestonbirt001_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123431.html","width":130,"caption":"","height":85});
															thumbnails[5123443] = clik.newPhoto({"id":5123443,"src":"011202CARtigerairways005_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123443.html","width":130,"caption":"","height":85});
															thumbnails[5123542] = clik.newPhoto({"id":5123542,"src":"LIFEeggfarmerCR1_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123542.html","width":130,"caption":"","height":195});
															thumbnails[5123557] = clik.newPhoto({"id":5123557,"src":"BIZfoodCR1_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123557.html","width":130,"caption":"","height":87});
															thumbnails[5123622] = clik.newPhoto({"id":5123622,"src":"renney210109CAR002_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5123622.html","width":130,"caption":"","height":88});
															thumbnails[5123634] = clik.newPhoto({"id":5123634,"src":"renegade045_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123634.html","width":130,"caption":"","height":87});
															thumbnails[5123644] = clik.newPhoto({"id":5123644,"src":"lacey261108CAR004_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123644.html","width":130,"caption":"","height":87});
															thumbnails[5123658] = clik.newPhoto({"id":5123658,"src":"hammond311208CAR002_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123658.html","width":130,"caption":"","height":198});
															thumbnails[5123676] = clik.newPhoto({"id":5123676,"src":"flower290308CAR005_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123676.html","width":130,"caption":"","height":86});
															thumbnails[5123706] = clik.newPhoto({"id":5123706,"src":"builderofyear211108CAR003_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5123706.html","width":130,"caption":"","height":195});
															thumbnails[5127593] = clik.newPhoto({"id":5127593,"src":"charleschurch0361_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5127593.html","width":130,"caption":"","height":87});
															thumbnails[5127608] = clik.newPhoto({"id":5127608,"src":"bottlegreen310109CAR009_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5127608.html","width":130,"caption":"","height":196});
															thumbnails[5127612] = clik.newPhoto({"id":5127612,"src":"biketractor100708CAR001_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5127612.html","width":130,"caption":"","height":87});
															thumbnails[5127620] = clik.newPhoto({"id":5127620,"src":"archaeology121108CAR014_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5127620.html","width":130,"caption":"","height":87});
															thumbnails[5127631] = clik.newPhoto({"id":5127631,"src":"120404chinnCAR003_0D3EA220-1D09-001F-9917A9E1FBED0552_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5127631.html","width":130,"caption":"","height":85});
															thumbnails[5445583] = clik.newPhoto({"id":5445583,"src":"annabel_rayer-16_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5445583.html","width":130,"caption":"","height":87});
															thumbnails[5445586] = clik.newPhoto({"id":5445586,"src":"paving-031_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5445586.html","width":130,"caption":"","height":87});
															thumbnails[5445630] = clik.newPhoto({"id":5445630,"src":"nexus-88_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5445630.html","width":130,"caption":"","height":87});
															thumbnails[5445637] = clik.newPhoto({"id":5445637,"src":"ractower-45_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5445637.html","width":130,"caption":"","height":87});
															thumbnails[5490643] = clik.newPhoto({"id":5490643,"src":"osijek-1_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5490643.html","width":130,"caption":"","height":94});
															thumbnails[5490652] = clik.newPhoto({"id":5490652,"src":"osijek-2_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5490652.html","width":130,"caption":"","height":92});
															thumbnails[5560396] = clik.newPhoto({"id":5560396,"src":"camelot-72_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5560396.html","width":130,"caption":"","height":86});
															thumbnails[5582987] = clik.newPhoto({"id":5582987,"src":"macquarie-44_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5582987.html","width":130,"caption":"","height":86});
															thumbnails[5594158] = clik.newPhoto({"id":5594158,"src":"amy-160_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5594158.html","width":130,"caption":"","height":195});
															thumbnails[5594167] = clik.newPhoto({"id":5594167,"src":"amy-127_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5594167.html","width":130,"caption":"","height":86});
															thumbnails[5860993] = clik.newPhoto({"id":5860993,"src":"babcock-165_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5860993.html","width":130,"caption":"","height":86});
															thumbnails[5860997] = clik.newPhoto({"id":5860997,"src":"babcock-116_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5860997.html","width":130,"caption":"","height":86});
															thumbnails[5861000] = clik.newPhoto({"id":5861000,"src":"babcock-258_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5861000.html","width":130,"caption":"","height":86});
															thumbnails[5861060] = clik.newPhoto({"id":5861060,"src":"burnett-387_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5861060.html","width":130,"caption":"","height":196});
															thumbnails[5861062] = clik.newPhoto({"id":5861062,"src":"camelot-43_3B138B4A-1D09-001F-9916601E869DC2C3_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_5861062.html","width":130,"caption":"","height":196});
															thumbnails[5861069] = clik.newPhoto({"id":5861069,"src":"samsung-79_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5861069.html","width":130,"caption":"","height":86});
															thumbnails[5861082] = clik.newPhoto({"id":5861082,"src":"bakery-64_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5861082.html","width":130,"caption":"","height":196});
															thumbnails[5861085] = clik.newPhoto({"id":5861085,"src":"cupcakes-4_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5861085.html","width":130,"caption":"","height":86});
															thumbnails[5861087] = clik.newPhoto({"id":5861087,"src":"christmascott-113_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_5861087.html","width":130,"caption":"","height":196});
															thumbnails[6788959] = clik.newPhoto({"id":6788959,"src":"arnolfini-227_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_6788959.html","width":130,"caption":"","height":86});
															thumbnails[6991367] = clik.newPhoto({"id":6991367,"src":"qa-212_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_6991367.html","width":130,"caption":"","height":86});
															thumbnails[6991371] = clik.newPhoto({"id":6991371,"src":"qa-977_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_6991371.html","width":130,"caption":"","height":196});
															thumbnails[6991375] = clik.newPhoto({"id":6991375,"src":"qa-285_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_6991375.html","width":130,"caption":"","height":86});
															thumbnails[6991385] = clik.newPhoto({"id":6991385,"src":"goape-161_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_6991385.html","width":130,"caption":"","height":196});
															thumbnails[7022676] = clik.newPhoto({"id":7022676,"src":"camsytems-358_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_7022676.html","width":130,"caption":"","height":86});
															thumbnails[7022687] = clik.newPhoto({"id":7022687,"src":"airambulance-70-Edit-Edit_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022687.html","width":130,"caption":"","height":86});
															thumbnails[7022700] = clik.newPhoto({"id":7022700,"src":"harley-165_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022700.html","width":130,"caption":"","height":86});
															thumbnails[7022711] = clik.newPhoto({"id":7022711,"src":"wadworths-136_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022711.html","width":130,"caption":"","height":86});
															thumbnails[7022792] = clik.newPhoto({"id":7022792,"src":"arnolfini-24_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_7022792.html","width":130,"caption":"","height":86});
															thumbnails[7022796] = clik.newPhoto({"id":7022796,"src":"bakery-108_thumb.jpg","galleries_id":254108,"server_id":18,"link":"photo_7022796.html","width":130,"caption":"","height":86});
															thumbnails[7022804] = clik.newPhoto({"id":7022804,"src":"countrywide-203_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022804.html","width":130,"caption":"","height":86});
															thumbnails[7022807] = clik.newPhoto({"id":7022807,"src":"chemex-163_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022807.html","width":130,"caption":"","height":86});
															thumbnails[7022814] = clik.newPhoto({"id":7022814,"src":"tucnewcollege-101_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022814.html","width":130,"caption":"","height":86});
															thumbnails[7022817] = clik.newPhoto({"id":7022817,"src":"princess-41_thumb.jpg","galleries_id":254109,"server_id":18,"link":"photo_7022817.html","width":130,"caption":"","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[254108] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commercial and Corporate","link":"gallery_254108.html","maxRecords":0.0,"photoIDs":[4311628.0,4319747.0,4319762.0,4320021.0,4320029.0,4369317.0,4369560.0,4369589.0,4369691.0,4369725.0,4369742.0,4684523.0,4684524.0,4901361.0,5116768.0,5116770.0,5116774.0,5116784.0,5116798.0,5122128.0,5122140.0,5123373.0,5123385.0,5123387.0,5123389.0,5123395.0,5123431.0,5123443.0,5123557.0,5123622.0,5127608.0,5445586.0,5445630.0,5594167.0,5860993.0,5860997.0,5861069.0,5861082.0,5861085.0,5861087.0,6788959.0,6991367.0,6991371.0,6991375.0,6991385.0,7022676.0,7022792.0,7022796.0],"skipIndex":0,"section_code":"gallery","featured_images":"7022796,7022792,7022676,6991385,6991375,6991371,6991367,6788959,5861087,5861085,5861082,5861069,5860997,5860993,5594167,5445630,5445586,5127608,5123622,5123443,5123431,5123395,5123389,5123387,5123385,5123373,5122140,5116784,4901361,4684524,4684523,4369742,4369725,4369691,4369589,4369560,4369317,4320029,4319762","id":254108,"singleSection":false});				  						galleries[254109] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Press and PR","link":"gallery_254109.html","maxRecords":0.0,"photoIDs":[4319826.0,4319919.0,4320009.0,4320011.0,4320018.0,4320024.0,4320025.0,4369489.0,4369539.0,4684522.0,4772311.0,4772313.0,5116749.0,5116759.0,5116778.0,5122135.0,5122152.0,5122153.0,5123382.0,5123542.0,5123634.0,5123644.0,5123658.0,5123676.0,5123706.0,5127593.0,5127612.0,5127620.0,5127631.0,5445583.0,5445637.0,5490643.0,5490652.0,5560396.0,5582987.0,5594158.0,5861000.0,5861060.0,5861062.0,7022687.0,7022700.0,7022711.0,7022804.0,7022807.0,7022814.0,7022817.0],"skipIndex":0,"section_code":"gallery","featured_images":"7022817,7022814,7022807,7022804,7022711,7022700,7022687,5861060,5861000,5594158,5582987,5560396,5490652,5490643,5445637,5445583,5127631,5127620,5123706,5123676,5123658,5123644,5123634,5123382,5122153,5122152,5122135,4772313,4772311,4684522,4369539,4369489,4320025,4320024,4320018,4320011,4320009,4319919,4319826","id":254109,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7022817,7022814,7022807,7022796,7022792,7022711,7022700,7022687,7022676,6991385,6991375,6991371,6991367,6788959,5861087,5861085,5861082,5861069,5861060,5861000,5860997,5860993,5594167,5594158,5582987,5560396,5490652,5490643,5445637,5445630,5445586,5445583,5127631,5127620,5127612,5127608,5127593,5123706,5123676,5123658,5123644,5123634,5123622,5123443,5123431,5123389,5123387,5123385,5123382,5123373,5122153,5122152,5122140,5122135,5122128,5116798,5116784,5116778,5116774,5116770,5116768,5116759,5116749,4901361,4772313,4684524,4684523,4684522,4369742,4369725,4369691,4369589,4369560,4369539,4369317,4320029,4320025,4320024,4320018,4320011,4320009,4319919,4319826,4319762,4319747,4311628';
imageSets[2] = '7022817,7022814,7022807,7022804,7022796,7022792,7022711,7022700,7022687,7022676,6991385,6991375,6991371,6991367,6788959,5861087,5861085,5861082,5861069,5861060,5861000,5860997,5860993,5594167,5594158,5582987,5560396,5490652,5490643,5445637,5445630,5445586,5445583,5127631,5127620,5127608,5123706,5123676,5123658,5123644,5123634,5123622,5123443,5123431,5123395,5123389,5123387,5123385,5123382,5123373,5122153,5122152,5122140,5122135,5116784,4901361,4772313,4772311,4684524,4684523,4684522,4369742,4369725,4369691,4369589,4369560,4369539,4369489,4369317,4320029,4320025,4320024,4320018,4320011,4320009,4319919,4319826,4319762';
imageSets[3] = '7022817,7022814,7022807,7022804,7022796,7022792,7022711,7022700,7022687,7022676,6991385,6991375,6991371,6991367,6788959,5861087,5861085,5861082,5861069,5861062,5861060,5861000,5860997,5860993,5594167,5594158,5582987,5560396,5490652,5490643,5445637,5445630,5445586,5445583,5127661,5127660,5127631,5127620,5127612,5127608,5127593,5123706,5123676,5123658,5123644,5123634,5123622,5123557,5123542,5123443';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/crandall/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/crandall/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/crandall/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/crandall/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/crandall/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/crandall/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/crandall/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/crandall/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 = 'www.pixelprphotography.co.uk: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

