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[879839]=new thumbnail(879839,"67485","Mist Over lake Lucerne","Mist_Over_Lake_Lucerne_thumb.jpg",130,166,1);thumbnails[892729]=new thumbnail(892729,"67485","Northern December Afternoon","Northern_December_Afternoon_thumb.jpg",130,197,1);thumbnails[892737]=new thumbnail(892737,"67485","Swan Beach","Swan_Beach_thumb.jpg",130,198,1);thumbnails[892740]=new thumbnail(892740,"67485","A Wider View","Wider_View_thumb.jpg",130,68,1);thumbnails[907266]=new thumbnail(907266,"67485","Mont St Michel","Mont St Michel_thumb.jpg",130,107,1);thumbnails[1054906]=new thumbnail(1054906,"67485","Sunset In Mist","Sunset in Mist_thumb.jpg",130,62,1);thumbnails[3528206]=new thumbnail(3528206,"67485","Composition in Steel and Mist","Composition in Steel and Mist_thumb.jpg",130,96,1);thumbnails[879835]=new thumbnail(879835,"122791","Magic Glade","Magic_Glade_thumb.jpg",130,91,1);thumbnails[879855]=new thumbnail(879855,"122791","The History Lesson","The_History_Lesson_thumb.jpg",130,102,1);thumbnails[1101297]=new thumbnail(1101297,"122791","A Forgotten Field","A Forgotten Field_thumb.jpg",130,180,1);thumbnails[1443425]=new thumbnail(1443425,"122791","Forde Abbey I","Forde Abbey l_thumb.jpg",130,98,1);thumbnails[1541821]=new thumbnail(1541821,"122791","Signs and Portents","Signs and Portents_thumb.jpg",130,98,1);thumbnails[4313612]=new thumbnail(4313612,"122791","In the Midst of Life","In_the_Midst_of_Life_thumb.jpg",130,104,1);thumbnails[892721]=new thumbnail(892721,"67486","Dividing Lines","Dividing_Lines_thumb.jpg",130,102,1);thumbnails[892723]=new thumbnail(892723,"67486","Elven Queen","Elven_Queen_thumb.jpg",130,172,1);thumbnails[1054834]=new thumbnail(1054834,"67486","Mirror Mirror","Mirror Mirror_thumb.jpg",130,71,1);thumbnails[1503116]=new thumbnail(1503116,"67486","Alison","Alison_thumb.jpg",130,92,1);thumbnails[1541823]=new thumbnail(1541823,"67486","The Photographer's Eye","The Photographers Eye_thumb.jpg",130,107,1);thumbnails[2857381]=new thumbnail(2857381,"67486","Watching in Light","Watching in Light_thumb.jpg",130,111,1);thumbnails[879832]=new thumbnail(879832,"67484","Harsh Light and Soft Shadows","Harsh_Light_and_Soft_Shadows_thumb.jpg",130,147,1);thumbnails[879851]=new thumbnail(879851,"67484","The Art Lovers","The_Art_Lovers_thumb.jpg",130,93,1);thumbnails[880194]=new thumbnail(880194,"67484","An Arrangement in Neon and Black","An_Arrangement_in_Neon_and_Black_thumb.jpg",130,72,1);thumbnails[892711]=new thumbnail(892711,"67484","A Silence at Midnight","A_Silence_At_Midnight_thumb.jpg",130,100,1);thumbnails[892720]=new thumbnail(892720,"67484","Dead Eyes","Dead_Eyes_thumb.jpg",130,100,1);thumbnails[1541815]=new thumbnail(1541815,"67484","Nightmare Scenario","Nightmare Scenario_thumb.jpg",130,79,1);thumbnails[1827018]=new thumbnail(1827018,"67484","Edge of Darkness","Edge of Darkness_thumb.jpg",130,83,1);thumbnails[1827023]=new thumbnail(1827023,"67484","Nocturne in Black, Red and Gold","Nocturne in Black Red and Gold_thumb.jpg",130,91,1);thumbnails[2180839]=new thumbnail(2180839,"67484","Someone to Watch Over Me","Someone To Watch Over Me_thumb.jpg",130,97,1);thumbnails[4313621]=new thumbnail(4313621,"67484","The Shadow Players","The_Shadow_Players_thumb.jpg",130,106,1);thumbnails[4742336]=new thumbnail(4742336,"67484","Shadow Story","Shadow_Story1_thumb.jpg",130,96,1);thumbnails[880207]=new thumbnail(880207,"67502","Only Questions","Only_Questions_thumb.jpg",130,130,1);thumbnails[892715]=new thumbnail(892715,"67502","Backstage","Backstage_thumb.jpg",130,71,1);thumbnails[892719]=new thumbnail(892719,"67502","Dancing in Dream","Dancing_in_Dream_thumb.jpg",130,85,1);thumbnails[892724]=new thumbnail(892724,"67502","Encounters","Encounters_thumb.jpg",130,101,1);thumbnails[892738]=new thumbnail(892738,"67502","Welcome To The Party","Welcome_To _The_Party_thumb.jpg",130,99,1);thumbnails[1827014]=new thumbnail(1827014,"67502","Caught in Dream","Caught in Dream_thumb.jpg",130,98,1);thumbnails[1827019]=new thumbnail(1827019,"67502","Figures in a Frame","Figures in a Frame_thumb.jpg",130,88,1);thumbnails[4115182]=new thumbnail(4115182,"67502","A Corner Of My Own","A_Corner_Of_My_Own1_thumb.jpg",130,91,1);thumbnails[880213]=new thumbnail(880213,"67519","The Natural Course of Events","The_Natural_Course_Of_Events_thumb.jpg",130,350,1);thumbnails[892718]=new thumbnail(892718,"67519","The Conversation","Conversation_thumb.jpg",130,100,1);thumbnails[892727]=new thumbnail(892727,"67519","He Could Not Remember Her Face","He_Could_Not_Remember_Her_Face_thumb.jpg",130,104,1);thumbnails[892732]=new thumbnail(892732,"67519","A Quickening Of The Pulse","Quickening_of_the_Pulse_thumb.jpg",130,50,1);thumbnails[879821]=new thumbnail(879821,"67487","A Skyful of Dreams","A_Skyful_Of_Dreams_thumb.jpg",130,166,1);thumbnails[879831]=new thumbnail(879831,"67487","Gothic Theatre","Gothic_Theatre_thumb.jpg",130,194,1);thumbnails[880196]=new thumbnail(880196,"67487","Dance Impressions","Dance_Impressions_thumb.jpg",130,127,1);thumbnails[880201]=new thumbnail(880201,"67487","Gender Icons","Gender_Icons_thumb.jpg",130,57,1);thumbnails[880205]=new thumbnail(880205,"67487","Memories and Regrets","Memories_and_Regrets_thumb.jpg",130,79,1);thumbnails[892714]=new thumbnail(892714,"67487","Aspects of Age","Aspects_of_Age_thumb.jpg",130,89,1);thumbnails[892726]=new thumbnail(892726,"67487","Four And One Passing","Four_and_One_Passing_thumb.jpg",130,86,1);thumbnails[892734]=new thumbnail(892734,"67487","Remembrance","Remembrance_thumb.jpg",130,90,1);thumbnails[1101441]=new thumbnail(1101441,"67487","Ammonite I","Ammonite I1_thumb.jpg",130,142,1);thumbnails[1443432]=new thumbnail(1443432,"67487","Shell I","Shell I_thumb.jpg",130,147,1);thumbnails[1827020]=new thumbnail(1827020,"67487","Flowers at Sunset","Flowers At Sunset_thumb.jpg",130,58,1);thumbnails[2180826]=new thumbnail(2180826,"67487","The Door","The Door_thumb.jpg",130,99,1);thumbnails[3528207]=new thumbnail(3528207,"67487","The Prisoner","The Prisoner_thumb.jpg",130,73,1);thumbnails[4115190]=new thumbnail(4115190,"67487","Great Synagogue, Budapest","Great_Synagogue_Budapest_thumb.jpg",130,100,1);thumbnails[4742317]=new thumbnail(4742317,"67487","The Watcher","The_Watcher_thumb.jpg",130,196,1);thumbnails[907268]=new thumbnail(907268,"67483","Sitting on the Edge","Sitting on the Edge_thumb.jpg",130,73,1);thumbnails[892728]=new thumbnail(892728,"67483","Memories Of Her","Memories_of_Her_thumb.jpg",130,87,1);thumbnails[892725]=new thumbnail(892725,"67483","The Face of New York","Face_of_New_York_thumb.jpg",130,73,1);thumbnails[879843]=new thumbnail(879843,"67483","Nightclub Story","Nightclub_Story_thumb.jpg",130,78,1);thumbnails[880197]=new thumbnail(880197,"67483","Figures in Space","Figures_in_Space_thumb.jpg",130,96,1);thumbnails[879847]=new thumbnail(879847,"67483","Shadow Games","Shadow_Games_thumb.jpg",130,95,1);thumbnails[879828]=new thumbnail(879828,"67483","A Time of Silences","A_Time_of_Silences_thumb.jpg",130,98,1);thumbnails[2857379]=new thumbnail(2857379,"67483","Made in America","Made in America_thumb.jpg",130,94,1);thumbnails[2857366]=new thumbnail(2857366,"67483","Backstage Dreaming","Backstage Dreaming_thumb.jpg",130,73,1);thumbnails[5340046]=new thumbnail(5340046,"67483","Windows and the Soul II","Windows_and_the_Soul_II_thumb.jpg",130,93,1);thumbnails[4742327]=new thumbnail(4742327,"67483","Wind Sculpture","Wind_Sculpture_2_thumb.jpg",130,196,1);thumbnails[5340036]=new thumbnail(5340036,"78376","At the World's Edge","At_the_Worlds_Edge_thumb.jpg",130,91,1);thumbnails[5340041]=new thumbnail(5340041,"78376","Sunset Eye","London_Eye_Sunset_thumb.jpg",130,94,1);thumbnails[5340043]=new thumbnail(5340043,"78376","The Smile","The_Smile_thumb.jpg",130,89,1);thumbnails[5933577]=new thumbnail(5933577,"78376","A Position of Safety","A_Position_of_Safety_thumb.jpg",130,109,1);thumbnails[5933585]=new thumbnail(5933585,"78376","Hiding and Seeking","Hiding_and_Seeking_thumb.jpg",130,99,1);thumbnails[5933590]=new thumbnail(5933590,"78376","Royal Academy Reflection","Royal_Academy_Reflection_thumb.jpg",130,96,1);thumbnails[5933593]=new thumbnail(5933593,"78376","The Weight of Expectations","The_Weight_of_Expectations_thumb.jpg",130,95,1);var galleries=new Object();galleries[67485]=new gallery(67485,"907266","Landscapes","gallery",[879839,892729,892737,892740,907266,1054906,3528206]);galleries[122791]=new gallery(122791,"1541821,1443425,879835","Infrared Landscapes","gallery",[879835,879855,1101297,1443425,1541821,4313612]);galleries[67486]=new gallery(67486,"892721","Portraits","gallery",[892721,892723,1054834,1503116,1541823,2857381]);galleries[67484]=new gallery(67484,"892711","Film Noir","gallery",[879832,879851,880194,892711,892720,1541815,1827018,1827023,2180839,4313621,4742336]);galleries[67502]=new gallery(67502,"1827014,892738","Masks and Symbols","gallery",[880207,892715,892719,892724,892738,1827014,1827019,4115182]);galleries[67519]=new gallery(67519,"892727","Narrative","gallery",[880213,892718,892727,892732]);galleries[67487]=new gallery(67487,"892726","Miscellaneous","gallery",[879821,879831,880196,880201,880205,892714,892726,892734,1101441,1443432,1827020,2180826,3528207,4115190,4742317]);galleries[67483]=new gallery(67483,"880197","Awards","gallery",[907268,892728,892725,879843,880197,879847,879828,2857379,2857366,5340046,4742327]);galleries[78376]=new gallery(78376,"5933593,5933590,5933585,5933577,5340043,5340041,5340036","New Images 2010","gallery",[5340036,5340041,5340043,5933577,5933585,5933590,5933593]);var imageSets=new Object();imageSets[1]="4742327";imageSets[2]="1827014,1541821,1443425,907266,892738,892727,892726,892721,892711,880197,879835";imageSets[3]="5933593,5933590,5933585,5933577,5340046,5340043,5340041,5340036,4742336,4742327,4742317,4313621,4313612,4115190,4115182,3528207,3528206,2857381,2857379,2857366,2180839,2180826,1827023,1827020,1827019,1827018,1827014,1541823,1541821,1541815,1503116,1443432,1443425,1101441,1101297,1054906,1054834,907268,907266,892740,892738,892737,892734,892732,892729,892728,892727,892726,892725,892724";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/gwilcock/images";break}switch(a){case 1:b="http://www1.clikpic.com/gwilcock/images";break}switch(a){case 2:b="http://admin.clikpic.com/gwilcock/images";break}switch(a){case 24:b="http://tpc15/clikpic/gwilcock/images";break}switch(a){case 4:b="http://www.clikchurch.com/gwilcock/images";break}switch(a){case 5:b="http://www2.clikpic.com/gwilcock/images";break}switch(a){case 22:b="http://tpc5/clikpic/gwilcock/images";break}switch(a){case 23:b="http://tpc10/clikpic/gwilcock/images";break}switch(a){case 25:b="http://tpc16/clikpic/gwilcock/images";break}switch(a){case 15:b="http://www3.clikpic.com/gwilcock/images";break}switch(a){case 18:b="http://www4.clikpic.com/gwilcock/images";break}switch(a){case 19:b="http://www5.clikpic.com/gwilcock/images";break}switch(a){case 31:b="http://www7.clikpic.com/gwilcock/images";break}switch(a){case 32:b="http://admin2.clikpic.com/gwilcock/images";break}switch(a){case 33:b="http://www8.clikpic.com/gwilcock/images";break}switch(a){case 34:b="http://www9.clikpic.com/gwilcock/images";break}switch(a){case 35:b="http://admin3.clikpic.com/gwilcock/images";break}switch(a){case 37:b="http://admin4.clikpic.com/gwilcock/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="Images by Graham Wilcock: "+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>Photographer: </strong>'+photos[b].photographer+"</p>"}if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Order this print:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 							"+(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="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';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+'<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(c,b){imageID=randomListVal(galleries[c].featured_images);if(imageID!=0){b.src=thumbnails[imageID].src;b.width=thumbnails[imageID].width;b.height=thumbnails[imageID].height;if(b.width<130){var f=$("img#gallery"+c);f.parents(".thumbWrap").width(b.width);var a=f.siblings("h3").size()==1?f.siblings("h3"):f.parent(".thumbWrap").siblings("h3");var g=parseInt(a.css("padding-left"))+parseInt(a.css("padding-right"));var d=parseInt(a.css("border-left-width"))+parseInt(a.css("border-right-width"));var e=parseInt(f.parents(".thumbWrap").css("border-left-width"))+parseInt(f.parents(".thumbWrap").css("border-right-width"));a.width(f.outerWidth(true)-g-d+e)}}}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+'")'})}}};