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[717340]=new thumbnail(717340,"55177","Ardbeg Distillery - Islay","Ardbeg_distillery_thumb.jpg.jpg",130,191,15);thumbnails[713134]=new thumbnail(713134,"54824",'"Storm Clouds Over Carra".',"_MG_1642-01 bwcopy copy_thumb.jpg",130,181,15);thumbnails[108289]=new thumbnail(108289,"54813","Cloud Reflections beyond the surf - Dunnet Beach","Cloud_reflections_beyond_the_surf_Dunnet Beach_thumb.jpg",130,98,15);thumbnails[235387]=new thumbnail(235387,"","Groyne No.1 - Aberdeen beach.","_MG_groyne_no_thumb.1.jpg",130,81,15);thumbnails[717343]=new thumbnail(717343,"55177","Ardbeg Pier - Islay.","Ardbeg_pier_thumb.jpg.jpg",130,188,15);thumbnails[713139]=new thumbnail(713139,"54824",'"Rockpool" - Study #1',"_MG_1658-01 bwcopy copy_thumb.jpg",130,192,15);thumbnails[108298]=new thumbnail(108298,"54813","Downpour - Dunnet Beach","Downpour_Dunnet_Beach_thumb.jpg",130,98,15);thumbnails[719341]=new thumbnail(719341,"55177","Craighouse Pier #1.","Craighouse_pier_no1_thumb.jpg.jpg",130,90,15);thumbnails[108299]=new thumbnail(108299,"54813","Flagstone Fence - Castletown.","Flagstone_fences_Castletown_thumb.jpg",130,87,15);thumbnails[108309]=new thumbnail(108309,"54813","Lone Tree and 5 Rocks - Glen Loth","Lone_tree_and_5_rocks _Glen_Loth_thumb.jpg",130,98,15);thumbnails[235416]=new thumbnail(235416,"","Groyne No.3 - Aberdeen Beach.","_MG_groyne_no_thumb.3.jpg",130,91,15);thumbnails[719346]=new thumbnail(719346,"55177","Craighouse Pier #2","Craighouse_ Pier_no2_thumb.jpg.jpg",130,189,15);thumbnails[108300]=new thumbnail(108300,"54813","The Clett Rocks - Brough","The_Clett_rocks_Dunnet_Head_thumb.jpg",130,98,15);thumbnails[108312]=new thumbnail(108312,"54813","Snow Fence - Kinbrace","Snow_fence_Kinbrace_thumb.jpg",130,98,15);thumbnails[719348]=new thumbnail(719348,"55177","Craighouse Pier #3","Craighouse_pier_no3_thumb.jpg.jpg",130,194,15);thumbnails[108306]=new thumbnail(108306,"54813","Tides Out - Dunnet Beach","Tide_ out_Dunnet_Beach_thumb.jpg",130,98,15);thumbnails[108304]=new thumbnail(108304,"54813","Cracked, But The Rocks Remain","Cracked_but_the_rocks_remain_Dunnet Head_thumb.jpg",130,173,15);thumbnails[108307]=new thumbnail(108307,"54813","2 Stabs and a Dark Cloud - Kinbrace","2_stabs_and_a_dark_cloud_Kinbrace_thumb.jpg",130,173,15);thumbnails[108308]=new thumbnail(108308,"54813","Breaking The Surface Tension - Loch Crocach","Breaking_the_surface_tension_Loch_Crocach_thumb.jpg",130,173,15);thumbnails[108313]=new thumbnail(108313,"54813","Lone Tree and Dead Bracken - Glen Loth","Dead_bracken_and_tree_Glen_Loth_thumb.jpg",130,173,15);thumbnails[166616]=new thumbnail(166616,"","","proaward_thumb.gif",130,47,15);thumbnails[198856]=new thumbnail(198856,"","","_MG_0924-01 ecopy_thumb.jpg",130,93,15);thumbnails[229219]=new thumbnail(229219,"","Canon 5D Digital SLR","Canon 5D frontview-001_thumb.jpg",130,98,15);thumbnails[564780]=new thumbnail(564780,"43518",'"Beacon" - Pocra Quay, Aberdeen Harbour',"_MG_Beacon_Pocra_Quay copy_thumb.jpg",130,198,15);thumbnails[719997]=new thumbnail(719997,"55389","Old Man O Muchalls","Old Man O Muchalls_thumb.jpg",130,206,15);thumbnails[1714182]=new thumbnail(1714182,"115217",'"WHIRLPOOL" - Berriedale',"_MG_Whirlpool_BerriedaleXco_thumb.jpg",130,89,15);thumbnails[1714205]=new thumbnail(1714205,"55389",'"DUNNOTTAR CASTLE" - Stonehaven',"_MG_dunnottar_castle_thumb.jpg",130,89,15);thumbnails[564787]=new thumbnail(564787,"43518",'"Impact" - Cruden Bay',"_MG_Impact_Cruden_Bay copy_thumb.jpg",130,202,15);thumbnails[1714192]=new thumbnail(1714192,"115217",'"BIG SEA" - Berriedale',"_MG_bigsea_thumb.jpg",130,85,15);thumbnails[564792]=new thumbnail(564792,"43518",'"Squall" - Catterline Bay',"_MG_Squall copy_thumb.jpg",130,198,15);thumbnails[1714193]=new thumbnail(1714193,"115217",'"CLIFF STUDY #1" -  Berriedale',"_MG_cliffstudy_no1_thumb.jpg",130,195,15);thumbnails[1714207]=new thumbnail(1714207,"55389",'"Potarch Bridge" - The River Dee',"_MG_potarch_bridge_thumb.jpg",130,89,15);thumbnails[564791]=new thumbnail(564791,"43518",'"Seapool" - Aberdeen Beach',"_MG_Seapool copy_thumb.jpg",130,188,15);thumbnails[1714194]=new thumbnail(1714194,"115217",'"WHIRLPOOL #2" - Berriedale',"_MG_whirlpool_no2_thumb.jpg",130,189,15);thumbnails[565516]=new thumbnail(565516,"43518",'"Jetsam" - St Cyrus',"_MG_Jetsam_copy_thumb.jpg",130,211,15);thumbnails[564810]=new thumbnail(564810,"43518",'"Stacks" - Cruden Bay',"_MG_Stacks copy_thumb.jpg",130,199,15);thumbnails[564965]=new thumbnail(564965,"43518",'"Lighthouse" - Todhead, Kinneff',"_MG_Todhead_lighthouse copy_thumb.jpg",130,195,15);thumbnails[565001]=new thumbnail(565001,"43518",'"Tidecatcher" - Catterline Bay',"_MG_Tidecatcher_thumb.jpg",130,193,15);thumbnails[235412]=new thumbnail(235412,"43518","Groyne No.2 - Aberdeen Beach.","_MG_groyne_no_thumb1.2.jpg",130,187,15);thumbnails[108260]=new thumbnail(108260,"43518"," Perfect Dune? - Newburgh","The_perfect_dune_Newburgh_thumb.jpg",130,168,15);thumbnails[149518]=new thumbnail(149518,"43518","Flotsam on Balmedie Beach","_MG_0636-01 bw2ecopyx_thumb.jpg",130,192,15);thumbnails[565426]=new thumbnail(565426,"43518",'"Windswept" - Balmedie',"_MG_Windswept-Balmedie-copy_thumb.jpg",130,195,15);thumbnails[565513]=new thumbnail(565513,"43518",'"Stranded" - St Cyrus',"Stranded-copy_thumb.jpg",130,211,15);thumbnails[564790]=new thumbnail(564790,"43518",'"Reef" - Cruden Bay',"_MG_Reef copy_thumb.jpg",130,177,15);thumbnails[565528]=new thumbnail(565528,"43518",'"Groyne #4" - Aberdeen beach',"_MG_Groyne_copy_thumb.jpg",130,211,15);thumbnails[108302]=new thumbnail(108302,"10152","Hawthorn and Drystone Dyke - Hastigrow","Hawthorn_and_drystone_dyke_Caithness_thumb.jpg",130,195,15);thumbnails[112383]=new thumbnail(112383,"10152","Wind Blown Hawthorn - Hastigrow","Wind_Blown_Hawthorn_Caithness_thumb.jpg",130,87,15);thumbnails[3309275]=new thumbnail(3309275,"201674",'"Uprooted" - study #1.',"_MG_5421-01bwecopy_thumb.jpg",130,89,15);thumbnails[953112]=new thumbnail(953112,"71998","Vik study #1","_MG_4182-01bwwebcopy_thumb.jpg",130,193,15);thumbnails[953129]=new thumbnail(953129,"71998","Vik study #2","_MG_4183-01bwwebcopy_thumb.jpg",130,89,15);thumbnails[953132]=new thumbnail(953132,"71998","Vik study #3","_MG_4211-01bwwebcopy_thumb.jpg",130,86,15);thumbnails[953143]=new thumbnail(953143,"71998","Dyrrhoaley study #1","_MG_4243-02bwwebcopy_thumb.jpg",130,84,15);thumbnails[953145]=new thumbnail(953145,"71998","Dyrrhoaley study #2","_MG_4260-01bwwebcopy_thumb.jpg",130,78,15);thumbnails[953167]=new thumbnail(953167,"71999",'"Mud cracks" - Deadvlei',"_MG_3482-01colourwebcopy_thumb.jpg",130,195,15);thumbnails[1714138]=new thumbnail(1714138,"71999",'"PETRIFIED" - Deadvlei',"_MG_Petrified_Deadvlei-copy_thumb.jpg",130,80,15);thumbnails[108222]=new thumbnail(108222,"10153","Deserted beach - South Uist","Deserted_Beach_South_Uist_thumb.jpg",130,195,15);thumbnails[1714137]=new thumbnail(1714137,"71999",'"TORTURED" - Deadvlei.',"_MG_Tortured_Deadvlei-copy_thumb.jpg",130,211,15);thumbnails[108225]=new thumbnail(108225,"10153","Through The Clouds - Benbecula","Through_the_Clouds_Benbecula_thumb.jpg",130,195,15);thumbnails[108226]=new thumbnail(108226,"10153","Seaweed - North Uist","Seaweed_ North_Uist copy_thumb.jpg",130,195,15);thumbnails[1714142]=new thumbnail(1714142,"71999",'"MUDCRACKS" Deadvlei',"_MG_Mudcracks_Deadvlei-copy_thumb.jpg",130,211,15);thumbnails[108237]=new thumbnail(108237,"10153","Looking Towards Berneray - North Uist","Looking_Towards_Berneray_thumb.jpg",130,87,15);thumbnails[1714150]=new thumbnail(1714150,"71999",'"TREE SHADOW" - Deadvlei',"_MG_3524-01bwcopy-copy_thumb.jpg",130,96,15);thumbnails[108238]=new thumbnail(108238,"10153","In The Surf - Benbecula","In_The_Surf_Benbecula_thumb.jpg",130,195,15);thumbnails[1714154]=new thumbnail(1714154,"71999",'"CANYON" - Deadvlei',"_MG_3533-01bwcopy-copy_thumb.jpg",130,87,15);thumbnails[111262]=new thumbnail(111262,"10153","Blackhouse no.1 - North Uist","Blackhouse no_thumb.1 North Uist.jpg",130,195,15);thumbnails[717422]=new thumbnail(717422,"55190","Ripcurl.","_MG_Ripcurl_thumb.jpg",130,186,15);thumbnails[717427]=new thumbnail(717427,"55190","Whitehorses #1","_MG_Whitehorses_no1_thumb.jpg.jpg",130,198,15);thumbnails[717431]=new thumbnail(717431,"55190","Whitehorses #2","_MG_Whitehorses_no2_thumb.jpg.jpg",130,188,15);thumbnails[108267]=new thumbnail(108267,"10155","Shifting Sands - Newburgh","Shifting_Sands_Newburgh_thumb.jpg",130,168,15);thumbnails[108269]=new thumbnail(108269,"10155","Towards Strachan In The Snow - Scolty Hill ","Snow_on_Scolty_Hill1_thumb.jpg",130,87,15);thumbnails[108270]=new thumbnail(108270,"10155","Between a Rock and a Hard Place - Scolty Hill ","Between_a_rock_and_a_hard_place_no_thumb.2_Scolty_Hill.jpg",130,195,15);thumbnails[108271]=new thumbnail(108271,"10155","Lone Pine and Rushes - Scolty Hill","Lone_pine_and_rushes_Scolty_Hill_thumb.jpg",130,195,15);thumbnails[190904]=new thumbnail(190904,"10155","Between a Rock and a Cold Place","_MG_0979-01 bwe2copy_thumb.jpg",130,188,15);thumbnails[108255]=new thumbnail(108255,"10156","Sun Breaks Through The Clouds - Loch Nan Eilean ","Sun_breaks_through_the_clouds_Aviemore_thumb.jpg",130,195,15);thumbnails[108247]=new thumbnail(108247,"10156","3 Dead Trees - Loch Garten","3_dead_trees_Loch_Garten_thumb.jpg",130,168,15);thumbnails[108251]=new thumbnail(108251,"10156","Ripples - Loch Garten","Ripple_in_Loch_Garten_thumb.jpg",130,170,15);thumbnails[108246]=new thumbnail(108246,"10156","The Lily Loch After The Rain - Loch Nan Eilean ","The_lily_loch_after_the_rain_Aviemore_thumb.jpg",130,100,15);thumbnails[108258]=new thumbnail(108258,"10156","3 Rocks - Loch Garten","3_rocks_Loch_Garten_thumb.jpg",130,100,15);thumbnails[174225]=new thumbnail(174225,"10156","Fallen Tree - Loch Garten.","_MG_0826-01 bwecopy_thumb.jpg",130,193,15);thumbnails[108316]=new thumbnail(108316,"10167","Waterfall - Talisker Bay","Waterfall_Talisker_bay_thumb.jpg",130,195,15);thumbnails[108317]=new thumbnail(108317,"10167","The Quirang Pinnacles - Trotternish","The_Quirang_pinnacles_thumb.jpg",130,173,15);thumbnails[108319]=new thumbnail(108319,"10167","Skye Rocks - Trotternish","Skye_rocks_The_old_man_of_Storr_thumb.jpg",130,195,15);thumbnails[108320]=new thumbnail(108320,"10167","Rocky shore - Talisker Bay","Rocky_shore_Talisker_bay_thumb.jpg",130,195,15);thumbnails[108321]=new thumbnail(108321,"10167","Atlantic Swell - Talisker Bay","Atlantic_swell-Talisker_bay_thumb.jpg",130,87,15);var galleries=new Object();galleries[54813]=new gallery(54813,"108304",'"The Rocks Remain" Exhibition',"gallery",[108289,108298,108299,108309,108300,108312,108306,108304,108307,108308,108313]);galleries[54824]=new gallery(54824,"713139","Gigha","gallery",[713134,713139]);galleries[55177]=new gallery(55177,"719348,717343,717340","Islay and Jura","gallery",[717340,717343,719341,719346,719348]);galleries[43518]=new gallery(43518,"565001,564792,149518",'"Coast" Exhibition.',"gallery",[564780,564787,564792,564791,565516,564810,564965,565001,235412,108260,149518,565426,565513,564790,565528]);galleries[55387]=new gallery(55387,"1714207,1714205,1714194,1714182,1714142,1714138,953145,953143,953132,953129,953112,719997","2007 Archive","gallery",[]);galleries[55389]=new gallery(55389,"1714207,1714205,719997","Aberdeen coast and stream","gallery",[719997,1714205,1714207]);galleries[115217]=new gallery(115217,"1714194,1714182","Berriedale","gallery",[1714182,1714192,1714193,1714194]);galleries[10152]=new gallery(10152,"108302","Caithness","gallery",[108302,112383]);galleries[54223]=new gallery(54223,"719348,717431,717427,717422,717343,717340,713139,565001,564792,149518"," 2006 Archive","gallery",[]);galleries[201672]=new gallery(201672,"3309275","2008 Archive","gallery",[]);galleries[71998]=new gallery(71998,"953145,953143,953132,953129,953112","Iceland","gallery",[953112,953129,953132,953143,953145]);galleries[201674]=new gallery(201674,"3309275","Tentsmuir Beach","gallery",[3309275]);galleries[54167]=new gallery(54167,"190904,174225,108304,108302,108271,108267,108255,108247,108226,108222","2005 Archive","gallery",[]);galleries[71999]=new gallery(71999,"1714142,1714138","Namibia","gallery",[953167,1714138,1714137,1714142,1714150,1714154]);galleries[10153]=new gallery(10153,"108226,108222","Outer Hebrides","gallery",[108222,108225,108226,108237,108238,111262]);galleries[55190]=new gallery(55190,"717431,717427,717422","Aberdeen Beach","gallery",[717422,717427,717431]);galleries[10155]=new gallery(10155,"190904,108271,108267","Aberdeenshire","gallery",[108267,108269,108270,108271,190904]);galleries[10156]=new gallery(10156,"174225,108255,108247","Speyside","gallery",[108255,108247,108251,108246,108258,174225]);galleries[10167]=new gallery(10167,"108321,108320,108319,108317,108316","Skye","gallery",[108316,108317,108319,108320,108321]);var imageSets=new Object();imageSets[1]="3309275,1714207,1714205,1714194,1714182,1714142,1714138,953145,953143,953132,953129,713139,565513,565001,564965,564810,564792,564791,564790,564787,564780,235412,190904,174225,149518,108316,108312,108309,108302,108299,108298,108289,108270,108269,108267,108260,108258,108255,108251,108247,108246,108238,108237,108226,108222";imageSets[2]="3309275,1714207,1714205,1714194,1714182,1714142,1714138,953145,953143,953132,953129,953112,719997,719348,717431,717427,717422,717343,717340,713139,565001,564792,190904,174225,149518,108304,108302,108271,108267,108255,108247,108226,108222";imageSets[3]="3309275,1714207,1714205,1714194,1714193,1714192,1714182,1714154,1714150,1714142,1714138,1714137,953167,953145,953143,953132,953129,953112,719997,719348,719346,719341,717431,717427,717422,717343,717340,713139,713134,565528,565516,565513,565426,565001,564965,564810,564792,564791,564790,564787,564780,235416,235412,235387,229219,198856,190904,174225,166616,149518";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 34:b="http://www9.clikpic.com/sandym/images";break}switch(a){case 1:b="http://www1.clikpic.com/sandym/images";break}switch(a){case 2:b="http://admin.clikpic.com/sandym/images";break}switch(a){case 4:b="http://www.clikchurch.com/sandym/images";break}switch(a){case 5:b="http://www2.clikpic.com/sandym/images";break}switch(a){case 15:b="http://www3.clikpic.com/sandym/images";break}switch(a){case 21:b="http://www6.clikpic.com/sandym/images";break}switch(a){case 18:b="http://www4.clikpic.com/sandym/images";break}switch(a){case 19:b="http://www5.clikpic.com/sandym/images";break}switch(a){case 22:b="http://tpc5/clikpic/sandym/images";break}switch(a){case 23:b="http://tpc10/clikpic/sandym/images";break}switch(a){case 24:b="http://tpc15/clikpic/sandym/images";break}switch(a){case 25:b="http://tpc16/clikpic/sandym/images";break}switch(a){case 31:b="http://www7.clikpic.com/sandym/images";break}switch(a){case 32:b="http://admin2.clikpic.com/sandym/images";break}switch(a){case 33:b="http://www8.clikpic.com/sandym/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="Sandy Menzies Landscape 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+"</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+'")'})}}};