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[780577]=new thumbnail(780577,"60528","Tofina Beach at dusk","Tofina-Beach1.jpg",130,53,15);thumbnails[780582]=new thumbnail(780582,"60528","Lindesfarne Priory","lindesfarne-Priory1.jpg",130,76,15);thumbnails[780584]=new thumbnail(780584,"60528","Early morning over Mellor","Early-morning-over-Mellor1.jpg",130,98,15);thumbnails[781988]=new thumbnail(781988,"60545","Single Iris study.","iris3.jpg",130,173,15);thumbnails[781989]=new thumbnail(781989,"60545","Beautiful red poppy.","red-poppy1.jpg",130,173,15);thumbnails[781990]=new thumbnail(781990,"60545","White flowers in May.","haque-flowerswhite1.jpg",130,173,15);thumbnails[781993]=new thumbnail(781993,"60545","Early morning rain on yellow flowers","yellow-flowers1.jpg",130,173,15);thumbnails[781999]=new thumbnail(781999,"60634","","bluebells1.jpg",130,84,15);thumbnails[782041]=new thumbnail(782041,"60545","Pink poppy.","pink-poppy1.jpg",130,173,15);thumbnails[788004]=new thumbnail(788004,"60634","Blubells in May","may-bluebells-06-0041.jpg",130,181,15);thumbnails[788005]=new thumbnail(788005,"60545","Foxgloves","foxgloves1.jpg",130,173,15);thumbnails[788006]=new thumbnail(788006,"60634","Bluebells","may-bluebells-06-0261.jpg",130,90,15);thumbnails[788227]=new thumbnail(788227,"60528","Autumn in Brabyns Park","autumn-in-Brabyns-Park1.jpg",130,98,15);thumbnails[788229]=new thumbnail(788229,"60528","Holy Island Photomerge","photomerge-new1.jpg",130,39,15);thumbnails[788236]=new thumbnail(788236,"60528","Tofino Beach","Tofino-Beach1.jpg",130,153,15);thumbnails[802957]=new thumbnail(802957,"60545","Pink Flowers","haque-flowers-0121.jpg",130,173,15);thumbnails[802960]=new thumbnail(802960,"60545","Blue Flowers","haque-flowers-0191.jpg",130,173,15);thumbnails[802961]=new thumbnail(802961,"60545","Close up of fern","home-flowers-0061.jpg",130,180,15);thumbnails[802964]=new thumbnail(802964,"60545","Purple flowers on the ground","purple-flowers-on-ground1.jpg",130,173,15);thumbnails[802965]=new thumbnail(802965,"60545","Single flower","single-white1.jpg",130,135,15);thumbnails[802966]=new thumbnail(802966,"60528","Buttercup meadow","buttercup-meadow1.jpg",130,168,15);thumbnails[802968]=new thumbnail(802968,"60528","Mellor Church Mono","mellor-church-mono1.jpg",130,173,15);thumbnails[802969]=new thumbnail(802969,"60528","Morning Sun on the longest day","morning-sun-july06-0011.jpg",130,173,15);thumbnails[802970]=new thumbnail(802970,"60528","Sunny Corner","sunny-corner-june-0031.jpg",130,98,15);thumbnails[802971]=new thumbnail(802971,"60528","Swan in the sun","swan1.jpg",130,160,15);thumbnails[822533]=new thumbnail(822533,"63754","Pansies - Oil","pansies_oil_small_thumb.jpg",130,165,15);thumbnails[822534]=new thumbnail(822534,"63754","pansies - Soft Pastel","pastel_pansies_small_thumb.jpg",130,91,15);thumbnails[823937]=new thumbnail(823937,"60634","","blubells1.jpg",130,178,15);thumbnails[823947]=new thumbnail(823947,"60634","","bluebells32.jpg",130,163,15);thumbnails[823950]=new thumbnail(823950,"60634","","bluebells42.jpg",130,164,15);thumbnails[823953]=new thumbnail(823953,"60634","","bluebells52.jpg",130,92,15);thumbnails[823954]=new thumbnail(823954,"60634","","bluebells61.jpg",130,102,15);thumbnails[823956]=new thumbnail(823956,"60634","","bluebells-21.jpg",130,90,15);thumbnails[823957]=new thumbnail(823957,"60545","","buxton11.jpg",130,173,15);thumbnails[823962]=new thumbnail(823962,"60545","","buxton21.jpg",130,173,15);thumbnails[823965]=new thumbnail(823965,"60545","","daisies1.jpg",130,173,15);thumbnails[823967]=new thumbnail(823967,"60528","","early-morning-beach1.jpg",130,98,15);thumbnails[823969]=new thumbnail(823969,"60528","","lindesfarne-castle1.jpg",130,173,15);thumbnails[823970]=new thumbnail(823970,"60528","","lindesfarne-castle21.jpg",130,94,15);thumbnails[823971]=new thumbnail(823971,"60545","","pink-poppies3.jpg",130,185,15);thumbnails[823972]=new thumbnail(823972,"60545","","purple-flowers21.jpg",130,167,15);thumbnails[823973]=new thumbnail(823973,"60545","","purple-flowers-in-the-rain1.jpg",130,173,15);thumbnails[823974]=new thumbnail(823974,"60545","","purple-pink-flowers1.jpg",130,173,15);thumbnails[823975]=new thumbnail(823975,"60545","","tulips1.jpg",130,203,15);thumbnails[823976]=new thumbnail(823976,"60528","","wild-garlic1.jpg",130,203,15);thumbnails[823977]=new thumbnail(823977,"60545","","yellow-flower1.jpg",130,179,15);thumbnails[855337]=new thumbnail(855337,"63754","Oil painting - Scottish Highlands","march 2007 0091.jpg",130,89,15);thumbnails[855340]=new thumbnail(855340,"63754","Pastel - Seascape","march 2007 0081.jpg",130,90,15);thumbnails[857985]=new thumbnail(857985,"63754","Pastel - Wheatear","new-bird-pastel1.jpg",130,159,15);thumbnails[925780]=new thumbnail(925780,"63754","Stone Girl Sleeping - Soft Pastel","stone_girl_cropped_thumb.jpg",130,125,15);thumbnails[925782]=new thumbnail(925782,"63754","Diana Monkey - Soft Pastel","diana_monkey_small_thumb.jpg",130,195,15);thumbnails[925812]=new thumbnail(925812,"63754","Bluebell Wood - Soft Pastel","bluebell_wood_small_thumb.jpg",130,107,15);thumbnails[945806]=new thumbnail(945806,"63754","Down the Lane - Soft Pastel","down_the_lane_small_thumb.jpg",130,87,15);thumbnails[945807]=new thumbnail(945807,"63754","Iris Pathway - Oil","iris_oil_small_thumb.jpg",130,195,15);thumbnails[5240471]=new thumbnail(5240471,"63754","","wildflower_meadow_small_thumb.jpg",130,97,15);thumbnails[5240474]=new thumbnail(5240474,"63754","","oil_small_file_thumb.jpg",130,130,15);thumbnails[5244113]=new thumbnail(5244113,"295528","","autumn_small_file_thumb.jpg",130,214,15);thumbnails[5244116]=new thumbnail(5244116,"295528","","brabyns_small_file1_thumb.jpg",130,98,15);thumbnails[5244121]=new thumbnail(5244121,"295528","","frosty_brabyns_small_file_thumb.jpg",130,87,15);thumbnails[5244123]=new thumbnail(5244123,"295528","","iron_bridge_small_file_thumb.jpg",130,86,15);thumbnails[5244137]=new thumbnail(5244137,"295527","","chris_guitar_small_file_thumb.jpg",130,95,15);thumbnails[5244139]=new thumbnail(5244139,"295527","","guitar_small_file_thumb.jpg",130,142,15);thumbnails[5244141]=new thumbnail(5244141,"295527","","guitarist_small_file_thumb.jpg",130,177,15);thumbnails[5244143]=new thumbnail(5244143,"295527","","party_time2_small_file_thumb.jpg",130,87,15);thumbnails[5244145]=new thumbnail(5244145,"295527","","party_time_small_file_thumb.jpg",130,92,15);thumbnails[5244149]=new thumbnail(5244149,"295527","","singer_small_file2_thumb.jpg",130,182,15);thumbnails[5244227]=new thumbnail(5244227,"295532","","3_trees_brabyns_small1_thumb.jpg",130,195,15);thumbnails[5244230]=new thumbnail(5244230,"295532","","cropped_A4_3_trees_small1_thumb.jpg",130,87,15);thumbnails[5244233]=new thumbnail(5244233,"295532","","foggy_brabyns2_small1_thumb.jpg",130,109,15);thumbnails[5244235]=new thumbnail(5244235,"295532","","foggy_brabyns_small_thumb.jpg",130,133,15);thumbnails[5244236]=new thumbnail(5244236,"295532","","foggy_rabyns4_small_thumb.jpg",130,107,15);thumbnails[5244238]=new thumbnail(5244238,"295532","","tree_a4_crop_small_thumb.jpg",130,143,15);thumbnails[5999707]=new thumbnail(5999707,"63754","","blue_flowers_small_thumb.jpg",130,161,15);thumbnails[5999708]=new thumbnail(5999708,"63754","","stonegoddesssmall_thumb.jpg",130,93,15);thumbnails[5999730]=new thumbnail(5999730,"63754","","oil_pastel_sunset_thumb.jpg",130,121,15);thumbnails[5999784]=new thumbnail(5999784,"63754","","iron_bridge_small_thumb.jpg",130,100,15);thumbnails[780563]=new thumbnail(780563,"60528","Early morning on Lindesfarne","holy-island-21.jpg",130,98,15);thumbnails[780595]=new thumbnail(780595,"60533","Ali eating chocolate ice cream","ali-eating-ice-cream1.jpg",130,189,15);thumbnails[780601]=new thumbnail(780601,"60533","Girls just want to have fun","barby-and-friends1.jpg",130,96,15);thumbnails[780687]=new thumbnail(780687,"60533","Bubble Bath","bubble-bath1.jpg",130,136,15);thumbnails[780704]=new thumbnail(780704,"60533","Swinging Time","swinging-time12.jpg",130,145,15);thumbnails[780719]=new thumbnail(780719,"60543","Stained Glass at Mellor Church","stained-glass1.jpg",130,51,15);thumbnails[780727]=new thumbnail(780727,"60543","Bottom Lodge at Ethrow","Bottom-Lodge1.jpg",130,173,15);thumbnails[780728]=new thumbnail(780728,"60543","Iris","iris1.jpg",130,210,15);thumbnails[780730]=new thumbnail(780730,"60543","Pink poppy at Arley Hall","pink-poppies1.jpg",130,185,15);thumbnails[780731]=new thumbnail(780731,"60543","Iron Bridge in Brabyns Park","roman-bridge1.jpg",130,99,15);thumbnails[780732]=new thumbnail(780732,"60543","","swans1.jpg",130,126,15);thumbnails[780735]=new thumbnail(780735,"60543","Yellow Pansies","yellow-poppies1.jpg",130,116,15);thumbnails[783967]=new thumbnail(783967,"60533","Lucy Jane","lucy-and-dave-wedding-0141.jpg",130,178,15);thumbnails[5999791]=new thumbnail(5999791,"60533","","cheeky_pair_small_thumb.jpg",130,96,15);var galleries=new Object();galleries[295528]=new gallery(295528,"5244123,5244121,5244116,5244113","Autumn shots","gallery",[5244113,5244116,5244121,5244123]);galleries[60634]=new gallery(60634,"823956,823954,823953,823950,823947,823937,788006,788004,781999","Blubell Wood Photography","gallery",[781999,788004,788006,823937,823947,823950,823953,823954,823956]);galleries[60545]=new gallery(60545,"823977,823975,823974,823973,823972,823971,823965,823962,823957,802965","flowers","gallery",[781988,781989,781990,781993,782041,788005,802957,802960,802961,802964,802965,823957,823962,823965,823971,823972,823973,823974,823975,823977]);galleries[295532]=new gallery(295532,"5244238,5244236,5244235,5244233,5244230,5244227","Foggy Day in Brabyns Park","gallery",[5244227,5244230,5244233,5244235,5244236,5244238]);galleries[295527]=new gallery(295527,"5244149,5244145,5244143,5244141,5244139,5244137","Gigs & Bands","gallery",[5244137,5244139,5244141,5244143,5244145,5244149]);galleries[60528]=new gallery(60528,"823976,823970,823969,823967,802971,802970,802969,802968,802966,788236","Lancscape Photography","gallery",[780577,780582,780584,788227,788229,788236,802966,802968,802969,802970,802971,823967,823969,823970,823976,780563]);galleries[63754]=new gallery(63754,"5999784,5999730,5999708,5999707,5240474,5240471,945807,945806,925812,925782","Paintings","gallery",[822533,822534,855337,855340,857985,925780,925782,925812,945806,945807,5240471,5240474,5999707,5999708,5999730,5999784]);galleries[60543]=new gallery(60543,"780735,780732,780731,780730,780728,780727,780719","digital photo art","gallery",[780719,780727,780728,780730,780731,780732,780735]);galleries[60533]=new gallery(60533,"5999791,783967,780704,780687,780601,780595","People","gallery",[780595,780601,780687,780704,783967,5999791]);var imageSets=new Object();imageSets[1]="780563";imageSets[3]="925780";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/paulpigram/images";break}switch(a){case 1:b="http://www1.clikpic.com/paulpigram/images";break}switch(a){case 2:b="http://admin.clikpic.com/paulpigram/images";break}switch(a){case 24:b="http://tpc15/clikpic/paulpigram/images";break}switch(a){case 4:b="http://www.clikchurch.com/paulpigram/images";break}switch(a){case 5:b="http://www2.clikpic.com/paulpigram/images";break}switch(a){case 22:b="http://tpc5/clikpic/paulpigram/images";break}switch(a){case 23:b="http://tpc10/clikpic/paulpigram/images";break}switch(a){case 25:b="http://tpc16/clikpic/paulpigram/images";break}switch(a){case 15:b="http://www3.clikpic.com/paulpigram/images";break}switch(a){case 18:b="http://www4.clikpic.com/paulpigram/images";break}switch(a){case 19:b="http://www5.clikpic.com/paulpigram/images";break}switch(a){case 31:b="http://www7.clikpic.com/paulpigram/images";break}switch(a){case 32:b="http://admin2.clikpic.com/paulpigram/images";break}switch(a){case 33:b="http://www8.clikpic.com/paulpigram/images";break}switch(a){case 34:b="http://www9.clikpic.com/paulpigram/images";break}switch(a){case 35:b="http://admin3.clikpic.com/paulpigram/images";break}switch(a){case 37:b="http://admin4.clikpic.com/paulpigram/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="paulpigram.co.uk: "+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+'")'})}}};
