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[3810335]=new thumbnail(3810335,"231969","Margaret Gardner, Director of Communications, at aid charity Practical Action","Clikpic0271_thumb.jpg",130,88,5);thumbnails[3810336]=new thumbnail(3810336,"231969","Sir Trevor McDonald with Sharon Doughty and characters from children's charity Kids Taskforce","Clikpic0831_thumb.jpg",130,87,5);thumbnails[3810337]=new thumbnail(3810337,"231969","Esther Rantzen supporting the Anti Bullying Campaign","ER2Oct06_thumb.jpg",106,130,5);thumbnails[3810338]=new thumbnail(3810338,"231969","Harry Hill promoting his book Tim the Tiny Horse ","HH05edit_thumb.jpg",94,130,5);thumbnails[3810361]=new thumbnail(3810361,"231969","Gordon Brown and young people from the Anti-Bullying Alliance","Clikpic0531_thumb.jpg",130,87,5);thumbnails[3810339]=new thumbnail(3810339,"231969","Rhona Cameron promoting her new book The Naked Drinking Club","RCameron_thumb.jpg",90,130,5);thumbnails[3810362]=new thumbnail(3810362,"231969","Sarah Walters at the York Lesbian Arts Festival","SWalters_thumb.jpg",115,130,5);thumbnails[3810360]=new thumbnail(3810360,"231969","Mediatheque at BFI Southbank","Clikpic0511_thumb.jpg",130,99,5);thumbnails[3810359]=new thumbnail(3810359,"231969","Benugo Bar at BFI Southbank","Clikpic0161_thumb.jpg",130,90,5);thumbnails[3810659]=new thumbnail(3810659,"231969","Parker McMillan Sessions","PM250407e173_thumb.jpg",130,87,5);thumbnails[4928672]=new thumbnail(4928672,"231969","Royal College of Physicians ","DaretoSpeak6a_thumb.jpg",130,93,5);thumbnails[4928671]=new thumbnail(4928671,"231969","Professor Jonathan Elford of City University speaking at the Naz Project London Dare to Speak Conference   ","DaretoSpeak48a_thumb.jpg",130,97,5);thumbnails[4930378]=new thumbnail(4930378,"231969","Brian Teixeira, Chief Executive, speaking at the Dare to Speak Conference at the Royal College of Physicians London","DaretoSpeak98a_thumb.jpg",95,130,5);thumbnails[4930489]=new thumbnail(4930489,"231969","Yusef Azad, Director of Policy and Campaigns, NAT, speaking at the Naz Project London's Dare to Speak Conference","DaretoSpeak111a_thumb.jpg",92,130,5);thumbnails[4928674]=new thumbnail(4928674,"231969","Delegates at the Race Equality Foundation Annual Conference Stronger Families Stronger Communities at SOAS in London","SFSC51a_thumb.jpg",130,87,5);thumbnails[4928673]=new thumbnail(4928673,"231969","Delegates at the Race Equality Foundation Annual Conference Stronger Families Stronger Communities held at SOAS London","SFSC27a_thumb.jpg",130,87,5);thumbnails[4928675]=new thumbnail(4928675,"231969","Jabeer Butt, Chair of the Race Equality Foundation, speaking at the Annual Stronger Families Stronger Communities Conference  ","SFSC61a_thumb.jpg",130,97,5);thumbnails[4930380]=new thumbnail(4930380,"231969","Yasmin Alibhai-Brown speaking at the Race Equality Foundation's Annual Stronger Families Stronger Communities Conference","SFSC109a_thumb.jpg",110,130,5);thumbnails[4930383]=new thumbnail(4930383,"231969","Delegate at the Race Equality Foundation's Annual Conference Stronger Families Stronger Communities","SFSC74a_thumb.jpg",87,130,5);thumbnails[4930387]=new thumbnail(4930387,"231969","Joanna Moorhead, journalist, speaking at the Race Equality Foundation's Annual Stronger Families Stronger Communities Conference","SFSC96a_thumb.jpg",130,87,5);thumbnails[4930385]=new thumbnail(4930385,"231969","Delegate at the Race Equality Foundation's Annual Stronger Families Stronger Communities Conference","SFSC78a_thumb.jpg",116,130,5);thumbnails[5450873]=new thumbnail(5450873,"231969","Jane Lane speaking at the launch of her new book Young Children and Racial Justice at the House of Lords","JLaneHoL57_thumb.jpg",130,87,5);thumbnails[5450872]=new thumbnail(5450872,"231969","Lord Navnit Dholakia speaking at the launch of Jane Lane's book at the House of Lords","JLaneHoL-99_thumb.jpg",130,89,5);thumbnails[5450869]=new thumbnail(5450869,"231969","Meryl Shepherd speaking at the launch of Jane Lane's book at the House of Lords","JLaneHoL-117_thumb.jpg",130,89,5);thumbnails[5450870]=new thumbnail(5450870,"231969","Guest at the reception of Jane Lane's book launch at the House of Lords ","JLaneHoL-2_thumb.jpg",130,83,5);thumbnails[5450871]=new thumbnail(5450871,"231969","Guest at the reception of Jane Lane's book launch at the House of Lords","JLaneHoL-23_copy_thumb.jpg",130,89,5);thumbnails[5451249]=new thumbnail(5451249,"231969","Greg Dyke giving the keynote speech at the Work Foundation's Workworld Media Awards ","WF2010AMA-3sml_copy_thumb.jpg",130,74,5);thumbnails[5451250]=new thumbnail(5451250,"231969","Will Hutton, Executive Vice Chair of The Work Foundation, speaking at the Workworld Media Awards  ","WF2010AMA-41sml_thumb.jpg",130,87,5);thumbnails[5451248]=new thumbnail(5451248,"231969","Vincent De Rivaz, EDF Energy Chief Executive, speaking at The Work Foundation's WorkWorld Media Awards ","WF2010AMA-1sml_copy_thumb.jpg",130,81,5);thumbnails[5451251]=new thumbnail(5451251,"231969","Guest at the reception of The Work Foundation Workworld Media Awards","WF2010AMA-82sml_thumb.jpg",130,87,5);thumbnails[5451252]=new thumbnail(5451252,"231969","Will Hutton with guests at the reception of The Work Foundation's Workworld Media Awards ","WF2010AMA-86_thumb.jpg",130,77,5);thumbnails[5431233]=new thumbnail(5431233,"306926","","samappa_027_thumb.jpg",130,87,5);thumbnails[3810294]=new thumbnail(3810294,"232098","","IsvaraMar07131C_thumb.jpg",87,130,5);thumbnails[3810292]=new thumbnail(3810292,"232098","","Clikpic01212_thumb.jpg",130,93,5);thumbnails[3810293]=new thumbnail(3810293,"232098","","Clikpic03112_thumb.jpg",130,88,5);thumbnails[3810295]=new thumbnail(3810295,"232098","","Zoe_HP164esf_thumb.jpg",130,101,5);thumbnails[4311566]=new thumbnail(4311566,"232098","","AudenFinal-44_copy_thumb.jpg",130,87,5);thumbnails[3810291]=new thumbnail(3810291,"232098","","BL163_thumb.jpg",87,130,5);thumbnails[3810303]=new thumbnail(3810303,"232098","","Parul266edit_thumb.jpg",130,86,5);thumbnails[3810306]=new thumbnail(3810306,"232098","","Victor089_thumb.jpg",87,130,5);thumbnails[3810305]=new thumbnail(3810305,"232098","","Ruben_thumb.jpg",130,87,5);thumbnails[3810304]=new thumbnail(3810304,"232098","","Rosie1a_thumb.jpg",93,130,5);thumbnails[3810302]=new thumbnail(3810302,"232098","","MWR08e54_thumb.jpg",97,130,5);thumbnails[4472082]=new thumbnail(4472082,"280518","Arc De Triomphe","LDT113_thumb.jpg",89,130,5);thumbnails[4472083]=new thumbnail(4472083,"280518","Tour Eiffel","Tour_Eiffel212_thumb.jpg",130,87,5);thumbnails[3810358]=new thumbnail(3810358,"280518","Street Scene in Soho","Clikpic0011_thumb.jpg",130,87,5);thumbnails[3810673]=new thumbnail(3810673,"280518","Big Ben","Clikpic0171_thumb.jpg",130,87,5);thumbnails[3810674]=new thumbnail(3810674,"280518","Canary Wharf","Clikpic0291_thumb.jpg",130,87,5);thumbnails[3810675]=new thumbnail(3810675,"280518","Hayward Gallery","Clikpic0421_thumb.jpg",130,92,5);thumbnails[3810676]=new thumbnail(3810676,"280518","Houses of Parliament","Clikpic0431_thumb.jpg",130,87,5);thumbnails[3810677]=new thumbnail(3810677,"280518","Former Greater London Council Building","Clikpic0501_thumb.jpg",130,89,5);thumbnails[3810685]=new thumbnail(3810685,"280518","National Portrait Gallery ","Clikpic0521_thumb.jpg",130,91,5);thumbnails[3810686]=new thumbnail(3810686,"280518","St Paul's Cathedral","Clikpic0811_thumb.jpg",130,83,5);thumbnails[3810687]=new thumbnail(3810687,"280518","Times Square","Clikpic0821_thumb.jpg",130,87,5);thumbnails[3810688]=new thumbnail(3810688,"280518","Trafalgar Square","Clikpic0841_thumb.jpg",130,87,5);thumbnails[3810689]=new thumbnail(3810689,"280518","L'arc de Triomphe","larcdetriomphe_thumb.jpg",130,87,5);thumbnails[3810704]=new thumbnail(3810704,"280518","Tour Eiffel","toureiffel_thumb.jpg",93,130,5);var galleries=new Object();galleries[231969]=new gallery(231969,"5451252,5451251,5451250,5451249,5451248,5450873,5450872,5450871,5450870,5450869","Charities/Corporate ","gallery",[3810335,3810336,3810337,3810338,3810361,3810339,3810362,3810360,3810359,3810659,4928672,4928671,4930378,4930489,4928674,4928673,4928675,4930380,4930383,4930387,4930385,5450873,5450872,5450869,5450870,5450871,5451249,5451250,5451248,5451251,5451252]);galleries[306926]=new gallery(306926,"5431233","Weddings","gallery",[5431233]);galleries[232098]=new gallery(232098,"4311566,3810306,3810305,3810304,3810303,3810302,3810295,3810294,3810293,3810292","Portraits","gallery",[3810294,3810292,3810293,3810295,4311566,3810291,3810303,3810306,3810305,3810304,3810302]);galleries[280518]=new gallery(280518,"4472083,4472082,3810704,3810689,3810688,3810687,3810686,3810685,3810677,3810676","Personal Work","gallery",[4472082,4472083,3810358,3810673,3810674,3810675,3810676,3810677,3810685,3810686,3810687,3810688,3810689,3810704]);var imageSets=new Object();imageSets[1]="5451252,5451251,5451250,5451249,5451248,5450873,5450872,5450871,5450870,5450869,5431233,4930489,4930387,4930385,4930383,4930380,4930378,4928675,4928674,4928673,4928672,4928671,4472083,4472082,4311566,3810704,3810689,3810688,3810687,3810686,3810685,3810677,3810676,3810675,3810674,3810673,3810659,3810362,3810361,3810360,3810359,3810358,3810339,3810338,3810337,3810336,3810335,3810306,3810305,3810304";imageSets[3]="5451252,5451251,5451250,5451249,5451248,5450873,5450872,5450871,5450870,5450869,5431233,4930489,4930387,4930385,4930383,4930380,4930378,4928675,4928674,4928673,4928672,4928671,4472083,4472082,4311566,3810704,3810689,3810688,3810687,3810686,3810685,3810677,3810676,3810675,3810674,3810673,3810659,3810362,3810361,3810360,3810359,3810358,3810339,3810338,3810337,3810336,3810335,3810306,3810305,3810304";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/shamil42/images";break}switch(a){case 1:b="http://www1.clikpic.com/shamil42/images";break}switch(a){case 2:b="http://admin.clikpic.com/shamil42/images";break}switch(a){case 4:b="http://www.clikchurch.com/shamil42/images";break}switch(a){case 5:b="http://www2.clikpic.com/shamil42/images";break}switch(a){case 15:b="http://www3.clikpic.com/shamil42/images";break}switch(a){case 21:b="http://www6.clikpic.com/shamil42/images";break}switch(a){case 18:b="http://www4.clikpic.com/shamil42/images";break}switch(a){case 19:b="http://www5.clikpic.com/shamil42/images";break}switch(a){case 22:b="http://tpc5/clikpic/shamil42/images";break}switch(a){case 23:b="http://tpc10/clikpic/shamil42/images";break}switch(a){case 24:b="http://tpc15/clikpic/shamil42/images";break}switch(a){case 25:b="http://tpc16/clikpic/shamil42/images";break}switch(a){case 31:b="http://www7.clikpic.com/shamil42/images";break}switch(a){case 32:b="http://admin2.clikpic.com/shamil42/images";break}switch(a){case 33:b="http://www8.clikpic.com/shamil42/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="Sam Appa 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+'")'})}}};