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[1983991]=new thumbnail(1983991,"","","LimeTree_thumb.jpg",117,130,32);thumbnails[1984089]=new thumbnail(1984089,"","","DavidWilson_thumb.jpg",120,130,32);thumbnails[1996093]=new thumbnail(1996093,"133933","DWORG001","original1_thumb.jpg",130,87,32);thumbnails[1996094]=new thumbnail(1996094,"133933","DWORG002","original2_thumb.jpg",129,130,32);thumbnails[1996095]=new thumbnail(1996095,"133933","DWORG003","original3_thumb.jpg",130,89,32);thumbnails[2022795]=new thumbnail(2022795,"133933","DWORG004","original7_thumb.jpg",103,130,32);thumbnails[2022811]=new thumbnail(2022811,"133933","DWORG005","original9_thumb.jpg",130,85,32);thumbnails[2022827]=new thumbnail(2022827,"133933","DWORG006","original8_thumb.jpg",112,130,32);thumbnails[6626440]=new thumbnail(6626440,"133933","DWORG007","original5_thumb.jpg",112,130,32);thumbnails[1986826]=new thumbnail(1986826,"132441","DWBEA001","DWBEA001_thumb.jpg",130,96,32);thumbnails[1986919]=new thumbnail(1986919,"132441","DWBEA002","DWBEA002_thumb.jpg",130,86,32);thumbnails[1986922]=new thumbnail(1986922,"132441","DWBEA003","DWBEA003_thumb.jpg",130,99,32);thumbnails[1986934]=new thumbnail(1986934,"132441","DWBEA004","DWBEA004_thumb.jpg",130,102,32);thumbnails[1986936]=new thumbnail(1986936,"132441","DWBEA005","DWBEA005_thumb.jpg",130,129,32);thumbnails[1986938]=new thumbnail(1986938,"132441","DWBEA006","DWBEA006_thumb.jpg",130,84,32);thumbnails[1986940]=new thumbnail(1986940,"132441","DWBEA007","DWBEA007_thumb.jpg",130,92,32);thumbnails[1986943]=new thumbnail(1986943,"132441","DWBEA008","DWBEA008_thumb.jpg",130,108,32);thumbnails[1986947]=new thumbnail(1986947,"132441","DWBEA009","DWBEA009_thumb.jpg",91,130,32);thumbnails[1987027]=new thumbnail(1987027,"132774","DWBEN001","DWBEN001_thumb.jpg",130,96,32);thumbnails[1987052]=new thumbnail(1987052,"132774","DWBEN002","DWBEN002_thumb.jpg",130,89,32);thumbnails[1987056]=new thumbnail(1987056,"132774","DWBEN003","DWBEN003_thumb.jpg",130,86,32);thumbnails[1987058]=new thumbnail(1987058,"132774","DWBEN004","DWBEN004_thumb.jpg",130,96,32);thumbnails[1987059]=new thumbnail(1987059,"132774","DWBEN005","DWBEN005_thumb.jpg",130,109,32);thumbnails[1987060]=new thumbnail(1987060,"132774","DWBEN006","DWBEN006_thumb.jpg",130,90,32);thumbnails[1987062]=new thumbnail(1987062,"132774","DWBEN007","DWBEN007_thumb.jpg",130,122,32);thumbnails[1987063]=new thumbnail(1987063,"132774","DWBEN008","DWBEN008_thumb.jpg",130,81,32);thumbnails[1987067]=new thumbnail(1987067,"132774","DWBEN009","DWBEN0092_thumb.jpg",130,129,32);thumbnails[1995356]=new thumbnail(1995356,"132775","DWCLI001","DWCLI001_thumb.jpg",130,128,32);thumbnails[1995358]=new thumbnail(1995358,"132775","DWCLI002","DWCLI002_thumb.jpg",130,129,32);thumbnails[1995377]=new thumbnail(1995377,"132775","DWCLI003","DWCLI003_thumb.jpg",130,89,32);thumbnails[1995378]=new thumbnail(1995378,"132775","DWCLI004","DWCLI004_thumb.jpg",84,130,32);thumbnails[1995380]=new thumbnail(1995380,"132775","DWCLI005","DWCLI005_thumb.jpg",92,130,32);thumbnails[1995384]=new thumbnail(1995384,"132775","DWCLI006","DWCLI006_thumb.jpg",87,130,32);thumbnails[1995386]=new thumbnail(1995386,"132775","DWCLI007","DWCLI007_thumb.jpg",92,130,32);thumbnails[1995387]=new thumbnail(1995387,"132775","DWCLI008","DWCLI008_thumb.jpg",76,130,32);thumbnails[1995391]=new thumbnail(1995391,"132775","DWCLI009","DWCLI009_thumb.jpg",82,130,32);thumbnails[1995414]=new thumbnail(1995414,"132776","DWGLC001","DWGLC001_thumb.jpg",130,91,32);thumbnails[1995421]=new thumbnail(1995421,"132776","DWGLC002","DWGLC002_thumb.jpg",130,98,32);thumbnails[1995424]=new thumbnail(1995424,"132776","DWGLC003","DWGLC003_thumb.jpg",130,81,32);thumbnails[1995426]=new thumbnail(1995426,"132776","DWGLC004","DWGLC004_thumb.jpg",130,96,32);thumbnails[1995427]=new thumbnail(1995427,"132776","DWGLC005","DWGLC005_thumb.jpg",130,102,32);thumbnails[1995429]=new thumbnail(1995429,"132776","DWGLC006","DWGLC006_thumb.jpg",127,130,32);thumbnails[1995430]=new thumbnail(1995430,"132776","DWGLC007","DWGLC007_thumb.jpg",129,130,32);thumbnails[1995431]=new thumbnail(1995431,"132776","DWGLC008","DWGLC008_thumb.jpg",130,93,32);thumbnails[1995433]=new thumbnail(1995433,"132776","DWGLC009","DWGLC009_thumb.jpg",130,130,32);thumbnails[1995446]=new thumbnail(1995446,"133398","DWGLS001","DWGLS001_thumb.jpg",130,93,32);thumbnails[1995450]=new thumbnail(1995450,"133398","DWGLS002","DWGLS002_thumb.jpg",130,95,32);thumbnails[1995451]=new thumbnail(1995451,"133398","DWGLS003","DWGLS003_thumb.jpg",130,102,32);thumbnails[1995454]=new thumbnail(1995454,"133398","DWGLS004","DWGLS004_thumb.jpg",130,93,32);thumbnails[1995456]=new thumbnail(1995456,"133398","DWGLS005","DWGLS005_thumb.jpg",130,95,32);thumbnails[1995457]=new thumbnail(1995457,"133398","DWGLS006","DWGLS006_thumb.jpg",130,129,32);thumbnails[1995518]=new thumbnail(1995518,"133401","DWHOM001","DWHOM001_thumb.jpg",130,92,32);thumbnails[1995521]=new thumbnail(1995521,"133401","DWHOM002","DWHOM002_thumb.jpg",130,129,32);thumbnails[2003775]=new thumbnail(2003775,"133401","DWHOM004","DWHOM0041_thumb.jpg",130,96,32);thumbnails[2003776]=new thumbnail(2003776,"133401","DWHOM005","DWHOM005_thumb.jpg",130,128,32);thumbnails[2003778]=new thumbnail(2003778,"133401","DWHOM006","DWHOM006_thumb.jpg",130,95,32);thumbnails[2003779]=new thumbnail(2003779,"133401","DWHOM007","DWHOM007_thumb.jpg",127,130,32);thumbnails[1995535]=new thumbnail(1995535,"133402","DWLOH001","DWLOH001_thumb.jpg",130,94,32);thumbnails[1995536]=new thumbnail(1995536,"133402","DWLOH002","DWLOH002_thumb.jpg",130,83,32);thumbnails[1995537]=new thumbnail(1995537,"133402","DWLOH003","DWLOH003_thumb.jpg",130,91,32);thumbnails[1995538]=new thumbnail(1995538,"133402","DWLOH004","DWLOH004_thumb.jpg",130,119,32);thumbnails[1995539]=new thumbnail(1995539,"133402","DWLOH005","DWLOH005_thumb.jpg",129,130,32);thumbnails[1995540]=new thumbnail(1995540,"133402","DWLOH006","DWLOH006_thumb.jpg",130,96,32);thumbnails[1995541]=new thumbnail(1995541,"133402","DWLOH007","DWLOH007_thumb.jpg",130,129,32);thumbnails[1995543]=new thumbnail(1995543,"133402","DWLOH008","DWLOH008_thumb.jpg",130,95,32);thumbnails[1995544]=new thumbnail(1995544,"133402","DWLOH009","DWLOH009_thumb.jpg",130,96,32);thumbnails[1995545]=new thumbnail(1995545,"133402","DWLOH010","DWLOH010_thumb.jpg",130,129,32);thumbnails[1995546]=new thumbnail(1995546,"133402","DWLOH011","DWLOH011_thumb.jpg",130,99,32);thumbnails[1995548]=new thumbnail(1995548,"133402","DWLOH012","DWLOH012_thumb.jpg",127,130,32);thumbnails[2003690]=new thumbnail(2003690,"133402","DWLOH013","DWLOH013_thumb.jpg",130,129,32);thumbnails[1995552]=new thumbnail(1995552,"133404","DWNOR001","DWNOR001_thumb.jpg",125,130,32);thumbnails[1995553]=new thumbnail(1995553,"133404","DWNOR002","DWNOR002_thumb.jpg",128,130,32);thumbnails[1995555]=new thumbnail(1995555,"133404","DWNOR003","DWNOR003_thumb.jpg",128,130,32);thumbnails[1995556]=new thumbnail(1995556,"133404","DWNOR004","DWNOR004_thumb.jpg",128,130,32);thumbnails[1995557]=new thumbnail(1995557,"133404","DWNOR005","DWNOR005_thumb.jpg",84,130,32);thumbnails[1995559]=new thumbnail(1995559,"133404","DWNOR006","DWNOR006_thumb.jpg",130,44,32);thumbnails[1995563]=new thumbnail(1995563,"133405","DWPAN001","DWPAN001_thumb.jpg",130,49,32);thumbnails[1995565]=new thumbnail(1995565,"133405","DWPAN002","DWPAN002_thumb.jpg",130,33,32);thumbnails[1995567]=new thumbnail(1995567,"133405","DWPAN003","DWPAN003_thumb.jpg",130,33,32);thumbnails[1995570]=new thumbnail(1995570,"133405","DWPAN004","DWPAN004_thumb.jpg",130,52,32);thumbnails[1995571]=new thumbnail(1995571,"133405","DWPAN005","DWPAN005_thumb.jpg",130,44,32);thumbnails[1995575]=new thumbnail(1995575,"133405","DWPAN006","DWPAN006_thumb.jpg",130,43,32);thumbnails[1995576]=new thumbnail(1995576,"133405","DWPAN007","DWPAN007_thumb.jpg",130,44,32);thumbnails[1995676]=new thumbnail(1995676,"133406","DWSEA001","DWSEA001_thumb.jpg",120,130,32);thumbnails[1995677]=new thumbnail(1995677,"133406","DWSEA002","DWSEA002_thumb.jpg",130,130,32);thumbnails[1995678]=new thumbnail(1995678,"133406","DWSEA003","DWSEA003_thumb.jpg",130,86,32);thumbnails[1995682]=new thumbnail(1995682,"133406","DWSEA004","DWSEA004_thumb.jpg",129,130,32);thumbnails[1995684]=new thumbnail(1995684,"133406","DWSEA005","DWSEA005_thumb.jpg",130,129,32);thumbnails[1995685]=new thumbnail(1995685,"133406","DWSEA006","DWSEA006_thumb.jpg",130,98,32);thumbnails[1995686]=new thumbnail(1995686,"133406","DWSEA007","DWSEA007_thumb.jpg",130,95,32);thumbnails[1995691]=new thumbnail(1995691,"133406","DWSEA009","DWSEA009_thumb.jpg",124,130,32);thumbnails[1995702]=new thumbnail(1995702,"133407","DWSKY001","DWSKY001_thumb.jpg",130,93,32);thumbnails[1995703]=new thumbnail(1995703,"133407","DWSKY002","DWSKY002_thumb.jpg",130,92,32);thumbnails[1995705]=new thumbnail(1995705,"133407","DWSKY003","DWSKY003_thumb.jpg",130,96,32);thumbnails[1995707]=new thumbnail(1995707,"133407","DWSKY004","DWSKY004_thumb.jpg",127,130,32);thumbnails[1995708]=new thumbnail(1995708,"133407","DWSKY005","DWSKY005_thumb.jpg",130,92,32);thumbnails[1995710]=new thumbnail(1995710,"133407","DWSKY006","DWSKY006_thumb.jpg",130,94,32);thumbnails[1995711]=new thumbnail(1995711,"133407","DWSKY007","DWSKY007_thumb.jpg",128,130,32);thumbnails[1995713]=new thumbnail(1995713,"133407","DWSKY008","DWSKY008_thumb.jpg",130,96,32);thumbnails[1995716]=new thumbnail(1995716,"133407","DWSKY009","DWSKY009_thumb.jpg",130,86,32);thumbnails[2003696]=new thumbnail(2003696,"133407","DWSKY010","DWSKY010_thumb.jpg",128,130,32);thumbnails[1995718]=new thumbnail(1995718,"133408","DWTRE001","DWTRE001_thumb.jpg",130,127,32);thumbnails[1995719]=new thumbnail(1995719,"133408","DWTRE002","DWTRE002_thumb.jpg",127,130,32);thumbnails[1995720]=new thumbnail(1995720,"133408","DWTRE003","DWTRE003_thumb.jpg",130,91,32);thumbnails[1995721]=new thumbnail(1995721,"133408","DWTRE004","DWTRE004_thumb.jpg",125,130,32);thumbnails[1995723]=new thumbnail(1995723,"133408","DWTRE005","DWTRE005_thumb.jpg",130,128,32);thumbnails[1995724]=new thumbnail(1995724,"133408","DWTRE006","DWTRE006_thumb.jpg",130,89,32);thumbnails[6668067]=new thumbnail(6668067,"133408","DWTRE007","aa8_thumb.jpg",129,130,32);thumbnails[6668070]=new thumbnail(6668070,"133408","DWTRE008","aa1_thumb.jpg",130,130,32);thumbnails[6668091]=new thumbnail(6668091,"133408","DWTRE009","aa2_thumb.jpg",129,130,32);thumbnails[6668105]=new thumbnail(6668105,"133408","DWTRE010","aa3_thumb.jpg",128,130,32);thumbnails[6668130]=new thumbnail(6668130,"133408","DWTRE011","aa4_thumb.jpg",130,129,32);thumbnails[6668221]=new thumbnail(6668221,"133408","DWTRE012","aa5_thumb.jpg",128,130,32);thumbnails[6668225]=new thumbnail(6668225,"133408","DWTRE13","aa6_thumb.jpg",130,129,32);thumbnails[6668227]=new thumbnail(6668227,"133408","DWTRE013","aa7_thumb.jpg",110,130,32);thumbnails[6668243]=new thumbnail(6668243,"133408","DWTRE012","aa9_thumb.jpg",130,130,32);var galleries=new Object();galleries[133933]=new gallery(133933,"6626440,2022827,2022811,2022795,1996095,1996094,1996093","Buy Originals","section172206",[1996093,1996094,1996095,2022795,2022811,2022827,6626440]);galleries[132441]=new gallery(132441,"1986943,1986940,1986938,1986936,1986934,1986922,1986919,1986826","Beach","gallery",[1986826,1986919,1986922,1986934,1986936,1986938,1986940,1986943,1986947]);galleries[132774]=new gallery(132774,"1987067,1987063,1987062,1987060,1987059,1987058,1987056,1987052,1987027","Ben Nevis","gallery",[1987027,1987052,1987056,1987058,1987059,1987060,1987062,1987063,1987067]);galleries[132775]=new gallery(132775,"1995391,1995386,1995380,1995377,1995358,1995356","Climbers","gallery",[1995356,1995358,1995377,1995378,1995380,1995384,1995386,1995387,1995391]);galleries[132776]=new gallery(132776,"1995433,1995431,1995430,1995429,1995427,1995426,1995424,1995421,1995414","Glencoe","gallery",[1995414,1995421,1995424,1995426,1995427,1995429,1995430,1995431,1995433]);galleries[133398]=new gallery(133398,"1995457,1995456,1995454,1995451,1995450,1995446","Glens","gallery",[1995446,1995450,1995451,1995454,1995456,1995457]);galleries[133401]=new gallery(133401,"2003779,2003778,2003776,2003775,1995521,1995518","Hometown","gallery",[1995518,1995521,2003775,2003776,2003778,2003779]);galleries[133402]=new gallery(133402,"2003690,1995548,1995546,1995545,1995544,1995543,1995541,1995540,1995539,1995538,1995537,1995536,1995535","Lochs","gallery",[1995535,1995536,1995537,1995538,1995539,1995540,1995541,1995543,1995544,1995545,1995546,1995548,2003690]);galleries[133404]=new gallery(133404,"1995559,1995557,1995556,1995555,1995553,1995552","Norway","gallery",[1995552,1995553,1995555,1995556,1995557,1995559]);galleries[133405]=new gallery(133405,"1995576,1995575,1995571,1995570,1995567,1995565,1995563","Panoramic","gallery",[1995563,1995565,1995567,1995570,1995571,1995575,1995576]);galleries[133406]=new gallery(133406,"1995691,1995686,1995685,1995684,1995682,1995678,1995677,1995676","Sea","gallery",[1995676,1995677,1995678,1995682,1995684,1995685,1995686,1995691]);galleries[133407]=new gallery(133407,"2003696,1995716,1995713,1995711,1995710,1995708,1995707,1995705,1995703,1995702","Skye","gallery",[1995702,1995703,1995705,1995707,1995708,1995710,1995711,1995713,1995716,2003696]);galleries[133408]=new gallery(133408,"6668243,6668227,6668225,6668221,6668130,6668105,6668091,6668070,6668067,1995724,1995723,1995721,1995720,1995719,1995718","Trees","gallery",[1995718,1995719,1995720,1995721,1995723,1995724,6668067,6668070,6668091,6668105,6668130,6668221,6668225,6668227,6668243]);var imageSets=new Object();imageSets[1]="6668243,6668227,6668225,6668221,6668130,6668105,6668091,6668070,6668067,2003779,2003778,2003776,2003775,2003696,2003690,1995724,1995723,1995721,1995720,1995719,1995718,1995716,1995713,1995711,1995710,1995708,1995707,1995705,1995703,1995702,1995691,1995686,1995685,1995684,1995682,1995678,1995677,1995676,1995576,1995575,1995571,1995570,1995567,1995565,1995563,1995559,1995557,1995556,1995555,1995553,1995552,1995548,1995546,1995545,1995544,1995543,1995541,1995540,1995539,1995538,1995537,1995536,1995535,1995521,1995518,1995457,1995456,1995454,1995451,1995450,1995446,1995433,1995431,1995430,1995429,1995427,1995426,1995424,1995421,1995414,1995391,1995386,1995380,1995378,1995377,1995358,1995356,1987067,1987063,1987062,1987060,1987059,1987058,1987056,1987052,1987027,1986943,1986940,1986938,1986936,1986934,1986922,1986919,1986826";imageSets[2]="6668243,6668227,6668225,6668221,6668130,6668105,6668091,6668070,6668067,2003779,2003778,2003776,2003775,2003696,2003690,1995724,1995723,1995721,1995720,1995719,1995718,1995716,1995713,1995711,1995710,1995708,1995707,1995705,1995703,1995702,1995691,1995686,1995685,1995684,1995682,1995678,1995677,1995676,1995576,1995575,1995571,1995570,1995567,1995565,1995563,1995559,1995557,1995556,1995555,1995553,1995552,1995548,1995546,1995545,1995544,1995543,1995541,1995540,1995539,1995538,1995537,1995536,1995535,1995521,1995518,1995457,1995456,1995454,1995451,1995450,1995446,1995433,1995431,1995430,1995429,1995427,1995426,1995424,1995421,1995414,1995391,1995386,1995380,1995377,1995358,1995356,1987067,1987063,1987062,1987060,1987059,1987058,1987056,1987052,1987027,1986943,1986940,1986938,1986936,1986934,1986922,1986919,1986826";imageSets[3]="1996093";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/davidwilson/images";break}switch(a){case 1:b="http://www1.clikpic.com/davidwilson/images";break}switch(a){case 2:b="http://admin.clikpic.com/davidwilson/images";break}switch(a){case 24:b="http://tpc15/clikpic/davidwilson/images";break}switch(a){case 4:b="http://www.clikchurch.com/davidwilson/images";break}switch(a){case 5:b="http://www2.clikpic.com/davidwilson/images";break}switch(a){case 22:b="http://tpc5/clikpic/davidwilson/images";break}switch(a){case 23:b="http://tpc10/clikpic/davidwilson/images";break}switch(a){case 25:b="http://tpc16/clikpic/davidwilson/images";break}switch(a){case 15:b="http://www3.clikpic.com/davidwilson/images";break}switch(a){case 18:b="http://www4.clikpic.com/davidwilson/images";break}switch(a){case 19:b="http://www5.clikpic.com/davidwilson/images";break}switch(a){case 31:b="http://www7.clikpic.com/davidwilson/images";break}switch(a){case 32:b="http://admin2.clikpic.com/davidwilson/images";break}switch(a){case 33:b="http://www8.clikpic.com/davidwilson/images";break}switch(a){case 34:b="http://www9.clikpic.com/davidwilson/images";break}switch(a){case 35:b="http://admin3.clikpic.com/davidwilson/images";break}switch(a){case 37:b="http://admin4.clikpic.com/davidwilson/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=" David Wilson Paintings: "+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>Status: </strong>'+photos[b].location+"</p>"}if(photos[b].photographer!=""){a=a+'<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>'+photos[b].photographer+"</p>"}a=a+fnGetPaymentInfo(photos[b]);if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Buy now using PayPal:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 				&pound;"+(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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="item_name" value="'+e+'">';ref="";if(c.photo_ref!=""){ref=c.photo_ref+" - "+c.caption}else{ref=c.id+" - "+c.caption}price=d;b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="david@limetreefortwilliam.co.uk">';b=b+'<input type="hidden" name="currency_code" value="GBP">';b=b+'<input type="hidden" name="add" value="1">';b=b+'<input type="hidden" name="amount" value="'+d+'">';b=b+'<input type="hidden" name="item_number" value="'+ref+'">';b=b+'<input type="Submit" value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";b=b+'<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';b=b+'<input type="hidden" name="cmd" value="_cart">';b=b+'<input type="hidden" name="business" value="david@limetreefortwilliam.co.uk">';b=b+'<input type="hidden" name="display" value="1">';b=b+'<input type="Submit" value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';">';b=b+"</form>";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+'")'})}}};