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[5141616]=new thumbnail(5141616,"335803","Sea Otter - 5194","HWP_5194_thumb.jpg",130,184,18);thumbnails[5223804]=new thumbnail(5223804,"335803","Meerkat - 7051","HWP_7051A4_thumb.jpg",130,184,18);thumbnails[5223816]=new thumbnail(5223816,"335803","Meerkat - 7066","HWP_7066A4_thumb.jpg",130,184,18);thumbnails[5223833]=new thumbnail(5223833,"335803","Meerkat - 7071","HWP_7071A4_thumb.jpg",130,184,18);thumbnails[5223839]=new thumbnail(5223839,"335803","Meerkat family - 7079","HWP_7079A4_thumb.jpg",130,92,18);thumbnails[5223853]=new thumbnail(5223853,"335803","Otter - 7614","HWP_7614A4_thumb.jpg",130,92,18);thumbnails[5223863]=new thumbnail(5223863,"335803","Otters - 7645","HWP_7645A4_thumb.jpg",130,92,18);thumbnails[5202795]=new thumbnail(5202795,"335803","Lion - 6844","HWP_6844A4_thumb.jpg",130,92,18);thumbnails[5202799]=new thumbnail(5202799,"335803","Leopard - 6864","HWP_6864A4_thumb.jpg",130,92,18);thumbnails[5194319]=new thumbnail(5194319,"335803","Sea otter - 5124","HWP_5124A4_thumb.jpg",130,92,18);thumbnails[5194321]=new thumbnail(5194321,"335803","Sea otter - 5128","HWP_5128A4_thumb.jpg",130,92,18);thumbnails[5194322]=new thumbnail(5194322,"335803","Seal - 5250","HWP_5250A4_thumb.jpg",130,92,18);thumbnails[5183887]=new thumbnail(5183887,"290532","Polar Bear Yearling Cubs - 0177","HWP_01771_thumb.jpg",130,184,18);thumbnails[5183892]=new thumbnail(5183892,"290532","Walrus - 0101","HWP_0201_thumb.jpg",130,92,18);thumbnails[5183904]=new thumbnail(5183904,"290532","Humpback Whale - 0481","HWP_0481_thumb.jpg",130,92,18);thumbnails[5780540]=new thumbnail(5780540,"327374","Arctic Horizon - 0064","DSC_0064_thumb.jpg",130,86,18);thumbnails[5780546]=new thumbnail(5780546,"327374","Arctic Tern - 0121","DSC_0121_thumb.jpg",130,86,18);thumbnails[5780563]=new thumbnail(5780563,"327374","Polar Bears - 0139","DSC_01391_thumb.jpg",130,86,18);thumbnails[5780577]=new thumbnail(5780577,"327374","Polar Bear - 0185","DSC_01854_thumb.jpg",130,74,18);thumbnails[5780582]=new thumbnail(5780582,"327374","Polar Bear - 0237","DSC_0237-21_thumb.jpg",130,196,18);thumbnails[5780588]=new thumbnail(5780588,"327374","Castle Rocks - 1581","HWP_1581_thumb.jpg",130,195,18);thumbnails[5780598]=new thumbnail(5780598,"327374","Sunrise at Lake Matheson - 2509","HWP_25091_thumb.jpg",130,86,18);thumbnails[5780604]=new thumbnail(5780604,"327374","Pacific Spray - 8828 ","HWP_88281_thumb.jpg",130,86,18);thumbnails[5780647]=new thumbnail(5780647,"327374","Waitekere Range - 9454","HWP_9454_thumb.jpg",130,86,18);thumbnails[5780654]=new thumbnail(5780654,"327374","New Zealand Fern - 9488","HWP_94881_thumb.jpg",130,89,18);thumbnails[5780663]=new thumbnail(5780663,"327374","Gannet - 9769","HWP_9769_thumb.jpg",130,86,18);thumbnails[5398958]=new thumbnail(5398958,"290532","Grizzly bear - A4-4","Untitled-A4-4_52757A92-1D09-001F-99C6E2E942C52685_thumb.jpg",130,92,18);thumbnails[5399097]=new thumbnail(5399097,"290532","Adult grizzly bear - A4-6","Untitled-A4-6_thumb.jpg",130,92,18);thumbnails[5399132]=new thumbnail(5399132,"290532","Adult grizzly bear A4-8","Untitled-A4-8_thumb.jpg",130,92,18);thumbnails[5399152]=new thumbnail(5399152,"290532","Adult grizzly bear A4-9","Untitled-A4-9_thumb.jpg",130,92,18);thumbnails[5399262]=new thumbnail(5399262,"290532","Grizzly bears - A4-10","Untitled-A4-10_thumb.jpg",130,92,18);thumbnails[5399324]=new thumbnail(5399324,"290532","Grizzly bears - A4-11","Untitled-A4-11_thumb.jpg",130,92,18);thumbnails[5399421]=new thumbnail(5399421,"290532","Grizzly bears - A4-12","Untitled-A4-12_thumb.jpg",130,92,18);thumbnails[5399662]=new thumbnail(5399662,"290532","Grizzly bear - A4-13","Untitled-A4-13_thumb.jpg",130,93,18);thumbnails[5183792]=new thumbnail(5183792,"290532","Black Bear - Mother & her 3 cubs - 6756","HWP_6756A4_thumb.jpg",130,92,18);thumbnails[5227902]=new thumbnail(5227902,"290577","Pyramid Lake - 8952","HWP_8952A4_thumb.jpg",130,92,18);thumbnails[5227927]=new thumbnail(5227927,"290577","Pyramid Lake - 8962","HWP_8962A4_thumb.jpg",130,184,18);thumbnails[5228687]=new thumbnail(5228687,"290532","Grizzly bear - adult female A4-2","Untitled-2_thumb.jpg",130,92,18);thumbnails[5184065]=new thumbnail(5184065,"290577","Spirit Island - Maligne Lake - 8784","HWP_8784_thumb.jpg",130,87,18);thumbnails[5223898]=new thumbnail(5223898,"290577","Spirit Island, Maligne Lake - 8769","HWP_8769A4_thumb.jpg",130,92,18);thumbnails[5223910]=new thumbnail(5223910,"290577","Spirit Island, Maligne Lake - 8779","HWP_8779A4_thumb.jpg",130,184,18);thumbnails[5223917]=new thumbnail(5223917,"290577","Pyramid Lake - 8928","HWP_8928A4_thumb.jpg",130,92,18);thumbnails[5223924]=new thumbnail(5223924,"290577","Pyramid Lake - 8944","HWP_8944A4_thumb.jpg",130,92,18);thumbnails[5202685]=new thumbnail(5202685,"290532","Black bear - 6620","HWP_6620A4_thumb.jpg",130,92,18);thumbnails[5202691]=new thumbnail(5202691,"290532","Black bear and cubs - 6660","HWP_6660A4_5B9F9DF0-2219-B5B5-4C8386CA93A76A13_thumb.jpg",130,184,18);thumbnails[5202721]=new thumbnail(5202721,"290532","Black bear and cubs - 6661","HWP_6661A4_thumb.jpg",130,184,18);thumbnails[5202726]=new thumbnail(5202726,"290532","Black bear and 3 cubs - 6662","HWP_6662A4_thumb.jpg",130,184,18);thumbnails[5202745]=new thumbnail(5202745,"290532","Black bear and 3 cubs - 6727","HWP_6727A4_thumb.jpg",130,92,18);thumbnails[5202751]=new thumbnail(5202751,"290532","Black bear and 3 cubs - 6757","HWP_6757A4_thumb.jpg",130,92,18);thumbnails[5194305]=new thumbnail(5194305,"290578","Orchid - 4368","HWP_4368A4_thumb.jpg",130,92,18);thumbnails[5194310]=new thumbnail(5194310,"290578","Orchid - 4375","HWP_4375A4_thumb.jpg",130,184,18);thumbnails[5194313]=new thumbnail(5194313,"290578","Botanical study - 4381","HWP_4381A4_thumb.jpg",130,184,18);thumbnails[5194315]=new thumbnail(5194315,"290577","Columbia Icefields - 5102","HWP_5102A4_thumb.jpg",130,92,18);thumbnails[5194323]=new thumbnail(5194323,"290577","Athabasca falls - 5650","HWP_5650A4_thumb.jpg",130,184,18);thumbnails[5197242]=new thumbnail(5197242,"290577","Athabasca falls - 5652","HWP_5652A4_thumb.jpg",130,86,18);thumbnails[5197244]=new thumbnail(5197244,"290577","Athabasca falls - 5652bw","HWP_5652A4BW_thumb.jpg",130,92,18);thumbnails[5197254]=new thumbnail(5197254,"290577","Athabasca falls - 5673","HWP_5673A4_thumb.jpg",130,92,18);thumbnails[5197264]=new thumbnail(5197264,"290577","Athabasca falls - 5698","HWP_5698A4_thumb.jpg",130,92,18);thumbnails[5197268]=new thumbnail(5197268,"290577","Athabasca falls - 5723","HWP_5723A4_thumb.jpg",130,184,18);thumbnails[5197272]=new thumbnail(5197272,"290577","Athabasca falls - 5839","HWP_5839A4_thumb.jpg",130,92,18);thumbnails[5197280]=new thumbnail(5197280,"290577","Athabasca falls - 5849","HWP_5849A4_thumb.jpg",130,184,18);thumbnails[5197296]=new thumbnail(5197296,"290577","Early morning - 6299","HWP_6299A4_thumb.jpg",130,92,18);thumbnails[5197313]=new thumbnail(5197313,"290532","Bees - 6339","HWP_6339A4_thumb.jpg",130,184,18);thumbnails[5197326]=new thumbnail(5197326,"290532","Adult black bear - 6612","HWP_6612A4_thumb.jpg",130,92,18);thumbnails[5184007]=new thumbnail(5184007,"290577","Lake Matheson at Dawn - 2418","HWP_2418A4_thumb.jpg",130,92,18);thumbnails[5184013]=new thumbnail(5184013,"290577","Akaroa Harbour - 8427","HWP_8427A4_thumb.jpg",130,92,18);thumbnails[5191864]=new thumbnail(5191864,"290532","Grizzly bear resting - A4-15","Untitled-A4-15_thumb.jpg",130,92,18);thumbnails[5191875]=new thumbnail(5191875,"290532","Grey wolf - 3717","HWP_3717A4_thumb.jpg",130,92,18);thumbnails[5191881]=new thumbnail(5191881,"290532","Grey wolf resting - 3726","HWP_3726A4_thumb.jpg",130,92,18);thumbnails[5191887]=new thumbnail(5191887,"290532","Grey wolf adult male - 3732","HWP_3732A4_thumb.jpg",130,92,18);thumbnails[5191903]=new thumbnail(5191903,"290578","Arthurium - 4290","HWP_4290A4_thumb.jpg",130,92,18);thumbnails[5191911]=new thumbnail(5191911,"290578","Botanical study - 4293","HWP_4293A4_thumb.jpg",130,184,18);thumbnails[5191915]=new thumbnail(5191915,"290578","Orchid - 4296","HWP_4296A4_thumb.jpg",130,92,18);thumbnails[5191921]=new thumbnail(5191921,"290578","Orchid - 4297","HWP_4297A4_thumb.jpg",130,92,18);thumbnails[5191925]=new thumbnail(5191925,"290578","Orchid - 4310","HWP_4310A4_thumb.jpg",130,92,18);thumbnails[5192028]=new thumbnail(5192028,"290578","Bromiliad - 4328","HWP_4328A4_thumb.jpg",130,92,18);thumbnails[5192032]=new thumbnail(5192032,"290578","Orchid - 4339","HWP_4339A4_thumb.jpg",130,92,18);thumbnails[5192039]=new thumbnail(5192039,"290578","Orchid - 4340","HWP_4340A4_thumb.jpg",130,92,18);thumbnails[5192050]=new thumbnail(5192050,"290578","Orchid - 4344","HWP_4344A4_thumb.jpg",130,184,18);thumbnails[5192114]=new thumbnail(5192114,"290578","Orchid - 4347","HWP_4347A4_thumb.jpg",130,92,18);thumbnails[5190017]=new thumbnail(5190017,"290577","Tangle falls - 5184","HWP-5184A4_thumb.jpg",130,92,18);thumbnails[5190148]=new thumbnail(5190148,"290577","Tangle falls - 5184bw","HWP-5184A4BW_thumb.jpg",130,92,18);thumbnails[5190211]=new thumbnail(5190211,"290578","Orchid - 4299","HWP_4299A4_thumb.jpg",130,92,18);thumbnails[5190220]=new thumbnail(5190220,"290532","Polar bear - 0237","HWP_0237A4_thumb.jpg",130,184,18);thumbnails[5190224]=new thumbnail(5190224,"290532","Polar bears - 0129","DSC_0129A4_thumb.jpg",130,92,18);thumbnails[5190234]=new thumbnail(5190234,"290577","Bow river valley - A4-3","A4-3_thumb.jpg",130,92,18);thumbnails[5190269]=new thumbnail(5190269,"290579","Window bottles - 3549","HWP_3549A4_thumb.jpg",130,184,18);thumbnails[5185116]=new thumbnail(5185116,"290577","Athabasca Falls - 5861","HEWP_5861A4_thumb.jpg",130,184,18);thumbnails[5185239]=new thumbnail(5185239,"290577","Bow River Valley - 2658","HWP_2658_A4_thumb.jpg",130,92,18);thumbnails[5185392]=new thumbnail(5185392,"290577","Burwood Island - 3451","HWP_3451A4_thumb.jpg",130,92,18);thumbnails[5185421]=new thumbnail(5185421,"290577","Mt Athabasca - 4444","HWP_4444A4_thumb.jpg",130,92,18);thumbnails[5185534]=new thumbnail(5185534,"290577","Sunwapta Falls - 5061","HWP_5061A4_thumb.jpg",130,184,18);thumbnails[5179204]=new thumbnail(5179204,"290532","Grazing grizzly bear - A4-7","Untitled-A4-7_thumb.jpg",130,184,18);thumbnails[5179366]=new thumbnail(5179366,"290579","Window bottles - 3548bw","HWP_3548A4BW_thumb.jpg",130,184,18);thumbnails[6063674]=new thumbnail(6063674,"290577","Akaroa Harbour - New Zealand 8372","HWP_8372_thumb.jpg",130,184,18);thumbnails[6063684]=new thumbnail(6063684,"290577","Bow Lake - Alberta 9355","HWP_9355_thumb.jpg",130,92,18);var galleries=new Object();galleries[335803]=new gallery(335803,"5223863,5223853,5223839,5223833,5223816,5223804,5202799,5202795,5194322,5194321,5194319,5141616","FINE ART SALES - ANIMALS","gallery",[5141616,5223804,5223816,5223833,5223839,5223853,5223863,5202795,5202799,5194319,5194321,5194322]);galleries[327374]=new gallery(327374,"5780663,5780654,5780647,5780604,5780598,5780588,5780582,5780577,5780563,5780546,5780540","Entries to Wildlife Photographer of The Year 2010","gallery",[5780540,5780546,5780563,5780577,5780582,5780588,5780598,5780604,5780647,5780654,5780663]);galleries[290578]=new gallery(290578,"5194313,5194310,5194305,5192114,5192050,5192039,5192032,5192028,5191925,5191921,5191915,5191911,5191903,5190211","FINE ART SALES - BOTANY","gallery",[5194305,5194310,5194313,5191903,5191911,5191915,5191921,5191925,5192028,5192032,5192039,5192050,5192114,5190211]);galleries[290577]=new gallery(290577,"6063684,6063674,5227927,5227902,5223924,5223917,5223910,5223898,5197296,5197280,5197272,5197268,5197264,5197254,5197244,5197242,5194323,5194315,5190234,5190148,5190017,5185534,5185421,5185392,5185239,5185116","FINE ART SALES - LANDSCAPES","gallery",[5227902,5227927,5184065,5223898,5223910,5223917,5223924,5194315,5194323,5197242,5197244,5197254,5197264,5197268,5197272,5197280,5197296,5184007,5184013,5190017,5190148,5190234,5185116,5185239,5185392,5185421,5185534,6063674,6063684]);galleries[290579]=new gallery(290579,"5190269,5179366","FINE ART SALES - LIFESTYLE","gallery",[5190269,5179366]);galleries[290532]=new gallery(290532,"5399662,5399421,5399324,5399262,5399152,5399132,5399097,5398958,5228687,5202751,5202745,5202726,5202721,5202691,5202685,5197326,5197313,5191887,5191881,5191875,5191864,5190224,5190220,5179204","FINE ART SALES - WILDLIFE","gallery",[5183887,5183892,5183904,5398958,5399097,5399132,5399152,5399262,5399324,5399421,5399662,5183792,5228687,5202685,5202691,5202721,5202726,5202745,5202751,5197313,5197326,5191864,5191875,5191881,5191887,5190220,5190224,5179204]);var imageSets=new Object();imageSets[1]="6063684,6063674,5780663,5780654,5780647,5780604,5780598,5780588,5780582,5780577,5780563,5780546,5780540,5399662,5399421,5399324,5399262,5399152,5399132,5399097,5398958,5228687,5227927,5227902,5223924,5223917,5223910,5223898,5223863,5223853,5223839,5223833,5223816,5223804,5202799,5202795,5202751,5202745,5202726,5202721,5202691,5202685,5197326,5197313,5197296,5197280,5197272,5197268,5197264,5197254,5197244,5197242,5194323,5194322,5194321,5194319,5194315,5194313,5194310,5194305,5192114,5192050,5192039,5192032,5192028,5191925,5191921,5191915,5191911,5191903,5191887,5191881,5191875,5191864,5190269,5190234,5190224,5190220,5190211,5190148,5190017,5185534,5185421,5185392,5185239,5185116,5179366,5179204,5141616";imageSets[2]="6063684,6063674,5780663,5780654,5780647,5780604,5780598,5780588,5780582,5780577,5780563,5780546,5780540,5399662,5399421,5399324,5399262,5399152,5399132,5399097,5398958,5228687,5227927,5227902,5223924,5223917,5223910,5223898,5223863,5223853,5223839,5223833,5223816,5223804,5202799,5202795,5202751,5202745,5202726,5202721,5202691,5202685,5197326,5197313,5197296,5197280,5197272,5197268,5197264,5197254,5197244,5197242,5194323,5194322,5194321,5194319,5194315,5194313,5194310,5194305,5192114,5192050,5192039,5192032,5192028,5191925,5191921,5191915,5191911,5191903,5191887,5191881,5191875,5191864,5190269,5190234,5190224,5190220,5190211,5190148,5190017,5185534,5185421,5185392,5185239,5185116,5179366,5179204,5141616";imageSets[3]="6063684,6063674,5780663,5780654,5780647,5780604,5780598,5780588,5780582,5780577,5780563,5780546,5780540,5399662,5399421,5399324,5399262,5399152,5399132,5399097,5398958,5228687,5227927,5227902,5223924,5223917,5223910,5223898,5223863,5223853,5223839,5223833,5223816,5223804,5202799,5202795,5202751,5202745,5202726,5202721,5202691,5202685,5197326,5197313,5197296,5197280,5197272,5197268,5197264,5197254";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/HPerry/images";break}switch(a){case 1:b="http://www1.clikpic.com/HPerry/images";break}switch(a){case 2:b="http://admin.clikpic.com/HPerry/images";break}switch(a){case 24:b="http://tpc15/clikpic/HPerry/images";break}switch(a){case 4:b="http://www.clikchurch.com/HPerry/images";break}switch(a){case 5:b="http://www2.clikpic.com/HPerry/images";break}switch(a){case 22:b="http://tpc5/clikpic/HPerry/images";break}switch(a){case 23:b="http://tpc10/clikpic/HPerry/images";break}switch(a){case 25:b="http://tpc16/clikpic/HPerry/images";break}switch(a){case 15:b="http://www3.clikpic.com/HPerry/images";break}switch(a){case 18:b="http://www4.clikpic.com/HPerry/images";break}switch(a){case 19:b="http://www5.clikpic.com/HPerry/images";break}switch(a){case 31:b="http://www7.clikpic.com/HPerry/images";break}switch(a){case 32:b="http://admin2.clikpic.com/HPerry/images";break}switch(a){case 33:b="http://www8.clikpic.com/HPerry/images";break}switch(a){case 34:b="http://www9.clikpic.com/HPerry/images";break}switch(a){case 35:b="http://admin3.clikpic.com/HPerry/images";break}switch(a){case 37:b="http://admin4.clikpic.com/HPerry/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="Howard Perry - Photographer: "+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").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>Howard Perry </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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="HPERRY">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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+'")'})}}};