function photo(j,c,p,t,d,k,h,r,v,o,m,s,a,n,g,l,b,u,q,f,e){this.id=j;this.galleries_id=c;this.photo_ref=p;this.section_code=t;this.src=d;this.width=k;this.height=h;this.caption=r;this.thumbnail=v;this.thumbnail_width=o;this.thumbnail_height=m;this.home=s;this.gallery=a;this.description=n;this.takendate=g;this.photographer=l;this.location=b;this.item_price=u;this.purchase_instruction=q;this.payment_groups_id=f;this.server_id=e;this.src=getServerPath(this.server_id)+"/"+this.src;this.thumbnail=getServerPath(this.server_id)+"/"+this.thumbnail}function gallery(e,c,d,b,a){this.id=e;this.featured_images=c;this.title=d;this.section_code=b;this.photoIDs=a}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 photos=new Object();photos[3507216]=new photo(3507216,"214515","","gallery","Bus lane.jpg",267,400,"Bus Lane","Bus lane_thumb.jpg",130,195,0,0,"A Cab driver waits in a queue at Kings Cross Station ","","John Violet","Kings Cross Station London","","","",1);photos[3507212]=new photo(3507212,"214515","","gallery","Feeding the birds, Hampstead Heath.jpg",600,400,"Feeding the Birds on Hampstead Heath","Feeding the birds, Hampstead Heath_thumb.jpg",130,87,0,0,"Two children feed the birds on ponds on Hampstead Heath, North London","","John Violet","","","","",1);photos[3863265]=new photo(3863265,"234958","","gallery","Boats_in_Harbour_Wellington_city_iii.jpg",600,400,"Boats in Harbour","Boats_in_Harbour_Wellington_city_iii_thumb.jpg",130,87,0,0,"Boats moored in the harbour in Wellington city","","","","","","",1);photos[3507213]=new photo(3507213,"214515","","gallery","Battersea Powerstation.jpg",600,400,"Battersea Power Station","Battersea Powerstation_thumb.jpg",130,87,0,0,"A pedestrian walks past Battersea Power Station","","John Violet","Battersea","","","",1);photos[3863266]=new photo(3863266,"","","","Xephometer_ii_Wellington.jpg",267,400,"Zephromyter","Xephometer_ii_Wellington_thumb.jpg",130,195,0,0,"","","","","","","",1);photos[3507215]=new photo(3507215,"214515","","gallery","Bridge.jpg",267,400,"Bridge Walkers","Bridge_thumb.jpg",130,195,0,0,"A couple of pedestrians walk on a bridge across the river Thames on a bright spring morning","","John Violet","South Bank, London","","","",1);photos[3863267]=new photo(3863267,"234958","Fence and Sails","gallery","Fence_and_Sails_Eastbourne.jpg",600,400,"","Fence_and_Sails_Eastbourne_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3507218]=new photo(3507218,"214515","","gallery","City hall I.jpg",600,400,"City Hall","City hall I_thumb.jpg",130,87,0,0,"A child walks in the ground of City Hall, London","","John Violet","South Bank, London","","","",1);photos[3863268]=new photo(3863268,"234958","","gallery","Downtown_Wellington_ii.jpg",267,400,"Downtown Wellington","Downtown_Wellington_ii_thumb.jpg",130,195,0,0,"","","","","","","",1);photos[3507219]=new photo(3507219,"214515","","gallery","Couples.jpg",600,400,"Couples","Couples_thumb.jpg",130,87,0,0,"A couple sit by the canalside in Camden Town","","John Violet","Camden Town, London","","","",1);photos[3863269]=new photo(3863269,"234958","","gallery","Wellington_Hills.jpg",600,400,"Wellington hills","Wellington_Hills_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3507220]=new photo(3507220,"214515","","gallery","Cyclist.jpg",600,400,"Cyclist","Cyclist_thumb.jpg",130,87,0,0,"A cyclist rides through a pedestrian tunnel running next to a canal crossing North London","","John Violet","Paddington, London","","","",1);photos[3863270]=new photo(3863270,"234958","","gallery","Wind_and_Sun.jpg",267,400,"Wind and Sun","Wind_and_Sun_thumb.jpg",130,195,1,1,"","","","","","","",1);photos[3507221]=new photo(3507221,"214515","","gallery","Mia.jpg",267,400,"Child","Mia_thumb.jpg",130,195,0,0,"A child looks out across the River Thames","","John Violet","South Bank, London","","","",1);photos[3863271]=new photo(3863271,"","","","Interislander_approaching_Wellington.jpg",600,400,"","Interislander_approaching_Wellington_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3507222]=new photo(3507222,"214515","","gallery","Pedestrians.jpg",600,400,"Pedestrians","Pedestrians_thumb.jpg",130,87,0,0,"Pedestrians cross the Millenium Bridge with the Tate modern museum in the background","","John Violet","South Bank, London","","","",1);photos[3863272]=new photo(3863272,"","Regatta","","Regatta_April_2009_Worser_Bay.jpg",600,400,"","Regatta_April_2009_Worser_Bay_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3507223]=new photo(3507223,"214515","","gallery","Red DJ.jpg",262,400,"Red DJ","Red DJ_thumb.jpg",130,198,0,0,"A DJ performs in the foyer of the Roundhouse, Camden town, London","","John Violet","Camden town, London","","","",1);photos[3507224]=new photo(3507224,"214515","","gallery","Red People.jpg",267,400,"Red People","Red People_thumb.jpg",130,195,0,0,"City workers in Canary Wharf, East London","","John Violet","Canary Wharf, London","","","",1);photos[3863273]=new photo(3863273,"234958","","gallery","Wind_sculpture.jpg",267,400,"Wind sculpture","Wind_sculpture_thumb.jpg",130,195,0,0,"","","","","","","",1);photos[3507225]=new photo(3507225,"214515","","gallery","Stuckley Place, Camden Town.jpg",267,400,"Stuckley Place","Stuckley Place, Camden Town_thumb.jpg",130,195,1,1,"Pedestrians chat in the street in Camden town on a  bright summers afternoon","","John Violet","Camden Town, London","","","",1);photos[3863274]=new photo(3863274,"234958","","gallery","Road_to_Wellington.jpg",600,400,"","Road_to_Wellington_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3863275]=new photo(3863275,"234958","","gallery","Watching_the_Boats.jpg",600,400,"Watching the boats","Watching_the_Boats_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3863276]=new photo(3863276,"234958","","gallery","Wind_sculptures_Wellington_City.jpg",267,400,"Wind sculptures","Wind_sculptures_Wellington_City_thumb.jpg",130,195,0,0,"","","","","","","",1);photos[3863277]=new photo(3863277,"","","","Scorching_Bay_iv.jpg",600,400,"Scorching bay","Scorching_Bay_iv_thumb.jpg",130,87,0,0,"","","","","","","",1);photos[3863278]=new photo(3863278,"234958","","gallery","Shipping_heading_out_of_Wellington.jpg",600,400,"Boat heading out to sea","Shipping_heading_out_of_Wellington_thumb.jpg",130,87,0,0,"","","","","","","",1);var thumbnails=new Object();thumbnails[3507216]=new thumbnail(3507216,"214515","Bus Lane","Bus lane_thumb.jpg",130,195,1);thumbnails[3507212]=new thumbnail(3507212,"214515","Feeding the Birds on Hampstead Heath","Feeding the birds, Hampstead Heath_thumb.jpg",130,87,1);thumbnails[3863265]=new thumbnail(3863265,"234958","Boats in Harbour","Boats_in_Harbour_Wellington_city_iii_thumb.jpg",130,87,1);thumbnails[3507213]=new thumbnail(3507213,"214515","Battersea Power Station","Battersea Powerstation_thumb.jpg",130,87,1);thumbnails[3863266]=new thumbnail(3863266,"","Zephromyter","Xephometer_ii_Wellington_thumb.jpg",130,195,1);thumbnails[3507215]=new thumbnail(3507215,"214515","Bridge Walkers","Bridge_thumb.jpg",130,195,1);thumbnails[3863267]=new thumbnail(3863267,"234958","","Fence_and_Sails_Eastbourne_thumb.jpg",130,87,1);thumbnails[3507218]=new thumbnail(3507218,"214515","City Hall","City hall I_thumb.jpg",130,87,1);thumbnails[3863268]=new thumbnail(3863268,"234958","Downtown Wellington","Downtown_Wellington_ii_thumb.jpg",130,195,1);thumbnails[3507219]=new thumbnail(3507219,"214515","Couples","Couples_thumb.jpg",130,87,1);thumbnails[3863269]=new thumbnail(3863269,"234958","Wellington hills","Wellington_Hills_thumb.jpg",130,87,1);thumbnails[3507220]=new thumbnail(3507220,"214515","Cyclist","Cyclist_thumb.jpg",130,87,1);thumbnails[3863270]=new thumbnail(3863270,"234958","Wind and Sun","Wind_and_Sun_thumb.jpg",130,195,1);thumbnails[3507221]=new thumbnail(3507221,"214515","Child","Mia_thumb.jpg",130,195,1);thumbnails[3863271]=new thumbnail(3863271,"","","Interislander_approaching_Wellington_thumb.jpg",130,87,1);thumbnails[3507222]=new thumbnail(3507222,"214515","Pedestrians","Pedestrians_thumb.jpg",130,87,1);thumbnails[3863272]=new thumbnail(3863272,"","","Regatta_April_2009_Worser_Bay_thumb.jpg",130,87,1);thumbnails[3507223]=new thumbnail(3507223,"214515","Red DJ","Red DJ_thumb.jpg",130,198,1);thumbnails[3507224]=new thumbnail(3507224,"214515","Red People","Red People_thumb.jpg",130,195,1);thumbnails[3863273]=new thumbnail(3863273,"234958","Wind sculpture","Wind_sculpture_thumb.jpg",130,195,1);thumbnails[3507225]=new thumbnail(3507225,"214515","Stuckley Place","Stuckley Place, Camden Town_thumb.jpg",130,195,1);thumbnails[3863274]=new thumbnail(3863274,"234958","","Road_to_Wellington_thumb.jpg",130,87,1);thumbnails[3863275]=new thumbnail(3863275,"234958","Watching the boats","Watching_the_Boats_thumb.jpg",130,87,1);thumbnails[3863276]=new thumbnail(3863276,"234958","Wind sculptures","Wind_sculptures_Wellington_City_thumb.jpg",130,195,1);thumbnails[3863277]=new thumbnail(3863277,"","Scorching bay","Scorching_Bay_iv_thumb.jpg",130,87,1);thumbnails[3863278]=new thumbnail(3863278,"234958","Boat heading out to sea","Shipping_heading_out_of_Wellington_thumb.jpg",130,87,1);var galleries=new Object();galleries[214515]=new gallery(214515,"3507225","London Life","gallery",[3507216,3507212,3507213,3507215,3507218,3507219,3507220,3507221,3507222,3507223,3507224,3507225]);galleries[234958]=new gallery(234958,"3863270","Windy Wellington","gallery",[3863265,3863267,3863268,3863269,3863270,3863273,3863274,3863275,3863276,3863278]);var imageSets=new Object();imageSets[1]="3863270,3507225";imageSets[2]="3863270,3507225";imageSets[3]="3863278,3863277,3863276,3863275,3863274,3863273,3863272,3863271,3863270,3863269,3863268,3863267,3863266,3863265,3507225,3507224,3507223,3507222,3507221,3507220,3507219,3507218,3507216,3507215,3507213,3507212";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 1:b="http://www1.clikpic.com/johnviolet/images";break}switch(a){case 2:b="http://admin.clikpic.com/johnviolet/images";break}switch(a){case 4:b="http://www.clikchurch.com/johnviolet/images";break}switch(a){case 5:b="http://www2.clikpic.com/johnviolet/images";break}switch(a){case 15:b="http://www3.clikpic.com/johnviolet/images";break}switch(a){case 21:b="http://www6.clikpic.com/johnviolet/images";break}switch(a){case 18:b="http://www4.clikpic.com/johnviolet/images";break}switch(a){case 19:b="http://www5.clikpic.com/johnviolet/images";break}switch(a){case 22:b="http://tpc5/clikpic/johnviolet/images";break}switch(a){case 23:b="http://tpc10/clikpic/johnviolet/images";break}switch(a){case 24:b="http://tpc15/clikpic/johnviolet/images";break}switch(a){case 25:b="http://tpc16/clikpic/johnviolet/images";break}switch(a){case 31:b="http://www7.clikpic.com/johnviolet/images";break}switch(a){case 32:b="http://admin2.clikpic.com/johnviolet/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(photos[imageID].galleries_id!=""){html+='<a href="'+photos[imageID].section_code+"_"+photos[imageID].galleries_id+'.html">'}else{html+='<a href="gallery.html">'}}html+='<img src="'+photos[imageID].src+'" width="'+photos[imageID].width+'" height="'+photos[imageID].height+'" class="mainhomepageimage photo" id="mainSample" name="mainSample" alt="'+photos[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").text(photos[f].caption);document.title="The Violet Gallery: "+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(){if(addItemToBasket(document.getElementById("paymentForm"))){if($.browser.msie){$("#paymentConfirm").show()}else{$("#paymentConfirm").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+"</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+'<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=photos[c].src;var b=$(a);if(b.size()>0){if(/\bimg$/.test(a)){b.attr({src:d})}else{b.css({"background-image":'url("'+d+'")'})}}};