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[3182293]=new thumbnail(3182293,"194741","cala n bosc","_MG_3759__b_thumb.jpg",130,60,1);thumbnails[3182361]=new thumbnail(3182361,"194741","radiant light ","_MG_3896-light_thumb.jpg",130,65,1);thumbnails[3182377]=new thumbnail(3182377,"194741","safe haven","DPP_014c__c_thumb.jpg",130,60,1);thumbnails[3182384]=new thumbnail(3182384,"194741","by night ","_MG_3403__c_thumb.jpg",130,60,1);thumbnails[1143584]=new thumbnail(1143584,"83009","here comes the bride","matt-&-ness-sizing-019_thumb.jpg",130,87,1);thumbnails[1143587]=new thumbnail(1143587,"83009","kissy kissy","matt-&-ness-sizing-041_thumb.jpg",130,130,1);thumbnails[1143589]=new thumbnail(1143589,"83009","signing the register","matt-&-ness-sizing-0311_thumb.jpg",130,87,1);thumbnails[1143593]=new thumbnail(1143593,"83009","it's in the eyes","matt-&-ness-sizing-075a1_thumb.jpg",130,130,1);thumbnails[1143594]=new thumbnail(1143594,"83009","look out","matt-&-ness-sizing-076_thumb.jpg",130,130,1);thumbnails[1143595]=new thumbnail(1143595,"83009","look back","matt-&-ness-sizing-080_thumb.jpg",130,130,1);thumbnails[1143596]=new thumbnail(1143596,"83009","i think that photographer's gone","matt-&-ness-sizing-093_thumb.jpg",130,130,1);thumbnails[1143597]=new thumbnail(1143597,"83009","reception ","matt-&-ness-sizing-096_thumb.jpg",130,87,1);thumbnails[1143599]=new thumbnail(1143599,"83009","leg up ","matt-&-ness-sizing-107a_thumb.jpg",130,130,1);thumbnails[1143761]=new thumbnail(1143761,"83009","your ring or mine","rring_thumb.jpg",130,130,1);thumbnails[1143763]=new thumbnail(1143763,"83009","hello wife","head-kiss_thumb.jpg",130,91,1);thumbnails[1143764]=new thumbnail(1143764,"83009","with this ring","hands-round_thumb.jpg",130,130,1);thumbnails[1143766]=new thumbnail(1143766,"83009","cheers","IMG_4959_thumb.jpg",130,195,1);thumbnails[1143770]=new thumbnail(1143770,"83009","Matt&Ness","m&n2_thumb.jpg",130,91,1);thumbnails[1143784]=new thumbnail(1143784,"83009","the rings","IMG_4709-sized_thumb.jpg",130,163,1);thumbnails[3290857]=new thumbnail(3290857,"200615","foggy river medina ","_MG_4372_thumb.jpg",130,87,1);thumbnails[3560831]=new thumbnail(3560831,"200615","","_MG_1459a_thumb.jpg",130,162,1);thumbnails[3560835]=new thumbnail(3560835,"259300","","_MG_1511CR2_thumb.jpg",130,195,1);thumbnails[3560838]=new thumbnail(3560838,"200615","","DPP_003c_thumb.jpg",130,104,1);thumbnails[3560840]=new thumbnail(3560840,"200615","","IMG_7411_thumb.jpg",130,87,1);thumbnails[3560856]=new thumbnail(3560856,"200615","","DPP_034_thumb.jpg",130,92,1);thumbnails[3560859]=new thumbnail(3560859,"200615","","IMG_7309_thumb.jpg",130,87,1);thumbnails[4410500]=new thumbnail(4410500,"258418","the big leap of faith","_MG_9035c_thumb.jpg",130,195,1);thumbnails[4410507]=new thumbnail(4410507,"258418","the charging pack","_MG_8865CR2_thumb.jpg",130,87,1);thumbnails[4410535]=new thumbnail(4410535,"258418","oowwerr mum","DPP_141c_thumb.jpg",130,87,1);thumbnails[4410557]=new thumbnail(4410557,"258418","faster ","DPP_165_thumb.jpg",130,87,1);thumbnails[4410558]=new thumbnail(4410558,"258418","thats my boy","DPP_508_thumb.jpg",130,195,1);thumbnails[4410601]=new thumbnail(4410601,"258422","round island race","DPP_095_thumb.jpg",130,87,1);thumbnails[4410606]=new thumbnail(4410606,"258422","round the island race","DPP_160_thumb.jpg",130,87,1);thumbnails[4410619]=new thumbnail(4410619,"258422","round the island ","DPP_103_thumb.jpg",130,87,1);thumbnails[4410629]=new thumbnail(4410629,"258422","chopper down","DPP_006c2_thumb.jpg",130,87,1);thumbnails[4410634]=new thumbnail(4410634,"258422","gentle cruise","_MG_5540_thumb.jpg",130,87,1);thumbnails[4410637]=new thumbnail(4410637,"258422","coming home ","_MG_5555-copy_thumb.jpg",130,104,1);thumbnails[4410669]=new thumbnail(4410669,"83009","Clare & Clive","_MG_9898d_thumb.jpg",130,195,1);thumbnails[4410681]=new thumbnail(4410681,"83009","Clare & Clive","_MG_9940c_thumb.jpg",130,87,1);thumbnails[4410682]=new thumbnail(4410682,"200615","me","DPP_027text_thumb.jpg",130,104,1);thumbnails[4431503]=new thumbnail(4431503,"259299","Mikado","DPP_003_thumb.jpg",130,195,1);thumbnails[4431504]=new thumbnail(4431504,"259299","Mikado","DPP_026_thumb.jpg",130,195,1);thumbnails[4431505]=new thumbnail(4431505,"259299","Mikado","DPP_082_thumb.jpg",130,195,1);thumbnails[4431506]=new thumbnail(4431506,"259299","Mikado","DPP_020_thumb.jpg",130,87,1);thumbnails[4431507]=new thumbnail(4431507,"259299","cast of Mikado","DPP_086c_thumb.jpg",130,60,1);thumbnails[4431509]=new thumbnail(4431509,"259299","Mikado","DPP_269_thumb.jpg",130,87,1);thumbnails[4431511]=new thumbnail(4431511,"259299","Mikado","DPP_256_thumb.jpg",130,195,1);thumbnails[4431525]=new thumbnail(4431525,"259300","","DPP_008c_thumb.jpg",130,195,1);thumbnails[4431526]=new thumbnail(4431526,"259300","","DPP_013c_thumb.jpg",130,195,1);thumbnails[4431528]=new thumbnail(4431528,"259300","","DPP_014c_thumb.jpg",130,163,1);thumbnails[4431529]=new thumbnail(4431529,"259300","","DPP_027c2_thumb.jpg",130,195,1);thumbnails[4431530]=new thumbnail(4431530,"259300","","DPP_036c_thumb.jpg",130,195,1);thumbnails[4432414]=new thumbnail(4432414,"258422","","_MG_9381c_thumb.jpg",130,87,1);thumbnails[4474087]=new thumbnail(4474087,"258422","start of Fastnet race","_MG_1206_thumb.jpg",130,87,1);thumbnails[4474091]=new thumbnail(4474091,"258422","Icap Lepard","_MG_1204_thumb.jpg",130,195,1);thumbnails[4474094]=new thumbnail(4474094,"258422","fastnet","_MG_1181_thumb.jpg",130,87,1);thumbnails[4474096]=new thumbnail(4474096,"258422","fastnet","_MG_1176c_thumb.jpg",130,60,1);thumbnails[4474098]=new thumbnail(4474098,"258422","fastnet","_MG_1147c_thumb.jpg",130,60,1);thumbnails[4474107]=new thumbnail(4474107,"258422","","_MG_1126c_thumb.jpg",130,60,1);thumbnails[4474110]=new thumbnail(4474110,"258422","fastnet","_MG_0118c_thumb.jpg",130,195,1);thumbnails[4474113]=new thumbnail(4474113,"258422","fastnet","_MG_0121_thumb.jpg",130,87,1);thumbnails[4474115]=new thumbnail(4474115,"258422","fastnet","_MG_1006_thumb.jpg",130,87,1);thumbnails[4474118]=new thumbnail(4474118,"258422","fastnet","_MG_1064c_thumb.jpg",130,130,1);thumbnails[4474120]=new thumbnail(4474120,"258422","","_MG_1074c_thumb.jpg",130,60,1);thumbnails[4474122]=new thumbnail(4474122,"258422","fastnet","_MG_1101c_thumb.jpg",130,60,1);thumbnails[4474123]=new thumbnail(4474123,"258422","fastnet","_MG_1101c2_thumb.jpg",130,60,1);thumbnails[4474125]=new thumbnail(4474125,"258422","fastnet","_MG_1109c_thumb.jpg",130,60,1);thumbnails[4474127]=new thumbnail(4474127,"258422","fastnet","_MG_1111c_thumb.jpg",130,60,1);thumbnails[4474128]=new thumbnail(4474128,"258422","fastnet","_MG_1147c1_thumb.jpg",130,60,1);thumbnails[4474130]=new thumbnail(4474130,"258422","fastnet","_MG_11811_thumb.jpg",130,87,1);thumbnails[4474132]=new thumbnail(4474132,"258422","fastnet","_MG_12061_thumb.jpg",130,87,1);thumbnails[4475819]=new thumbnail(4475819,"258422","Artimis fastnet race 09","_MG_0985c_thumb.jpg",130,195,1);thumbnails[4475831]=new thumbnail(4475831,"258422","start canon 09","_MG_0927c_thumb.jpg",130,87,1);thumbnails[4481486]=new thumbnail(4481486,"258422","John B","_MG_1135c_thumb.jpg",130,195,1);thumbnails[4567530]=new thumbnail(4567530,"83009","Carol & Rob","_MG_1573c_thumb.jpg",130,195,1);thumbnails[4567533]=new thumbnail(4567533,"83009","Carol & Rob","_MG_1557c_thumb.jpg",130,87,1);thumbnails[4567537]=new thumbnail(4567537,"83009","Carol & Rob","_MG_1583_thumb.jpg",130,195,1);thumbnails[4567553]=new thumbnail(4567553,"83009","Samantha & Craig","_MG_0838c_thumb.jpg",130,162,1);thumbnails[4567555]=new thumbnail(4567555,"83009","Samantha & Craig","_MG_0879c_thumb.jpg",130,130,1);thumbnails[4567557]=new thumbnail(4567557,"83009","Samantha & Craig","_MG_0894c_thumb.jpg",130,87,1);thumbnails[734082]=new thumbnail(734082,"56443","sunset reflections ","_MG_91061_thumb.jpg",130,87,1);thumbnails[734093]=new thumbnail(734093,"56443","sunset on Corfu","_MG_1466a1_thumb.jpg",130,195,1);thumbnails[734105]=new thumbnail(734105,"56443","hammer head at sunset ","IMG_7128-1_thumb.jpg",130,90,1);thumbnails[734112]=new thumbnail(734112,"56443","bar at dusk ","PICT0069400_thumb.jpg",130,98,1);thumbnails[776904]=new thumbnail(776904,"56443","TENERIFE  SUNSET ","SUNSET-TENERIFE-2007_thumb.jpg",130,195,1);thumbnails[939986]=new thumbnail(939986,"56443","liberty of the seas in southampton ","IMG_4603-e-mail_thumb.jpg",130,86,1);thumbnails[1233393]=new thumbnail(1233393,"56443","cowes sunset","IMG_6062aa_thumb.jpg",130,87,1);thumbnails[3193492]=new thumbnail(3193492,"56443","sunrise over the power station","DPP_027_thumb.jpg",130,87,1);var galleries=new Object();galleries[194741]=new gallery(194741,"3182384,3182377,3182361,3182293","menorca ","gallery",[3182293,3182361,3182377,3182384]);galleries[258418]=new gallery(258418,"4410558,4410557,4410535,4410507,4410500","Motor sport ","gallery",[4410500,4410507,4410535,4410557,4410558]);galleries[259300]=new gallery(259300,"4431530,4431529,4431528,4431526,4431525,3560835","portraits","gallery",[3560835,4431525,4431526,4431528,4431529,4431530]);galleries[258422]=new gallery(258422,"4481486,4475831,4475819,4474132,4474130,4474128,4474127,4474125,4474123,4474122","sailing ","gallery",[4410601,4410606,4410619,4410629,4410634,4410637,4432414,4474087,4474091,4474094,4474096,4474098,4474107,4474110,4474113,4474115,4474118,4474120,4474122,4474123,4474125,4474127,4474128,4474130,4474132,4475819,4475831,4481486]);galleries[259299]=new gallery(259299,"4431511,4431509,4431507,4431506,4431505,4431504,4431503","stage productions","gallery",[4431503,4431504,4431505,4431506,4431507,4431509,4431511]);galleries[83009]=new gallery(83009,"4567557,4567555,4567553,4567537,4567533,4567530,4410681,4410669,1143784,1143770","wedding","gallery",[1143584,1143587,1143589,1143593,1143594,1143595,1143596,1143597,1143599,1143761,1143763,1143764,1143766,1143770,1143784,4410669,4410681,4567530,4567533,4567537,4567553,4567555,4567557]);galleries[200615]=new gallery(200615,"4410682,3560859,3560856,3560840,3560838,3560831,3290857","whimsy","gallery",[3290857,3560831,3560838,3560840,3560856,3560859,4410682]);galleries[56443]=new gallery(56443,"3193492,1233393,939986,776904,734112,734105,734093,734082","sunsets","gallery",[734082,734093,734105,734112,776904,939986,1233393,3193492]);var imageSets=new Object();imageSets[1]="4410682";imageSets[3]="3182293";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/ALLANSIMAGES/images";break}switch(a){case 1:b="http://www1.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 2:b="http://admin.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 24:b="http://tpc15/clikpic/ALLANSIMAGES/images";break}switch(a){case 4:b="http://www.clikchurch.com/ALLANSIMAGES/images";break}switch(a){case 5:b="http://www2.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 22:b="http://tpc5/clikpic/ALLANSIMAGES/images";break}switch(a){case 23:b="http://tpc10/clikpic/ALLANSIMAGES/images";break}switch(a){case 25:b="http://tpc16/clikpic/ALLANSIMAGES/images";break}switch(a){case 15:b="http://www3.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 18:b="http://www4.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 19:b="http://www5.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 31:b="http://www7.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 32:b="http://admin2.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 33:b="http://www8.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 34:b="http://www9.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 35:b="http://admin3.clikpic.com/ALLANSIMAGES/images";break}switch(a){case 37:b="http://admin4.clikpic.com/ALLANSIMAGES/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="ALLAN MARSH PHOTOGRAPHY: "+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>"}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+'")'})}}};