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[875757]=new thumbnail(875757,"","","karen2_thumb.jpg",130,104,15);thumbnails[875652]=new thumbnail(875652,"66324","Bathing Beauty - Close up","BathingBeauty_thumb.jpg",98,130,15);thumbnails[875665]=new thumbnail(875665,"66324","Bathing Beauty","BathingBeauty1_thumb.jpg",104,130,15);thumbnails[875668]=new thumbnail(875668,"66324","Watching Waves","WatchingWaves1_thumb.jpg",98,130,15);thumbnails[908894]=new thumbnail(908894,"66324","Love Letter","LoveLetter_thumb.jpg",130,98,15);thumbnails[908897]=new thumbnail(908897,"66324","Keeper of the Keys - Front View","keeper1_thumb.jpg",98,130,15);thumbnails[908902]=new thumbnail(908902,"66324","Keeper of the Keys - Back View","Keeper_thumb.jpg",98,130,15);thumbnails[908910]=new thumbnail(908910,"66324","Mirror Mirror","Mirror_thumb.jpg",98,130,15);thumbnails[908980]=new thumbnail(908980,"66324","Watching Waves - Close up","WatchingWaves2_thumb.jpg",130,98,15);thumbnails[914233]=new thumbnail(914233,"66324","First Harvest","Harvest_thumb.jpg",130,98,15);thumbnails[2120105]=new thumbnail(2120105,"66324","Rehearsal 1","Rehearsal1-Front_thumb.jpg",98,130,15);thumbnails[2120108]=new thumbnail(2120108,"66324","Rehearsal 1","Rehearsal1-Back_thumb.jpg",98,130,15);thumbnails[2120115]=new thumbnail(2120115,"66324","Rehearsal 2","Rehearsal2-Front_thumb.jpg",98,130,15);thumbnails[2120116]=new thumbnail(2120116,"66324","Rehearsal 2","Rehearsal2-Back_thumb.jpg",98,130,15);thumbnails[2120045]=new thumbnail(2120045,"69331","Beach Ball","BeachBall_thumb.jpg",130,98,15);thumbnails[2120102]=new thumbnail(2120102,"69331","Girl Talk","GirlTalk_1_thumb.jpg",130,98,15);thumbnails[5724576]=new thumbnail(5724576,"69331","Daisy Doo","Karens_Pics_048_-1_thumb.jpg",130,98,15);thumbnails[5724596]=new thumbnail(5724596,"69331","Daisy Doo","Karens_Pics_050_-1_thumb.jpg",130,98,15);thumbnails[5724603]=new thumbnail(5724603,"69331","Secret Thought","Karens_Pics_046_-1_thumb.jpg",98,130,15);thumbnails[908738]=new thumbnail(908738,"69331","Secret Dreams - SOLD OUT","SecretDreams_thumb.jpg",130,98,15);thumbnails[908807]=new thumbnail(908807,"69331","Friday Bridge - SOLD OUT","FridayBridge_thumb.jpg",98,130,15);thumbnails[914201]=new thumbnail(914201,"69331","Dressing up","DressingUp1_thumb.jpg",98,130,15);thumbnails[914212]=new thumbnail(914212,"69331","Dressing up","DressingUp2_thumb.jpg",98,130,15);thumbnails[914217]=new thumbnail(914217,"69331","Girl Talk","GirlTalk_thumb.jpg",130,98,15);thumbnails[914226]=new thumbnail(914226,"69331","Girl Talk - Close up","GirlTalk2_thumb.jpg",130,98,15);thumbnails[908821]=new thumbnail(908821,"69331","Best Friend","BestFriend_thumb.jpg",98,130,15);thumbnails[908858]=new thumbnail(908858,"69331","Butterfly Summer","ButterflySummer_thumb.jpg",130,98,15);thumbnails[908826]=new thumbnail(908826,"69331","May - Front View","MayBack_thumb.jpg",130,98,15);thumbnails[908832]=new thumbnail(908832,"69331","May - Back View","MayFront1_thumb.jpg",130,98,15);thumbnails[908933]=new thumbnail(908933,"69356","In Anticipation - Wall Piece","Anticipation_thumb.jpg",98,130,15);thumbnails[914412]=new thumbnail(914412,"69356","Awakening - Front","Awakening1_thumb.jpg",98,130,15);thumbnails[5724635]=new thumbnail(5724635,"69356","I Saw Three Ships","Karens_Pics_054_-1_thumb.jpg",130,98,15);thumbnails[5724637]=new thumbnail(5724637,"69356","I Saw Three Ships","Karens_Pics_055_-1_thumb.jpg",130,98,15);thumbnails[5724659]=new thumbnail(5724659,"69356","Three Sopranos","Karens_Pics_041_-1_thumb.jpg",130,98,15);thumbnails[5724765]=new thumbnail(5724765,"69356","Movement in Moonlight","Karens_Pics_058_-1_thumb.jpg",130,98,15);thumbnails[5724794]=new thumbnail(5724794,"69356","Movement in Moonlight","Karens_Pics_059_-1_thumb.jpg",130,98,15);thumbnails[5724801]=new thumbnail(5724801,"69356","Movement in Moonlight","Karens_Pics_060_-1_thumb.jpg",130,98,15);thumbnails[5724844]=new thumbnail(5724844,"69356","Movement in Moonlight","Karens_Pics_062_-1_thumb.jpg",130,98,15);thumbnails[5724854]=new thumbnail(5724854,"69356","Movement in Moonlight","Karens_Pics_063_-1_thumb.jpg",130,98,15);thumbnails[5724864]=new thumbnail(5724864,"69356","Movement in Moonlight","Karens_Pics_064_-1_thumb.jpg",130,98,15);thumbnails[909074]=new thumbnail(909074,"69380","Seeing Me Seeing You","Head_thumb.jpg",130,104,15);thumbnails[914255]=new thumbnail(914255,"69380","Seeing Me Seeing You","Face2_thumb.jpg",98,130,15);thumbnails[908998]=new thumbnail(908998,"69367","","Comm1_thumb.jpg",98,130,15);thumbnails[909000]=new thumbnail(909000,"69367","","Comm2_thumb.jpg",98,130,15);thumbnails[909002]=new thumbnail(909002,"69367","","Comm3_thumb.jpg",98,130,15);thumbnails[909005]=new thumbnail(909005,"69367","","Comm4_thumb.jpg",130,104,15);thumbnails[909009]=new thumbnail(909009,"69367","","Comm5_thumb.jpg",98,130,15);thumbnails[909060]=new thumbnail(909060,"69367","","Comm6_thumb.jpg",97,130,15);thumbnails[909061]=new thumbnail(909061,"69367","","Comm7_thumb.jpg",130,104,15);thumbnails[909068]=new thumbnail(909068,"69367","","Comm11_thumb.jpg",130,98,15);thumbnails[909069]=new thumbnail(909069,"69367","","Comm8_thumb.jpg",130,98,15);thumbnails[914192]=new thumbnail(914192,"69367","","Comm12_thumb.jpg",98,130,15);thumbnails[914337]=new thumbnail(914337,"69367","","mums sculptures 192_thumb.jpg",98,130,15);thumbnails[914338]=new thumbnail(914338,"69367","","mums sculptures 193_thumb.jpg",118,130,15);thumbnails[914421]=new thumbnail(914421,"69635","Sculpting in clay 'Love Letter'","studio2_thumb.jpg",130,98,15);thumbnails[914424]=new thumbnail(914424,"69635","Silicon moulding","stuio1_thumb.jpg",130,98,15);thumbnails[5724435]=new thumbnail(5724435,"69635","","Karens_Pics_019_-1_thumb.jpg",98,130,15);thumbnails[5724437]=new thumbnail(5724437,"69635","","Karens_Pics_021-1_thumb.jpg",98,130,15);thumbnails[5724440]=new thumbnail(5724440,"69635","","Karens_Pics_022_-1_thumb.jpg",98,130,15);thumbnails[5724325]=new thumbnail(5724325,"314803","Pure Delight","Karens_Norfolk_2_thumb.jpg",98,130,15);thumbnails[5724367]=new thumbnail(5724367,"314803","Pure Delight","Karens_Pics_025_-1_thumb.jpg",98,130,15);thumbnails[5724387]=new thumbnail(5724387,"314803","Nude","Karens_Pics_069_-1_thumb.jpg",98,130,15);thumbnails[5724391]=new thumbnail(5724391,"314803","Nude","Karens_Pics_066_-1_thumb.jpg",98,130,15);thumbnails[5724394]=new thumbnail(5724394,"314803","Nude","Karens_Pics_065_-1_thumb.jpg",98,130,15);thumbnails[5724404]=new thumbnail(5724404,"314803","Spa Day","Karens_Pics_072_-1_thumb.jpg",130,98,15);thumbnails[5725106]=new thumbnail(5725106,"314804","Alex Smith","Alex_Smith_1_thumb.jpg",87,130,15);thumbnails[5725130]=new thumbnail(5725130,"314804","Jack Stew","Jack_Stew_thumb.jpg",130,109,15);thumbnails[5725135]=new thumbnail(5725135,"314804","Russell Charlie Dean","Russell_thumb.JPG",130,98,15);thumbnails[5725145]=new thumbnail(5725145,"314804","Tania Corbett","Tania_-_White_Water_thumb.JPG",130,80,15);thumbnails[5725173]=new thumbnail(5725173,"314804","Rebecca Saunders","Karens_Pics_005_-1_thumb.jpg",130,98,15);var galleries=new Object();galleries[66324]=new gallery(66324,"2120115,875665","Figurative Sculptures","gallery",[875652,875665,875668,908894,908897,908902,908910,908980,914233,2120105,2120108,2120115,2120116]);galleries[69331]=new gallery(69331,"2120045,908738","Small Sculptures","gallery",[2120045,2120102,5724576,5724596,5724603,908738,908807,914201,914212,914217,914226,908821,908858,908826,908832]);galleries[69356]=new gallery(69356,"908933","Wall Sculptures","gallery",[908933,914412,5724635,5724637,5724659,5724765,5724794,5724801,5724844,5724854,5724864]);galleries[69380]=new gallery(69380,"909074","Garden Sculptures","gallery",[909074,914255]);galleries[69367]=new gallery(69367,"908998","Commissions","gallery",[908998,909000,909002,909005,909009,909060,909061,909068,909069,914192,914337,914338]);galleries[69635]=new gallery(69635,"914421","In the Studio","gallery",[914421,914424,5724435,5724437,5724440]);galleries[314803]=new gallery(314803,"5724404,5724394,5724391,5724387,5724367,5724325","Work in Progress","gallery",[5724325,5724367,5724387,5724391,5724394,5724404]);galleries[314804]=new gallery(314804,"5725173,5725145,5725135,5725130,5725106","Guest Artists","gallery",[5725106,5725130,5725135,5725145,5725173]);var imageSets=new Object();imageSets[1]="875757";imageSets[2]="2120115,2120045,914421,909074,908998,908933,908738,875665";imageSets[3]="5725173,5725145,5725135,5725130,5725106,5724864,5724854,5724844,5724801,5724794,5724765,5724659,5724637,5724635,5724603,5724596,5724576,5724440,5724437,5724435,5724404,5724394,5724391,5724387,5724367,5724325,2120116,2120115,2120108,2120105,2120102,2120045,914424,914421,914412,914338,914337,914255,914233,914226,914217,914212,914201,914192,909074,909069,909068,909061,909060,909009";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/karennorfolk/images";break}switch(a){case 1:b="http://www1.clikpic.com/karennorfolk/images";break}switch(a){case 2:b="http://admin.clikpic.com/karennorfolk/images";break}switch(a){case 24:b="http://tpc15/clikpic/karennorfolk/images";break}switch(a){case 4:b="http://www.clikchurch.com/karennorfolk/images";break}switch(a){case 5:b="http://www2.clikpic.com/karennorfolk/images";break}switch(a){case 22:b="http://tpc5/clikpic/karennorfolk/images";break}switch(a){case 23:b="http://tpc10/clikpic/karennorfolk/images";break}switch(a){case 25:b="http://tpc16/clikpic/karennorfolk/images";break}switch(a){case 15:b="http://www3.clikpic.com/karennorfolk/images";break}switch(a){case 18:b="http://www4.clikpic.com/karennorfolk/images";break}switch(a){case 19:b="http://www5.clikpic.com/karennorfolk/images";break}switch(a){case 31:b="http://www7.clikpic.com/karennorfolk/images";break}switch(a){case 32:b="http://admin2.clikpic.com/karennorfolk/images";break}switch(a){case 33:b="http://www8.clikpic.com/karennorfolk/images";break}switch(a){case 34:b="http://www9.clikpic.com/karennorfolk/images";break}switch(a){case 35:b="http://admin3.clikpic.com/karennorfolk/images";break}switch(a){case 37:b="http://admin4.clikpic.com/karennorfolk/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="<em>Karen Norfolk Sculpture</em>: "+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+'")'})}}};
