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[4801469]=new thumbnail(4801469,"216212","P1","P1_thumb.JPG",130,102,15);thumbnails[4715240]=new thumbnail(4715240,"216212","P2","P2_thumb.JPG",130,162,15);thumbnails[5019113]=new thumbnail(5019113,"216212","P32","P32_thumb.JPG",130,97,15);thumbnails[4715239]=new thumbnail(4715239,"216212","P3","SEX_13_thumb.JPG",130,104,15);thumbnails[4715238]=new thumbnail(4715238,"216212","P4","SEX_12_thumb.JPG",130,104,15);thumbnails[5019108]=new thumbnail(5019108,"216212","P31","P31_thumb.JPG",130,97,15);thumbnails[5019103]=new thumbnail(5019103,"216212","P30","PRIMAL_3_thumb.JPG",130,153,15);thumbnails[5018979]=new thumbnail(5018979,"216212","P29","P29_thumb.JPG",130,108,15);thumbnails[4123017]=new thumbnail(4123017,"216212","P5","DESIRE_1_thumb.JPG",130,86,15);thumbnails[3948977]=new thumbnail(3948977,"216212","P6","SEXUAL_FANTASY_2_thumb.JPG",130,131,15);thumbnails[3952804]=new thumbnail(3952804,"216212","P7","SEXUAL_FANTASY_1_thumb.JPG",130,174,15);thumbnails[3780780]=new thumbnail(3780780,"216212","P8","Abandonment_thumb.JPG",130,63,15);thumbnails[3780783]=new thumbnail(3780783,"216212","P9","DSC_00051_thumb.JPG",130,130,15);thumbnails[3539015]=new thumbnail(3539015,"216212","P10","SEX_CARTOON_thumb.JPG",130,131,15);thumbnails[3542009]=new thumbnail(3542009,"216212","P11","SEX_CARTOON_2_2_thumb.JPG",130,129,15);thumbnails[3542058]=new thumbnail(3542058,"216212","P12","sex_in_progress1_thumb.jpg",130,64,15);thumbnails[3542068]=new thumbnail(3542068,"216212","P13","sex_in_progress2_thumb.jpg",130,86,15);thumbnails[3542073]=new thumbnail(3542073,"216212","P14","sex_in_progress3_thumb.jpg",130,104,15);thumbnails[3542080]=new thumbnail(3542080,"216212","P15","sex_in_progress4_thumb.jpg",130,103,15);thumbnails[3556524]=new thumbnail(3556524,"216212","P16","Sex_1_thumb.jpg",130,106,15);thumbnails[3556545]=new thumbnail(3556545,"216212","P17","ANIMAL_2__thumb.jpg",130,129,15);thumbnails[3557182]=new thumbnail(3557182,"216212","P18","THE_MASTURBATOR_thumb.jpg",130,132,15);thumbnails[3557190]=new thumbnail(3557190,"216212","P19","MASTURBATOR_STUDY_1_thumb.jpg",130,129,15);thumbnails[3557197]=new thumbnail(3557197,"216212","P20","MASTURBATOR_STUDY_2_thumb.jpg",130,133,15);thumbnails[3557220]=new thumbnail(3557220,"216212","P21","Sex_2_thumb.JPG",130,107,15);thumbnails[3557239]=new thumbnail(3557239,"216212","P22","P22_thumb.JPG",130,131,15);thumbnails[3557402]=new thumbnail(3557402,"216212","P23","Sex_11_thumb.jpg",130,160,15);thumbnails[3557423]=new thumbnail(3557423,"216212","P24","SEX_3___195CM_X_39CM_-_Copy_thumb.jpg",130,64,15);thumbnails[3557461]=new thumbnail(3557461,"216212","P25","Arousal_1_thumb.jpg",130,130,15);thumbnails[3557465]=new thumbnail(3557465,"216212","P26","Sex_Act_1_thumb.jpg",130,131,15);thumbnails[3557467]=new thumbnail(3557467,"216212","P27","Attainment__1_thumb.jpg",130,129,15);thumbnails[3557482]=new thumbnail(3557482,"216212","P28","AROUSAL_STUDY_1_thumb.JPG",130,129,15);thumbnails[5376635]=new thumbnail(5376635,"216212","P33","P33_thumb.JPG",130,129,15);thumbnails[5376660]=new thumbnail(5376660,"216212","P34","P34_thumb.JPG",130,131,15);thumbnails[4854383]=new thumbnail(4854383,"216213","Untitled","DSC_0012_thumb.JPG",130,171,15);thumbnails[4715590]=new thumbnail(4715590,"216213","DESIRE 62","Desire_drawing0062_thumb.jpg",130,110,15);thumbnails[4715600]=new thumbnail(4715600,"216213","DESIRE 63","Desire_drawing0063_thumb.jpg",130,109,15);thumbnails[4715586]=new thumbnail(4715586,"216213","DESIRE 61","Desire_drawing0061_thumb.jpg",130,136,15);thumbnails[3692626]=new thumbnail(3692626,"216213","DESIRE DRAWING 24","DESIRE_DRAWING0024_thumb.jpg",130,180,15);thumbnails[3692630]=new thumbnail(3692630,"216213","DESIRE DRAWING 16","DESIRE_DRAWING0016_thumb.jpg",130,167,15);thumbnails[3692632]=new thumbnail(3692632,"216213","DESIRE DRAWING 17","DESIRE_DRAWING0017_thumb.jpg",130,167,15);thumbnails[3692637]=new thumbnail(3692637,"216213","DESIRE DRAWING 19","DESIRE_DRAWING0019_thumb.jpg",130,138,15);thumbnails[3692642]=new thumbnail(3692642,"216213","DESIRE DRAWING 22","DESIRE_DRAWING0022_thumb.jpg",130,122,15);thumbnails[3692647]=new thumbnail(3692647,"216213","DESIRE DRAWING 23","DESIRE_DRAWING0023_thumb.jpg",130,122,15);thumbnails[3692655]=new thumbnail(3692655,"216213","DESIRE DRAWING 27","DESIRE_DRAWING0027_thumb.jpg",130,203,15);thumbnails[3692664]=new thumbnail(3692664,"216213","DESIRE DRAWING 28","DESIRE_DRAWING0028_thumb.jpg",130,183,15);thumbnails[3692676]=new thumbnail(3692676,"216213","DESIRE DRAWING 29","DESIRE_DRAWING0029_thumb.jpg",130,183,15);thumbnails[3543857]=new thumbnail(3543857,"216213","Desire drawing 42","Art_and_Sex0042_thumb.jpg",130,94,15);thumbnails[4568200]=new thumbnail(4568200,"264900","WITHDRAWAL","Sculpture_1fin_15_thumb.JPG",130,173,15);thumbnails[3735086]=new thumbnail(3735086,"228010","Duo","unfinished_duo_thumb.jpg",130,62,15);thumbnails[3735079]=new thumbnail(3735079,"228010","","DSC_0005_thumb.JPG",130,86,15);thumbnails[3542692]=new thumbnail(3542692,"216903","Mark in his studio.","me_in_studio_112345_thumb.jpg",130,87,15);thumbnails[3735062]=new thumbnail(3735062,"216903","My studio","studio_3_thumb.JPG",130,196,15);thumbnails[3538389]=new thumbnail(3538389,"216906","Mark Newton","me_artofdesire_thumb.jpg",130,138,15);thumbnails[4821268]=new thumbnail(4821268,"216906","Mark Newton 2009","me4trig_thumb.JPG",130,100,15);thumbnails[3539004]=new thumbnail(3539004,"216904","Sex Cartoon 2","SEX_CARTOON_2_thumb.JPG",130,51,15);thumbnails[4950019]=new thumbnail(4950019,"216904","Mark Newton","website_homepage1_thumb.jpg",130,87,15);var galleries=new Object();galleries[216212]=new gallery(216212,"4801469","PAINTINGS","gallery",[4801469,4715240,5019113,4715239,4715238,5019108,5019103,5018979,4123017,3948977,3952804,3780780,3780783,3539015,3542009,3542058,3542068,3542073,3542080,3556524,3556545,3557182,3557190,3557197,3557220,3557239,3557402,3557423,3557461,3557465,3557467,3557482,5376635,5376660]);galleries[216213]=new gallery(216213,"3543857","DRAWINGS","gallery",[4854383,4715590,4715600,4715586,3692626,3692630,3692632,3692637,3692642,3692647,3692655,3692664,3692676,3543857]);galleries[264900]=new gallery(264900,"4568200","SCULPTURE","gallery",[4568200]);galleries[228010]=new gallery(228010,"3735086,3735079","UNFINISHED WORK","gallery",[3735086,3735079]);galleries[216903]=new gallery(216903,"3542692","IN MY STUDIO","gallery",[3542692,3735062]);galleries[216906]=new gallery(216906,"3538389","ME","gallery",[3538389,4821268]);galleries[216904]=new gallery(216904,"3539004","PROMO IMAGES","gallery",[3539004,4950019]);var imageSets=new Object();imageSets[1]="4950019";imageSets[2]="4801469,4568200,3543857,3542692,3539004,3538389";imageSets[3]="5376660,5376635,5019113,5019108,5019103,5018979,4950019,4854383,4821268,4801469,4715600,4715590,4715586,4715240,4715239,4715238,4568200,4123017,3952804,3948977,3780783,3780780,3735086,3735079,3735062,3692676,3692664,3692655,3692647,3692642,3692637,3692632,3692630,3692626,3557482,3557467,3557465,3557461,3557423,3557402,3557239,3557220,3557197,3557190,3557182,3556545,3556524,3543857,3542692,3542080";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/marknewton/images";break}switch(a){case 1:b="http://www1.clikpic.com/marknewton/images";break}switch(a){case 2:b="http://admin.clikpic.com/marknewton/images";break}switch(a){case 4:b="http://www.clikchurch.com/marknewton/images";break}switch(a){case 5:b="http://www2.clikpic.com/marknewton/images";break}switch(a){case 15:b="http://www3.clikpic.com/marknewton/images";break}switch(a){case 21:b="http://www6.clikpic.com/marknewton/images";break}switch(a){case 18:b="http://www4.clikpic.com/marknewton/images";break}switch(a){case 19:b="http://www5.clikpic.com/marknewton/images";break}switch(a){case 22:b="http://tpc5/clikpic/marknewton/images";break}switch(a){case 23:b="http://tpc10/clikpic/marknewton/images";break}switch(a){case 24:b="http://tpc15/clikpic/marknewton/images";break}switch(a){case 25:b="http://tpc16/clikpic/marknewton/images";break}switch(a){case 31:b="http://www7.clikpic.com/marknewton/images";break}switch(a){case 32:b="http://admin2.clikpic.com/marknewton/images";break}switch(a){case 33:b="http://www8.clikpic.com/marknewton/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="artofdesire: "+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>Year created </strong>'+photos[b].takendate+"</p>"}if(photos[b].location!=""){a=a+'<p class="imageinfo" id="imageLocation"><strong>Medium </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>Artist </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+'")'})}}};