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[4342157]=new thumbnail(4342157,"","","E5s_thumb.jpg",130,650,18);thumbnails[4342160]=new thumbnail(4342160,"","","E6s_thumb.jpg",130,658,18);thumbnails[4342162]=new thumbnail(4342162,"","","E7s_thumb.jpg",130,675,18);thumbnails[5636778]=new thumbnail(5636778,"","","DSC_2116_2_thumb.JPG",130,63,18);thumbnails[140289]=new thumbnail(140289,"","ITEM # 163 556","PC127477 (2)_thumb.JPG",130,132,18);thumbnails[4144376]=new thumbnail(4144376,"","ITEM # 09 155893","E8s2_thumb.jpg",130,667,18);thumbnails[4342156]=new thumbnail(4342156,"","","E4s_thumb.jpg",130,650,18);thumbnails[140288]=new thumbnail(140288,"","ITEM # 163 567","PC127475 (2)_thumb.JPG",130,130,18);thumbnails[3452895]=new thumbnail(3452895,"","ITEM # 163 896","a11_thumb.jpg",130,129,18);thumbnails[4342406]=new thumbnail(4342406,"","","E19s_thumb.jpg",130,650,18);thumbnails[140290]=new thumbnail(140290,"","ITEM # 163 554","PC127484 (2)_thumb.JPG",130,132,18);thumbnails[4342408]=new thumbnail(4342408,"","","E20s_thumb.jpg",130,658,18);thumbnails[4144455]=new thumbnail(4144455,"","ITEM# 09 55623","EA_111_thumb.jpg",130,757,18);thumbnails[4144454]=new thumbnail(4144454,"","ITEM# 09 22568","EA_10_thumb.jpg",130,757,18);thumbnails[4144451]=new thumbnail(4144451,"","ITEM# 09 4885622","EA_9_thumb.jpg",130,743,18);thumbnails[5636755]=new thumbnail(5636755,"319580","","P3026383_thumb.jpg",130,127,18);thumbnails[5636761]=new thumbnail(5636761,"319580","","P30263801_thumb.jpg",130,131,18);thumbnails[5636762]=new thumbnail(5636762,"319580","","P3026381_thumb.jpg",130,131,18);thumbnails[5636764]=new thumbnail(5636764,"319580","","P3026388_2_thumb.jpg",130,97,18);thumbnails[4342499]=new thumbnail(4342499,"255543","ITEM# 09 144783","e1_thumb.jpg",130,166,18);thumbnails[6420526]=new thumbnail(6420526,"319581","","AKA_4787_thumb.JPG",130,63,18);thumbnails[4342503]=new thumbnail(4342503,"255543","ITEM# 09 144783","e3_thumb.jpg",130,164,18);thumbnails[4144372]=new thumbnail(4144372,"255543","ITEM# 09 144783","EA_31_thumb.jpg",130,163,18);thumbnails[4342153]=new thumbnail(4342153,"255543","","E2s_thumb.jpg",130,195,18);thumbnails[4342416]=new thumbnail(4342416,"255543","","E22s_thumb.jpg",130,132,18);thumbnails[4144441]=new thumbnail(4144441,"255543","ITEM# 09 1225893","EA_8_2a_thumb.jpg",130,98,18);thumbnails[4342155]=new thumbnail(4342155,"255543","","E3s_thumb.jpg",130,87,18);thumbnails[4342151]=new thumbnail(4342151,"255543","","E1s_thumb.jpg",130,62,18);thumbnails[4144456]=new thumbnail(4144456,"255542","ITEM# 09 223665","EA_13_thumb.jpg",130,132,18);thumbnails[4144370]=new thumbnail(4144370,"255542","ITEM# 09 145589","EA_11_thumb.jpg",130,129,18);thumbnails[4144371]=new thumbnail(4144371,"255542","ITEM# 09 415589","EA_21_thumb.jpg",130,134,18);thumbnails[4144458]=new thumbnail(4144458,"255542","ITEM# 09 414458","EA_14_thumb.jpg",130,130,18);thumbnails[4144373]=new thumbnail(4144373,"247777","ITEM# 09 156691","E23s_thumb.jpg",130,130,18);thumbnails[4342593]=new thumbnail(4342593,"247777","","3s_thumb.jpg",130,133,18);thumbnails[3033226]=new thumbnail(3033226,"247777","","07_thumb.jpg",130,130,18);thumbnails[3033206]=new thumbnail(3033206,"247777","","02_thumb.jpg",130,97,18);thumbnails[3033225]=new thumbnail(3033225,"247777","","06_thumb.jpg",130,63,18);thumbnails[3033222]=new thumbnail(3033222,"247777","","01_thumb.jpg",130,174,18);thumbnails[4342271]=new thumbnail(4342271,"247777","","E13s_2_thumb.jpg",130,197,18);thumbnails[3033168]=new thumbnail(3033168,"255550","ITEM # 303 3168","2008-03-31_0011202_thumb.jpg",130,131,18);thumbnails[1731622]=new thumbnail(1731622,"97549","ITEM # 1731622","04 2008_thumb.jpg",130,124,18);thumbnails[1731624]=new thumbnail(1731624,"97549","ITEM # 1731624","2007-12-15_0006_thumb.jpg",130,127,18);thumbnails[1731626]=new thumbnail(1731626,"97549","ITEM # 1731626","2007-12-15_0007_thumb.jpg",130,130,18);thumbnails[1775610]=new thumbnail(1775610,"97549","ITEM # 177610","2007-12-15_0012_thumb.jpg",130,124,18);thumbnails[1775609]=new thumbnail(1775609,"97549","ITEM # 1775609","2007-12-15_0011_thumb.jpg",130,125,18);thumbnails[1775500]=new thumbnail(1775500,"116374","ITEM # 1775500","03 2008_thumb.jpg",130,126,18);thumbnails[1775504]=new thumbnail(1775504,"116374","ITEM # 1775504  <br>\r\n","01 2008_thumb.jpg",130,133,18);thumbnails[1403657]=new thumbnail(1403657,"97547","ITEM # 1403657","PA076625_thumb.JPG",130,133,18);thumbnails[40358]=new thumbnail(40358,"97547","ITEM # 40358","image078_thumb.jpg",130,131,18);thumbnails[40340]=new thumbnail(40340,"97547","ITEM # 40340","image004_thumb.jpg",130,131,18);thumbnails[140285]=new thumbnail(140285,"12968","ITEM # 140285","PA076586 (2)_thumb.JPG",130,130,18);thumbnails[140286]=new thumbnail(140286,"12968","ITEM # 140286","PA076588 (2)_thumb.JPG",130,127,18);thumbnails[140287]=new thumbnail(140287,"12968","ITEM # 140287","PA076591 (2)_thumb.JPG",130,129,18);thumbnails[1403646]=new thumbnail(1403646,"97550","ITEM # 1403646","PA076621_thumb.jpg",130,134,18);thumbnails[40337]=new thumbnail(40337,"97550","ITEM # 40337","image002_thumb.jpg",130,128,18);thumbnails[40338]=new thumbnail(40338,"97550","ITEM # 40338","image001_thumb.jpg",130,128,18);thumbnails[1403645]=new thumbnail(1403645,"97550","ITEM # 1403645","P7186229_thumb.jpg",130,131,18);thumbnails[1403643]=new thumbnail(1403643,"97550","ITEM # 1403643","04380001_thumb.jpg",130,129,18);thumbnails[41035]=new thumbnail(41035,"4191","ITEM # 41035","P62745881 (2) (2)_thumb.jpg",130,130,18);thumbnails[40353]=new thumbnail(40353,"4191","ITEM # 40353","image072_thumb.jpg",130,134,18);thumbnails[41039]=new thumbnail(41039,"4191","ITEM # 41039","P62745811 (2) (2)_thumb.jpg",130,174,18);thumbnails[4342787]=new thumbnail(4342787,"4191","","EDUARD_019_2_thumb.jpg",130,175,18);thumbnails[4342263]=new thumbnail(4342263,"4191"," <br>\r\n","E16s_thumb.jpg",130,166,18);thumbnails[4342272]=new thumbnail(4342272,"4191","","E14s_thumb.jpg",130,162,18);thumbnails[4342385]=new thumbnail(4342385,"4191","","E15s_thumb.jpg",130,194,18);thumbnails[3033166]=new thumbnail(3033166,"4195","","03_thumb.jpg",130,104,18);thumbnails[65247]=new thumbnail(65247,"4266","ITEM # 65247","P9076225 (2)_thumb.JPG",130,106,18);thumbnails[65249]=new thumbnail(65249,"4266","ITEM # 65249","P9076203 (2)_thumb.JPG",130,100,18);thumbnails[65257]=new thumbnail(65257,"4266","ITEM # 65257","PA246691 (2)_thumb.JPG",130,83,18);thumbnails[65261]=new thumbnail(65261,"4266","ITEM # 65261","P9076232 (2)_thumb.JPG",130,30,18);thumbnails[65260]=new thumbnail(65260,"4266","ITEM # 65260","P9076230 (2)_thumb.JPG",130,32,18);thumbnails[41046]=new thumbnail(41046,"4265","","w2_thumb.jpg",130,64,18);thumbnails[41048]=new thumbnail(41048,"4265","","P62745551 (2) (2)_thumb.jpg",130,65,18);thumbnails[41047]=new thumbnail(41047,"4265","","P62745641 (2) (2)_thumb.jpg",130,63,18);thumbnails[4342251]=new thumbnail(4342251,"255553","","E11s_thumb.jpg",130,62,18);thumbnails[4342256]=new thumbnail(4342256,"255553","","E10s_thumb.jpg",130,64,18);thumbnails[3452894]=new thumbnail(3452894,"211072","ITEM # 163 2569<br>\r\n","a21_thumb.jpg",130,130,18);var galleries=new Object();galleries[319581]=new gallery(319581,"6420526","CANADIAN RHAPSODY 2010","gallery",[6420526]);galleries[319580]=new gallery(319580,"5636755","MORNING MIST","gallery",[5636755,5636761,5636762,5636764]);galleries[255543]=new gallery(255543,"4342416","NEW ART","gallery",[4342499,4342503,4144372,4342153,4342416,4144441,4342155,4342151]);galleries[255542]=new gallery(255542,"4144456",'NEW 36" x 36"',"gallery",[4144456,4144370,4144371,4144458]);galleries[247777]=new gallery(247777,"4144373","KAUAI ON MY MIND","gallery",[4144373,4342593,3033226,3033206,3033225,3033222,4342271]);galleries[255550]=new gallery(255550,"3033168","BLACK & WHITE WORLD","gallery",[3033168]);galleries[97549]=new gallery(97549,"1731622","NEW ABSTRACT ART","gallery",[1731622,1731624,1731626,1775610,1775609]);galleries[116374]=new gallery(116374,"1775500","POWER OF LOVE","gallery",[1775500,1775504]);galleries[97547]=new gallery(97547,"1403657,40340","TOGETHER","gallery",[1403657,40358,40340]);galleries[12968]=new gallery(12968,"140285","OUR FUTURE","gallery",[140285,140286,140287]);galleries[97550]=new gallery(97550,"1403646","CANADIAN RHAPSODY","gallery",[1403646,40337,40338,1403645,1403643]);galleries[4191]=new gallery(4191,"41035","REFLECTIONS","gallery",[41035,40353,41039,4342787,4342263,4342272,4342385]);galleries[4195]=new gallery(4195,"3033166","UNIVERSE","gallery",[3033166]);galleries[4266]=new gallery(4266,"65261,65260,65257,65249,65247","TUSCANY ON MY MIND","gallery",[65247,65249,65257,65261,65260]);galleries[4265]=new gallery(4265,"41046","CITYSCAPES II.","gallery",[41046,41048,41047]);galleries[255553]=new gallery(255553,"4342251","SEASCAPES","gallery",[4342251,4342256]);galleries[211072]=new gallery(211072,"3452894","HAWAIAN PETROGLYPHS","gallery",[3452894]);var imageSets=new Object();imageSets[1]="1403657";imageSets[2]="6420526,5636778,5636755,4342416,4342251,4342156,4144456,4144376,4144373,3452894,3033168,3033166,1775500,1731622,1403657,1403646,140289,140285,41046,41035,40340";imageSets[3]="6420526,5636778,5636764,5636762,5636761,5636755,4342787,4342593,4342503,4342499,4342416,4342408,4342406,4342385,4342272,4342271,4342263,4342256,4342251,4342162,4342160,4342157,4342156,4342155,4342153,4342151,4144458,4144456,4144455,4144454,4144451,4144441,4144376,4144373,4144372,4144371,4144370,3452895,3452894,3033226,3033225,3033222,3033206,3033168,3033166,1775610,1775609,1775504,1775500,1731626";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/ambrose/images";break}switch(a){case 1:b="http://www1.clikpic.com/ambrose/images";break}switch(a){case 2:b="http://admin.clikpic.com/ambrose/images";break}switch(a){case 24:b="http://tpc15/clikpic/ambrose/images";break}switch(a){case 4:b="http://www.clikchurch.com/ambrose/images";break}switch(a){case 5:b="http://www2.clikpic.com/ambrose/images";break}switch(a){case 22:b="http://tpc5/clikpic/ambrose/images";break}switch(a){case 23:b="http://tpc10/clikpic/ambrose/images";break}switch(a){case 25:b="http://tpc16/clikpic/ambrose/images";break}switch(a){case 15:b="http://www3.clikpic.com/ambrose/images";break}switch(a){case 18:b="http://www4.clikpic.com/ambrose/images";break}switch(a){case 19:b="http://www5.clikpic.com/ambrose/images";break}switch(a){case 31:b="http://www7.clikpic.com/ambrose/images";break}switch(a){case 32:b="http://admin2.clikpic.com/ambrose/images";break}switch(a){case 33:b="http://www8.clikpic.com/ambrose/images";break}switch(a){case 34:b="http://www9.clikpic.com/ambrose/images";break}switch(a){case 35:b="http://admin3.clikpic.com/ambrose/images";break}switch(a){case 37:b="http://admin4.clikpic.com/ambrose/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="ED AMBROSE: "+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> 				CN$"+(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+'")'})}}};