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[4071]=new thumbnail(4071,"788","Clothes Show Live","IMG_0108JPG_thumb.jpg",130,195,18);thumbnails[4073]=new thumbnail(4073,"788","Clothes Show Live","IMG_0130JPG_thumb.jpg",130,195,18);thumbnails[4074]=new thumbnail(4074,"788","Clothes Show Live","IMG_0137JPG_thumb.jpg",130,195,18);thumbnails[4075]=new thumbnail(4075,"788","Clothes Show Live","IMG_0157JPG_thumb.jpg",130,195,18);thumbnails[4297]=new thumbnail(4297,"788","Clothes Show Live","IMG_0116JPG_thumb.jpg",130,195,18);thumbnails[4299]=new thumbnail(4299,"788","Clothes Show Live","IMG_0117JPG_thumb.jpg",130,195,18);thumbnails[4301]=new thumbnail(4301,"788","Clothes Show Live","IMG_0141JPG_thumb.jpg",130,195,18);thumbnails[4303]=new thumbnail(4303,"788","Clothes Show Live","IMG_0143JPG_thumb.jpg",130,195,18);thumbnails[4308]=new thumbnail(4308,"788","H&M Spring Collection 2005","IMG_0170JPG_thumb.jpg",130,165,18);thumbnails[4309]=new thumbnail(4309,"788","H&M Spring Collection 2005","IMG_0171JPG_thumb.jpg",130,195,18);thumbnails[4307]=new thumbnail(4307,"788","H&M Spring Collection 2005","IMG_0168JPG_thumb.jpg",130,254,18);thumbnails[1004415]=new thumbnail(1004415,"780","Kerry & Daniel","IMG_0172-Edit_cnv_400x6002_thumb.jpg",130,195,18);thumbnails[1004418]=new thumbnail(1004418,"780","Kerry & Daniel","IMG_0175-Edit_cnv_400x6001_thumb.jpg",130,195,18);thumbnails[1004421]=new thumbnail(1004421,"780","Kerry & Daniel","IMG_0187-Edit_cnv_400x6001_thumb.jpg",130,195,18);thumbnails[1004424]=new thumbnail(1004424,"780","Kerry & Daniel","IMG_0192-Edit_cnv_400x6001_thumb.jpg",130,195,18);thumbnails[1004426]=new thumbnail(1004426,"780","Kerry & Daniel","IMG_0202-Edit_cnv_400x6001_thumb.jpg",130,195,18);thumbnails[1004429]=new thumbnail(1004429,"780","Kerry","IMG_0209-Edit_cnv_400x6002_thumb.jpg",130,195,18);thumbnails[1004430]=new thumbnail(1004430,"780","Kerry & Daniel","IMG_0223-Edit_cnv_400x6001_thumb.jpg",130,195,18);thumbnails[1008559]=new thumbnail(1008559,"780","Tara & Martin","Button_-1_cnv_400x600_thumb.jpg",130,195,18);thumbnails[1008562]=new thumbnail(1008562,"780","Tara & Martin","Button_-2_cnv_400x600_thumb.jpg",130,195,18);thumbnails[1008571]=new thumbnail(1008571,"780","Tara & Martin","Button_-4_cnv_400x600_thumb.jpg",130,195,18);thumbnails[1008575]=new thumbnail(1008575,"780","Tara & Martin","Button_-5_cnv_400x600_thumb.jpg",130,195,18);thumbnails[70200]=new thumbnail(70200,"780","Mark & Anne","Mark_260305_IMG_0321_thumb.JPG",130,195,18);thumbnails[70202]=new thumbnail(70202,"780","Mark & Anne","Mark_260305_IMG_0322_thumb.JPG",130,195,18);thumbnails[70203]=new thumbnail(70203,"780","Claire & Barrie","IMG_0138_thumb.JPG",130,195,18);thumbnails[70205]=new thumbnail(70205,"780","Claire & Barrie","IMG_0209_thumb.JPG",130,195,18);thumbnails[4083]=new thumbnail(4083,"787","","2003_0920Image0001JPG_thumb.jpg",130,173,18);thumbnails[4304]=new thumbnail(4304,"787","","IMG_0161JPG_thumb.jpg",130,179,18);thumbnails[712295]=new thumbnail(712295,"787","","W1010_thumb.jpg",130,195,18);thumbnails[712298]=new thumbnail(712298,"787","","W1006_thumb.jpg",130,174,18);thumbnails[712301]=new thumbnail(712301,"787","","W1004_thumb.jpg",130,179,18);thumbnails[69951]=new thumbnail(69951,"54721","","Shannon_0154_thumb.jpg",130,195,18);thumbnails[69952]=new thumbnail(69952,"54721","","Shannon_0159_thumb.jpg",130,195,18);thumbnails[69954]=new thumbnail(69954,"54721","","Shannon_0179_thumb.jpg",130,195,18);thumbnails[69955]=new thumbnail(69955,"54721","","Shannon_0189_thumb.jpg",130,195,18);thumbnails[712230]=new thumbnail(712230,"54721","","W0045_thumb.jpg",130,195,18);thumbnails[712260]=new thumbnail(712260,"54721","","W0071_thumb.jpg",130,195,18);thumbnails[712262]=new thumbnail(712262,"54721","","W0098_thumb.jpg",130,195,18);thumbnails[712264]=new thumbnail(712264,"54721","","W0168_thumb.jpg",130,195,18);thumbnails[712266]=new thumbnail(712266,"54721","","W0188_thumb.jpg",130,83,18);thumbnails[4085]=new thumbnail(4085,"790","St Fagans (1)","IMG_0057JPG_thumb.jpg",130,195,18);thumbnails[4088]=new thumbnail(4088,"790","St Fagans (2)","IMG_0053JPG_thumb.jpg",130,195,18);thumbnails[6722]=new thumbnail(6722,"790","London Docklands Wharf","LandSeascape0004 copyJPG_thumb.jpg",130,195,18);thumbnails[6719]=new thumbnail(6719,"790","London Docklands Crane","LandSeascape0001 copyJPG_thumb.jpg",130,195,18);thumbnails[6720]=new thumbnail(6720,"790","London Docklands","LandSeascape0002 copyJPG_thumb.jpg",130,87,18);thumbnails[69961]=new thumbnail(69961,"790","Post Office - St Fagans","Landscape_0028_thumb.JPG",130,87,18);thumbnails[69956]=new thumbnail(69956,"790","Transporter Bridge - Newport","Bridge_0005_thumb.JPG",130,87,18);thumbnails[69957]=new thumbnail(69957,"790","Rape Seed Field","Landscape_0010_thumb.JPG",130,87,18);thumbnails[69958]=new thumbnail(69958,"790","Penarth Pier","Landscape_0016_thumb.JPG",130,87,18);thumbnails[6725]=new thumbnail(6725,"1048","Honda","Transport0010 copyJPG_thumb.jpg",130,86,18);thumbnails[6730]=new thumbnail(6730,"1048","Fishing Boat","IMG_0032JPG1_thumb.jpg",130,87,18);thumbnails[6726]=new thumbnail(6726,"1048","London Boat Show 2005","Transport0014 copyJPG_thumb.jpg",130,87,18);thumbnails[6729]=new thumbnail(6729,"1048","London Boat Show 2005","Transport0021 copyJPG_thumb.jpg",130,85,18);thumbnails[6721]=new thumbnail(6721,"1048","London Boat Show 2005","Transport0003 copyJPG_thumb.jpg",130,87,18);thumbnails[6727]=new thumbnail(6727,"1048","Steam Tugs London Docklands","Transport0017 copyJPG_thumb.jpg",130,87,18);thumbnails[6728]=new thumbnail(6728,"1048","HMS Sutherland London","Transport0020 copyJPG_thumb.jpg",130,82,18);thumbnails[6724]=new thumbnail(6724,"1048","London Boat Show 2005","Transport0008 copyJPG_thumb.jpg",130,196,18);thumbnails[69986]=new thumbnail(69986,"1048","Hot Air Balloon - Blackwood","Balloons_00061_thumb.jpg",130,195,18);thumbnails[69987]=new thumbnail(69987,"1048","Hot Air Balloon - Blackwood","Balloons_0016_thumb.jpg",130,195,18);thumbnails[69949]=new thumbnail(69949,"1048","Hot Air Balloon - Blackwood","Balloons_0002_thumb.JPG",130,87,18);var galleries=new Object();galleries[788]=new gallery(788,"4301,4074","Fashion","gallery",[4071,4073,4074,4075,4297,4299,4301,4303,4308,4309,4307]);galleries[780]=new gallery(780,"1004415","Wedding","gallery",[1004415,1004418,1004421,1004424,1004426,1004429,1004430,1008559,1008562,1008571,1008575,70200,70202,70203,70205]);galleries[787]=new gallery(787,"712298,4304","Portraits","gallery",[4083,4304,712295,712298,712301]);galleries[54721]=new gallery(54721,"712266,712264,712262,712260,712230,69955,69954,69952,69951","Nurseries","gallery",[69951,69952,69954,69955,712230,712260,712262,712264,712266]);galleries[790]=new gallery(790,"6722","Landscapes","gallery",[4085,4088,6722,6719,6720,69961,69956,69957,69958]);galleries[1048]=new gallery(1048,"6730,6726,6725","Commercial","gallery",[6725,6730,6726,6729,6721,6727,6728,6724,69986,69987,69949]);var imageSets=new Object();imageSets[1]="1008562,1008559,1004429,1004418,1004415,70202,69987,69986,69955,69954,69952,6722,4303,4301,4299,4075,4074,4071";imageSets[2]="1004415,712298,6730,6726,6725,6722,4304,4301,4074";imageSets[3]="1008575,1008571,1008562,1008559,1004430,1004429,1004426,1004424,1004421,1004418,1004415,712301,712298,712295,712266,712264,712262,712260,712230,70205,70203,70202,70200,69987,69986,69961,69958,69957,69956,69955,69954,69952,69951,69949,6730,6729,6728,6727,6726,6725,6724,6722,6721,6720,6719,4309,4308,4307,4304,4303";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/rogerkeyse/images";break}switch(a){case 1:b="http://www1.clikpic.com/rogerkeyse/images";break}switch(a){case 2:b="http://admin.clikpic.com/rogerkeyse/images";break}switch(a){case 4:b="http://www.clikchurch.com/rogerkeyse/images";break}switch(a){case 5:b="http://www2.clikpic.com/rogerkeyse/images";break}switch(a){case 15:b="http://www3.clikpic.com/rogerkeyse/images";break}switch(a){case 21:b="http://www6.clikpic.com/rogerkeyse/images";break}switch(a){case 18:b="http://www4.clikpic.com/rogerkeyse/images";break}switch(a){case 19:b="http://www5.clikpic.com/rogerkeyse/images";break}switch(a){case 22:b="http://tpc5/clikpic/rogerkeyse/images";break}switch(a){case 23:b="http://tpc10/clikpic/rogerkeyse/images";break}switch(a){case 24:b="http://tpc15/clikpic/rogerkeyse/images";break}switch(a){case 25:b="http://tpc16/clikpic/rogerkeyse/images";break}switch(a){case 31:b="http://www7.clikpic.com/rogerkeyse/images";break}switch(a){case 32:b="http://admin2.clikpic.com/rogerkeyse/images";break}switch(a){case 33:b="http://www8.clikpic.com/rogerkeyse/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="Roger Keyse 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+'")'})}}};