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[2098970]=new thumbnail(2098970,"139607","","Abyss1_thumb.jpg",130,93,32);thumbnails[2098976]=new thumbnail(2098976,"139607","","Blue-i_thumb.jpg",130,93,32);thumbnails[2098984]=new thumbnail(2098984,"139607","","Crowning-glory2_thumb.jpg",130,93,32);thumbnails[2098998]=new thumbnail(2098998,"139607","","Onfire_thumb.jpg",130,93,32);thumbnails[2099003]=new thumbnail(2099003,"139607","","Milk2_thumb.jpg",130,93,32);thumbnails[2099005]=new thumbnail(2099005,"139607","","Purplelava_thumb.jpg",130,93,32);thumbnails[2099006]=new thumbnail(2099006,"139607","","RWB_splash_thumb.jpg",130,93,32);thumbnails[2099067]=new thumbnail(2099067,"139607","","Purplejelly_thumb.jpg",130,93,32);thumbnails[2099068]=new thumbnail(2099068,"139607","","Milk1_thumb.jpg",130,93,32);thumbnails[2227803]=new thumbnail(2227803,"139612","","Falcons1-800x600_thumb.jpg",130,182,32);thumbnails[2227805]=new thumbnail(2227805,"139612","","Mustang1-800x600_thumb.jpg",130,93,32);thumbnails[2227806]=new thumbnail(2227806,"139612","","Red-Arrows1-800x600_thumb.jpg",130,87,32);thumbnails[2227807]=new thumbnail(2227807,"139612","","Red-Arrows-Cross-800x600_thumb.jpg",130,93,32);thumbnails[2158546]=new thumbnail(2158546,"139612","","IMG_6199_thumb.jpg",130,93,32);thumbnails[2158547]=new thumbnail(2158547,"139612","","IMG_6220_thumb.jpg",130,93,32);thumbnails[2158548]=new thumbnail(2158548,"139612","","IMG_6228_thumb.jpg",130,93,32);thumbnails[2158549]=new thumbnail(2158549,"139612","","IMG_6334_thumb.jpg",130,93,32);thumbnails[2158550]=new thumbnail(2158550,"139612","","IMG_6358_thumb.jpg",130,93,32);thumbnails[2158552]=new thumbnail(2158552,"139612","","IMG_6442_thumb.jpg",130,104,32);thumbnails[2158553]=new thumbnail(2158553,"139612","","IMG_6470_thumb.jpg",130,93,32);thumbnails[2093541]=new thumbnail(2093541,"139612","","IMG_5605edit_thumb.jpg",130,87,32);thumbnails[2093545]=new thumbnail(2093545,"139612","","IMG_5681edit_thumb.jpg",130,94,32);thumbnails[2099110]=new thumbnail(2099110,"139612","","IMG_5603_thumb.jpg",130,87,32);thumbnails[2099112]=new thumbnail(2099112,"139612","","IMG_5630_thumb.jpg",130,93,32);thumbnails[2099113]=new thumbnail(2099113,"139612","","IMG_5656_thumb.jpg",130,93,32);thumbnails[2098981]=new thumbnail(2098981,"139616","","Chess3D_thumb.jpg",130,113,32);thumbnails[2098992]=new thumbnail(2098992,"139616","","frog3D_thumb.jpg",130,98,32);thumbnails[2098997]=new thumbnail(2098997,"139616","","Leaking3_thumb.jpg",130,182,32);thumbnails[2099002]=new thumbnail(2099002,"139616","","MotoGP3D_thumb.jpg",130,95,32);thumbnails[2099022]=new thumbnail(2099022,"139616","","rose3D_thumb.jpg",130,87,32);thumbnails[2099024]=new thumbnail(2099024,"139616","","Jake-and-Casey-800x600_thumb.jpg",130,195,32);thumbnails[2134190]=new thumbnail(2134190,"139617","","IMG_6106_thumb.jpg",130,87,32);thumbnails[2134196]=new thumbnail(2134196,"139617","","IMG_6107_thumb.jpg",130,195,32);thumbnails[2098974]=new thumbnail(2098974,"139617","","Appleslpash_thumb.jpg",130,93,32);thumbnails[2099114]=new thumbnail(2099114,"139617","","IMG_5700_thumb.jpg",130,195,32);thumbnails[2508643]=new thumbnail(2508643,"139617","","Bug1_thumb.jpg",130,87,32);thumbnails[2508647]=new thumbnail(2508647,"139617","","Bug2_thumb.jpg",130,87,32);thumbnails[2227802]=new thumbnail(2227802,"139618","","2-Yachts-800x600_thumb.jpg",130,182,32);thumbnails[2134161]=new thumbnail(2134161,"139618","","IMG_6101_thumb.jpg",130,182,32);thumbnails[2134167]=new thumbnail(2134167,"139618","","IMG_6109_thumb.jpg",130,195,32);thumbnails[2134174]=new thumbnail(2134174,"139618","","IMG_6130_thumb.jpg",130,87,32);thumbnails[2134178]=new thumbnail(2134178,"139618","","IMG_6149_thumb.jpg",130,87,32);thumbnails[2093540]=new thumbnail(2093540,"139618","A walk in the park","ab_park3_thumb.jpg",130,87,32);thumbnails[2098963]=new thumbnail(2098963,"139618","","0017_thumb.jpg",130,87,32);thumbnails[2098964]=new thumbnail(2098964,"139618","","0019_thumb.jpg",130,195,32);thumbnails[2098993]=new thumbnail(2098993,"139618","","IMG_5903_thumb.jpg",130,93,32);thumbnails[2099109]=new thumbnail(2099109,"139618","","IMG_5584_thumb.jpg",130,195,32);thumbnails[2099075]=new thumbnail(2099075,"139845","","Char1_thumb.jpg",130,195,32);thumbnails[2099076]=new thumbnail(2099076,"139845","","Club-B&W1_thumb.jpg",130,179,32);thumbnails[2099077]=new thumbnail(2099077,"139845","","Club-B&W2_thumb.jpg",130,179,32);thumbnails[2099078]=new thumbnail(2099078,"139845","","Club-B&W2b_thumb.jpg",130,93,32);thumbnails[2099118]=new thumbnail(2099118,"139845","","IMG_5812_thumb.jpg",130,182,32);thumbnails[2173614]=new thumbnail(2173614,"139615","","IMG_6745_thumb.jpg",130,87,32);thumbnails[2173716]=new thumbnail(2173716,"139615","","IMG_67971_thumb.jpg",130,87,32);thumbnails[2098961]=new thumbnail(2098961,"139615","","0009_thumb.jpg",130,87,32);thumbnails[2098985]=new thumbnail(2098985,"139615","","Drake1_thumb.jpg",130,87,32);thumbnails[2098987]=new thumbnail(2098987,"139615","","Duck1_thumb.jpg",130,93,32);thumbnails[2099000]=new thumbnail(2099000,"139615","","Otter1_thumb.jpg",130,195,32);thumbnails[2099028]=new thumbnail(2099028,"139615","","Swan1_thumb.jpg",130,93,32);thumbnails[2099119]=new thumbnail(2099119,"139615","","Twig1_thumb.jpg",130,182,32);var galleries=new Object();galleries[139607]=new gallery(139607,"2098998,2098976","Liquidity","gallery",[2098970,2098976,2098984,2098998,2099003,2099005,2099006,2099067,2099068]);galleries[139612]=new gallery(139612,"2227806","Avionics","gallery",[2227803,2227805,2227806,2227807,2158546,2158547,2158548,2158549,2158550,2158552,2158553,2093541,2093545,2099110,2099112,2099113]);galleries[139616]=new gallery(139616,"2099024,2099022,2099002,2098997,2098992,2098981","Creative Imagery","gallery",[2098981,2098992,2098997,2099002,2099022,2099024]);galleries[139617]=new gallery(139617,"2098974","Abstract","gallery",[2134190,2134196,2098974,2099114,2508643,2508647]);galleries[139618]=new gallery(139618,"2093540","Around Us","gallery",[2227802,2134161,2134167,2134174,2134178,2093540,2098963,2098964,2098993,2099109]);galleries[139845]=new gallery(139845,"2099076","People & Portraits","gallery",[2099075,2099076,2099077,2099078,2099118]);galleries[139615]=new gallery(139615,"2173614,2099000","Flora & Fauna","gallery",[2173614,2173716,2098961,2098985,2098987,2099000,2099028,2099119]);var imageSets=new Object();imageSets[1]="2508643,2227807,2227806,2227805,2173614,2158553,2158552,2158550,2158549,2158548,2158546,2099119,2099112,2099110,2099078,2099075,2099068,2099067,2099028,2099022,2099006,2099005,2099003,2099002,2098998,2098992,2098985,2098984,2098981,2098976,2098974,2098970,2098961,2093541,2093540";imageSets[2]="2227806,2173614,2099076,2099000,2098998,2098976,2098974,2093540";imageSets[3]="2508647,2508643,2227807,2227806,2227805,2227803,2227802,2173716,2173614,2158553,2158552,2158550,2158549,2158548,2158547,2158546,2134196,2134190,2134178,2134174,2134167,2134161,2099119,2099118,2099114,2099113,2099112,2099110,2099109,2099078,2099077,2099076,2099075,2099068,2099067,2099028,2099024,2099022,2099006,2099005,2099003,2099002,2099000,2098998,2098997,2098993,2098992,2098987,2098985,2098984";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/mattcurd/images";break}switch(a){case 1:b="http://www1.clikpic.com/mattcurd/images";break}switch(a){case 2:b="http://admin.clikpic.com/mattcurd/images";break}switch(a){case 24:b="http://tpc15/clikpic/mattcurd/images";break}switch(a){case 4:b="http://www.clikchurch.com/mattcurd/images";break}switch(a){case 5:b="http://www2.clikpic.com/mattcurd/images";break}switch(a){case 22:b="http://tpc5/clikpic/mattcurd/images";break}switch(a){case 23:b="http://tpc10/clikpic/mattcurd/images";break}switch(a){case 25:b="http://tpc16/clikpic/mattcurd/images";break}switch(a){case 15:b="http://www3.clikpic.com/mattcurd/images";break}switch(a){case 18:b="http://www4.clikpic.com/mattcurd/images";break}switch(a){case 19:b="http://www5.clikpic.com/mattcurd/images";break}switch(a){case 31:b="http://www7.clikpic.com/mattcurd/images";break}switch(a){case 32:b="http://admin2.clikpic.com/mattcurd/images";break}switch(a){case 33:b="http://www8.clikpic.com/mattcurd/images";break}switch(a){case 34:b="http://www9.clikpic.com/mattcurd/images";break}switch(a){case 35:b="http://admin3.clikpic.com/mattcurd/images";break}switch(a){case 37:b="http://admin4.clikpic.com/mattcurd/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="Articulus Photographic: "+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>"}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="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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="matt_curd@btinternet.com">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="matt_curd@btinternet.com">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};