window.thumbnails = {};
															thumbnails[1500494] = clik.newPhoto({"id":1500494,"src":"IMG_1103_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1500495] = clik.newPhoto({"id":1500495,"src":"IMG_1074_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1500497] = clik.newPhoto({"id":1500497,"src":"IMG_1017_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1500498] = clik.newPhoto({"id":1500498,"src":"IMG_0982_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1500499] = clik.newPhoto({"id":1500499,"src":"IMG_1047_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":195});
															thumbnails[1500501] = clik.newPhoto({"id":1500501,"src":"IMG_0972_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1500503] = clik.newPhoto({"id":1500503,"src":"IMG_1066_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1500504] = clik.newPhoto({"id":1500504,"src":"IMG_1076_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1500505] = clik.newPhoto({"id":1500505,"src":"IMG_1108_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[1500506] = clik.newPhoto({"id":1500506,"src":"IMG_1160_WRAY_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4755562] = clik.newPhoto({"id":4755562,"src":"C_0023_thumb.jpg","galleries_id":272656,"server_id":18,"link":"photo_4755562.html","width":130,"caption":"","height":195});
															thumbnails[4755822] = clik.newPhoto({"id":4755822,"src":"Peckitt_180709_0244_thumb.jpg","galleries_id":272668,"server_id":18,"link":"photo_4755822.html","width":130,"caption":"","height":195});
															thumbnails[4755831] = clik.newPhoto({"id":4755831,"src":"Foglietta_0181_thumb.jpg","galleries_id":272670,"server_id":18,"link":"photo_4755831.html","width":130,"caption":"","height":195});
															thumbnails[4755834] = clik.newPhoto({"id":4755834,"src":"Copy_of_E-JOHNSON_0043BW_thumb.jpg","galleries_id":272672,"server_id":18,"link":"photo_4755834.html","width":130,"caption":"","height":195});
															thumbnails[4755842] = clik.newPhoto({"id":4755842,"src":"SCJH_120909_0159BW_thumb.jpg","galleries_id":272664,"server_id":18,"link":"photo_4755842.html","width":130,"caption":"","height":195});
															thumbnails[4755925] = clik.newPhoto({"id":4755925,"src":"B_0015_thumb.jpg","galleries_id":272680,"server_id":18,"link":"photo_4755925.html","width":130,"caption":"","height":195});
															thumbnails[4755930] = clik.newPhoto({"id":4755930,"src":"Simpson_060209__0129_thumb.jpg","galleries_id":272683,"server_id":18,"link":"photo_4755930.html","width":130,"caption":"","height":195});
															thumbnails[4755934] = clik.newPhoto({"id":4755934,"src":"09_03_21_Avison_0111_thumb.jpg","galleries_id":272685,"server_id":18,"link":"photo_4755934.html","width":130,"caption":"","height":195});
															thumbnails[4766334] = clik.newPhoto({"id":4766334,"src":"09_04_24_Dacey_A328_thumb.jpg","galleries_id":273025,"server_id":18,"link":"photo_4766334.html","width":130,"caption":"","height":195});
															thumbnails[4766344] = clik.newPhoto({"id":4766344,"src":"A093_thumb.jpg","galleries_id":273027,"server_id":18,"link":"photo_4766344.html","width":130,"caption":"","height":195});
															thumbnails[4766348] = clik.newPhoto({"id":4766348,"src":"IMG_4299_thumb.jpg","galleries_id":273029,"server_id":18,"link":"photo_4766348.html","width":130,"caption":"","height":195});
															thumbnails[4766353] = clik.newPhoto({"id":4766353,"src":"B_0095A_thumb.jpg","galleries_id":273031,"server_id":18,"link":"photo_4766353.html","width":130,"caption":"","height":195});
															thumbnails[5781106] = clik.newPhoto({"id":5781106,"src":"Turner_100410_0402_thumb.jpg","galleries_id":327402,"server_id":18,"link":"photo_5781106.html","width":130,"caption":"","height":195});
															thumbnails[5814736] = clik.newPhoto({"id":5814736,"src":"ELD_170410_0116_thumb.jpg","galleries_id":329149,"server_id":18,"link":"photo_5814736.html","width":130,"caption":"","height":195});
															thumbnails[5887146] = clik.newPhoto({"id":5887146,"src":"LDW_010510_0319_thumb.jpg","galleries_id":332471,"server_id":18,"link":"photo_5887146.html","width":130,"caption":"","height":195});
															thumbnails[6187899] = clik.newPhoto({"id":6187899,"src":"GWDM_190610_0243P_thumb.jpg","galleries_id":345561,"server_id":18,"link":"photo_6187899.html","width":130,"caption":"","height":195});
															thumbnails[6230178] = clik.newPhoto({"id":6230178,"src":"NDJB_230610_0155_thumb.jpg","galleries_id":347014,"server_id":18,"link":"photo_6230178.html","width":130,"caption":"","height":195});
															thumbnails[6915240] = clik.newPhoto({"id":6915240,"src":"HMJP_16102010_0498_thumb.jpg","galleries_id":375125,"server_id":18,"link":"photo_6915240.html","width":130,"caption":"","height":195});
															thumbnails[7837920] = clik.newPhoto({"id":7837920,"src":"Dixon_210511_04581_thumb.jpg","galleries_id":422991,"server_id":18,"link":"photo_7837920.html","width":130,"caption":"","height":195});
															thumbnails[4182058] = clik.newPhoto({"id":4182058,"src":"IMG_0786_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_4182058.html","width":130,"caption":"","height":195});
															thumbnails[4741220] = clik.newPhoto({"id":4741220,"src":"Peckitt_180709_0110_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741220.html","width":130,"caption":"","height":195});
															thumbnails[6453906] = clik.newPhoto({"id":6453906,"src":"GSRA_310710_0325_thumb.jpg","galleries_id":356028,"server_id":18,"link":"photo_6453906.html","width":130,"caption":"","height":195});
															thumbnails[6595584] = clik.newPhoto({"id":6595584,"src":"LSAS_210810_0284A1_thumb.jpg","galleries_id":361515,"server_id":18,"link":"photo_6595584.html","width":130,"caption":"","height":195});
															thumbnails[6668216] = clik.newPhoto({"id":6668216,"src":"KCMH_03092010_0316_thumb.jpg","galleries_id":364452,"server_id":18,"link":"photo_6668216.html","width":130,"caption":"","height":195});
															thumbnails[8371625] = clik.newPhoto({"id":8371625,"src":"ESSG_270811_0252_thumb.jpg","galleries_id":444283,"server_id":37,"link":"photo_8371625.html","width":130,"caption":"","height":195});
															thumbnails[8668637] = clik.newPhoto({"id":8668637,"src":"CTJB_211011_0190C_thumb.jpg","galleries_id":457640,"server_id":35,"link":"photo_8668637.html","width":130,"caption":"","height":195});
															thumbnails[4182060] = clik.newPhoto({"id":4182060,"src":"IMG_0795_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_4182060.html","width":130,"caption":"","height":195});
															thumbnails[4741221] = clik.newPhoto({"id":4741221,"src":"Peckitt_180709_0143_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741221.html","width":130,"caption":"","height":87});
															thumbnails[2476643] = clik.newPhoto({"id":2476643,"src":"B_0035_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476643.html","width":130,"caption":"","height":87});
															thumbnails[4741222] = clik.newPhoto({"id":4741222,"src":"Peckitt_180709_0244B_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741222.html","width":130,"caption":"","height":195});
															thumbnails[2476645] = clik.newPhoto({"id":2476645,"src":"B_0037B_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476645.html","width":130,"caption":"","height":87});
															thumbnails[4182062] = clik.newPhoto({"id":4182062,"src":"IMG_0984_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_4182062.html","width":130,"caption":"","height":195});
															thumbnails[4741223] = clik.newPhoto({"id":4741223,"src":"Peckitt_180709_0301_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741223.html","width":130,"caption":"","height":195});
															thumbnails[4741228] = clik.newPhoto({"id":4741228,"src":"Peckitt_180709_0286BW_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741228.html","width":130,"caption":"","height":87});
															thumbnails[4181998] = clik.newPhoto({"id":4181998,"src":"C_0020_thumb.jpg","galleries_id":127468,"server_id":18,"link":"photo_4181998.html","width":130,"caption":"","height":195});
															thumbnails[4741226] = clik.newPhoto({"id":4741226,"src":"Peckitt_180709_0245R_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741226.html","width":130,"caption":"","height":195});
															thumbnails[4182052] = clik.newPhoto({"id":4182052,"src":"A_00582_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_4182052.html","width":130,"caption":"","height":195});
															thumbnails[4741235] = clik.newPhoto({"id":4741235,"src":"Peckitt_180709_0264_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741235.html","width":130,"caption":"","height":87});
															thumbnails[4181995] = clik.newPhoto({"id":4181995,"src":"B_0025_thumb.jpg","galleries_id":127468,"server_id":18,"link":"photo_4181995.html","width":130,"caption":"","height":195});
															thumbnails[4181994] = clik.newPhoto({"id":4181994,"src":"B_00151_thumb.jpg","galleries_id":127468,"server_id":18,"link":"photo_4181994.html","width":130,"caption":"","height":195});
															thumbnails[4182065] = clik.newPhoto({"id":4182065,"src":"IMG_1068_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_4182065.html","width":130,"caption":"","height":195});
															thumbnails[4181997] = clik.newPhoto({"id":4181997,"src":"C_0015BW_thumb.jpg","galleries_id":127468,"server_id":18,"link":"photo_4181997.html","width":130,"caption":"","height":195});
															thumbnails[4182066] = clik.newPhoto({"id":4182066,"src":"IMG_1102_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_4182066.html","width":130,"caption":"","height":195});
															thumbnails[4182048] = clik.newPhoto({"id":4182048,"src":"C_00232_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_4182048.html","width":130,"caption":"","height":195});
															thumbnails[4182067] = clik.newPhoto({"id":4182067,"src":"IMG_1103_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_4182067.html","width":130,"caption":"","height":195});
															thumbnails[4741230] = clik.newPhoto({"id":4741230,"src":"Peckitt_180709_0306_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741230.html","width":130,"caption":"","height":195});
															thumbnails[4182050] = clik.newPhoto({"id":4182050,"src":"C_00261_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_4182050.html","width":130,"caption":"","height":195});
															thumbnails[4182222] = clik.newPhoto({"id":4182222,"src":"C_0013_thumb.jpg","galleries_id":127468,"server_id":18,"link":"photo_4182222.html","width":130,"caption":"","height":87});
															thumbnails[4182000] = clik.newPhoto({"id":4182000,"src":"C_0026_thumb.jpg","galleries_id":127468,"server_id":18,"link":"photo_4182000.html","width":130,"caption":"","height":195});
															thumbnails[4741232] = clik.newPhoto({"id":4741232,"src":"Peckitt_180709_0258_thumb.jpg","galleries_id":271967,"server_id":18,"link":"photo_4741232.html","width":130,"caption":"","height":87});
															thumbnails[2476656] = clik.newPhoto({"id":2476656,"src":"C_0061_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476656.html","width":130,"caption":"","height":87});
															thumbnails[1500544] = clik.newPhoto({"id":1500544,"src":"IMG_1066_WRAY1_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_1500544.html","width":130,"caption":"","height":87});
															thumbnails[1500546] = clik.newPhoto({"id":1500546,"src":"IMG_1108_WRAY1_thumb.jpg","galleries_id":96350,"server_id":18,"link":"photo_1500546.html","width":130,"caption":"","height":87});
															thumbnails[2476659] = clik.newPhoto({"id":2476659,"src":"C_0084_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476659.html","width":130,"caption":"","height":87});
															thumbnails[4182051] = clik.newPhoto({"id":4182051,"src":"A_00971_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_4182051.html","width":130,"caption":"","height":195});
															thumbnails[2476706] = clik.newPhoto({"id":2476706,"src":"A_0003_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476706.html","width":130,"caption":"","height":87});
															thumbnails[2476710] = clik.newPhoto({"id":2476710,"src":"A_0058AC_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476710.html","width":130,"caption":"","height":87});
															thumbnails[2476713] = clik.newPhoto({"id":2476713,"src":"A_0063_thumb.jpg","galleries_id":94320,"server_id":18,"link":"photo_2476713.html","width":130,"caption":"","height":87});
															thumbnails[5467607] = clik.newPhoto({"id":5467607,"src":"Jacqui_0055_thumb.jpg","galleries_id":309336,"server_id":18,"link":"photo_5467607.html","width":130,"caption":"","height":195});
															thumbnails[5467762] = clik.newPhoto({"id":5467762,"src":"A_JOHNSON_0001_thumb.jpg","galleries_id":309332,"server_id":18,"link":"photo_5467762.html","width":130,"caption":"","height":195});
															thumbnails[5467765] = clik.newPhoto({"id":5467765,"src":"A_JOHNSON_0008_thumb.jpg","galleries_id":309332,"server_id":18,"link":"photo_5467765.html","width":130,"caption":"","height":195});
															thumbnails[5467767] = clik.newPhoto({"id":5467767,"src":"A_JOHNSON_0026_thumb.jpg","galleries_id":309332,"server_id":18,"link":"photo_5467767.html","width":130,"caption":"","height":195});
															thumbnails[2491623] = clik.newPhoto({"id":2491623,"src":"Q_0016_thumb.jpg","galleries_id":309337,"server_id":18,"link":"photo_2491623.html","width":130,"caption":"","height":87});
															thumbnails[2491617] = clik.newPhoto({"id":2491617,"src":"Q_0053SOFT_thumb.jpg","galleries_id":309337,"server_id":18,"link":"photo_2491617.html","width":130,"caption":"","height":195});
															thumbnails[4741278] = clik.newPhoto({"id":4741278,"src":"Foglietta_06491_thumb.jpg","galleries_id":271975,"server_id":18,"link":"photo_4741278.html","width":130,"caption":"","height":87});
															thumbnails[4741279] = clik.newPhoto({"id":4741279,"src":"Foglietta_06631_thumb.jpg","galleries_id":271975,"server_id":18,"link":"photo_4741279.html","width":130,"caption":"","height":87});
															thumbnails[4741280] = clik.newPhoto({"id":4741280,"src":"Foglietta_06911_thumb.jpg","galleries_id":271975,"server_id":18,"link":"photo_4741280.html","width":130,"caption":"","height":87});
															thumbnails[4741282] = clik.newPhoto({"id":4741282,"src":"Foglietta_06961_thumb.jpg","galleries_id":271975,"server_id":18,"link":"photo_4741282.html","width":130,"caption":"","height":87});
															thumbnails[4755193] = clik.newPhoto({"id":4755193,"src":"Q_0016DONE_thumb.jpg","galleries_id":264415,"server_id":18,"link":"photo_4755193.html","width":130,"caption":"","height":87});
															thumbnails[4755199] = clik.newPhoto({"id":4755199,"src":"Q_0053DONE_thumb.jpg","galleries_id":264415,"server_id":18,"link":"photo_4755199.html","width":130,"caption":"","height":195});
															thumbnails[4834165] = clik.newPhoto({"id":4834165,"src":"A_0048_1_thumb.jpg","galleries_id":264400,"server_id":18,"link":"photo_4834165.html","width":130,"caption":"","height":87});
															thumbnails[4858679] = clik.newPhoto({"id":4858679,"src":"black_contact_thumb.jpg","galleries_id":274613,"server_id":18,"link":"photo_4858679.html","width":130,"caption":"","height":87});
															thumbnails[1760961] = clik.newPhoto({"id":1760961,"src":"Deposit 21_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_1760961.html","width":130,"caption":"","height":195});
															thumbnails[6915260] = clik.newPhoto({"id":6915260,"src":"HMJP_16102010_0405_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_6915260.html","width":130,"caption":"","height":87});
															thumbnails[1406789] = clik.newPhoto({"id":1406789,"src":"B0801_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_1406789.html","width":130,"caption":"","height":223});
															thumbnails[2491618] = clik.newPhoto({"id":2491618,"src":"Q_0044_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491618.html","width":130,"caption":"","height":195});
															thumbnails[6716406] = clik.newPhoto({"id":6716406,"src":"GSRA_310710_0393_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_6716406.html","width":130,"caption":"","height":87});
															thumbnails[2491620] = clik.newPhoto({"id":2491620,"src":"Q_0040_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491620.html","width":130,"caption":"","height":195});
															thumbnails[6716417] = clik.newPhoto({"id":6716417,"src":"GSRA_310710_03201_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_6716417.html","width":130,"caption":"","height":195});
															thumbnails[6716399] = clik.newPhoto({"id":6716399,"src":"GSRA_310710_0329_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_6716399.html","width":130,"caption":"","height":87});
															thumbnails[6716420] = clik.newPhoto({"id":6716420,"src":"GSRA_310710_03931_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_6716420.html","width":130,"caption":"","height":87});
															thumbnails[2491621] = clik.newPhoto({"id":2491621,"src":"Q_0039_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491621.html","width":130,"caption":"","height":195});
															thumbnails[6716410] = clik.newPhoto({"id":6716410,"src":"GSRA_310710_0042_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_6716410.html","width":130,"caption":"","height":87});
															thumbnails[2319910] = clik.newPhoto({"id":2319910,"src":"B_0037_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_2319910.html","width":130,"caption":"","height":87});
															thumbnails[4828960] = clik.newPhoto({"id":4828960,"src":"Foglietta_0102_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_4828960.html","width":130,"caption":"","height":195});
															thumbnails[2491622] = clik.newPhoto({"id":2491622,"src":"Q_0026_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491622.html","width":130,"caption":"","height":195});
															thumbnails[2491625] = clik.newPhoto({"id":2491625,"src":"Q_0015_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491625.html","width":130,"caption":"","height":87});
															thumbnails[2491626] = clik.newPhoto({"id":2491626,"src":"Q_0026FILTER_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491626.html","width":130,"caption":"","height":87});
															thumbnails[2491632] = clik.newPhoto({"id":2491632,"src":"Q_00091_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491632.html","width":130,"caption":"","height":87});
															thumbnails[5889252] = clik.newPhoto({"id":5889252,"src":"LDW_010510_0048_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_5889252.html","width":130,"caption":"","height":87});
															thumbnails[2491628] = clik.newPhoto({"id":2491628,"src":"Q_0009C_thumb.jpg","galleries_id":159953,"server_id":18,"link":"photo_2491628.html","width":130,"caption":"","height":87});
															thumbnails[5887151] = clik.newPhoto({"id":5887151,"src":"LDW_010510_0347_thumb.jpg","galleries_id":118319,"server_id":18,"link":"photo_5887151.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[271975] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Rainy Day Retake ","link":"section326966.html","maxRecords":0.0,"photoIDs":[4741278.0,4741279.0,4741280.0,4741282.0],"skipIndex":0,"section_code":"section326966","featured_images":"4741282,4741280,4741279,4741278","id":271975,"singleSection":true});				  						galleries[264400] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pricing","link":"section318720.html","maxRecords":0.0,"photoIDs":[4834165.0],"skipIndex":0,"section_code":"section318720","featured_images":4834165.0,"id":264400,"singleSection":true});				  						galleries[271967] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sample Gallery 2","link":"gallery_271967.html","maxRecords":0.0,"photoIDs":[4741220.0,4741221.0,4741222.0,4741223.0,4741228.0,4741226.0,4741235.0,4741230.0,4741232.0],"skipIndex":0,"section_code":"gallery","featured_images":4741223.0,"id":271967,"singleSection":false});				  						galleries[264415] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wear it Where?","link":"section318735.html","maxRecords":0.0,"photoIDs":[4755193.0,4755199.0],"skipIndex":0,"section_code":"section318735","featured_images":"4755199,4755193","id":264415,"singleSection":true});				  						galleries[94320] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sample Gallery 3","link":"gallery_94320.html","maxRecords":0.0,"photoIDs":[2476643.0,2476645.0,4182052.0,4182048.0,4182050.0,2476656.0,2476659.0,4182051.0,2476706.0,2476710.0,2476713.0],"skipIndex":0,"section_code":"gallery","featured_images":4182052.0,"id":94320,"singleSection":false});				  						galleries[127468] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sample Gallery 4","link":"gallery_127468.html","maxRecords":0.0,"photoIDs":[4181998.0,4181995.0,4181994.0,4181997.0,4182222.0,4182000.0],"skipIndex":0,"section_code":"gallery","featured_images":4181997.0,"id":127468,"singleSection":false});				  						galleries[96350] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sample Gallery 5","link":"gallery_96350.html","maxRecords":0.0,"photoIDs":[4182058.0,4182060.0,4182062.0,4182065.0,4182066.0,4182067.0,1500544.0,1500546.0],"skipIndex":0,"section_code":"gallery","featured_images":4182065.0,"id":96350,"singleSection":false});				  						galleries[457640] = clik.newGallery({"parentGallery":457639,"usePopups":false,"title":"Christian & Joanna","link":"gallery_457640.html","maxRecords":0.0,"photoIDs":[8668637.0],"skipIndex":0,"section_code":"gallery","featured_images":8668637.0,"id":457640,"singleSection":false});				  						galleries[457639] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required 58","link":"gallery_457639.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":8668637.0,"id":457639,"singleSection":false});				  						galleries[444283] = clik.newGallery({"parentGallery":444281,"usePopups":false,"title":"Emma and Shaughan","link":"gallery_444283.html","maxRecords":0.0,"photoIDs":[8371625.0],"skipIndex":0,"section_code":"gallery","featured_images":8371625.0,"id":444283,"singleSection":false});				  						galleries[444281] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required 57","link":"gallery_444281.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":8371625.0,"id":444281,"singleSection":false});				  						galleries[422991] = clik.newGallery({"parentGallery":422990,"usePopups":false,"title":"Hannah & Neil","link":"gallery_422991.html","maxRecords":0.0,"photoIDs":[7837920.0],"skipIndex":0,"section_code":"gallery","featured_images":7837920.0,"id":422991,"singleSection":false});				  						galleries[422990] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required 56","link":"gallery_422990.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":7837920.0,"id":422990,"singleSection":false});				  						galleries[375125] = clik.newGallery({"parentGallery":375124,"usePopups":false,"title":"James & Helena","link":"gallery_375125.html","maxRecords":0.0,"photoIDs":[6915240.0],"skipIndex":0,"section_code":"gallery","featured_images":6915240.0,"id":375125,"singleSection":false});				  						galleries[375124] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 54","link":"gallery_375124.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":6915240.0,"id":375124,"singleSection":false});				  						galleries[364452] = clik.newGallery({"parentGallery":364451,"usePopups":false,"title":"Karen & Mike","link":"gallery_364452.html","maxRecords":0.0,"photoIDs":[6668216.0],"skipIndex":0,"section_code":"gallery","featured_images":6668216.0,"id":364452,"singleSection":false});				  						galleries[364451] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 53","link":"gallery_364451.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":6668216.0,"id":364451,"singleSection":false});				  						galleries[361515] = clik.newGallery({"parentGallery":361514,"usePopups":false,"title":"Linda & Andy","link":"gallery_361515.html","maxRecords":0.0,"photoIDs":[6595584.0],"skipIndex":0,"section_code":"gallery","featured_images":6595584.0,"id":361515,"singleSection":false});				  						galleries[361514] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 52","link":"gallery_361514.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":6595584.0,"id":361514,"singleSection":false});				  						galleries[356027] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"<b>No<\/b> Password Required","link":"gallery_356027.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":6453906.0,"id":356027,"singleSection":false});				  						galleries[356028] = clik.newGallery({"parentGallery":356027,"usePopups":false,"title":"Sample Gallery ","link":"gallery_356028.html","maxRecords":0.0,"photoIDs":[6453906.0],"skipIndex":0,"section_code":"gallery","featured_images":6453906.0,"id":356028,"singleSection":false});				  						galleries[347014] = clik.newGallery({"parentGallery":347013,"usePopups":false,"title":"James & Nicola","link":"gallery_347014.html","maxRecords":0.0,"photoIDs":[6230178.0],"skipIndex":0,"section_code":"gallery","featured_images":6230178.0,"id":347014,"singleSection":false});				  						galleries[347013] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 50","link":"gallery_347013.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":6230178.0,"id":347013,"singleSection":false});				  						galleries[345561] = clik.newGallery({"parentGallery":345559,"usePopups":false,"title":"Gemma & David","link":"gallery_345561.html","maxRecords":0.0,"photoIDs":[6187899.0],"skipIndex":0,"section_code":"gallery","featured_images":6187899.0,"id":345561,"singleSection":false});				  						galleries[345559] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 37","link":"gallery_345559.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":6187899.0,"id":345559,"singleSection":false});				  						galleries[332471] = clik.newGallery({"parentGallery":332618,"usePopups":false,"title":"Lynda & Dave","link":"gallery_332471.html","maxRecords":0.0,"photoIDs":[5887146.0],"skipIndex":0,"section_code":"gallery","featured_images":5887146.0,"id":332471,"singleSection":false});				  						galleries[332618] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 38","link":"gallery_332618.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":5887146.0,"id":332618,"singleSection":false});				  						galleries[327401] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 39","link":"gallery_327401.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":5781106.0,"id":327401,"singleSection":false});				  						galleries[327402] = clik.newGallery({"parentGallery":327401,"usePopups":false,"title":"Rachael & Steve","link":"gallery_327402.html","maxRecords":0.0,"photoIDs":[5781106.0],"skipIndex":0,"section_code":"gallery","featured_images":5781106.0,"id":327402,"singleSection":false});				  						galleries[272664] = clik.newGallery({"parentGallery":272663,"usePopups":false,"title":1.0,"link":"gallery_272664.html","maxRecords":0.0,"photoIDs":[4755842.0],"skipIndex":0,"section_code":"gallery","featured_images":4755842.0,"id":272664,"singleSection":false});				  						galleries[272668] = clik.newGallery({"parentGallery":272665,"usePopups":false,"title":2.0,"link":"gallery_272668.html","maxRecords":0.0,"photoIDs":[4755822.0],"skipIndex":0,"section_code":"gallery","featured_images":4755822.0,"id":272668,"singleSection":false});				  						galleries[272670] = clik.newGallery({"parentGallery":272669,"usePopups":false,"title":3.0,"link":"gallery_272670.html","maxRecords":0.0,"photoIDs":[4755831.0],"skipIndex":0,"section_code":"gallery","featured_images":4755831.0,"id":272670,"singleSection":false});				  						galleries[272672] = clik.newGallery({"parentGallery":272671,"usePopups":false,"title":4.0,"link":"gallery_272672.html","maxRecords":0.0,"photoIDs":[4755834.0],"skipIndex":0,"section_code":"gallery","featured_images":4755834.0,"id":272672,"singleSection":false});				  						galleries[118319] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Deposit\/Home Page","link":"section154689_118319.html","maxRecords":0.0,"photoIDs":[1760961.0,6915260.0,1406789.0,6716406.0,6716417.0,6716399.0,6716420.0,6716410.0,2319910.0,4828960.0,5889252.0,5887151.0],"skipIndex":0,"section_code":"section154689","featured_images":"6915260,6716420,6716417,6716410,6716406,6716399,5889252,5887151,4828960,2319910","id":118319,"singleSection":false});				  						galleries[329149] = clik.newGallery({"parentGallery":329148,"usePopups":false,"title":"Lee ","link":"gallery_329149.html","maxRecords":0.0,"photoIDs":[5814736.0],"skipIndex":0,"section_code":"gallery","featured_images":5814736.0,"id":329149,"singleSection":false});				  						galleries[329148] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 40","link":"gallery_329148.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":5814736.0,"id":329148,"singleSection":false});				  						galleries[272663] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 41","link":"gallery_272663.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755842.0,"id":272663,"singleSection":false});				  						galleries[272665] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 42","link":"gallery_272665.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755822.0,"id":272665,"singleSection":false});				  						galleries[272669] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 43","link":"gallery_272669.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755831.0,"id":272669,"singleSection":false});				  						galleries[272671] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 44","link":"gallery_272671.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755834.0,"id":272671,"singleSection":false});				  						galleries[272656] = clik.newGallery({"parentGallery":272655,"usePopups":false,"title":5.0,"link":"gallery_272656.html","maxRecords":0.0,"photoIDs":[4755562.0],"skipIndex":0,"section_code":"gallery","featured_images":4755562.0,"id":272656,"singleSection":false});				  						galleries[272655] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 5","link":"gallery_272655.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755562.0,"id":272655,"singleSection":false});				  						galleries[159953] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wear it Where","link":"section154689_159953.html","maxRecords":0.0,"photoIDs":[2491618.0,2491620.0,2491621.0,2491622.0,2491625.0,2491626.0,2491632.0,2491628.0],"skipIndex":0,"section_code":"section154689","featured_images":2491625.0,"id":159953,"singleSection":false});				  						galleries[272680] = clik.newGallery({"parentGallery":272678,"usePopups":false,"title":6.0,"link":"gallery_272680.html","maxRecords":0.0,"photoIDs":[4755925.0],"skipIndex":0,"section_code":"gallery","featured_images":4755925.0,"id":272680,"singleSection":false});				  						galleries[272678] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 6","link":"gallery_272678.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755925.0,"id":272678,"singleSection":false});				  						galleries[272683] = clik.newGallery({"parentGallery":272681,"usePopups":false,"title":7.0,"link":"gallery_272683.html","maxRecords":0.0,"photoIDs":[4755930.0],"skipIndex":0,"section_code":"gallery","featured_images":4755930.0,"id":272683,"singleSection":false});				  						galleries[272681] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 7","link":"gallery_272681.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755930.0,"id":272681,"singleSection":false});				  						galleries[272685] = clik.newGallery({"parentGallery":272684,"usePopups":false,"title":8.0,"link":"gallery_272685.html","maxRecords":0.0,"photoIDs":[4755934.0],"skipIndex":0,"section_code":"gallery","featured_images":4755934.0,"id":272685,"singleSection":false});				  						galleries[272684] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 8","link":"gallery_272684.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4755934.0,"id":272684,"singleSection":false});				  						galleries[273025] = clik.newGallery({"parentGallery":273024,"usePopups":false,"title":9.0,"link":"gallery_273025.html","maxRecords":0.0,"photoIDs":[4766334.0],"skipIndex":0,"section_code":"gallery","featured_images":4766334.0,"id":273025,"singleSection":false});				  						galleries[273024] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 9","link":"gallery_273024.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4766334.0,"id":273024,"singleSection":false});				  						galleries[273027] = clik.newGallery({"parentGallery":273026,"usePopups":false,"title":10.0,"link":"gallery_273027.html","maxRecords":0.0,"photoIDs":[4766344.0],"skipIndex":0,"section_code":"gallery","featured_images":4766344.0,"id":273027,"singleSection":false});				  						galleries[273026] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 10","link":"gallery_273026.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4766344.0,"id":273026,"singleSection":false});				  						galleries[273029] = clik.newGallery({"parentGallery":273028,"usePopups":false,"title":11.0,"link":"gallery_273029.html","maxRecords":0.0,"photoIDs":[4766348.0],"skipIndex":0,"section_code":"gallery","featured_images":4766348.0,"id":273029,"singleSection":false});				  						galleries[309332] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bridal Preparations","link":"section370653_309332.html","maxRecords":0.0,"photoIDs":[5467762.0,5467765.0,5467767.0],"skipIndex":0,"section_code":"section370653","featured_images":5467765.0,"id":309332,"singleSection":false});				  						galleries[273028] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 11","link":"gallery_273028.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4766348.0,"id":273028,"singleSection":false});				  						galleries[309336] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"For His Eyes Only","link":"section370653_309336.html","maxRecords":0.0,"photoIDs":[5467607.0],"skipIndex":0,"section_code":"section370653","featured_images":5467607.0,"id":309336,"singleSection":false});				  						galleries[309337] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wear it Where? ","link":"section370653_309337.html","maxRecords":0.0,"photoIDs":[2491623.0,2491617.0],"skipIndex":0,"section_code":"section370653","featured_images":2491617.0,"id":309337,"singleSection":false});				  						galleries[309342] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Just the Two of You","link":"section370653_309342.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section370653","featured_images":"","id":309342,"singleSection":false});				  						galleries[273031] = clik.newGallery({"parentGallery":273030,"usePopups":false,"title":12.0,"link":"gallery_273031.html","maxRecords":0.0,"photoIDs":[4766353.0],"skipIndex":0,"section_code":"gallery","featured_images":4766353.0,"id":273031,"singleSection":false});				  						galleries[273030] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Password Required - 12","link":"gallery_273030.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":4766353.0,"id":273030,"singleSection":false});				  						galleries[274613] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Contact","link":"section329973.html","maxRecords":0.0,"photoIDs":[4858679.0],"skipIndex":0,"section_code":"section329973","featured_images":4858679.0,"id":274613,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6915240,6915260,6716417,6716399,6716420,6716410,4741228,2319910,4828960,4181998,4182052,4181995,4181994,2491617,5889252,5887151';
imageSets[2] = '6915240,4858679,8371625,6453906,5467765,4741223,4182052,4182065,4181997,2491625,2491617';
imageSets[3] = '8668637,8371625,7837920,6915260,6915240,6716420,6716417,6716410,6716406,6716399,6668216,6595584,6453906,6230178,6187899,5889252,5887151,5887146,5814736,5781106,5467767,5467765,5467762,5467607,4858679,4834165,4828960,4766353,4766348,4766344,4766334,4755934,4755930,4755925,4755842,4755834,4755831,4755822,4755562,4755199,4755193,4741282,4741280,4741279,4741278,4741235,4741232,4741230,4741228,4741226';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/moments/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/moments/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/moments/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/moments/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/moments/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/moments/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/moments/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 = 'Scarborough Wedding Photographer: ' + 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="jacquishipman@btinternet.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="jacquishipman@btinternet.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

