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[138913]=new thumbnail(138913,"","introduction","intro clikpic_thumb.gif",130,195,18);thumbnails[138896]=new thumbnail(138896,"12810","Spotted asparagus beetle adult. (Crioceris duodecimpunctata). Criocere de l'asperge.","IMG_2808_2s_thumb.JPG",130,104,18);thumbnails[138897]=new thumbnail(138897,"12810","common fly taken in my parent's garden in France","IMG_2830s_thumb.JPG",130,97,18);thumbnails[138898]=new thumbnail(138898,"12810","Metallic Fly or Lucilia caesar","IMG_2834_1s_thumb.JPG",130,97,18);thumbnails[140124]=new thumbnail(140124,"12810","Honey Bee on a flower, abeille sur une fleur","IMG_2848_1s_thumb.JPG",130,93,18);thumbnails[140133]=new thumbnail(140133,"12810","Flower with water droplets","IMG_0675_1s_thumb.JPG",130,87,18);thumbnails[164047]=new thumbnail(164047,"15326","Great tit flying. Mesange charbonniere a l'envol.","IMG_8034_2_thumb.JPG",130,130,18);thumbnails[164065]=new thumbnail(164065,"15326","blue tit and great tit flying. Mesanges en vol","IMG_8051_1_thumb.JPG",130,111,18);thumbnails[164068]=new thumbnail(164068,"15326","House Sparrow. Moineaux domestiques en vol.","IMG_8069_1_thumb.JPG",130,162,18);thumbnails[164084]=new thumbnail(164084,"15326","Hawfinch arguing with an house sparrow. Gros Bec defendant sa place avec un moineau domestique.","IMG_8092_1_thumb.JPG",130,156,18);thumbnails[164086]=new thumbnail(164086,"15326","Bird landing. Atterissage d'un pinson male.","IMG_8095_1_thumb.JPG",130,160,18);thumbnails[164092]=new thumbnail(164092,"15326","Blue tit. Mesange bleue. ","IMG_8106_1_thumb.JPG",130,142,18);thumbnails[164093]=new thumbnail(164093,"15326","Blue tit taking off. Envol d'une mesange bleue.","IMG_8128_1_thumb.JPG",130,123,18);thumbnails[164096]=new thumbnail(164096,"15326","Great tit. Mesange charbonniere. ","IMG_8140_1_thumb.JPG",130,135,18);thumbnails[164099]=new thumbnail(164099,"15326","Great tit taking off. Mesange charbonniere a l'envol.","IMG_8156_1_thumb.JPG",130,102,18);thumbnails[164101]=new thumbnail(164101,"15326","Great tit flying. Mesange charbonniere en vol.","IMG_8167_1_thumb.JPG",130,102,18);thumbnails[164102]=new thumbnail(164102,"15326","flying tit. Mesange en vol.","IMG_8180_1_thumb.JPG",130,102,18);thumbnails[164103]=new thumbnail(164103,"15326","birds flying. Deux mesanges en vol.","IMG_8196_1_thumb.JPG",130,176,18);thumbnails[164106]=new thumbnail(164106,"15326","Hawfinch arguying with a goldfinch. Gros bec casse-noyaux protegeant son repas.","IMG_8086_1_thumb.JPG",130,122,18);thumbnails[164108]=new thumbnail(164108,"15326","Great tit surprised. Mesange charbonniere surprise.","IMG_8073_1_thumb.JPG",130,160,18);thumbnails[164111]=new thumbnail(164111,"15326","Marsh Tit. Mesange nonette. Parus palustris","IMG_8171_1_thumb.JPG",130,160,18);thumbnails[164112]=new thumbnail(164112,"15326","Nuthatch. Sitelle torchepot.","IMG_8186_1_thumb.JPG",130,160,18);thumbnails[164116]=new thumbnail(164116,"15326","Common Buzzard, Buse variable. buteo buteo","IMG_8022_1_thumb.JPG",130,113,18);thumbnails[143482]=new thumbnail(143482,"12812","Traditional house in Kaunas, Lithuania","IMG_6702_1s_thumb.JPG",130,88,18);thumbnails[138900]=new thumbnail(138900,"12812","St Michael the Archangel Church, Kaunas -Lithuania","IMG_6392s_thumb.JPG",130,87,18);thumbnails[143430]=new thumbnail(143430,"12812","Main street of Kaunas, Lithuania","IMG_6404_1s_thumb.JPG",130,96,18);thumbnails[143431]=new thumbnail(143431,"12812","Main street of Kaunas, Lithuania","IMG_6396_1s_thumb.JPG",130,89,18);thumbnails[143424]=new thumbnail(143424,"12812","Old town hall, Lithuania","IMG_6471_1s_thumb.JPG",130,103,18);thumbnails[138901]=new thumbnail(138901,"12812","Phone boxes in Kaunas","IMG_6461s_thumb.JPG",130,87,18);thumbnails[143455]=new thumbnail(143455,"12812","Military Museum of Vytautas the Great, Kaunas","IMG_6575_1s_thumb.JPG",130,93,18);thumbnails[143419]=new thumbnail(143419,"12812","Old lorry","IMG_6634_1s_thumb.JPG",130,87,18);thumbnails[144735]=new thumbnail(144735,"12812","Bus in Kaunas","IMG_6712_1s_thumb.JPG",130,98,18);thumbnails[143462]=new thumbnail(143462,"12812","Traditional Lithuanian house","IMG_6663s_thumb.JPG",130,98,18);thumbnails[143467]=new thumbnail(143467,"12812","Traditional house in Kaunas, Lithuania","IMG_6667s_thumb.JPG",130,88,18);thumbnails[143460]=new thumbnail(143460,"12812","Bus in Kaunas, Lithuania","IMG_6625_1s_thumb.JPG",130,98,18);thumbnails[138899]=new thumbnail(138899,"12812","Statue in front of Mykolas Zilinskas Art museum in Kaunas","IMG_6386s_thumb.JPG",130,195,18);thumbnails[144728]=new thumbnail(144728,"12812","Wooden window","IMG_6665_1s_thumb.JPG",130,194,18);thumbnails[144722]=new thumbnail(144722,"12812","Lithuanian window","IMG_6658_1s_thumb.JPG",130,195,18);thumbnails[138902]=new thumbnail(138902,"12812","kaunas old town hall by night","IMG_6523s_thumb.JPG",130,195,18);thumbnails[138904]=new thumbnail(138904,"12812","Kaunas by night.","IMG_6541s_thumb.JPG",130,195,18);thumbnails[144753]=new thumbnail(144753,"12812","Entrance to Vilnius","IMG_6734_1s_thumb.JPG",130,98,18);thumbnails[144756]=new thumbnail(144756,"12812","Vilnius, Old town, Lithuania","IMG_6735_1s_thumb.JPG",130,98,18);thumbnails[144776]=new thumbnail(144776,"12812","National museum, Vilnius, Lithuania","IMG_6789_1s_thumb.JPG",130,87,18);thumbnails[144782]=new thumbnail(144782,"12812","Vilnius Cathedral, Lithuania","IMG_6779_1s_thumb.JPG",130,87,18);thumbnails[144762]=new thumbnail(144762,"12812","Church in Vilnius","IMG_6739_1s_thumb.JPG",130,200,18);thumbnails[144765]=new thumbnail(144765,"12812","Statues from the National Theatre, Vilnius","IMG_6753_1v_thumb.JPG",130,195,18);thumbnails[144763]=new thumbnail(144763,"12812","Statue from the National Drama Theatre, Vilnius","IMG_6750_1v_thumb.JPG",130,195,18);thumbnails[144772]=new thumbnail(144772,"12812","cathedral of Vilnius, Lithuania","IMG_6767_1v_thumb.JPG",130,184,18);thumbnails[144774]=new thumbnail(144774,"12812","Clock tower next to Vilnius Cathedral, Lithuania","IMG_6770_1v_thumb.JPG",130,184,18);thumbnails[144778]=new thumbnail(144778,"12812","Vilnius. Gediminas Castle tower","IMG_6832_1v_thumb.JPG",130,195,18);thumbnails[189531]=new thumbnail(189531,"17343","Torre de Belem - Belem Tower","IMG_9149_1_thumb.JPG",130,106,18);thumbnails[189592]=new thumbnail(189592,"17343","Monument to the Discoveries","IMG_9192_1_thumb.JPG",130,141,18);thumbnails[189612]=new thumbnail(189612,"17343","Details from the Monument of Discoveries.","IMG_9180_1_thumb.JPG",130,195,18);thumbnails[189614]=new thumbnail(189614,"17343","Castelo de Sao Jorge","IMG_8716_1_thumb.JPG",130,100,18);thumbnails[189630]=new thumbnail(189630,"17343","Memorial to the dead soldiers on Portuguese colonial war (1961/1974)","IMG_9145_1_thumb.JPG",130,85,18);thumbnails[189654]=new thumbnail(189654,"17343","Mosteiro dos Jeronimos.","IMG_9213_2_thumb.JPG",130,87,18);thumbnails[189656]=new thumbnail(189656,"17343","an inside view from Jeronimos Monastery","IMG_9249_2_thumb.JPG",130,87,18);thumbnails[189622]=new thumbnail(189622,"17343","Augusta Street Arch","IMG_8761_1_thumb.JPG",130,103,18);thumbnails[189632]=new thumbnail(189632,"17343","Praca de Commercio","IMG_8772_cor_thumb.JPG",130,92,18);thumbnails[189639]=new thumbnail(189639,"17343","Monuent to the King Jose","IMG_8773_1_thumb.JPG",130,196,18);thumbnails[189643]=new thumbnail(189643,"17343","Old tram in the stret of Lisbon","IMG_8753_1_thumb.JPG",130,195,18);thumbnails[189644]=new thumbnail(189644,"17343","Tram in a typical Portuguese street.","IMG_8991_1_thumb.JPG",130,108,18);thumbnails[189646]=new thumbnail(189646,"17343","azulejos","IMG_8696_1_thumb.JPG",130,93,18);thumbnails[189653]=new thumbnail(189653,"17343","azulejos","IMG_8984_1_thumb.JPG",130,87,18);thumbnails[3523701]=new thumbnail(3523701,"215658","city hall","Maslenitsa-city hall_thumb.jpg",130,87,18);thumbnails[3523681]=new thumbnail(3523681,"215658","Maslenitsa-more london","Maslenitsa-more london_thumb.jpg",130,87,18);thumbnails[3523683]=new thumbnail(3523683,"215658","Maslenitsa-spring dance","Maslenitsa-spring dance_thumb.jpg",130,87,18);thumbnails[3523703]=new thumbnail(3523703,"215658","A dancing lady","Maslenitsa-claire sister_thumb.jpg",130,87,18);thumbnails[3523704]=new thumbnail(3523704,"215658","Another dancing lady.","Maslenitsa-claire_thumb.jpg",130,87,18);thumbnails[3523680]=new thumbnail(3523680,"215658","Crowd gathered to celebrate Maslenitsa.","Maslenitsa-location1_thumb.jpg",130,87,18);thumbnails[3523705]=new thumbnail(3523705,"215658","General view of Maslenitsa. ","Maslenitsa-location city_thumb.jpg",130,87,18);thumbnails[3523732]=new thumbnail(3523732,"215658","Made in russia","Maslenitsa-made in russia_thumb.jpg",130,87,18);thumbnails[3523682]=new thumbnail(3523682,"215658","The soviet flag.","Maslenitsa-soviet flag_thumb.jpg",130,87,18);thumbnails[3523731]=new thumbnail(3523731,"215658","two ladies talking together.","Maslenitsa-ladies talking_thumb.jpg",130,87,18);thumbnails[3523733]=new thumbnail(3523733,"215658"," The Russian ambassador : Youri Fedotov","Maslenitsa-russian ambassador_thumb.jpg",130,130,18);thumbnails[3523730]=new thumbnail(3523730,"215658","A blue eyed lady","Maslenitsa-blue eyed lady_thumb.jpg",130,130,18);thumbnails[3523842]=new thumbnail(3523842,"215658","Maslenitsa-with a russian army cap","Maslenitsa-with a russian army cap_thumb.jpg",130,130,18);thumbnails[3523749]=new thumbnail(3523749,"215658","Maslenitsa-on the phone","Maslenitsa-on the phone_thumb.jpg",130,130,18);thumbnails[3523735]=new thumbnail(3523735,"215658","A woman eating Russian food. ","Maslenitsa-woman eating_thumb.jpg",130,130,18);thumbnails[3523742]=new thumbnail(3523742,"215658","menu - ","Maslenitsa-menu_thumb.jpg",130,195,18);var galleries=new Object();galleries[12810]=new gallery(12810,"140133,140124,138898,138897,138896","Nature","gallery",[138896,138897,138898,140124,140133]);galleries[15326]=new gallery(15326,"164101,164099,164065","Birds - A tire-d'aile","gallery",[164047,164065,164068,164084,164086,164092,164093,164096,164099,164101,164102,164103,164106,164108,164111,164112,164116]);galleries[12812]=new gallery(12812,"144753,143482,143467,143462,143424,138900","Lithuania","gallery",[143482,138900,143430,143431,143424,138901,143455,143419,144735,143462,143467,143460,138899,144728,144722,138902,138904,144753,144756,144776,144782,144762,144765,144763,144772,144774,144778]);galleries[17343]=new gallery(17343,"189632,189622,189614,189531","Portugal","gallery",[189531,189592,189612,189614,189630,189654,189656,189622,189632,189639,189643,189644,189646,189653]);galleries[215658]=new gallery(215658,"3523682","Maslenitsa - Russian Festival in London 2009","gallery",[3523701,3523681,3523683,3523703,3523704,3523680,3523705,3523732,3523682,3523731,3523733,3523730,3523842,3523749,3523735,3523742]);var imageSets=new Object();imageSets[1]="189643,144765,144763,138913";imageSets[2]="3523682,189632,189622,189614,189531,164101,164099,164065,144753,143482,143467,143462,143424,140133,140124,138900,138898,138897,138896";imageSets[3]="3523842,3523749,3523742,3523735,3523733,3523732,3523731,3523730,3523705,3523704,3523703,3523701,3523683,3523682,3523681,3523680,189656,189654,189653,189646,189644,189643,189639,189632,189630,189622,189614,189612,189592,189531,164116,164112,164111,164108,164106,164103,164102,164101,164099,164096,164093,164092,164086,164084,164068,164065,164047,144782,144778,144776";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/pmayon/images";break}switch(a){case 1:b="http://www1.clikpic.com/pmayon/images";break}switch(a){case 2:b="http://admin.clikpic.com/pmayon/images";break}switch(a){case 24:b="http://tpc15/clikpic/pmayon/images";break}switch(a){case 4:b="http://www.clikchurch.com/pmayon/images";break}switch(a){case 5:b="http://www2.clikpic.com/pmayon/images";break}switch(a){case 22:b="http://tpc5/clikpic/pmayon/images";break}switch(a){case 23:b="http://tpc10/clikpic/pmayon/images";break}switch(a){case 25:b="http://tpc16/clikpic/pmayon/images";break}switch(a){case 15:b="http://www3.clikpic.com/pmayon/images";break}switch(a){case 18:b="http://www4.clikpic.com/pmayon/images";break}switch(a){case 19:b="http://www5.clikpic.com/pmayon/images";break}switch(a){case 31:b="http://www7.clikpic.com/pmayon/images";break}switch(a){case 32:b="http://admin2.clikpic.com/pmayon/images";break}switch(a){case 33:b="http://www8.clikpic.com/pmayon/images";break}switch(a){case 34:b="http://www9.clikpic.com/pmayon/images";break}switch(a){case 35:b="http://admin3.clikpic.com/pmayon/images";break}switch(a){case 37:b="http://admin4.clikpic.com/pmayon/images";break}switch(a){case 38:b="http://admin5.clikpic.com/pmayon/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="Photos by Patrick Mayon: "+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+'")'})}}};
