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[5434970]=new thumbnail(5434970,"","The photographer at work.","photographer_thumb.jpg",130,184,18);thumbnails[4363942]=new thumbnail(4363942,"258450","Beachstand","beachstand_wm_thumb.jpg",130,125,18);thumbnails[4363906]=new thumbnail(4363906,"258450","Prayer Flags, SW China","prayerflags_wm_thumb.jpg",130,87,18);thumbnails[4504408]=new thumbnail(4504408,"258450","Water","water_wm_thumb.jpg",130,182,18);thumbnails[4528771]=new thumbnail(4528771,"258450","Cloth","Cloth_wm_thumb.jpg",130,83,18);thumbnails[4529530]=new thumbnail(4529530,"258450","Sea stones","Stones_watercolour_wm_thumb.jpg",130,87,18);thumbnails[4566100]=new thumbnail(4566100,"258450","Red Chillies","Chillies_Puglia_wm_thumb.jpg",130,88,18);thumbnails[4566160]=new thumbnail(4566160,"258450","Stuck in a storm","downed_helo_wm_thumb.jpg",130,86,18);thumbnails[4566175]=new thumbnail(4566175,"258450","Trio","puglia_roofs_wm_thumb.jpg",130,196,18);thumbnails[4707676]=new thumbnail(4707676,"258450","The EICC at night","EICC_edinburgh_wm_thumb.jpg",130,90,18);thumbnails[4707691]=new thumbnail(4707691,"258450","The EICC","festival_wm_thumb.jpg",130,196,18);thumbnails[4756786]=new thumbnail(4756786,"258450","Gentian group","Gentian_cluster_wm12_thumb.jpg",130,171,18);thumbnails[4969196]=new thumbnail(4969196,"258450","Seaweed","seaweed_wm_thumb.jpg",130,95,18);thumbnails[4969319]=new thumbnail(4969319,"258450","All that is left is faith","bible_wm_thumb.jpg",130,88,18);thumbnails[4969514]=new thumbnail(4969514,"258450","Departed","departed_thumb.jpg",130,196,18);thumbnails[4969642]=new thumbnail(4969642,"258450","Blue door","door_lock_wm_thumb.jpg",130,186,18);thumbnails[4969645]=new thumbnail(4969645,"258450","Highland Cow","Highland_cow_wm_thumb.jpg",130,188,18);thumbnails[5079933]=new thumbnail(5079933,"258450","Red Rose","red_rose1_thumb.jpg",130,124,18);thumbnails[5270801]=new thumbnail(5270801,"258450","Frost","Frost_thumb.jpg",130,182,18);thumbnails[5423267]=new thumbnail(5423267,"258450","Ice stream","ice_stream_thumb.jpg",130,93,18);thumbnails[5423297]=new thumbnail(5423297,"258450","Lodge pole","trees_thumb.jpg",130,182,18);thumbnails[4363989]=new thumbnail(4363989,"258453","Planning","Boys_wm_thumb.jpg",130,181,18);thumbnails[4406885]=new thumbnail(4406885,"258453","Space","lagganat_wm_thumb.jpg",130,93,18);thumbnails[4406893]=new thumbnail(4406893,"258453","Single track","lagganat2_wm_thumb.jpg",130,182,18);thumbnails[4411532]=new thumbnail(4411532,"258453","Market day","oldwomendali_wm_thumb.jpg",130,194,18);thumbnails[4411618]=new thumbnail(4411618,"258453","In from the fields","tractorlijiang_wm_thumb.jpg",130,93,18);thumbnails[4411620]=new thumbnail(4411620,"258453","Traditional dress","traditionaldresskunming_wm_thumb.jpg",130,194,18);thumbnails[4411642]=new thumbnail(4411642,"258453","The Bride","WeddingportraitAG_wm_thumb.jpg",130,182,18);thumbnails[4411685]=new thumbnail(4411685,"258453","Old and young","womenwithboylijiang_wm_thumb.jpg",130,87,18);thumbnails[4504298]=new thumbnail(4504298,"258453","A face in the crowd","a_face_in_the_crowd_wm_thumb.jpg",130,93,18);thumbnails[4504333]=new thumbnail(4504333,"258453","Cutting firewood","chopping_wood_wm_thumb.jpg",130,93,18);thumbnails[4504338]=new thumbnail(4504338,"258453","Happy clapping","Clapping_girl_wm_thumb.jpg",130,182,18);thumbnails[4504365]=new thumbnail(4504365,"258453","Fisher Girls","fishing_girls_wm_thumb.jpg",130,87,18);thumbnails[4504407]=new thumbnail(4504407,"258453","The Piroguieurs","three_dug_outs_wm_thumb.jpg",130,63,18);thumbnails[4504414]=new thumbnail(4504414,"258453","In the shade","Women_under_umbrellas_wm_thumb.jpg",130,93,18);thumbnails[4529037]=new thumbnail(4529037,"258453","Girl in the ring","Dancing_girl_wm_thumb.jpg",130,194,18);thumbnails[4529101]=new thumbnail(4529101,"258453","The throw","Fishing_net_wm_thumb.jpg",130,93,18);thumbnails[4707683]=new thumbnail(4707683,"258453","Eyes","eyes_wm1_thumb.jpg",130,97,18);thumbnails[4707703]=new thumbnail(4707703,"258453","Grabbit","fringe_tout_wm_thumb.jpg",130,121,18);thumbnails[4969168]=new thumbnail(4969168,"258453","The Pearly Queen","pearly_queen_wm_thumb.jpg",130,201,18);thumbnails[4363962]=new thumbnail(4363962,"256329","Blue Footed Boobie","BlueFootedBoobies_wm_thumb.jpg",130,196,18);thumbnails[4363973]=new thumbnail(4363973,"256329","Blue Footed Boobies","BlueFootedBoobiespair_wm_thumb.jpg",130,90,18);thumbnails[4364042]=new thumbnail(4364042,"256329","Lime butterfly, South West China","butterflydali_wm_thumb.jpg",130,87,18);thumbnails[4406759]=new thumbnail(4406759,"256329","Red Grouse","Grouse2_wm_thumb.jpg",130,93,18);thumbnails[4406761]=new thumbnail(4406761,"256329","Orangutan","Juvenileorungutanborneo_wm_thumb.jpg",130,182,18);thumbnails[4411536]=new thumbnail(4411536,"256329","Orangutan","orangutanborneo_wm_thumb.jpg",130,196,18);thumbnails[4411541]=new thumbnail(4411541,"256329","Ptarmigan, summer plumage","Ptarmigan_wm_thumb.jpg",130,93,18);thumbnails[4411543]=new thumbnail(4411543,"256329","Puffin, Head and beak","puffinhead_wm_thumb.jpg",130,87,18);thumbnails[4411545]=new thumbnail(4411545,"256329","Puffin, Head and shoulders","puffinheadshoulders_wm_thumb.jpg",130,93,18);thumbnails[4411546]=new thumbnail(4411546,"256329","Puffin, Portrait","puffinstanding_wm_thumb.jpg",130,194,18);thumbnails[4411558]=new thumbnail(4411558,"256329","Coming in to land","sandpiperslanding_wm_thumb.jpg",130,47,18);thumbnails[4411562]=new thumbnail(4411562,"256329","Snipe","Snipe_wm_thumb.jpg",130,87,18);thumbnails[4411623]=new thumbnail(4411623,"256329","Tree frog","treefrogborneo_wm_thumb.jpg",130,93,18);thumbnails[4504312]=new thumbnail(4504312,"256329","Humblot's Heron Ardea humbloti","Black_Heron_wm_thumb.jpg",130,93,18);thumbnails[4504357]=new thumbnail(4504357,"256329","Yellow billed Kite","Fish_eagle_wm1_thumb.jpg",130,93,18);thumbnails[4504385]=new thumbnail(4504385,"256329","Sifaka","Sifaka_Lemur_wm_thumb.jpg",130,182,18);thumbnails[4529256]=new thumbnail(4529256,"256329","Mouse Lemur","Mouse_Lemur_wm_thumb.jpg",130,182,18);thumbnails[4566187]=new thumbnail(4566187,"256329","Snow Monkey","snow_monkey_wm_thumb.jpg",130,87,18);thumbnails[4566194]=new thumbnail(4566194,"256329","Snowy Owl","Snowy_owl_wm_thumb.jpg",130,194,18);thumbnails[4805750]=new thumbnail(4805750,"256329","Yellow Billed Kite, Milvus aegyptius","Kite_yellow_billed_wm_thumb.jpg",130,93,18);thumbnails[4969657]=new thumbnail(4969657,"256329","Highland cow and calf","cow_and_calf_bw_wm_thumb.jpg",130,96,18);thumbnails[5270811]=new thumbnail(5270811,"256329","Hare running","Hare_running_thumb.jpg",130,93,18);thumbnails[5270815]=new thumbnail(5270815,"256329","Mountain hare","Mountain_Hare_thumb.jpg",130,93,18);thumbnails[5423271]=new thumbnail(5423271,"256329","Mule Deer","Mule_deer_thumb.jpg",130,93,18);thumbnails[4363927]=new thumbnail(4363927,"256330","Sundown Baobabs, Madagascar","Baobabs_wm_thumb.jpg",130,87,18);thumbnails[4406931]=new thumbnail(4406931,"256330","Place of rest","Mcleodschurchlscape_wm_thumb.jpg",130,93,18);thumbnails[4411626]=new thumbnail(4411626,"256330","Misty Isle","Ullapool_wm_thumb.jpg",130,64,18);thumbnails[4411640]=new thumbnail(4411640,"256330","The Highlands","Viewfromanteallach_wm_thumb.jpg",130,173,18);thumbnails[4504307]=new thumbnail(4504307,"256330","A place in the shade","a_place_in_the_shade_wm_thumb.jpg",130,182,18);thumbnails[4504353]=new thumbnail(4504353,"256330","The ruins","Findlatter_castle_wm_thumb.jpg",130,182,18);thumbnails[4504371]=new thumbnail(4504371,"256330","Mangroves","Mangroves_wm_thumb.jpg",130,194,18);thumbnails[4504378]=new thumbnail(4504378,"256330","Pure Sunset","pure_sunset_wm_thumb.jpg",130,70,18);thumbnails[4504381]=new thumbnail(4504381,"256330","The Manambolo","river_view_wm_thumb.jpg",130,67,18);thumbnails[4529093]=new thumbnail(4529093,"256330","Dhow","dhow_wm_thumb.jpg",130,93,18);thumbnails[4529230]=new thumbnail(4529230,"256330","Loch Laggan","Laggan_East_wm_thumb.jpg",130,71,18);thumbnails[4529354]=new thumbnail(4529354,"256330","Sailing Dhow","Sailing_dhow_wm_thumb.jpg",130,87,18);thumbnails[4969150]=new thumbnail(4969150,"256330","Bow Fiddle rock","bow_bandw_wm_thumb.jpg",130,80,18);thumbnails[4969158]=new thumbnail(4969158,"256330","Bow Fiddle rock","Bow_fiddle_wm_thumb.jpg",130,191,18);thumbnails[4969178]=new thumbnail(4969178,"256330","Autumn trees","pityoulish_lscape_wm_thumb.jpg",130,88,18);thumbnails[4969180]=new thumbnail(4969180,"256330","Lone tree","pityoulish_trees_lscape_wm_thumb.jpg",130,65,18);thumbnails[4969186]=new thumbnail(4969186,"256330","Early morning mist","pityoulish_wm_thumb.jpg",130,86,18);thumbnails[4969344]=new thumbnail(4969344,"256330","Calanais standing stones, site 2","Callanais_2_wm_thumb.jpg",130,83,18);thumbnails[4969347]=new thumbnail(4969347,"256330","Calanais","Callanais_wm_thumb.jpg",130,87,18);thumbnails[4969653]=new thumbnail(4969653,"256330","Luskentyre Beach","Luskentyre_beach_wm_thumb.jpg",130,60,18);thumbnails[5270799]=new thumbnail(5270799,"256330","Bostadh Bay","Bostadh_thumb.jpg",130,74,18);thumbnails[5270800]=new thumbnail(5270800,"256330","Bostadh Bay","Bostadh2_thumb.jpg",130,70,18);thumbnails[5270803]=new thumbnail(5270803,"256330","Green Field","Green_field_thumb.jpg",130,67,18);thumbnails[5270818]=new thumbnail(5270818,"256330","Valasay peninsular","Valasy_peninsular_thumb.jpg",130,71,18);thumbnails[5423274]=new thumbnail(5423274,"256330","Spring river","Spring_river_thumb.jpg",130,74,18);thumbnails[6390039]=new thumbnail(6390039,"266393","Gannet","ganet_thumb.jpg",130,93,18);thumbnails[6346870]=new thumbnail(6346870,"266393","Red Grouse and chick","grouse_and_chick_thumb.jpg",130,93,18);thumbnails[6346896]=new thumbnail(6346896,"266393","Bog Cotton","bog_cotton1_thumb.jpg",130,70,18);thumbnails[6346914]=new thumbnail(6346914,"266393","Puffin on cliff","puffin_and_sea_thumb.jpg",130,93,18);thumbnails[6346923]=new thumbnail(6346923,"266393","Puffin stretch","puffin_flapping_thumb.jpg",130,93,18);thumbnails[6346942]=new thumbnail(6346942,"266393","Skua attack","skua_attack_thumb.jpg",130,112,18);thumbnails[6346954]=new thumbnail(6346954,"266393","Arctic Skua","skua_landing_thumb.jpg",130,93,18);thumbnails[6347008]=new thumbnail(6347008,"266393","Kylesku","Kinlochewe_thumb.jpg",130,76,18);thumbnails[6347015]=new thumbnail(6347015,"266393","Scourie sunset","scourie_sunset_thumb.jpg",130,63,18);thumbnails[6346990]=new thumbnail(6346990,"266393","Whisky barrels","whisky_barrels_thumb.jpg",130,87,18);thumbnails[6346976]=new thumbnail(6346976,"266393","Ringed Plover","Ringed_plover_thumb.jpg",130,93,18);var galleries=new Object();galleries[258450]=new gallery(258450,"5423297,5423267,5270801,5079933,4969645,4969642,4969514,4969319,4969196,4756786","Abstract","gallery",[4363942,4363906,4504408,4528771,4529530,4566100,4566160,4566175,4707676,4707691,4756786,4969196,4969319,4969514,4969642,4969645,5079933,5270801,5423267,5423297]);galleries[258453]=new gallery(258453,"4969168,4707703,4707683,4529101,4529037,4504414,4504407,4504365,4504338,4504333","People","gallery",[4363989,4406885,4406893,4411532,4411618,4411620,4411642,4411685,4504298,4504333,4504338,4504365,4504407,4504414,4529037,4529101,4707683,4707703,4969168]);galleries[256329]=new gallery(256329,"5423271,5270815,5270811,4969657,4805750,4566194,4566187,4529256,4504385,4504357","Wildlife","gallery",[4363962,4363973,4364042,4406759,4406761,4411536,4411541,4411543,4411545,4411546,4411558,4411562,4411623,4504312,4504357,4504385,4529256,4566187,4566194,4805750,4969657,5270811,5270815,5423271]);galleries[256330]=new gallery(256330,"5423274,5270818,5270803,5270800,5270799,4969653,4969347,4969344,4969186,4969180","Landscapes","gallery",[4363927,4406931,4411626,4411640,4504307,4504353,4504371,4504378,4504381,4529093,4529230,4529354,4969150,4969158,4969178,4969180,4969186,4969344,4969347,4969653,5270799,5270800,5270803,5270818,5423274]);galleries[266393]=new gallery(266393,"6390039,6347015,6347008,6346990,6346976,6346954,6346942,6346923,6346914,6346896","New images","gallery",[6390039,6346870,6346896,6346914,6346923,6346942,6346954,6347008,6347015,6346990,6346976]);var imageSets=new Object();imageSets[231665]="6346990,6346896,5270801,5079933,4969642,4969196,4756786,4707703,4707691,4707676,4566175,4566160,4566100,4529530,4528771,4504408,4411626,4363942";imageSets[1]="6346990";imageSets[231651]="6347015,6347008,5423297,5423274,5423267,5270818,5270803,5270800,5270799,4969653,4969186,4969180,4969178,4969150,4805750,4707683,4707676,4566175,4566100,4529354,4529230,4529101,4529093,4529037,4528771,4504414,4504408,4504407,4504385,4504381,4504378,4504371,4504365,4504357,4504353,4504338,4504333,4504312,4504307,4504298,4411685,4411640,4411626,4411623,4411620,4411618,4411536,4411532,4406931,4406893,4406885,4406761,4364042,4363989,4363973,4363962,4363927,4363906";imageSets[3]="4969196,4969186,4969180,4969178,4969168,4969150";imageSets[231652]="4969514,4969168,4707703,4707683,4529101,4529037,4504414,4504407,4504365,4504338,4504333,4504298,4411685,4411642,4411620,4411618,4411532,4406893,4406885,4363989,4363942";imageSets[231666]="6346976,6346954,6346942,6346923,6346914,6346896,6346870,5423297,5423271,5270815,5270811,4969657,4969645,4969158,4805750,4756786,4566194,4566187,4529256,4504385,4504357,4504312,4411623,4411562,4411558,4411546,4411545,4411543,4411541,4411536,4406761,4406759,4364042,4363973,4363962";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/martinsearle/images";break}switch(a){case 1:b="http://www1.clikpic.com/martinsearle/images";break}switch(a){case 2:b="http://admin.clikpic.com/martinsearle/images";break}switch(a){case 24:b="http://tpc15/clikpic/martinsearle/images";break}switch(a){case 4:b="http://www.clikchurch.com/martinsearle/images";break}switch(a){case 5:b="http://www2.clikpic.com/martinsearle/images";break}switch(a){case 22:b="http://tpc5/clikpic/martinsearle/images";break}switch(a){case 23:b="http://tpc10/clikpic/martinsearle/images";break}switch(a){case 25:b="http://tpc16/clikpic/martinsearle/images";break}switch(a){case 15:b="http://www3.clikpic.com/martinsearle/images";break}switch(a){case 18:b="http://www4.clikpic.com/martinsearle/images";break}switch(a){case 19:b="http://www5.clikpic.com/martinsearle/images";break}switch(a){case 31:b="http://www7.clikpic.com/martinsearle/images";break}switch(a){case 32:b="http://admin2.clikpic.com/martinsearle/images";break}switch(a){case 33:b="http://www8.clikpic.com/martinsearle/images";break}switch(a){case 34:b="http://www9.clikpic.com/martinsearle/images";break}switch(a){case 35:b="http://admin3.clikpic.com/martinsearle/images";break}switch(a){case 37:b="http://admin4.clikpic.com/martinsearle/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="MTS Photography: "+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+'")'})}}};