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[419081]=new thumbnail(419081,"33609","View from Osmington Mills","Osmington Mills 2_thumb.jpg",130,59,18);thumbnails[419083]=new thumbnail(419083,"33609","View from Osmington Mills, near to the view as painted by John Constable","Osmington Mills 3_thumb.jpg",130,54,18);thumbnails[419105]=new thumbnail(419105,"33609","Sun set from Overcome corner Weymouth","Weymouth Sunset_thumb.jpg",130,59,18);thumbnails[419109]=new thumbnail(419109,"33609","White Nothe near Weymouth<br>\r\n","White Nothe_thumb.jpg",130,80,18);thumbnails[419115]=new thumbnail(419115,"33609","View of St Catherine's Chapel, Abbotsbury Dorset.","Abbotsbury 1_thumb.jpg",130,36,18);thumbnails[419151]=new thumbnail(419151,"33613","Outside West Stafford, Dorset","West Stafford 2_thumb.jpg",116,200,18);thumbnails[419157]=new thumbnail(419157,"33613","","Brockhampton River_thumb.jpg",130,90,18);thumbnails[419191]=new thumbnail(419191,"33614","","New York 1_thumb.jpg",130,73,18);thumbnails[419192]=new thumbnail(419192,"33614","","New York 2_thumb.jpg",130,73,18);thumbnails[419194]=new thumbnail(419194,"33614","","New York 3_thumb.jpg",130,98,18);thumbnails[419196]=new thumbnail(419196,"33613","","Trees_thumb.jpg",130,86,18);thumbnails[419197]=new thumbnail(419197,"33613","","Meadows_thumb.jpg",130,67,18);thumbnails[419198]=new thumbnail(419198,"33613","","From Water Meadows_thumb.jpg",130,53,18);thumbnails[419972]=new thumbnail(419972,"33614","","Barcelona 1_thumb.jpg",130,89,18);thumbnails[419973]=new thumbnail(419973,"33614","","Barcelona 2_thumb.jpg",130,73,18);thumbnails[419975]=new thumbnail(419975,"33609","Lyme Regis Dorset","Lyme 2_thumb.jpg",130,77,18);thumbnails[419977]=new thumbnail(419977,"33609","","Lyme_thumb.jpg",130,73,18);thumbnails[419978]=new thumbnail(419978,"33609","Star in Cafe","Weymouth Star_thumb.jpg",130,140,18);thumbnails[422725]=new thumbnail(422725,"41288","Photo of High West Street Dorchester using a Holga Camera","Holga-Dorchester001_thumb.jpg",130,127,18);thumbnails[422726]=new thumbnail(422726,"41288","South Street Dorchester","Holga-Dorchester002_thumb.jpg",130,127,18);thumbnails[422727]=new thumbnail(422727,"41288","","Holga-Dorchester003_thumb.jpg",130,132,18);thumbnails[424840]=new thumbnail(424840,"33609","West Bay, Bridport","West Bay_thumb.jpg",130,56,18);thumbnails[424843]=new thumbnail(424843,"33609","West Bexington, Dorset","West Bexington_thumb.jpg",130,49,18);thumbnails[424844]=new thumbnail(424844,"33614","","Arles2_thumb.jpg",106,200,18);thumbnails[424852]=new thumbnail(424852,"33614","","Arles31_thumb.jpg",130,98,18);thumbnails[532564]=new thumbnail(532564,"41288","Fordington Green, Dorchester.","Dorchester Pinhole004ver2_thumb.jpg",130,102,18);thumbnails[532568]=new thumbnail(532568,"41288","Dungate Street, Dorchester.","Dorchester Pinhole Web Image 1_thumb.jpg",130,111,18);thumbnails[532571]=new thumbnail(532571,"41288","High East Street, Dorchester.","Web Image 2_thumb.jpg",130,165,18);thumbnails[542852]=new thumbnail(542852,"33613","Sheep in Frome Valley","Sheep in Frome Valley_thumb.jpg",130,70,18);thumbnails[542853]=new thumbnail(542853,"33613","Trees in Frome Valley","Trees1_thumb.jpg",130,81,18);thumbnails[543162]=new thumbnail(543162,"33613","Trees in Frome Valley","Dorchester0021_thumb.jpg",130,102,18);thumbnails[543182]=new thumbnail(543182,"33609","White Nothe, Nr Weymouth","seascape001_thumb.jpg",130,130,18);thumbnails[840004]=new thumbnail(840004,"33609","Hyde Beach","DSCF2028_thumb.JPG",130,79,18);thumbnails[840010]=new thumbnail(840010,"33609","Jordon Hill, Weymouth","DSCF2581_thumb.JPG",130,77,18);thumbnails[840012]=new thumbnail(840012,"33609","West Bay","DSCF2612ver2_thumb.jpg",130,90,18);thumbnails[840068]=new thumbnail(840068,"33613","Frome Valley","DSCF2496ver2_thumb.jpg",130,61,18);thumbnails[2885019]=new thumbnail(2885019,"33614","","DSC_1347_thumb.jpg",130,86,18);thumbnails[2885020]=new thumbnail(2885020,"33614","","DSC_1348_thumb.jpg",130,86,18);thumbnails[2885021]=new thumbnail(2885021,"33614","","DSC_1355_thumb.jpg",130,87,18);thumbnails[2885023]=new thumbnail(2885023,"33614","","DSCF0055_thumb.jpg",130,97,18);thumbnails[2885032]=new thumbnail(2885032,"33613","","Sheep_thumb.jpg",129,68,18);thumbnails[2885037]=new thumbnail(2885037,"33614","","venice_thumb.jpg",112,200,18);thumbnails[2885038]=new thumbnail(2885038,"33614","","Venice001_thumb.jpg",130,118,18);thumbnails[2885039]=new thumbnail(2885039,"33614","","Venice002_thumb.jpg",129,119,18);thumbnails[2902666]=new thumbnail(2902666,"33609","","ot_thumb.jpg",130,87,18);thumbnails[6491548]=new thumbnail(6491548,"33614","","New_York003_thumb.jpg",122,200,18);thumbnails[6491551]=new thumbnail(6491551,"33614","","washington017_thumb.jpg",130,78,18);thumbnails[6492628]=new thumbnail(6492628,"33609","","DSC_0470_thumb.jpg",130,194,18);thumbnails[6492632]=new thumbnail(6492632,"33609","","DSC_0449_thumb.jpg",130,87,18);thumbnails[6492637]=new thumbnail(6492637,"33609","","DSC_0445_thumb.jpg",130,87,18);thumbnails[6492748]=new thumbnail(6492748,"33609","","DSC_0316_thumb.jpg",130,194,18);thumbnails[6492750]=new thumbnail(6492750,"33609","","DSC_0298_thumb.jpg",130,87,18);thumbnails[419119]=new thumbnail(419119,"33602","","Christmas Lights 2_thumb.jpg",130,193,18);thumbnails[419125]=new thumbnail(419125,"33602","Weymouth Avenue Dorchester","Weymouth Avenue Dorchester_thumb.jpg",130,98,18);thumbnails[419128]=new thumbnail(419128,"33602","High East Street, Dorchester","High East Street December Afternoon_thumb.jpg",130,139,18);thumbnails[424839]=new thumbnail(424839,"33602","South Street Dorchester","South Street_thumb.jpg",130,73,18);thumbnails[542854]=new thumbnail(542854,"33602","High West Street Dorchester.","Letter Box_thumb.jpg",130,74,18);thumbnails[543166]=new thumbnail(543166,"33602","Floods 2003","Flood 2_thumb.jpg",130,98,18);thumbnails[839996]=new thumbnail(839996,"33602","Dorchester Show 2007","DSCF2056ver2_thumb.jpg",130,73,18);thumbnails[840029]=new thumbnail(840029,"33602","The White Hart","IMG_0177_thumb.JPG",130,82,18);thumbnails[840049]=new thumbnail(840049,"33602","The Walks","DSCF0026ver3_thumb.jpg",130,98,18);thumbnails[2902650]=new thumbnail(2902650,"33602","","DSC_0151ver2ot_thumb.jpg",130,69,18);thumbnails[2902653]=new thumbnail(2902653,"33602","","DSC_4887ver2_thumb.jpg",130,194,18);thumbnails[3643484]=new thumbnail(3643484,"33602","Dorchester Snow 2009","web_photos_20093_thumb.jpg",130,87,18);thumbnails[3643485]=new thumbnail(3643485,"33602","","web_photos_200914_thumb.jpg",130,87,18);thumbnails[3643488]=new thumbnail(3643488,"33602","","web_photos_200918_thumb.jpg",130,73,18);thumbnails[3643490]=new thumbnail(3643490,"33602","","web_photos_20095_thumb.jpg",130,80,18);thumbnails[6491538]=new thumbnail(6491538,"33602","","DSC_8608_thumb.jpg",130,52,18);thumbnails[6491539]=new thumbnail(6491539,"33602","","DSC_86081_thumb.jpg",130,52,18);thumbnails[6491540]=new thumbnail(6491540,"33602","","seats2_thumb.jpg",130,161,18);thumbnails[6491542]=new thumbnail(6491542,"33602","The White Hart","marchcoast052_thumb.jpg",130,82,18);var galleries=new Object();galleries[33609]=new gallery(33609,"2902666","Dorset Coast Project","gallery",[419081,419083,419105,419109,419115,419975,419977,419978,424840,424843,543182,840004,840010,840012,2902666,6492628,6492632,6492637,6492748,6492750]);galleries[41288]=new gallery(41288,"532571,532568,532564,422727,422726,422725","Experimental","gallery",[422725,422726,422727,532564,532568,532571]);galleries[33614]=new gallery(33614,"2885039","International","gallery",[419191,419192,419194,419972,419973,424844,424852,2885019,2885020,2885021,2885023,2885037,2885038,2885039,6491548,6491551]);galleries[33613]=new gallery(33613,"2885032,840068,543162,542853,542852,419198,419197,419196,419157,419151","Landscape","gallery",[419151,419157,419196,419197,419198,542852,542853,543162,840068,2885032]);galleries[33602]=new gallery(33602,"419128","Dorchester","gallery",[419119,419125,419128,424839,542854,543166,839996,840029,840049,2902650,2902653,3643484,3643485,3643488,3643490,6491538,6491539,6491540,6491542]);var imageSets=new Object();imageSets[1]="840012";imageSets[2]="2902666,2885039,419128";imageSets[3]="6492750,6492748,6492637,6492632,6492628,6491551,6491548,6491542,6491540,6491539,6491538,3643490,3643488,3643485,3643484,2902666,2902653,2902650,2885039,2885038,2885037,2885032,2885023,2885021,2885020,2885019,840068,840049,840029,840012,840010,840004,839996,543182,543166,543162,542854,542853,542852,532571,532568,532564,424852,424844,424843,424840,424839,422727,422726,422725";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/andygill01/images";break}switch(a){case 1:b="http://www1.clikpic.com/andygill01/images";break}switch(a){case 2:b="http://admin.clikpic.com/andygill01/images";break}switch(a){case 24:b="http://tpc15/clikpic/andygill01/images";break}switch(a){case 4:b="http://www.clikchurch.com/andygill01/images";break}switch(a){case 5:b="http://www2.clikpic.com/andygill01/images";break}switch(a){case 22:b="http://tpc5/clikpic/andygill01/images";break}switch(a){case 23:b="http://tpc10/clikpic/andygill01/images";break}switch(a){case 25:b="http://tpc16/clikpic/andygill01/images";break}switch(a){case 15:b="http://www3.clikpic.com/andygill01/images";break}switch(a){case 18:b="http://www4.clikpic.com/andygill01/images";break}switch(a){case 19:b="http://www5.clikpic.com/andygill01/images";break}switch(a){case 31:b="http://www7.clikpic.com/andygill01/images";break}switch(a){case 32:b="http://admin2.clikpic.com/andygill01/images";break}switch(a){case 33:b="http://www8.clikpic.com/andygill01/images";break}switch(a){case 34:b="http://www9.clikpic.com/andygill01/images";break}switch(a){case 35:b="http://admin3.clikpic.com/andygill01/images";break}switch(a){case 37:b="http://admin4.clikpic.com/andygill01/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="'+escape(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="Andrew Gillett 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;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+'")'})}}};