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[1966654]=new thumbnail(1966654,"132199","Vale Resort","Vale Hotel_87_thumb.jpg",130,86,18);thumbnails[1966670]=new thumbnail(1966670,"165737","Steelwork for the retail development, St. David's 2, Cardiff","07-07-096 Steelwork_3_thumb.jpg",130,102,18);thumbnails[1966671]=new thumbnail(1966671,"132198","Celsa Steel UK","05_0019_thumb.jpg",130,86,18);thumbnails[1966956]=new thumbnail(1966956,"132198","Telecoms in Tuscany, Italy","06-07-037 Satellite Dishes_thumb.jpg",87,130,18);thumbnails[1966959]=new thumbnail(1966959,"132198","Celsa Steel UK, Cardiff","35_0073_thumb.jpg",130,86,18);thumbnails[1966971]=new thumbnail(1966971,"132199","Coloured Pencils in a Jar","06-05-018 Coloured Pencils in a Jar_thumb.jpg",130,87,18);thumbnails[1966972]=new thumbnail(1966972,"132199","Domestic Glassware, mid 20th century","06-05-025 Three Glasses_empty_thumb.jpg",87,130,18);thumbnails[1966976]=new thumbnail(1966976,"165737","Safety in scaffold erection. Construction of a MSCP at the Cardiff Marriott Hotel.","07-07-092 Scaffold Erecting_thumb.jpg",130,98,18);thumbnails[1966979]=new thumbnail(1966979,"165737","Building Conservation","Civil Engineering 2 BI_thumb.jpg",86,130,18);thumbnails[1969502]=new thumbnail(1969502,"165737","Foundations, retail development, St David's 2, Cardiff","07-07-071 Groundworks_3_thumb.jpg",130,96,18);thumbnails[2035850]=new thumbnail(2035850,"132199","Vale Resort, Conference Suite","Vale Resort_Conference Suite_0049_thumb.jpg",130,84,18);thumbnails[2062577]=new thumbnail(2062577,"165737","Cinema Complex in Cardiff City Centre","08-04-001 Cinema Complex_Cardiff City_thumb.jpg",96,130,18);thumbnails[2069960]=new thumbnail(2069960,"165737","New access road at Dunraven Bay, Vale of Glamorgan","08-07-013 New Road_Dunraven Bay_thumb.jpg",130,85,18);thumbnails[2082064]=new thumbnail(2082064,"165737","Steelwork in the construction of St David's2 in Cardiff City Centre","08-07-005 Steelwork_7_thumb.jpg",98,130,18);thumbnails[2103891]=new thumbnail(2103891,"165737","Access Tower at retail development, St. David's 2, Cardiff","08-07-004 Safety-Access Tower_thumb.jpg",98,130,18);thumbnails[2273370]=new thumbnail(2273370,"165729","Richmond Village Care Homes, Northampton","Richmond Village_0102_thumb.jpg",130,88,18);thumbnails[2273373]=new thumbnail(2273373,"165729","Isis House, Care and Retirement Centre, Oxford","Isis House_4415_thumb.jpg",130,86,18);thumbnails[2273379]=new thumbnail(2273379,"165729","Hafan y Waun Care Home, Aberystwyth","Hafan y Waun_4164_thumb.jpg",130,87,18);thumbnails[2273386]=new thumbnail(2273386,"165729","Sensory garden at Trinity Lodge Care Home, Coventry","Coventry_Trinity_0014_thumb.jpg",130,87,18);thumbnails[2273393]=new thumbnail(2273393,"165729","Leofric Court Care Home, Coventry","Coventry_Leofric_0065_thumb.jpg",130,85,18);thumbnails[2407639]=new thumbnail(2407639,"165733","Albion Riverside, a major residential and office development on the Thames","Albion Wharf_3283_thumb.jpg",130,105,18);thumbnails[2407664]=new thumbnail(2407664,"165733","Bankside 123, office, retail and residential development, London","Bankside_2_0359_thumb.jpg",130,87,18);thumbnails[2407670]=new thumbnail(2407670,"165733","Medway Viaduct, high speed Channel Tunnel rail link","Medway_0047_thumb.jpg",130,86,18);thumbnails[2407680]=new thumbnail(2407680,"165733","Motorway interchange, Sunbury on Thames","Sunbury_0005_thumb.jpg",130,86,18);thumbnails[2407686]=new thumbnail(2407686,"132198","Gravloc prevents mobile hydraulic machinery overbalancing","AEL_0395_thumb.jpg",130,85,18);thumbnails[2407778]=new thumbnail(2407778,"132198","High Precision Components","AEL_0400_thumb.jpg",130,86,18);thumbnails[2407781]=new thumbnail(2407781,"132198","Hydraulic Rams awaiting finishing","AEL_0433_thumb.jpg",130,86,18);thumbnails[2641942]=new thumbnail(2641942,"165737","Second Severn Crossing","Severn Bridge_thumb.jpg",130,82,18);thumbnails[2709453]=new thumbnail(2709453,"165737","Office Building, Cardiff","Office Building_Cardiff_thumb.jpg",130,85,18);thumbnails[2709867]=new thumbnail(2709867,"165737","Redeveloped Waterfront at Ribiera Brava, Madeira","Ribiera Brava_thumb.jpg",130,92,18);thumbnails[2829789]=new thumbnail(2829789,"165737","The Aarne Jakobsen Swan Chair, an enduring classic in the public area of the Senedd","The Chair_thumb.jpg",89,130,18);thumbnails[2917134]=new thumbnail(2917134,"165737","Senedd, or Debating Chamber of the Welsh Assembly Government","006_06-04-200 Senedd on the Waterfront_thumb.jpg",130,92,18);thumbnails[2932456]=new thumbnail(2932456,"165737","Striking internal feature of the Senedd","06-04-202 Form and Function_Senedd_thumb.jpg",130,90,18);thumbnails[2932468]=new thumbnail(2932468,"165729","Carterton Care Home, Oxfordshire","Carterton_0226_thumb.jpg",130,84,18);thumbnails[2932476]=new thumbnail(2932476,"165729","Truss detail, Hafan y Waun, Aberystwyth.","Hafan y Waun_4103_thumb.jpg",130,86,18);thumbnails[2932480]=new thumbnail(2932480,"165729","Queen's Court, Windsor","Queens Court_0006_thumb.jpg",130,88,18);thumbnails[2932483]=new thumbnail(2932483,"165729","Balcony, Queen's Court, Windsor","Queens Court_0032_thumb.jpg",130,92,18);thumbnails[2932502]=new thumbnail(2932502,"165729","St. Mary's Nursinhg Home, East Sussex","St Marys_0132_thumb.jpg",130,87,18);thumbnails[2932604]=new thumbnail(2932604,"165733","Albion Waterside on the south bank of the Thames","Albion Wharf_3281_thumb.jpg",97,130,18);thumbnails[2932607]=new thumbnail(2932607,"165733","Office Development at Bankside","Bankside_1_0319_thumb.jpg",130,86,18);thumbnails[2932614]=new thumbnail(2932614,"165733","New Street Square","New Street Square_3268_thumb.jpg",96,130,18);thumbnails[2932647]=new thumbnail(2932647,"165733","New Street Square","New Street Square_3263_thumb.jpg",130,99,18);thumbnails[2943720]=new thumbnail(2943720,"165737","Roald Dahl's Plass, Cardiff Bay","04-04-147 Oval Basin_Cardiff Bay_thumb.jpg",130,104,18);thumbnails[3396742]=new thumbnail(3396742,"132198","Mifflin Construction","Mifflin_8190_thumb.jpg",130,86,18);thumbnails[3396797]=new thumbnail(3396797,"132198","Mifflin Construction","Mifflin_8242_thumb.jpg",130,90,18);thumbnails[3396800]=new thumbnail(3396800,"132198","Mifflin Construction","Mifflin_8272_thumb.jpg",130,84,18);thumbnails[3396821]=new thumbnail(3396821,"165729","Rosebrook Court, in Southampton, a new project opened in February 2009","Rosebrook Court_5532_thumb.jpg",130,87,18);thumbnails[3423144]=new thumbnail(3423144,"165729","Rosebrook Court, in Southampton, a new project opened in February 2009","Rosebrook Court_5662_corr_thumb.jpg",130,95,18);thumbnails[4785456]=new thumbnail(4785456,"165729","Barrier detail, Lightmoor View near Telford","Lightmoor_View_5778_thumb.jpg",130,87,18);thumbnails[4785461]=new thumbnail(4785461,"165729","Entrance to Lightmoor View, Telford","Lightmoor_View_5860_thumb.jpg",130,87,18);thumbnails[4785559]=new thumbnail(4785559,"165729","Wing Lodge, Buckinghamshire","Wing_Lodge_6671_thumb.jpg",130,87,18);thumbnails[4785915]=new thumbnail(4785915,"165729","Betty Dodd Court, Luton","BDodd_1987_thumb.jpg",130,86,18);thumbnails[4785927]=new thumbnail(4785927,"165729","June Jenkins Court, Luton, under construction","JJenkins_6749_thumb.jpg",130,87,18);thumbnails[4785933]=new thumbnail(4785933,"165729","Rothsay Grange, Andover","Rothsay_Grange_5776_thumb.jpg",130,86,18);thumbnails[4785968]=new thumbnail(4785968,"132198","Wales & West Utilities","Clydach_5412_thumb.jpg",130,86,18);thumbnails[4785973]=new thumbnail(4785973,"132198","Wales & West Utilities","Clydach_7118_thumb.jpg",130,87,18);thumbnails[4786346]=new thumbnail(4786346,"132198","Wales & West Utilities","Clydach_7123_thumb.jpg",130,87,18);thumbnails[4787345]=new thumbnail(4787345,"273944","Car parking bays","SD2_5569_thumb.jpg",130,86,18);thumbnails[4787354]=new thumbnail(4787354,"273944","Directional markings","SD2_7157_thumb.jpg",130,87,18);thumbnails[4787371]=new thumbnail(4787371,"273944","Directional marking","SD2_7166_thumb.jpg",130,87,18);thumbnails[4787373]=new thumbnail(4787373,"273944","Mother and Toddler bay","SD2_7195_thumb.jpg",130,87,18);thumbnails[4787386]=new thumbnail(4787386,"273944","Directional marking at junction","SD2_7198_thumb.jpg",130,87,18);thumbnails[4787412]=new thumbnail(4787412,"273944","Directional marking - detail","SD2_7200_thumb.jpg",130,87,18);thumbnails[5450807]=new thumbnail(5450807,"132198","Wales&West Utilities","Abercanaid_connect_11_0292_8F3ABC4A-1D09-001F-9927914A8B3070C2_thumb.jpg",130,86,18);thumbnails[5450881]=new thumbnail(5450881,"132198","Wales&West Utilities","Abercanaid_pipe_spray_11_8470_thumb.jpg",130,87,18);thumbnails[5450888]=new thumbnail(5450888,"132198","Wales&West Utilities","Abercanaid_pipe_weld_10_8222_thumb.jpg",130,87,18);thumbnails[5450894]=new thumbnail(5450894,"132198","Wales&West Utilities","Abercanaid_site_07_8322_thumb.jpg",130,87,18);var galleries=new Object();galleries[165726]=new gallery(165726,"4787386,4787373,4787371,4787354,4787345,4785933,4785927,4785915,4785559,4785461,3423144,3396821,2943720,2932607,2932604,2932502,2932483,2932480,2932476,2932468,2932456,2917134,2829789,2709867,2709453,2641942,2407680,2407670,2407664,2407639,2273393,2273386,2273379,2273373,2273370,2082064,2069960,2062577,1969502,1966979","Architecture and Construction","gallery",[]);galleries[165729]=new gallery(165729,"4785933,4785927,4785915,4785559,4785461,3423144,3396821,2932502,2932483,2932480,2932476,2932468,2273393,2273386,2273379,2273373,2273370","Castleoak Care Homes","gallery",[2273370,2273373,2273379,2273386,2273393,2932468,2932476,2932480,2932483,2932502,3396821,3423144,4785456,4785461,4785559,4785915,4785927,4785933]);galleries[165733]=new gallery(165733,"2932607,2932604,2407680,2407670,2407664,2407639","Celsa Steel UK","gallery",[2407639,2407664,2407670,2407680,2932604,2932607,2932614,2932647]);galleries[132199]=new gallery(132199,"2035850,1966972","Commercial","gallery",[1966654,1966971,1966972,2035850]);galleries[273944]=new gallery(273944,"4787386,4787373,4787371,4787354,4787345","Deckmaster","gallery",[4787345,4787354,4787371,4787373,4787386,4787412]);galleries[132198]=new gallery(132198,"5450894,5450888,5450881,5450807,4785968,3396742,2407781,2407778,2407686,1966959,1966956","Industry","gallery",[1966671,1966956,1966959,2407686,2407778,2407781,3396742,3396797,3396800,4785968,4785973,4786346,5450807,5450881,5450888,5450894]);galleries[165737]=new gallery(165737,"2943720,2932456,2917134,2829789,2709867,2709453,2641942,2082064,2069960,2062577,1969502,1966979","Personal","gallery",[1966670,1966976,1966979,1969502,2062577,2069960,2082064,2103891,2641942,2709453,2709867,2829789,2917134,2932456,2943720]);var imageSets=new Object();imageSets[1]="5450881,4787345,4785927,4785915,4785461,3423144,3396742,2943720,2932607,2932604,2932456,2917134,2829789,2709867,2709453,2641942,2407781,2407778,2407686,2407664,2407639,2273370,2082064,2069960,2062577,2035850,1969502,1966671,1966670,1966654";imageSets[2]="5450894,5450888,5450881,5450807,4787386,4787373,4787371,4787354,4787345,4785968,4785933,4785927,4785915,4785559,4785461,3423144,3396821,3396742,2943720,2932607,2932604,2932502,2932483,2932480,2932476,2932468,2932456,2917134,2829789,2709867,2709453,2641942,2407781,2407778,2407686,2407680,2407670,2407664,2407639,2273393,2273386,2273379,2273373,2273370,2082064,2069960,2062577,2035850,1969502,1966979,1966972,1966959,1966956";imageSets[3]="5450894,5450888,5450881,5450807,4787412,4787386,4787373,4787371,4787354,4787345,4786346,4785973,4785968,4785933,4785927,4785915,4785559,4785461,4785456,3423144,3396821,3396800,3396797,3396742,2943720,2932647,2932614,2932607,2932604,2932502,2932483,2932480,2932476,2932468,2932456,2917134,2829789,2709867,2709453,2641942,2407781,2407778,2407686,2407680,2407670,2407664,2407639,2273393,2273386,2273379";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/garyandnick/images";break}switch(a){case 1:b="http://www1.clikpic.com/garyandnick/images";break}switch(a){case 2:b="http://admin.clikpic.com/garyandnick/images";break}switch(a){case 4:b="http://www.clikchurch.com/garyandnick/images";break}switch(a){case 5:b="http://www2.clikpic.com/garyandnick/images";break}switch(a){case 15:b="http://www3.clikpic.com/garyandnick/images";break}switch(a){case 21:b="http://www6.clikpic.com/garyandnick/images";break}switch(a){case 18:b="http://www4.clikpic.com/garyandnick/images";break}switch(a){case 19:b="http://www5.clikpic.com/garyandnick/images";break}switch(a){case 22:b="http://tpc5/clikpic/garyandnick/images";break}switch(a){case 23:b="http://tpc10/clikpic/garyandnick/images";break}switch(a){case 24:b="http://tpc15/clikpic/garyandnick/images";break}switch(a){case 25:b="http://tpc16/clikpic/garyandnick/images";break}switch(a){case 31:b="http://www7.clikpic.com/garyandnick/images";break}switch(a){case 32:b="http://admin2.clikpic.com/garyandnick/images";break}switch(a){case 33:b="http://www8.clikpic.com/garyandnick/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="Business Image: "+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+'")'})}}};