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[1269586]=new thumbnail(1269586,"","","DSC_0302_thumb.JPG",130,87,1);thumbnails[1270891]=new thumbnail(1270891,"90401","","DSC_00111_thumb.JPG",130,87,1);thumbnails[1281483]=new thumbnail(1281483,"90401","","DSC_0013_thumb.JPG",130,87,1);thumbnails[1281485]=new thumbnail(1281485,"90401","","DSC_0006_thumb.JPG",130,87,1);thumbnails[1281486]=new thumbnail(1281486,"90401","","DSC_0012_thumb.JPG",130,87,1);thumbnails[1281490]=new thumbnail(1281490,"91013","","DSC_0107_thumb.JPG",130,51,1);thumbnails[1281491]=new thumbnail(1281491,"91013","","DSC_0084_thumb.JPG",130,38,1);thumbnails[1281498]=new thumbnail(1281498,"91014","","DSC_0016_thumb.JPG",130,87,1);thumbnails[1281500]=new thumbnail(1281500,"91015","","DSC_0241_thumb.JPG",130,87,1);thumbnails[1289825]=new thumbnail(1289825,"90401","","DSC_0007-1_thumb.JPG",130,87,1);thumbnails[1289828]=new thumbnail(1289828,"91014","","DSC_00461_thumb.JPG",130,87,1);thumbnails[1289831]=new thumbnail(1289831,"91013","","DSC_0061_thumb.JPG",130,87,1);thumbnails[1289832]=new thumbnail(1289832,"91013","","DSC_0033-1_thumb.JPG",130,93,1);thumbnails[1289851]=new thumbnail(1289851,"91014","","DSC_0223_thumb.JPG",130,87,1);thumbnails[1291198]=new thumbnail(1291198,"91584","","DSC_0163_thumb.JPG",130,87,1);thumbnails[1291232]=new thumbnail(1291232,"91014","","DSC_0204_thumb.JPG",130,87,1);thumbnails[1294393]=new thumbnail(1294393,"91015","","DSC_0095-1_thumb.JPG",130,87,1);thumbnails[1294394]=new thumbnail(1294394,"91584","","DSC_0530_thumb.JPG",130,87,1);thumbnails[1294401]=new thumbnail(1294401,"91584","","DSC_0372_thumb.JPG",130,87,1);thumbnails[1294403]=new thumbnail(1294403,"91738","","DSC_0373_thumb.JPG",130,87,1);thumbnails[1294406]=new thumbnail(1294406,"91738","","DSC_0395_thumb.JPG",130,87,1);thumbnails[1294407]=new thumbnail(1294407,"91015","","DSC_0572_thumb.JPG",130,201,1);thumbnails[1294409]=new thumbnail(1294409,"91015","","DSC_0141_thumb.JPG",130,87,1);thumbnails[1294411]=new thumbnail(1294411,"91584","","DSC_0558_thumb.JPG",130,87,1);thumbnails[1294414]=new thumbnail(1294414,"91584","","DSC_0170_thumb.JPG",130,87,1);thumbnails[1295241]=new thumbnail(1295241,"91786","","DSC_0008_thumb.JPG",130,87,1);thumbnails[1295245]=new thumbnail(1295245,"91786","","DSC_0004-1_thumb.JPG",130,87,1);thumbnails[1295394]=new thumbnail(1295394,"91014","","DSC_0265_thumb.JPG",130,87,1);thumbnails[1295401]=new thumbnail(1295401,"91014","","DSC_0285_thumb.JPG",130,87,1);thumbnails[1298538]=new thumbnail(1298538,"91738","","DSC_00112_thumb.JPG",130,84,1);thumbnails[1298539]=new thumbnail(1298539,"91738","","DSC_0020_thumb.JPG",130,194,1);thumbnails[1300612]=new thumbnail(1300612,"90401","","DSC_0031_thumb.JPG",130,87,1);thumbnails[1300876]=new thumbnail(1300876,"91014","","DSC_00121_thumb.JPG",130,46,1);thumbnails[1302383]=new thumbnail(1302383,"91013","","DSC_0053_thumb.JPG",130,87,1);thumbnails[1304571]=new thumbnail(1304571,"91013","","DSC_00122_thumb.JPG",130,53,1);thumbnails[1304861]=new thumbnail(1304861,"91013","","DSC_0005_thumb.JPG",130,87,1);thumbnails[1328694]=new thumbnail(1328694,"91014","","DSC_0164_thumb.JPG",130,87,1);thumbnails[1337681]=new thumbnail(1337681,"91738","","DSC_0032_thumb.JPG",130,98,1);thumbnails[1375363]=new thumbnail(1375363,"91014","","DSC_0045_thumb.JPG",130,87,1);thumbnails[1375368]=new thumbnail(1375368,"91584","","DSC_0026_thumb.JPG",130,87,1);thumbnails[1408504]=new thumbnail(1408504,"97880","","DSC_0073_thumb.JPG",130,87,1);thumbnails[1408507]=new thumbnail(1408507,"97880","","DSC_01631_thumb.JPG",130,194,1);thumbnails[1408509]=new thumbnail(1408509,"97880","","DSC_0231_thumb.JPG",130,194,1);thumbnails[1408511]=new thumbnail(1408511,"97880","","DSC_0243_thumb.JPG",130,87,1);thumbnails[1408513]=new thumbnail(1408513,"97880","","DSC_0110_thumb.JPG",130,175,1);thumbnails[1421450]=new thumbnail(1421450,"91014","","DSC_0120_thumb.JPG",130,87,1);thumbnails[1421453]=new thumbnail(1421453,"91015","","DSC_0233_thumb.JPG",130,87,1);thumbnails[1421461]=new thumbnail(1421461,"91015","","DSC_0176_thumb.JPG",130,87,1);thumbnails[1421463]=new thumbnail(1421463,"91015","","DSC_0320_thumb.JPG",130,87,1);thumbnails[1421468]=new thumbnail(1421468,"91014","","27_thumb.JPG",130,86,1);thumbnails[1421471]=new thumbnail(1421471,"91014","","DSC_0335_thumb.JPG",130,87,1);thumbnails[1522504]=new thumbnail(1522504,"91584","","DSC_0023_thumb.JPG",130,87,1);thumbnails[1673779]=new thumbnail(1673779,"91786","","DSC_0033_thumb.JPG",130,83,1);thumbnails[1781747]=new thumbnail(1781747,"97880","","DSC_0009_thumb.JPG",130,57,1);thumbnails[1781748]=new thumbnail(1781748,"97880","","DSC_0024_thumb.JPG",130,87,1);thumbnails[1781750]=new thumbnail(1781750,"97880","","DSC_0036_thumb.JPG",130,42,1);thumbnails[1781751]=new thumbnail(1781751,"97880","","DSC_0173_thumb.JPG",130,87,1);thumbnails[1781754]=new thumbnail(1781754,"97880","","DSC_00331_thumb.JPG",130,60,1);thumbnails[2078828]=new thumbnail(2078828,"91738","","DSC_0092_thumb.JPG",130,194,1);thumbnails[2494897]=new thumbnail(2494897,"90401","","DSC_0040_thumb.JPG",130,81,1);thumbnails[2511546]=new thumbnail(2511546,"91013","","DSC_0013-1_thumb.JPG",130,87,1);thumbnails[3509679]=new thumbnail(3509679,"90401","","DSC_0035-4_thumb.JPG",130,115,1);thumbnails[3509684]=new thumbnail(3509684,"90401","","DSC_0006_1_thumb.JPG",130,87,1);thumbnails[4499340]=new thumbnail(4499340,"97880","","DSC_0042_thumb.JPG",130,87,1);thumbnails[4499342]=new thumbnail(4499342,"97880","","DSC_0072_thumb.JPG",130,87,1);thumbnails[4499343]=new thumbnail(4499343,"97880","","DSC_0080_thumb.JPG",130,87,1);thumbnails[4499346]=new thumbnail(4499346,"97880","","DSC_0133_thumb.JPG",130,87,1);thumbnails[4499349]=new thumbnail(4499349,"97880","","DSC_0101_thumb.JPG",130,85,1);thumbnails[4499352]=new thumbnail(4499352,"97880","","DSC_0114_thumb.JPG",130,95,1);thumbnails[4499374]=new thumbnail(4499374,"91013","","DSC_0007888_thumb.jpg",130,104,1);thumbnails[4499662]=new thumbnail(4499662,"91013","","DSC_0025_thumb.JPG",130,87,1);thumbnails[1270885]=new thumbnail(1270885,"90178","","DSC_0004_thumb.JPG",130,87,1);thumbnails[1302381]=new thumbnail(1302381,"90178","","DSC_0001_thumb.JPG",130,87,1);var galleries=new Object();galleries[91738]=new gallery(91738,"1294403","Abstract","gallery",[1294403,1294406,1298538,1298539,1337681,2078828]);galleries[90401]=new gallery(90401,"1270891","After dark","gallery",[1270891,1281483,1281485,1281486,1289825,1300612,2494897,3509679,3509684]);galleries[91014]=new gallery(91014,"1295394","Automotive","gallery",[1281498,1289828,1289851,1291232,1295394,1295401,1300876,1328694,1375363,1421450,1421468,1421471]);galleries[91015]=new gallery(91015,"1281500","Candids","gallery",[1281500,1294393,1294407,1294409,1421453,1421461,1421463]);galleries[97880]=new gallery(97880,"1408504","Commissions","gallery",[1408504,1408507,1408509,1408511,1408513,1781747,1781748,1781750,1781751,1781754,4499340,4499342,4499343,4499346,4499349,4499352]);galleries[91584]=new gallery(91584,"1294394","Random collection","gallery",[1291198,1294394,1294401,1294411,1294414,1375368,1522504]);galleries[91786]=new gallery(91786,"1295241","Still life","gallery",[1295241,1295245,1673779]);galleries[91013]=new gallery(91013,"1289831","Wildlife","gallery",[1281490,1281491,1289831,1289832,1302383,1304571,1304861,2511546,4499374,4499662]);galleries[90178]=new gallery(90178,"1270885","Urban","gallery",[1270885,1302381]);var imageSets=new Object();imageSets[1]="1269586";imageSets[2]="1408504,1295394,1295241,1294403,1294394,1289831,1281500,1270891,1270885";imageSets[3]="4499662,4499374,4499352,4499349,4499346,4499343,4499342,4499340,3509684,3509679,2511546,2494897,2078828,1781754,1781751,1781750,1781748,1781747,1673779,1522504,1421471,1421468,1421463,1421461,1421453,1421450,1408513,1408511,1408509,1408507,1408504,1375368,1375363,1337681,1328694,1304861,1304571,1302383,1302381,1300876,1300612,1298539,1298538,1295401,1295394,1295245,1295241,1294414,1294411,1294409";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/vanillacoffee/images";break}switch(a){case 1:b="http://www1.clikpic.com/vanillacoffee/images";break}switch(a){case 2:b="http://admin.clikpic.com/vanillacoffee/images";break}switch(a){case 4:b="http://www.clikchurch.com/vanillacoffee/images";break}switch(a){case 5:b="http://www2.clikpic.com/vanillacoffee/images";break}switch(a){case 15:b="http://www3.clikpic.com/vanillacoffee/images";break}switch(a){case 21:b="http://www6.clikpic.com/vanillacoffee/images";break}switch(a){case 18:b="http://www4.clikpic.com/vanillacoffee/images";break}switch(a){case 19:b="http://www5.clikpic.com/vanillacoffee/images";break}switch(a){case 22:b="http://tpc5/clikpic/vanillacoffee/images";break}switch(a){case 23:b="http://tpc10/clikpic/vanillacoffee/images";break}switch(a){case 24:b="http://tpc15/clikpic/vanillacoffee/images";break}switch(a){case 25:b="http://tpc16/clikpic/vanillacoffee/images";break}switch(a){case 31:b="http://www7.clikpic.com/vanillacoffee/images";break}switch(a){case 32:b="http://admin2.clikpic.com/vanillacoffee/images";break}switch(a){case 33:b="http://www8.clikpic.com/vanillacoffee/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="Vanilla Coffee 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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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+'")'})}}};