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[4090949]=new thumbnail(4090949,"","","HPS_logo_web_thumb.jpg",130,130,15);thumbnails[4091751]=new thumbnail(4091751,"","","Piece_Hall_EXHIBITION_1_copy_thumb.jpg",94,130,15);thumbnails[6259165]=new thumbnail(6259165,"","","Halifax_Photographic336505_thumb.jpg",92,130,15);thumbnails[4115293]=new thumbnail(4115293,"242044","Embleton Bay Reflections","a_thumb.jpg",130,86,15);thumbnails[4115305]=new thumbnail(4115305,"242044","Break of a Winter's Day,  Bamburgh","b_thumb.jpg",130,86,15);thumbnails[4115311]=new thumbnail(4115311,"242044","Gibson Mill Reflections","c_thumb.jpg",130,85,15);thumbnails[4116026]=new thumbnail(4116026,"242044","Clearing Rain , Beadnell Harbour Northumberland","5_copy_thumb.jpg",130,86,15);thumbnails[4116028]=new thumbnail(4116028,"242044","The Old Ship's Lifeboat, Lindisfarne","6_copy_thumb.jpg",86,130,15);thumbnails[4119076]=new thumbnail(4119076,"242044","West Pier Light, Whitby at Dawn","3West_Pier_Light_Whitby_at_Dawn_PLH_thumb.jpg",130,86,15);thumbnails[4120095]=new thumbnail(4120095,"242044","Boulder Beach, Dunstanburgh","172_copy_filtered_copy_thumb.jpg",130,86,15);thumbnails[4121929]=new thumbnail(4121929,"242044","Look It's Here Somewhere","DSC_2466_copy_filtered_copy_thumb.jpg",130,86,15);thumbnails[4199148]=new thumbnail(4199148,"242044","Saltwick Bay , Evening Light at Low Tide.","Saltwick_Nab_3_filtered_copy_thumb.jpg",130,84,15);thumbnails[4217787]=new thumbnail(4217787,"242044","Whitby Harbour Lights","DSC_4312_copy_filtered_copy_thumb.jpg",130,86,15);thumbnails[4114807]=new thumbnail(4114807,"246616","5 Spot Burnet Moth","5_spot_burnet_moth_thumb.jpg",89,130,15);thumbnails[4114822]=new thumbnail(4114822,"246616","Egret","Egret_thumb.jpg",130,87,15);thumbnails[4114832]=new thumbnail(4114832,"246616","Florida Sunrise","Florida_Sunrise_thumb.jpg",130,87,15);thumbnails[4114842]=new thumbnail(4114842,"246616","Great Blue Heron","Great_Blue_Heron_thumb.jpg",130,87,15);thumbnails[4114852]=new thumbnail(4114852,"246616","Meerkat on Guard","Meerkat_on_Guard_thumb.jpg",102,130,15);thumbnails[4114866]=new thumbnail(4114866,"246616","Rose","Rose_thumb.jpg",97,130,15);thumbnails[4114890]=new thumbnail(4114890,"246616","Sunrise at Fairburn Ings","Sunrise_at_Fairburn_Ings_thumb.jpg",102,130,15);thumbnails[4114795]=new thumbnail(4114795,"246616","Ducklings ","Ducklings_thumb.jpg",130,87,15);thumbnails[4197722]=new thumbnail(4197722,"249525","Feather","IMG_7055_edited_small_for_HPC_Site_edited-100kb_copy_copy_thumb.jpg",100,130,15);thumbnails[4208326]=new thumbnail(4208326,"249525","Wastwater  Reflections","Wast_Water_Reflections_edited-1_copy_thumb.jpg",130,98,15);thumbnails[4208499]=new thumbnail(4208499,"249525","Peregrine Falcon, Malham Cove","Periguin_Falcon_Malham_Cove_copy_thumb.jpg",93,130,15);thumbnails[4208514]=new thumbnail(4208514,"249525","Fountains Abbey, Sun Flash","Fountains_Abbey_Sun_Flash_copy_thumb.jpg",87,130,15);thumbnails[4660023]=new thumbnail(4660023,"249525","Parched, Mongolia","Parched__Mongolia_thumb.jpg",87,130,15);thumbnails[4660028]=new thumbnail(4660028,"249525","Reflections, Altai Mountains. Russia","Reflections__Altai_Mountains_Russia_thumb.jpg",87,130,15);thumbnails[4662758]=new thumbnail(4662758,"249525","Homework at the Mongolian Orphanage","Homework_at_the_Mongolian_Orphanage_thumb.jpg",104,130,15);thumbnails[4677476]=new thumbnail(4677476,"269397","Orchid","TS_1_thumb.jpg",91,130,15);thumbnails[4677480]=new thumbnail(4677480,"269397","Black Box","TS_2_thumb.jpg",90,130,15);thumbnails[4677482]=new thumbnail(4677482,"269397","Poppy","TS_3_thumb.jpg",92,130,15);thumbnails[4677486]=new thumbnail(4677486,"269397","Moulin Rouge","TS_4_thumb.jpg",87,130,15);thumbnails[4677489]=new thumbnail(4677489,"269397","Reflecting on Schubert","TS_5_thumb.jpg",88,130,15);thumbnails[4677494]=new thumbnail(4677494,"269397","Field of Gold","TS_6_thumb.jpg",92,130,15);thumbnails[4779042]=new thumbnail(4779042,"273595","Daisy","1Daisy_COC_copy_thumb.jpg",130,88,15);thumbnails[4779043]=new thumbnail(4779043,"273595","Wainhouse at Dusk","1Wainhouse_at_Dusk_COC_copy_thumb.jpg",130,94,15);thumbnails[4779044]=new thumbnail(4779044,"273595","Golden Sunburst","2Golden_Sunburst__COC__copy_thumb.jpg",94,130,15);thumbnails[4779045]=new thumbnail(4779045,"273595","Couple","Couple_copy_thumb.jpg",130,87,15);thumbnails[4779046]=new thumbnail(4779046,"273595","Poppy","Poppy_copy_thumb.jpg",130,103,15);thumbnails[4899090]=new thumbnail(4899090,"279218","","a_1_thumb.jpg",130,40,15);thumbnails[4899095]=new thumbnail(4899095,"279218","","a1_thumb.jpg",87,130,15);thumbnails[4899097]=new thumbnail(4899097,"279218","","a2_thumb.jpg",130,41,15);thumbnails[4899099]=new thumbnail(4899099,"279218","","a3_thumb.jpg",87,130,15);thumbnails[4899101]=new thumbnail(4899101,"279218","","a4_thumb.jpg",130,130,15);thumbnails[4899104]=new thumbnail(4899104,"279218","","a6_thumb.jpg",88,130,15);thumbnails[4899106]=new thumbnail(4899106,"279218","","a7_thumb.jpg",87,130,15);thumbnails[4899112]=new thumbnail(4899112,"279218","","a8_thumb.jpg",130,87,15);thumbnails[4899115]=new thumbnail(4899115,"279218","","a9_thumb.jpg",98,130,15);thumbnails[4899117]=new thumbnail(4899117,"279218","","a10_thumb.jpg",130,130,15);thumbnails[4947391]=new thumbnail(4947391,"281375","Apple Blossom","Apple_Blossom_for_print_copy_copy_thumb.jpg",130,91,15);thumbnails[4947427]=new thumbnail(4947427,"281375","Ullswater","Sombre_Reflections_-_print_copy_thumb.jpg",130,91,15);thumbnails[4947429]=new thumbnail(4947429,"281375","Towards Dawlish from Teignmouth, Devon","Undecided_British_weather_-_print_copy_thumb.jpg",130,91,15);thumbnails[5450676]=new thumbnail(5450676,"281375","Buff Tailed Bumblebee","1Buff-tailed_Bumblebee_PJM_copy_thumb.jpg",98,130,15);thumbnails[5450684]=new thumbnail(5450684,"281375","Poppy","3Poppy_PJM_copy_thumb.jpg",130,130,15);thumbnails[5450690]=new thumbnail(5450690,"281375","What Pictures Can You See?","4_What_pictures_can_you_see_PJM_copy_thumb.jpg",130,94,15);thumbnails[5450697]=new thumbnail(5450697,"281375","Slipper Orchid","6_Slipper_Orchid_PJM_copy_thumb.jpg",130,120,15);thumbnails[5450783]=new thumbnail(5450783,"281375","Geum","5_Geum_PJM_copy_thumb.jpg",93,130,15);thumbnails[5171445]=new thumbnail(5171445,"291995","Blades of Glory","blades-of-glory_thumb.jpg",87,130,15);thumbnails[5171470]=new thumbnail(5171470,"291995","The Boat House, Shibden Park","boathouse_thumb.jpg",130,76,15);thumbnails[5171695]=new thumbnail(5171695,"291995","The Enchanted Wood","enchantedwood_thumb.jpg",130,74,15);thumbnails[5171696]=new thumbnail(5171696,"291995","The Port of Jaffa","jaffa-port_thumb.jpg",130,83,15);thumbnails[5171697]=new thumbnail(5171697,"291995","Leaves and Trees","leavesandtress_thumb.jpg",88,130,15);thumbnails[5171701]=new thumbnail(5171701,"291995","A  New Daisy","newdaisy_thumb.jpg",130,88,15);thumbnails[5171704]=new thumbnail(5171704,"291995","The Piece Hall,Halifax","piecehall-wide-lower-bw_thumb.jpg",130,85,15);thumbnails[5171710]=new thumbnail(5171710,"291995","Pollen Hunting","pollen-hunting_thumb.jpg",130,122,15);thumbnails[5171713]=new thumbnail(5171713,"291995","The Solitary Church","thesolitarychurch_thumb.jpg",87,130,15);thumbnails[5171760]=new thumbnail(5171760,"291995","Time Piece","timepiece_thumb.jpg",130,90,15);var galleries=new Object();galleries[242044]=new gallery(242044,"4199148","Philip Haigh","gallery",[4115293,4115305,4115311,4116026,4116028,4119076,4120095,4121929,4199148,4217787]);galleries[246616]=new gallery(246616,"4114890,4114866,4114852,4114842,4114832,4114822,4114807,4114795","Janet Dewhirst","gallery",[4114807,4114822,4114832,4114842,4114852,4114866,4114890,4114795]);galleries[249525]=new gallery(249525,"4208326,4197722","Simon Dixon","gallery",[4197722,4208326,4208499,4208514,4660023,4660028,4662758]);galleries[269397]=new gallery(269397,"4677494,4677489,4677486,4677482,4677480,4677476","Tony Sheeky","gallery",[4677476,4677480,4677482,4677486,4677489,4677494]);galleries[273595]=new gallery(273595,"4779046,4779045,4779044,4779043,4779042","Chris O'Connor","gallery",[4779042,4779043,4779044,4779045,4779046]);galleries[279218]=new gallery(279218,"4899099","Stephen Gilling","gallery",[4899090,4899095,4899097,4899099,4899101,4899104,4899106,4899112,4899115,4899117]);galleries[281375]=new gallery(281375,"4947391","Patricia Morley","gallery",[4947391,4947427,4947429,5450676,5450684,5450690,5450697,5450783]);galleries[291995]=new gallery(291995,"5171695","Craig Johnston ","gallery",[5171445,5171470,5171695,5171696,5171697,5171701,5171704,5171710,5171713,5171760]);var imageSets=new Object();imageSets[1]="5450697,5450690,5450684,5171760,5171710,5171704,5171701,5171696,5171695,5171470,4947429,4947427,4947391,4899117,4899112,4899101,4899097,4899090,4779046,4779045,4779043,4779042,4217787,4208326,4199148,4121929,4120095,4119076,4116026,4115311,4115305,4115293,4114842,4114832,4114822,4114795";imageSets[2]="5171695,4947391,4899099,4208326,4199148,4197722";imageSets[3]="5450697,5450690,5450684,5450676,5171760,5171713,5171710,5171704,5171701,5171697,5171696,5171695,5171470,5171445,4947429,4947427,4947391,4899117,4899115,4899112,4899106,4899104,4899101,4899099,4899097,4899095,4899090,4779046,4779045,4779044,4779043,4779042,4677494,4677489,4677486,4677482,4677480,4677476,4662758,4660028,4660023,4217787,4208514,4208499,4208326,4199148,4197722,4121929,4120095,4119076,4116028,4116026,4115311,4115305,4115293,4114890,4114866,4114852,4114842,4114832,4114822,4114807,4114795,4091751,4090949";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/phil99/images";break}switch(a){case 1:b="http://www1.clikpic.com/phil99/images";break}switch(a){case 2:b="http://admin.clikpic.com/phil99/images";break}switch(a){case 24:b="http://tpc15/clikpic/phil99/images";break}switch(a){case 4:b="http://www.clikchurch.com/phil99/images";break}switch(a){case 5:b="http://www2.clikpic.com/phil99/images";break}switch(a){case 22:b="http://tpc5/clikpic/phil99/images";break}switch(a){case 23:b="http://tpc10/clikpic/phil99/images";break}switch(a){case 25:b="http://tpc16/clikpic/phil99/images";break}switch(a){case 15:b="http://www3.clikpic.com/phil99/images";break}switch(a){case 18:b="http://www4.clikpic.com/phil99/images";break}switch(a){case 19:b="http://www5.clikpic.com/phil99/images";break}switch(a){case 31:b="http://www7.clikpic.com/phil99/images";break}switch(a){case 32:b="http://admin2.clikpic.com/phil99/images";break}switch(a){case 33:b="http://www8.clikpic.com/phil99/images";break}switch(a){case 34:b="http://www9.clikpic.com/phil99/images";break}switch(a){case 35:b="http://admin3.clikpic.com/phil99/images";break}switch(a){case 37:b="http://admin4.clikpic.com/phil99/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="HALIFAX PHOTOGRAPHIC SOCIETY: "+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+'")'})}}};