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[3439165]=new thumbnail(3439165,"43837","FLATIRON, N.Y. 2008","FLATIRON2008_thumb.jpg",130,130,18);thumbnails[2846117]=new thumbnail(2846117,"43837","","BROOKLYN-BRIDGE-WEB_thumb.jpg",130,103,18);thumbnails[3439220]=new thumbnail(3439220,"43837","","montSAINTMICHEL_thumb.jpg",130,109,18);thumbnails[3439221]=new thumbnail(3439221,"43837","","MONTSAINTMICHEL2_thumb.jpg",130,130,18);thumbnails[3439243]=new thumbnail(3439243,"43837","","VENTANA-EN-EDAM_thumb.jpg",130,114,18);thumbnails[568239]=new thumbnail(568239,"43837","","arguis-copia_thumb.jpg",130,133,18);thumbnails[568248]=new thumbnail(568248,"43837","","BATTERSEAPOWERSTATION--copi_thumb.jpg",130,104,18);thumbnails[568260]=new thumbnail(568260,"43837","","ALHAMBRA-copia1_thumb.jpg",130,173,18);thumbnails[568271]=new thumbnail(568271,"43837","","cabarceno-copia_thumb.jpg",130,116,18);thumbnails[568275]=new thumbnail(568275,"43837","","CANAL-FRANCIA-copia_thumb.jpg",130,139,18);thumbnails[568280]=new thumbnail(568280,"43837","","cascada-monasterio-de-piedr_thumb.jpg",130,117,18);thumbnails[568282]=new thumbnail(568282,"43837","","CASCADA-ORDESA-copia_thumb.jpg",130,130,18);thumbnails[568285]=new thumbnail(568285,"43837","","CEMENTERIO-EN-LONDRES-2-cop_thumb.jpg",130,101,18);thumbnails[568286]=new thumbnail(568286,"43837","","CEMENTERIO-LONDRES-4-copia_thumb.jpg",130,105,18);thumbnails[568290]=new thumbnail(568290,"43837","","CENTRAL-PARK-copia_thumb.jpg",130,87,18);thumbnails[568292]=new thumbnail(568292,"43837","","desdeTRIJUEQUE-copia_thumb.jpg",130,132,18);thumbnails[568297]=new thumbnail(568297,"43837","","DESNUDO-A-BAJO-CERO-EN-NUEV_thumb.jpg",130,202,18);thumbnails[568302]=new thumbnail(568302,"43837","","EDINBURGH-copia_thumb.jpg",130,130,18);thumbnails[568304]=new thumbnail(568304,"43837","","EDINBURGH-panoramica-copia_thumb.jpg",130,72,18);thumbnails[568310]=new thumbnail(568310,"43837","","el rincon de los muertos, estocolmo copia_thumb.jpg",130,41,18);thumbnails[568314]=new thumbnail(568314,"43837","","ferroatlantica-copia_thumb.jpg",130,129,18);thumbnails[568315]=new thumbnail(568315,"43837","","FILA-india-EN-EL-CORAZON-DE_thumb.jpg",130,97,18);thumbnails[568316]=new thumbnail(568316,"43837","","GAMLA STAN copia_thumb.jpg",130,76,18);thumbnails[568318]=new thumbnail(568318,"43837","","harinera huesca copia 2_thumb.jpg",130,129,18);thumbnails[568319]=new thumbnail(568319,"43837","","nave-vikinga-copia_thumb.jpg",130,94,18);thumbnails[568321]=new thumbnail(568321,"43837","","New-York-1996,-homenaje-a-S_thumb.jpg",130,193,18);thumbnails[568322]=new thumbnail(568322,"43837","","PATIO-DE-PALACIO--copia_thumb.jpg",130,153,18);thumbnails[568327]=new thumbnail(568327,"43837","","puente-estocolmo-copia_thumb.jpg",130,129,18);thumbnails[568330]=new thumbnail(568330,"43837","","REFLEJO-EN-CENTRAL-PARK-cop_thumb.jpg",130,241,18);thumbnails[568332]=new thumbnail(568332,"43837","","rocas-y-agua-copia_thumb.jpg",130,130,18);thumbnails[568334]=new thumbnail(568334,"43837","","RUINAS-EN-EDINBURGH-copia-4_thumb.jpg",130,114,18);thumbnails[568344]=new thumbnail(568344,"43837","","SIERRA DE GUARA copia_thumb.jpg",130,133,18);thumbnails[1159916]=new thumbnail(1159916,"43837","","MAR_thumb.jpg",130,73,18);thumbnails[1159934]=new thumbnail(1159934,"43837","","ESCAPARATE MADRID_thumb.jpg",130,76,18);thumbnails[1159938]=new thumbnail(1159938,"43837","","SIERRA DE LAS NIEVES_thumb.jpg",130,73,18);thumbnails[1159950]=new thumbnail(1159950,"43837","","PLAYA DE MIJAS_thumb.jpg",130,97,18);thumbnails[1159955]=new thumbnail(1159955,"43837","","ARBOL EN MONTSERRAT_thumb.jpg",130,179,18);thumbnails[1159958]=new thumbnail(1159958,"43837","","NUBE Y OLA_thumb.jpg",130,128,18);thumbnails[1159959]=new thumbnail(1159959,"43837","","TOSSA DE MAR_thumb.jpg",130,113,18);thumbnails[573332]=new thumbnail(573332,"44264","","PAULA-copia_thumb.jpg",130,130,18);thumbnails[573334]=new thumbnail(573334,"44264","","paula-con-gafas-sol_thumb.jpg",130,134,18);thumbnails[573335]=new thumbnail(573335,"44264","","paulacolor-copia_thumb.jpg",130,112,18);thumbnails[573336]=new thumbnail(573336,"44264","","paula,en-la-ALHAMBRA-copia1_thumb.jpg",130,128,18);thumbnails[573340]=new thumbnail(573340,"44264","","PAULA-6-granada_thumb.jpg",130,98,18);thumbnails[573343]=new thumbnail(573343,"44264","","PAULA-5-en-granada_thumb.jpg",130,91,18);thumbnails[573344]=new thumbnail(573344,"44264","","PAULA-3-copia_thumb.jpg",130,90,18);thumbnails[573351]=new thumbnail(573351,"44264","","PAULA-2-copia_thumb.jpg",130,88,18);thumbnails[573354]=new thumbnail(573354,"44264","","PAULA-1-copia_thumb.jpg",130,165,18);thumbnails[573360]=new thumbnail(573360,"44264","","Puala-sentada_thumb.jpg",130,153,18);thumbnails[1159964]=new thumbnail(1159964,"44264","","PAULA VERANO 2006_thumb.jpg",130,101,18);thumbnails[1165254]=new thumbnail(1165254,"44264","","PAULA CON TOALLA 1999_thumb.jpg",130,87,18);thumbnails[3439227]=new thumbnail(3439227,"44264","","PAULA-en-nuevo-baztan_thumb.jpg",130,130,18);thumbnails[3439142]=new thumbnail(3439142,"83891","","ARCACHON_thumb.jpg",130,83,18);thumbnails[1159921]=new thumbnail(1159921,"83891","","MI LAVABO_thumb.jpg",130,94,18);thumbnails[1159930]=new thumbnail(1159930,"83891","","GERONA_thumb.jpg",130,100,18);thumbnails[1159945]=new thumbnail(1159945,"83891","","CEMENTERIO EN LONDRES_thumb.jpg",130,99,18);thumbnails[3439166]=new thumbnail(3439166,"83891","","Madrid_thumb.jpg",130,128,18);thumbnails[3439236]=new thumbnail(3439236,"83891","","RETRATO-CON-VALLA_thumb.jpg",130,81,18);thumbnails[3439238]=new thumbnail(3439238,"83891","","sombrasZEROfinal-copia_thumb.jpg",130,85,18);var galleries=new Object();galleries[43837]=new gallery(43837,"3439243,3439221,3439220,3439165,2846117,1159959,1159958,1159955,1159950,1159938","CUADERNO DE BITACORA","gallery",[3439165,2846117,3439220,3439221,3439243,568239,568248,568260,568271,568275,568280,568282,568285,568286,568290,568292,568297,568302,568304,568310,568314,568315,568316,568318,568319,568321,568322,568327,568330,568332,568334,568344,1159916,1159934,1159938,1159950,1159955,1159958,1159959]);galleries[44264]=new gallery(44264,"3439227,1165254,1159964,573360,573354,573351,573344,573343,573340,573336","PAULA","gallery",[573332,573334,573335,573336,573340,573343,573344,573351,573354,573360,1159964,1165254,3439227]);galleries[83891]=new gallery(83891,"3439238,3439236,3439166,3439142,1159945,1159930,1159921","HOLE AND HOLGA","gallery",[3439142,1159921,1159930,1159945,3439166,3439236,3439238]);var imageSets=new Object();imageSets[1]="3439243,3439238,3439236,3439227,3439221,3439220,3439166,3439165,3439142,2846117,1165254,1159964,1159959,1159958,1159955,1159950,1159945,1159938,1159934,1159930,1159921,1159916,573360,573354,573351,573344,573343,573340,573336,573335,573334,573332,568344,568334,568332,568330,568327,568322,568321,568319,568318,568316,568315,568314,568310,568304,568302,568297,568292,568290";imageSets[3]="3439243,3439238,3439236,3439227,3439221,3439220,3439166,3439165,3439142,2846117,1165254,1159964,1159959,1159958,1159955,1159950,1159945,1159938,1159934,1159930,1159921,1159916,573360,573354,573351,573344,573343,573340,573336,573335,573334,573332,568344,568334,568332,568330,568327,568322,568321,568319,568318,568316,568315,568314,568310,568304,568302,568297,568292,568290";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 34:b="http://www9.clikpic.com/csphoto/images";break}switch(a){case 1:b="http://www1.clikpic.com/csphoto/images";break}switch(a){case 2:b="http://admin.clikpic.com/csphoto/images";break}switch(a){case 4:b="http://www.clikchurch.com/csphoto/images";break}switch(a){case 5:b="http://www2.clikpic.com/csphoto/images";break}switch(a){case 15:b="http://www3.clikpic.com/csphoto/images";break}switch(a){case 21:b="http://www6.clikpic.com/csphoto/images";break}switch(a){case 18:b="http://www4.clikpic.com/csphoto/images";break}switch(a){case 19:b="http://www5.clikpic.com/csphoto/images";break}switch(a){case 22:b="http://tpc5/clikpic/csphoto/images";break}switch(a){case 23:b="http://tpc10/clikpic/csphoto/images";break}switch(a){case 24:b="http://tpc15/clikpic/csphoto/images";break}switch(a){case 25:b="http://tpc16/clikpic/csphoto/images";break}switch(a){case 31:b="http://www7.clikpic.com/csphoto/images";break}switch(a){case 32:b="http://admin2.clikpic.com/csphoto/images";break}switch(a){case 33:b="http://www8.clikpic.com/csphoto/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="Carlos Sanchez 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>"}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+"</p>";var e=c.purchase_instruction;var d=c.item_price;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="carlos1960sb@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="carlos1960sb@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+'")'})}}};