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[945483]=new thumbnail(945483,"","With my studio overlooking the sea, when the sun comes out so do my paints. I see the children enjoying themselves digging in the sand, splashing in the sea, flying kites, playing ball....","postcardbeachscene1.jpg",130,85,1);thumbnails[945763]=new thumbnail(945763,"","","brenda-painting-photo1.jpg",130,112,1);thumbnails[907903]=new thumbnail(907903,"69287","","a-moment-in-time.jpg",100,100,1);thumbnails[907918]=new thumbnail(907918,"69287","","catch-of-the-day.jpg",100,100,1);thumbnails[907920]=new thumbnail(907920,"69287","","father's-line.jpg",100,100,1);thumbnails[907924]=new thumbnail(907924,"69287","","rock-pools.jpg",100,100,1);thumbnails[907927]=new thumbnail(907927,"69287","","crabs1.jpg",100,100,1);thumbnails[907986]=new thumbnail(907986,"69287","","once-upon-a-time.jpg",100,100,1);thumbnails[907988]=new thumbnail(907988,"69287","","up-and-away.jpg",100,100,1);thumbnails[907989]=new thumbnail(907989,"69287","","windy-worthing.jpg",100,100,1);thumbnails[907990]=new thumbnail(907990,"69287","","feeding-the-gulls.jpg",100,100,1);thumbnails[907996]=new thumbnail(907996,"69306","","lone-sailor.jpg",100,100,1);thumbnails[907999]=new thumbnail(907999,"69306","","path-to-the-sea.jpg",100,100,1);thumbnails[908001]=new thumbnail(908001,"69306","","finders-keepers.jpg",100,100,1);thumbnails[908003]=new thumbnail(908003,"69306","","once-upon-a-time-2.jpg",100,100,1);thumbnails[908006]=new thumbnail(908006,"69306","","evening1.jpg",100,100,1);thumbnails[908009]=new thumbnail(908009,"69306","","incoming-tide.jpg",100,100,1);thumbnails[908011]=new thumbnail(908011,"69306","","boatrace1.jpg",100,100,1);thumbnails[908141]=new thumbnail(908141,"69306","","august1.jpg",100,100,1);thumbnails[907908]=new thumbnail(907908,"69306","","gone-fishing.jpg",100,100,1);thumbnails[908021]=new thumbnail(908021,"69308","","sea-&-sky.jpg",100,100,1);thumbnails[908022]=new thumbnail(908022,"69308","","we-three-&-fred.jpg",100,100,1);thumbnails[908023]=new thumbnail(908023,"69308","","lighthouse1.jpg",100,100,1);thumbnails[908024]=new thumbnail(908024,"69308","","Goring1.jpg",100,100,1);thumbnails[908025]=new thumbnail(908025,"69308","","worthing-pier-evening.jpg",100,100,1);thumbnails[908027]=new thumbnail(908027,"69308","","school-holidays.jpg",100,100,1);thumbnails[908030]=new thumbnail(908030,"69308","","sandcastles1.jpg",100,100,1);thumbnails[908031]=new thumbnail(908031,"69308","","wet-sands.jpg",100,100,1);thumbnails[908110]=new thumbnail(908110,"69309","","surf-2.jpg",100,100,1);thumbnails[908138]=new thumbnail(908138,"69309","","surf-1.jpg",100,100,1);thumbnails[908140]=new thumbnail(908140,"69309","","surf-3.jpg",100,100,1);thumbnails[908142]=new thumbnail(908142,"69309","","wish-you-were-here.jpg",100,100,1);thumbnails[908143]=new thumbnail(908143,"69309","","some-like-it-hot.jpg",100,100,1);thumbnails[908144]=new thumbnail(908144,"69309","","three-umbrellas.jpg",100,100,1);thumbnails[908145]=new thumbnail(908145,"69309","","shell-seekers.jpg",100,100,1);thumbnails[908147]=new thumbnail(908147,"69309","","with-grandma.jpg",100,100,1);thumbnails[908148]=new thumbnail(908148,"69309","","flying1.jpg",100,100,1);thumbnails[5095672]=new thumbnail(5095672,"288103","Click on image to enlarge","map2_thumb.jpg",130,125,1);var galleries=new Object();galleries[69287]=new gallery(69287,"907990,907989,907988,907986,907927,907924,907920,907918,907903","Gallery 1","gallery",[907903,907918,907920,907924,907927,907986,907988,907989,907990]);galleries[69306]=new gallery(69306,"908141,908011,908009,908006,908003,908001,907999,907996,907908","Gallery 2","gallery",[907996,907999,908001,908003,908006,908009,908011,908141,907908]);galleries[69308]=new gallery(69308,"908031,908030,908027,908025,908024,908023,908022,908021","Gallery 3","gallery",[908021,908022,908023,908024,908025,908027,908030,908031]);galleries[69309]=new gallery(69309,"908148,908147,908145,908144,908143,908142,908140,908138,908110","Gallery 4","gallery",[908110,908138,908140,908142,908143,908144,908145,908147,908148]);galleries[288103]=new gallery(288103,"5095672","Brooks Studios Location","gallery",[5095672]);var imageSets=new Object();imageSets[1]="5095672,945763,945483,908148,908147,908145,908144,908143,908142,908141,908140,908138,908110,908031,908030,908027,908025,908024,908023,908022,908021,908011,908009,908006,908003,908001,907999,907996,907990,907989,907988,907986,907927,907924,907920,907918,907908,907903";imageSets[3]="5095672,945763,945483,908148,908147,908145,908144,908143,908142,908141,908140,908138,908110,908031,908030,908027,908025,908024,908023,908022,908021,908011,908009,908006,908003,908001,907999,907996,907990,907989,907988,907986,907927,907924,907920,907918,907908,907903";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/brooksart/images";break}switch(a){case 1:b="http://www1.clikpic.com/brooksart/images";break}switch(a){case 2:b="http://admin.clikpic.com/brooksart/images";break}switch(a){case 24:b="http://tpc15/clikpic/brooksart/images";break}switch(a){case 4:b="http://www.clikchurch.com/brooksart/images";break}switch(a){case 5:b="http://www2.clikpic.com/brooksart/images";break}switch(a){case 22:b="http://tpc5/clikpic/brooksart/images";break}switch(a){case 23:b="http://tpc10/clikpic/brooksart/images";break}switch(a){case 25:b="http://tpc16/clikpic/brooksart/images";break}switch(a){case 15:b="http://www3.clikpic.com/brooksart/images";break}switch(a){case 18:b="http://www4.clikpic.com/brooksart/images";break}switch(a){case 19:b="http://www5.clikpic.com/brooksart/images";break}switch(a){case 31:b="http://www7.clikpic.com/brooksart/images";break}switch(a){case 32:b="http://admin2.clikpic.com/brooksart/images";break}switch(a){case 33:b="http://www8.clikpic.com/brooksart/images";break}switch(a){case 34:b="http://www9.clikpic.com/brooksart/images";break}switch(a){case 35:b="http://admin3.clikpic.com/brooksart/images";break}switch(a){case 37:b="http://admin4.clikpic.com/brooksart/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="Brenda Brooks: "+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).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+'")'})}}};