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[5179974]=new thumbnail(5179974,"","Luz Bailando<br>\r\n","Luz_Bailando_thumb.jpg",130,171,15);thumbnails[5303190]=new thumbnail(5303190,"","Revelation","Revelation_thumb.jpg",130,164,15);thumbnails[5432236]=new thumbnail(5432236,"","","The_Crucible_thumb.jpg",130,166,15);thumbnails[5574723]=new thumbnail(5574723,"","Los Lagos","_los_lagos1_thumb.jpg",130,172,15);thumbnails[5727781]=new thumbnail(5727781,"","Genesis","Genesis_thumb.jpg",130,170,15);thumbnails[5854402]=new thumbnail(5854402,"","Monolith","Monolith_thumb.jpg",130,171,15);thumbnails[6052944]=new thumbnail(6052944,"","Ahí","Ahì_thumb.jpg",130,97,15);thumbnails[6241355]=new thumbnail(6241355,"","Signals","Signals_thumb.jpg",130,103,15);thumbnails[6435679]=new thumbnail(6435679,"","Taken","Taken_thumb.jpg",130,99,15);thumbnails[6643503]=new thumbnail(6643503,"","Grapes","Grapes-_thumb.jpg",130,171,15);thumbnails[4159491]=new thumbnail(4159491,"18386","SS. American Star. #1 . ","As_median_A3_PSg-1_thumb.jpg",130,102,15);thumbnails[5035738]=new thumbnail(5035738,"18386","Infinity Pool","Infinity_Pool_thumb.jpg",130,162,15);thumbnails[5035742]=new thumbnail(5035742,"18386","Wheeker","Wheeker_thumb.jpg",130,162,15);thumbnails[4203445]=new thumbnail(4203445,"18386","SS. American Star. #2.","American_Star_new_A4_Psg-4_thumb.jpg",130,101,15);thumbnails[4203450]=new thumbnail(4203450,"18386","Step Beach","Stepbeach_glow_A3_psg-5_thumb.jpg",130,99,15);thumbnails[5035746]=new thumbnail(5035746,"18386","Mused","Mused_thumb.jpg",130,164,15);thumbnails[4203455]=new thumbnail(4203455,"18386","El Cotillo Lighthouse","Cotillo_Lighthouse_Psg-7_thumb.jpg",130,101,15);thumbnails[4203459]=new thumbnail(4203459,"18386","Fire and Ice","Fire_and_ice_A3_PSG-8_thumb.jpg",130,99,15);thumbnails[4203463]=new thumbnail(4203463,"18386","SS. American Star. #3.","AS_SWELL_A3_PSG_-9_thumb.jpg",130,101,15);thumbnails[4203535]=new thumbnail(4203535,"129037","Los Lobos","Lobos_rainbowA3_psg-10_thumb.jpg",130,99,15);thumbnails[4203538]=new thumbnail(4203538,"129037","SS. American Star. #4.","as_glow_psg-11_thumb.jpg",130,102,15);thumbnails[4203539]=new thumbnail(4203539,"129037","Heavens Gate","Heavens_Gate_A3_Psg-12_thumb.jpg",130,104,15);thumbnails[4203545]=new thumbnail(4203545,"129037","The Journey Home","F_Psg-13_thumb.jpg",130,104,15);thumbnails[4203548]=new thumbnail(4203548,"129037","El Cotillo","new_psg-151_thumb.jpg",130,101,15);thumbnails[4203547]=new thumbnail(4203547,"129037","Wraiths","Wraiths_A3_psg-14_thumb.jpg",130,102,15);thumbnails[5035764]=new thumbnail(5035764,"129037","Birds","Birds_thumb.jpg",130,169,15);thumbnails[4951234]=new thumbnail(4951234,"129037","Who´s the Daddy.<br>\r\n","whosthedaddy1_thumb.jpg",130,108,15);thumbnails[5035779]=new thumbnail(5035779,"18643","Steps","Steps_thumb.jpg",130,170,15);thumbnails[5035783]=new thumbnail(5035783,"18643","Pool","Pool_thumb.jpg",130,169,15);thumbnails[4203555]=new thumbnail(4203555,"18643","Stripped","Stripped_psg-1-19_thumb.jpg",130,101,15);thumbnails[4203557]=new thumbnail(4203557,"18643","Millenia","step_revisted_A3__Psg-20_thumb.jpg",130,99,15);thumbnails[4203558]=new thumbnail(4203558,"18643","Lighting the Cloth","Aguas_verdes_psg_cc_copy-21_thumb.jpg",130,100,15);thumbnails[5035797]=new thumbnail(5035797,"18643","Teardrop","Teardrop_thumb.jpg",130,170,15);thumbnails[4203560]=new thumbnail(4203560,"18643","Pods","step_seaweed_2_psg-23_thumb.jpg",130,101,15);thumbnails[5035799]=new thumbnail(5035799,"18643","Ornate","Ornate_thumb.jpg",130,172,15);thumbnails[4203563]=new thumbnail(4203563,"18643","Untitled","swirl_psg-25_thumb.jpg",130,100,15);thumbnails[5035801]=new thumbnail(5035801,"18643","Cerebral","Cerebral_thumb.jpg",130,171,15);thumbnails[5035804]=new thumbnail(5035804,"18643","Nada Mas","Nada_Mas_thumb.jpg",130,172,15);thumbnails[5035808]=new thumbnail(5035808,"18643","Narcissi","Narcissi_thumb.jpg",130,169,15);thumbnails[5035810]=new thumbnail(5035810,"18643","Adrift","Adrift_thumb.jpg",130,169,15);thumbnails[5035814]=new thumbnail(5035814,"18643","Elemental","Elemental_thumb.jpg",130,176,15);thumbnails[5035675]=new thumbnail(5035675,"285035","The Ancient<br>\r\n","The_Ancient1_thumb.jpg",130,169,15);thumbnails[5035654]=new thumbnail(5035654,"285035","Gnome","Gnome1_thumb.jpg",130,169,15);thumbnails[5035669]=new thumbnail(5035669,"285035","Still Ill","Still_Ill1_thumb.jpg",130,167,15);thumbnails[5035652]=new thumbnail(5035652,"285035","Cadena Perpetua","Cadena_Perpetua1_thumb.jpg",130,169,15);thumbnails[6381990]=new thumbnail(6381990,"352995","","----------2_thumb.jpg",130,43,15);var galleries=new Object();galleries[18386]=new gallery(18386,"5035746,5035742,5035738,4203463,4203459,4203455,4203450,4203445,4159491","Seascapes Winter 2004 - 2005","gallery",[4159491,5035738,5035742,4203445,4203450,5035746,4203455,4203459,4203463]);galleries[129037]=new gallery(129037,"5035764,4951234,4203548,4203547,4203545,4203539,4203538,4203535","Seascapes 2006 - 2007","gallery",[4203535,4203538,4203539,4203545,4203548,4203547,5035764,4951234]);galleries[18643]=new gallery(18643,"5035814,5035810,5035808,5035804,5035801,5035799,5035797,5035783,5035779,4203563","Seascapes 2008 - 2009","gallery",[5035779,5035783,4203555,4203557,4203558,5035797,4203560,5035799,4203563,5035801,5035804,5035808,5035810,5035814]);galleries[285035]=new gallery(285035,"5035675,5035669,5035654,5035652","Fuerte Rocks","gallery",[5035675,5035654,5035669,5035652]);galleries[352995]=new gallery(352995,"6381990","  ","gallery",[6381990]);var imageSets=new Object();imageSets[1]="6643503";imageSets[3]="4951234,4203563,4203560,4203558,4203557,4203555,4203548,4203547,4203545,4203539,4203538,4203535,4203463,4203459,4203455,4203450,4203445,4159491";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/bemac/images";break}switch(a){case 1:b="http://www1.clikpic.com/bemac/images";break}switch(a){case 2:b="http://admin.clikpic.com/bemac/images";break}switch(a){case 24:b="http://tpc15/clikpic/bemac/images";break}switch(a){case 4:b="http://www.clikchurch.com/bemac/images";break}switch(a){case 5:b="http://www2.clikpic.com/bemac/images";break}switch(a){case 22:b="http://tpc5/clikpic/bemac/images";break}switch(a){case 23:b="http://tpc10/clikpic/bemac/images";break}switch(a){case 25:b="http://tpc16/clikpic/bemac/images";break}switch(a){case 15:b="http://www3.clikpic.com/bemac/images";break}switch(a){case 18:b="http://www4.clikpic.com/bemac/images";break}switch(a){case 19:b="http://www5.clikpic.com/bemac/images";break}switch(a){case 31:b="http://www7.clikpic.com/bemac/images";break}switch(a){case 32:b="http://admin2.clikpic.com/bemac/images";break}switch(a){case 33:b="http://www8.clikpic.com/bemac/images";break}switch(a){case 34:b="http://www9.clikpic.com/bemac/images";break}switch(a){case 35:b="http://admin3.clikpic.com/bemac/images";break}switch(a){case 37:b="http://admin4.clikpic.com/bemac/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="Daisychained-Photography.com: "+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>"}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> 				&euro;"+(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>Your choices for this photograph :- </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="daisychained-photography@hotmail.com">';b=b+'<input type="hidden" name="currency_code" value="EUR">';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="daisychained-photography@hotmail.com">';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+'")'})}}};