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[738969]=new thumbnail(738969,"57102","","Andy&-Peta-Kiss_thumb.gif",130,195,15);thumbnails[738971]=new thumbnail(738971,"57102","","Brigg-Wedding-2_thumb.gif",130,195,15);thumbnails[739020]=new thumbnail(739020,"57102","","cars_thumb.jpg",130,87,15);thumbnails[739036]=new thumbnail(739036,"57102","","JF-05-079-070_thumb.jpg",130,87,15);thumbnails[739038]=new thumbnail(739038,"57102","","Jo & Dave Bmaids_thumb.jpg",130,87,15);thumbnails[739041]=new thumbnail(739041,"57102","","Page & Maids_thumb.jpg",130,87,15);thumbnails[739042]=new thumbnail(739042,"57102","","River Andy & Pete_thumb.jpg",130,195,15);thumbnails[1136003]=new thumbnail(1136003,"57102","","_DSC0002a1_thumb.jpg",130,163,15);thumbnails[1136005]=new thumbnail(1136005,"57102","","_DSC00141_thumb.jpg",130,104,15);thumbnails[1136006]=new thumbnail(1136006,"57102","","_DSC0029_thumb.jpg",130,104,15);thumbnails[1136007]=new thumbnail(1136007,"57102","","_DSC0031_thumb.jpg",130,163,15);thumbnails[1136009]=new thumbnail(1136009,"57102","","_DSC0052_thumb.jpg",130,104,15);thumbnails[1136016]=new thumbnail(1136016,"57102","","JF-07-001-007b&w_thumb.jpg",130,104,15);thumbnails[1136019]=new thumbnail(1136019,"57102","","JF-07-001-047wb_thumb.jpg",130,104,15);thumbnails[1136020]=new thumbnail(1136020,"57102","","JF-07-001-115_thumb.jpg",130,104,15);thumbnails[1136022]=new thumbnail(1136022,"57102","","JF-07-001-153 BOARDER_thumb.jpg",130,163,15);thumbnails[1136024]=new thumbnail(1136024,"57102","","JF-07-001-210BOARDER_thumb.jpg",130,163,15);thumbnails[1136026]=new thumbnail(1136026,"57102","","JF-07-001-229boarder_thumb.jpg",130,163,15);thumbnails[1136027]=new thumbnail(1136027,"57102","","JF-07-001-257bwboarder_thumb.jpg",130,173,15);thumbnails[2043157]=new thumbnail(2043157,"57102","","JF-07-247-033_thumb.jpg",130,181,15);thumbnails[2043159]=new thumbnail(2043159,"57102","","JF-07-247-163-vig_thumb.jpg",130,174,15);thumbnails[2043160]=new thumbnail(2043160,"57102","","JF-08-050-014-view-vig-sepia_thumb.jpg",130,122,15);thumbnails[2043161]=new thumbnail(2043161,"57102","","JF-08-050-168-8x12- _thumb.jpg",130,187,15);thumbnails[2043163]=new thumbnail(2043163,"57102","","JF-08-062-219-vig_thumb.jpg",130,181,15);thumbnails[2043164]=new thumbnail(2043164,"57102","","JF-08-062-456_thumb.jpg",130,109,15);thumbnails[739049]=new thumbnail(739049,"57103","","JF-04-40-049_thumb.jpg",130,87,15);thumbnails[739052]=new thumbnail(739052,"57103","","JF-06-041-070_thumb.jpg",130,87,15);thumbnails[739053]=new thumbnail(739053,"57103","","JF-06-041-073_thumb.jpg",130,87,15);thumbnails[739054]=new thumbnail(739054,"57103","","Matt-Spring_thumb.jpg",130,130,15);thumbnails[739055]=new thumbnail(739055,"57103","","McSheffery_thumb.jpg",130,130,15);thumbnails[739059]=new thumbnail(739059,"57103","","twyford-stage-rally-2_thumb.jpg",130,87,15);thumbnails[2043147]=new thumbnail(2043147,"57103","","JF-08-094-148-name_thumb.jpg",130,104,15);thumbnails[2043149]=new thumbnail(2043149,"57103","","JF-08-094-154-name_thumb.jpg",130,104,15);thumbnails[2043150]=new thumbnail(2043150,"57103","","JF-08-096-009_thumb.jpg",130,177,15);thumbnails[2043152]=new thumbnail(2043152,"57103","","JF-08-097-004_thumb.jpg",130,67,15);thumbnails[2043154]=new thumbnail(2043154,"57103","","JF-08-097-014_thumb.jpg",130,118,15);thumbnails[2043156]=new thumbnail(2043156,"57103","","JF-08-097-048_thumb.jpg",130,93,15);thumbnails[2043243]=new thumbnail(2043243,"57103","","JF-07-111-058_thumb.jpg",130,93,15);thumbnails[2043245]=new thumbnail(2043245,"57103","","JF-08-097-0041_thumb.jpg",130,97,15);thumbnails[739091]=new thumbnail(739091,"57104","","JF04-65-094_thumb.jpg",130,195,15);thumbnails[2043139]=new thumbnail(2043139,"57104","","JF-07-214-203_thumb.jpg",130,167,15);thumbnails[2043141]=new thumbnail(2043141,"57104","","JF-07-230-171_thumb.jpg",130,166,15);thumbnails[2043142]=new thumbnail(2043142,"57104","","JF-07-279-026_thumb.jpg",130,107,15);thumbnails[2043144]=new thumbnail(2043144,"57104","","JF-08-102-006_thumb.jpg",130,154,15);thumbnails[739082]=new thumbnail(739082,"57106","","JF-04-26-043_thumb.jpg",130,87,15);thumbnails[739084]=new thumbnail(739084,"57106","","JF-04-48-019_thumb.jpg",130,87,15);thumbnails[1136092]=new thumbnail(1136092,"57106","","JF-07-024-181_thumb.jpg",130,195,15);thumbnails[1136093]=new thumbnail(1136093,"57106","","JF-07-024-195_thumb.jpg",130,195,15);thumbnails[1136094]=new thumbnail(1136094,"57106","","JF-07-057-013_thumb.jpg",130,195,15);thumbnails[2043090]=new thumbnail(2043090,"57106","","JF-08-041-109_thumb.jpg",130,85,15);thumbnails[2043137]=new thumbnail(2043137,"57106","","JF-08-041-1891_thumb.jpg",130,104,15);thumbnails[2043138]=new thumbnail(2043138,"57106","","JF-08-086-029_thumb.jpg",130,206,15);thumbnails[739092]=new thumbnail(739092,"57105","","8x10-film-final_thumb.jpg",130,195,15);thumbnails[739094]=new thumbnail(739094,"57105","","APRIL-FOX-136_thumb.jpg",130,195,15);thumbnails[739096]=new thumbnail(739096,"57105","","JF-04-74-050_thumb.jpg",130,195,15);thumbnails[739098]=new thumbnail(739098,"57105","","JF-05-060-131_thumb.jpg",130,195,15);thumbnails[739102]=new thumbnail(739102,"57105","","wallers_thumb.jpg",130,195,15);thumbnails[1136095]=new thumbnail(1136095,"57105","","JF-07-025-009_thumb.jpg",130,173,15);thumbnails[1136096]=new thumbnail(1136096,"57105","","JF-07-025-005_thumb.jpg",130,98,15);thumbnails[1136099]=new thumbnail(1136099,"57105","","JF-07-009-077 blur_thumb.jpg",130,98,15);thumbnails[1136101]=new thumbnail(1136101,"57105","","JF-07-001-157B&W_thumb.jpg",130,163,15);thumbnails[2043204]=new thumbnail(2043204,"57105","","JF-08-004-003_thumb.jpg",130,173,15);thumbnails[2043205]=new thumbnail(2043205,"57105","","JF-08-027-062_thumb.jpg",130,98,15);thumbnails[2043207]=new thumbnail(2043207,"57105","","JF-08-054-330_thumb.jpg",130,173,15);thumbnails[2043211]=new thumbnail(2043211,"57105","","JF-08-067-003_thumb.jpg",130,104,15);thumbnails[2043212]=new thumbnail(2043212,"57105","","JF-08-067-018_thumb.jpg",130,103,15);thumbnails[2043213]=new thumbnail(2043213,"57105","","JF-08-067-065_thumb.jpg",130,216,15);thumbnails[2043236]=new thumbnail(2043236,"57105","","JF-07-127-169_thumb.jpg",130,173,15);thumbnails[2043238]=new thumbnail(2043238,"57105","","JF-07-127-185bw_thumb.jpg",130,195,15);thumbnails[2043239]=new thumbnail(2043239,"57105","","JF-07-127-189_thumb.jpg",130,176,15);thumbnails[2043240]=new thumbnail(2043240,"57105","","JF-07-271-016_thumb.jpg",130,163,15);thumbnails[2043241]=new thumbnail(2043241,"57105","","JF-08-004-0031_thumb.jpg",130,105,15);var galleries=new Object();galleries[57102]=new gallery(57102,"2043164,2043163,2043161,2043160,2043159,2043157,1136027,1136026,1136024,1136022","Weddings","gallery",[738969,738971,739020,739036,739038,739041,739042,1136003,1136005,1136006,1136007,1136009,1136016,1136019,1136020,1136022,1136024,1136026,1136027,2043157,2043159,2043160,2043161,2043163,2043164]);galleries[57103]=new gallery(57103,"2043245,2043243,2043156,2043154,2043152,2043150,2043149,2043147,739059,739055","Sport","gallery",[739049,739052,739053,739054,739055,739059,2043147,2043149,2043150,2043152,2043154,2043156,2043243,2043245]);galleries[57104]=new gallery(57104,"2043144,2043142,2043141,2043139,739091","Pets","gallery",[739091,2043139,2043141,2043142,2043144]);galleries[57106]=new gallery(57106,"2043138,2043137,2043090,1136094,1136093,1136092,739084,739082","Landscapes","gallery",[739082,739084,1136092,1136093,1136094,2043090,2043137,2043138]);galleries[57105]=new gallery(57105,"2043241,2043240,2043239,2043238,2043236,2043213,2043212,2043211,2043207,2043205","Portraits","gallery",[739092,739094,739096,739098,739102,1136095,1136096,1136099,1136101,2043204,2043205,2043207,2043211,2043212,2043213,2043236,2043238,2043239,2043240,2043241]);var imageSets=new Object();imageSets[1]="2043245,2043243,2043241,2043240,2043239,2043238,2043236,2043213,2043212,2043211,2043207,2043205,2043204,2043164,2043163,2043161,2043160,2043159,2043157,2043156,2043154,2043152,2043150,2043149,2043147,2043144,2043142,2043141,2043139,2043138,2043137,2043090,1136101,1136099,1136096,1136095,1136094,1136093,1136092,1136027,1136026,1136024,1136022,1136020,1136019,1136016,1136009,1136007,1136006,1136005";imageSets[3]="2043245,2043243,2043241,2043240,2043239,2043238,2043236,2043213,2043212,2043211,2043207,2043205,2043204,2043164,2043163,2043161,2043160,2043159,2043157,2043156,2043154,2043152,2043150,2043149,2043147,2043144,2043142,2043141,2043139,2043138,2043137,2043090,1136101,1136099,1136096,1136095,1136094,1136093,1136092,1136027,1136026,1136024,1136022,1136020,1136019,1136016,1136009,1136007,1136006,1136005";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/johnforman/images";break}switch(a){case 1:b="http://www1.clikpic.com/johnforman/images";break}switch(a){case 2:b="http://admin.clikpic.com/johnforman/images";break}switch(a){case 4:b="http://www.clikchurch.com/johnforman/images";break}switch(a){case 5:b="http://www2.clikpic.com/johnforman/images";break}switch(a){case 15:b="http://www3.clikpic.com/johnforman/images";break}switch(a){case 21:b="http://www6.clikpic.com/johnforman/images";break}switch(a){case 18:b="http://www4.clikpic.com/johnforman/images";break}switch(a){case 19:b="http://www5.clikpic.com/johnforman/images";break}switch(a){case 22:b="http://tpc5/clikpic/johnforman/images";break}switch(a){case 23:b="http://tpc10/clikpic/johnforman/images";break}switch(a){case 24:b="http://tpc15/clikpic/johnforman/images";break}switch(a){case 25:b="http://tpc16/clikpic/johnforman/images";break}switch(a){case 31:b="http://www7.clikpic.com/johnforman/images";break}switch(a){case 32:b="http://admin2.clikpic.com/johnforman/images";break}switch(a){case 33:b="http://www8.clikpic.com/johnforman/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="Ambleside Photographic: "+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+'")'})}}};