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[3958197]=new thumbnail(3958197,"51","","_VIS7480_thumb.jpg",130,86,1);thumbnails[3958202]=new thumbnail(3958202,"51","","_VIS7512_thumb.jpg",130,86,1);thumbnails[20722]=new thumbnail(20722,"51","","042_thumb.jpg",130,143,1);thumbnails[20725]=new thumbnail(20725,"51","","074_thumb.jpg",130,195,1);thumbnails[363176]=new thumbnail(363176,"51","","_igp6541m_thumb.jpg",130,87,1);thumbnails[2521862]=new thumbnail(2521862,"51","","normalCAXED0RE_thumb.jpg",130,163,1);thumbnails[2522013]=new thumbnail(2522013,"51","","_VIS2552_thumb.jpg",130,86,1);thumbnails[2522022]=new thumbnail(2522022,"51","","_VIS2372_thumb.jpg",130,196,1);thumbnails[2522023]=new thumbnail(2522023,"51","","_VIS2574_thumb.jpg",130,196,1);thumbnails[2602473]=new thumbnail(2602473,"51","","_VIS3624_thumb.jpg",130,196,1);thumbnails[2750884]=new thumbnail(2750884,"51","","_VIS3922_copy_thumb.jpg",130,163,1);thumbnails[3691145]=new thumbnail(3691145,"51","","_VIS6886_thumb.jpg",130,196,1);thumbnails[3691146]=new thumbnail(3691146,"51","","_VIS6896_thumb.jpg",130,196,1);thumbnails[3691147]=new thumbnail(3691147,"51","","_VIS6913_thumb.jpg",130,196,1);thumbnails[6570181]=new thumbnail(6570181,"51","","_VIS7548_thumb.jpg",130,89,1);thumbnails[6570184]=new thumbnail(6570184,"51","","_VIS7550_thumb.jpg",130,196,1);thumbnails[6570191]=new thumbnail(6570191,"51","","_VIS7599_thumb.jpg",130,196,1);thumbnails[2750878]=new thumbnail(2750878,"51","","_VIS3823_thumb.jpg",130,104,1);thumbnails[2602457]=new thumbnail(2602457,"51","","_VIS3584_copy_thumb.jpg",130,196,1);thumbnails[2750891]=new thumbnail(2750891,"51","","_VIS3962_thumb.jpg",130,86,1);thumbnails[2750875]=new thumbnail(2750875,"51","","_VIS3812_thumb.jpg",130,163,1);thumbnails[363175]=new thumbnail(363175,"51","","_igp6536m_thumb.jpg",130,195,1);thumbnails[1103]=new thumbnail(1103,"51","","092_thumb.jpg",130,195,1);thumbnails[1076]=new thumbnail(1076,"51","","032_thumb.jpg",130,87,1);thumbnails[1050]=new thumbnail(1050,"51","","CNV00035_thumb.jpg",130,195,1);thumbnails[363179]=new thumbnail(363179,"51","","kissm_thumb.jpg",130,196,1);thumbnails[6570193]=new thumbnail(6570193,"173","","_VIS7745_thumb.jpg",130,89,1);thumbnails[3958192]=new thumbnail(3958192,"173","","_VIS7475_thumb.jpg",130,190,1);thumbnails[215875]=new thumbnail(215875,"173","Princess for the day","wedding-upload_thumb.jpg",130,104,1);thumbnails[397804]=new thumbnail(397804,"173","","0808m_thumb.jpg",130,196,1);thumbnails[417785]=new thumbnail(417785,"173","","vis_8106m_thumb.jpg",130,86,1);thumbnails[445126]=new thumbnail(445126,"173","","VIS_8352dress_m_thumb.jpg",130,86,1);thumbnails[1269473]=new thumbnail(1269473,"173","","russellcroucher  wedding traditional  august_thumb.jpg",130,86,1);thumbnails[1269480]=new thumbnail(1269480,"173","","russellcroucher contemporary wedding july_thumb.jpg",130,86,1);thumbnails[2521864]=new thumbnail(2521864,"173","","normalCAAOCDW7_thumb.jpg",130,86,1);thumbnails[2522027]=new thumbnail(2522027,"173","","_VIS2469_thumb.jpg",130,86,1);thumbnails[3691150]=new thumbnail(3691150,"173","","_VIS6909_copy_thumb.jpg",130,196,1);thumbnails[6570177]=new thumbnail(6570177,"173","","_VIS5039_thumb.jpg",130,196,1);thumbnails[6570178]=new thumbnail(6570178,"173","","_VIS5182_thumb.jpg",130,86,1);thumbnails[552]=new thumbnail(552,"173","","IMGP1855_thumb.jpg",130,87,1);thumbnails[1054]=new thumbnail(1054,"173","wedding in the rain","131_thumb.jpg",130,87,1);thumbnails[197]=new thumbnail(197,"173","","Imgp0482JPG_thumb.jpg",130,91,1);thumbnails[1068]=new thumbnail(1068,"173","","imgp3708_thumb.jpg",130,87,1);thumbnails[1053]=new thumbnail(1053,"173","","072_thumb.jpg",130,87,1);thumbnails[548]=new thumbnail(548,"173","","IMGP1796_thumb.jpg",130,87,1);thumbnails[360205]=new thumbnail(360205,"30302","","visible30memoiresm_thumb.jpg",130,196,1);thumbnails[360206]=new thumbnail(360206,"30302","","indi1-main_thumb.jpg",130,181,1);thumbnails[397806]=new thumbnail(397806,"30302","","8080am_thumb.jpg",130,179,1);thumbnails[2522017]=new thumbnail(2522017,"30302","","VIS_8319_thumb.jpg",130,104,1);thumbnails[2602476]=new thumbnail(2602476,"30302","","_VIS5149_thumb.jpg",130,196,1);thumbnails[2602478]=new thumbnail(2602478,"30302","","_VIS5447_thumb.jpg",130,196,1);thumbnails[360208]=new thumbnail(360208,"30302","","rob-sundaym_thumb.jpg",130,199,1);thumbnails[360231]=new thumbnail(360231,"30302","","VIS_2643_thumb.jpg",130,196,1);thumbnails[370306]=new thumbnail(370306,"30302","","7515_thumb.jpg",130,92,1);thumbnails[370322]=new thumbnail(370322,"30302","","VIS_4272a_thumb.jpg",130,86,1);thumbnails[403]=new thumbnail(403,"77","Bluebell","_IGP08732_thumb.jpg",130,195,1);thumbnails[492663]=new thumbnail(492663,"77","","russell_croucher_pets_august_uk_thumb.jpg",130,196,1);thumbnails[980926]=new thumbnail(980926,"77","","Imgp0777upload_thumb.jpg",130,163,1);thumbnails[360207]=new thumbnail(360207,"77","Winter Morning","treem_thumb.jpg",130,86,1);thumbnails[191]=new thumbnail(191,"77","","Imgp0476JPG_thumb.jpg",130,61,1);thumbnails[5553]=new thumbnail(5553,"77","Crowland Abbey","d_thumb.jpg",130,98,1);thumbnails[375881]=new thumbnail(375881,"150590","Bourne Tae Kwon Do club grading June 06","tkdm_thumb.jpg",130,54,1);thumbnails[417782]=new thumbnail(417782,"150590","Landrover Freelander TD4","landroverbwtxtm_thumb.jpg",130,86,1);thumbnails[1066]=new thumbnail(1066,"150590","David Dickinson","russ2874_thumb.jpg",130,195,1);thumbnails[360218]=new thumbnail(360218,"150590","Remembrance Sunday","VIS_0345main_thumb.jpg",130,86,1);thumbnails[360217]=new thumbnail(360217,"150590","","VIS_0024sepiamain_thumb.jpg",130,86,1);var galleries=new Object();galleries[51]=new gallery(51,"6570191,6570184,6570181,3958202,3691147,3691145,2750878,2750875,2602457,2522023,2522022,2522013,2521862,363179,363176,363175,20725,20722,1103,1076,1050","Informal wedding photographs","gallery",[3958197,3958202,20722,20725,363176,2521862,2522013,2522022,2522023,2602473,2750884,3691145,3691146,3691147,6570181,6570184,6570191,2750878,2602457,2750891,2750875,363175,1103,1076,1050,363179]);galleries[173]=new gallery(173,"6570193,6570177,3958192,2522027,2521864,1269480,1269473,445126,417785,397804,215875,1068,1054,1053,552","Formal wedding photographs","gallery",[6570193,3958192,215875,397804,417785,445126,1269473,1269480,2521864,2522027,3691150,6570177,6570178,552,1054,197,1068,1053,548]);galleries[30302]=new gallery(30302,"2602478,2602476,370322,370306,360231,360208,360206","Portraits","gallery",[360205,360206,397806,2522017,2602476,2602478,360208,360231,370306,370322]);galleries[77]=new gallery(77,"492663,360207,403,191","Nature & outdoor","gallery",[403,492663,980926,360207,191,5553]);galleries[150590]=new gallery(150590,"360218","Sporting / Celebrity  and Advertising","gallery",[375881,417782,1066,360218,360217]);var imageSets=new Object();imageSets[1]="6570193,6570191,6570184,6570181,6570177,3958202,3958192,3691146,2522022,2521862,417785,215875,20722";imageSets[2]="6570193,6570191,6570184,6570181,6570177,3958202,3958192,3691147,3691145,2750878,2750875,2602478,2602476,2602457,2522027,2522023,2522022,2522013,2521864,2521862,1269480,1269473,492663,445126,417785,397804,370322,370306,363179,363176,363175,360231,360218,360208,360207,360206,215875,20725,20722,1103,1076,1068,1054,1053,1050,552,403,191";imageSets[3]="6570193,6570191,6570184,6570181,6570178,6570177,3958202,3958197,3958192,3691150,3691147,3691146,3691145,2750891,2750884,2750878,2750875,2602478,2602476,2602473,2602457,2522027,2522023,2522022,2522017,2522013,2521864,2521862,1269480,1269473,980926,492663,445126,417785,417782,397806,397804,375881,370322,370306,363179,363176,363175,360231,360218,360217,360208,360207,360206,360205";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/croucherphotography/images";break}switch(a){case 1:b="http://www1.clikpic.com/croucherphotography/images";break}switch(a){case 2:b="http://admin.clikpic.com/croucherphotography/images";break}switch(a){case 24:b="http://tpc15/clikpic/croucherphotography/images";break}switch(a){case 4:b="http://www.clikchurch.com/croucherphotography/images";break}switch(a){case 5:b="http://www2.clikpic.com/croucherphotography/images";break}switch(a){case 22:b="http://tpc5/clikpic/croucherphotography/images";break}switch(a){case 23:b="http://tpc10/clikpic/croucherphotography/images";break}switch(a){case 25:b="http://tpc16/clikpic/croucherphotography/images";break}switch(a){case 15:b="http://www3.clikpic.com/croucherphotography/images";break}switch(a){case 18:b="http://www4.clikpic.com/croucherphotography/images";break}switch(a){case 19:b="http://www5.clikpic.com/croucherphotography/images";break}switch(a){case 31:b="http://www7.clikpic.com/croucherphotography/images";break}switch(a){case 32:b="http://admin2.clikpic.com/croucherphotography/images";break}switch(a){case 33:b="http://www8.clikpic.com/croucherphotography/images";break}switch(a){case 34:b="http://www9.clikpic.com/croucherphotography/images";break}switch(a){case 35:b="http://admin3.clikpic.com/croucherphotography/images";break}switch(a){case 37:b="http://admin4.clikpic.com/croucherphotography/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="Visible Memories 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;resizePhotoInfo();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].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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="CROUCHERPHOTOGRAPHY">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};