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[494697]=new thumbnail(494697,"34154","Lynn with the Artfact Portrait trade stand","96661.jpg",130,87,1);thumbnails[4707806]=new thumbnail(4707806,"270787","","Harvey--Kiri_thumb.jpg",130,106,1);thumbnails[4707810]=new thumbnail(4707810,"270787","","Joness-Spaniels-for-card_e_thumb.jpg",130,96,1);thumbnails[4707821]=new thumbnail(4707821,"270787","","Axel_thumb.jpg",130,183,1);thumbnails[4708303]=new thumbnail(4708303,"270787","","Gemma-Baxter_thumb.jpg",130,179,1);thumbnails[4708306]=new thumbnail(4708306,"270787","","New-Jacob-for-cards-1_thumb.jpg",130,196,1);thumbnails[4708308]=new thumbnail(4708308,"270787","","Orville-Phillips-cropped_thumb.jpg",130,175,1);thumbnails[4708311]=new thumbnail(4708311,"270787","","Pippa-Beal-for-cards_thumb.jpg",130,169,1);thumbnails[4708314]=new thumbnail(4708314,"270787","","Wendy-Donkin_thumb.jpg",130,168,1);thumbnails[4708316]=new thumbnail(4708316,"270787","","Whippet_thumb.jpg",130,178,1);thumbnails[411796]=new thumbnail(411796,"270787","","Lily-&-Rosie-edited1.jpg",130,87,1);thumbnails[427133]=new thumbnail(427133,"270787","","Border Collies1.jpg",130,91,1);thumbnails[427135]=new thumbnail(427135,"270787","","Holly & Treasure1.jpg",130,94,1);thumbnails[427137]=new thumbnail(427137,"270787","","Jay & Telfer1.jpg",130,96,1);thumbnails[427173]=new thumbnail(427173,"270787","","Tigger & Pepper1.jpg",130,114,1);thumbnails[427215]=new thumbnail(427215,"270787","","Meg1.jpg",130,175,1);thumbnails[427218]=new thumbnail(427218,"270787","","Midget1.jpg",130,161,1);thumbnails[427219]=new thumbnail(427219,"270787","","Snipe1.jpg",130,169,1);thumbnails[427221]=new thumbnail(427221,"270787","","Rosie3.jpg",130,174,1);thumbnails[427160]=new thumbnail(427160,"270787","","Lily & Rosie1.jpg",130,87,1);thumbnails[427166]=new thumbnail(427166,"270787","","Nacho1.jpg",130,95,1);thumbnails[427171]=new thumbnail(427171,"270787","","Poppy & Scampi1.jpg",130,103,1);thumbnails[427140]=new thumbnail(427140,"270787","","Jack-&-Harvey1.jpg",130,102,1);thumbnails[427142]=new thumbnail(427142,"270787","","Coco1.jpg",130,158,1);thumbnails[427146]=new thumbnail(427146,"270787","","George the Bulldog1.jpg",130,184,1);thumbnails[427152]=new thumbnail(427152,"270787","","Daz5.jpg",130,181,1);thumbnails[427155]=new thumbnail(427155,"270787","","George1.jpg",130,165,1);thumbnails[427249]=new thumbnail(427249,"270787","","Willoughby1.jpg",130,168,1);thumbnails[427254]=new thumbnail(427254,"270787","","Tom1.jpg",130,172,1);thumbnails[798653]=new thumbnail(798653,"270787","","Bambi1.jpg",130,97,1);thumbnails[798657]=new thumbnail(798657,"270787","","Bejay & Danny1.jpg",130,103,1);thumbnails[798658]=new thumbnail(798658,"270787","","Belinda1.jpg",130,93,1);thumbnails[798660]=new thumbnail(798660,"270787","","Big-Red1.jpg",130,95,1);thumbnails[494740]=new thumbnail(494740,"270787","","Bearded Collie1.jpg",130,89,1);thumbnails[798667]=new thumbnail(798667,"270787","","Bishons1.jpg",130,93,1);thumbnails[798671]=new thumbnail(798671,"270787","","Dodson1.jpg",130,169,1);thumbnails[798672]=new thumbnail(798672,"270787","","Haggis1.jpg",130,173,1);thumbnails[798674]=new thumbnail(798674,"270787","","IMG_94061.jpg",130,198,1);thumbnails[798675]=new thumbnail(798675,"270787","","Jack-Russell1.jpg",130,170,1);thumbnails[798682]=new thumbnail(798682,"270787","","Scooby1.jpg",130,170,1);thumbnails[798686]=new thumbnail(798686,"270787","","Teddy1.jpg",130,86,1);thumbnails[798691]=new thumbnail(798691,"270787","","Toby1.jpg",130,194,1);thumbnails[4707764]=new thumbnail(4707764,"270788","","Amy-Coupland_thumb.jpg",130,98,1);thumbnails[427263]=new thumbnail(427263,"270788","","Cat1.jpg",130,169,1);thumbnails[798665]=new thumbnail(798665,"270786","","0011.jpg",130,193,1);thumbnails[798668]=new thumbnail(798668,"270786","","Blinkbonny-Prince-Harry1.jpg",130,92,1);thumbnails[798677]=new thumbnail(798677,"270786","","Jean-Levitt's-Horse1.jpg",130,175,1);thumbnails[798685]=new thumbnail(798685,"270786","","Jenny-Watson's-Horse1.jpg",130,186,1);thumbnails[4708321]=new thumbnail(4708321,"270786","","Erin-Coupland1_thumb.jpg",130,197,1);thumbnails[4707805]=new thumbnail(4707805,"270789","","Champ-Coupland-Square_thumb.jpg",130,126,1);thumbnails[798669]=new thumbnail(798669,"270789","","Champion-Teeswater1.jpg",130,92,1);thumbnails[798689]=new thumbnail(798689,"270789","","Steve-Milners-Texel1.jpg",130,84,1);var galleries=new Object();galleries[34154]=new gallery(34154,"494697","Profile","section54343",[494697]);galleries[270787]=new gallery(270787,"4708316,4708314,4708311,4708308,4708306,4708303,4707821,4707810,4707806,798691","Dogs","section54397",[4707806,4707810,4707821,4708303,4708306,4708308,4708311,4708314,4708316,411796,427133,427135,427137,427173,427215,427218,427219,427221,427160,427166,427171,427140,427142,427146,427152,427155,427249,427254,798653,798657,798658,798660,494740,798667,798671,798672,798674,798675,798682,798686,798691]);galleries[270788]=new gallery(270788,"4707764,427263","Cats","section54397",[4707764,427263]);galleries[270786]=new gallery(270786,"4708321,798685,798677,798668,798665","Horses","section54397",[798665,798668,798677,798685,4708321]);galleries[270789]=new gallery(270789,"4707805,798689,798669","Sheep","section54397",[4707805,798669,798689]);var imageSets=new Object();imageSets[1]="411796";imageSets[2]="494697";imageSets[3]="4708321,4708316,4708314,4708311,4708308,4708306,4708303,4707821,4707810,4707806,4707805,4707764,798691,798689,798686,798685,798682,798677,798675,798674,798672,798671,798669,798668,798667,798665,798660,798658,798657,798653,494740,494697,427263,427254,427249,427221,427219,427218,427215,427173,427171,427166,427160,427155,427152,427146,427142,427140,427137,427135";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/LynnFoster/images";break}switch(a){case 1:b="http://www1.clikpic.com/LynnFoster/images";break}switch(a){case 2:b="http://admin.clikpic.com/LynnFoster/images";break}switch(a){case 4:b="http://www.clikchurch.com/LynnFoster/images";break}switch(a){case 5:b="http://www2.clikpic.com/LynnFoster/images";break}switch(a){case 15:b="http://www3.clikpic.com/LynnFoster/images";break}switch(a){case 21:b="http://www6.clikpic.com/LynnFoster/images";break}switch(a){case 18:b="http://www4.clikpic.com/LynnFoster/images";break}switch(a){case 19:b="http://www5.clikpic.com/LynnFoster/images";break}switch(a){case 22:b="http://tpc5/clikpic/LynnFoster/images";break}switch(a){case 23:b="http://tpc10/clikpic/LynnFoster/images";break}switch(a){case 24:b="http://tpc15/clikpic/LynnFoster/images";break}switch(a){case 25:b="http://tpc16/clikpic/LynnFoster/images";break}switch(a){case 31:b="http://www7.clikpic.com/LynnFoster/images";break}switch(a){case 32:b="http://admin2.clikpic.com/LynnFoster/images";break}switch(a){case 33:b="http://www8.clikpic.com/LynnFoster/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("section54343"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section54343.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("section54343"!=""){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="artyfactportraits.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;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>Artist </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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};
