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[3402803]=new thumbnail(3402803,"73859","","_MG_1380_thumb.jpg",130,87,1);thumbnails[2585031]=new thumbnail(2585031,"73847","","_MG_3739_1_thumb.jpg",130,195,1);thumbnails[1917380]=new thumbnail(1917380,"73847","","_MG_6379_thumb.jpg",130,195,1);thumbnails[1917383]=new thumbnail(1917383,"73847","","_MG_6392_thumb.jpg",130,195,1);thumbnails[1649350]=new thumbnail(1649350,"73859","Rivers Edge, Thrapston","_MG_4594_RAW_DxO_web_thumb.jpg",130,87,1);thumbnails[1649348]=new thumbnail(1649348,"73859","Thrapston Lakes","IMG_2333_thumb.jpg",130,185,1);thumbnails[1649349]=new thumbnail(1649349,"73859","River Nene at Thrapston","IMG_2342_thumb.jpg",130,91,1);thumbnails[985570]=new thumbnail(985570,"73859","St Louis Arch","IMG_2017a_thumb.jpg",130,92,1);thumbnails[1282641]=new thumbnail(1282641,"73848","","IMG_1313-out-of-frame_thumb.jpg",130,92,1);thumbnails[985531]=new thumbnail(985531,"73859","Southern Ireland","IMG_16721_thumb.jpg",130,92,1);thumbnails[985533]=new thumbnail(985533,"73859","Southern Ireland","IMG_14841_thumb.jpg",130,92,1);thumbnails[985534]=new thumbnail(985534,"73859","Southern Ireland","IMG_1686_thumb.jpg",130,92,1);thumbnails[985537]=new thumbnail(985537,"73856","","IMG_16751_thumb.jpg",130,92,1);thumbnails[983582]=new thumbnail(983582,"73859","One of the many island in the Maldives taken from a seaplane","IMG_1151_thumb.jpg",130,87,1);thumbnails[983590]=new thumbnail(983590,"73859","Sunset in the Maldives","IMG_1454_thumb.jpg",130,87,1);thumbnails[983726]=new thumbnail(983726,"73856","","web-size-x-3-k-bike-2_thumb.jpg",130,68,1);thumbnails[1391743]=new thumbnail(1391743,"364953","Honeymoon in Maldives","IMG_1313-out-of-frame1_thumb.jpg",130,92,1);thumbnails[1571454]=new thumbnail(1571454,"73847","","_MG_3159_thumb.jpg",130,195,1);thumbnails[6681427]=new thumbnail(6681427,"364951","Red In The Clouds","_MG_2031_thumb.jpg",130,195,1);thumbnails[6681431]=new thumbnail(6681431,"364951","Eyes Of An Angel","Eyes_Of_A_Angel_thumb.jpg",130,177,1);thumbnails[6681433]=new thumbnail(6681433,"364951","Fingers","Fingers_thumb.jpg",130,92,1);thumbnails[6681496]=new thumbnail(6681496,"73845","","Image_5941_thumb.jpg",130,195,1);thumbnails[6681508]=new thumbnail(6681508,"73845","","IMG_4284-web_thumb.jpg",130,195,1);thumbnails[6681583]=new thumbnail(6681583,"73845","","IMG_8558_thumb.jpg",130,195,1);thumbnails[6681618]=new thumbnail(6681618,"364964","In A London Cab","_MG_2676b_thumb.jpg",130,199,1);thumbnails[6681664]=new thumbnail(6681664,"364964","Caught In A Web","_MG_8994a_thumb.jpg",130,87,1);thumbnails[6681670]=new thumbnail(6681670,"364964","Desolation with Beauty","_MG_4543_thumb.jpg",130,87,1);thumbnails[6681676]=new thumbnail(6681676,"364951","The Vampire Wife","_MG_5710sharpened_thumb.jpg",130,198,1);thumbnails[6681688]=new thumbnail(6681688,"364964","Drunk","_MG_7988a_thumb.jpg",130,86,1);thumbnails[6681736]=new thumbnail(6681736,"364964","Spider Lady","_MG_7128c_thumb.jpg",130,86,1);thumbnails[6681756]=new thumbnail(6681756,"364951","Alone In The Dark","_MG_5658c_thumb.jpg",130,199,1);thumbnails[6681855]=new thumbnail(6681855,"73845","","_MG_6901_thumb.jpg",130,195,1);thumbnails[6681904]=new thumbnail(6681904,"364964","Ripples in the lake","Ripples_thumb.jpg",130,195,1);thumbnails[6681906]=new thumbnail(6681906,"364964","Contemplation","_MG_2371_thumb.jpg",130,94,1);thumbnails[6681938]=new thumbnail(6681938,"364964","Dawn at the Lake","_MG_9233a_thumb.jpg",130,87,1);thumbnails[6681944]=new thumbnail(6681944,"364964","Claw","_MG_7597_thumb.jpg",130,195,1);thumbnails[6681955]=new thumbnail(6681955,"364964","Gunfight at Laredo","_MG_2285_thumb.jpg",130,87,1);thumbnails[6682065]=new thumbnail(6682065,"73845","","_MG_1451b_thumb.jpg",130,199,1);thumbnails[6682069]=new thumbnail(6682069,"364953","","_MG_7787_thumb.jpg",130,87,1);thumbnails[6682071]=new thumbnail(6682071,"364953","","_MG_7801_thumb.jpg",130,87,1);thumbnails[6682072]=new thumbnail(6682072,"364953","","_MG_7808_thumb.jpg",130,195,1);thumbnails[6682075]=new thumbnail(6682075,"364953","","_MG_7986_thumb.jpg",130,87,1);thumbnails[6682076]=new thumbnail(6682076,"364953","","_MG_8104_thumb.jpg",130,87,1);thumbnails[6682078]=new thumbnail(6682078,"364953","","_MG_8456_thumb.jpg",130,195,1);thumbnails[6682079]=new thumbnail(6682079,"364953","","_MG_8464_thumb.jpg",130,87,1);thumbnails[6682102]=new thumbnail(6682102,"73856","","_MG_8705_thumb.jpg",130,195,1);thumbnails[6682113]=new thumbnail(6682113,"73859","","_MG_4946_thumb.jpg",130,87,1);thumbnails[6682114]=new thumbnail(6682114,"73859","","_MG_5066_thumb.jpg",130,87,1);thumbnails[6682120]=new thumbnail(6682120,"73847","","_MG_7613_thumb.jpg",130,87,1);thumbnails[6682127]=new thumbnail(6682127,"73847","","_MG_1425a_thumb.jpg",130,195,1);thumbnails[6682128]=new thumbnail(6682128,"73847","","_MG_1475a_thumb.jpg",130,87,1);var galleries=new Object();galleries[364951]=new gallery(364951,"6681756,6681676,6681433,6681431,6681427","Digital Art","section434736",[6681427,6681431,6681433,6681676,6681756]);galleries[73847]=new gallery(73847,"6682128,6682127,6682120,2585031,1917383,1917380,1571454","Family","section104862",[2585031,1917380,1917383,1571454,6682120,6682127,6682128]);galleries[73848]=new gallery(73848,"1282641","Formal","section104862",[1282641]);galleries[73856]=new gallery(73856,"6682102,985537,983726","Harley Davidson","section104883",[985537,983726,6682102]);galleries[73845]=new gallery(73845,"6682065,6681855,6681583,6681508,6681496","Individual","section104862",[6681496,6681508,6681583,6681855,6682065]);galleries[73859]=new gallery(73859,"6682114,6682113,3402803,1649350,1649349,1649348,985570,985534,985533,985531","Landscapes","section104887",[3402803,1649350,1649348,1649349,985570,985531,985533,985534,983582,983590,6682113,6682114]);galleries[364964]=new gallery(364964,"6681955,6681944,6681938,6681906,6681904,6681736,6681688,6681670,6681664,6681618","Private Projects","section434739",[6681618,6681664,6681670,6681688,6681736,6681904,6681906,6681938,6681944,6681955]);galleries[364953]=new gallery(364953,"6682079,6682078,6682076,6682075,6682072,6682071,6682069,1391743","Weddings","section434738",[1391743,6682069,6682071,6682072,6682075,6682076,6682078,6682079]);var imageSets=new Object();imageSets[1]="2585031,1917383,1917380,1391743,1282641";imageSets[3]="6682128,6682127,6682120,6682114,6682113,6682102,6682079,6682078,6682076,6682075,6682072,6682071,6682069,6682065,6681955,6681944,6681938,6681906,6681904,6681855,6681756,6681736,6681688,6681676,6681670,6681664,6681618,6681583,6681508,6681496,6681433,6681431,6681427,3402803,2585031,1917383,1917380,1649350,1649349,1649348,1571454,1391743,1282641,985570,985537,985534,985533,985531,983726,983590";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/timrosier/images";break}switch(a){case 1:b="http://www1.clikpic.com/timrosier/images";break}switch(a){case 2:b="http://admin.clikpic.com/timrosier/images";break}switch(a){case 24:b="http://tpc15/clikpic/timrosier/images";break}switch(a){case 4:b="http://www.clikchurch.com/timrosier/images";break}switch(a){case 5:b="http://www2.clikpic.com/timrosier/images";break}switch(a){case 22:b="http://tpc5/clikpic/timrosier/images";break}switch(a){case 23:b="http://tpc10/clikpic/timrosier/images";break}switch(a){case 25:b="http://tpc16/clikpic/timrosier/images";break}switch(a){case 15:b="http://www3.clikpic.com/timrosier/images";break}switch(a){case 18:b="http://www4.clikpic.com/timrosier/images";break}switch(a){case 19:b="http://www5.clikpic.com/timrosier/images";break}switch(a){case 31:b="http://www7.clikpic.com/timrosier/images";break}switch(a){case 32:b="http://admin2.clikpic.com/timrosier/images";break}switch(a){case 33:b="http://www8.clikpic.com/timrosier/images";break}switch(a){case 34:b="http://www9.clikpic.com/timrosier/images";break}switch(a){case 35:b="http://admin3.clikpic.com/timrosier/images";break}switch(a){case 37:b="http://admin4.clikpic.com/timrosier/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("section434736"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section434736.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("section434736"!=""){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="Tim Rosier 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>Tim Rosier </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+'")'})}}};