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[6622278]=new thumbnail(6622278,"362800","Cloch Point I","Cloch-Lighthouse-01_thumb.jpg",130,88,18);thumbnails[6622295]=new thumbnail(6622295,"362806","Electric Sheep","Electric-Sheep-01_thumb.jpg",130,83,18);thumbnails[6622438]=new thumbnail(6622438,"362798","20 Cadogan Street","Big-Stopper-031_thumb.jpg",130,114,18);thumbnails[6622465]=new thumbnail(6622465,"362798","A Dead Tree I","Dead-Tree-02_thumb.jpg",130,126,18);thumbnails[6622467]=new thumbnail(6622467,"362806","A Dead Tree II","Dead-Tree-03_thumb.jpg",130,130,18);thumbnails[6622491]=new thumbnail(6622491,"362811","Glasgow Icons I","Glasgow-Iconic-01_thumb.jpg",130,130,18);thumbnails[6622500]=new thumbnail(6622500,"362810","River Clyde","My-Glasgow-01_thumb.jpg",130,79,18);thumbnails[6622506]=new thumbnail(6622506,"362810","Clyde Pink I","Squinty-Bridge-01_thumb.jpg",130,84,18);thumbnails[6622512]=new thumbnail(6622512,"362809","Squinty Red I","Squinty-Bridge-02_thumb.jpg",130,85,18);thumbnails[6622516]=new thumbnail(6622516,"362809","Squinty Red II","Squinty-Bridge-03_thumb.jpg",130,130,18);thumbnails[6622868]=new thumbnail(6622868,"362800","Loch Leven I","Loch-Leven-01_thumb.jpg",130,194,18);thumbnails[6622875]=new thumbnail(6622875,"362800","Loch Leven II","Loch-Leven-02_thumb.jpg",130,88,18);thumbnails[6622884]=new thumbnail(6622884,"362800","Ballast Bank I","Ballast-Bank-02_thumb.jpg",130,89,18);thumbnails[6622892]=new thumbnail(6622892,"362800","Ballast Bank II","Ballast-Bank-03_thumb.jpg",130,83,18);thumbnails[6622898]=new thumbnail(6622898,"362800","Lady Isle I","Lady-Isle-02_thumb.jpg",130,187,18);thumbnails[6622904]=new thumbnail(6622904,"362800","Lady Isle II","Lady-Isle-03_thumb.jpg",130,86,18);thumbnails[6622914]=new thumbnail(6622914,"362811","Rouken Glen Frozen","Feeding-Ducks-01_thumb.jpg",130,108,18);thumbnails[6622922]=new thumbnail(6622922,"362811","Hard Landing","Hard-Landing-01_thumb.jpg",130,79,18);thumbnails[6622928]=new thumbnail(6622928,"362811","Iced Falls I","Iced-Falls-01_thumb.jpg",130,86,18);thumbnails[6622932]=new thumbnail(6622932,"362810","Iced Falls II","Iced-Falls-02_thumb.jpg",130,85,18);thumbnails[6625103]=new thumbnail(6625103,"362811","Bands of Stone","Banding-01_thumb.jpg",130,97,18);thumbnails[6625109]=new thumbnail(6625109,"362811","Only goodnight beloved","Cathcart-Cemetry-01_thumb.jpg",130,202,18);thumbnails[6625113]=new thumbnail(6625113,"362810","Cathcart Cemetery","Cathcart-Cemetry-02_thumb.jpg",130,43,18);thumbnails[6625252]=new thumbnail(6625252,"362800","Cloch Point II","Cloch-Lighthouse-01_BD0C2A91-24E8-5EC4-4F59A1045D44D3B6_thumb.jpg",130,84,18);thumbnails[6625254]=new thumbnail(6625254,"362800","Dunure Castle I","Dunure-Castle-01_thumb.jpg",130,198,18);thumbnails[6625257]=new thumbnail(6625257,"362800","Volcanic Ash Sunset I","Portencross-02_thumb.jpg",130,85,18);thumbnails[6625263]=new thumbnail(6625263,"362800","Volcanic Ash Sunset II","Portencross-04_thumb.jpg",130,85,18);thumbnails[6625265]=new thumbnail(6625265,"362798","Portencross Pier","Portencross-Pier-05_thumb.jpg",130,85,18);thumbnails[6625287]=new thumbnail(6625287,"362811","Glasgow School of Art ","School-of-Art-01_thumb.jpg",130,191,18);thumbnails[6625317]=new thumbnail(6625317,"362810","Glasgow School of Art","School-of-Art-02_thumb.jpg",130,88,18);thumbnails[6625318]=new thumbnail(6625318,"362809","Glasgow School of Art","School-of-Art-03_thumb.jpg",130,86,18);thumbnails[6625320]=new thumbnail(6625320,"362811","Mackintosh Rose","School-of-Art-04_thumb.jpg",130,199,18);thumbnails[6625321]=new thumbnail(6625321,"362800","Clyde Sunset I","Seamill-01_thumb.jpg",130,130,18);thumbnails[6625322]=new thumbnail(6625322,"362800","Clyde Sunset II","Seamill-03_thumb.jpg",130,83,18);thumbnails[6625327]=new thumbnail(6625327,"362809","Standing Guard","Statues-01_thumb.jpg",130,189,18);thumbnails[6625328]=new thumbnail(6625328,"362809","The Michell Library I","The-Mitchell-01_thumb.jpg",130,138,18);thumbnails[6625329]=new thumbnail(6625329,"362809","The Michell Library II","The-Mitchell-02_thumb.jpg",130,192,18);thumbnails[6625336]=new thumbnail(6625336,"362811","Wolfeson Building I","Wolfeson-04_thumb.jpg",130,129,18);thumbnails[6625340]=new thumbnail(6625340,"362811","Wolfeson Building II","Wolfeson-05_thumb.jpg",130,81,18);thumbnails[6625485]=new thumbnail(6625485,"362798","Clyde Union Pumps","Clyde-Union-Pumps-02_thumb.jpg",130,130,18);thumbnails[6625488]=new thumbnail(6625488,"362798","Ibrox Demolition","Demolition-01_thumb.jpg",130,85,18);thumbnails[6625494]=new thumbnail(6625494,"362810","Ibrox Demolition","Demolition-04_thumb.jpg",130,197,18);thumbnails[6625499]=new thumbnail(6625499,"362800","Dunure Castle II","Dunure-Castle-011_thumb.jpg",130,87,18);thumbnails[6625503]=new thumbnail(6625503,"362800","Dunure Castle III","Dunure-Castle-02_thumb.jpg",130,87,18);thumbnails[6625504]=new thumbnail(6625504,"362800","Dunure Castle IV","Dunure-Castle-03_thumb.jpg",130,84,18);thumbnails[6625506]=new thumbnail(6625506,"362800","Dunure Castle V","Dunure-Castle-04_thumb.jpg",130,87,18);thumbnails[6625507]=new thumbnail(6625507,"362800","Dunure Harbour","Dunure-Harbour-01_thumb.jpg",130,195,18);thumbnails[6625511]=new thumbnail(6625511,"362810","Eaglesham Church I","Eaglesham-Church-02_thumb.jpg",130,192,18);thumbnails[6625512]=new thumbnail(6625512,"362810","Eaglesham Church II","Eaglesham-Church-03_thumb.jpg",130,87,18);thumbnails[6625514]=new thumbnail(6625514,"362798","Eaglesham Church","Eaglesham-Church-04_thumb.jpg",130,82,18);thumbnails[6625530]=new thumbnail(6625530,"362798","High on Eaglesham Moor","Eaglesham-Moor-01_thumb.jpg",130,130,18);thumbnails[6625533]=new thumbnail(6625533,"362806","Goatfell I","Goatfell-01_thumb.jpg",130,208,18);thumbnails[6625534]=new thumbnail(6625534,"362806","Goatfell II","Goatfell-02_thumb.jpg",130,87,18);thumbnails[6625535]=new thumbnail(6625535,"362806","Goatfell III","Goatfell-03_thumb.jpg",130,87,18);thumbnails[6625537]=new thumbnail(6625537,"362806","Goatfell IV","Goatfell-04_thumb.jpg",130,195,18);thumbnails[6625540]=new thumbnail(6625540,"362806","Goatfell V","Goatfell-05_thumb.jpg",130,87,18);thumbnails[6625541]=new thumbnail(6625541,"362809","Golden Embers","golden-embers-01_thumb.jpg",130,81,18);thumbnails[6625543]=new thumbnail(6625543,"362811","University Quadrangle","Quadrangle-01_thumb.jpg",130,130,18);thumbnails[6625545]=new thumbnail(6625545,"362811","University Spire","Spire-01_thumb.jpg",130,130,18);thumbnails[6625546]=new thumbnail(6625546,"362811","Towers Old and New","Towers---Old--New-01_thumb.jpg",130,130,18);thumbnails[6625579]=new thumbnail(6625579,"362806","The Hermitage I","The-Hermitage-01_thumb.jpg",130,87,18);thumbnails[6625582]=new thumbnail(6625582,"362806","The Hermitage II","The-Hermitage-02_thumb.jpg",130,90,18);thumbnails[6625585]=new thumbnail(6625585,"362806","The Hermitage III","The-Hermitage-03_thumb.jpg",130,91,18);thumbnails[6625587]=new thumbnail(6625587,"362806","The Hermitage V","The-Hermitage-06_thumb.jpg",130,92,18);thumbnails[6625589]=new thumbnail(6625589,"362798","Balgray Reservoir","Water-02_thumb.jpg",130,87,18);thumbnails[6625597]=new thumbnail(6625597,"362811","Flowering Whitelees","Whitelees-01_thumb.jpg",130,135,18);thumbnails[6625601]=new thumbnail(6625601,"362810","Zippo's Circus","Zippos-Circus-01_thumb.jpg",130,72,18);thumbnails[6625603]=new thumbnail(6625603,"362798","Wolfson Building","Wolfson-Building-01_thumb.jpg",130,130,18);var galleries=new Object();galleries[362800]=new gallery(362800,"6625507,6625506,6625504,6625503,6625499,6625322,6625321,6625263,6625257,6625254","Coast","gallery",[6622278,6622868,6622875,6622884,6622892,6622898,6622904,6625252,6625254,6625257,6625263,6625321,6625322,6625499,6625503,6625504,6625506,6625507]);galleries[362810]=new gallery(362810,"6625601,6625512,6625511,6625494,6625317,6625113,6622932,6622506,6622500","Glasgow Colour","gallery",[6622500,6622506,6622932,6625113,6625317,6625494,6625511,6625512,6625601]);galleries[362806]=new gallery(362806,"6625587,6625585,6625582,6625579,6625540,6625537,6625535,6625534,6625533,6622467","Landscape","gallery",[6622295,6622467,6625533,6625534,6625535,6625537,6625540,6625579,6625582,6625585,6625587]);galleries[362798]=new gallery(362798,"6625603,6625589,6625530,6625514,6625488,6625485,6625265,6622465,6622438","Long Exposure","gallery",[6622438,6622465,6625265,6625485,6625488,6625514,6625530,6625589,6625603]);galleries[362809]=new gallery(362809,"6625541,6625329,6625328,6625327,6625318,6622516,6622512","Night Magic","gallery",[6622512,6622516,6625318,6625327,6625328,6625329,6625541]);galleries[362811]=new gallery(362811,"6625597,6625546,6625545,6625543,6625340,6625336,6625320,6625287,6625109,6625103","Shades of Glasgow","gallery",[6622491,6622914,6622922,6622928,6625103,6625109,6625287,6625320,6625336,6625340,6625543,6625545,6625546,6625597]);var imageSets=new Object();imageSets[1]="6625603,6625601,6625597,6625589,6625587,6625585,6625582,6625579,6625546,6625545,6625543,6625541,6625540,6625537,6625535,6625534,6625533,6625530,6625514,6625512,6625511,6625507,6625506,6625504,6625503,6625499,6625494,6625488,6625485,6625340,6625336,6625329,6625328,6625327,6625322,6625321,6625320,6625318,6625317,6625287,6625265,6625263,6625257,6625254,6625252,6625113,6625109,6625103,6622932,6622928";imageSets[3]="6625603,6625601,6625597,6625589,6625587,6625585,6625582,6625579,6625546,6625545,6625543,6625541,6625540,6625537,6625535,6625534,6625533,6625530,6625514,6625512,6625511,6625507,6625506,6625504,6625503,6625499,6625494,6625488,6625485,6625340,6625336,6625329,6625328,6625327,6625322,6625321,6625320,6625318,6625317,6625287,6625265,6625263,6625257,6625254,6625252,6625113,6625109,6625103,6622932,6622928";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/davidcation/images";break}switch(a){case 1:b="http://www1.clikpic.com/davidcation/images";break}switch(a){case 2:b="http://admin.clikpic.com/davidcation/images";break}switch(a){case 24:b="http://tpc15/clikpic/davidcation/images";break}switch(a){case 4:b="http://www.clikchurch.com/davidcation/images";break}switch(a){case 5:b="http://www2.clikpic.com/davidcation/images";break}switch(a){case 22:b="http://tpc5/clikpic/davidcation/images";break}switch(a){case 23:b="http://tpc10/clikpic/davidcation/images";break}switch(a){case 25:b="http://tpc16/clikpic/davidcation/images";break}switch(a){case 15:b="http://www3.clikpic.com/davidcation/images";break}switch(a){case 18:b="http://www4.clikpic.com/davidcation/images";break}switch(a){case 19:b="http://www5.clikpic.com/davidcation/images";break}switch(a){case 31:b="http://www7.clikpic.com/davidcation/images";break}switch(a){case 32:b="http://admin2.clikpic.com/davidcation/images";break}switch(a){case 33:b="http://www8.clikpic.com/davidcation/images";break}switch(a){case 34:b="http://www9.clikpic.com/davidcation/images";break}switch(a){case 35:b="http://admin3.clikpic.com/davidcation/images";break}switch(a){case 37:b="http://admin4.clikpic.com/davidcation/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="David Cation | 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;resizePhotoInfo({centre:true});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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};