function thumbnail(g,e,b,f,d,a,c){this.id=g;this.galleries_id=e;this.caption=b;this.src=getServerPath(c)+"/"+f;this.width=d;this.height=a}function gallery(e,c,d,b,a){this.id=e;this.featured_images=c;this.title=d;this.section_code=b;this.photoIDs=a}var thumbnails=new Object();thumbnails[32244]=new thumbnail(32244,"216394","Outgoing Tide","Outgoing Tide2_thumb.jpg",130,167,1);thumbnails[42839]=new thumbnail(42839,"216589","Strumble Head","Strumble Head_thumb.jpg",130,167,1);thumbnails[759801]=new thumbnail(759801,"216442","Tranquil Waters","Tranquil Waters_thumb.jpg",130,130,1);thumbnails[915900]=new thumbnail(915900,"216627","Pentre Ifan","Pentre Ifan_thumb.jpg",130,130,1);thumbnails[431599]=new thumbnail(431599,"216589","Pen-Caer","Pen-Caer_thumb.jpg",130,37,1);thumbnails[573521]=new thumbnail(573521,"216627","Waldo's Stone","Waldos Stone_thumb.jpg",130,37,1);thumbnails[573543]=new thumbnail(573543,"216394","First Light At Amroth","First Light At Amroth_thumb.jpg",130,72,1);thumbnails[915872]=new thumbnail(915872,"216442","Time To Reflect","Time To Reflect_thumb.jpg",130,82,1);thumbnails[1127327]=new thumbnail(1127327,"216442","Beggars Reach","Beggars Reach_thumb.jpg",130,72,1);thumbnails[3562272]=new thumbnail(3562272,"235696","Morning Stroll","Morning_Stroll1_thumb.jpg",130,75,1);thumbnails[50537]=new thumbnail(50537,"216395","Peace & Quiet","Peace & Quiet_thumb.jpg",130,167,1);thumbnails[186159]=new thumbnail(186159,"216446","Tranquillity","Tranquillity_thumb.jpg",130,192,1);thumbnails[296151]=new thumbnail(296151,"216591","Lower Town Harbour","Lower Town Harbour_thumb.jpg",130,72,1);thumbnails[20414]=new thumbnail(20414,"216395","High & Dry","High & Dry8_thumb.jpg",130,82,1);thumbnails[186174]=new thumbnail(186174,"216446","The Edge Of Light","The Edge Of Light_thumb.jpg",130,72,1);thumbnails[431600]=new thumbnail(431600,"216446","Deep In Thought","Deep In Thought_thumb.jpg",130,37,1);thumbnails[3153896]=new thumbnail(3153896,"216446","Incoming Tide","Incoming Tide_thumb.jpg",130,187,1);thumbnails[203105]=new thumbnail(203105,"216446","Looking Out To Skokholm","Looking Out To Skokholm_thumb.jpg",130,167,1);thumbnails[80541]=new thumbnail(80541,"216448","Final Glow","Final Glow_thumb.jpg",130,82,1);thumbnails[150105]=new thumbnail(150105,"216396","South Beach Sunset","South Beach Sunset_thumb.jpg",130,192,1);thumbnails[1240505]=new thumbnail(1240505,"216596","Keeping The Faith","Keeping The Faith_thumb.jpg",130,192,1);thumbnails[110332]=new thumbnail(110332,"216396","The Break Of Dawn","The Break Of Dawn_thumb.jpg",130,72,1);thumbnails[1240478]=new thumbnail(1240478,"216596","Cwm-yr-Eglwys","Cwm-yr-Eglwys_thumb.jpg",130,72,1);thumbnails[334528]=new thumbnail(334528,"216396","Across The Bay","Across The Bay_thumb.jpg",130,82,1);thumbnails[3881440]=new thumbnail(3881440,"216396","Peaceful Sanctuary","Peaceful_Sanctuary_-_PROFILE_thumb.jpg",130,75,1);thumbnails[56491]=new thumbnail(56491,"216396","Harbour Reflections","Harbour Reflections_thumb.jpg",130,167,1);thumbnails[59917]=new thumbnail(59917,"216396","Harbour Dawn","Harbour Dawn_thumb.jpg",130,167,1);thumbnails[37696]=new thumbnail(37696,"216396","Heavens Above","Heavens Above_thumb.jpg",130,82,1);thumbnails[296140]=new thumbnail(296140,"216396","Golden Light","Golden Light_thumb.jpg",130,167,1);thumbnails[27390]=new thumbnail(27390,"216396","The Light Of Dawn","The Light Of Dawn_thumb.jpg",130,167,1);thumbnails[56490]=new thumbnail(56490,"216456","Until Tomorrow","Until_Tomorrow_thumb.jpg",130,187,1);thumbnails[759814]=new thumbnail(759814,"216410","Manorbier Sunset","Manorbier Sunset_thumb.jpg",130,130,1);thumbnails[1348544]=new thumbnail(1348544,"216601","Three Pebbles","Three Pebbles_thumb.jpg",130,192,1);thumbnails[66255]=new thumbnail(66255,"216456","...Shepherd's Delight","Shepherd's Delight1_thumb.jpg",130,72,1);thumbnails[173048]=new thumbnail(173048,"216410","A Break In The Clouds","A Break In The Clouds_thumb.jpg",130,82,1);thumbnails[1348430]=new thumbnail(1348430,"216601","Apostles","Apostles_thumb.jpg",130,82,1);thumbnails[1365509]=new thumbnail(1365509,"216601","Waiting For The Tide","Waiting For The Tide_thumb.jpg",130,82,1);thumbnails[1365635]=new thumbnail(1365635,"216601","End Of A Dream","End Of A Dream_thumb.jpg",130,72,1);thumbnails[66251]=new thumbnail(66251,"216410","Riding The Wave","Riding The Wave_thumb.jpg",130,72,1);thumbnails[635952]=new thumbnail(635952,"216427","Driftwood","Driftwood_thumb.jpg",130,192,1);thumbnails[1957623]=new thumbnail(1957623,"216603","Ceibwr Bay","Ceibwr Bay_thumb.jpg",130,130,1);thumbnails[1957761]=new thumbnail(1957761,"216462","Rock Of Ages","Rock Of Ages_thumb.jpg",130,187,1);thumbnails[706609]=new thumbnail(706609,"216462","Breaking Light","Breaking Light_thumb.jpg",130,72,1);thumbnails[1127287]=new thumbnail(1127287,"216427","The Spirit Of Church Rock","The Spirit Of Chruch Rock PRINT_thumb.jpg",130,41,1);thumbnails[80538]=new thumbnail(80538,"216462","Golden Shores","Golden Shores_thumb.jpg",130,192,1);thumbnails[1127415]=new thumbnail(1127415,"216463","Solitary Moment","Solitary Moment_thumb.jpg",130,192,1);thumbnails[1957856]=new thumbnail(1957856,"216604","The Boardwalk","The Boardwalk_thumb.jpg",130,85,1);thumbnails[264436]=new thumbnail(264436,"216431","Taking On Mother Nature","Taking On Mother Nature_thumb.jpg",130,72,1);thumbnails[3153866]=new thumbnail(3153866,"216463","Rickets View","Ricketts View_thumb.jpg",130,37,1);thumbnails[602874]=new thumbnail(602874,"216431","Boundaries","Boundaries_thumb.jpg",130,82,1);thumbnails[1365484]=new thumbnail(1365484,"216463","Newgale Reflections","Newgale Reflections_thumb.jpg",130,72,1);thumbnails[150124]=new thumbnail(150124,"216431","Open Space","Open Space_thumb.jpg",130,82,1);thumbnails[3562306]=new thumbnail(3562306,"216463","Newgale","Newgale_thumb.jpg",130,72,1);thumbnails[1365584]=new thumbnail(1365584,"216431","Neighbours From Hell","Neighbours From Hell_thumb.jpg",130,82,1);thumbnails[1365616]=new thumbnail(1365616,"216464","Solva","Solva_thumb.jpg",130,451,1);thumbnails[4404846]=new thumbnail(4404846,"292663","Catching The Light","Catching_The_Light_thumb.jpg",130,37,1);thumbnails[1365595]=new thumbnail(1365595,"216464","Sheltered Haven","Sheltered Haven_thumb.jpg",130,37,1);thumbnails[3881482]=new thumbnail(3881482,"258148","St Justinian","St_Justinian_-_PROFILE_thumb.jpg",130,187,1);thumbnails[110246]=new thumbnail(110246,"216437","Mill Pond Reflections","Mill Pond Reflections_thumb.jpg",130,167,1);thumbnails[602940]=new thumbnail(602940,"216645","Three Bales","Three_Bales12_thumb.jpg",130,451,1);thumbnails[4012994]=new thumbnail(4012994,"216465","What Lies Beneath","What_Lies_Beneath_-_A_PROFILE_thumb.jpg",130,187,1);thumbnails[405874]=new thumbnail(405874,"216437","Reflections Of The Past","Reflections Of The Past_thumb.jpg",130,37,1);thumbnails[4012925]=new thumbnail(4012925,"216465","Tidal Rush","Tidal_Rush_thumb.jpg",130,85,1);thumbnails[635947]=new thumbnail(635947,"216437","Carew Sunset","Carew Sunset_thumb.jpg",130,72,1);thumbnails[4012974]=new thumbnail(4012974,"216465","Splash Of Gold","Splash_Of_Gold_thumb.jpg",130,75,1);thumbnails[405918]=new thumbnail(405918,"216437","Windows To The Past","Windows To The Past_thumb.jpg",130,37,1);thumbnails[573418]=new thumbnail(573418,"216465","Stormy Beach","Stormy Beach_thumb.jpg",130,37,1);thumbnails[110270]=new thumbnail(110270,"216437","Sundown At Carew","Sundown At Carew_thumb.jpg",130,72,1);thumbnails[3953490]=new thumbnail(3953490,"216465","Storm Brewing","Storm_Brewing1_thumb.jpg",130,85,1);thumbnails[30103]=new thumbnail(30103,"216647","Abereiddy","Abereiddy_thumb.jpg",130,82,1);thumbnails[3153922]=new thumbnail(3153922,"216642","Standing Proud","Standing Proud_thumb.jpg",130,37,1);thumbnails[405902]=new thumbnail(405902,"216624","Dreaming...","Dreaming_thumb.....jpg",130,37,1);thumbnails[5182458]=new thumbnail(5182458,"16260","The Nave","The_Nave_profile_thumb.jpg",130,85,1);thumbnails[5182545]=new thumbnail(5182545,"16260","Nash Point","Nash_point_-_profile_thumb.jpg",130,85,1);thumbnails[5182624]=new thumbnail(5182624,"16260","Penarth Pier","Penarth_Pier_thumb.jpg",130,187,1);thumbnails[66284]=new thumbnail(66284,"6437","A Ray Of Hope","A Ray Of Hope_thumb.jpg",130,167,1);thumbnails[3881241]=new thumbnail(3881241,"18941","Forsaken","Forsaken_-_Profile_-_trip_thumb.jpg",130,40,1);thumbnails[208157]=new thumbnail(208157,"18941","Corran Books","Corran Books_thumb.jpg",130,72,1);thumbnails[46694]=new thumbnail(46694,"18941","Long Forgotten","Long Forgotten_thumb1.jpg",130,72,1);thumbnails[263357]=new thumbnail(263357,"18941","Paxton's Gate","Paxtons Gate_thumb.jpg",130,82,1);thumbnails[635979]=new thumbnail(635979,"18941","Towy Valley","Towy Valley_thumb.jpg",130,37,1);thumbnails[915915]=new thumbnail(915915,"2637","Dunraven Reflections","Dunraven Reflections_thumb.jpg",130,82,1);thumbnails[1957692]=new thumbnail(1957692,"2637","Natures Tapestry","Natures Tapestry_thumb.jpg",130,85,1);thumbnails[1957712]=new thumbnail(1957712,"2637","White Water","White Water_thumb.jpg",130,130,1);thumbnails[42835]=new thumbnail(42835,"2637","A Place In The Country","A Place In The Country_thumb.jpg",130,82,1);thumbnails[80503]=new thumbnail(80503,"2637","Fire Escape","Fire Escape_thumb.jpg",130,82,1);thumbnails[3879787]=new thumbnail(3879787,"2637","Cwmgors","Cwmgors_-_profile_thumb.jpg",130,85,1);thumbnails[136077]=new thumbnail(136077,"12510","Boat House Reflections","Boat House Reflections_thumb.jpg",130,192,1);thumbnails[173093]=new thumbnail(173093,"12510","Ashness Launch","Ashness Launch_thumb.jpg",130,72,1);thumbnails[136089]=new thumbnail(136089,"12510","Autumn Glow","Autumn Glow_thumb.jpg",130,82,1);thumbnails[136110]=new thumbnail(136110,"12510","Surprise View","Surprise View_thumb.jpg",130,82,1);thumbnails[136113]=new thumbnail(136113,"12510","Derwent Dusk","Derwent Dusk_thumb.jpg",130,192,1);thumbnails[136115]=new thumbnail(136115,"12510","Golden Lake","Golden Lake_thumb.jpg",130,167,1);thumbnails[150111]=new thumbnail(150111,"12510","Symmetry","Symmetry_thumb.jpg",130,82,1);thumbnails[136122]=new thumbnail(136122,"12510","Blea Tarn","Blea Tarn-S_thumb.jpg",130,192,1);thumbnails[176646]=new thumbnail(176646,"12510","Dusk Reflections","Dusk Reflections_thumb.jpg",130,82,1);thumbnails[136118]=new thumbnail(136118,"12510","St Patrick's Well","St Patrick's Well_thumb.jpg",130,192,1);thumbnails[186138]=new thumbnail(186138,"12510","Reflections Over Crummock","Reflections Over Crummock_thumb.jpg",130,167,1);thumbnails[228813]=new thumbnail(228813,"12510","In The Shadow Of Cat Bells","In The Shadow Of Cat Bells_thumb.jpg",130,72,1);thumbnails[263257]=new thumbnail(263257,"12510","The Cold Light Of Dawn","The Cold Light Of Dawn_thumb.jpg",130,82,1);thumbnails[228807]=new thumbnail(228807,"12510","Last Light Over Cat Bells","Last Light Over Cat Bells_thumb.jpg",130,192,1);thumbnails[296180]=new thumbnail(296180,"12510","Ullswater Reflections","Ullswater Reflections_thumb.jpg",130,167,1);thumbnails[203094]=new thumbnail(203094,"3175","A Stones Throw","A Stones Throw_thumb.jpg",130,192,1);thumbnails[126967]=new thumbnail(126967,"3175","Road To Bridgnorth","Road To Bridgnorth_thumb.jpg",130,72,1);thumbnails[173091]=new thumbnail(173091,"3175","Leave No Tracks","Leave No Tracks_thumb.jpg",130,192,1);thumbnails[173089]=new thumbnail(173089,"3175","Warren Point","Warren Point_thumb.jpg",130,82,1);var galleries=new Object();galleries[216394]=new gallery(216394,"573543,32244","Amroth","gallery",[32244,573543]);galleries[216442]=new gallery(216442,"1127327,915872,759801","Llangwm / Port Lion","gallery",[759801,915872,1127327]);galleries[216627]=new gallery(216627,"915900,573521","Preseli's","gallery",[915900,573521]);galleries[216589]=new gallery(216589,"431599,42839","Strumble Head / Pen-Caer","gallery",[42839,431599]);galleries[235696]=new gallery(235696,"3562272","Wiseman's Bridge","gallery",[3562272]);galleries[216591]=new gallery(216591,"296151","Fishguard","gallery",[296151]);galleries[216395]=new gallery(216395,"50537,20414","Saundersfoot","gallery",[50537,20414]);galleries[216446]=new gallery(216446,"3153896,431600,203105,186174,186159","West Dale Bay","gallery",[186159,186174,431600,3153896,203105]);galleries[216596]=new gallery(216596,"1240505,1240478","Cwm-yr-Eglwys","gallery",[1240505,1240478]);galleries[216448]=new gallery(216448,"80541","Marloes Sands","gallery",[80541]);galleries[216396]=new gallery(216396,"3881440,334528,296140,150105,110332,59917,56491,37696,27390","Tenby","gallery",[150105,110332,334528,3881440,56491,59917,37696,296140,27390]);galleries[216456]=new gallery(216456,"66255,56490","Little Haven / Broad Haven","gallery",[56490,66255]);galleries[216410]=new gallery(216410,"759814,173048,66251","Manorbier","gallery",[759814,173048,66251]);galleries[216601]=new gallery(216601,"1365635,1365509,1348544,1348430","Newport / Parrog","gallery",[1348544,1348430,1365509,1365635]);galleries[216427]=new gallery(216427,"1127287,635952","Broad Haven South","gallery",[635952,1127287]);galleries[216603]=new gallery(216603,"1957623","Ceibwr Bay","gallery",[1957623]);galleries[216462]=new gallery(216462,"1957761,706609,80538","Druidston Haven","gallery",[1957761,706609,80538]);galleries[216431]=new gallery(216431,"1365584,602874,264436,150124","Freshwater West","gallery",[264436,602874,150124,1365584]);galleries[216463]=new gallery(216463,"3562306,3153866,1365484,1127415","Newgale","gallery",[1127415,3153866,1365484,3562306]);galleries[216604]=new gallery(216604,"1957856","Poppit Sands","gallery",[1957856]);galleries[292663]=new gallery(292663,"4404846","Pwllgwaelod","gallery",[4404846]);galleries[216464]=new gallery(216464,"1365595","Solva","gallery",[1365616,1365595]);galleries[258148]=new gallery(258148,"3881482","St Justinian's","gallery",[3881482]);galleries[216437]=new gallery(216437,"635947,405918,405874,110270,110246","Carew","gallery",[110246,405874,635947,405918,110270]);galleries[216645]=new gallery(216645,"602940","St Florence","gallery",[602940]);galleries[216465]=new gallery(216465,"4012994,4012974,4012925,3953490,573418","Whitesands","gallery",[4012994,4012925,4012974,573418,3953490]);galleries[216647]=new gallery(216647,"30103","Abereiddy","gallery",[30103]);galleries[216642]=new gallery(216642,"3153922","Jeffreyston","gallery",[3153922]);galleries[216624]=new gallery(216624,"405902","Aber Bach","gallery",[405902]);galleries[16260]=new gallery(16260,"5182624,5182545,5182458","New Images","gallery",[5182458,5182545,5182624]);galleries[6437]=new gallery(6437,"66284","Royal National Lifeboat Institution","gallery",[66284]);galleries[216393]=new gallery(216393,"3881440,3562272,3153922,1365584,1127287,759814,635952,635947,602874,573543,405918,405874,334528,296140,264436,173048,150124,150105,110332,110270,110246,66251,59917,56491,50537,37696,32244,27390,20414","South Pembrokeshire","gallery",[]);galleries[216441]=new gallery(216441,"4012994,4012974,4012925,3953490,3881482,3562306,3153896,3153866,1957761,1365595,1365484,1127415,1127327,915872,759801,706609,573418,431600,405902,203105,186174,186159,80541,80538,66255,56490,30103","West Pembrokeshire","gallery",[]);galleries[216588]=new gallery(216588,"1957856,1957623,1365635,1365509,1348544,1348430,1240505,1240478,431599,296151,42839","North Pembrokeshire","gallery",[]);galleries[216625]=new gallery(216625,"915900,573521","Central Pembrokeshire","gallery",[]);galleries[18941]=new gallery(18941,"3881241,635979,263357,208157,46694","Carmarthenshire","gallery",[3881241,208157,46694,263357,635979]);galleries[2637]=new gallery(2637,"3879787,1957712,1957692,915915,80503,42835","Wales","gallery",[915915,1957692,1957712,42835,80503,3879787]);galleries[12510]=new gallery(12510,"296180,263257,228813,228807,186138,176646,173093,150111,136122,136118,136115,136113,136110,136089,136077","Lake District","gallery",[136077,173093,136089,136110,136113,136115,150111,136122,176646,136118,186138,228813,263257,228807,296180]);galleries[3175]=new gallery(3175,"203094,173091,173089,126967","The Gallery","gallery",[203094,126967,173091,173089]);var imageSets=new Object();imageSets[1]="4012994,4012974,4012925,3953490,3881482,3881440,3881241,3879787,3562306,3562272,3153922,3153896,3153866,1957856,1957761,1957712,1957692,1957623,1365635,1365595,1365584,1365509,1365484,1348544,1348430,1240505,1240478,1127415,1127327,1127287,915915,915900,915872,759814,759801,706609,635979,635952,635947,602874,573543,573521,573418,431600,431599,405918,405902,405874,334528,296180,296151,296140,264436,263357,263257,228813,228807,208157,203105,203094,186174,186159,186138,176646,173093,173091,173089,173048,150124,150111,150105,136122,136118,136115,136113,136110,136089,136077,126967,110332,110270,110246,80541,80538,80503,66284,66255,66251,59917,56491,56490,50537,46694,42839,42835,37696,32244,30103,27390,20414";imageSets[2]="4012994,4012974,4012925,3953490,3881482,3881440,3881241,3879787,3562306,3562272,3153922,3153896,3153866,1957856,1957761,1957712,1957692,1957623,1365635,1365595,1365584,1365509,1365484,1348544,1348430,1240505,1240478,1127415,1127327,1127287,915915,915900,915872,759814,759801,706609,635979,635952,635947,602874,573543,573521,573418,431600,431599,405918,405902,405874,334528,296180,296151,296140,264436,263357,263257,228813,228807,208157,203105,203094,186174,186159,186138,176646,173093,173091,173089,173048,150124,150111,150105,136122,136118,136115,136113,136110,136089,136077,126967,110332,110270,110246,80541,80538,80503,66284,66255,66251,59917,56491,56490,50537,46694,42839,42835,37696,32244,30103,27390,20414";imageSets[3]="5182624,5182545,5182458,4404846,4012994,4012974,4012925,3953490,3881482,3881440,3881241,3879787,3562306,3562272,3153922,3153896,3153866,1957856,1957761,1957712,1957692,1957623,1365635,1365616,1365595,1365584,1365509,1365484,1348544,1348430,1240505,1240478,1127415,1127327,1127287,915915,915900,915872,759814,759801,706609,635979,635952,635947,602940,602874,573543,573521,573418,431600";function randomListVal(a){arrayVals=a.split(",");if(arrayVals.length){pos=Math.round(Math.random()*(arrayVals.length-1));val=arrayVals[pos]}else{val=0}return val}function getServerPath(a){var b=-1;switch(a){case 21:b="http://www6.clikpic.com/stenward/images";break}switch(a){case 1:b="http://www1.clikpic.com/stenward/images";break}switch(a){case 2:b="http://admin.clikpic.com/stenward/images";break}switch(a){case 24:b="http://tpc15/clikpic/stenward/images";break}switch(a){case 4:b="http://www.clikchurch.com/stenward/images";break}switch(a){case 5:b="http://www2.clikpic.com/stenward/images";break}switch(a){case 22:b="http://tpc5/clikpic/stenward/images";break}switch(a){case 23:b="http://tpc10/clikpic/stenward/images";break}switch(a){case 25:b="http://tpc16/clikpic/stenward/images";break}switch(a){case 15:b="http://www3.clikpic.com/stenward/images";break}switch(a){case 18:b="http://www4.clikpic.com/stenward/images";break}switch(a){case 19:b="http://www5.clikpic.com/stenward/images";break}switch(a){case 31:b="http://www7.clikpic.com/stenward/images";break}switch(a){case 32:b="http://admin2.clikpic.com/stenward/images";break}switch(a){case 33:b="http://www8.clikpic.com/stenward/images";break}switch(a){case 34:b="http://www9.clikpic.com/stenward/images";break}switch(a){case 35:b="http://admin3.clikpic.com/stenward/images";break}switch(a){case 37:b="http://admin4.clikpic.com/stenward/images";break}return b}function showHomeImage(a){imageID=randomListVal("");if(!basic){a.src=photos[imageID].src;a.width=photos[imageID].width;a.height=photos[imageID].height}else{newImage=new Image(photos[imageID].width,photos[imageID].height);newImage.src=photos[imageID].src;document.images[a.name]=newImage}}function showHomeImageInline(){html="";imageID=randomListVal(imageSets[1]);if("gallery"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="gallery.html">'}}html+='<img src="'+backgrounds[imageID].src+'" width="'+backgrounds[imageID].width+'" height="'+backgrounds[imageID].height+'" class="mainhomepageimage photo" id="mainSample" name="mainSample" alt="'+backgrounds[imageID].caption+'" border="0">';if("gallery"!=""){html+="</a>"}$("#homepageimage").html(html)}function getNextId(b,d,a){var c=getArrayPos(d,b);if(a){if(c==0){nextImgPos=d.length-1}else{nextImgPos=c-1}}else{if(c==d.length-1){nextImgPos=0}else{nextImgPos=c+1}}nextImg=d[nextImgPos];return nextImg}function next(d,b){var c=d.value;var a=galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,a);if(nextImg!=-1){updateImage(nextImg,d,b)}}function updateImage(f,e,b){if(!basic){document.getElementById("imagePhoto").innerHTML='<img class="mainphoto photo" src="'+photos[f].src+' " id="mainPic" name="mainPic" width="'+photos[f].width+'" height="'+photos[f].height+'" alt="'+photos[f].caption+'">';e.value=photos[f].id;$("#imageTitle").html(photos[f].caption);document.title="Kersten Howard Photography: "+photos[f].caption;if(photos[f].caption==""){document.getElementById("imageTitle").style.display="none"}else{document.getElementById("imageTitle").style.display="block"}var a=fnGetImageDetails(f);if(a==""){document.getElementById("imageDetails").style.display="none";var c=document.getElementById("infoWrap");var d=document.getElementById("photoInfo");if(photos[f].caption==""){if(c!=null){c.className="empty"}if(d!=null){d.className="empty"}}else{if(c!=null){c.className="noinfo"}if(d!=null){d.className="noinfo"}}}else{document.getElementById("imageDetails").style.display="block";var c=document.getElementById("infoWrap");if(c!=null){c.className="normal"}var d=document.getElementById("photoInfo");if(d!=null){d.className="normal"}}document.getElementById("imageDetails").innerHTML=a;resizePhotoInfo();toggleAddToCartConfirm()}else{window.location="photo_"+photos[f].id+".html"}}function toggleAddToCartConfirm(){if($("#paymentConfirm").size()){$("#paymentConfirm").hide();$("#paymentAddButton").unbind().click(function(){form=document.getElementById("paymentForm");option_id=0;if(form.item_option.value){option_id=form.item_option.value}if(addItemToBasket(form.item_number.value,photos,form.site.value,parseInt(form.quantity.value,10),option_id)){if($.browser.msie){$("#paymentConfirm").text("Item added to cart").show()}else{$("#paymentConfirm").text("Item added to cart").fadeIn()}}else{$("#paymentConfirm").text("Item not added - check cookies are enabled in your browser.").fadeIn()}})}}function fnGetImageDetails(b){var a="";if(photos[b].description!=""){a=a+'<p id="imageDescription">'+photos[b].description+"</p>"}if(photos[b].photo_ref!=""){a=a+'<p class="imageinfo" id="imageRef"><strong>Ref: </strong>'+photos[b].photo_ref+"</p>"}if(photos[b].takendate!=""){a=a+'<p class="imageinfo" id="imageDate"><strong>Date: </strong>'+photos[b].takendate+"</p>"}if(photos[b].location!=""){a=a+'<p class="imageinfo" id="imageLocation"><strong>Location: </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>Limited edition of 150. For full details please visit SALES before placing your order. </strong>'+photos[b].photographer+"</p>"}a=a+fnGetPaymentInfo(photos[b]);if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Buy now using PayPal:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 				&pound;"+(c.item_price).toFixed(2)+"</p>";var e=c.purchase_instruction;var d=(c.item_price).toFixed(2);var a=0}else{if(c.payment_groups_id!==""){b=b+"<p>Buy this print online:</p>";b=b+'<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';b=b+'<select class="paymentlink" name="payment_options_id" onchange="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';b=b+getPaymentOptions(c.payment_groups_id);b=b+"</select>";b=b+"</form>";var a=paymentGroups[c.payment_groups_id].options[0];if(paymentOptions[a]){var e=paymentOptions[a].payment_option;var d=paymentOptions[a].price}}else{}}if(c.item_price!==""||c.payment_groups_id!==""){b=b+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="STENWARD">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";b=b+'<div class="clearing">&nbsp;</div>'}return b}function previous(d,b){var c=d.value;var a=galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,a,1);if(nextImg!=-1){updateImage(nextImg,d,b)}}function showGalleryImage(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}function showGalleries(a){if(!basic){temp="";for(i=0;i<galleries.length;i++){if(galleries[i].id!=a){if(temp!=""){temp=temp+" | "}temp=temp+'<a href="gallery_'+galleries[i].id+'.html">'+galleries[i].title+"</a>"}}document.all.galleryLinks.innerHTML="Other galleries: "+temp}}function resizePhotoInfo(n){var b=$.extend({centre:false},n||{});var d=3;$("div#photoPanelOuter").height("auto");$("div#infoWrap").width(200);$("div#photoDetail").css("width","auto");var h=$("div#maincolContent").width();var j=$("div#photoWrap").outerWidth(true);var m=$("div#infoWrap").outerWidth(true);var k=$("div#photoWrap").outerHeight();var f=$("div#infoWrap").outerHeight();var c=$("div#infoWrap").hasClass("empty");floatDrop=0;var g=j;if(!c){if(h<(j+m)){floatDrop=1}if(!floatDrop){var a=$("div#infoWrap").innerWidth();$("div#infoWrap").width(a+(h-j-m-d));m=$("div#infoWrap").outerWidth(true);g=j+m;if(k>f){var e=$("div#photoPanelOuter").height();$("div#photoPanelOuter").height(e+(k-f));var f=$("div#infoWrap").outerHeight()}}else{var l=$("div#photoWrap").outerWidth();$("div#infoWrap").width(l)}}if(b.centre){$("div#photoDetail").width(g);$("div#photoDetail").css("margin-left","auto");$("div#photoDetail").css("margin-right","auto")}else{$("div#photoDetail").css("margin-left","0");$("div#photoDetail").css("margin-right","0")}}function getArrayPos(c,b){for(var a=0;a<c.length;a++){if(c[a]==b){return a}}return -1}function changeBgImg(a,e){var c=randomListVal(imageSets[e]);var d=backgrounds[c].src;var b=$(a);if(b.size()>0){if(/\bimg$/.test(a)){b.attr({src:d})}else{b.css({"background-image":'url("'+d+'")'})}}};