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[6345861]=new thumbnail(6345861,"359522","","hj1-92_thumb.jpg",130,97,1);thumbnails[6345862]=new thumbnail(6345862,"359522","","hj1-80_thumb.jpg",130,84,1);thumbnails[6345867]=new thumbnail(6345867,"359522","STAMPE SV4C","_DSC0030_thumb.jpg",130,85,1);thumbnails[6345877]=new thumbnail(6345877,"359522","","_DSC0768_thumb.jpg",130,77,1);thumbnails[6345878]=new thumbnail(6345878,"359522","","_DSC0782_thumb.jpg",130,79,1);thumbnails[6345893]=new thumbnail(6345893,"359522","","_DSC0307_thumb.jpg",130,108,1);thumbnails[6346114]=new thumbnail(6346114,"359522","","_DSC0407_thumb.jpg",130,78,1);thumbnails[6346116]=new thumbnail(6346116,"359522","","_DSC0424_thumb.jpg",130,78,1);thumbnails[6346117]=new thumbnail(6346117,"359522","","_DSC0441_thumb.jpg",130,82,1);thumbnails[6346413]=new thumbnail(6346413,"359522","","hj1-250_thumb.jpg",130,81,1);thumbnails[6346418]=new thumbnail(6346418,"359522","","hj1-256_thumb.jpg",130,80,1);thumbnails[6347019]=new thumbnail(6347019,"359522","BOEING STEARMAN N2-4 KAYDET","_DSC0358_thumb.jpg",130,83,1);thumbnails[6347021]=new thumbnail(6347021,"359522","","_DSC0365_thumb.jpg",130,82,1);thumbnails[6347044]=new thumbnail(6347044,"359522","","_DSC0445_thumb.jpg",130,78,1);thumbnails[6350173]=new thumbnail(6350173,"359522","STAMPE SV4C","_DSC0122_thumb.jpg",130,81,1);thumbnails[6350189]=new thumbnail(6350189,"359522","BOEING STEARMAN N2-4 KAYDET","_DSC0318_thumb.jpg",130,79,1);thumbnails[6351110]=new thumbnail(6351110,"359522","","_DSC0201_thumb.jpg",130,79,1);thumbnails[6351136]=new thumbnail(6351136,"359522","","_DSC0253_thumb.jpg",130,79,1);thumbnails[6351144]=new thumbnail(6351144,"359522","","_DSC0281_D8055069-24E8-5EC4-4F2B90214D2F0984_thumb.jpg",130,78,1);thumbnails[6351149]=new thumbnail(6351149,"359522","","aaaae-3_thumb.jpg",130,81,1);thumbnails[6351165]=new thumbnail(6351165,"359522","CESSNA 120","QWERTY-4_thumb.jpg",130,81,1);thumbnails[6352426]=new thumbnail(6352426,"359522","","_DSC0026_thumb.jpg",130,77,1);thumbnails[6352431]=new thumbnail(6352431,"359522","","_DSC0108_thumb.jpg",130,86,1);thumbnails[6352436]=new thumbnail(6352436,"359522","","_DSC0114_thumb.jpg",130,91,1);thumbnails[6352446]=new thumbnail(6352446,"359522","","_DSC0160_thumb.jpg",130,78,1);thumbnails[6352498]=new thumbnail(6352498,"351883","","_DSC0465_thumb.jpg",130,83,1);thumbnails[6352501]=new thumbnail(6352501,"359522","","_DSC0006_thumb.jpg",130,85,1);thumbnails[6357814]=new thumbnail(6357814,"359522","CESSNA 120","_DSC0148_DD29ECBF-1EC9-D45B-1CBE3C007B772532_thumb.jpg",130,78,1);thumbnails[6394492]=new thumbnail(6394492,"359522","CHZECH AIRCRAFT WORKS SPORTSCRUISER.","Copy-of-_DSC0316_thumb.jpg",130,78,1);thumbnails[6404997]=new thumbnail(6404997,"359522","","Copy_of__DSC0215_copy_thumb.jpg",130,78,1);thumbnails[6405021]=new thumbnail(6405021,"359522","","XXX12-353_edited-1_thumb.gif",130,86,1);thumbnails[6405881]=new thumbnail(6405881,"359522","","forsite_thumb.jpg",130,85,1);thumbnails[6423281]=new thumbnail(6423281,"359522","","_DSC0070_thumb.jpg",130,80,1);thumbnails[6445180]=new thumbnail(6445180,"359522","","_DSC0009_27463F29-1D09-001F-998732927F82645D_thumb.jpg",130,81,1);thumbnails[6445182]=new thumbnail(6445182,"359522","","_DSC0014_thumb.jpg",130,80,1);thumbnails[6450310]=new thumbnail(6450310,"359522","","_DSC0082_thumb.jpg",130,92,1);thumbnails[6548144]=new thumbnail(6548144,"359530","","_DSC0138_7A2631BF-1D09-001F-9983C0AD7A97A2F8_thumb.jpg",130,98,1);thumbnails[6548217]=new thumbnail(6548217,"359530","","Copy-2-of-_DSC01231_thumb.jpg",130,103,1);thumbnails[6548262]=new thumbnail(6548262,"359540","","Copy_of_QWERT11_thumb.jpg",130,86,1);thumbnails[6548269]=new thumbnail(6548269,"359533","","_DSC0058_thumb.jpg",130,92,1);thumbnails[6548454]=new thumbnail(6548454,"359531","","sue_thumb.jpg",130,99,1);thumbnails[6548533]=new thumbnail(6548533,"359533","THE CLOVER SISTERS","_DSC0004_thumb.jpg",130,96,1);thumbnails[6549259]=new thumbnail(6549259,"359540","Organised chaos!","_DSC0080_thumb.jpg",130,87,1);thumbnails[6551991]=new thumbnail(6551991,"351883","","_DSC0039_thumb.jpg",130,102,1);thumbnails[6555277]=new thumbnail(6555277,"351883","","_DSC0026_7F97E9FB-1D09-001F-990CC4A66F5FA7B0_thumb.jpg",130,87,1);thumbnails[6555289]=new thumbnail(6555289,"351883","LEEDS CASTLE, KENT, VINTAGE VEHICLE RALLY 2010","_DSC0112_thumb.jpg",130,87,1);thumbnails[6555292]=new thumbnail(6555292,"351883","LEEDS CASTLE, KENT, ENGLAND.<br>\r\nVINTAGE VEHICLE RALLY 2010","_DSC0104_thumb.jpg",130,87,1);thumbnails[6555346]=new thumbnail(6555346,"351883","LEEDS CASTLE, KENT. ENGLAND.<br>\r\nVINTAGE VEHICLE RALLY 2010","_DSC0148_thumb.jpg",130,93,1);thumbnails[6555350]=new thumbnail(6555350,"351883","LEEDS CASTLE, KENT. ENGLAND.<br>\r\nVINTAGE VEHICLE RALLY 2010","_DSC0161_thumb.jpg",130,93,1);thumbnails[6555356]=new thumbnail(6555356,"351883","LEEDS CASTLE, KENT. ENGLAND.<br>\r\nVINTAGE VEHICLE RALLY 2010","_DSC0177_thumb.jpg",130,96,1);thumbnails[6555485]=new thumbnail(6555485,"351883","LEEDS CASTLE, KENT. ENGLAND.<br>\r\nVINTAGE VEHICLE RALLY 2010","_DSC0127_thumb.jpg",130,95,1);thumbnails[6558989]=new thumbnail(6558989,"351883","ON THE BEACH AT HASTINGS, SUSSEX.","Copy-of-_DSC0073_thumb.jpg",130,104,1);thumbnails[6559011]=new thumbnail(6559011,"359534","HASTINGS, SUSSEX. ENGLAND.","_DSC0020_thumb.jpg",130,87,1);thumbnails[6560750]=new thumbnail(6560750,"359540","BLUSTERY DAY!","_DSC0100_thumb.jpg",130,87,1);thumbnails[6560768]=new thumbnail(6560768,"359530","SPRING","_DSC0087_thumb.jpg",130,91,1);thumbnails[6560772]=new thumbnail(6560772,"359530","NEW LEAVES - THE CYCLE COMPLETE!","_DSC0210_thumb.jpg",130,176,1);thumbnails[6560791]=new thumbnail(6560791,"359540","THE FELICITY ","_DSC0053_thumb.jpg",130,120,1);thumbnails[6561099]=new thumbnail(6561099,"359530","AUTUMN COLOURS 2009","_DSC0018_thumb.jpg",130,115,1);thumbnails[6561104]=new thumbnail(6561104,"359530","","_DSC0005_thumb.jpg",130,96,1);thumbnails[6561106]=new thumbnail(6561106,"359530","","_DSC0011_thumb.jpg",130,117,1);thumbnails[6561109]=new thumbnail(6561109,"359531","BRENZETT, KENT,  SHOW 2009","IMG_2459-copy_thumb.jpg",130,195,1);thumbnails[6561113]=new thumbnail(6561113,"359534","CAERNARFON, WALES 2009","IMG_0240-copy_thumb.jpg",130,87,1);thumbnails[6567768]=new thumbnail(6567768,"359534","","2-1-copy_thumb.jpg",130,87,1);thumbnails[6567783]=new thumbnail(6567783,"359534","SNOWDONIA","YUYU-6-copy_thumb.jpg",130,84,1);thumbnails[6571043]=new thumbnail(6571043,"359522","AIR- BRITAIN COLLECTION.","1133190F_thumb.jpg",130,78,1);thumbnails[6581157]=new thumbnail(6581157,"359522","AIRPORT-DATA.COM","285664_thumb.jpg",130,79,1);thumbnails[6624287]=new thumbnail(6624287,"359530","","_DSC0001_thumb.jpg",130,96,1);thumbnails[6624290]=new thumbnail(6624290,"359530","","_DSC0008_thumb.jpg",130,107,1);thumbnails[6624291]=new thumbnail(6624291,"359530","","_DSC0035_thumb.jpg",130,109,1);thumbnails[6624293]=new thumbnail(6624293,"359530","","_DSC0006_BAB156B3-24E8-5EC4-4FB0E9743707963F_thumb.jpg",130,90,1);thumbnails[6624294]=new thumbnail(6624294,"359530","","_DSC0020_BAB20023-24E8-5EC4-4F00C614D31E3DB4_thumb.jpg",130,86,1);thumbnails[6624297]=new thumbnail(6624297,"359522","","_DSC0281_thumb.jpg",130,97,1);thumbnails[6625120]=new thumbnail(6625120,"359530","","_DSC0044_thumb.jpg",130,101,1);var galleries=new Object();galleries[359522]=new gallery(359522,"6624297,6581157,6571043,6450310,6445182,6445180,6423281,6405881,6405021,6404997","AIRCRAFT","gallery",[6345861,6345862,6345867,6345877,6345878,6345893,6346114,6346116,6346117,6346413,6346418,6347019,6347021,6347044,6350173,6350189,6351110,6351136,6351144,6351149,6351165,6352426,6352431,6352436,6352446,6352501,6357814,6394492,6404997,6405021,6405881,6423281,6445180,6445182,6450310,6571043,6581157,6624297]);galleries[359531]=new gallery(359531,"6561109,6548454","ANIMALS","gallery",[6548454,6561109]);galleries[359533]=new gallery(359533,"6548533,6548269","GENERAL INTEREST","gallery",[6548269,6548533]);galleries[351883]=new gallery(351883,"6558989,6555485,6555356,6555350,6555346,6555292,6555289,6555277,6551991,6352498","INTERESTING VEHICLES - OF ALL KINDS!","gallery",[6352498,6551991,6555277,6555289,6555292,6555346,6555350,6555356,6555485,6558989]);galleries[359530]=new gallery(359530,"6625120,6624294,6624293,6624291,6624290,6624287,6561106,6561104,6561099,6560772","NATURE","gallery",[6548144,6548217,6560768,6560772,6561099,6561104,6561106,6624287,6624290,6624291,6624293,6624294,6625120]);galleries[359534]=new gallery(359534,"6567783,6567768,6561113,6559011","PLACES AND BUILDINGS","gallery",[6559011,6561113,6567768,6567783]);galleries[359540]=new gallery(359540,"6560791,6560750,6549259,6548262","SHIPS AND THE SEA","gallery",[6548262,6549259,6560750,6560791]);var imageSets=new Object();imageSets[1]="6625120,6624297,6624294,6624293,6624291,6624290,6624287,6581157,6571043,6567783,6567768,6561113,6561109,6561106,6561104,6561099,6560791,6560772,6560768,6560750,6559011,6558989,6555485,6555356,6555350,6555346,6555292,6555289,6555277,6551991,6549259,6548533,6548454,6548269,6548262,6548217,6548144,6450310,6445182,6445180,6423281,6405881,6405021,6404997,6394492,6357814,6352501,6352498,6352446,6352436";imageSets[3]="6625120,6624297,6624294,6624293,6624291,6624290,6624287,6581157,6571043,6567783,6567768,6561113,6561109,6561106,6561104,6561099,6560791,6560772,6560768,6560750,6559011,6558989,6555485,6555356,6555350,6555346,6555292,6555289,6555277,6551991,6549259,6548533,6548454,6548269,6548262,6548217,6548144,6450310,6445182,6445180,6423281,6405881,6405021,6404997,6394492,6357814,6352501,6352498,6352446,6352436";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/martinbee/images";break}switch(a){case 1:b="http://www1.clikpic.com/martinbee/images";break}switch(a){case 2:b="http://admin.clikpic.com/martinbee/images";break}switch(a){case 24:b="http://tpc15/clikpic/martinbee/images";break}switch(a){case 4:b="http://www.clikchurch.com/martinbee/images";break}switch(a){case 5:b="http://www2.clikpic.com/martinbee/images";break}switch(a){case 22:b="http://tpc5/clikpic/martinbee/images";break}switch(a){case 23:b="http://tpc10/clikpic/martinbee/images";break}switch(a){case 25:b="http://tpc16/clikpic/martinbee/images";break}switch(a){case 15:b="http://www3.clikpic.com/martinbee/images";break}switch(a){case 18:b="http://www4.clikpic.com/martinbee/images";break}switch(a){case 19:b="http://www5.clikpic.com/martinbee/images";break}switch(a){case 31:b="http://www7.clikpic.com/martinbee/images";break}switch(a){case 32:b="http://admin2.clikpic.com/martinbee/images";break}switch(a){case 33:b="http://www8.clikpic.com/martinbee/images";break}switch(a){case 34:b="http://www9.clikpic.com/martinbee/images";break}switch(a){case 35:b="http://admin3.clikpic.com/martinbee/images";break}switch(a){case 37:b="http://admin4.clikpic.com/martinbee/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="MARTIN PHILIP BROWNE  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();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>"}a=a+fnGetPaymentInfo(photos[b]);if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Buy now using PayPal:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 				&pound;"+(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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="MARTINBEE">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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<100){var e=$("img#gallery"+c);e.parents(".thumbWrap").width(b.width);var a=e.siblings("h3").size()==1?e.siblings("h3"):e.parent(".thumbWrap").siblings("h3");var f=parseInt(a.css("padding-left"))+parseInt(a.css("padding-right"));var d=parseInt(a.css("border-left-width"))+parseInt(a.css("border-right-width"));a.width(e.outerWidth(true)-f-d)}}}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+'")'})}}};