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[67166]=new thumbnail(67166,"160076","Roman Theatre, St Albans","C192_0493web600_thumb.jpg",130,130,1);thumbnails[67167]=new thumbnail(67167,"160493","","330_2201sqweb_thumb.jpg",130,130,1);thumbnails[67169]=new thumbnail(67169,"160493","","FP15_02web600x_thumb.jpg",130,130,1);thumbnails[67173]=new thumbnail(67173,"160493","Provence","FP_18_04web600w_thumb.jpg",130,130,1);thumbnails[67178]=new thumbnail(67178,"160493","Beacon Hill","BeaconHillweb600x_thumb.jpg",130,130,1);thumbnails[67182]=new thumbnail(67182,"160493","Blaneau Ffestiniog","BlaenauFweb600x_thumb.jpg",130,130,1);thumbnails[67185]=new thumbnail(67185,"160493","","330_031web600x_thumb.jpg",130,130,1);thumbnails[67197]=new thumbnail(67197,"160493","","TheBrickWeb600x_thumb.jpg",130,130,1);thumbnails[2225732]=new thumbnail(2225732,"9421","CN Tower, Canada","759_26web4001_thumb.jpg",130,130,1);thumbnails[2225740]=new thumbnail(2225740,"9421","Waterloo, London, Copyright BRE Ltd","1992_459_07web4001_thumb.jpg",130,130,1);thumbnails[2225757]=new thumbnail(2225757,"9421","Accelerated weathering, Copyright BRE Ltd","1998_60109web4001_thumb.jpg",130,130,1);thumbnails[2225792]=new thumbnail(2225792,"9421","Canada Water","2000_16704web4001_thumb.jpg",130,130,1);thumbnails[2225844]=new thumbnail(2225844,"9421","Cameras, Tower Bridge","C125_261web400_thumb.jpg",130,130,1);thumbnails[2225881]=new thumbnail(2225881,"9421","Bull Ring, Birmingham","C130_553web400_thumb.jpg",130,130,1);thumbnails[2225883]=new thumbnail(2225883,"9421","Bus transport","C131_577Cweb400_thumb.jpg",130,130,1);thumbnails[2225897]=new thumbnail(2225897,"9421","Train Travel, South West Trains","C134_848zbWeb400_thumb.jpg",130,130,1);thumbnails[2225938]=new thumbnail(2225938,"9421","Ventilation","C141_267web400_thumb.jpg",130,130,1);thumbnails[2225960]=new thumbnail(2225960,"9421","Lounge Interior","C170_680web4001_thumb.jpg",130,130,1);thumbnails[2228913]=new thumbnail(2228913,"9421","Cladding","C122_A145web400_thumb.jpg",130,130,1);thumbnails[2234811]=new thumbnail(2234811,"160493","","904_24web600x_thumb.jpg",130,130,1);thumbnails[2493846]=new thumbnail(2493846,"160076","The Town Hall, St Albans","C188_0379rWeb600_thumb.jpg",130,130,1);thumbnails[2494221]=new thumbnail(2494221,"160076","The Town Hall, St Albans","C188_0383web600_thumb.jpg",130,130,1);thumbnails[2505116]=new thumbnail(2505116,"160076","The Town Hall, St Albans","C188_0386web600_thumb.jpg",130,130,1);thumbnails[2505117]=new thumbnail(2505117,"160076","St Albans Abbey","C188_0395web600_thumb.jpg",130,130,1);thumbnails[2505118]=new thumbnail(2505118,"160076","St Albans Abbey","C188_0398web600_thumb.jpg",130,130,1);thumbnails[2505221]=new thumbnail(2505221,"160076","Grey Heron, Verulamium Park","C190_0402web600_thumb.jpg",130,130,1);thumbnails[2506143]=new thumbnail(2506143,"160076","The Clock Tower, St Albans","C191_481_thumb.jpg",130,130,1);thumbnails[2506145]=new thumbnail(2506145,"160076","The Clock Tower, St Albans","C191_0482web600_thumb.jpg",130,130,1);thumbnails[2506147]=new thumbnail(2506147,"160076","St Albans, Sopwell Nunnery","C192_0508_thumb.jpg",130,130,1);thumbnails[2508022]=new thumbnail(2508022,"160076","Cafe, St Albans","C190_437web600_thumb.jpg",130,130,1);thumbnails[2508427]=new thumbnail(2508427,"160076","Verulamium Park, St Albans","C190_0444web600_thumb.jpg",130,130,1);thumbnails[2508436]=new thumbnail(2508436,"160076","Lake, Verulamium Park, St Albans","C190_0447web600_thumb.jpg",130,130,1);thumbnails[2508451]=new thumbnail(2508451,"160076","The Vintry Garden, St Albans","C191_0472web600_thumb.jpg",130,130,1);thumbnails[2508518]=new thumbnail(2508518,"160076","Roman Theatre, St Albans","C192_0494web600_thumb.jpg",130,130,1);thumbnails[2509283]=new thumbnail(2509283,"160076","The City Flag, St Albans","C191_0457web600_thumb.jpg",130,130,1);thumbnails[2512941]=new thumbnail(2512941,"160076","Museum, St Albans","C192_0505web600_thumb.jpg",130,130,1);thumbnails[2516388]=new thumbnail(2516388,"160076","Hypercaust building","C196_0571cweb600_thumb.jpg",130,130,1);thumbnails[2537944]=new thumbnail(2537944,"160076","Sunset, Verulamium Park","C194_0521web600_thumb.jpg",130,130,1);thumbnails[2537946]=new thumbnail(2537946,"160076","George Street, St Albans","C195_0537web600_thumb.jpg",130,130,1);thumbnails[2537950]=new thumbnail(2537950,"160076","Waxhouse Gate, St. Albans","C195_0539web600_thumb.jpg",130,130,1);thumbnails[2537952]=new thumbnail(2537952,"160076","Accordion Player, St Albans","C197_0666web600_thumb.jpg",130,130,1);thumbnails[2537956]=new thumbnail(2537956,"160076","Vintry Garden & Abbey","C196_0593web600_thumb.jpg",130,130,1);thumbnails[2537958]=new thumbnail(2537958,"160076","St Albans Market","C197_0636web600_thumb.jpg",130,130,1);thumbnails[2537959]=new thumbnail(2537959,"160076","The Inn in the Park","C198_0708web600_thumb.jpg",130,130,1);thumbnails[2538002]=new thumbnail(2538002,"160076","Vintry Garden, St Albans","C195_0551web600_thumb.jpg",130,130,1);thumbnails[2540150]=new thumbnail(2540150,"160493","Provence","FP_21_02web600w_thumb.jpg",130,130,1);thumbnails[2761245]=new thumbnail(2761245,"","<em>Rosie & Dave</em>","611_08sqweb400_thumb.jpg",130,130,1);thumbnails[2217063]=new thumbnail(2217063,"9421","Architectural model, copyright BRE Ltd","1991_176_07web400_thumb.jpg",130,130,1);thumbnails[2225977]=new thumbnail(2225977,"9421","Canary Wharf at night","C177_0946web4001_thumb.jpg",130,130,1);thumbnails[2225744]=new thumbnail(2225744,"9421","Steel Construction, Copyright BRE Ltd","1995_17411web4001_thumb.jpg",130,130,1);thumbnails[2225800]=new thumbnail(2225800,"9421","Stockley Academy 2005","C123f_01web400_thumb.jpg",130,130,1);thumbnails[2225807]=new thumbnail(2225807,"9421","Stockley Academy","C123f_011web400_thumb.jpg",130,130,1);thumbnails[2225949]=new thumbnail(2225949,"9421","Toll bridge, Plymouth","C155_-025web400_thumb.jpg",130,130,1);thumbnails[2258901]=new thumbnail(2258901,"9421","St Josephs School, Harrow","C182_2844web400_thumb.jpg",130,130,1);thumbnails[2225888]=new thumbnail(2225888,"9421","Rail worker, South West Trains","C134_816web400_thumb.jpg",130,130,1);thumbnails[2226385]=new thumbnail(2226385,"9421","Timber conditioning, Copyright BRE Ltd","1995_07119web400_thumb.jpg",130,130,1);thumbnails[2238067]=new thumbnail(2238067,"9421","Conversion by Architect, Peter Baker","C184_0054bweb400_thumb.jpg",130,130,1);thumbnails[2225851]=new thumbnail(2225851,"9421","Birmingham City centre","C130_549web400_thumb.jpg",130,130,1);thumbnails[2225837]=new thumbnail(2225837,"9421","Vauxhall Cross","C125_211web400_thumb.jpg",130,130,1);thumbnails[2225972]=new thumbnail(2225972,"9421","Tower Bridge House & The Tower, London","C176_0894web4001_thumb.jpg",130,130,1);var galleries=new Object();galleries[9421]=new gallery(9421,"2258901,2238067,2228913,2226385,2225977,2225972,2225960,2225949,2225938,2225897","Commercial","gallery",[2225732,2225740,2225757,2225792,2225844,2225881,2225883,2225897,2225938,2225960,2228913,2217063,2225977,2225744,2225800,2225807,2225949,2258901,2225888,2226385,2238067,2225851,2225837,2225972]);galleries[160076]=new gallery(160076,"2509283,2508022,2505118","Gallery of the Month","gallery",[67166,2493846,2494221,2505116,2505117,2505118,2505221,2506143,2506145,2506147,2508022,2508427,2508436,2508451,2508518,2509283,2512941,2516388,2537944,2537946,2537950,2537952,2537956,2537958,2537959,2538002]);galleries[160493]=new gallery(160493,"67182","Personal Portfolio","gallery",[67167,67169,67173,67178,67182,67185,67197,2234811,2540150]);var imageSets=new Object();imageSets[1]="2258901,2238067,2226385,2225977,2225972,2225949,2225888,2225851,2225837,2225807,2225800,2225744,2217063";imageSets[2]="2509283,2508022,2505118,67182";imageSets[3]="2761245,2540150,2538002,2537959,2537958,2537956,2537952,2537950,2537946,2537944,2516388,2512941,2509283,2508518,2508451,2508436,2508427,2508022,2506147,2506145,2506143,2505221,2505118,2505117,2505116,2494221,2493846,2258901,2238067,2234811,2228913,2226385,2225977,2225972,2225960,2225949,2225938,2225897,2225888,2225883,2225881,2225851,2225844,2225837,2225807,2225800,2225792,2225757,2225744,2225740";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/johnfrussell/images";break}switch(a){case 1:b="http://www1.clikpic.com/johnfrussell/images";break}switch(a){case 2:b="http://admin.clikpic.com/johnfrussell/images";break}switch(a){case 4:b="http://www.clikchurch.com/johnfrussell/images";break}switch(a){case 5:b="http://www2.clikpic.com/johnfrussell/images";break}switch(a){case 15:b="http://www3.clikpic.com/johnfrussell/images";break}switch(a){case 21:b="http://www6.clikpic.com/johnfrussell/images";break}switch(a){case 18:b="http://www4.clikpic.com/johnfrussell/images";break}switch(a){case 19:b="http://www5.clikpic.com/johnfrussell/images";break}switch(a){case 22:b="http://tpc5/clikpic/johnfrussell/images";break}switch(a){case 23:b="http://tpc10/clikpic/johnfrussell/images";break}switch(a){case 24:b="http://tpc15/clikpic/johnfrussell/images";break}switch(a){case 25:b="http://tpc16/clikpic/johnfrussell/images";break}switch(a){case 31:b="http://www7.clikpic.com/johnfrussell/images";break}switch(a){case 32:b="http://admin2.clikpic.com/johnfrussell/images";break}switch(a){case 33:b="http://www8.clikpic.com/johnfrussell/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="John F Russell 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>Copyright: </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+'")'})}}};