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[1320736]=new thumbnail(1320736,"92839","Delivery, Venice<br>\r\nThis photograph was selected and displayed as part of the Trierenberg Super Circuit 2007 photography competition, Austria.","017_14_1_thumb.jpg",130,195,15);thumbnails[1320801]=new thumbnail(1320801,"92839","Through the Window<br>\r\nThis photograph appeared in the Trierenberg Super Circuit Photography Competition 2007, on exhibition in Austria.<br>\r\n","Through the Window - Landscape1KWestwood_thumb.jpg",130,195,15);thumbnails[1320810]=new thumbnail(1320810,"92839","Snow Clouds over Marmalade<br>\r\nThis image was exhibited as part of the Trierenberg Super Circuit 2007 photography competition, Austria.","Snow Clouds on Marmalade - SeasonsandWeather1KWestwood_thumb.jpg",130,87,15);thumbnails[1347691]=new thumbnail(1347691,"92839","Indian Ocean","Walk - Katherine Westwood_thumb.jpg",130,195,15);thumbnails[1347692]=new thumbnail(1347692,"92839","Ocean Colours, North of Perth, WA<br>\r\nThis image was exhibited at Huddersfield Art Gallery 2008.","Layers - Katherine Westwood_thumb.jpg",130,195,15);thumbnails[1347696]=new thumbnail(1347696,"92839","Deserted Beach<br>\r\nExhibited at Huddersfield Art Gallery 2008.","Alone - Katherine Westwood_thumb.jpg",130,195,15);thumbnails[1408926]=new thumbnail(1408926,"92839","Contemplation - exhibited in the Al-Thani Award 2007 ","Contemplation - Katherine Westwood_thumb.jpg",130,87,15);thumbnails[1579085]=new thumbnail(1579085,"92839","Miyajima Island, Japan","view from miyajima2_thumb.jpg",130,185,15);thumbnails[2047357]=new thumbnail(2047357,"92839","Maiko - Trainee Geisha, Kyoto, Japan","maiko_thumb.jpg",130,219,15);thumbnails[1320746]=new thumbnail(1320746,"92918","Reflections over Longwood Resevoir, West Yorkshire<br>\r\nExhibited at Huddersfield Art Gallery 2008.<br>\r\nFeatured in Issue 2 of the Colne Valley Now magazine.","reflections_thumb.jpg",130,87,15);thumbnails[1320755]=new thumbnail(1320755,"92918","River Derwent<br>\r\nExhibited at the Huddersfield Art Gallery 2008.","myriver_thumb.jpg",130,87,15);thumbnails[1320762]=new thumbnail(1320762,"92918","Winter on Marsden Moor<br>\r\nFeatured in Issue 2 of the Colne Valley Now magazine.","moorpanorama_thumb.jpg",130,66,15);thumbnails[1320772]=new thumbnail(1320772,"92918","Blackley Methodist Church","churchthroughgate_thumb.jpg",130,98,15);thumbnails[1320775]=new thumbnail(1320775,"92918","Church at Blackley","churchblackley_thumb.jpg",130,76,15);thumbnails[2054563]=new thumbnail(2054563,"92918","Home, Sweet Home","Home Sweet Home1_thumb.jpg",130,211,15);thumbnails[3424386]=new thumbnail(3424386,"92918","Pule Hill","pule hill hdr_thumb.jpg",130,87,15);thumbnails[3424399]=new thumbnail(3424399,"92918","Golcar and Castle Hill","castle hill - golcar from scape_thumb.jpg",130,196,15);thumbnails[3424406]=new thumbnail(3424406,"92918","Moon at Scapegoat Hill","road and moon scape_thumb.jpg",130,195,15);thumbnails[3424412]=new thumbnail(3424412,"92918","Winter Moon","scapegoat moon hdr_thumb.jpg",130,195,15);thumbnails[3424580]=new thumbnail(3424580,"92918","Castle Hill","castle hill_1_thumb.jpg",130,87,15);thumbnails[3438276]=new thumbnail(3438276,"92918","Golcar, Castle Hill and Emley Moor Mast<br>\r\nCurrently featured in the Colne Valley Now magazine - issue 3","Scapegoat Hill0020_thumb.jpg",130,87,15);thumbnails[3438286]=new thumbnail(3438286,"92918","Golcar to Castle Hill","scar lane, golcar to Castle Hill_thumb.jpg",130,70,15);thumbnails[3438291]=new thumbnail(3438291,"92918","Golcar - Linthwaite - Marsden","Titanic Spa, Linthwaite to the moors_thumb.jpg",130,195,15);thumbnails[4630592]=new thumbnail(4630592,"92918","Panorama - Ramshaw Rocks, Peak District","IMG_5293-Edit_1_thumb.jpg",130,26,15);thumbnails[5663097]=new thumbnail(5663097,"92918","Edale Panorama, Peak District, Derbyshire","IMG_5500-Edit_copy12_thumb.jpg",130,23,15);thumbnails[4630610]=new thumbnail(4630610,"92918","Rockscape","IMG_5575_1_thumb.jpg",130,195,15);thumbnails[4630629]=new thumbnail(4630629,"92918","Desolate","IMG_5553_1_thumb.jpg",130,195,15);thumbnails[1579086]=new thumbnail(1579086,"107928","Tilly","Dd62_thumb.jpg",130,195,15);thumbnails[2054556]=new thumbnail(2054556,"107928","Bump","Bump1_thumb.jpg",130,87,15);thumbnails[3424374]=new thumbnail(3424374,"107928","Neve","photoshop neve mono_1_thumb.jpg",130,87,15);thumbnails[3813686]=new thumbnail(3813686,"107928","Will and Hil","Will0018_1_thumb.JPG",130,87,15);thumbnails[3813688]=new thumbnail(3813688,"107928","Sandra","Sandra0002_1_thumb.JPG",130,87,15);thumbnails[1667792]=new thumbnail(1667792,"112513","Rings","Rings2_thumb.jpg",130,87,15);thumbnails[1667797]=new thumbnail(1667797,"112513","Bridal Bouquet","Wedding Decorations0003_thumb.jpg",130,87,15);thumbnails[2070255]=new thumbnail(2070255,"112513","The Bride and Groom","Sarah and Simon helicopter_thumb.jpg",130,195,15);thumbnails[1320741]=new thumbnail(1320741,"92915","Curious Highland cattle","highlandcow0001_thumb.jpg",130,76,15);thumbnails[1320742]=new thumbnail(1320742,"92915","Long-haired highland Cow<br>\r\nDisplayed at the Huddersfield Art Gallery 2008.","highlandcow0002_thumb.jpg",130,113,15);thumbnails[1320779]=new thumbnail(1320779,"92915","Beauty on the Wing","butterfly2_thumb.jpg",130,78,15);thumbnails[2047308]=new thumbnail(2047308,"136863","Churchyard","Golcar church_thumb.jpg",130,199,15);thumbnails[3406128]=new thumbnail(3406128,"92921","Industrialisation - Graffiti Nation<br>\r\n<br>\r\nArt or vandalism??","industrialisationgraffitination_thumb.jpg",130,196,15);thumbnails[2128402]=new thumbnail(2128402,"141487","","Dave1_thumb.jpg",130,98,15);thumbnails[2128403]=new thumbnail(2128403,"141487","","Dave2_thumb.jpg",130,98,15);thumbnails[2128408]=new thumbnail(2128408,"141487","","Dave3_thumb.jpg",130,98,15);thumbnails[2128411]=new thumbnail(2128411,"141487","","Dave4_thumb.jpg",130,98,15);thumbnails[2128412]=new thumbnail(2128412,"141487","","Dave5_thumb.jpg",130,98,15);thumbnails[2128413]=new thumbnail(2128413,"141487","","Dave6_thumb.jpg",130,98,15);thumbnails[2150883]=new thumbnail(2150883,"142765","Member of the Photographic Society of America (PSA) since February 2008.","psa_newlogo_wb_thumb.jpg",130,122,15);var galleries=new Object();galleries[92839]=new gallery(92839,"2047357,1579085,1408926,1347696,1320810,1320801,1320736","Travel","gallery",[1320736,1320801,1320810,1347691,1347692,1347696,1408926,1579085,2047357]);galleries[92918]=new gallery(92918,"3438291,3438286,3438276,3424580,3424412,3424406,3424399,3424386,2054563,1320775,1320772,1320762,1320746","United Kingdom","gallery",[1320746,1320755,1320762,1320772,1320775,2054563,3424386,3424399,3424406,3424412,3424580,3438276,3438286,3438291,4630592,5663097,4630610,4630629]);galleries[107928]=new gallery(107928,"3813688,3813686,3424374,1579086","Portraiture","gallery",[1579086,2054556,3424374,3813686,3813688]);galleries[112513]=new gallery(112513,"2070255,1667797,1667792","Wedding","gallery",[1667792,1667797,2070255]);galleries[92915]=new gallery(92915,"1320779,1320742,1320741","Animal Life","gallery",[1320741,1320742,1320779]);galleries[136863]=new gallery(136863,"2047308","Creative","gallery",[2047308]);galleries[92921]=new gallery(92921,"3406128","Urban Life","gallery",[3406128]);galleries[141487]=new gallery(141487,"2128413,2128412,2128411,2128408","Guest Artist - Dave Griffiths","gallery",[2128402,2128403,2128408,2128411,2128412,2128413]);galleries[142765]=new gallery(142765,"2150883","Photographic Society of America (PSA)","gallery",[2150883]);var imageSets=new Object();imageSets[1]="3813688,3813686,3438291,3438286,3438276,3424580,3424412,3424406,3424399,3424386,3424374,3406128,2070255,2054563,2047357,2047308,1667797,1667792,1579086,1579085,1408926,1347696,1347691,1320810,1320801,1320779,1320775,1320772,1320762,1320755,1320746,1320742,1320741,1320736";imageSets[2]="3813688,3813686,3438291,3438286,3438276,3424580,3424412,3424406,3424399,3424386,3424374,3406128,2150883,2128413,2128412,2128411,2128408,2070255,2054563,2047357,2047308,1667797,1667792,1579086,1579085,1408926,1347696,1320810,1320801,1320779,1320775,1320772,1320762,1320746,1320742,1320741,1320736";imageSets[3]="5663097,4630629,4630610,4630592,3813688,3813686,3438291,3438286,3438276,3424580,3424412,3424406,3424399,3424386,3424374,3406128,2150883,2128413,2128412,2128411,2128408,2128403,2128402,2070255,2054563,2054556,2047357,2047308,1667797,1667792,1579086,1579085,1408926,1347696,1347692,1347691,1320810,1320801,1320779,1320775,1320772,1320762,1320755,1320746,1320742,1320741,1320736";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/katherinewestwood/images";break}switch(a){case 1:b="http://www1.clikpic.com/katherinewestwood/images";break}switch(a){case 2:b="http://admin.clikpic.com/katherinewestwood/images";break}switch(a){case 24:b="http://tpc15/clikpic/katherinewestwood/images";break}switch(a){case 4:b="http://www.clikchurch.com/katherinewestwood/images";break}switch(a){case 5:b="http://www2.clikpic.com/katherinewestwood/images";break}switch(a){case 22:b="http://tpc5/clikpic/katherinewestwood/images";break}switch(a){case 23:b="http://tpc10/clikpic/katherinewestwood/images";break}switch(a){case 25:b="http://tpc16/clikpic/katherinewestwood/images";break}switch(a){case 15:b="http://www3.clikpic.com/katherinewestwood/images";break}switch(a){case 18:b="http://www4.clikpic.com/katherinewestwood/images";break}switch(a){case 19:b="http://www5.clikpic.com/katherinewestwood/images";break}switch(a){case 31:b="http://www7.clikpic.com/katherinewestwood/images";break}switch(a){case 32:b="http://admin2.clikpic.com/katherinewestwood/images";break}switch(a){case 33:b="http://www8.clikpic.com/katherinewestwood/images";break}switch(a){case 34:b="http://www9.clikpic.com/katherinewestwood/images";break}switch(a){case 35:b="http://admin3.clikpic.com/katherinewestwood/images";break}switch(a){case 37:b="http://admin4.clikpic.com/katherinewestwood/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="Katherine Westwood Photographic Designs: "+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>"}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="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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="kathyandrick@btinternet.com">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="kathyandrick@btinternet.com">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};