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[3282626]=new thumbnail(3282626,"","","j_thumb.jpg",130,87,32);thumbnails[3282861]=new thumbnail(3282861,"","","k_thumb.jpg",130,87,32);thumbnails[3282871]=new thumbnail(3282871,"","","o_thumb.jpg",130,87,32);thumbnails[3295664]=new thumbnail(3295664,"","","121_thumb.jpg",130,87,32);thumbnails[3295650]=new thumbnail(3295650,"","","112_thumb.jpg",130,87,32);thumbnails[3295667]=new thumbnail(3295667,"","","171_thumb.jpg",130,87,32);thumbnails[5100203]=new thumbnail(5100203,"","","IMG_5399_thumb.JPG",130,87,32);thumbnails[5100355]=new thumbnail(5100355,"","","IMG_5643_thumb.JPG",130,87,32);thumbnails[3295686]=new thumbnail(3295686,"","","161_thumb.jpg",130,195,32);thumbnails[3295592]=new thumbnail(3295592,"","","51_thumb.jpg",130,195,32);thumbnails[3295690]=new thumbnail(3295690,"","","141_thumb.jpg",130,195,32);thumbnails[3295697]=new thumbnail(3295697,"","","GetAttachment[1]_thumb.jpg",130,195,32);thumbnails[3282897]=new thumbnail(3282897,"","","t_thumb.jpg",130,195,32);thumbnails[5100371]=new thumbnail(5100371,"","","IMG_5869_thumb.JPG",130,195,32);thumbnails[3295599]=new thumbnail(3295599,"","","22_thumb.jpg",130,195,32);thumbnails[3410586]=new thumbnail(3410586,"159415","","m4_thumb.jpg",130,87,32);thumbnails[3492181]=new thumbnail(3492181,"159415","","boy6_thumb.jpg",130,87,32);thumbnails[3492188]=new thumbnail(3492188,"159415","","mr3_thumb.jpg",130,90,32);thumbnails[3492216]=new thumbnail(3492216,"159415","","tw5_thumb.jpg",130,93,32);thumbnails[3413488]=new thumbnail(3413488,"159415","","m11_thumb.jpg",130,91,32);thumbnails[3410595]=new thumbnail(3410595,"159415","","m5_thumb.jpg",130,87,32);thumbnails[3413212]=new thumbnail(3413212,"159415","","w3_thumb.jpg",130,96,32);thumbnails[3410587]=new thumbnail(3410587,"159415","","m9_thumb.jpg",130,87,32);thumbnails[3413214]=new thumbnail(3413214,"159415","","w4_thumb.jpg",130,87,32);thumbnails[3410608]=new thumbnail(3410608,"159415","","lp8_thumb.jpg",130,89,32);thumbnails[3413209]=new thumbnail(3413209,"159415","","w1_thumb.jpg",130,195,32);thumbnails[3413415]=new thumbnail(3413415,"159415","","n3_thumb.jpg",130,195,32);thumbnails[3413438]=new thumbnail(3413438,"159415","","n7_thumb.jpg",130,213,32);thumbnails[3413388]=new thumbnail(3413388,"159415","","n11_thumb.jpg",130,195,32);thumbnails[3413432]=new thumbnail(3413432,"159415","","n6_thumb.jpg",130,195,32);thumbnails[3410607]=new thumbnail(3410607,"159415","","lp10_thumb.jpg",130,195,32);thumbnails[3413440]=new thumbnail(3413440,"159415","","n8_thumb.jpg",130,195,32);thumbnails[3413210]=new thumbnail(3413210,"159415","","w2_thumb.jpg",130,195,32);thumbnails[3412683]=new thumbnail(3412683,"159415","","cm4_thumb.jpg",130,210,32);thumbnails[3413443]=new thumbnail(3413443,"159415","","n9_thumb.jpg",130,220,32);thumbnails[3413423]=new thumbnail(3413423,"159415","","n4_thumb.jpg",130,218,32);thumbnails[3413395]=new thumbnail(3413395,"159415","","n2_thumb.jpg",130,195,32);thumbnails[3410604]=new thumbnail(3410604,"159415","","lp4_thumb.jpg",130,186,32);thumbnails[3410588]=new thumbnail(3410588,"159415","","m10_thumb.jpg",130,192,32);thumbnails[3234993]=new thumbnail(3234993,"159415","","culprit_dec[1]_thumb.jpg",130,184,32);thumbnails[3413428]=new thumbnail(3413428,"159415","","n5_thumb.jpg",130,195,32);thumbnails[3413455]=new thumbnail(3413455,"159415","","n10_thumb.jpg",130,195,32);thumbnails[3492204]=new thumbnail(3492204,"159415","","tw18_thumb.jpg",130,195,32);thumbnails[3492224]=new thumbnail(3492224,"159415","","tw10_thumb.jpg",130,198,32);thumbnails[3492195]=new thumbnail(3492195,"159415","","mr5_thumb.jpg",130,188,32);thumbnails[3410606]=new thumbnail(3410606,"159415","","lp11_thumb.jpg",130,148,32);thumbnails[3879601]=new thumbnail(3879601,"159415","","JF1_thumb.jpg",130,209,32);thumbnails[3879615]=new thumbnail(3879615,"159415","","JF2_thumb.jpg",130,195,32);thumbnails[3879629]=new thumbnail(3879629,"159415","","JF3_thumb.jpg",130,195,32);thumbnails[3879631]=new thumbnail(3879631,"159415","","JF4_thumb.jpg",130,191,32);thumbnails[3879638]=new thumbnail(3879638,"159415","","JF5_thumb.jpg",130,206,32);thumbnails[3879640]=new thumbnail(3879640,"159415","","JF6_thumb.jpg",130,205,32);thumbnails[3879644]=new thumbnail(3879644,"159415","","JF7_thumb.jpg",130,192,32);thumbnails[5101006]=new thumbnail(5101006,"203401","","IMG_6570_thumb.JPG",130,195,32);thumbnails[5101014]=new thumbnail(5101014,"203401","","JakeB_031_thumb.jpg",130,195,32);thumbnails[5101019]=new thumbnail(5101019,"203401","","JakeB_152_thumb.jpg",130,195,32);thumbnails[5101026]=new thumbnail(5101026,"203401","","JakeB_2931_thumb.jpg",130,195,32);thumbnails[5101039]=new thumbnail(5101039,"203401","","IMG_6672_thumb.JPG",130,195,32);thumbnails[5101058]=new thumbnail(5101058,"203401","","IMG_7192_thumb.JPG",130,195,32);thumbnails[5101063]=new thumbnail(5101063,"203401","","IMG_7242_thumb.JPG",130,195,32);thumbnails[3282868]=new thumbnail(3282868,"203401","","n_thumb.jpg",130,87,32);thumbnails[3282567]=new thumbnail(3282567,"203401","","b_thumb.jpg",130,87,32);thumbnails[5101128]=new thumbnail(5101128,"203401","","IMG_2086_thumb.JPG",130,90,32);thumbnails[5101134]=new thumbnail(5101134,"203401","","IMG_2120_thumb.JPG",130,87,32);thumbnails[5101140]=new thumbnail(5101140,"203401","","IMG_0006_F35DA22A-1D09-001F-99139A4EBA2CF50F_thumb.JPG",130,87,32);thumbnails[5101146]=new thumbnail(5101146,"203401","","IMG_2573_thumb.JPG",130,87,32);thumbnails[5101151]=new thumbnail(5101151,"203401","","IMG_2563_thumb.JPG",130,88,32);thumbnails[5101153]=new thumbnail(5101153,"203401","","IMG_2131_thumb.JPG",130,128,32);thumbnails[5047708]=new thumbnail(5047708,"285611","","IMG_0002_thumb.jpg",130,95,32);thumbnails[5047716]=new thumbnail(5047716,"285611","","IMG_0003_thumb.jpg",130,97,32);thumbnails[5047721]=new thumbnail(5047721,"285611","","IMG_0017_thumb.jpg",130,97,32);thumbnails[5047723]=new thumbnail(5047723,"285611","","IMG_0018_thumb.jpg",130,96,32);thumbnails[5047726]=new thumbnail(5047726,"285611","","IMG_0019_thumb.jpg",130,96,32);thumbnails[5047728]=new thumbnail(5047728,"285611","","IMG_0021_thumb.jpg",130,97,32);thumbnails[5047733]=new thumbnail(5047733,"285611","","IMG_0010_thumb.jpg",130,97,32);thumbnails[5047738]=new thumbnail(5047738,"285611","","IMG_0020_thumb.jpg",130,96,32);thumbnails[5047735]=new thumbnail(5047735,"285611","","IMG_0007_thumb.jpg",130,97,32);thumbnails[5047741]=new thumbnail(5047741,"285611","","IMG_0016_thumb.jpg",130,96,32);thumbnails[5047740]=new thumbnail(5047740,"285611","","IMG_0023_thumb.jpg",130,95,32);thumbnails[5047731]=new thumbnail(5047731,"285611","","IMG_0006_thumb.jpg",130,97,32);thumbnails[5047747]=new thumbnail(5047747,"285611","","IMG_0026_thumb.jpg",130,176,32);thumbnails[5047745]=new thumbnail(5047745,"285611","","IMG_0012_thumb.jpg",130,176,32);thumbnails[5047742]=new thumbnail(5047742,"285611","","IMG_0009_thumb.jpg",130,176,32);thumbnails[5047748]=new thumbnail(5047748,"285611","","IMG_0004_thumb.jpg",130,173,32);thumbnails[5047751]=new thumbnail(5047751,"285611","","IMG_00011_thumb.jpg",130,96,32);thumbnails[5047754]=new thumbnail(5047754,"285611","","IMG_00021_thumb.jpg",130,97,32);thumbnails[5047706]=new thumbnail(5047706,"285611","","IMG_0001_thumb.jpg",130,85,32);thumbnails[3282916]=new thumbnail(3282916,"159414","","w_thumb.jpg",130,87,32);thumbnails[3285321]=new thumbnail(3285321,"159414","","1_thumb.jpg",130,87,32);thumbnails[3281710]=new thumbnail(3281710,"159414","","3_thumb.jpg",130,87,32);thumbnails[3234997]=new thumbnail(3234997,"159414","","11_thumb.jpg",130,87,32);thumbnails[3285323]=new thumbnail(3285323,"159414","","21_thumb.jpg",130,87,32);thumbnails[3281753]=new thumbnail(3281753,"159414","","16_thumb.jpg",130,87,32);thumbnails[3282545]=new thumbnail(3282545,"159414","","GetAttachment_thumb.jpg",130,87,32);thumbnails[3281713]=new thumbnail(3281713,"159414","","4_thumb.jpg",130,171,32);thumbnails[3282594]=new thumbnail(3282594,"159414","","e_thumb.jpg",130,195,32);thumbnails[3281701]=new thumbnail(3281701,"159414","","2_thumb.jpg",130,195,32);thumbnails[3235025]=new thumbnail(3235025,"159414","","n223405223_6801375_5404_thumb.jpg",130,195,32);var galleries=new Object();galleries[159415]=new gallery(159415,"3234993","Gigs","gallery",[3410586,3492181,3492188,3492216,3413488,3410595,3413212,3410587,3413214,3410608,3413209,3413415,3413438,3413388,3413432,3410607,3413440,3413210,3412683,3413443,3413423,3413395,3410604,3410588,3234993,3413428,3413455,3492204,3492224,3492195,3410606,3879601,3879615,3879629,3879631,3879638,3879640,3879644]);galleries[203401]=new gallery(203401,"5101019","Sport","gallery",[5101006,5101014,5101019,5101026,5101039,5101058,5101063,3282868,3282567,5101128,5101134,5101140,5101146,5101151,5101153]);galleries[285611]=new gallery(285611,"5047751","35mm","gallery",[5047708,5047716,5047721,5047723,5047726,5047728,5047733,5047738,5047735,5047741,5047740,5047731,5047747,5047745,5047742,5047748,5047751,5047754,5047706]);galleries[159414]=new gallery(159414,"3281710","Nature","gallery",[3282916,3285321,3281710,3234997,3285323,3281753,3282545,3281713,3282594,3281701,3235025]);var imageSets=new Object();imageSets[1]="5047728";imageSets[2]="5101019,5047751,3282897,3281710,3234993";imageSets[3]="5101153,5101151,5101146,5101140,5101134,5101128,5101063,5101058,5101039,5101026,5101019,5101014,5101006,5100371,5100355,5100203,5047754,5047751,5047748,5047747,5047745,5047742,5047741,5047740,5047738,5047735,5047733,5047731,5047728,5047726,5047723,5047721,5047716,5047708,5047706,3879644,3879640,3879638,3879631,3879629,3879615,3879601,3492224,3492216,3492204,3492195,3492188,3492181,3413488,3413455";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 34:b="http://www9.clikpic.com/sophiestern/images";break}switch(a){case 1:b="http://www1.clikpic.com/sophiestern/images";break}switch(a){case 2:b="http://admin.clikpic.com/sophiestern/images";break}switch(a){case 4:b="http://www.clikchurch.com/sophiestern/images";break}switch(a){case 5:b="http://www2.clikpic.com/sophiestern/images";break}switch(a){case 15:b="http://www3.clikpic.com/sophiestern/images";break}switch(a){case 21:b="http://www6.clikpic.com/sophiestern/images";break}switch(a){case 18:b="http://www4.clikpic.com/sophiestern/images";break}switch(a){case 19:b="http://www5.clikpic.com/sophiestern/images";break}switch(a){case 22:b="http://tpc5/clikpic/sophiestern/images";break}switch(a){case 23:b="http://tpc10/clikpic/sophiestern/images";break}switch(a){case 24:b="http://tpc15/clikpic/sophiestern/images";break}switch(a){case 25:b="http://tpc16/clikpic/sophiestern/images";break}switch(a){case 31:b="http://www7.clikpic.com/sophiestern/images";break}switch(a){case 32:b="http://admin2.clikpic.com/sophiestern/images";break}switch(a){case 33:b="http://www8.clikpic.com/sophiestern/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="SSIMAGES: "+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+'")'})}}};