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[4324368]=new thumbnail(4324368,"30679","","about1_thumb.jpg",130,110,18);thumbnails[5204258]=new thumbnail(5204258,"30679","","d_thumb.jpg",130,50,18);thumbnails[5614229]=new thumbnail(5614229,"30679","","243560x560_thumb.jpg",130,130,18);thumbnails[5620867]=new thumbnail(5620867,"30679","","_245560x236_thumb.jpg",130,55,18);thumbnails[5614375]=new thumbnail(5614375,"30679","","246560x235_thumb.jpg",130,55,18);thumbnails[5614475]=new thumbnail(5614475,"30679","","244560x240_thumb.jpg",130,56,18);thumbnails[5615782]=new thumbnail(5615782,"30679","","_234560_x_235_thumb.jpg",130,55,18);thumbnails[5620806]=new thumbnail(5620806,"30679","","___67560x246_thumb.jpg",130,57,18);thumbnails[5620825]=new thumbnail(5620825,"30679","","_217560x235_thumb.jpg",130,55,18);thumbnails[2469723]=new thumbnail(2469723,"158741","Pomegranates","131600272_thumb.jpg",130,164,18);thumbnails[2469727]=new thumbnail(2469727,"158741","","131600261_thumb.jpg",130,164,18);thumbnails[2469730]=new thumbnail(2469730,"158741","","131600251_thumb.jpg",130,162,18);thumbnails[2469732]=new thumbnail(2469732,"158741","","131600141_thumb.jpg",130,164,18);thumbnails[2469238]=new thumbnail(2469238,"158741","Reflections","13160010_thumb.jpg",130,164,18);thumbnails[2469293]=new thumbnail(2469293,"158741","","13160008_thumb.jpg",130,164,18);thumbnails[2469370]=new thumbnail(2469370,"158741","","13160039_thumb.jpg",130,165,18);thumbnails[2464574]=new thumbnail(2464574,"158741","","13160002_thumb.jpg",130,163,18);thumbnails[2469591]=new thumbnail(2469591,"158741","Floating","13160003_thumb.jpg",130,165,18);thumbnails[2469603]=new thumbnail(2469603,"158741","","13160028_thumb.jpg",130,164,18);thumbnails[2469606]=new thumbnail(2469606,"158741","","13160022_thumb.jpg",130,163,18);thumbnails[2471528]=new thumbnail(2471528,"158749","","32911_thumb.jpg",130,173,18);thumbnails[2471529]=new thumbnail(2471529,"158749","","33101_thumb.jpg",130,176,18);thumbnails[2471530]=new thumbnail(2471530,"158749","","33181_thumb.jpg",130,173,18);thumbnails[2471531]=new thumbnail(2471531,"158749","","33681_thumb.jpg",130,173,18);thumbnails[2471505]=new thumbnail(2471505,"158749","","3307_thumb.jpg",130,98,18);thumbnails[2471506]=new thumbnail(2471506,"158749","","3301_thumb.jpg",130,101,18);thumbnails[2471508]=new thumbnail(2471508,"158749","","3304_thumb.jpg",130,93,18);thumbnails[2471519]=new thumbnail(2471519,"158749","","3323_thumb.jpg",130,107,18);thumbnails[5633014]=new thumbnail(5633014,"319436","Zurbaran","IMG_4444_thumb.jpg",130,153,18);thumbnails[5632765]=new thumbnail(5632765,"319436","The Passion","246400x4701_thumb.jpg",130,154,18);thumbnails[6087303]=new thumbnail(6087303,"319436","Mantegna","IMG_4664_thumb.jpg",130,163,18);thumbnails[5727103]=new thumbnail(5727103,"319436","Ecce Homo","247500x500_thumb.jpg",130,129,18);thumbnails[6087300]=new thumbnail(6087300,"319436","Piero","IMG_4663_thumb.jpg",130,92,18);thumbnails[6087290]=new thumbnail(6087290,"319436","Flagellation","249400x500_thumb.jpg",130,109,18);thumbnails[5202968]=new thumbnail(5202968,"319436","The Origins of Argument","243_thumb.jpg",130,95,18);thumbnails[360358]=new thumbnail(360358,"29631","Studio of Ghirlandaio","180_thumb.jpg",130,162,18);thumbnails[360366]=new thumbnail(360366,"29631","Studio of Botticelli"," 181_thumb.jpg",130,164,18);thumbnails[360397]=new thumbnail(360397,"29631","Studio of Gericault","119_thumb.jpg",130,160,18);thumbnails[360399]=new thumbnail(360399,"29631","Studio of Brugghen","118_thumb.jpg",130,160,18);thumbnails[360419]=new thumbnail(360419,"29631","Card from Rome"," 189_thumb.jpg",130,129,18);thumbnails[360423]=new thumbnail(360423,"29631","Card from Florence"," 186_thumb.jpg",130,131,18);thumbnails[363330]=new thumbnail(363330,"29636","The Singer","43_thumb.jpg",130,160,18);thumbnails[363105]=new thumbnail(363105,"29636","Masquerade","61_thumb.jpg",130,159,18);thumbnails[363154]=new thumbnail(363154,"29636","In the Morning Light","42_thumb.jpg",130,160,18);thumbnails[363315]=new thumbnail(363315,"29636","Legacy","46_thumb.jpg",130,160,18);thumbnails[363127]=new thumbnail(363127,"29636","Cassandra","cassandra_thumb.jpg",130,158,18);thumbnails[360435]=new thumbnail(360435,"29636","First Touch","218_thumb.jpg",130,159,18);thumbnails[360690]=new thumbnail(360690,"29636","Ritual"," 220_thumb.jpg",130,156,18);thumbnails[2482674]=new thumbnail(2482674,"29636","Model in The Studio","48_thumb.jpg",130,162,18);thumbnails[5023113]=new thumbnail(5023113,"29634","Nude Torso","torso2_thumb.jpg",130,163,18);thumbnails[5023120]=new thumbnail(5023120,"29634","Nude Torso","torso3_thumb.jpg",130,162,18);thumbnails[360812]=new thumbnail(360812,"29634","By the Black Screen"," 135_thumb.jpg",130,162,18);thumbnails[363151]=new thumbnail(363151,"29634","Nude Seated","nude_thumb.jpg",130,163,18);thumbnails[369962]=new thumbnail(369962,"29634","Seated Nude","97_thumb.jpg",130,163,18);thumbnails[360813]=new thumbnail(360813,"29634","Character Study, I"," 212_thumb.jpg",130,130,18);thumbnails[360815]=new thumbnail(360815,"29634","Character Study, III"," 213_thumb.jpg",130,131,18);thumbnails[360816]=new thumbnail(360816,"29634","Naked Portrait","134_thumb.jpg",130,106,18);thumbnails[363067]=new thumbnail(363067,"29633","Study of a Head, I","study_thumb.jpg",130,130,18);thumbnails[363073]=new thumbnail(363073,"29633","Study of a Head, II","head_thumb.jpg",130,130,18);thumbnails[363336]=new thumbnail(363336,"29633","Head Study, IV","interview_thumb.jpg",130,130,18);thumbnails[360825]=new thumbnail(360825,"29633","Character Study, II"," 214_thumb.jpg",130,130,18);thumbnails[2767961]=new thumbnail(2767961,"29633","Natalie","b_thumb.jpg",130,130,18);thumbnails[3083071]=new thumbnail(3083071,"29633","The Player"," 234_thumb.jpg",130,129,2);thumbnails[2483130]=new thumbnail(2483130,"29633","Lady in a Turban, II","8_thumb.jpg",130,133,18);thumbnails[375834]=new thumbnail(375834,"29633","Self Portrait","156_thumb.jpg",130,130,18);thumbnails[5386972]=new thumbnail(5386972,"284304","Self  No.48","400x400px_thumb.jpg",130,130,18);thumbnails[5629053]=new thumbnail(5629053,"284304","Woman in White","_245500x500_thumb.jpg",130,130,18);thumbnails[5202926]=new thumbnail(5202926,"284304","Daniel","111_thumb.jpg",130,128,18);thumbnails[2482673]=new thumbnail(2482673,"284304","Painter's Mother","174_thumb.jpg",130,115,18);thumbnails[363161]=new thumbnail(363161,"284304","To the One Who Knows","dreamer_thumb.jpg",130,159,18);thumbnails[363398]=new thumbnail(363398,"284304","St Francis and an Angel","francis_thumb.jpg",130,163,18);thumbnails[361386]=new thumbnail(361386,"284304","Sallyanne","217_thumb.jpg",130,163,18);thumbnails[360893]=new thumbnail(360893,"284304","Interview"," 127_thumb.jpg",130,162,18);thumbnails[360581]=new thumbnail(360581,"29632","White, Black, Yellow & Blue"," 1641_thumb.jpg",130,130,18);thumbnails[360585]=new thumbnail(360585,"29632","Black, Red, Yellow & Blue"," 172_thumb.jpg",130,130,18);thumbnails[360439]=new thumbnail(360439,"29632","Vanity"," 175_thumb.jpg",130,131,18);thumbnails[360619]=new thumbnail(360619,"29632","Whispers"," 182_thumb.jpg",130,130,18);thumbnails[360621]=new thumbnail(360621,"29632","Belgian Pears"," 179_thumb.jpg",130,131,18);thumbnails[360416]=new thumbnail(360416,"29632","Grand Lotus"," 207_thumb.jpg",130,130,18);thumbnails[360613]=new thumbnail(360613,"29632","Reflections"," 199_thumb.jpg",130,130,18);thumbnails[2474160]=new thumbnail(2474160,"29637","Composition, I","c225_thumb.jpg",130,131,18);thumbnails[2474159]=new thumbnail(2474159,"29637","Composition, III","c224_thumb.jpg",130,130,18);thumbnails[4002065]=new thumbnail(4002065,"29637","Kite in the Studio","241vk_thumb.jpg",130,130,18);thumbnails[4002061]=new thumbnail(4002061,"29637","Kite in the Studio","240vk_thumb.jpg",130,130,18);thumbnails[4002049]=new thumbnail(4002049,"29637","Orpheus and Eurydice  ","239vk_thumb.jpg",130,130,18);thumbnails[4002059]=new thumbnail(4002059,"29637","Orpheus","238vk_thumb.jpg",130,130,18);thumbnails[360707]=new thumbnail(360707,"29637","Composition"," 196_thumb.jpg",130,107,18);var galleries=new Object();galleries[30679]=new gallery(30679,"5620867,5620825,5620806,5615782,5614475,5614375,5614229,5204258,4324368","1","section50148",[4324368,5204258,5614229,5620867,5614375,5614475,5615782,5620806,5620825]);galleries[158741]=new gallery(158741,"2464574","paintings","section201172",[2469723,2469727,2469730,2469732,2469238,2469293,2469370,2464574,2469591,2469603,2469606]);galleries[158749]=new gallery(158749,"2471528","site images","section201172",[2471528,2471529,2471530,2471531,2471505,2471506,2471508,2471519]);galleries[319436]=new gallery(319436,"5632765","2010","section48818",[5633014,5632765,6087303,5727103,6087300,6087290,5202968]);galleries[29631]=new gallery(29631,"360358","homage ","section48818",[360358,360366,360397,360399,360419,360423]);galleries[29636]=new gallery(29636,"363154","figure","section48818",[363330,363105,363154,363315,363127,360435,360690,2482674]);galleries[29634]=new gallery(29634,"5023120","nude","section48818",[5023113,5023120,360812,363151,369962,360813,360815,360816]);galleries[29633]=new gallery(29633,"363073","head study","section48818",[363067,363073,363336,360825,2767961,3083071,2483130,375834]);galleries[284304]=new gallery(284304,"5386972","portrait","section48818",[5386972,5629053,5202926,2482673,363161,363398,361386,360893]);galleries[29632]=new gallery(29632,"360585","still life","section48818",[360581,360585,360439,360619,360621,360416,360613]);galleries[29637]=new gallery(29637,"2474160","compositions","section48818",[2474160,2474159,4002065,4002061,4002049,4002059,360707]);var imageSets=new Object();imageSets[1]="5614229";imageSets[2]="5632765,5386972,5023120,2474160,2471528,2464574,363154,363073,360585,360358";imageSets[3]="5727103";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/Valery/images";break}switch(a){case 1:b="http://www1.clikpic.com/Valery/images";break}switch(a){case 2:b="http://admin.clikpic.com/Valery/images";break}switch(a){case 24:b="http://tpc15/clikpic/Valery/images";break}switch(a){case 4:b="http://www.clikchurch.com/Valery/images";break}switch(a){case 5:b="http://www2.clikpic.com/Valery/images";break}switch(a){case 22:b="http://tpc5/clikpic/Valery/images";break}switch(a){case 23:b="http://tpc10/clikpic/Valery/images";break}switch(a){case 25:b="http://tpc16/clikpic/Valery/images";break}switch(a){case 15:b="http://www3.clikpic.com/Valery/images";break}switch(a){case 18:b="http://www4.clikpic.com/Valery/images";break}switch(a){case 19:b="http://www5.clikpic.com/Valery/images";break}switch(a){case 31:b="http://www7.clikpic.com/Valery/images";break}switch(a){case 32:b="http://admin2.clikpic.com/Valery/images";break}switch(a){case 33:b="http://www8.clikpic.com/Valery/images";break}switch(a){case 34:b="http://www9.clikpic.com/Valery/images";break}switch(a){case 35:b="http://admin3.clikpic.com/Valery/images";break}switch(a){case 37:b="http://admin4.clikpic.com/Valery/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("section48818"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section48818.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("section48818"!=""){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="Valery Koroshilov Fine Art Painting: "+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+'")'})}}};