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[4701881]=new thumbnail(4701881,"","","bouquet_thumb.jpg",130,130,18);thumbnails[4701970]=new thumbnail(4701970,"270298","","SHOES_thumb.jpg",130,130,18);thumbnails[4701990]=new thumbnail(4701990,"273086","","ANNIE_thumb.jpg",130,130,18);thumbnails[4702022]=new thumbnail(4702022,"273131","","Lyingonthefloor_thumb.jpg",130,130,18);thumbnails[4702106]=new thumbnail(4702106,"278218","PAUL MASON STUDIOS","studio_thumb.jpg",130,130,18);thumbnails[4767362]=new thumbnail(4767362,"273082","","1_107_thumb.jpg",130,130,18);thumbnails[4767379]=new thumbnail(4767379,"270456","","8_thumb.JPG",130,130,18);thumbnails[4767411]=new thumbnail(4767411,"","","12_thumb.jpg",130,130,18);thumbnails[4770028]=new thumbnail(4770028,"273131","","10_SINGLE_IMAGE_12X8_thumb.jpg",130,130,18);thumbnails[4770117]=new thumbnail(4770117,"273131","","IMG_1057_bw_thumb.jpg",130,130,18);thumbnails[4770128]=new thumbnail(4770128,"273131","","IMG_2680_thumb.JPG",130,130,18);thumbnails[4770160]=new thumbnail(4770160,"273131","","IMG_2354bw_proof_thumb.jpg",130,130,18);thumbnails[4770320]=new thumbnail(4770320,"273114","","IMG_6186_bw_thumb.jpg",130,130,18);thumbnails[4770332]=new thumbnail(4770332,"273114","","IMG_1382_bw_thumb.jpg",130,130,18);thumbnails[4770344]=new thumbnail(4770344,"273114","","IMG_1460_18x12_bw_thumb.jpg",130,130,18);thumbnails[4770390]=new thumbnail(4770390,"273129","","IMG_6752_thumb.JPG",130,130,18);thumbnails[4770399]=new thumbnail(4770399,"273129","","IMG_6754_thumb.JPG",130,130,18);thumbnails[4770404]=new thumbnail(4770404,"270298","","01_thumb.JPG",130,130,18);thumbnails[4770407]=new thumbnail(4770407,"270298","","33_thumb.jpg",130,130,18);thumbnails[4770417]=new thumbnail(4770417,"270298","","38_thumb.JPG",130,130,18);thumbnails[4770428]=new thumbnail(4770428,"270456","","16_thumb.JPG",130,130,18);thumbnails[4770436]=new thumbnail(4770436,"273132","","IMG_1005A_thumb.jpg",130,130,18);thumbnails[4770446]=new thumbnail(4770446,"273132","","IMG_9203_thumb.JPG",130,130,18);thumbnails[4770455]=new thumbnail(4770455,"273085","","IMG_1243_thumb.JPG",130,130,18);thumbnails[4770457]=new thumbnail(4770457,"273085","","IMG_9822_bw_thumb.JPG",130,130,18);thumbnails[4770461]=new thumbnail(4770461,"273131","","IMG_1391a_thumb.jpg",130,130,18);thumbnails[4770486]=new thumbnail(4770486,"273161","","IMG_9529BW_thumb.JPG",130,130,18);thumbnails[4770526]=new thumbnail(4770526,"273470","Custard Factory, Digbeth, Birmingham","011_thumb.jpg",130,130,18);thumbnails[4770702]=new thumbnail(4770702,"273465","Drayton Manor Park","17_thumb.JPG",130,130,18);thumbnails[4776231]=new thumbnail(4776231,"273465","Drayton Manor Park","20_thumb.JPG",130,130,18);thumbnails[4776298]=new thumbnail(4776298,"273465","Childrens Magician","03_thumb.JPG",130,130,18);thumbnails[4776300]=new thumbnail(4776300,"273465","A Level Results","27_thumb.JPG",130,130,18);thumbnails[4776311]=new thumbnail(4776311,"273465","Ex Status Quo Drummer ","34_thumb.JPG",130,130,18);thumbnails[4776318]=new thumbnail(4776318,"273470","Custard Factory, Digbeth, Birmingham","02_thumb.jpg",130,130,18);thumbnails[4776382]=new thumbnail(4776382,"273470","Custard Factory, Digbeth, Birmingham","031_thumb.jpg",130,130,18);thumbnails[4776820]=new thumbnail(4776820,"273082","","1_71_thumb.JPG",130,130,18);thumbnails[4776824]=new thumbnail(4776824,"273082","","1_123_thumb.JPG",130,130,18);thumbnails[4776880]=new thumbnail(4776880,"273082","","1_7_thumb.JPG",130,130,18);thumbnails[4776975]=new thumbnail(4776975,"273082","","1_133_thumb.JPG",130,130,18);thumbnails[4776991]=new thumbnail(4776991,"273082","","1_106_thumb.JPG",130,130,18);thumbnails[4777484]=new thumbnail(4777484,"270456","","IMG_7990_thumb.JPG",130,130,18);thumbnails[4777783]=new thumbnail(4777783,"273513","","IMG_1259_thumb.JPG",130,130,18);thumbnails[4777784]=new thumbnail(4777784,"273513","","IMG_1276_thumb.JPG",130,130,18);thumbnails[4777785]=new thumbnail(4777785,"273513","","IMG_1302_thumb.JPG",130,130,18);thumbnails[4777846]=new thumbnail(4777846,"273513","","52_IMG_7860_7x5_thumb.JPG",130,130,18);thumbnails[4777849]=new thumbnail(4777849,"273513","","IMG_5126_thumb.JPG",130,130,18);thumbnails[4777853]=new thumbnail(4777853,"273513","","IMG_7043_thumb.JPG",130,130,18);thumbnails[4777856]=new thumbnail(4777856,"273513","","IMG_7060_thumb.JPG",130,130,18);thumbnails[4777878]=new thumbnail(4777878,"273518","","28_IMG_4619_thumb.JPG",130,130,18);thumbnails[4777882]=new thumbnail(4777882,"273518","","IMG_1018_thumb.JPG",130,130,18);thumbnails[4788507]=new thumbnail(4788507,"273994","3 IMAGE COLLECTIONS - FRAMED & MOUNTED TO SUIT YOUR HOME","3_image_collection_2_-_1-6x4_2-3x3_at_10x12_thumb.jpg",130,130,18);thumbnails[4788509]=new thumbnail(4788509,"273994","4 IMAGE COLLECTIONS - FRAMED & MOUNTED TO SUIT YOUR HOME","4_COLLECTION_12X12_thumb.jpg",130,130,18);thumbnails[4788512]=new thumbnail(4788512,"273994","7 IMAGE COLLECTIONS - FRAMED & MOUNTED TO SUIT YOUR HOME","021_thumb.jpg",130,130,18);thumbnails[4788513]=new thumbnail(4788513,"273994","9 IMAGE COLLECTIONS - FRAMED AND MOUNTED TO SUIT YOUR HOME","1_thumb.jpg",130,130,18);thumbnails[4788557]=new thumbnail(4788557,"273996","","05_panoramic_thumb.jpg",130,130,18);thumbnails[4788569]=new thumbnail(4788569,"273996","","06_panoramic_thumb.jpg",130,130,18);thumbnails[4788571]=new thumbnail(4788571,"273996","","IMG_2369bw_merge_18x12_thumb.jpg",130,130,18);thumbnails[4788572]=new thumbnail(4788572,"273996","","IMG_2931_24x12_thumb.jpg",130,130,18);thumbnails[4876197]=new thumbnail(4876197,"","","IMG_0092_thumb.JPG",130,130,18);thumbnails[4876200]=new thumbnail(4876200,"","","IMG_0101_thumb.JPG",130,130,18);thumbnails[4876202]=new thumbnail(4876202,"","","IMG_0104_thumb.JPG",130,130,18);thumbnails[4876204]=new thumbnail(4876204,"","","IMG_0113_thumb.JPG",130,130,18);thumbnails[4876224]=new thumbnail(4876224,"","","IMG_0122_thumb.JPG",130,130,18);thumbnails[4876465]=new thumbnail(4876465,"","","81_IMG_0502-1_thumb.jpg",130,130,18);thumbnails[4876491]=new thumbnail(4876491,"","","109_IMG_0531_thumb.JPG",130,130,18);thumbnails[4876494]=new thumbnail(4876494,"","","113_IMG_0564_thumb.JPG",130,130,18);thumbnails[4876496]=new thumbnail(4876496,"","","15_IMG_0139_thumb.JPG",130,130,18);thumbnails[4876514]=new thumbnail(4876514,"","","16_IMG_0143_thumb.JPG",130,130,18);thumbnails[4876515]=new thumbnail(4876515,"","","17_IMG_0145_thumb.JPG",130,130,18);thumbnails[4876518]=new thumbnail(4876518,"","","18_IMG_0148_thumb.JPG",130,130,18);thumbnails[4876520]=new thumbnail(4876520,"","","19_IMG_0154_thumb.JPG",130,130,18);thumbnails[4876523]=new thumbnail(4876523,"","","24_IMG_0226_thumb.JPG",130,130,18);thumbnails[4876524]=new thumbnail(4876524,"","","36_IMG_0025_thumb.JPG",130,130,18);thumbnails[4876525]=new thumbnail(4876525,"","","153_IMG_0631_thumb.JPG",130,130,18);thumbnails[4876526]=new thumbnail(4876526,"","","118_IMG_0612_thumb.JPG",130,130,18);thumbnails[4876528]=new thumbnail(4876528,"","","57_IMG_0342_thumb.JPG",130,130,18);thumbnails[4876530]=new thumbnail(4876530,"","","65_IMG_8482_thumb.JPG",130,130,18);thumbnails[4876534]=new thumbnail(4876534,"","","107_IMG_0559_thumb.JPG",130,130,18);var galleries=new Object();galleries[273086]=new gallery(273086,"4701990","Babies","section328198",[4701990]);galleries[273114]=new gallery(273114,"4770344,4770332,4770320","Babies","section325167",[4770320,4770332,4770344]);galleries[273131]=new gallery(273131,"4770461,4770160,4770128,4770117,4770028,4702022","Children","section325167",[4702022,4770028,4770117,4770128,4770160,4770461]);galleries[273132]=new gallery(273132,"4770446,4770436","Children","section328198",[4770436,4770446]);galleries[273085]=new gallery(273085,"4770457,4770455","GrandParents","section328198",[4770455,4770457]);galleries[273465]=new gallery(273465,"4776311,4776300,4776298,4776231,4770702","journalism","section325208",[4770702,4776231,4776298,4776300,4776311]);galleries[273470]=new gallery(273470,"4776382,4776318,4770526","music","section328546",[4770526,4776318,4776382]);galleries[278218]=new gallery(278218,"4702106","Paul Mason Studio","section325167",[4702106]);galleries[273161]=new gallery(273161,"4770486","Pets","section328198",[4770486]);galleries[270456]=new gallery(270456,"4777484,4770428,4767379","Pre WEDDING SHOOT","section325056",[4767379,4770428,4777484]);galleries[270107]=new gallery(270107,"","Studio at Middleton Hall","gallery",[]);galleries[273994]=new gallery(273994,"4788513,4788512,4788509,4788507","studio COLLECTIONS","section325167",[4788507,4788509,4788512,4788513]);galleries[273996]=new gallery(273996,"4788572,4788571,4788569,4788557","studio MONTAGES ","section325167",[4788557,4788569,4788571,4788572]);galleries[273129]=new gallery(273129,"4770399,4770390","Teenagers","section325167",[4770390,4770399]);galleries[270298]=new gallery(270298,"4770417,4770407,4770404,4701970","Wedding ART","section325056",[4701970,4770404,4770407,4770417]);galleries[273518]=new gallery(273518,"4777882,4777878","wedding CONFETTI","section325056",[4777878,4777882]);galleries[273082]=new gallery(273082,"4776991,4776975,4776880,4776824,4776820,4767362","wedding DETAILS","section325056",[4767362,4776820,4776824,4776880,4776975,4776991]);galleries[273513]=new gallery(273513,"4777856,4777853,4777849,4777846,4777785,4777784,4777783","wedding PORTRAITS","section325056",[4777783,4777784,4777785,4777846,4777849,4777853,4777856]);var imageSets=new Object();imageSets[1]="4876534,4876530,4876528,4876526,4876525,4876524,4876523,4876520,4876518,4876515,4876514,4876496,4876494,4876491,4876465,4876224,4876204,4876202,4876200,4876197,4788572,4788571,4788569,4788557,4788513,4788512,4788509,4788507,4777882,4777878,4777856,4777853,4777849,4777846,4777785,4777784,4777783,4777484,4776991,4776975,4776880,4776824,4776820,4776382,4776318,4776311,4776300,4776298,4776231,4770702";imageSets[3]="4876534,4876530,4876528,4876526,4876525,4876524,4876523,4876520,4876518,4876515,4876514,4876496,4876494,4876491,4876465,4876224,4876204,4876202,4876200,4876197,4788572,4788571,4788569,4788557,4788513,4788512,4788509,4788507,4777882,4777878,4777856,4777853,4777849,4777846,4777785,4777784,4777783,4777484,4776991,4776975,4776880,4776824,4776820,4776382,4776318,4776311,4776300,4776298,4776231,4770702";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/p4u12506/images";break}switch(a){case 1:b="http://www1.clikpic.com/p4u12506/images";break}switch(a){case 2:b="http://admin.clikpic.com/p4u12506/images";break}switch(a){case 24:b="http://tpc15/clikpic/p4u12506/images";break}switch(a){case 4:b="http://www.clikchurch.com/p4u12506/images";break}switch(a){case 5:b="http://www2.clikpic.com/p4u12506/images";break}switch(a){case 22:b="http://tpc5/clikpic/p4u12506/images";break}switch(a){case 23:b="http://tpc10/clikpic/p4u12506/images";break}switch(a){case 25:b="http://tpc16/clikpic/p4u12506/images";break}switch(a){case 15:b="http://www3.clikpic.com/p4u12506/images";break}switch(a){case 18:b="http://www4.clikpic.com/p4u12506/images";break}switch(a){case 19:b="http://www5.clikpic.com/p4u12506/images";break}switch(a){case 31:b="http://www7.clikpic.com/p4u12506/images";break}switch(a){case 32:b="http://admin2.clikpic.com/p4u12506/images";break}switch(a){case 33:b="http://www8.clikpic.com/p4u12506/images";break}switch(a){case 34:b="http://www9.clikpic.com/p4u12506/images";break}switch(a){case 35:b="http://admin3.clikpic.com/p4u12506/images";break}switch(a){case 37:b="http://admin4.clikpic.com/p4u12506/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="Paul Mason 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).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+'")'})}}};