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[2314997]=new thumbnail(2314997,"98101","debbie fearn at rothley station","debbie fearn at rothley 2008_thumb.jpg",130,195,15);thumbnails[2315008]=new thumbnail(2315008,"98101","on duty","soldier fearn at rothley war weekend_thumb.jpg",130,87,15);thumbnails[1456173]=new thumbnail(1456173,"98895","nene vally 40s event","40s familly on station_thumb.jpg",130,87,15);thumbnails[1456183]=new thumbnail(1456183,"98895","1940s fashions","40s event at nene valley steam_thumb.jpg",130,85,15);thumbnails[1456209]=new thumbnail(1456209,"98895","young lady on train bridge","sepia (young lady)_thumb.jpg",130,153,15);thumbnails[1192357]=new thumbnail(1192357,"3033","jenny coe-studio shot","jenny-web-shot_thumb.jpg",130,123,15);thumbnails[840594]=new thumbnail(840594,"3033","amy studio mono","amy web shot_thumb.jpg",130,87,15);thumbnails[840597]=new thumbnail(840597,"3033","lucy studio shoot","lucy web shot_thumb.jpg",130,195,15);thumbnails[840600]=new thumbnail(840600,"3033","laura studio shoot","2007 laura_thumb.jpg",130,195,15);thumbnails[20891]=new thumbnail(20891,"1392","","web-tram-shot-1_thumb.jpg",130,195,15);thumbnails[20893]=new thumbnail(20893,"1393","","web-blue-bells_thumb.jpg",130,87,15);thumbnails[22166]=new thumbnail(22166,"1393","forde abbey","web-shot-shadows_thumb.jpg",130,87,15);thumbnails[162664]=new thumbnail(162664,"1410","blacksmith training classes","the-blacksmithweb-shot_thumb.jpg",130,195,15);thumbnails[9850]=new thumbnail(9850,"1392","","2004-street-web_thumb.jpg",130,195,15);thumbnails[12149]=new thumbnail(12149,"1391","great central steam shed","web-train_thumb.jpg",130,79,15);thumbnails[12341]=new thumbnail(12341,"1410","","web-water-hole_thumb.jpg",130,87,15);thumbnails[12477]=new thumbnail(12477,"1393","","web-shot-1_thumb.jpg",130,103,15);thumbnails[12828]=new thumbnail(12828,"1393","","web trees_thumb.jpg",130,70,15);thumbnails[12950]=new thumbnail(12950,"1392","","web-shot-bike_thumb.jpg",130,87,15);thumbnails[12951]=new thumbnail(12951,"1392","","web-shot-chloe_thumb.jpg",130,113,15);thumbnails[12952]=new thumbnail(12952,"1392","","web-shot-drummer_thumb.jpg",130,169,15);thumbnails[12954]=new thumbnail(12954,"1393","","web-shot-leaf_thumb.jpg",130,132,15);thumbnails[12955]=new thumbnail(12955,"1410","","web-shot-roofline_thumb.jpg",130,87,15);thumbnails[12956]=new thumbnail(12956,"1392","","web-shot-steakers_thumb.jpg",130,87,15);thumbnails[13445]=new thumbnail(13445,"1393","","web shot two_thumb.jpg",130,87,15);thumbnails[18370]=new thumbnail(18370,"1410","phil","phil mh web site_thumb.jpg",130,218,15);thumbnails[18371]=new thumbnail(18371,"1410","","street lamp mh web_thumb.jpg",130,281,15);thumbnails[18372]=new thumbnail(18372,"1410","great central steam.","ethans steam pics 014_thumb.jpg",130,110,15);thumbnails[18373]=new thumbnail(18373,"1410","","manipulated wood mh web_thumb.jpg",130,71,15);thumbnails[21309]=new thumbnail(21309,"1393","","web-lilly_thumb.jpg",130,87,15);thumbnails[21458]=new thumbnail(21458,"1410","blue girl","web-shot-blue-girl_thumb.jpg",130,195,15);thumbnails[21462]=new thumbnail(21462,"1391","your move","web-shot-chess_thumb.jpg",130,87,15);thumbnails[21465]=new thumbnail(21465,"1391","crossed keys","web-shot-keys_thumb.jpg",130,86,15);thumbnails[21467]=new thumbnail(21467,"1391","egg detail","web-shot-egg_thumb.jpg",130,71,15);thumbnails[22168]=new thumbnail(22168,"1393","teasle's","web-shot-teasles_thumb.jpg",130,87,15);thumbnails[22169]=new thumbnail(22169,"1393","","we-shot-cockerill_thumb.jpg",130,226,15);thumbnails[22170]=new thumbnail(22170,"1392","street faces","web-shot-street-art_thumb.jpg",130,87,15);thumbnails[22183]=new thumbnail(22183,"1393","","web-shot-clump_thumb.jpg",130,195,15);thumbnails[22185]=new thumbnail(22185,"1391","","web-shot-wood-baskets_thumb.jpg",130,87,15);thumbnails[22186]=new thumbnail(22186,"1393","","web-shot-danger_thumb.jpg",130,198,15);thumbnails[22188]=new thumbnail(22188,"1393","","web-shot-feeding_thumb.jpg",130,87,15);thumbnails[22189]=new thumbnail(22189,"1393","","web-shot-steakers1_thumb.jpg",130,87,15);thumbnails[29723]=new thumbnail(29723,"1389","lucy-studio locacation","lucy-studio_thumb.jpg",130,227,15);thumbnails[29776]=new thumbnail(29776,"1389","lucy studio shot","web--lucy-studio_thumb.jpg",130,166,15);thumbnails[29777]=new thumbnail(29777,"1389","","web-lucy--2_thumb.jpg",130,120,15);thumbnails[20894]=new thumbnail(20894,"1389","","web-crich-couple_thumb.jpg",130,206,15);thumbnails[12157]=new thumbnail(12157,"1389","","web-pic-11_thumb.jpg",130,193,15);thumbnails[12340]=new thumbnail(12340,"1389","","web-sean_thumb.jpg",130,195,15);thumbnails[12876]=new thumbnail(12876,"1389","","web-phil_thumb.jpg",130,165,15);thumbnails[12953]=new thumbnail(12953,"1389","","web-shot-helen_thumb.jpg",130,180,15);thumbnails[14480]=new thumbnail(14480,"1389","julia","julia_thumb.jpg",130,195,15);thumbnails[18374]=new thumbnail(18374,"1389","","michell-mh web_thumb.jpg",130,195,15);thumbnails[21459]=new thumbnail(21459,"1389","caroline","web-shot-caroline_thumb.jpg",130,195,15);thumbnails[21461]=new thumbnail(21461,"1389","fiqure study","web shot-fiqure study_thumb.jpg",130,195,15);thumbnails[21464]=new thumbnail(21464,"1389","donna in pvc","web-shot-donna_thumb.jpg",130,195,15);var galleries=new Object();galleries[3033]=new gallery(3033,"1192357,840600,840597,840594","2007 studio shoots","gallery",[1192357,840594,840597,840600]);galleries[141134]=new gallery(141134,"","flickr-my other piccy site","gallery",[]);galleries[98101]=new gallery(98101,"2315008,2314997","great central steam railway","gallery",[2314997,2315008]);galleries[98103]=new gallery(98103,"","lamport and pitsford steam trains","gallery",[]);galleries[1410]=new gallery(1410,"21458,18373,18372,18371,18370,12955,12341","manipulated images","gallery",[162664,12341,12955,18370,18371,18372,18373,21458]);galleries[1393]=new gallery(1393,"22188,22169,21309,20893,13445,12954,12477","natural world","gallery",[20893,22166,12477,12828,12954,13445,21309,22168,22169,22183,22186,22188,22189]);galleries[98895]=new gallery(98895,"1456209,1456183,1456173","nene valley steam trains","gallery",[1456173,1456183,1456209]);galleries[1391]=new gallery(1391,"21467,21465,21462,12149","still life ","gallery",[12149,21462,21465,21467,22185]);galleries[1392]=new gallery(1392,"22170,20891,12956,12952,12951,12950,9850","street photography","gallery",[20891,9850,12950,12951,12952,12956,22170]);galleries[1389]=new gallery(1389,"29777,29776,29723,21464,21461,21459,20894,18374,14480,12953,12876,12340,12157","people","gallery",[29723,29776,29777,20894,12157,12340,12876,12953,14480,18374,21459,21461,21464]);var imageSets=new Object();imageSets[1]="1192357,840600,840597,840594,29777,29776,29723,22188,21467,21465,21464,21462,21461,21459,21309,20894,20893,20891,18374,18371,18370,14480,13445,12956,12954,12953,12952,12951,12950,12876,12157,9850";imageSets[2]="1192357,840600,840597,840594,29777,29776,29723,22188,22170,22169,21467,21465,21464,21462,21461,21459,21458,21309,20894,20893,20891,18374,18373,18372,18371,18370,14480,13445,12956,12955,12954,12953,12952,12951,12950,12876,12477,12341,12340,12157,12149,9850";imageSets[3]="2315008,2314997,1456209,1456183,1456173,1192357,840600,840597,840594,162664,29777,29776,29723,22189,22188,22186,22185,22183,22170,22169,22168,22166,21467,21465,21464,21462,21461,21459,21458,21309,20894,20893,20891,18374,18373,18372,18371,18370,14480,13445,12956,12955,12954,12953,12952,12951,12950,12876,12828,12477";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/portraitgroup/images";break}switch(a){case 1:b="http://www1.clikpic.com/portraitgroup/images";break}switch(a){case 2:b="http://admin.clikpic.com/portraitgroup/images";break}switch(a){case 4:b="http://www.clikchurch.com/portraitgroup/images";break}switch(a){case 5:b="http://www2.clikpic.com/portraitgroup/images";break}switch(a){case 15:b="http://www3.clikpic.com/portraitgroup/images";break}switch(a){case 21:b="http://www6.clikpic.com/portraitgroup/images";break}switch(a){case 18:b="http://www4.clikpic.com/portraitgroup/images";break}switch(a){case 19:b="http://www5.clikpic.com/portraitgroup/images";break}switch(a){case 22:b="http://tpc5/clikpic/portraitgroup/images";break}switch(a){case 23:b="http://tpc10/clikpic/portraitgroup/images";break}switch(a){case 24:b="http://tpc15/clikpic/portraitgroup/images";break}switch(a){case 25:b="http://tpc16/clikpic/portraitgroup/images";break}switch(a){case 31:b="http://www7.clikpic.com/portraitgroup/images";break}switch(a){case 32:b="http://admin2.clikpic.com/portraitgroup/images";break}switch(a){case 33:b="http://www8.clikpic.com/portraitgroup/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="CHRIS-MARSH.CO.UK (PORTRAIT-GROUP.CO.UK): "+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+'")'})}}};