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[5011152]=new thumbnail(5011152,"228990","Hamstead_Heath.jpg","Oana_Hamstead_Heath_LR_10_of_11_thumb.jpg",130,195,32);thumbnails[5558227]=new thumbnail(5558227,"228990","Hot Pants","Farina_West-1_thumb.jpg",130,195,32);thumbnails[4726620]=new thumbnail(4726620,"228990","Whitehall","Trafalgar_LR-301_thumb.jpg",130,195,32);thumbnails[3752541]=new thumbnail(3752541,"228990","Lizzie from Italy","Lizzie_4_lr_thumb.jpg",130,182,32);thumbnails[5053796]=new thumbnail(5053796,"228990","Insect_Man","Till_Nude_2_of_1012_thumb.jpg",130,195,32);thumbnails[4726609]=new thumbnail(4726609,"228990","Oana_Marcu_portrait","Trafalgar_LR-43_thumb.jpg",130,195,32);thumbnails[4425089]=new thumbnail(4425089,"228990","Cloth and Male_Nude","cloth_thumb.jpg",130,87,32);thumbnails[5540789]=new thumbnail(5540789,"228990","Model for Sale","Model_for_Sale_4_lr-1_thumb.jpg",130,87,32);thumbnails[5561480]=new thumbnail(5561480,"228990","Fania_Gerald in Lingerie","Fania_1_lr_thumb.jpg",130,82,32);thumbnails[5540468]=new thumbnail(5540468,"228990","Champagne Jacuzzi","Champagne_Jacuzzi-1_thumb.jpg",130,195,32);thumbnails[4359344]=new thumbnail(4359344,"228990","Alexandra_Hamit shopping in Canary_Wharf","8_1_thumb.jpg",130,195,32);thumbnails[4633352]=new thumbnail(4633352,"228990","Neon Dancer","22_thumb.jpg",130,195,32);thumbnails[3595731]=new thumbnail(3595731,"163848","In the evening in my local park. March 09","Vicki_Park_Fountain_lr_thumb.jpg",130,87,32);thumbnails[2698808]=new thumbnail(2698808,"163848","City of Gold","City of Goldlr_thumb.jpg",130,85,32);thumbnails[2698922]=new thumbnail(2698922,"163848","Sunrise over Tower_Bridge<br>\r\n","Tower bridge sunset lr_thumb.jpg",130,86,32);thumbnails[2699001]=new thumbnail(2699001,"163848","God and Money","God and Money 2lr_thumb.jpg",130,80,32);thumbnails[3237429]=new thumbnail(3237429,"163848","Red Sunset over london","2a_thumb.jpg",130,86,32);thumbnails[3237431]=new thumbnail(3237431,"163848","The City of London","4a_thumb.jpg",130,93,32);thumbnails[3372787]=new thumbnail(3372787,"163848","Pickle at sunset Jan 09","sunset jan 09 Pickle lr_thumb.jpg",130,182,32);thumbnails[3414043]=new thumbnail(3414043,"163848","Broadgate Saturated","Broadgate saturated1_thumb.jpg",130,98,32);thumbnails[3414045]=new thumbnail(3414045,"163848","Canary Wharf Mist","Canary Wharf Mist_thumb.jpg",130,98,32);thumbnails[3414052]=new thumbnail(3414052,"163848","Post Office Tower","Pastel Post Office Tower_thumb.jpg",130,98,32);thumbnails[3733252]=new thumbnail(3733252,"163848","April 08 view of Victoria Park","Folly_Victoria_Park_lr_thumb.jpg",130,86,32);thumbnails[4252137]=new thumbnail(4252137,"163848","Battersea Power Station","battersea_power_station_lr_thumb.jpg",130,195,32);thumbnails[5053898]=new thumbnail(5053898,"163848","Fountain Man gets Spiritual","Fountain_Man_Gets_Spiritual_1_of_1_thumb.jpg",130,83,32);thumbnails[5539706]=new thumbnail(5539706,"163848","Post Office Tower.jpg","Post_Office_Tower_lr-1_thumb.jpg",130,86,32);thumbnails[5539755]=new thumbnail(5539755,"163848","Brick Lane, Trumans Brewery","Brick_Lane_Trumans_Brewery_lr-1_thumb.jpg",130,86,32);thumbnails[5559931]=new thumbnail(5559931,"163848","Victoria Park in the Mist","Victoria_Park__Dawn_LR-1_thumb.jpg",130,85,32);thumbnails[5575482]=new thumbnail(5575482,"163848","Broadgate Tower under construction, 2008","Broadgate_Tower_Purple-1_thumb.jpg",130,195,32);thumbnails[5596969]=new thumbnail(5596969,"163848","Autumn Jog","Victoria_Park_Jogger_lr-1_thumb.jpg",130,87,32);thumbnails[5589956]=new thumbnail(5589956,"316612","Footbal future","pat_James_football_2007_lr_thumb.jpg",130,87,32);thumbnails[5590715]=new thumbnail(5590715,"316612","All at Sea","Pat_triangle_2_thumb.jpg",130,87,32);thumbnails[5591181]=new thumbnail(5591181,"316612","Through the Window","Picture_004_thumb.jpg",130,93,32);thumbnails[5591258]=new thumbnail(5591258,"316612","Hiking","Picture_071_lr_thumb.jpg",130,93,32);thumbnails[5591322]=new thumbnail(5591322,"316612","Race","kids_running_lr_thumb.jpg",130,87,32);thumbnails[5591442]=new thumbnail(5591442,"316612","Birthday","James_is_3_thumb.jpg",130,87,32);thumbnails[5589954]=new thumbnail(5589954,"316612","santa's hat","Caitling_Xmas_Hat_thumb.jpg",130,195,32);thumbnails[5589951]=new thumbnail(5589951,"316612","Swing","caitlin_Swing_2007_lr_thumb.jpg",130,195,32);thumbnails[5591183]=new thumbnail(5591183,"316612","Beachcombing","Picture_033_thumb.jpg",130,182,32);thumbnails[4406316]=new thumbnail(4406316,"316612","Look what I found!","beach_lr_thumb.jpg",130,93,32);thumbnails[4217557]=new thumbnail(4217557,"316612","In from the Rain","8_thumb.jpg",130,87,32);thumbnails[4466513]=new thumbnail(4466513,"316612","James hangs on.","James_hangs_on_lr1_thumb.jpg",130,87,32);thumbnails[5611608]=new thumbnail(5611608,"316613","to the meeting","Corporate_photography1_thumb.jpg",130,86,32);thumbnails[5582879]=new thumbnail(5582879,"316613","The Team<br>\r\n","Bow_West_thumb.jpg",130,87,32);thumbnails[5596460]=new thumbnail(5596460,"316613","Barrister's Clerk","Clerk_304361AA-24E8-5EC4-4F9A11155778632C_thumb.jpg",130,87,32);thumbnails[5504515]=new thumbnail(5504515,"316613","Campaigning","Oona_King_lrjpg-1_thumb.jpg",130,89,32);thumbnails[5611671]=new thumbnail(5611671,"316613","The Annual Conference","Conference_photography_thumb.jpg",130,87,32);thumbnails[5500073]=new thumbnail(5500073,"316613","Bangla Flag","Alibor_Choudhury_lr-1_thumb.jpg",130,88,32);thumbnails[5582882]=new thumbnail(5582882,"316613","Got the Deal!","Got_the_Deal_thumb.jpg",130,195,32);thumbnails[5582877]=new thumbnail(5582877,"316613","Research or Espionage?","Adam_Danyal_lr_thumb.jpg",130,195,32);thumbnails[5594795]=new thumbnail(5594795,"316613","commanding","Commanding_lr-1_thumb.jpg",130,195,32);thumbnails[5594729]=new thumbnail(5594729,"316613","Canary Wharf Clocks","Canary_Wharf_Clock_Blue_lr-1_thumb.jpg",130,86,32);thumbnails[5589818]=new thumbnail(5589818,"316613","Citigroup","citigroup_lr_thumb.jpg",130,87,32);thumbnails[5591466]=new thumbnail(5591466,"316613","up and down","jubilee_escalators_thumb.jpg",130,78,32);thumbnails[5589359]=new thumbnail(5589359,"316613","Time Off","Buddhist_Retreat_-_reading-1_thumb.jpg",130,87,32);thumbnails[5611692]=new thumbnail(5611692,"316613","blue sky thinking","corporate_image_thumb.jpg",130,56,32);thumbnails[5593513]=new thumbnail(5593513,"316613","End of Play","Marc_and_Kabir_Approach_lr-1_thumb.jpg",130,87,32);thumbnails[5582874]=new thumbnail(5582874,"316613","It Takes Brains","jim_thinks_lr_thumb.jpg",130,195,32);thumbnails[5582876]=new thumbnail(5582876,"316613","Company Art","Two_Men_Canary_Wharf_lr_thumb.jpg",130,195,32);thumbnails[5589711]=new thumbnail(5589711,"316613","Teamwork","Marc_Lutfur_thumb.jpg",130,195,32);thumbnails[5607372]=new thumbnail(5607372,"316613","Blue Sky Portraits","Rajib_Ahmed_2_lr_thumb.jpg",130,195,32);var galleries=new Object();galleries[228990]=new gallery(228990,"4359344","Fashion","gallery",[5011152,5558227,4726620,3752541,5053796,4726609,4425089,5540789,5561480,5540468,4359344,4633352]);galleries[163848]=new gallery(163848,"5575482","Cities","gallery",[3595731,2698808,2698922,2699001,3237429,3237431,3372787,3414043,3414045,3414052,3733252,4252137,5053898,5539706,5539755,5559931,5575482,5596969]);galleries[316612]=new gallery(316612,"5589951","Kids","gallery",[5589956,5590715,5591181,5591258,5591322,5591442,5589954,5589951,5591183,4406316,4217557,4466513]);galleries[316613]=new gallery(316613,"5582874","Corporate","gallery",[5611608,5582879,5596460,5504515,5611671,5500073,5582882,5582877,5594795,5594729,5589818,5591466,5589359,5611692,5593513,5582874,5582876,5589711,5607372]);var imageSets=new Object();imageSets[1]="5053898";imageSets[2]="5589951,5582874,5575482,4359344";imageSets[3]="3752541";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/danmccurry/images";break}switch(a){case 1:b="http://www1.clikpic.com/danmccurry/images";break}switch(a){case 2:b="http://admin.clikpic.com/danmccurry/images";break}switch(a){case 24:b="http://tpc15/clikpic/danmccurry/images";break}switch(a){case 4:b="http://www.clikchurch.com/danmccurry/images";break}switch(a){case 5:b="http://www2.clikpic.com/danmccurry/images";break}switch(a){case 22:b="http://tpc5/clikpic/danmccurry/images";break}switch(a){case 23:b="http://tpc10/clikpic/danmccurry/images";break}switch(a){case 25:b="http://tpc16/clikpic/danmccurry/images";break}switch(a){case 15:b="http://www3.clikpic.com/danmccurry/images";break}switch(a){case 18:b="http://www4.clikpic.com/danmccurry/images";break}switch(a){case 19:b="http://www5.clikpic.com/danmccurry/images";break}switch(a){case 31:b="http://www7.clikpic.com/danmccurry/images";break}switch(a){case 32:b="http://admin2.clikpic.com/danmccurry/images";break}switch(a){case 33:b="http://www8.clikpic.com/danmccurry/images";break}switch(a){case 34:b="http://www9.clikpic.com/danmccurry/images";break}switch(a){case 35:b="http://admin3.clikpic.com/danmccurry/images";break}switch(a){case 37:b="http://admin4.clikpic.com/danmccurry/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="Dan McCurry 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+'")'})}}};