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[183788]=new thumbnail(183788,"16944","Beach","Beach_thumb.jpg",130,87,15);thumbnails[183790]=new thumbnail(183790,"16944","Javea Waves","Best Slide Show1_thumb.jpg",130,81,15);thumbnails[183792]=new thumbnail(183792,"16944","Pego Cinema","Pego Cinama_thumb.jpg",130,87,15);thumbnails[183793]=new thumbnail(183793,"16944","The Montgo","Best Slide Show123_thumb.jpg",130,87,15);thumbnails[183797]=new thumbnail(183797,"16944","Tree and Chairs","Tree & Chairs_thumb.jpg",130,87,15);thumbnails[185063]=new thumbnail(185063,"16944","Poppys","Poppys_thumb.jpg",130,195,15);thumbnails[185066]=new thumbnail(185066,"16944","Wall & Bike","Wall & Bike_thumb.jpg",130,87,15);thumbnails[190972]=new thumbnail(190972,"16944","White Horse","White Horse_thumb.jpg",130,128,15);thumbnails[1558323]=new thumbnail(1558323,"16944","Altea 1","Best Slide Show7_thumb.jpg",130,86,15);thumbnails[1558351]=new thumbnail(1558351,"16944","Altea 2","Altea 2_thumb.jpg",130,171,15);thumbnails[1558354]=new thumbnail(1558354,"16944","Barcelona","Barcelona 1_thumb.jpg",130,82,15);thumbnails[1558385]=new thumbnail(1558385,"16944","Denia 1","Denia 1_thumb.jpg",130,125,15);thumbnails[1558404]=new thumbnail(1558404,"16944","Denea 2","Denia 4_thumb.jpg",130,113,15);thumbnails[1558405]=new thumbnail(1558405,"16944","Granada 1","Grenada 1_thumb.jpg",130,194,15);thumbnails[1558407]=new thumbnail(1558407,"16944","Granada 2","Grenada 2_thumb.jpg",130,88,15);thumbnails[1558409]=new thumbnail(1558409,"16944","Granada 3","Grenada 3_thumb.jpg",130,194,15);thumbnails[1558412]=new thumbnail(1558412,"16944","Moores and Christians 1","M & C_thumb.jpg",130,98,15);thumbnails[1558413]=new thumbnail(1558413,"16944","Moores and Christians 2","M & C 2_thumb.jpg",130,131,15);thumbnails[1558452]=new thumbnail(1558452,"16944","Toledo","Toledo_thumb.jpg",130,100,15);thumbnails[1558453]=new thumbnail(1558453,"16944","Valencia 1","Valencia 1_thumb.jpg",130,92,15);thumbnails[1558454]=new thumbnail(1558454,"16944","Vaencia 2","Valencia 2_thumb.jpg",130,97,15);thumbnails[1558488]=new thumbnail(1558488,"16944","Blossom","Blossom_thumb.jpg",130,87,15);thumbnails[3256922]=new thumbnail(3256922,"16944","Javea Waves 1","Web 1_thumb.jpg",130,85,15);thumbnails[3256923]=new thumbnail(3256923,"16944","Javea Waves 2","Web 2_thumb.jpg",130,86,15);thumbnails[3258093]=new thumbnail(3258093,"16944","Crane","Crane _thumb.jpg",130,88,15);thumbnails[3258099]=new thumbnail(3258099,"16944","Fighter","Fighter_thumb.jpg",130,100,15);thumbnails[3258100]=new thumbnail(3258100,"16944","Javea Beach","Javea Beach_thumb.jpg",130,86,15);thumbnails[3258103]=new thumbnail(3258103,"16944","Javea Sea 3<br>\r\n","Javea Sea 3_thumb.jpg",130,89,15);thumbnails[3258104]=new thumbnail(3258104,"16944","Javea Surfer","Javea Surfer_thumb.jpg",130,90,15);thumbnails[3258105]=new thumbnail(3258105,"16944","La Marina Denia","La Marina Denia_thumb.jpg",130,87,15);thumbnails[3258115]=new thumbnail(3258115,"16944","Spanish Kids Denia","Spanish Kids Denea_thumb.jpg",130,87,15);thumbnails[3258119]=new thumbnail(3258119,"16944","The Rocks","The Rocks_thumb.jpg",130,194,15);thumbnails[3258122]=new thumbnail(3258122,"16944","Toledo","Toledo_1_thumb.jpg",130,87,15);thumbnails[3258124]=new thumbnail(3258124,"16944","Windmill 1","Windmill 1_thumb.jpg",130,87,15);thumbnails[3258125]=new thumbnail(3258125,"16944","Windmill 2","Windmill 2_thumb.jpg",130,87,15);thumbnails[184916]=new thumbnail(184916,"16945","Bullfight 2","Bullfight 21_thumb.jpg",130,219,15);thumbnails[1558063]=new thumbnail(1558063,"16945","Bullfight 1","Bullfight 11_thumb.jpg",130,79,15);thumbnails[1558068]=new thumbnail(1558068,"16945","Bullfight 3","Bullfight 31_thumb.jpg",130,128,15);thumbnails[1558108]=new thumbnail(1558108,"16945","Bullfight 4","Bullfight 41_thumb.jpg",130,94,15);thumbnails[1558138]=new thumbnail(1558138,"16945","Bullfight 6","Bullfight 61_thumb.jpg",130,87,15);thumbnails[1558140]=new thumbnail(1558140,"16945","Bullfight 7","Bullfight 71_thumb.jpg",130,121,15);thumbnails[1558143]=new thumbnail(1558143,"16945","Bullfight 8","Bullfight 81_thumb.jpg",130,104,15);thumbnails[1558147]=new thumbnail(1558147,"16945","Bullfight 9","Bullfight 91_thumb.jpg",130,90,15);thumbnails[1558150]=new thumbnail(1558150,"16945","Bullfight 10","Bullfight 101_thumb.jpg",130,140,15);thumbnails[1558187]=new thumbnail(1558187,"16945","Bullfight 11","Bullfight 111_thumb.jpg",130,112,15);thumbnails[1558239]=new thumbnail(1558239,"16945","Bullfight 12","Bullfight 121_thumb.jpg",130,94,15);thumbnails[1558278]=new thumbnail(1558278,"16945","Bullfight 5","Bullfight 23_thumb.jpg",130,134,15);thumbnails[3258107]=new thumbnail(3258107,"16945","Oops","Oops_thumb.jpg",130,84,15);thumbnails[3258114]=new thumbnail(3258114,"16945","Red Rag to a Bull","Red rag to a bull_thumb.jpg",130,113,15);thumbnails[3258120]=new thumbnail(3258120,"16945","The Swerve","The Swerve_thumb.jpg",130,105,15);thumbnails[183840]=new thumbnail(183840,"16947","2nd Severn Bridge","Best Slide Show4_thumb.jpg",130,87,15);thumbnails[183842]=new thumbnail(183842,"16947","Clevedon Pier","Cleavdon Pier_thumb.jpg",130,87,15);thumbnails[183844]=new thumbnail(183844,"16947","Golden Buddha","Best Slide Show27_thumb.jpg",130,96,15);thumbnails[183845]=new thumbnail(183845,"16947","Lake Mid Wales","Lake Mid Wales_thumb.jpg",130,87,15);thumbnails[183847]=new thumbnail(183847,"16947","Llanwern Sunrise","Best Slide Show85_thumb.jpg",130,86,15);thumbnails[183851]=new thumbnail(183851,"16947","Owl","Owl Monmouth Show_thumb.jpg",130,110,15);thumbnails[183852]=new thumbnail(183852,"16947","Pier and Red Girl","Pier & Red Girl_thumb.jpg",130,87,15);thumbnails[183854]=new thumbnail(183854,"16947","Port Douglas","Port Douglas_thumb.jpg",130,87,15);thumbnails[183855]=new thumbnail(183855,"16947","Rainbow Penarth Pier","Best Slide Show96_thumb.jpg",130,97,15);thumbnails[183856]=new thumbnail(183856,"16947","Australian Seagulls","Seagulls_thumb.jpg",130,87,15);thumbnails[183857]=new thumbnail(183857,"16947","Swan in Scotland","Best Slide Show102_thumb.jpg",130,87,15);thumbnails[183862]=new thumbnail(183862,"16947","Soft Tulips","Tulips_thumb.jpg",130,133,15);thumbnails[183936]=new thumbnail(183936,"16947","","Best Slide Show87_thumb.jpg",130,144,15);thumbnails[184919]=new thumbnail(184919,"16947","Mid Wales Beach","Mid Wales B1_thumb.jpg",130,174,15);thumbnails[185056]=new thumbnail(185056,"16947","Facetree","Best Slide Show67_thumb.jpg",130,177,15);thumbnails[185058]=new thumbnail(185058,"16947","Hawk","Best Slide Show0_thumb.jpg",130,98,15);thumbnails[185065]=new thumbnail(185065,"16947","Tree & Mist","Tree & Mist_thumb.jpg",130,87,15);thumbnails[3258111]=new thumbnail(3258111,"16947","Red Flower","Red Flower_thumb.jpg",130,115,15);thumbnails[3258112]=new thumbnail(3258112,"16947","Red Parrot","Red Parrot_thumb.jpg",130,96,15);thumbnails[3258116]=new thumbnail(3258116,"16947","Sunflower","Sunflower_thumb.jpg",130,87,15);thumbnails[3263823]=new thumbnail(3263823,"16947","Horses in Tredegar","Best Slide Show76_thumb.jpg",130,87,15);thumbnails[3263882]=new thumbnail(3263882,"16947","Tractor in Scotland","Hay & Tractor_thumb.jpg",130,87,15);thumbnails[183825]=new thumbnail(183825,"16946","Atlantic City Boat","Atlantic City Boat_thumb.jpg",130,87,15);thumbnails[183826]=new thumbnail(183826,"16946","Brooklyn Bridge","Best Slide Show26_thumb.jpg",130,87,15);thumbnails[183828]=new thumbnail(183828,"16946","Grand Central Station NY","Grand Central Station 1_thumb.jpg",130,87,15);thumbnails[183832]=new thumbnail(183832,"16946","New York 3","Newyork 2 _thumb.jpg",130,87,15);thumbnails[183834]=new thumbnail(183834,"16946","Yellow Cab","Yellow Cab NY sepia 2_thumb.jpg",130,87,15);thumbnails[184922]=new thumbnail(184922,"16946","New York 0","Newyork 01_thumb.jpg",130,157,15);thumbnails[184924]=new thumbnail(184924,"16946","New York 1","Newyork 11_thumb.jpg",130,164,15);thumbnails[185062]=new thumbnail(185062,"16946","Monument Valley","Monument Valley_thumb.jpg",130,85,15);thumbnails[185064]=new thumbnail(185064,"16946","Soho NY","Soho NY_thumb.jpg",130,85,15);var galleries=new Object();galleries[16944]=new gallery(16944,"3258125,3258124,3258122,3258119,3258115,3258105,3258104,3258103,3258100,3258099","Spain","gallery",[183788,183790,183792,183793,183797,185063,185066,190972,1558323,1558351,1558354,1558385,1558404,1558405,1558407,1558409,1558412,1558413,1558452,1558453,1558454,1558488,3256922,3256923,3258093,3258099,3258100,3258103,3258104,3258105,3258115,3258119,3258122,3258124,3258125]);galleries[16945]=new gallery(16945,"3258120,3258114,3258107,1558278,1558239,1558187,1558150,1558147,1558143,1558140","Bullfighting","gallery",[184916,1558063,1558068,1558108,1558138,1558140,1558143,1558147,1558150,1558187,1558239,1558278,3258107,3258114,3258120]);galleries[16947]=new gallery(16947,"3263882,3263823,3258116,3258112,3258111,185065,185058,185056,184919,183936","General","gallery",[183840,183842,183844,183845,183847,183851,183852,183854,183855,183856,183857,183862,183936,184919,185056,185058,185065,3258111,3258112,3258116,3263823,3263882]);galleries[16946]=new gallery(16946,"185064,185062,184924,184922,183834,183832,183828,183826,183825","U.S.A.","gallery",[183825,183826,183828,183832,183834,184922,184924,185062,185064]);var imageSets=new Object();imageSets[1]="183936";imageSets[3]="3263882,3263823,3258125,3258124,3258122,3258120,3258119,3258116,3258115,3258114,3258112,3258111,3258107,3258105,3258104,3258103,3258100,3258099,3258093,3256923,3256922,1558488,1558454,1558453,1558452,1558413,1558412,1558409,1558407,1558405,1558404,1558385,1558354,1558351,1558323,1558278,1558239,1558187,1558150,1558147,1558143,1558140,1558138,1558108,1558068,1558063,190972,185066,185065,185064";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/chrisrobin/images";break}switch(a){case 1:b="http://www1.clikpic.com/chrisrobin/images";break}switch(a){case 2:b="http://admin.clikpic.com/chrisrobin/images";break}switch(a){case 24:b="http://tpc15/clikpic/chrisrobin/images";break}switch(a){case 4:b="http://www.clikchurch.com/chrisrobin/images";break}switch(a){case 5:b="http://www2.clikpic.com/chrisrobin/images";break}switch(a){case 22:b="http://tpc5/clikpic/chrisrobin/images";break}switch(a){case 23:b="http://tpc10/clikpic/chrisrobin/images";break}switch(a){case 25:b="http://tpc16/clikpic/chrisrobin/images";break}switch(a){case 15:b="http://www3.clikpic.com/chrisrobin/images";break}switch(a){case 18:b="http://www4.clikpic.com/chrisrobin/images";break}switch(a){case 19:b="http://www5.clikpic.com/chrisrobin/images";break}switch(a){case 31:b="http://www7.clikpic.com/chrisrobin/images";break}switch(a){case 32:b="http://admin2.clikpic.com/chrisrobin/images";break}switch(a){case 33:b="http://www8.clikpic.com/chrisrobin/images";break}switch(a){case 34:b="http://www9.clikpic.com/chrisrobin/images";break}switch(a){case 35:b="http://admin3.clikpic.com/chrisrobin/images";break}switch(a){case 37:b="http://admin4.clikpic.com/chrisrobin/images";break}switch(a){case 38:b="http://admin5.clikpic.com/chrisrobin/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="'+escape(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="Chris Roberts 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;resizePhotoInfo({centre:true});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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};
