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[534227]=new thumbnail(534227,"","Central and Broad Street.","central---web-21.jpg",130,87,1);thumbnails[534240]=new thumbnail(534240,"","A view of the Stamford rooftops.","rooftops-web1.jpg",130,87,1);thumbnails[534256]=new thumbnail(534256,"","A town of many churches.","churches-web1.jpg",130,87,1);thumbnails[549239]=new thumbnail(549239,"","Alfred Sismore.","grandad-web-21.jpg",130,143,1);thumbnails[769111]=new thumbnail(769111,"","THE TOWN BRIDGE VIEWED FROM THE MEADOWS","Town-bridge-from-meadows-041.jpg",130,185,1);thumbnails[564292]=new thumbnail(564292,"","Burghley House.","burghley-house-5-tifweb1.jpg",130,86,1);thumbnails[4180467]=new thumbnail(4180467,"63850","SUMMER ON THE WELLAND","1-WEB_1_thumb.jpg",130,183,1);thumbnails[2026711]=new thumbnail(2026711,"63850","BURGHLEY HOUSE.","21_thumb.jpg",130,174,1);thumbnails[1727786]=new thumbnail(1727786,"63850","BURGHLEY HOUSE IN THE AUTUMN.","burghley-3_thumb.jpg",130,175,1);thumbnails[1727889]=new thumbnail(1727889,"63850","STAMFORD MEADOWS, EARLY MORNING FROST.","frosty-river-stam-living_thumb.jpg",130,176,1);thumbnails[4181107]=new thumbnail(4181107,"63850","WINTER ON THE MEADOWS","stamford-winter-frost-portr_thumb.jpg",130,184,1);thumbnails[1726555]=new thumbnail(1726555,"63850","A MISTY MORNING.","A-MISTY-MORNING-IMAGE-11sha_thumb.jpg",130,194,1);thumbnails[2440839]=new thumbnail(2440839,"63850","A STREET SCENE","1-web_thumb.jpg",130,183,1);thumbnails[2440835]=new thumbnail(2440835,"63850","POPPY FIELDS NR STAMFORD","with-border-web_thumb.jpg",130,182,1);thumbnails[1727893]=new thumbnail(1727893,"63850","NORMANTON CHURCH.","1_thumb.jpg",130,180,1);thumbnails[2133363]=new thumbnail(2133363,"63850","NORMANTON CHURCH","church-1-575_thumb.jpg",130,182,1);thumbnails[1726570]=new thumbnail(1726570,"63850","A FROSTY MORNING.","A-FROSTY-MORNING-stam-livin_thumb.jpg",130,180,1);thumbnails[1726586]=new thumbnail(1726586,"63850","THE BURGHLEY TREE MEN.","IMG_0057_thumb.jpg",130,171,1);thumbnails[4180981]=new thumbnail(4180981,"63850","STAMFORD TRAIN STATION","35-WEB_thumb.jpg",130,194,1);thumbnails[862693]=new thumbnail(862693,"63850","THE GEORGE HOTEL","george-web1.jpg",130,80,1);thumbnails[1726651]=new thumbnail(1726651,"63850","STAMFORD, BARN HILL.","BARN-HILL-IMAGE-5_thumb.jpg",130,169,1);thumbnails[1726657]=new thumbnail(1726657,"63850","ST MARYS HILL.","ST-MARYS-HILL-IMAGE-13_thumb.jpg",130,171,1);thumbnails[1727066]=new thumbnail(1727066,"63850","STAMFORD IN THE SNOW.","THE-SNOWEY-GATE-IMAGE_thumb.jpg",130,160,1);thumbnails[5217680]=new thumbnail(5217680,"63850","BURGHLEY HOUSE","new-web_thumb.jpg",130,184,1);thumbnails[1727789]=new thumbnail(1727789,"63850","ST MARTINS CHURCH","cropped-book_thumb.jpg",130,176,1);thumbnails[4179816]=new thumbnail(4179816,"63850","SNOW ON BATH ROW","snow-web1_thumb.jpg",130,183,1);thumbnails[4179817]=new thumbnail(4179817,"63850","ST MARYS HILL","st-marys-hill-WEB_thumb.jpg",130,183,1);thumbnails[1726519]=new thumbnail(1726519,"63850","ST MARTINS + ST MARYS HILL","1-ST-MARTINS-FROM-ABOVE_thumb.jpg",130,181,1);thumbnails[4180988]=new thumbnail(4180988,"63850","RED LION SQUARE","26-WEB_thumb.jpg",130,183,1);thumbnails[1726613]=new thumbnail(1726613,"63850","A GARGOYLES VIEW.","a-gargoyles-view-image-4blu_thumb.jpg",130,193,1);thumbnails[3424988]=new thumbnail(3424988,"63850","FEBRUARY SNOW ON THE MEADOWS","snow-3-border-21_thumb.gif",71,100,1);thumbnails[4180199]=new thumbnail(4180199,"63850","A DUDDINGTON FIELD SCENE","a-duddington-field-scene-WE_thumb.jpg",130,180,1);thumbnails[4180225]=new thumbnail(4180225,"63850","CHRISTMAS 2007","xmas-2007-WEB_thumb.jpg",130,183,1);thumbnails[4181051]=new thumbnail(4181051,"63850","ST MARTINS AT CHRISTMAS","28-WEB_thumb.jpg",130,183,1);thumbnails[4180232]=new thumbnail(4180232,"63850","ST LEANORDS PRIORY","priory-WEB_thumb.jpg",130,183,1);thumbnails[1726661]=new thumbnail(1726661,"63850","SUMMER ON STAMFORD MEADOWS.","THE-WEEPING-WILLOWS-IMAGE-1_thumb.jpg",130,93,1);thumbnails[1727913]=new thumbnail(1727913,"63850","NORMANTON CHURCH","Normanton-church-book2_thumb.jpg",130,97,1);thumbnails[481550]=new thumbnail(481550,"63850","A ROWING BOAT ON THE WELLAND.","MEADOWS-BOAT1.jpg",130,83,1);thumbnails[4181724]=new thumbnail(4181724,"63850","ST MARTINS AT DUSK","25-book-web_thumb.jpg",130,93,1);thumbnails[1727930]=new thumbnail(1727930,"63850","FROST ON THE SECOND MEADOW.","a-frosty-morning-3_thumb.jpg",130,87,1);thumbnails[769133]=new thumbnail(769133,"63850","THE ALBERT BRIDGE","albert-bridge--0441.jpg",130,195,1);thumbnails[481396]=new thumbnail(481396,"63850","BOTTLE LODGES","bottle-lodges1.jpg",130,78,1);thumbnails[4181181]=new thumbnail(4181181,"63850","BURGHLEY HOUSE","burghley-book-WEB_thumb.jpg",130,93,1);thumbnails[1726489]=new thumbnail(1726489,"37717","THE RUINS AT WOTHORPE.","1-b-and-w2_thumb.jpg",130,185,1);thumbnails[1727499]=new thumbnail(1727499,"37717","THE TREE MEN.","sculpture-garden-1_thumb.jpg",130,181,1);thumbnails[1727902]=new thumbnail(1727902,"37717","THE AUTUMN STEPS.","st-martins-steps-autumn_thumb..jpg",130,193,1);thumbnails[4180245]=new thumbnail(4180245,"37717","ST GEORGES SQUARE","st-georges-sq-night-WEB_thumb.jpg",130,184,1);thumbnails[1730246]=new thumbnail(1730246,"37717","BARN HILL","BARN-HILL-IMAGE--b-and-w_thumb.jpg",130,174,1);thumbnails[1794003]=new thumbnail(1794003,"37717","ABANDONED WINDMILL","various 002_thumb.jpg",130,187,1);thumbnails[1730301]=new thumbnail(1730301,"37717","BURGHLEY HOUSE.","burghley-b-and-white_thumb.jpg",130,167,1);thumbnails[1775493]=new thumbnail(1775493,"37717","HIGH WATER.","2_thumb.jpg",130,184,1);thumbnails[2133387]=new thumbnail(2133387,"37717","NORMANTON CHURCH","church-1-b-and-w_thumb.jpg",130,182,1);thumbnails[1727068]=new thumbnail(1727068,"37717","THREE CHURCHES.","3-churches-image-2_thumb.jpg",130,175,1);thumbnails[1727495]=new thumbnail(1727495,"37717","A RUTLAND WATER SCENE.","_BA-WND-1_thumb.jpg",130,157,1);thumbnails[767762]=new thumbnail(767762,"37717","SNOW ON THE MEADOWS","master-gate-b-and-w1.jpg",130,173,1);thumbnails[1727071]=new thumbnail(1727071,"37717","EMPTY STREETS.","EMPTY-STREETS-IMAGE-12_thumb.jpg",130,89,1);thumbnails[1727909]=new thumbnail(1727909,"37717","THE ALBERT BRIDGE.","albert-bridge---b+w_thumb.jpg",130,186,1);thumbnails[2212144]=new thumbnail(2212144,"37717","EASTON TREE","country-tree-b-and-w-WEB_thumb.jpg",130,183,1);thumbnails[1727222]=new thumbnail(1727222,"37717","ALL SAINTS CHURCH.","IMAGE-6-ALL-SAINTS-AND-HOUS_thumb.jpg",130,192,1);thumbnails[1727301]=new thumbnail(1727301,"37717","THE GEORGE HOTEL.","THE-GEORGE-----b-and-w_thumb.jpg",130,82,1);thumbnails[767266]=new thumbnail(767266,"37717","EARLY MORNING ON THE MEADOWS","a-frosty-morning-3-b-and-we1.jpg",130,87,1);thumbnails[1727705]=new thumbnail(1727705,"37717","WOTHORPE RUINS.","b-and-w-wothorpe_thumb.jpg",130,87,1);thumbnails[862685]=new thumbnail(862685,"37717","THE GEORGE HOTEL AT CHRISTMAS","the-george-at-night--b-and-1.jpg",130,91,1);thumbnails[767338]=new thumbnail(767338,"37717","A WINTER LANE IN GREATFORD","greatford-wood-b-and-w-EB1.jpg",130,87,1);thumbnails[769172]=new thumbnail(769172,"37717","ST MICHEALS CHURCH","church-curved!-4-book1.jpg",130,87,1);thumbnails[1727497]=new thumbnail(1727497,"37717","BOTTLE LODGES.","Bottle-lodges-b-and-w_thumb.jpg",130,85,1);thumbnails[767334]=new thumbnail(767334,"37717","A GREATFORD LANE","greatford-stump-b-and-wEB1.jpg",130,87,1);var galleries=new Object();galleries[63850]=new gallery(63850,"2133363","STAMFORD IN COLOUR.","gallery",[4180467,2026711,1727786,1727889,4181107,1726555,2440839,2440835,1727893,2133363,1726570,1726586,4180981,862693,1726651,1726657,1727066,5217680,1727789,4179816,4179817,1726519,4180988,1726613,3424988,4180199,4180225,4181051,4180232,1726661,1727913,481550,4181724,1727930,769133,481396,4181181]);galleries[37717]=new gallery(37717,"4180245,1775493,1727902,1727301","STAMFORD IN BLACK AND WHITE.","gallery",[1726489,1727499,1727902,4180245,1730246,1794003,1730301,1775493,2133387,1727068,1727495,767762,1727071,1727909,2212144,1727222,1727301,767266,1727705,862685,767338,769172,1727497,767334]);var imageSets=new Object();imageSets[1]="5217680,4181724,4181181,4181107,4181051,4180988,4180981,4180467,4180245,4180232,4180225,4180199,4179817,4179816,2440839,2440835,1775493,1727902,1727789,1727786,1726661,1726657,1726613,1726555,1726519,862693";imageSets[2]="4180245,2133363,1775493,1727902,1727301";imageSets[3]="5217680,4181724,4181181,4181107,4181051,4180988,4180981,4180467,4180245,4180232,4180225,4180199,4179817,4179816,3424988,2440839,2440835,2212144,2133387,2133363,2026711,1794003,1775493,1730301,1730246,1727930,1727913,1727909,1727902,1727893,1727889,1727789,1727786,1727705,1727499,1727497,1727495,1727301,1727222,1727071,1727068,1727066,1726661,1726657,1726651,1726613,1726586,1726570,1726555,1726519";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/towers10/images";break}switch(a){case 1:b="http://www1.clikpic.com/towers10/images";break}switch(a){case 2:b="http://admin.clikpic.com/towers10/images";break}switch(a){case 24:b="http://tpc15/clikpic/towers10/images";break}switch(a){case 4:b="http://www.clikchurch.com/towers10/images";break}switch(a){case 5:b="http://www2.clikpic.com/towers10/images";break}switch(a){case 22:b="http://tpc5/clikpic/towers10/images";break}switch(a){case 23:b="http://tpc10/clikpic/towers10/images";break}switch(a){case 25:b="http://tpc16/clikpic/towers10/images";break}switch(a){case 15:b="http://www3.clikpic.com/towers10/images";break}switch(a){case 18:b="http://www4.clikpic.com/towers10/images";break}switch(a){case 19:b="http://www5.clikpic.com/towers10/images";break}switch(a){case 31:b="http://www7.clikpic.com/towers10/images";break}switch(a){case 32:b="http://admin2.clikpic.com/towers10/images";break}switch(a){case 33:b="http://www8.clikpic.com/towers10/images";break}switch(a){case 34:b="http://www9.clikpic.com/towers10/images";break}switch(a){case 35:b="http://admin3.clikpic.com/towers10/images";break}switch(a){case 37:b="http://admin4.clikpic.com/towers10/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="STAMFORD VIEWS : "+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].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>"}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="TOWERS10">';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 BASKET" 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+'")'})}}};
