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[3718165]=new thumbnail(3718165,"293733","","amyrillus_thumb.jpg",130,87,32);thumbnails[3718167]=new thumbnail(3718167,"293733","","bee_orchid_closeup_thumb.jpg",130,87,32);thumbnails[3730517]=new thumbnail(3730517,"293733","","Tulips_2364_thumb.jpg",130,90,32);thumbnails[4217746]=new thumbnail(4217746,"293733","","Bud_1000_2372_thumb.jpg",130,87,32);thumbnails[5202938]=new thumbnail(5202938,"293733","","Daisies_dark_21561_thumb.jpg",130,194,32);thumbnails[5202941]=new thumbnail(5202941,"293733","","Moulin_bed_1071_thumb.jpg",130,195,32);thumbnails[5202943]=new thumbnail(5202943,"293733","","Moulin_blues_0875_thumb.jpg",130,87,32);thumbnails[5202945]=new thumbnail(5202945,"293733","","Moulin_daisy_0918_thumb.jpg",130,87,32);thumbnails[5202949]=new thumbnail(5202949,"293733","","Moulin_echinop_0942_thumb.jpg",130,195,32);thumbnails[5202950]=new thumbnail(5202950,"293733","","Moulin_echinops_0848_thumb.jpg",130,195,32);thumbnails[5202952]=new thumbnail(5202952,"293733","","Moulin_lollipop_0862_thumb.jpg",130,87,32);thumbnails[5202955]=new thumbnail(5202955,"293733","","Moulin_pinks_0887_thumb.jpg",130,87,32);thumbnails[5202957]=new thumbnail(5202957,"293733","","Moulin_poppy_0842_thumb.jpg",130,87,32);thumbnails[5202958]=new thumbnail(5202958,"293733","","Moulin_poppy_0891_thumb.jpg",130,195,32);thumbnails[5202959]=new thumbnail(5202959,"293733","","Moulin_purples_1017_thumb.jpg",130,195,32);thumbnails[5202960]=new thumbnail(5202960,"293733","","Moulin_purply_0866_thumb.jpg",130,87,32);thumbnails[5202966]=new thumbnail(5202966,"293733","","Moulin_purplyblur_0879_thumb.jpg",130,195,32);thumbnails[5202967]=new thumbnail(5202967,"293733","","Moulin_sweetpea_0944_thumb.jpg",130,87,32);thumbnails[5202969]=new thumbnail(5202969,"293733","","Moulin_thing_1089_thumb.jpg",130,195,32);thumbnails[5202970]=new thumbnail(5202970,"293733","","Roses_drying_2204_thumb.jpg",130,195,32);thumbnails[5202977]=new thumbnail(5202977,"293733","","Sunflower_pollen_2625_thumb.jpg",130,199,32);thumbnails[5202978]=new thumbnail(5202978,"293733","","Sunflowers_ragged_2151_thumb.jpg",130,195,32);thumbnails[5225654]=new thumbnail(5225654,"293733","","Blue_Iris_0015_thumb.jpg",130,195,32);thumbnails[5202939]=new thumbnail(5202939,"293733","","Iris_stamens_2003_thumb.jpg",130,199,32);thumbnails[4217753]=new thumbnail(4217753,"293733","","Tulips_2363_1k_thumb.jpg",130,184,32);thumbnails[5202971]=new thumbnail(5202971,"293733","","Sunflower_dark_2219_thumb.jpg",130,195,32);thumbnails[3385675]=new thumbnail(3385675,"206687","","bald eagle_thumb.jpg",130,185,32);thumbnails[3718192]=new thumbnail(3718192,"206687","","Entree_des_artistes_thumb.jpg",130,236,32);thumbnails[5168190]=new thumbnail(5168190,"206687","","City_hall_DSCN0990_thumb.jpg",130,173,32);thumbnails[5211498]=new thumbnail(5211498,"206687","","CityWedding1_thumb.jpg",130,104,32);thumbnails[3385671]=new thumbnail(3385671,"206687","","apprentice custom vrb 1000_thumb.jpg",130,78,32);thumbnails[3385653]=new thumbnail(3385653,"206687","","Eagle owl tint 1000_thumb.jpg",130,93,32);thumbnails[2305935]=new thumbnail(2305935,"206687","","Bluebell girl1_thumb.jpg",130,95,32);thumbnails[3686196]=new thumbnail(3686196,"206687","","DuskoverMarbella_thumb.jpg",130,138,32);thumbnails[4129266]=new thumbnail(4129266,"247063","","CP__bride1_thumb.jpg",130,87,32);thumbnails[4129268]=new thumbnail(4129268,"247063","","CP_leg_thumb.jpg",130,195,32);thumbnails[4408848]=new thumbnail(4408848,"247063","","Pew_WCol_1000_5340_thumb.jpg",130,195,32);thumbnails[4408851]=new thumbnail(4408851,"247063","","Aisle_1000_5311_thumb.jpg",130,195,32);thumbnails[4408854]=new thumbnail(4408854,"247063","","Choir_1000_P8120298_thumb.jpg",130,173,32);thumbnails[2306022]=new thumbnail(2306022,"225053","","SIX1_thumb.jpg",130,86,32);thumbnails[3718171]=new thumbnail(3718171,"225053","","Fireworks_bush_1_thumb.jpg",130,181,32);thumbnails[3718174]=new thumbnail(3718174,"225053","","Fireworks_flowers_4_thumb.jpg",130,181,32);thumbnails[3718185]=new thumbnail(3718185,"225053","","Curtains_ap_thumb.jpg",130,192,32);thumbnails[3291916]=new thumbnail(3291916,"225053","","Blow_me_1000_72_10_thumb.jpg",130,130,32);thumbnails[2484547]=new thumbnail(2484547,"205544","","Graduate with tutors_thumb.jpg",130,92,32);thumbnails[2484548]=new thumbnail(2484548,"205544","","Graduation caps in the air_thumb.jpg",130,87,32);thumbnails[2305953]=new thumbnail(2305953,"205544","","Recital1_thumb.jpg",130,87,32);thumbnails[3372761]=new thumbnail(3372761,"205544","","deep in the pit_thumb.jpg",130,237,32);thumbnails[3718183]=new thumbnail(3718183,"205544","","CityWedding_thumb.jpg",130,104,32);thumbnails[4991210]=new thumbnail(4991210,"205544","Sorcerers Apprentice","sorcerers_apprentice_600_thumb.jpg",130,78,32);thumbnails[2504493]=new thumbnail(2504493,"205544","","The English Graduate_thumb.jpg",130,144,32);thumbnails[3385649]=new thumbnail(3385649,"200762"," ","Too cold 1000_thumb.jpg",130,122,32);thumbnails[3498822]=new thumbnail(3498822,"200762","","Winns2_thumb.jpg",130,173,32);thumbnails[2305868]=new thumbnail(2305868,"200762","","Gerickes1_thumb.jpg",130,82,32);thumbnails[2305873]=new thumbnail(2305873,"200762","","Far away Andy_thumb.jpg",130,97,32);thumbnails[3292839]=new thumbnail(3292839,"200762","","Canvas_BW_eyes_158_thumb.jpg",130,120,32);thumbnails[2305871]=new thumbnail(2305871,"200762","","Mastertons1_thumb.jpg",130,92,32);thumbnails[2929000]=new thumbnail(2929000,"200762","","Winns in snow1_thumb.jpg",130,97,32);thumbnails[3292891]=new thumbnail(3292891,"200762","","Girl_pose_thumb.jpg",130,195,32);thumbnails[3292867]=new thumbnail(3292867,"200762","","Boy_girl_buggy_thumb.jpg",130,184,32);thumbnails[3292915]=new thumbnail(3292915,"200762","","Boy_pose_sepia_thumb.jpg",130,195,32);thumbnails[3292879]=new thumbnail(3292879,"200762","","Boy_girl_leaves_thumb.jpg",130,87,32);thumbnails[3733183]=new thumbnail(3733183,"247062","","Want_some_gum_BW1_thumb.jpg",130,184,32);thumbnails[5168194]=new thumbnail(5168194,"247062","","Chris_Becky_sml_3206_thumb.jpg",130,87,32);thumbnails[2305497]=new thumbnail(2305497,"247062","","Snow bird_thumb.jpg",130,195,32);thumbnails[2510593]=new thumbnail(2510593,"247062","","Hi key Kate_thumb.jpg",130,195,32);thumbnails[2530899]=new thumbnail(2530899,"247062","","headshot Myrlene side_thumb.jpg",130,161,32);thumbnails[4134679]=new thumbnail(4134679,"150067","","Grey_t_MG_0353_pp_thumb.jpg",130,195,32);thumbnails[4134696]=new thumbnail(4134696,"150067","","Grey_A_BW_0354_pp1_thumb.jpg",130,195,32);thumbnails[4134698]=new thumbnail(4134698,"150067","","Grey_A_MG_0354_pp1_thumb.jpg",130,195,32);thumbnails[4134700]=new thumbnail(4134700,"150067","","Grey_t_BW_0353_pp1_thumb.jpg",130,195,32);thumbnails[2530958]=new thumbnail(2530958,"150067","","headshot Rachel teeth_thumb.jpg",130,195,32);thumbnails[2619375]=new thumbnail(2619375,"150067","","Hi key Kate 2_pp BBW1_thumb.jpg",130,163,32);thumbnails[2530833]=new thumbnail(2530833,"150067","","headshot Jeff laughing_thumb.jpg",130,195,32);thumbnails[2530942]=new thumbnail(2530942,"150067","","headshot Nick laughing_thumb.jpg",130,195,32);thumbnails[2530894]=new thumbnail(2530894,"150067","","headshot Michael unshaven _thumb.jpg",130,195,32);thumbnails[2530934]=new thumbnail(2530934,"150067","","headshot Myrlene smiling_thumb.jpg",130,195,32);thumbnails[3061707]=new thumbnail(3061707,"150067","","headshot Jeff smiling1_thumb.jpg",130,195,32);thumbnails[2305862]=new thumbnail(2305862,"150067","","Chris2_pp1_thumb.jpg",130,163,32);thumbnails[2305866]=new thumbnail(2305866,"150067","","Old Nick1_thumb.jpg",130,163,32);thumbnails[2598369]=new thumbnail(2598369,"150067","","paddy_thumb.jpg",130,173,32);var galleries=new Object();galleries[293733]=new gallery(293733,"5225654,5202977,5202971,5202939","Flowers","gallery",[3718165,3718167,3730517,4217746,5202938,5202941,5202943,5202945,5202949,5202950,5202952,5202955,5202957,5202958,5202959,5202960,5202966,5202967,5202969,5202970,5202977,5202978,5225654,5202939,4217753,5202971]);galleries[206687]=new gallery(206687,"5211498,3385653","Out & about","gallery",[3385675,3718192,5168190,5211498,3385671,3385653,2305935,3686196]);galleries[247063]=new gallery(247063,"4129266","Wedding","gallery",[4129266,4129268,4408848,4408851,4408854]);galleries[225053]=new gallery(225053,"3718185,3718174,3718171,3291916,2306022","Wall art","gallery",[2306022,3718171,3718174,3718185,3291916]);galleries[205544]=new gallery(205544,"2305953","Events & happenings","gallery",[2484547,2484548,2305953,3372761,3718183,4991210,2504493]);galleries[200762]=new gallery(200762,"3292839,2929000","Children & family","gallery",[3385649,3498822,2305868,2305873,3292839,2305871,2929000,3292891,3292867,3292915,3292879]);galleries[247062]=new gallery(247062,"2305497","Portraits","gallery",[3733183,5168194,2305497,2510593,2530899]);galleries[150067]=new gallery(150067,"4134698","Headshots for actors","gallery",[4134679,4134696,4134698,4134700,2530958,2619375,2530833,2530942,2530894,2530934,3061707,2305862,2305866,2598369]);var imageSets=new Object();imageSets[1]="5225654,5211498,5202977,5202971,5202939,4129268,4129266,3291916";imageSets[2]="5225654,5211498,5202977,5202971,5202939,4134698,4129266,3385653,3292839,2929000,2305953,2305497";imageSets[3]="5225654,5211498,5202978,5202977,5202971,5202970,5202969,5202967,5202966,5202960,5202959,5202958,5202957,5202955,5202952,5202950,5202949,5202945,5202943,5202941,5202939,5202938,5168194,5168190,4991210,4408854,4408851,4408848,4217753,4217746,4134700,4134698,4134696,4134679,4129268,4129266,3733183,3730517,3718192,3718185,3718183,3718174,3718171,3718167,3718165,3686196,3498822,3385675,3385671,3385653";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/mrdarcy/images";break}switch(a){case 1:b="http://www1.clikpic.com/mrdarcy/images";break}switch(a){case 2:b="http://admin.clikpic.com/mrdarcy/images";break}switch(a){case 4:b="http://www.clikchurch.com/mrdarcy/images";break}switch(a){case 5:b="http://www2.clikpic.com/mrdarcy/images";break}switch(a){case 15:b="http://www3.clikpic.com/mrdarcy/images";break}switch(a){case 21:b="http://www6.clikpic.com/mrdarcy/images";break}switch(a){case 18:b="http://www4.clikpic.com/mrdarcy/images";break}switch(a){case 19:b="http://www5.clikpic.com/mrdarcy/images";break}switch(a){case 22:b="http://tpc5/clikpic/mrdarcy/images";break}switch(a){case 23:b="http://tpc10/clikpic/mrdarcy/images";break}switch(a){case 24:b="http://tpc15/clikpic/mrdarcy/images";break}switch(a){case 25:b="http://tpc16/clikpic/mrdarcy/images";break}switch(a){case 31:b="http://www7.clikpic.com/mrdarcy/images";break}switch(a){case 32:b="http://admin2.clikpic.com/mrdarcy/images";break}switch(a){case 33:b="http://www8.clikpic.com/mrdarcy/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="Watson Lavery Images: "+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>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="mrdarcy@hotmail.co.uk">';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="mrdarcy@hotmail.co.uk">';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(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+'")'})}}};