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[2504924]=new thumbnail(2504924,"","Location","RWP_64941_thumb.jpg",130,194,5);thumbnails[5095570]=new thumbnail(5095570,"","","GraphiProductShot3_thumb.jpg",130,133,5);thumbnails[2223849]=new thumbnail(2223849,"","Creative","RWP_3903_thumb.jpg",130,239,5);thumbnails[2230367]=new thumbnail(2230367,"","'Trash The Dress'","RWP_4119_thumb.jpg",130,194,5);thumbnails[2238552]=new thumbnail(2238552,"","Reportage","RWP_4899_thumb.jpg",130,100,5);thumbnails[5169051]=new thumbnail(5169051,"","RWP 8073","RWP_8073_thumb.jpg",99,130,5);thumbnails[2238550]=new thumbnail(2238550,"","Classic","DSC_4552_thumb.jpg",130,86,5);thumbnails[2238549]=new thumbnail(2238549,"","Precious Memories","RWP_5141_thumb.jpg",130,97,5);thumbnails[2238554]=new thumbnail(2238554,"","Location","DSC_5147_thumb.jpg",130,86,5);thumbnails[2238553]=new thumbnail(2238553,"","Ambience","RWP_6087_thumb.jpg",130,87,5);thumbnails[2238551]=new thumbnail(2238551,"","Relaxed, informal","RWP_4986_thumb.jpg",130,195,5);thumbnails[2238555]=new thumbnail(2238555,"","Reportage","DSC_4452_thumb.jpg",130,195,5);thumbnails[2238903]=new thumbnail(2238903,"","Bridesmaid","DSC_5131_thumb.jpg",130,86,5);thumbnails[2238910]=new thumbnail(2238910,"","Reportage","RWP_44571_thumb.jpg",130,169,5);thumbnails[2238926]=new thumbnail(2238926,"","Group","DSC_5288_thumb.jpg",130,76,5);thumbnails[2238930]=new thumbnail(2238930,"","Details","RWP_6382_thumb.jpg",130,204,5);thumbnails[2238904]=new thumbnail(2238904,"","Reportage","RWP_3960_thumb.jpg",130,95,5);thumbnails[5153238]=new thumbnail(5153238,"291226","","_RWP3668112_thumb.jpg",130,194,5);thumbnails[5168922]=new thumbnail(5168922,"291226","","RWP_51472_thumb.jpg",130,87,5);thumbnails[5168949]=new thumbnail(5168949,"291226","","RWP_49345_thumb.jpg",130,87,5);thumbnails[5169186]=new thumbnail(5169186,"291226","","RWP_7335_thumb.jpg",96,130,5);thumbnails[5169189]=new thumbnail(5169189,"291226","","RWP_9039_thumb.jpg",98,130,5);thumbnails[5169190]=new thumbnail(5169190,"291226","","RWP_91403_thumb.jpg",81,130,5);thumbnails[5169192]=new thumbnail(5169192,"291226","","RWP_7083_thumb.jpg",97,130,5);thumbnails[5169195]=new thumbnail(5169195,"291226","","RWP_4119_35782557-2219-B5B5-4CA5950C9035B8A7_thumb.jpg",87,130,5);thumbnails[5169197]=new thumbnail(5169197,"291226","","RWP_4296_thumb.jpg",100,130,5);thumbnails[5169199]=new thumbnail(5169199,"291226","","RWP_4538_thumb.jpg",94,130,5);thumbnails[5169200]=new thumbnail(5169200,"291226","","RWP_4557_thumb.jpg",67,130,5);thumbnails[5117510]=new thumbnail(5117510,"291226","","RWP_22005_thumb.jpg",130,181,5);thumbnails[5184758]=new thumbnail(5184758,"291226","Wedding Portraiture","RWP_9805_thumb.jpg",90,130,5);thumbnails[6657797]=new thumbnail(6657797,"291226","The Day, The Moment, The Memory","_RWP3741_thumb.jpg",130,50,5);thumbnails[5169046]=new thumbnail(5169046,"291226","","Graphi_Product_Shot_Comp_65F83CA0-1D09-001F-990C5733A8E48CAF_thumb.jpg",127,130,5);thumbnails[5169048]=new thumbnail(5169048,"291226","","RWP_1315_thumb.jpg",130,98,5);thumbnails[5169050]=new thumbnail(5169050,"291226","","RWP_1498_thumb.jpg",130,81,5);thumbnails[5169053]=new thumbnail(5169053,"291226","","RWP_1659_thumb.jpg",130,89,5);thumbnails[5169054]=new thumbnail(5169054,"291226","","RWP_1986_thumb.jpg",93,130,5);thumbnails[5169055]=new thumbnail(5169055,"291226","","RWP_2200_thumb.jpg",93,130,5);thumbnails[5169056]=new thumbnail(5169056,"291226","","RWP_3167_3564CF3F-2219-B5B5-4CB98EC08C65B26C_thumb.jpg",83,130,5);thumbnails[5169057]=new thumbnail(5169057,"291226","","RWP_3664_thumb.jpg",130,86,5);thumbnails[5169058]=new thumbnail(5169058,"291226","","RWP_3925_thumb.jpg",130,74,5);thumbnails[5169059]=new thumbnail(5169059,"291226","","RWP_3947_thumb.jpg",130,73,5);thumbnails[5169060]=new thumbnail(5169060,"291226","","RWP_5018_thumb.jpg",130,87,5);thumbnails[5169061]=new thumbnail(5169061,"291226","","RWP_5141_3564DBC2-2219-B5B5-4C594C280282EA12_thumb.jpg",130,86,5);thumbnails[5169062]=new thumbnail(5169062,"291226","","RWP_5147_3564DC01-2219-B5B5-4CCFA0E19063A98C_thumb.jpg",130,87,5);thumbnails[5169063]=new thumbnail(5169063,"291226","","RWP_6502_thumb.jpg",74,130,5);thumbnails[5169064]=new thumbnail(5169064,"291226","","RWP_7024_thumb.jpg",94,130,5);thumbnails[2238493]=new thumbnail(2238493,"145584","'The Bringewood - Winter Dawn 1'","Bringewood Winter Dawn_0934 18x12_thumb.jpg",130,87,5);thumbnails[2238494]=new thumbnail(2238494,"145584","'Whitesands Sunset'","RWP_2352_thumb.jpg",130,92,5);thumbnails[2238497]=new thumbnail(2238497,"145584","'Yellow Suburban Fields'","Yellow Suburban Fields 8X8_0819_thumb.jpg",130,130,5);thumbnails[2238502]=new thumbnail(2238502,"145584","'Incoming'","Incoming_4264_thumb.jpg",130,45,5);thumbnails[2238506]=new thumbnail(2238506,"145584","'Tower Power'","Tower Power RWP_3288_thumb.jpg",130,194,5);thumbnails[2238510]=new thumbnail(2238510,"145584","'Red Bloom on Wood'","Red Flower Wycliffe  12x8 4416_thumb.jpg",130,102,5);thumbnails[2238513]=new thumbnail(2238513,"145584","'Tenby Beach'","Tenby Beach Scene_3967_thumb.jpg",130,62,5);thumbnails[2257363]=new thumbnail(2257363,"145584","'Golden Bales'","Golden Bales 4547_thumb.jpg",130,87,5);thumbnails[2238414]=new thumbnail(2238414,"145987","Exterior Photomural","Photomural_thumb.jpg",130,118,5);thumbnails[2238415]=new thumbnail(2238415,"145987","Interior Photomural","Canvas A 10x2_thumb.jpg",130,37,5);thumbnails[2253793]=new thumbnail(2253793,"145987","Fashion","Studio Portraiture_3552_thumb.jpg",130,206,5);thumbnails[2253794]=new thumbnail(2253794,"145987","Agriculture","RWP_6686_thumb.jpg",130,87,5);thumbnails[2253795]=new thumbnail(2253795,"145987","Portraiture for Business","Press & PR_3057_thumb.jpg",130,205,5);thumbnails[2579554]=new thumbnail(2579554,"145987","Interiors","Architecture_26851_thumb.jpg",130,79,5);thumbnails[2579559]=new thumbnail(2579559,"145987","Architectural details - photo montage","Architecture Montage_thumb.jpg",130,153,5);thumbnails[5995914]=new thumbnail(5995914,"145987","","_RWP4453_thumb.jpg",87,130,5);thumbnails[6657712]=new thumbnail(6657712,"145987","Product Shoot","RWP_7830_thumb.jpg",54,130,5);thumbnails[5560713]=new thumbnail(5560713,"145987","Advertising","RWP_5653_Spot_Colour_21_thumb.jpg",130,78,5);thumbnails[6657768]=new thumbnail(6657768,"145987","Product Shoot","RWP_7633_thumb.jpg",86,130,5);thumbnails[3215730]=new thumbnail(3215730,"145987","Promotion and Advertising","RWP_8209_thumb.jpg",130,166,5);thumbnails[2238409]=new thumbnail(2238409,"145987","Industrial","APC Cliff CMS_3401_thumb.jpg",130,117,5);thumbnails[2238431]=new thumbnail(2238431,"145984","College Ball","Prom_0561_thumb.jpg",130,93,5);thumbnails[2238440]=new thumbnail(2238440,"145984","Fancy Dress Gala Party","Fancy Dress Ball_8706_thumb.jpg",130,195,5);thumbnails[2238477]=new thumbnail(2238477,"145984","Party Time","RWP_2134_thumb.jpg",130,86,5);thumbnails[2238478]=new thumbnail(2238478,"145984","Sports Day","RWP_0437_thumb.jpg",130,101,5);thumbnails[2238484]=new thumbnail(2238484,"145984","Red Carpet Occasions","Red Carpet_8540_thumb.jpg",130,195,5);thumbnails[2238490]=new thumbnail(2238490,"145984","School Days","School Days_0222_thumb.jpg",130,118,5);thumbnails[2238491]=new thumbnail(2238491,"145984","Corporate Events","RWP_0067_thumb.jpg",130,88,5);thumbnails[3962081]=new thumbnail(3962081,"145984","Prom Night","RWP_8072_thumb.jpg",130,157,5);thumbnails[5169047]=new thumbnail(5169047,"145984","Llandovery College Ball: Coral Lewis, lifeguard hero ","RWP_1383_thumb.jpg",80,130,5);thumbnails[2224340]=new thumbnail(2224340,"145984","College Ball","21st Birthday_0568_thumb.jpg",130,207,5);thumbnails[2235323]=new thumbnail(2235323,"145983","Reportage","RWP_0177_thumb.jpg",130,102,5);thumbnails[2235340]=new thumbnail(2235340,"145983","Portraits at Home","_RWP7482B&W_thumb.jpg",130,89,5);thumbnails[2236122]=new thumbnail(2236122,"145983","Corporate Portraiture","Corporate Portraiture_3161_thumb.jpg",130,194,5);thumbnails[2238492]=new thumbnail(2238492,"145983","Family Portraits","UGO 08_0057_thumb.jpg",130,98,5);thumbnails[2224462]=new thumbnail(2224462,"145983","Portraits at Home","Portraiture at Home_ 98581_thumb.jpg",130,88,5);thumbnails[2224386]=new thumbnail(2224386,"145983","Studio Portraits","_RWP7844_thumb.jpg",130,182,5);thumbnails[2236018]=new thumbnail(2236018,"145983","Pop Art Prints","Lucy Warhol Poster Ad _thumb.jpg",130,160,5);var galleries=new Object();galleries[291226]=new gallery(291226,"5169053","Wedding Photography","gallery",[5153238,5168922,5168949,5169186,5169189,5169190,5169192,5169195,5169197,5169199,5169200,5117510,5184758,6657797,5169046,5169048,5169050,5169053,5169054,5169055,5169056,5169057,5169058,5169059,5169060,5169061,5169062,5169063,5169064]);galleries[145584]=new gallery(145584,"2257363,2238513,2238510,2238506,2238502,2238497,2238494,2238493","Fine Art Prints","gallery",[2238493,2238494,2238497,2238502,2238506,2238510,2238513,2257363]);galleries[145987]=new gallery(145987,"5560713","Commercial","gallery",[2238414,2238415,2253793,2253794,2253795,2579554,2579559,5995914,6657712,5560713,6657768,3215730,2238409]);galleries[145984]=new gallery(145984,"5169047,2224340","Event Photography","gallery",[2238431,2238440,2238477,2238478,2238484,2238490,2238491,3962081,5169047,2224340]);galleries[145983]=new gallery(145983,"2224462","Portraiture","gallery",[2235323,2235340,2236122,2238492,2224462,2224386,2236018]);var imageSets=new Object();imageSets[1]="5995914,5560713,5184758,2236018,2230367,2224462,2224386,2224340,2223849";imageSets[2]="5560713,5169053,5169047,2224462,2224340,2223849";imageSets[3]="6657797,5560713";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/richardweaverphoto/images";break}switch(a){case 1:b="http://www1.clikpic.com/richardweaverphoto/images";break}switch(a){case 2:b="http://admin.clikpic.com/richardweaverphoto/images";break}switch(a){case 24:b="http://tpc15/clikpic/richardweaverphoto/images";break}switch(a){case 4:b="http://www.clikchurch.com/richardweaverphoto/images";break}switch(a){case 5:b="http://www2.clikpic.com/richardweaverphoto/images";break}switch(a){case 22:b="http://tpc5/clikpic/richardweaverphoto/images";break}switch(a){case 23:b="http://tpc10/clikpic/richardweaverphoto/images";break}switch(a){case 25:b="http://tpc16/clikpic/richardweaverphoto/images";break}switch(a){case 15:b="http://www3.clikpic.com/richardweaverphoto/images";break}switch(a){case 18:b="http://www4.clikpic.com/richardweaverphoto/images";break}switch(a){case 19:b="http://www5.clikpic.com/richardweaverphoto/images";break}switch(a){case 31:b="http://www7.clikpic.com/richardweaverphoto/images";break}switch(a){case 32:b="http://admin2.clikpic.com/richardweaverphoto/images";break}switch(a){case 33:b="http://www8.clikpic.com/richardweaverphoto/images";break}switch(a){case 34:b="http://www9.clikpic.com/richardweaverphoto/images";break}switch(a){case 35:b="http://admin3.clikpic.com/richardweaverphoto/images";break}switch(a){case 37:b="http://admin4.clikpic.com/richardweaverphoto/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="Richard Weaver 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>"}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="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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="rich.weaver@virgin.net">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="rich.weaver@virgin.net">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};