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[5378511]=new thumbnail(5378511,"303342","","_THL9019_19_thumb.JPG",130,87,5);thumbnails[5378512]=new thumbnail(5378512,"303342","","_THL9018_201_thumb.JPG",130,87,5);thumbnails[5378513]=new thumbnail(5378513,"303342","","_THL9020_18_thumb.JPG",130,87,5);thumbnails[5378514]=new thumbnail(5378514,"303342","","_THL9021_17_thumb.JPG",130,87,5);thumbnails[5378518]=new thumbnail(5378518,"303342","","_THL9069_42_thumb.JPG",130,87,5);thumbnails[5378519]=new thumbnail(5378519,"303342","","_THL9024_153_thumb.JPG",130,194,5);thumbnails[5378520]=new thumbnail(5378520,"303342","","_THL9007_211_thumb.JPG",130,194,5);thumbnails[5378521]=new thumbnail(5378521,"303342","","_THL9035_14_thumb.JPG",130,194,5);thumbnails[5378522]=new thumbnail(5378522,"303342","","_THL9036_131_thumb.JPG",130,194,5);thumbnails[5378523]=new thumbnail(5378523,"303342","","_THL9071_31_thumb.JPG",130,194,5);thumbnails[5378525]=new thumbnail(5378525,"303342","","_THL9049_9_thumb.JPG",130,194,5);thumbnails[5378526]=new thumbnail(5378526,"303342","","_THL9039_11_thumb.JPG",130,194,5);thumbnails[5378527]=new thumbnail(5378527,"303342","","_THL9038_12_thumb.JPG",130,194,5);thumbnails[5378528]=new thumbnail(5378528,"303342","","_THL9062_5_thumb.JPG",130,194,5);thumbnails[5378530]=new thumbnail(5378530,"303342","","_THL9057_7_thumb.JPG",130,194,5);thumbnails[5378532]=new thumbnail(5378532,"303342","","_THL9097_1_thumb.JPG",130,87,5);thumbnails[5378533]=new thumbnail(5378533,"303342","","_THL9082_2_thumb.JPG",130,87,5);thumbnails[5378534]=new thumbnail(5378534,"303342","","_THL9061_6_thumb.JPG",130,87,5);thumbnails[5378535]=new thumbnail(5378535,"303342","","_THL9048_10_thumb.JPG",130,87,5);thumbnails[5413683]=new thumbnail(5413683,"303195","","1_thumb.JPG",130,195,5);thumbnails[5413684]=new thumbnail(5413684,"303195","","2_thumb.JPG",130,195,5);thumbnails[5413686]=new thumbnail(5413686,"303195","","6_thumb.JPG",130,194,5);thumbnails[5413688]=new thumbnail(5413688,"303195","","8_thumb.JPG",130,194,5);thumbnails[5413692]=new thumbnail(5413692,"303195","","11_thumb.JPG",130,194,5);thumbnails[5413695]=new thumbnail(5413695,"303195","","3_thumb.JPG",130,87,5);thumbnails[5413698]=new thumbnail(5413698,"303195","","4_thumb.JPG",130,87,5);thumbnails[5413699]=new thumbnail(5413699,"303195","","16_thumb.JPG",130,70,5);thumbnails[5413700]=new thumbnail(5413700,"303195","","7_thumb.JPG",130,87,5);thumbnails[5413701]=new thumbnail(5413701,"303195","","18_thumb.JPG",130,51,5);thumbnails[5413703]=new thumbnail(5413703,"303195","","5_thumb.JPG",130,87,5);thumbnails[5413704]=new thumbnail(5413704,"303195","","10_thumb.JPG",130,87,5);thumbnails[5413705]=new thumbnail(5413705,"303195","","110_thumb.JPG",130,87,5);thumbnails[5413706]=new thumbnail(5413706,"303195","","17_thumb.JPG",130,86,5);thumbnails[5413707]=new thumbnail(5413707,"303195","","15_thumb.JPG",130,87,5);thumbnails[5413708]=new thumbnail(5413708,"303195","","24_thumb.JPG",130,69,5);thumbnails[5413709]=new thumbnail(5413709,"303195","","31_thumb.JPG",130,87,5);thumbnails[5413710]=new thumbnail(5413710,"303195","","13_thumb.JPG",130,87,5);thumbnails[5413712]=new thumbnail(5413712,"303195","","14_thumb.JPG",130,194,5);thumbnails[5413725]=new thumbnail(5413725,"305902","","111_thumb.JPG",130,121,5);thumbnails[5413726]=new thumbnail(5413726,"305902","","25_thumb.JPG",130,87,5);thumbnails[5413727]=new thumbnail(5413727,"305902","","32_thumb.JPG",130,87,5);thumbnails[5413728]=new thumbnail(5413728,"305902","","41_thumb.JPG",130,87,5);thumbnails[5413729]=new thumbnail(5413729,"305902","","51_thumb.JPG",130,88,5);thumbnails[5413730]=new thumbnail(5413730,"305902","","61_thumb.JPG",130,57,5);thumbnails[5413731]=new thumbnail(5413731,"305902","","71_thumb.JPG",130,37,5);thumbnails[5413732]=new thumbnail(5413732,"305902","","81_thumb.JPG",130,87,5);thumbnails[5413734]=new thumbnail(5413734,"305902","","9_thumb.JPG",130,51,5);thumbnails[5413735]=new thumbnail(5413735,"305902","","28_thumb.JPG",130,102,5);thumbnails[5413736]=new thumbnail(5413736,"305902","","114_thumb.JPG",130,171,5);thumbnails[5413751]=new thumbnail(5413751,"305905","","115_thumb.JPG",130,87,5);thumbnails[5413752]=new thumbnail(5413752,"","","29_thumb.JPG",130,194,5);thumbnails[5413755]=new thumbnail(5413755,"305905","","116_thumb.JPG",130,87,5);thumbnails[5413757]=new thumbnail(5413757,"305905","","210_thumb.JPG",130,194,5);thumbnails[5413758]=new thumbnail(5413758,"305905","","33_thumb.JPG",130,194,5);thumbnails[5413759]=new thumbnail(5413759,"305905","","42_thumb.JPG",130,194,5);thumbnails[5413760]=new thumbnail(5413760,"305905","","52_thumb.JPG",130,194,5);thumbnails[5447996]=new thumbnail(5447996,"305905","","TT-1_thumb.JPG",130,183,5);thumbnails[5448042]=new thumbnail(5448042,"305905","","TT-2_thumb.JPG",130,187,5);thumbnails[5448044]=new thumbnail(5448044,"305905","","TT-3_thumb.jpg",130,182,5);thumbnails[5493548]=new thumbnail(5493548,"305905","","Startrails-1_thumb.jpg",130,92,5);thumbnails[5558241]=new thumbnail(5558241,"305902","","_THL0642_3_4_5_6_tonemapped-1-1_thumb.jpg",130,212,5);thumbnails[5558243]=new thumbnail(5558243,"305902","","_THL0682_3_4_5_6_tonemapped-1_thumb.jpg",130,181,5);thumbnails[5558247]=new thumbnail(5558247,"305902","","_THL0545_6_7_8_9_tonemapped-1_thumb.jpg",130,102,5);thumbnails[5558248]=new thumbnail(5558248,"305902","","_THL0721_2_3_4_5_tonemapped-1_thumb.jpg",130,93,5);thumbnails[5695539]=new thumbnail(5695539,"322547","Mode det ukendte 1/3","_THL1135_1_thumb.JPG",130,149,5);thumbnails[5695540]=new thumbnail(5695540,"322547","Mode det ukendte 2/3","_THL1137_thumb.JPG",130,117,5);thumbnails[5695541]=new thumbnail(5695541,"322547","Mod det ukendte 3/3","_THL1146_thumb.JPG",130,147,5);thumbnails[6265379]=new thumbnail(6265379,"348281","","THL_3796_797_798_799_800_tonemapped_thumb.JPG",130,86,5);thumbnails[6265380]=new thumbnail(6265380,"348281","","kirkr_thumb.JPG",130,196,5);thumbnails[6265382]=new thumbnail(6265382,"348281","","THL_3936_37_38_39_40_tonemapped_thumb.JPG",130,87,5);thumbnails[6265388]=new thumbnail(6265388,"348281","","_THL1952-1_thumb.jpg",130,92,5);thumbnails[5377297]=new thumbnail(5377297,"303189","","_DSC2817_014_25_thumb.JPG",130,195,5);thumbnails[5377304]=new thumbnail(5377304,"303189","","_DSC2816_015_262_thumb.JPG",130,195,5);thumbnails[5377368]=new thumbnail(5377368,"303189","","_DSC2894_013_24_thumb.JPG",130,195,5);thumbnails[5377370]=new thumbnail(5377370,"303189","","_DSC2895_025_23_thumb.JPG",130,195,5);thumbnails[5377393]=new thumbnail(5377393,"303189","","THL_0203_017_12_thumb.JPG",130,194,5);thumbnails[5377397]=new thumbnail(5377397,"303189","","_DSC3753_005_14_thumb.JPG",130,195,5);thumbnails[5377400]=new thumbnail(5377400,"303189","","THL_2773_016_1_thumb.JPG",130,87,5);thumbnails[5377403]=new thumbnail(5377403,"303189","","THL_2765_001_2_thumb.JPG",130,87,5);thumbnails[5377431]=new thumbnail(5377431,"303189","","THL_2733_002_3_thumb.JPG",130,87,5);thumbnails[5377436]=new thumbnail(5377436,"303189","","THL_2731_003_4_thumb.JPG",130,194,5);thumbnails[5377438]=new thumbnail(5377438,"303189","","THL_2729_024_5_thumb.JPG",130,194,5);thumbnails[5377441]=new thumbnail(5377441,"303189","","THL_2402_004_61_thumb.JPG",130,87,5);thumbnails[5377442]=new thumbnail(5377442,"303189","","THL_1250_020_7_thumb.JPG",130,194,5);thumbnails[5377445]=new thumbnail(5377445,"303189","","THL_0441_023_8_thumb.JPG",130,87,5);thumbnails[5377461]=new thumbnail(5377461,"303189","","THL_0225_019_10_thumb.JPG",130,194,5);thumbnails[5378499]=new thumbnail(5378499,"303189","","THL_0426_021_9_thumb.JPG",130,195,5);thumbnails[5378500]=new thumbnail(5378500,"303189","","THL_0210_022_11_thumb.JPG",130,87,5);thumbnails[5378501]=new thumbnail(5378501,"303189","","raps_13_thumb.JPG",130,200,5);thumbnails[5378502]=new thumbnail(5378502,"303189","","_DSC3657_006_15_thumb.JPG",130,195,5);thumbnails[5378503]=new thumbnail(5378503,"303189","","_DSC3588_007_16_thumb.JPG",130,195,5);thumbnails[5378504]=new thumbnail(5378504,"303189","","_DSC2933_008_17_thumb.JPG",130,195,5);thumbnails[5378505]=new thumbnail(5378505,"303189","","_DSC2930_009_18_thumb.JPG",130,195,5);thumbnails[5378506]=new thumbnail(5378506,"303189","","_DSC2925_010_19_thumb.JPG",130,86,5);thumbnails[6265292]=new thumbnail(6265292,"303189","","2-1_thumb.JPG",130,89,5);thumbnails[6265293]=new thumbnail(6265293,"303189","","1_92884138-1EC9-D45B-1C80D63AA98A7EEA_thumb.JPG",130,87,5);thumbnails[6265296]=new thumbnail(6265296,"303189","","2_9288C184-1EC9-D45B-1C1F1A48C824C153_thumb.JPG",130,86,5);var galleries=new Object();galleries[303195]=new gallery(303195,"5413705,5413704","2009","gallery",[5413683,5413684,5413686,5413688,5413692,5413695,5413698,5413699,5413700,5413701,5413703,5413704,5413705,5413706,5413707,5413708,5413709,5413710,5413712]);galleries[348281]=new gallery(348281,"6265388,6265382,6265380,6265379","2010","gallery",[6265379,6265380,6265382,6265388]);galleries[303342]=new gallery(303342,"5378518","Frost ","gallery",[5378511,5378512,5378513,5378514,5378518,5378519,5378520,5378521,5378522,5378523,5378525,5378526,5378527,5378528,5378530,5378532,5378533,5378534,5378535]);galleries[305902]=new gallery(305902,"5413732","HDR","gallery",[5413725,5413726,5413727,5413728,5413729,5413730,5413731,5413732,5413734,5413735,5413736,5558241,5558243,5558247,5558248]);galleries[305905]=new gallery(305905,"5413751","New","gallery",[5413751,5413755,5413757,5413758,5413759,5413760,5447996,5448042,5448044,5493548]);galleries[322547]=new gallery(322547,"5695541,5695540,5695539","S/H","gallery",[5695539,5695540,5695541]);galleries[303189]=new gallery(303189,"5378500","2008","gallery",[5377297,5377304,5377368,5377370,5377393,5377397,5377400,5377403,5377431,5377436,5377438,5377441,5377442,5377445,5377461,5378499,5378500,5378501,5378502,5378503,5378504,5378505,5378506,6265292,6265293,6265296]);var imageSets=new Object();imageSets[234221]="6265296,6265293,6265292,5378506,5378505,5378504,5378503,5378502,5378501,5378500,5378499,5377461,5377445,5377442,5377441,5377438,5377436,5377431,5377403,5377400,5377397,5377393,5377370,5377368";imageSets[1]="5493548,5378518";imageSets[2]="5413751,5413732,5413705,5413704,5378518,5378500";imageSets[3]="5413735";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/tloekke/images";break}switch(a){case 1:b="http://www1.clikpic.com/tloekke/images";break}switch(a){case 2:b="http://admin.clikpic.com/tloekke/images";break}switch(a){case 24:b="http://tpc15/clikpic/tloekke/images";break}switch(a){case 4:b="http://www.clikchurch.com/tloekke/images";break}switch(a){case 5:b="http://www2.clikpic.com/tloekke/images";break}switch(a){case 22:b="http://tpc5/clikpic/tloekke/images";break}switch(a){case 23:b="http://tpc10/clikpic/tloekke/images";break}switch(a){case 25:b="http://tpc16/clikpic/tloekke/images";break}switch(a){case 15:b="http://www3.clikpic.com/tloekke/images";break}switch(a){case 18:b="http://www4.clikpic.com/tloekke/images";break}switch(a){case 19:b="http://www5.clikpic.com/tloekke/images";break}switch(a){case 31:b="http://www7.clikpic.com/tloekke/images";break}switch(a){case 32:b="http://admin2.clikpic.com/tloekke/images";break}switch(a){case 33:b="http://www8.clikpic.com/tloekke/images";break}switch(a){case 34:b="http://www9.clikpic.com/tloekke/images";break}switch(a){case 35:b="http://admin3.clikpic.com/tloekke/images";break}switch(a){case 37:b="http://admin4.clikpic.com/tloekke/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="THL-FOTO.DK: "+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>Thorkild Løkke </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(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+'")'})}}};