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[3256716]=new thumbnail(3256716,"202688","Rose Blanche, NL.","_BSC5446FIN_thumb.jpg",130,87,15);thumbnails[3256718]=new thumbnail(3256718,"202688","Rose Blanche, NL.","DSC_8615_thumb.jpg",130,195,15);thumbnails[3325349]=new thumbnail(3325349,"202688","Ferryland","DSC_0744_thumb.jpg",130,86,15);thumbnails[3325380]=new thumbnail(3325380,"202692","Cape Spear Lighthouse, NL","DSC_0838-Aug-17-2005_thumb.jpg",130,86,15);thumbnails[3325388]=new thumbnail(3325388,"200673","Iceberg off Blackhead","IcebergBSC3415_thumb.jpg",130,87,15);thumbnails[3365426]=new thumbnail(3365426,"200673","Pack ice","PackIce2556_thumb.jpg",130,87,15);thumbnails[3517277]=new thumbnail(3517277,"202688","Moored Boats, St. Phillip's, NL.","DSC_5650_thumb.jpg",130,93,15);thumbnails[3589440]=new thumbnail(3589440,"202688","Boat & Shed in Conception Harbour, NL","Conception-Harbour-2_thumb.jpg",130,86,15);thumbnails[3589482]=new thumbnail(3589482,"202692","Cape Spear Lighthouse, NL","DSC_0853ink_thumb.jpg",130,86,15);thumbnails[3589603]=new thumbnail(3589603,"202692","Bonavista Lighthouse, Bonavista, NL","DSC_1322_thumb.jpg",130,86,15);thumbnails[3589636]=new thumbnail(3589636,"202688","Boats on Slipway, Quidi Vidi, NL.","DSC_5521CP_thumb.jpg",130,86,15);thumbnails[3683909]=new thumbnail(3683909,"202692","Cape Spear Lighthouse, NL","Cape-Spear-0309-63_4_5cp_thumb.jpg",130,87,15);thumbnails[3450929]=new thumbnail(3450929,"210983","","Pro-Portrait-A-04-0000031_thumb.jpg",130,98,15);thumbnails[3256717]=new thumbnail(3256717,"200673","Tors Cove, NL","DSC_4239_thumb.jpg",130,87,15);thumbnails[3450144]=new thumbnail(3450144,"210983","","Wedding-Album-Classic-White-01-005006_thumb.jpg",130,65,15);thumbnails[3450160]=new thumbnail(3450160,"210983","","Wedding-Album-Classic-White-01-009010_thumb.jpg",130,65,15);thumbnails[3450155]=new thumbnail(3450155,"210983","","Wedding-Album-Classic-White-01-007008_thumb.jpg",130,65,15);thumbnails[3450184]=new thumbnail(3450184,"210983","","Wedding-Album-Classic-White-01-011012_thumb.jpg",130,65,15);thumbnails[3450188]=new thumbnail(3450188,"210983","","Wedding-Album-Classic-White-01-013014_thumb.jpg",130,65,15);thumbnails[3450191]=new thumbnail(3450191,"210983","","Wedding-Album-Classic-White-01-015016_thumb.jpg",130,65,15);thumbnails[3450195]=new thumbnail(3450195,"210983","","Wedding-Album-Classic-White-01-017018_thumb.jpg",130,65,15);thumbnails[3450198]=new thumbnail(3450198,"210983","","Wedding-Album-Classic-White-01-019020_thumb.jpg",130,65,15);thumbnails[3450203]=new thumbnail(3450203,"210983","","Wedding-Album-Classic-White-01-021022c_thumb.jpg",130,65,15);thumbnails[3450205]=new thumbnail(3450205,"210983","","Wedding-Album-Classic-White-01-035036_thumb.jpg",130,65,15);thumbnails[3253075]=new thumbnail(3253075,"198448","Montreal Museum of Fine Art","SEP4087bw_thumb.jpg",130,87,15);thumbnails[3325113]=new thumbnail(3325113,"198448","Park Bench in Winter","DSC_3724-B&W_thumb.jpg",130,86,15);thumbnails[3683908]=new thumbnail(3683908,"198448","Cape Spear Lighthouse, NL","Cape-Spear-0309-63_4_5BW_thumb.jpg",130,87,15);thumbnails[4979784]=new thumbnail(4979784,"198448","Waterford River, Bowring Park","0901_Bowring-Park-Winter_010_12_08-BW_thumb.jpg",130,194,15);thumbnails[3256722]=new thumbnail(3256722,"198571","Cape Ray, NL.","_BSC5579fin_thumb.jpg",130,87,15);thumbnails[4979785]=new thumbnail(4979785,"198571","Waterford River, Bowring Park","0901_Bowring-Park-Winter_203p2_thumb.jpg",130,194,15);thumbnails[3264892]=new thumbnail(3264892,"199136","Park Bench","0901_Winter_035RS_thumb.jpg",130,87,15);thumbnails[3269155]=new thumbnail(3269155,"199136","Waterford River, Bowring Park, NL.","0901_Bowring-Park-Winter_094_6_8_thumb.jpg",130,194,15);thumbnails[3272494]=new thumbnail(3272494,"199136","Bowring Park, St. John's, NL.","0901_Bowring-Park-Winter_116_18_20_thumb.jpg",130,87,15);thumbnails[3589611]=new thumbnail(3589611,"199136","Bowring Park","0901_Bowring-Park-Winter_197ptp_thumb.jpg",130,87,15);thumbnails[3256720]=new thumbnail(3256720,"199139","Flatrock, NL","0709_Pouch_Cove_569_thumb.jpg",130,194,15);thumbnails[3325404]=new thumbnail(3325404,"199139","Reflection","SEP_3339_40_41_thumb.jpg",130,87,15);thumbnails[3517273]=new thumbnail(3517273,"199139","Fishing Shed","CapeRayShedDSC_8547a_thumb.jpg",130,196,15);thumbnails[3517280]=new thumbnail(3517280,"199139","Waterfall","N100_0001-(23)_thumb.jpg",130,98,15);thumbnails[5210355]=new thumbnail(5210355,"199139","St. JoHn's Sunrise","St3883-84-85_thumb.jpg",130,87,15);thumbnails[5934127]=new thumbnail(5934127,"199139","East Coast Trail -Tors Cove","20090517-Tors-Cove-7_thumb.jpg",130,194,15);thumbnails[5934130]=new thumbnail(5934130,"199139","Seascape","20090517-Tors-Cove-91_thumb.jpg",130,87,15);thumbnails[4930671]=new thumbnail(4930671,"199141","Megan","Megan-Foley-Z-Card-05-011_thumb.jpg",130,79,15);thumbnails[3324039]=new thumbnail(3324039,"199141","Alicia","Akicia-Tuxedo-Black-007008_thumb.jpg",130,65,15);thumbnails[3324040]=new thumbnail(3324040,"199141","Alicia ","Alicia-A-02-003-(single)_thumb.jpg",130,172,15);thumbnails[3365452]=new thumbnail(3365452,"199141","Martina","DSC_5575_pp_thumb.jpg",130,194,15);thumbnails[3365475]=new thumbnail(3365475,"199141","Melissa","Melissa-tear-1_thumb.jpg",130,86,15);thumbnails[3416630]=new thumbnail(3416630,"199141","Melissa","CSC1668A_thumb.jpg",130,194,15);thumbnails[5934112]=new thumbnail(5934112,"199141","Model Michelle Chaytor","20100321-Model-Shoot-4349_thumb.jpg",130,195,15);thumbnails[5934113]=new thumbnail(5934113,"199141","Model Zoha Rabie","20100321-Model-Shoot-4578-Edit-Edit-Edit_thumb.jpg",130,128,15);thumbnails[3265033]=new thumbnail(3265033,"199141","Alicia","Alicia-01_thumb.jpg",130,194,15);thumbnails[4913106]=new thumbnail(4913106,"199142","Jasmine","Kieley-Wedding-9186_thumb.jpg",130,163,15);thumbnails[3373147]=new thumbnail(3373147,"199142","Julia","Julia-triple-000003_thumb.jpg",130,98,15);thumbnails[3416904]=new thumbnail(3416904,"199142","Emily","Emily-Portrait-Pack-01_thumb.jpg",130,98,15);thumbnails[3988387]=new thumbnail(3988387,"199142","Kaitlin B's first day in the park.","Kaitlin_Brake_0031_thumb.jpg",130,87,15);thumbnails[3988398]=new thumbnail(3988398,"199142","Kaitlin B","Kaitlin_Brake_-0030_thumb.jpg",130,87,15);thumbnails[5379316]=new thumbnail(5379316,"199142","Emily photographed using natural light from window.","Emilyclikpicrs_thumb.jpg",130,87,15);thumbnails[5381481]=new thumbnail(5381481,"199142","Elizabeth","Elizabeth-Chafe-2398_thumb.jpg",130,194,15);thumbnails[3265055]=new thumbnail(3265055,"199142","Melissa","MelissaBPrs-01_thumb.jpg",130,194,15);thumbnails[3280188]=new thumbnail(3280188,"199145","George Street, St. John's, NL.","DSC_9273sepia_thumb.jpg",130,94,15);thumbnails[3589640]=new thumbnail(3589640,"199145","Shy","DSC_7434v_thumb.jpg",130,87,15);thumbnails[3253215]=new thumbnail(3253215,"200033","Montreal","SEP4115_thumb.jpg",130,194,15);thumbnails[3280184]=new thumbnail(3280184,"200033","Barbados Beach","BarbadosbeachDSC_4932A_thumb.jpg",130,86,15);thumbnails[3325205]=new thumbnail(3325205,"200033","Sunset, St. Lucia","116_1654_thumb.jpg",130,173,15);thumbnails[3280181]=new thumbnail(3280181,"200032","St. Lucia","Umbrellascoloured_thumb.jpg",130,97,15);thumbnails[3291470]=new thumbnail(3291470,"200032","Ferryland, NL.","BSC8522-3_thumb.jpg",130,87,15);thumbnails[3292055]=new thumbnail(3292055,"200032","Outer Battery, St. John's, NL.","Outer-Battery1_thumb.jpg",130,36,15);thumbnails[3325068]=new thumbnail(3325068,"200032","Old Shed","Door&barrelDSC_3736-_thumb.jpg",130,88,15);thumbnails[3417002]=new thumbnail(3417002,"200672","George Street Statue","George-Street-Statue_thumb.jpg",130,194,15);thumbnails[3256719]=new thumbnail(3256719,"200672","Clothesline, Codroy Valley, NL.","DSC_8751_1_thumb.jpg",130,86,15);thumbnails[3325195]=new thumbnail(3325195,"200672","Window View","DSC_2549-copy_thumb.jpg",130,80,15);thumbnails[3325319]=new thumbnail(3325319,"200672","Silhouette, Quidi Vidi Lake","DSC_6650_1s_thumb.jpg",130,196,15);thumbnails[3398610]=new thumbnail(3398610,"200672"," Wine Glasses","BarGlassesBSC1867copy_thumb.jpg",130,87,15);thumbnails[5934090]=new thumbnail(5934090,"200672","Bernese Mountain Dog","20100508-Dogs-5997s_thumb.jpg",130,163,15);var galleries=new Object();galleries[200673]=new gallery(200673,"3365426,3325388,3256717","Icebergs","gallery",[3325388,3365426,3256717]);galleries[202692]=new gallery(202692,"3683909,3589603,3589482,3325380","Lighthouses","gallery",[3325380,3589482,3589603,3683909]);galleries[210983]=new gallery(210983,"3450929","Matthew & Natalie","gallery",[3450929,3450144,3450160,3450155,3450184,3450188,3450191,3450195,3450198,3450203,3450205]);galleries[202688]=new gallery(202688,"3256718","Newfoundland & Labrador Communities","gallery",[3256716,3256718,3325349,3517277,3589440,3589636]);galleries[198447]=new gallery(198447,"3256718","Scenery & Nature","gallery",[]);galleries[198448]=new gallery(198448,"3683908","Black & White","gallery",[3253075,3325113,3683908,4979784]);galleries[198571]=new gallery(198571,"4979785,3256722","Landscapes","gallery",[3256722,4979785]);galleries[199134]=new gallery(199134,"3589611,3272494,3269155,3264892","Seasons","gallery",[]);galleries[199136]=new gallery(199136,"3589611,3272494,3269155,3264892","Winter","gallery",[3264892,3269155,3272494,3589611]);galleries[199139]=new gallery(199139,"5934130,5934127,5210355,3517280,3517273,3325404,3256720","Seascapes","gallery",[3256720,3325404,3517273,3517280,5210355,5934127,5934130]);galleries[199140]=new gallery(199140,"5381481,3988398,3416630,3373147","People","gallery",[]);galleries[199141]=new gallery(199141,"3416630","Modelling & Fashion","gallery",[4930671,3324039,3324040,3365452,3365475,3416630,5934112,5934113,3265033]);galleries[199142]=new gallery(199142,"5381481,3988398,3373147","Portraits","gallery",[4913106,3373147,3416904,3988387,3988398,5379316,5381481,3265055]);galleries[199145]=new gallery(199145,"3589640,3280188","Candids","gallery",[3280188,3589640]);galleries[200033]=new gallery(200033,"3325205,3280184,3253215","Travel","gallery",[3253215,3280184,3325205]);galleries[200032]=new gallery(200032,"3291470","Handcolouring","gallery",[3280181,3291470,3292055,3325068]);galleries[200672]=new gallery(200672,"3417002","Photo Library","gallery",[3417002,3256719,3325195,3325319,3398610,5934090]);galleries[210982]=new gallery(210982,"3450929","Weddings","gallery",[]);var imageSets=new Object();imageSets[1]="5381481,4930671,3988398,3988387,3683909,3683908,3589640,3589636,3589611,3589482,3589440,3517280,3517277,3417002,3416904,3416630,3398610,3373147,3365475,3365452,3365426,3325404,3325388,3325380,3325349,3325319,3325205,3325113,3325068,3324040,3324039,3292055,3291470,3280188,3280184,3280181,3272494,3269155,3265055,3265033,3264892,3256722,3256720,3256719,3256718,3256716,3253215";imageSets[2]="5381481,3988398,3683908,3450929,3417002,3416630,3373147,3291470,3256718";imageSets[3]="5381481";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/ericbar/images";break}switch(a){case 1:b="http://www1.clikpic.com/ericbar/images";break}switch(a){case 2:b="http://admin.clikpic.com/ericbar/images";break}switch(a){case 24:b="http://tpc15/clikpic/ericbar/images";break}switch(a){case 4:b="http://www.clikchurch.com/ericbar/images";break}switch(a){case 5:b="http://www2.clikpic.com/ericbar/images";break}switch(a){case 22:b="http://tpc5/clikpic/ericbar/images";break}switch(a){case 23:b="http://tpc10/clikpic/ericbar/images";break}switch(a){case 25:b="http://tpc16/clikpic/ericbar/images";break}switch(a){case 15:b="http://www3.clikpic.com/ericbar/images";break}switch(a){case 18:b="http://www4.clikpic.com/ericbar/images";break}switch(a){case 19:b="http://www5.clikpic.com/ericbar/images";break}switch(a){case 31:b="http://www7.clikpic.com/ericbar/images";break}switch(a){case 32:b="http://admin2.clikpic.com/ericbar/images";break}switch(a){case 33:b="http://www8.clikpic.com/ericbar/images";break}switch(a){case 34:b="http://www9.clikpic.com/ericbar/images";break}switch(a){case 35:b="http://admin3.clikpic.com/ericbar/images";break}switch(a){case 37:b="http://admin4.clikpic.com/ericbar/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="eric bartlett 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+'")'})}}};