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[3317196]=new thumbnail(3317196,"","Joy","Joy_thumb.JPG",130,113,32);thumbnails[2050767]=new thumbnail(2050767,"304069","Boggy Landscape, Joyce's Country, Ireland","Conemarra_thumb.JPG",130,109,32);thumbnails[2050816]=new thumbnail(2050816,"304069","Langhe 4 ","Langhe_thumb.JPG",130,93,32);thumbnails[2050824]=new thumbnail(2050824,"304069","Langhe 3","Langhe3_thumb.JPG",130,130,32);thumbnails[2050825]=new thumbnail(2050825,"304069","Langhe 1","Langhe4_thumb.JPG",130,94,32);thumbnails[2050830]=new thumbnail(2050830,"304069","Pen Ponds, Richmond Park ","PenPonds_thumb.JPG",130,96,32);thumbnails[2050844]=new thumbnail(2050844,"304069","Suffolk Marshes","SuffolkMarshes2_thumb.jpg",130,100,32);thumbnails[2050853]=new thumbnail(2050853,"304069","The Old Man of Storr","TheOldManofStorr_thumb.JPG",130,97,32);thumbnails[2063799]=new thumbnail(2063799,"304069","Piova Massaia","Piova Massia from Cocconato1_thumb.JPG",130,101,32);thumbnails[2063805]=new thumbnail(2063805,"304069","Stones in the Landscape","Stones in the landscape1_thumb.JPG",130,129,32);thumbnails[2063811]=new thumbnail(2063811,"304069","Tall Trees","Tall Trees1_thumb.JPG",130,108,32);thumbnails[3314565]=new thumbnail(3314565,"304069","Robella","Robella_thumb.jpg",130,103,32);thumbnails[3314575]=new thumbnail(3314575,"304069","Sunset over Banengo","Banengo tramonto_thumb.jpg",130,106,32);thumbnails[5389691]=new thumbnail(5389691,"304069","Yellow Trees","Monferrato__Verde_thumb.jpg",130,129,32);thumbnails[5389763]=new thumbnail(5389763,"304069","Tuffo Church 3","Tuffo_Church_3_thumb.jpg",130,132,32);thumbnails[5389637]=new thumbnail(5389637,"304069","The Ruined House","casa_vecchia_2_thumb.jpg",130,130,32);thumbnails[2050810]=new thumbnail(2050810,"304068","Storm over the Pyrenees","StormoverthePyrenees_thumb.JPG",130,87,32);thumbnails[2063800]=new thumbnail(2063800,"304068","Storm, Pyrenees","Pyrenees storm1_thumb.JPG",130,131,32);thumbnails[3314497]=new thumbnail(3314497,"304068","Valle Chisone 1","valle chissone 1_thumb.JPG",130,107,32);thumbnails[3314550]=new thumbnail(3314550,"304068","Valle Chisone 3","valle chissone 3_thumb.jpg",130,105,32);thumbnails[3314553]=new thumbnail(3314553,"304068","Valle Chisone 4","valle chissone 4_thumb.jpg",130,103,32);thumbnails[3314548]=new thumbnail(3314548,"304068","Valle Chisone 2","valle chissone 2_thumb.JPG",130,107,32);thumbnails[5389750]=new thumbnail(5389750,"304070","Scarpata di Tufo 4","scarpata_di_tufo_1_thumb.jpg",130,131,32);thumbnails[5389804]=new thumbnail(5389804,"304070","Summer Green 5","verde_destate_5_thumb.jpg",130,128,32);thumbnails[5389811]=new thumbnail(5389811,"304070","Summer Green 6","Verde_destate_6_thumb.jpg",130,129,32);thumbnails[5389739]=new thumbnail(5389739,"304070","Scarpata di Tufo 3","scarpata_di_tufo2_thumb.jpg",130,128,32);thumbnails[2050768]=new thumbnail(2050768,"304071","Mountains and Sea Western Ireland","MountainsandseaWIreland_thumb.JPG",130,86,32);thumbnails[2050814]=new thumbnail(2050814,"304071","Rocky Beach West Ireland","RockybeachWesternIreland_thumb.JPG",130,131,32);thumbnails[3310337]=new thumbnail(3310337,"304071","Storm Over Mull 3","Storm over Mull 3_thumb.JPG",130,102,32);thumbnails[2050807]=new thumbnail(2050807,"304071","Kyle Beach West Ireland","Kyle Beach_thumb.JPG",130,128,32);thumbnails[3314366]=new thumbnail(3314366,"304082","Mountains near Argentera","Montagnevicino Argentera_thumb.JPG",130,103,32);thumbnails[5389681]=new thumbnail(5389681,"304082","The Tree in the Snow","Lo_Albero_Nella_Neve_thumb.jpg",130,128,32);thumbnails[5389670]=new thumbnail(5389670,"304082","The Chapel in the Snow","La_Capella_Nella_Neve_thumb.jpg",130,131,32);thumbnails[2050738]=new thumbnail(2050738,"201457","The Alps from Cocconato","AlpsfromCocconato_thumb.jpg",130,125,32);thumbnails[2050747]=new thumbnail(2050747,"201457","The Alps from the Colline del Po","BackroadtoCocconato_thumb.jpg",130,130,32);thumbnails[2050763]=new thumbnail(2050763,"201457","Banengo","Banengo_thumb.jpg",130,102,32);thumbnails[2050849]=new thumbnail(2050849,"201457","Montiglio","Muresengo_thumb.jpg",130,133,32);thumbnails[2050857]=new thumbnail(2050857,"201457","Piova Massaia","PiovaMassaia_thumb.jpg",130,125,32);thumbnails[2050863]=new thumbnail(2050863,"201457","Road to the Coullins","Coullins_thumb.jpg",130,101,32);thumbnails[2063780]=new thumbnail(2063780,"201457","Langdale Pikes","Langdale Pikes1_thumb.JPG",130,130,32);thumbnails[2063781]=new thumbnail(2063781,"201457","Autumn Trees 1","Autumn Trees 11_thumb.JPG",130,131,32);thumbnails[2063783]=new thumbnail(2063783,"201457","Autumn Trees 2","Autumn trees 21_thumb.JPG",130,96,32);thumbnails[2063786]=new thumbnail(2063786,"201457","Autumn, Banengo","Autumn, Banengo1_thumb.JPG",130,131,32);thumbnails[2063790]=new thumbnail(2063790,"201457","Cornish Beach New Year's Day","Cornish Beach, New Year's Day1_thumb.JPG",130,129,32);thumbnails[2063793]=new thumbnail(2063793,"201457","Joyce's Country, Connemara","Joyce's Country1_thumb.JPG",130,131,32);thumbnails[2063796]=new thumbnail(2063796,"201457","Mountain Stream, Cumbria","Mountain stream Cumbria1_thumb.JPG",130,130,32);thumbnails[2063797]=new thumbnail(2063797,"201457","Olive Trees, Provence","Olive trees greece1_thumb.JPG",130,129,32);thumbnails[2063802]=new thumbnail(2063802,"201457","Rocky Outcrop, Skye","Skye Outcrop1_thumb.JPG",130,130,32);thumbnails[2063809]=new thumbnail(2063809,"201457","Storm over Mull","Storm over Mull1_thumb.JPG",130,101,32);thumbnails[2063813]=new thumbnail(2063813,"201457","Tuffo Church","Tuffo Church1_thumb.JPG",130,128,32);thumbnails[2063831]=new thumbnail(2063831,"201457","Tuffo Cart","Tuffocart_thumb.jpg",130,127,32);thumbnails[3282902]=new thumbnail(3282902,"201457","Summer Green 2","Verde d'estate 2_thumb.jpg",130,131,32);thumbnails[3310331]=new thumbnail(3310331,"201457","Yorkshire Dales","yorkshiredales_thumb.jpg",130,132,32);thumbnails[3310381]=new thumbnail(3310381,"201457","Skye 1","Skye 1_thumb.JPG",130,97,32);thumbnails[3314255]=new thumbnail(3314255,"201457","Langhe 2","Langhe21_thumb.JPG",130,93,32);thumbnails[3314260]=new thumbnail(3314260,"201457","The Langhe, Italy","The Langhe, Italy_thumb.JPG",130,99,32);thumbnails[3314271]=new thumbnail(3314271,"201457","Trees atTuffo","Alberi di Tuffo_thumb.jpg",130,129,32);thumbnails[3314282]=new thumbnail(3314282,"201457","Barbaresco","Barbaresco_thumb.jpg",130,128,32);thumbnails[3314288]=new thumbnail(3314288,"201457","Cocconato","Cocconato_thumb.jpg",130,106,32);thumbnails[3314291]=new thumbnail(3314291,"201457","Misty hills near Brozolo","Collina pioggerellina vicino a Brozolo_thumb.jpg",130,130,32);thumbnails[3314293]=new thumbnail(3314293,"201457","Inishboffin","Inishboffin2_thumb.JPG",130,128,32);thumbnails[3314302]=new thumbnail(3314302,"201457","The Old House","La Casa Vecchia - Pavese_thumb.jpg",130,127,32);thumbnails[3314312]=new thumbnail(3314312,"201457","Tree Richmond Park","Tree, Richmond Park_thumb.jpg",130,121,32);thumbnails[3314317]=new thumbnail(3314317,"201457","The Road to Cocconato","La Strada a Cocconato_thumb.jpg",130,130,32);thumbnails[3314349]=new thumbnail(3314349,"201457","Summer Green 1","Verde d'estate 1_thumb.jpg",130,129,32);thumbnails[3314354]=new thumbnail(3314354,"201457","Skye 2","Skye 2_thumb.JPG",130,108,32);thumbnails[3314583]=new thumbnail(3314583,"201457","Vines in the Langhe of Pavese","Le Vigne di Pavese_thumb.jpg",130,98,32);thumbnails[5384915]=new thumbnail(5384915,"201457","Beach West Wales","Beach_W_Wales_thumb.JPG",130,132,32);thumbnails[5389619]=new thumbnail(5389619,"201457","Banengo Nella Nevica","Banengo_Nella_Neve_thumb.jpg",130,128,32);thumbnails[5389717]=new thumbnail(5389717,"201457","Montechiaro ","montechiaro_nr_thumb.JPG",130,128,32);thumbnails[5389720]=new thumbnail(5389720,"201457","Monferrato Nevicata","Monferrato_Nevicata_thumb.jpg",130,135,32);thumbnails[5389730]=new thumbnail(5389730,"201457","Cornish Beach","Cornish_beach1_thumb.JPG",130,130,32);thumbnails[5389731]=new thumbnail(5389731,"201457","Tramonte, Monferrato","Monferrato_Tramonte_dEstate_thumb.jpg",130,132,32);thumbnails[5389733]=new thumbnail(5389733,"201457","Montiglio","Montiglio_2_thumb.jpg",130,131,32);thumbnails[5389736]=new thumbnail(5389736,"201457","Piova Massaia Nevicata","Piova_Massaia_Nevicata_thumb.jpg",130,128,32);thumbnails[5389758]=new thumbnail(5389758,"201457","Storm on the Plain","Storm_on_the_plain_thumb.jpg",130,129,32);thumbnails[5389783]=new thumbnail(5389783,"201457","Twelve Pins, Joyc's Country","Twelve_Pins_Joyce_Country_thumb.JPG",130,131,32);thumbnails[5389790]=new thumbnail(5389790,"201457","Summer Green 4","Verde_destate_4_thumb.jpg",130,130,32);thumbnails[5389824]=new thumbnail(5389824,"201457","Towards Asti from Muresengo","Verso_Asti_da_Muresengo_thumb.jpg",130,130,32);thumbnails[5389787]=new thumbnail(5389787,"201457","Tuffo Church 2","chiesa_di_Tuffo_2_thumb.jpg",130,129,32);var galleries=new Object();galleries[304069]=new gallery(304069,"5389637,2050853,2050830,2050767","Landscapes","gallery",[2050767,2050816,2050824,2050825,2050830,2050844,2050853,2063799,2063805,2063811,3314565,3314575,5389691,5389763,5389637]);galleries[304068]=new gallery(304068,"3314548,2050810","Mountains","gallery",[2050810,2063800,3314497,3314550,3314553,3314548]);galleries[304070]=new gallery(304070,"5389739","Nature","gallery",[5389750,5389804,5389811,5389739]);galleries[304071]=new gallery(304071,"2050807","Seascapes","gallery",[2050768,2050814,3310337,2050807]);galleries[304082]=new gallery(304082,"5389670","Snowscapes","gallery",[3314366,5389681,5389670]);galleries[201457]=new gallery(201457,"5389787,3282902","Archives","gallery",[2050738,2050747,2050763,2050849,2050857,2050863,2063780,2063781,2063783,2063786,2063790,2063793,2063796,2063797,2063802,2063809,2063813,2063831,3282902,3310331,3310381,3314255,3314260,3314271,3314282,3314288,3314291,3314293,3314302,3314312,3314317,3314349,3314354,3314583,5384915,5389619,5389717,5389720,5389730,5389731,5389733,5389736,5389758,5389783,5389790,5389824,5389787]);var imageSets=new Object();imageSets[1]="2050763";imageSets[2]="5389787,5389739,5389670,5389637,3317196,3314548,3282902,2050853,2050830,2050810,2050807,2050767";imageSets[3]="3310337,2063805,2063800,2050853,2050844,2050830";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/joymoore/images";break}switch(a){case 1:b="http://www1.clikpic.com/joymoore/images";break}switch(a){case 2:b="http://admin.clikpic.com/joymoore/images";break}switch(a){case 24:b="http://tpc15/clikpic/joymoore/images";break}switch(a){case 4:b="http://www.clikchurch.com/joymoore/images";break}switch(a){case 5:b="http://www2.clikpic.com/joymoore/images";break}switch(a){case 22:b="http://tpc5/clikpic/joymoore/images";break}switch(a){case 23:b="http://tpc10/clikpic/joymoore/images";break}switch(a){case 25:b="http://tpc16/clikpic/joymoore/images";break}switch(a){case 15:b="http://www3.clikpic.com/joymoore/images";break}switch(a){case 18:b="http://www4.clikpic.com/joymoore/images";break}switch(a){case 19:b="http://www5.clikpic.com/joymoore/images";break}switch(a){case 31:b="http://www7.clikpic.com/joymoore/images";break}switch(a){case 32:b="http://admin2.clikpic.com/joymoore/images";break}switch(a){case 33:b="http://www8.clikpic.com/joymoore/images";break}switch(a){case 34:b="http://www9.clikpic.com/joymoore/images";break}switch(a){case 35:b="http://admin3.clikpic.com/joymoore/images";break}switch(a){case 37:b="http://admin4.clikpic.com/joymoore/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="Joy Moore Paintings: "+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+'")'})}}};