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[3859974]=new thumbnail(3859974,"235045","","090425-3400-NUI-RCS-0016a_Thumb.jpg",130,87,18);thumbnails[3860015]=new thumbnail(3860015,"235045","","090425-3400-NUI-RCS-0037_Thumb.jpg",130,84,18);thumbnails[3860048]=new thumbnail(3860048,"235045","","090425-3400-NUI-RCS-0120_Thumb.jpg",130,88,18);thumbnails[3864264]=new thumbnail(3864264,"235045","","090425-3400-NUI-RCS-0079_Thumb.jpg",130,87,18);thumbnails[3864295]=new thumbnail(3864295,"235045","","090425-3400-NUI-RCS-0123a_Thumb.jpg",130,89,18);thumbnails[3864379]=new thumbnail(3864379,"235045","","090425-3400-NUI-RCS-0126_Thumb.jpg",89,130,18);thumbnails[3859953]=new thumbnail(3859953,"235056","","090416-3400-NUI-RCS-0012b_Thumb.jpg",91,130,18);thumbnails[3859918]=new thumbnail(3859918,"235056","","090331-3400-NUI-RCS-_0004_Thumb.jpg",92,130,18);thumbnails[3859944]=new thumbnail(3859944,"235056","","090331-3400-NUI-RCS-_0011_Thumb.jpg",130,80,18);thumbnails[3859854]=new thumbnail(3859854,"235056","","090312-3400-NUI-RCS-015_Thumb.jpg",130,87,18);thumbnails[3859876]=new thumbnail(3859876,"235056","","090312-3400-NUI-RCS-018_Thumb.jpg",130,83,18);thumbnails[3859844]=new thumbnail(3859844,"235056","","090228-3400-NUI-RCS-010_Thumb.jpg",130,89,18);thumbnails[3859756]=new thumbnail(3859756,"235053","","090226-3400-NUI-RCS-004_Thumb.jpg",130,87,18);thumbnails[3859777]=new thumbnail(3859777,"235053","","090226-3400-NUI-RCS-007_Thumb.jpg",87,130,18);thumbnails[3859788]=new thumbnail(3859788,"235053","","090226-3400-NUI-RCS-030_Thumb.jpg",127,130,18);thumbnails[3859794]=new thumbnail(3859794,"235053","","090226-3400-NUI-RCS-040_Thumb.jpg",130,95,18);thumbnails[3859806]=new thumbnail(3859806,"235053","","090226-3400-NUI-RCS-047_Thumb.jpg",86,130,18);thumbnails[3859814]=new thumbnail(3859814,"235053","","090226-3400-NUI-RCS-050_Thumb.jpg",130,87,18);thumbnails[3859826]=new thumbnail(3859826,"235053","","090226-3400-NUI-RCS-051_Thumb.jpg",130,118,18);thumbnails[3859517]=new thumbnail(3859517,"235056","","090224-3400-NUI-RCS-0003_Thumb.jpg",87,130,18);thumbnails[3859530]=new thumbnail(3859530,"235056","","090224-3400-NUI-RCS-0038_Thumb.jpg",130,87,18);thumbnails[3859746]=new thumbnail(3859746,"235056","","090224-3400-NUI-RCS028_Thumb.jpg",84,130,18);thumbnails[2527327]=new thumbnail(2527327,"161903","Star Performance","CRH_5459_Thumb.jpg",88,130,18);thumbnails[2527357]=new thumbnail(2527357,"161903","Setting the Mood","CRH_5375_Thumb.jpg",80,130,18);thumbnails[2527389]=new thumbnail(2527389,"161917","The Fron Male Voice Choir","EPI_07_148_out_unclass_112_Thumb.jpg",130,81,18);thumbnails[2527340]=new thumbnail(2527340,"161909","Heather Small","CRH_0004_Thumb.jpg",87,130,18);thumbnails[2527343]=new thumbnail(2527343,"161909","Jim Davidson","CRH_0135_Thumb.jpg",130,87,18);thumbnails[2527354]=new thumbnail(2527354,"161909","Catherine Jenkins","CRH_0161_Thumb.jpg",87,130,18);thumbnails[3300883]=new thumbnail(3300883,"201272","","EPI_08_0282_out_unclass_0089_Thumb.jpg",92,130,18);thumbnails[3300898]=new thumbnail(3300898,"201272","","EPI_08_0282_out_unclass_0137_Thumb.jpg",130,88,18);thumbnails[3864182]=new thumbnail(3864182,"235017","","090425-3400-NUI-RCS-0003_Thumb.jpg",93,130,18);thumbnails[3300979]=new thumbnail(3300979,"201276","","EPI_08_0247_out_unclass_0052_Thumb.jpg",83,130,18);thumbnails[3864239]=new thumbnail(3864239,"235017","","090425-3400-NUI-RCS-0013_Thumb.jpg",87,130,18);thumbnails[3300982]=new thumbnail(3300982,"201276","","EPI_08_0247_out_unclass_0112_Thumb.jpg",130,87,18);thumbnails[3864245]=new thumbnail(3864245,"235017","","090425-3400-NUI-RCS-0016_Thumb.jpg",87,130,18);thumbnails[3864234]=new thumbnail(3864234,"235017","","090425-3400-NUI-RCS-0011_Thumb.jpg",130,87,18);thumbnails[3864196]=new thumbnail(3864196,"235017","","090425-3400-NUI-RCS-0007_Thumb.jpg",130,87,18);thumbnails[558026]=new thumbnail(558026,"39980","","Five_Thumb1.jpg",85,130,18);thumbnails[1339159]=new thumbnail(1339159,"94151","","EPI_07_088_out_unclass_036 (1)_Thumb.jpg",130,87,18);thumbnails[1339162]=new thumbnail(1339162,"94151","","EPI_07_088_out_unclass_038 (1)_Thumb.jpg",130,87,18);thumbnails[1339166]=new thumbnail(1339166,"94151","","EPI_07_088_out_unclass_046 (1)_Thumb.jpg",130,87,18);thumbnails[1339175]=new thumbnail(1339175,"94151","","EPI_07_088_out_unclass_061 (1)_Thumb.jpg",87,130,18);thumbnails[1339184]=new thumbnail(1339184,"94151","","EPI_07_088_out_unclass_063 (1)_Thumb.jpg",87,130,18);thumbnails[1339205]=new thumbnail(1339205,"94151","Rusty Light","EPI_07_088_out_unclass_066_Thumb.jpg",130,87,18);thumbnails[3300735]=new thumbnail(3300735,"40256","","DSC_2918a_Thumb.jpg",87,130,18);thumbnails[3300756]=new thumbnail(3300756,"40256","","DSC_2736_thumb.jpg",87,130,18);thumbnails[3300758]=new thumbnail(3300758,"40256","","DSC_2737_Thumb.jpg",130,87,18);thumbnails[3300762]=new thumbnail(3300762,"40256","","DSC_2758_Thumb.jpg",87,130,18);thumbnails[3300770]=new thumbnail(3300770,"40256","","DSC_2783_Thumb.jpg",130,87,18);thumbnails[3300773]=new thumbnail(3300773,"40256","","DSC_2812_Thumb.jpg",87,130,18);thumbnails[3300777]=new thumbnail(3300777,"40256","","DSC_2860_Thumb.jpg",87,130,18);thumbnails[3300813]=new thumbnail(3300813,"40256","","Amy 1_Thumb.jpg",87,130,18);thumbnails[1339253]=new thumbnail(1339253,"40256","","portrait 3_Thumb.jpg",130,87,18);thumbnails[643663]=new thumbnail(643663,"40715","","DSC_0010_Thumb.jpg",85,130,18);thumbnails[526449]=new thumbnail(526449,"40715","<br>\r\n","Regt BDay-095_Thumb.jpg",87,130,18);thumbnails[3304739]=new thumbnail(3304739,"40715","","_DSC7602_Thumb.jpg",130,66,18);thumbnails[3304748]=new thumbnail(3304748,"40715","","_DSC7607_Thumb.jpg",130,87,18);thumbnails[516046]=new thumbnail(516046,"39979","Blue Eye","DSC_00281_Thumb.jpg",130,85,18);thumbnails[516041]=new thumbnail(516041,"39979","Millenuim Wheel","DSC_0136_Thumb.jpg",130,54,18);thumbnails[505521]=new thumbnail(505521,"39311","","Flowers_Thumb5.jpg",130,69,18);thumbnails[516044]=new thumbnail(516044,"39311","","IMG_0122_Thumb.jpg",130,87,18);thumbnails[749389]=new thumbnail(749389,"39311","","DSC_0037_Thumb.jpg",130,85,18);thumbnails[3301030]=new thumbnail(3301030,"39311","","CRH_6966a_Thumb.jpg",87,130,18);thumbnails[3301036]=new thumbnail(3301036,"39311","","CRH_7000a_Thumb.jpg",130,87,18);thumbnails[3301044]=new thumbnail(3301044,"39311","","CRH_7026a_Thumb.jpg",130,87,18);thumbnails[3301054]=new thumbnail(3301054,"39311","","CRH_7037a_Thumb.jpg",130,87,18);thumbnails[516025]=new thumbnail(516025,"39971","","CRH_2765_Thumb.jpg",130,68,18);thumbnails[749358]=new thumbnail(749358,"39971","","CRH_2584_Thumb.jpg",130,79,18);thumbnails[1339050]=new thumbnail(1339050,"39971","<br>\r\n","AAC_4948_Thumb.jpg",130,87,18);thumbnails[1339226]=new thumbnail(1339226,"94152","","EPI_07_111_out_unclass_443a _Thumb.jpg",96,130,18);thumbnails[1339235]=new thumbnail(1339235,"94152","","EPI_07_111_out_unclass_479_Thumb.jpg",130,79,18);thumbnails[1339238]=new thumbnail(1339238,"94152","","EPI_07_111_out_unclass_497_Thumb.jpg",130,87,18);thumbnails[1339242]=new thumbnail(1339242,"94152","","EPI_07_111_out_unclass_520_Thumb.jpg",130,88,18);thumbnails[1339244]=new thumbnail(1339244,"94152","","EPI_07_111_out_unclass_581_Thumb.jpg",130,52,18);thumbnails[1339248]=new thumbnail(1339248,"94152","","EPI_07_111_out_unclass_597_Thumb.jpg",130,74,18);thumbnails[1339251]=new thumbnail(1339251,"94152","Firing Pistol","Pistol Montage_Thumb.jpg",130,35,18);thumbnails[557985]=new thumbnail(557985,"40698","","DSC_0187_Thumb.jpg",130,78,18);thumbnails[526447]=new thumbnail(526447,"40698","","Boxing_AAC_06_027_Thumb.jpg",130,87,18);thumbnails[1339063]=new thumbnail(1339063,"40698","","CRH_5907b_Thumb.jpg",87,130,18);thumbnails[643405]=new thumbnail(643405,"39981","","Stella 1_Thumb1.jpg",85,130,18);thumbnails[749331]=new thumbnail(749331,"39981","","One_Thumb.jpg",80,130,18);thumbnails[1339261]=new thumbnail(1339261,"39981","","EPI_07_093_out_unclass_035 copy_Thumb.jpg",130,98,18);thumbnails[1339266]=new thumbnail(1339266,"39981","","EPI_07_093_out_unclass_067_Thumb.jpg",88,130,18);thumbnails[1339256]=new thumbnail(1339256,"39981","","EPI_07_093_out_unclass_063_Thumb.jpg",130,97,18);var galleries=new Object();galleries[161909]=new gallery(161909,"2527354,2527343,2527340","British Forces Foundation","gallery",[2527340,2527343,2527354]);galleries[235053]=new gallery(235053,"3859826,3859814,3859806,3859794,3859788,3859777,3859756","Humanitarian Aid","gallery",[3859756,3859777,3859788,3859794,3859806,3859814,3859826]);galleries[161903]=new gallery(161903,"2527327","James Blunt Concert, Limassol","gallery",[2527327,2527357]);galleries[235045]=new gallery(235045,"3864379,3864295,3864264,3860048,3860015,3859974","Operation Sarak I","gallery",[3859974,3860015,3860048,3864264,3864295,3864379]);galleries[161917]=new gallery(161917,"2527389","The Fron Male Voice Choir","gallery",[2527389]);galleries[201276]=new gallery(201276,"3300982","Tiesto","gallery",[3300979,3300982]);galleries[235017]=new gallery(235017,"3864245,3864239,3864234,3864196,3864182","Toby Keith","gallery",[3864182,3864239,3864245,3864234,3864196]);galleries[235056]=new gallery(235056,"3859953","Various","gallery",[3859953,3859918,3859944,3859854,3859876,3859844,3859517,3859530,3859746]);galleries[201272]=new gallery(201272,"3300898,3300883","Whitesnake","gallery",[3300883,3300898]);galleries[234766]=new gallery(234766,"3859953","Afghanistan","gallery",[]);galleries[39980]=new gallery(39980,"558026","Black & White","gallery",[558026]);galleries[94151]=new gallery(94151,"1339184","Cyprus in Pictures","gallery",[1339159,1339162,1339166,1339175,1339184,1339205]);galleries[40256]=new gallery(40256,"3300813","Portraits","gallery",[3300735,3300756,3300758,3300762,3300770,3300773,3300777,3300813,1339253]);galleries[40715]=new gallery(40715,"643663","Animals","gallery",[643663,526449,3304739,3304748]);galleries[151359]=new gallery(151359,"3300982,2527327","Celebrities ","gallery",[]);galleries[39979]=new gallery(39979,"516046","Architecture","gallery",[516046,516041]);galleries[39311]=new gallery(39311,"749389","Flora","gallery",[505521,516044,749389,3301030,3301036,3301044,3301054]);galleries[39971]=new gallery(39971,"1339050","Aircraft","gallery",[516025,749358,1339050]);galleries[94152]=new gallery(94152,"1339235","Military","gallery",[1339226,1339235,1339238,1339242,1339244,1339248,1339251]);galleries[40698]=new gallery(40698,"1339063","Sport","gallery",[557985,526447,1339063]);galleries[39981]=new gallery(39981,"1339266","Other","gallery",[643405,749331,1339261,1339266,1339256]);var imageSets=new Object();imageSets[1]="3859944";imageSets[2]="3859953,3300982,3300813,2527327,1339266,1339235,1339184,1339063,1339050,749389,643663,516046";imageSets[3]="3864379,3864295,3864264,3864245,3864239,3864234,3864196,3864182,3860048,3860015,3859974,3859953,3859944,3859918,3859876,3859854,3859844,3859826,3859814,3859806,3859794,3859788,3859777,3859756,3859746,3859530,3859517,3304748,3304739,3301054,3301044,3301036,3301030,3300982,3300979,3300898,3300883,3300813,3300777,3300773,3300770,3300762,3300758,3300756,3300735,2527389,2527357,2527354,2527343,2527340";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 1:b="http://www1.clikpic.com/chrishalton/images";break}switch(a){case 2:b="http://admin.clikpic.com/chrishalton/images";break}switch(a){case 4:b="http://www.clikchurch.com/chrishalton/images";break}switch(a){case 5:b="http://www2.clikpic.com/chrishalton/images";break}switch(a){case 15:b="http://www3.clikpic.com/chrishalton/images";break}switch(a){case 21:b="http://www6.clikpic.com/chrishalton/images";break}switch(a){case 18:b="http://www4.clikpic.com/chrishalton/images";break}switch(a){case 19:b="http://www5.clikpic.com/chrishalton/images";break}switch(a){case 22:b="http://tpc5/clikpic/chrishalton/images";break}switch(a){case 23:b="http://tpc10/clikpic/chrishalton/images";break}switch(a){case 24:b="http://tpc15/clikpic/chrishalton/images";break}switch(a){case 25:b="http://tpc16/clikpic/chrishalton/images";break}switch(a){case 31:b="http://www7.clikpic.com/chrishalton/images";break}switch(a){case 32:b="http://admin2.clikpic.com/chrishalton/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="Halton Photographic: "+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").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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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+'")'})}}};