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[5413984]=new thumbnail(5413984,"305923","Circles","Leica_M8_L1005598_091205_thumb.jpg",130,87,15);thumbnails[5414010]=new thumbnail(5414010,"305923","Lancashire","Leica_M8_L1000838_20012009_thumb.jpg",130,91,15);thumbnails[5414275]=new thumbnail(5414275,"305923","","Leica_M8-Digital-Camer_thumb.jpg",130,87,15);thumbnails[5414276]=new thumbnail(5414276,"305923","Rochdale Canal","Leica_M8-Digital-Camera_L10_thumb.jpg",130,87,15);thumbnails[5414011]=new thumbnail(5414011,"305923","Kilkeel","Leica_M8_L1005375_091114_thumb.jpg",130,95,15);thumbnails[2190130]=new thumbnail(2190130,"14832","Rus in Urbe","Bronica_ETRS_110508_1456_thumb.jpg",130,100,15);thumbnails[2190139]=new thumbnail(2190139,"14832","Chetham's Library Manchester","Leica_MP_280408_1320_thumb.jpg",130,85,15);thumbnails[2190150]=new thumbnail(2190150,"14832","Landscape with Anglers and Gardener","Toyo_45A_050508_1422_thumb.jpg",130,102,15);thumbnails[2190152]=new thumbnail(2190152,"14832","Morning Coffee - France","Rolleiflex_28P_200208_0838_thumb.jpg",130,134,15);thumbnails[2190168]=new thumbnail(2190168,"14832","Waterloo","Rolleiflex_35P_220208_0883_thumb.jpg",130,134,15);thumbnails[2192815]=new thumbnail(2192815,"14832","Vestry Heptonstall","Leica_MP_220408_1307_thumb.jpg",130,197,15);thumbnails[3730252]=new thumbnail(3730252,"14832","Hass 503cx 0096","Hass_503cx_0096_thumb.jpg",130,131,15);thumbnails[2190140]=new thumbnail(2190140,"14832","Heptonstall","Mamiya_7_050408_1168_thumb.jpg",130,107,15);thumbnails[2190145]=new thumbnail(2190145,"14832","Flag","Rolleiflex_28P_080508_1437_thumb.jpg",130,132,15);thumbnails[2190151]=new thumbnail(2190151,"14832","Dim discovered spires","Toyo_45A_070508_1432_thumb.jpg",130,103,15);thumbnails[2190153]=new thumbnail(2190153,"14832","Afternoon  - France","Rolleiflex_28P_200208_0841_thumb.jpg",130,133,15);thumbnails[2190169]=new thumbnail(2190169,"14832","Pimlico","Rolleiflex_35X_110208_0798_thumb.jpg",130,131,15);thumbnails[2192816]=new thumbnail(2192816,"14832","Chetham's Library Manchester","Leica_MP_280408_13201_thumb.jpg",130,85,15);thumbnails[2190146]=new thumbnail(2190146,"14832","Gorse","Rolleiflex_28P_080508_1446_thumb.jpg",130,130,15);thumbnails[2190170]=new thumbnail(2190170,"14832","Pimlico","Rolleiflex_35X_110208_0799_thumb.jpg",130,131,15);thumbnails[2190133]=new thumbnail(2190133,"14832","Chethams Library Manchester","Leica_MP_280408_1318_thumb.jpg",130,201,15);thumbnails[2190147]=new thumbnail(2190147,"14832","The Dark Tower","Rolleiflex_28P_080508_1451_1_thumb.jpg",130,130,15);thumbnails[2190155]=new thumbnail(2190155,"14832","Haworth","Rolleiflex_35P_160308_1026_thumb.jpg",130,128,15);thumbnails[2190159]=new thumbnail(2190159,"14832","Cigars","Rolleiflex_35X_070208_0767_thumb.jpg",130,131,15);thumbnails[3730255]=new thumbnail(3730255,"14832","Rollei 28FP 0138","Rollei_28FP_0138_thumb.jpg",130,128,15);thumbnails[2190148]=new thumbnail(2190148,"14832","Heat","Rolleiflex_28P_090508_1453_thumb.jpg",130,132,15);thumbnails[269576]=new thumbnail(269576,"119314","Browsers","London_NEG_R-D1_2006-05-23_EPSN0199_thumb1.jpg",130,86,15);thumbnails[1774917]=new thumbnail(1774917,"119314","British Museum","Rolleiflex_180108_0300_thumb.jpg",130,132,15);thumbnails[1774925]=new thumbnail(1774925,"119314","British Museum","Rolleiflex_180108_0299_thumb.jpg",130,130,15);thumbnails[2190394]=new thumbnail(2190394,"119314","Baron Campden and his wife sleeping their last sleep","Leica_MP_010508_1395_thumb.jpg",130,85,15);thumbnails[2246468]=new thumbnail(2246468,"119314","Little Gidding","Bronica_ETRS_170508_1494_thumb.jpg",130,161,15);thumbnails[2190144]=new thumbnail(2190144,"119314","Library Afternoon","Minolta_-Autocord_170508_1479_thumb.jpg",130,128,15);thumbnails[3730253]=new thumbnail(3730253,"119314","Nikon 00050 060209","Nikon_00050_060209_thumb.jpg",130,86,15);thumbnails[2190114]=new thumbnail(2190114,"119314","Chetham's Library Manchester","Leica_MP_060408_1191-1_thumb.jpg",130,196,15);thumbnails[316839]=new thumbnail(316839,"23993","Paris","Paris_NEG_R-D1_2006-06-22__EPS0786_thumb.jpg",130,196,15);thumbnails[316840]=new thumbnail(316840,"23993","Paris","Paris_NEG_R-D1_2006-06-20__EPS0680_thumb.jpg",130,101,15);thumbnails[316859]=new thumbnail(316859,"23993","Paris","Paris2_NEG_R-D1_2006-06-22__EPS0746_1_thumb.jpg",130,86,15);thumbnails[487316]=new thumbnail(487316,"23993","Shakespeare & Co Paris","Paris Leica0003 - Desaturate_thumb.jpg",130,86,15);thumbnails[487325]=new thumbnail(487325,"23993","Shakespeare & Co Paris","Paris Leica0002_thumb.jpg",130,86,15);thumbnails[487328]=new thumbnail(487328,"23993","Browsing","Paris Left bank 2 Leica_thumb.jpg",130,88,15);thumbnails[487336]=new thumbnail(487336,"23993","Shakespeare & Co Paris","Paris Shakespeare Leica_thumb.jpg",130,86,15);thumbnails[487340]=new thumbnail(487340,"23993","Rive Gauche","Paris_Leica_thumb.jpg",130,87,15);thumbnails[1216685]=new thumbnail(1216685,"23993","","Bronica_16072007_0293_thumb.jpg",130,99,15);thumbnails[2648846]=new thumbnail(2648846,"23993","","Minolta_26062007_0157_thumb.jpg",130,130,15);thumbnails[987642]=new thumbnail(987642,"23993","Bates Gentleman's Hatters - Jermyn street","Bates_M8 Digital Camera_L1000792_16_Jan_07-001_thumb.jpg",130,87,15);thumbnails[1759090]=new thumbnail(1759090,"23993","Mr Whippy","Scan_00482_thumb.jpg",130,198,15);thumbnails[269573]=new thumbnail(269573,"23993","Rain - British Museum","London_NEG_R-D1_2006-05-23_EPSN0184_thumb.jpg",130,195,15);thumbnails[271756]=new thumbnail(271756,"23993","Readers","Train_NEG_R-D1_2006-05-27_EPSN0171_thumb.jpg",130,86,15);thumbnails[2190141]=new thumbnail(2190141,"23993","Pere Lachaise","Mamiya_C330_010208_0538_thumb.jpg",130,130,15);thumbnails[3730254]=new thumbnail(3730254,"23993","Budapest","Rollei_28FP_0113_thumb.jpg",130,132,15);thumbnails[2190171]=new thumbnail(2190171,"23993","Executive Lounge Ennui","Rolleiflex_T_120408_1264_thumb.jpg",130,129,15);thumbnails[987646]=new thumbnail(987646,"23993","The Origin of the World - Musée de Louvre Paris","M8 Digital Camera_L1000687_11_Jan_07-001_thumb.jpg",130,87,15);thumbnails[2190160]=new thumbnail(2190160,"23993","Bates Hats - Jermyn Street London","Rolleiflex_35X_070208_0776_thumb.jpg",130,129,15);thumbnails[3730256]=new thumbnail(3730256,"23993","Budapest","Rollei_28FP_03312009-4_thumb.jpg",130,133,15);var galleries=new Object();galleries[305923]=new gallery(305923,"5414276,5414275,5414011,5414010,5413984","COLOUR GALLERY","gallery",[5413984,5414010,5414275,5414276,5414011]);galleries[14832]=new gallery(14832,"2192816,2192815,2190170,2190169,2190159,2190155,2190153,2190152,2190151,2190150,2190148,2190147,2190145,2190140,2190133,2190130","<b>PLACES</b>","gallery",[2190130,2190139,2190150,2190152,2190168,2192815,3730252,2190140,2190145,2190151,2190153,2190169,2192816,2190146,2190170,2190133,2190147,2190155,2190159,3730255,2190148]);galleries[119314]=new gallery(119314,"2190144,2190114,1774917,269576","<b>CONTEMPLATION<b/>","gallery",[269576,1774917,1774925,2190394,2246468,2190144,3730253,2190114]);galleries[23993]=new gallery(23993,"2190171,2190160,487316","<b>PEOPLE<b/>","gallery",[316839,316840,316859,487316,487325,487328,487336,487340,1216685,2648846,987642,1759090,269573,271756,2190141,3730254,2190171,987646,2190160,3730256]);var imageSets=new Object();imageSets[1]="2192816,2192815,2190170,2190169,2190160,2190159,2190155,2190153,2190152,2190151,2190150,2190148,2190147,2190145,2190144,2190140,2190133,2190114,1774925,1774917,487316,269576";imageSets[2]="2192816,2192815,2190171,2190170,2190169,2190160,2190159,2190155,2190153,2190152,2190151,2190150,2190148,2190147,2190145,2190144,2190140,2190133,2190130,2190114,1774917,487316,269576";imageSets[3]="5414276,5414275,5414011,5414010,5413984,3730256,3730255,3730254,3730253,3730252,2648846,2246468,2192816,2192815,2190394,2190171,2190170,2190169,2190168,2190160,2190159,2190155,2190153,2190152,2190151,2190150,2190148,2190147,2190146,2190145,2190144,2190141,2190140,2190139,2190133,2190130,2190114,1774925,1774917,1759090,1216685,987646,987642,487340,487336,487328,487325,487316,316859,316840";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 34:b="http://www9.clikpic.com/keithcocker/images";break}switch(a){case 1:b="http://www1.clikpic.com/keithcocker/images";break}switch(a){case 2:b="http://admin.clikpic.com/keithcocker/images";break}switch(a){case 4:b="http://www.clikchurch.com/keithcocker/images";break}switch(a){case 5:b="http://www2.clikpic.com/keithcocker/images";break}switch(a){case 15:b="http://www3.clikpic.com/keithcocker/images";break}switch(a){case 21:b="http://www6.clikpic.com/keithcocker/images";break}switch(a){case 18:b="http://www4.clikpic.com/keithcocker/images";break}switch(a){case 19:b="http://www5.clikpic.com/keithcocker/images";break}switch(a){case 22:b="http://tpc5/clikpic/keithcocker/images";break}switch(a){case 23:b="http://tpc10/clikpic/keithcocker/images";break}switch(a){case 24:b="http://tpc15/clikpic/keithcocker/images";break}switch(a){case 25:b="http://tpc16/clikpic/keithcocker/images";break}switch(a){case 31:b="http://www7.clikpic.com/keithcocker/images";break}switch(a){case 32:b="http://admin2.clikpic.com/keithcocker/images";break}switch(a){case 33:b="http://www8.clikpic.com/keithcocker/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="<b><i>Sharpsight - Photography by Keith Cocker: "+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;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+'")'})}}};