window.thumbnails = {};
															thumbnails[513830] = clik.newPhoto({"id":513830,"src":"largecover1_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_513830.html","width":128,"caption":"Untitled 2002","height":130});
															thumbnails[514991] = clik.newPhoto({"id":514991,"src":"DSCN0036_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_514991.html","width":101,"caption":"Untitled","height":130});
															thumbnails[515001] = clik.newPhoto({"id":515001,"src":"DSCN0049_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_515001.html","width":100,"caption":"Untitled","height":130});
															thumbnails[515005] = clik.newPhoto({"id":515005,"src":"DSCN0053_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_515005.html","width":101,"caption":"Inverted figure","height":130});
															thumbnails[515120] = clik.newPhoto({"id":515120,"src":"alanmcgowan039_RT8_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_515120.html","width":130,"caption":"Untitled","height":130});
															thumbnails[515125] = clik.newPhoto({"id":515125,"src":"alanmcgowan101_RT8_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_515125.html","width":109,"caption":"Untitled","height":130});
															thumbnails[517651] = clik.newPhoto({"id":517651,"src":"alanmcgowan017_RT8_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_517651.html","width":119,"caption":"Untitled","height":130});
															thumbnails[517653] = clik.newPhoto({"id":517653,"src":"DSCN0054_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_517653.html","width":98,"caption":"","height":130});
															thumbnails[517660] = clik.newPhoto({"id":517660,"src":"fallen_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_517660.html","width":130,"caption":"Fallen","height":99});
															thumbnails[518808] = clik.newPhoto({"id":518808,"src":"DSCN0017_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_518808.html","width":130,"caption":"","height":128});
															thumbnails[518823] = clik.newPhoto({"id":518823,"src":"a_mcgowan2_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_518823.html","width":130,"caption":"","height":130});
															thumbnails[518832] = clik.newPhoto({"id":518832,"src":"DSCN00231_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_518832.html","width":130,"caption":"","height":93});
															thumbnails[518836] = clik.newPhoto({"id":518836,"src":"DSCN0034_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_518836.html","width":94,"caption":"","height":130});
															thumbnails[518838] = clik.newPhoto({"id":518838,"src":"DSCN0035_thumb.jpg","galleries_id":39847,"server_id":1,"link":"photo_518838.html","width":93,"caption":"","height":130});
															thumbnails[544484] = clik.newPhoto({"id":544484,"src":"XC6N8260_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544484.html","width":92,"caption":"","height":130});
															thumbnails[544486] = clik.newPhoto({"id":544486,"src":"XC6N8264_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544486.html","width":92,"caption":"","height":130});
															thumbnails[544487] = clik.newPhoto({"id":544487,"src":"XC6N8268_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544487.html","width":92,"caption":"","height":130});
															thumbnails[544656] = clik.newPhoto({"id":544656,"src":"XC6N8347_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544656.html","width":118,"caption":"","height":130});
															thumbnails[544683] = clik.newPhoto({"id":544683,"src":"XC6N8532_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544683.html","width":98,"caption":"","height":130});
															thumbnails[544688] = clik.newPhoto({"id":544688,"src":"XC6N8280_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544688.html","width":92,"caption":"","height":130});
															thumbnails[544692] = clik.newPhoto({"id":544692,"src":"XC6N8291_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544692.html","width":92,"caption":"","height":130});
															thumbnails[544694] = clik.newPhoto({"id":544694,"src":"XC6N8299_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544694.html","width":130,"caption":"","height":92});
															thumbnails[544711] = clik.newPhoto({"id":544711,"src":"XC6N8330_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544711.html","width":130,"caption":"","height":96});
															thumbnails[544713] = clik.newPhoto({"id":544713,"src":"XC6N8448_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544713.html","width":130,"caption":"","height":87});
															thumbnails[544716] = clik.newPhoto({"id":544716,"src":"XC6N8477_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544716.html","width":95,"caption":"","height":130});
															thumbnails[544719] = clik.newPhoto({"id":544719,"src":"XC6N8453_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544719.html","width":86,"caption":"","height":130});
															thumbnails[544720] = clik.newPhoto({"id":544720,"src":"XC6N8458_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544720.html","width":85,"caption":"","height":130});
															thumbnails[544723] = clik.newPhoto({"id":544723,"src":"XC6N8472_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544723.html","width":94,"caption":"","height":130});
															thumbnails[544725] = clik.newPhoto({"id":544725,"src":"XC6N8462_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544725.html","width":87,"caption":"","height":130});
															thumbnails[544727] = clik.newPhoto({"id":544727,"src":"XC6N8501_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544727.html","width":98,"caption":"","height":130});
															thumbnails[544743] = clik.newPhoto({"id":544743,"src":"XC6N8565_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544743.html","width":98,"caption":"","height":130});
															thumbnails[544750] = clik.newPhoto({"id":544750,"src":"XC6N8560_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544750.html","width":89,"caption":"","height":130});
															thumbnails[544756] = clik.newPhoto({"id":544756,"src":"XC6N8523_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544756.html","width":112,"caption":"","height":130});
															thumbnails[544759] = clik.newPhoto({"id":544759,"src":"XC6N8511_thumb.jpg","galleries_id":42174,"server_id":1,"link":"photo_544759.html","width":90,"caption":"","height":130});
															thumbnails[544847] = clik.newPhoto({"id":544847,"src":"XC6N8654_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544847.html","width":96,"caption":"","height":130});
															thumbnails[544856] = clik.newPhoto({"id":544856,"src":"XC6N8649_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_544856.html","width":103,"caption":"","height":130});
															thumbnails[545538] = clik.newPhoto({"id":545538,"src":"XC6N82562_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_545538.html","width":96,"caption":"","height":130});
															thumbnails[2077960] = clik.newPhoto({"id":2077960,"src":"paintinggaf08_thumb.jpg","galleries_id":42173,"server_id":1,"link":"photo_2077960.html","width":130,"caption":"Untitled Figure","height":98});
															thumbnails[8775537] = clik.newPhoto({"id":8775537,"src":"P1050059_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775537.html","width":84,"caption":"","height":130});
															thumbnails[8775542] = clik.newPhoto({"id":8775542,"src":"P1050067_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775542.html","width":98,"caption":"","height":130});
															thumbnails[8775544] = clik.newPhoto({"id":8775544,"src":"P1050051_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775544.html","width":97,"caption":"","height":130});
															thumbnails[8775550] = clik.newPhoto({"id":8775550,"src":"P1050049_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775550.html","width":101,"caption":"","height":130});
															thumbnails[8775568] = clik.newPhoto({"id":8775568,"src":"P1050066_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775568.html","width":130,"caption":"","height":93});
															thumbnails[8775572] = clik.newPhoto({"id":8775572,"src":"P1050080_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775572.html","width":88,"caption":"","height":130});
															thumbnails[8775576] = clik.newPhoto({"id":8775576,"src":"P1050114_3_thumb.jpg","galleries_id":462055,"server_id":1,"link":"photo_8775576.html","width":70,"caption":"","height":130});
															thumbnails[8775579] = clik.newPhoto({"id":8775579,"src":"P1050115_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775579.html","width":85,"caption":"","height":130});
															thumbnails[8775583] = clik.newPhoto({"id":8775583,"src":"P1050073_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775583.html","width":130,"caption":"","height":80});
															thumbnails[8775585] = clik.newPhoto({"id":8775585,"src":"P1050078_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_8775585.html","width":111,"caption":"","height":130});
															thumbnails[8244702] = clik.newPhoto({"id":8244702,"src":"painting_1_thumb.jpg","galleries_id":424339,"server_id":1,"link":"photo_8244702.html","width":104,"caption":"Untitled Figure, Alan McGowan 2011","height":130});
															thumbnails[513975] = clik.newPhoto({"id":513975,"src":"faustdb_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_513975.html","width":121,"caption":"Faust's Dream - Blue","height":130});
															thumbnails[514708] = clik.newPhoto({"id":514708,"src":"Night_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514708.html","width":128,"caption":"Nacht","height":130});
															thumbnails[7862800] = clik.newPhoto({"id":7862800,"src":"P1040293_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7862800.html","width":103,"caption":"","height":130});
															thumbnails[8244706] = clik.newPhoto({"id":8244706,"src":"painting8_thumb.jpg","galleries_id":424339,"server_id":1,"link":"photo_8244706.html","width":102,"caption":"Untitled Figure,  Alan McGowan 2011","height":130});
															thumbnails[514765] = clik.newPhoto({"id":514765,"src":"Who-is-my-guide_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514765.html","width":130,"caption":"Who is my Guide?","height":130});
															thumbnails[517656] = clik.newPhoto({"id":517656,"src":"Carol's Gift 1_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_517656.html","width":115,"caption":"Faust's Dream - Gold","height":130});
															thumbnails[7862798] = clik.newPhoto({"id":7862798,"src":"P1040294_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7862798.html","width":105,"caption":"","height":130});
															thumbnails[7938186] = clik.newPhoto({"id":7938186,"src":"P1040491_thumb.jpg","galleries_id":424339,"server_id":1,"link":"photo_7938186.html","width":130,"caption":"","height":102});
															thumbnails[7938191] = clik.newPhoto({"id":7938191,"src":"P1040490_thumb.jpg","galleries_id":424339,"server_id":1,"link":"photo_7938191.html","width":102,"caption":"","height":130});
															thumbnails[514889] = clik.newPhoto({"id":514889,"src":"Witch's-Mirror6_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514889.html","width":129,"caption":"Hexenspiegel","height":130});
															thumbnails[517658] = clik.newPhoto({"id":517658,"src":"Carol's Gift 2_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_517658.html","width":108,"caption":"Faust's Dream - Red","height":130});
															thumbnails[7862807] = clik.newPhoto({"id":7862807,"src":"P1040304_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7862807.html","width":100,"caption":"","height":130});
															thumbnails[514951] = clik.newPhoto({"id":514951,"src":"Gretchen-as-Mephistopheles_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514951.html","width":130,"caption":"Gretchen As Mephistopheles","height":129});
															thumbnails[515144] = clik.newPhoto({"id":515144,"src":"redfigure_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_515144.html","width":130,"caption":"Figure in Red and Gold","height":130});
															thumbnails[7862809] = clik.newPhoto({"id":7862809,"src":"P1040301_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7862809.html","width":97,"caption":"","height":130});
															thumbnails[7938193] = clik.newPhoto({"id":7938193,"src":"P1040486_thumb.jpg","galleries_id":424339,"server_id":1,"link":"photo_7938193.html","width":98,"caption":"","height":130});
															thumbnails[7938195] = clik.newPhoto({"id":7938195,"src":"P1040492_thumb.jpg","galleries_id":424339,"server_id":1,"link":"photo_7938195.html","width":100,"caption":"","height":130});
															thumbnails[7938197] = clik.newPhoto({"id":7938197,"src":"P1040300_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7938197.html","width":97,"caption":"","height":130});
															thumbnails[513829] = clik.newPhoto({"id":513829,"src":"bwswimmer_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_513829.html","width":130,"caption":"Swimmer, 2002","height":126});
															thumbnails[514653] = clik.newPhoto({"id":514653,"src":"A-Shrine-In-the-Ramparts_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514653.html","width":130,"caption":"A Shrine","height":128});
															thumbnails[515100] = clik.newPhoto({"id":515100,"src":"curled_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_515100.html","width":128,"caption":"Curled","height":130});
															thumbnails[7862806] = clik.newPhoto({"id":7862806,"src":"P1040295_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7862806.html","width":130,"caption":"","height":85});
															thumbnails[7942567] = clik.newPhoto({"id":7942567,"src":"painting10_thumb.jpg","galleries_id":462055,"server_id":1,"link":"photo_7942567.html","width":92,"caption":"","height":130});
															thumbnails[7862801] = clik.newPhoto({"id":7862801,"src":"P1040277_thumb.jpg","galleries_id":462055,"server_id":1,"link":"photo_7862801.html","width":101,"caption":"","height":130});
															thumbnails[514957] = clik.newPhoto({"id":514957,"src":"You-Kiss-no-More_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514957.html","width":127,"caption":"You Kiss No More?","height":130});
															thumbnails[518820] = clik.newPhoto({"id":518820,"src":"6_thumb.12varnishdrawing.jpg","galleries_id":39938,"server_id":1,"link":"photo_518820.html","width":120,"caption":"Varnish drawing","height":130});
															thumbnails[7862811] = clik.newPhoto({"id":7862811,"src":"P1040274_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7862811.html","width":130,"caption":"","height":86});
															thumbnails[7862812] = clik.newPhoto({"id":7862812,"src":"P1040292_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7862812.html","width":112,"caption":"","height":130});
															thumbnails[7942551] = clik.newPhoto({"id":7942551,"src":"P1040291_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7942551.html","width":98,"caption":"","height":130});
															thumbnails[7942553] = clik.newPhoto({"id":7942553,"src":"P1040276_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7942553.html","width":96,"caption":"","height":130});
															thumbnails[514961] = clik.newPhoto({"id":514961,"src":"Prison_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514961.html","width":126,"caption":"Prison","height":130});
															thumbnails[545261] = clik.newPhoto({"id":545261,"src":"XC6N8549_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_545261.html","width":93,"caption":"","height":130});
															thumbnails[7862810] = clik.newPhoto({"id":7862810,"src":"P1040286_thumb.JPG","galleries_id":424339,"server_id":1,"link":"photo_7862810.html","width":93,"caption":"","height":130});
															thumbnails[7942556] = clik.newPhoto({"id":7942556,"src":"P1040275_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7942556.html","width":95,"caption":"","height":130});
															thumbnails[7862813] = clik.newPhoto({"id":7862813,"src":"P1040280_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7862813.html","width":92,"caption":"","height":130});
															thumbnails[514964] = clik.newPhoto({"id":514964,"src":"Globe_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514964.html","width":123,"caption":"Globe","height":130});
															thumbnails[545264] = clik.newPhoto({"id":545264,"src":"XC6N8538_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_545264.html","width":130,"caption":"","height":87});
															thumbnails[7862803] = clik.newPhoto({"id":7862803,"src":"P1040279_thumb.JPG","galleries_id":462055,"server_id":1,"link":"photo_7862803.html","width":79,"caption":"","height":130});
															thumbnails[514970] = clik.newPhoto({"id":514970,"src":"Gretchenhead_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_514970.html","width":130,"caption":"Gretchenhead","height":126});
															thumbnails[515131] = clik.newPhoto({"id":515131,"src":"Crucifix_thumb.jpg","galleries_id":39845,"server_id":1,"link":"photo_515131.html","width":125,"caption":"Crucifix","height":130});
															thumbnails[545302] = clik.newPhoto({"id":545302,"src":"XC6N8336_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_545302.html","width":95,"caption":"","height":130});
															thumbnails[545336] = clik.newPhoto({"id":545336,"src":"XC6N8592_thumb.jpg","galleries_id":39938,"server_id":1,"link":"photo_545336.html","width":98,"caption":"","height":130});
															thumbnails[4086203] = clik.newPhoto({"id":4086203,"src":"anatomy7_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4086203.html","width":130,"caption":"Anatomy workshop 6","height":92});
															thumbnails[4068826] = clik.newPhoto({"id":4068826,"src":"anatomy1_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4068826.html","width":130,"caption":"Anatomy workshop 1","height":98});
															thumbnails[4068832] = clik.newPhoto({"id":4068832,"src":"anatomy2_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4068832.html","width":130,"caption":"Anatomy workshop 2","height":98});
															thumbnails[4068852] = clik.newPhoto({"id":4068852,"src":"anatomy3_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4068852.html","width":130,"caption":"Anatomy workshop 3","height":98});
															thumbnails[4068854] = clik.newPhoto({"id":4068854,"src":"anatomy4_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4068854.html","width":130,"caption":"Anatomy workshop 4","height":98});
															thumbnails[4068860] = clik.newPhoto({"id":4068860,"src":"anatomy5_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4068860.html","width":130,"caption":"Anatomy workshop 5","height":98});
															thumbnails[6828325] = clik.newPhoto({"id":6828325,"src":"bw5031_1_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_6828325.html","width":90,"caption":"Anatomy workshop 7","height":130});
															thumbnails[4068906] = clik.newPhoto({"id":4068906,"src":"anatomy6_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4068906.html","width":98,"caption":"Anatomy workshop 8","height":130});
															thumbnails[4086194] = clik.newPhoto({"id":4086194,"src":"anatomy9_thumb.jpg","galleries_id":371000,"server_id":1,"link":"photo_4086194.html","width":93,"caption":"anatomy workshop 9","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[371000] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Anatomy for Artists","link":"section442055.html","maxRecords":0.0,"photoIDs":[4086203.0,4068826.0,4068832.0,4068852.0,4068854.0,4068860.0,6828325.0,4068906.0,4086194.0],"skipIndex":0,"section_code":"section442055","featured_images":"6828325,4086203,4086194,4068906,4068860,4068854,4068852,4068832,4068826","id":371000,"singleSection":true});				  						galleries[462055] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Drawings","link":"gallery_462055.html","maxRecords":0.0,"photoIDs":[8775537.0,8775542.0,8775544.0,8775550.0,8775568.0,8775572.0,8775576.0,8775579.0,8775583.0,8775585.0,7942567.0,7862801.0,7862811.0,7862812.0,7942551.0,7942553.0,7942556.0,7862813.0,7862803.0],"skipIndex":0,"section_code":"gallery","featured_images":8775576.0,"id":462055,"singleSection":false});				  						galleries[424339] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_424339.html","maxRecords":0.0,"photoIDs":[8244702.0,7862800.0,8244706.0,7862798.0,7938186.0,7938191.0,7862807.0,7862809.0,7938193.0,7938195.0,7938197.0,7862806.0,7862810.0],"skipIndex":0,"section_code":"gallery","featured_images":7862798.0,"id":424339,"singleSection":false});				  						galleries[42173] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_42173.html","maxRecords":0.0,"photoIDs":[544484.0,544486.0,544487.0,544656.0,544683.0,544688.0,544692.0,544694.0,544847.0,544856.0,545538.0,2077960.0],"skipIndex":0,"section_code":"gallery","featured_images":544484.0,"id":42173,"singleSection":false});				  						galleries[42174] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 3","link":"gallery_42174.html","maxRecords":0.0,"photoIDs":[518832.0,518836.0,544711.0,544713.0,544716.0,544719.0,544720.0,544723.0,544725.0,544727.0,544743.0,544750.0,544756.0,544759.0],"skipIndex":0,"section_code":"gallery","featured_images":"544756,544723","id":42174,"singleSection":false});				  						galleries[39847] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 4","link":"gallery_39847.html","maxRecords":0.0,"photoIDs":[513830.0,514991.0,515001.0,515005.0,515120.0,515125.0,517651.0,517653.0,517660.0,518808.0,518823.0,518838.0],"skipIndex":0,"section_code":"gallery","featured_images":515120.0,"id":39847,"singleSection":false});				  						galleries[39938] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 5","link":"gallery_39938.html","maxRecords":0.0,"photoIDs":[513975.0,517656.0,517658.0,515144.0,513829.0,515100.0,518820.0,545261.0,545264.0,545302.0,545336.0],"skipIndex":0,"section_code":"gallery","featured_images":513975.0,"id":39938,"singleSection":false});				  						galleries[39845] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Faust","link":"gallery_39845.html","maxRecords":0.0,"photoIDs":[514708.0,514765.0,514889.0,514951.0,514653.0,514957.0,514961.0,514964.0,514970.0,515131.0],"skipIndex":0,"section_code":"gallery","featured_images":514765.0,"id":39845,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '544683';
imageSets[2] = '8775576,544756,544723,544484,515120,513975,7862798,514765';
imageSets[3] = '8775585,8775583,8775579,8775576,8775572,8775568,8775550,8775544,8775542,8775537,8244706,8244702,7942567,7942556,7942553,7942551,7938197,7938195,7938193,7938191,7938186,7862813,7862812,7862811,7862810,7862809,7862807,7862806,7862803,7862801,7862800,7862798,6828325,4086203,4086194,4068906,4068860,4068854,4068852,4068832,4068826,2077960,545538,545336,545302,545264,545261,544856,544847,544759';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/alanmcgowan/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/alanmcgowan/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 = 'Alan McGowan Artist: ' + 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 !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

