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[3830447]=new thumbnail(3830447,"232952","Millenium Theatre","millenium_centre_thumb.jpg",100,76,15);thumbnails[3831732]=new thumbnail(3831732,"232952","Tower Bridge","tower_bridge_1_thumb.jpg",67,100,15);thumbnails[5046712]=new thumbnail(5046712,"232952","Red Dragon Centre ( Cardiff Bay)","bay_cinema1_thumb.jpg",100,77,15);thumbnails[5046994]=new thumbnail(5046994,"232952","Cardiff Bay Barrage","bay_12_thumb.jpg",67,100,15);thumbnails[5047038]=new thumbnail(5047038,"232952","Bay Apartments","bay_10_thumb.jpg",67,100,15);thumbnails[5047043]=new thumbnail(5047043,"232952","Canary Wharf Tube Station","canary_wharf_tube_station_thumb.jpg",100,89,15);thumbnails[5047048]=new thumbnail(5047048,"232952","Skylight","sky_view_thumb.jpg",74,100,15);thumbnails[5047112]=new thumbnail(5047112,"232952","St Davids Hotel (Cardiff Bay)","bay_hotel1_thumb.jpg",72,100,15);thumbnails[5047126]=new thumbnail(5047126,"232952","Technium (SA1 Swansea)","technium_thumb.jpg",79,100,15);thumbnails[5047339]=new thumbnail(5047339,"232863","The Eye at Night","london_eye_thumb.jpg",67,100,15);thumbnails[5047379]=new thumbnail(5047379,"232863","Mumbles Head","mumbles_head_thumb.jpg",100,52,15);thumbnails[5047380]=new thumbnail(5047380,"232863","Mumbles Pier (infared)","mumbles_infared_thumb.jpg",100,67,15);thumbnails[5047384]=new thumbnail(5047384,"232863","Whitford Point Lighthouse","whitford_point_lighthouse_thumb.jpg",68,100,15);thumbnails[5047457]=new thumbnail(5047457,"234888","Kidwelly Castle","kidwelly_castle_1_thumb.jpg",100,68,15);thumbnails[5047459]=new thumbnail(5047459,"234888","North Dock Llanelli","north_thumb.jpg",100,69,15);thumbnails[5047460]=new thumbnail(5047460,"234888","Park Howard (infared)","park_howard_infared_sepia_thumb.jpg",100,69,15);thumbnails[5047461]=new thumbnail(5047461,"234888","Swiss valley ","swiss_valley_thumb.jpg",100,69,15);thumbnails[5047463]=new thumbnail(5047463,"234888","Burryport Lighthouse","burry_port_light_house1_thumb.jpg",68,100,15);thumbnails[5047464]=new thumbnail(5047464,"234888"," Coastal Path Vistors Centre","costal_path_thumb.jpg",100,68,15);thumbnails[5051442]=new thumbnail(5051442,"232863","Misty Dawn","Dryslwyn_castle_1_thumb.jpg",100,67,15);thumbnails[5051449]=new thumbnail(5051449,"232863","Corris Valley","cader_valley1_thumb.jpg",77,100,15);thumbnails[5051452]=new thumbnail(5051452,"232863","Reflections Of Dawn","misty_river1_thumb.jpg",100,67,15);thumbnails[5051475]=new thumbnail(5051475,"232863","Autumn Glory","Rhandirmyn1_thumb.jpg",67,100,15);thumbnails[5058911]=new thumbnail(5058911,"232883","Blue Green Anole","blue_green_anole_thumb.jpg",68,100,15);thumbnails[5058914]=new thumbnail(5058914,"232883","Buzzard","buzzard_2_thumb.jpg",100,63,15);thumbnails[5058915]=new thumbnail(5058915,"232883","Atlantic Grey Seal","gery_seal1_thumb.jpg",80,100,15);thumbnails[5058919]=new thumbnail(5058919,"232883","Green Heron","Green_heron_thumb.jpg",68,100,15);thumbnails[5058922]=new thumbnail(5058922,"232883","Grey Flycatcher","grey_fly_catcher_thumb.jpg",100,67,15);thumbnails[5058923]=new thumbnail(5058923,"232883","Hispaniolan Woodpecker","Hispaniolan_woodpecker_thumb.jpg",62,100,15);thumbnails[5058932]=new thumbnail(5058932,"232883","Little Egret","little_egret_thumb.jpg",100,83,15);thumbnails[5058934]=new thumbnail(5058934,"232883","Praying Mantis","Praying_mantis_thumb.jpg",100,67,15);thumbnails[5058935]=new thumbnail(5058935,"232883","Spiny Tailed Lizard","Spiny_tailed_lizard_uromastyx_Acanthinurus_thumb.jpg",100,59,15);thumbnails[5058958]=new thumbnail(5058958,"232863","Storm In The City","storm_in_the_city_thumb.jpg",100,53,15);thumbnails[5060088]=new thumbnail(5060088,"232864","","a4_thumb.jpg",100,69,15);thumbnails[5060089]=new thumbnail(5060089,"232864","","DSC_0025_thumb.jpg",100,66,15);thumbnails[5060090]=new thumbnail(5060090,"232864","","ivan_28_thumb.jpg",100,67,15);thumbnails[5060091]=new thumbnail(5060091,"232864","","model_shot_13_thumb.jpg",100,67,15);thumbnails[5060127]=new thumbnail(5060127,"268420","Dandilion Clock","dandilion_2_thumb.jpg",100,59,15);thumbnails[5060129]=new thumbnail(5060129,"268420","Ilston Church (Infared)","ilston_church_thumb.jpg",67,100,15);thumbnails[5060131]=new thumbnail(5060131,"268420","Protractor","polerized_protractor_thumb.jpg",67,100,15);thumbnails[5060134]=new thumbnail(5060134,"268420","Red Diamond","red_arrows_2_thumb.jpg",100,66,15);thumbnails[5064623]=new thumbnail(5064623,"232864","","warpath_thumb.jpg",73,100,15);thumbnails[5064890]=new thumbnail(5064890,"232863","Ferryside At Dusk","ferry_side_thumb.jpg",71,100,15);thumbnails[5064909]=new thumbnail(5064909,"232863","Abercastle","abercastle1_thumb.jpg",100,42,15);thumbnails[5064928]=new thumbnail(5064928,"232863","Harbour Lights","tenby_at_night_thumb.jpg",100,67,15);thumbnails[5065673]=new thumbnail(5065673,"","Elipse Building (SA1 Swansea)","elipse_1_thumb.jpg",67,100,15);thumbnails[5065676]=new thumbnail(5065676,"232952","Sail Bridge (Swansea Marina)","sail_bridge_thumb.jpg",66,100,15);thumbnails[5702937]=new thumbnail(5702937,"232864","","contemplation_thumb.jpg",67,100,15);thumbnails[5702959]=new thumbnail(5702959,"268420","","lower_slaughter_mill__thumb.jpg",64,100,15);thumbnails[5702969]=new thumbnail(5702969,"268420","The Fiddler","The_Violinist_thumb.jpg",70,100,15);thumbnails[5702981]=new thumbnail(5702981,"268420","","amonite_thumb.jpg",100,82,15);thumbnails[5742357]=new thumbnail(5742357,"268420","","clyne_bridge123_thumb.jpg",100,63,15);thumbnails[6092610]=new thumbnail(6092610,"232864","","chloie_thumb.jpg",100,67,15);thumbnails[6092616]=new thumbnail(6092616,"268420","","tulip2_thumb.jpg",64,100,15);thumbnails[5058979]=new thumbnail(5058979,"232747","56 chevi","56_chevrolet_2_thumb.jpg",100,79,15);thumbnails[5058981]=new thumbnail(5058981,"232747","Child Of The Revolution","begger_thumb.jpg",58,100,15);thumbnails[5058983]=new thumbnail(5058983,"232747","Blue Boat","Blue_boat_thumb.JPG",67,100,15);thumbnails[5058986]=new thumbnail(5058986,"232747","Berber Woman","Burber_woman_2_thumb.jpg",80,100,15);thumbnails[5058987]=new thumbnail(5058987,"232747","Camel Herder","Camel_Herder_thumb.jpg",100,67,15);thumbnails[5058989]=new thumbnail(5058989,"232747","El Jem","El-Jem_6_thumb.jpg",100,67,15);thumbnails[5058990]=new thumbnail(5058990,"232747","Gone Fishing","gone_fishing_thumb.jpg",67,100,15);thumbnails[5058992]=new thumbnail(5058992,"232747","Guardalavaca Beach (Cuba)","Guardalavaca_2_thumb.jpg",67,100,15);thumbnails[5058994]=new thumbnail(5058994,"232747","Ishmala At Dusk","ismalar_at_night_thumb.jpg",100,45,15);thumbnails[5058997]=new thumbnail(5058997,"232747","Alcudia","majorca_10_thumb.jpg",61,100,15);thumbnails[5058998]=new thumbnail(5058998,"232747","Just The Spot","majorca_44_thumb.jpg",67,100,15);thumbnails[5058999]=new thumbnail(5058999,"232747","Old Bike","Old_bike_thumb.JPG",67,100,15);thumbnails[5059000]=new thumbnail(5059000,"232747","Reythmno Harbour ","Rheythmno_Harbour_thumb.jpg",100,67,15);thumbnails[5059001]=new thumbnail(5059001,"232747","Rimondi Fountian","Rimondi_Fountian_thumb.jpg",100,67,15);thumbnails[5059003]=new thumbnail(5059003,"232747","Moncada Berracks (Cuba)","sandiago_de_cuba_thumb.jpg",67,100,15);thumbnails[5059009]=new thumbnail(5059009,"232747","Sandiargo de cuba catherdral","sandiago_de_cuba_cathedral_thumb.jpg",100,75,15);thumbnails[5059011]=new thumbnail(5059011,"232747","Catherderal of St John The Baptist (Santorini)","Santorni_4_thumb.JPG",67,100,15);thumbnails[5059013]=new thumbnail(5059013,"232747","A Place In The Sun","Santorni_5_thumb.JPG",74,100,15);thumbnails[5059014]=new thumbnail(5059014,"232747","Suger Cane Workers","sugar_cane_worker_thumb.jpg",67,100,15);thumbnails[5059015]=new thumbnail(5059015,"232747","The Card Game","The_card_game_thumb.jpg",100,79,15);thumbnails[5059017]=new thumbnail(5059017,"232747","Thera","Thera_thumb.JPG",75,100,15);thumbnails[5059020]=new thumbnail(5059020,"232747","Twerag","Twareg_2_thumb.jpg",65,100,15);thumbnails[5065344]=new thumbnail(5065344,"232747","Shadows At Sunset","majorca__thumb.jpg",69,100,15);thumbnails[4836395]=new thumbnail(4836395,"232748","","97930004_thumb.jpg",88,100,15);thumbnails[4836396]=new thumbnail(4836396,"232748","","97930020_thumb.jpg",52,100,15);thumbnails[4836397]=new thumbnail(4836397,"232748","","97930033_thumb.jpg",79,100,15);thumbnails[5059992]=new thumbnail(5059992,"232748","","26580010_thumb.jpg",100,66,15);thumbnails[5059993]=new thumbnail(5059993,"232748","","26580020_thumb.jpg",66,100,15);thumbnails[5059996]=new thumbnail(5059996,"232748","","26580022_thumb.jpg",66,100,15);thumbnails[5059999]=new thumbnail(5059999,"232748","","32970004_thumb.jpg",66,100,15);thumbnails[5060001]=new thumbnail(5060001,"232748","","32970032_thumb.jpg",66,100,15);thumbnails[5060004]=new thumbnail(5060004,"232748","","32980007_thumb.jpg",100,66,15);thumbnails[5060005]=new thumbnail(5060005,"232748","","32980029_thumb.jpg",100,66,15);thumbnails[5060020]=new thumbnail(5060020,"232748","","247100271_thumb.jpg",66,100,15);thumbnails[5060021]=new thumbnail(5060021,"232748","","247200191_thumb.jpg",66,100,15);thumbnails[5060025]=new thumbnail(5060025,"232748","","265900351_thumb.jpg",66,100,15);var galleries=new Object();galleries[232952]=new gallery(232952,"5065676,5047126,5047112,5047048,5047043,5047038,5046994,5046712,3831732,3830447","Architecture","gallery",[3830447,3831732,5046712,5046994,5047038,5047043,5047048,5047112,5047126,5065676]);galleries[234888]=new gallery(234888,"5047464,5047463,5047461,5047460,5047459,5047457","Commissions","gallery",[5047457,5047459,5047460,5047461,5047463,5047464]);galleries[232863]=new gallery(232863,"5064928,5064909,5064890,5058958,5051475,5051452,5051449,5051442,5047384,5047380","Landscapes","gallery",[5047339,5047379,5047380,5047384,5051442,5051449,5051452,5051475,5058958,5064890,5064909,5064928]);galleries[232883]=new gallery(232883,"5058935,5058934,5058932,5058923,5058922,5058919,5058915,5058914,5058911","Natural History","gallery",[5058911,5058914,5058915,5058919,5058922,5058923,5058932,5058934,5058935]);galleries[232864]=new gallery(232864,"6092610,5702937,5064623,5060091,5060090,5060089,5060088","Portraits","gallery",[5060088,5060089,5060090,5060091,5064623,5702937,6092610]);galleries[268420]=new gallery(268420,"6092616,5742357,5702981,5702969,5702959,5060134,5060131,5060129,5060127","various","gallery",[5060127,5060129,5060131,5060134,5702959,5702969,5702981,5742357,6092616]);galleries[232747]=new gallery(232747,"5065344,5059020,5059017,5059015,5059014,5059013,5059011,5059009,5059003,5059001","Travel","gallery",[5058979,5058981,5058983,5058986,5058987,5058989,5058990,5058992,5058994,5058997,5058998,5058999,5059000,5059001,5059003,5059009,5059011,5059013,5059014,5059015,5059017,5059020,5065344]);galleries[232748]=new gallery(232748,"5060025,5060021,5060020,5060005,5060004,5060001,5059999,5059996,5059993,5059992","weddings","gallery",[4836395,4836396,4836397,5059992,5059993,5059996,5059999,5060001,5060004,5060005,5060020,5060021,5060025]);var imageSets=new Object();imageSets[1]="6092616,6092610,5742357,5702981,5702969,5702959,5702937,5065676,5065673,5065344,5064928,5064909,5064890,5064623,5060134,5060131,5060129,5060127,5060091,5060090,5060089,5060088,5060025,5060021,5060020,5060005,5060004,5060001,5059999,5059996,5059993,5059992,5059020,5059017,5059015,5059014,5059013,5059011,5059009,5059003,5059001,5059000,5058999,5058998,5058997,5058994,5058992,5058990,5058989,5058987";imageSets[3]="6092616,6092610,5742357,5702981,5702969,5702959,5702937,5065676,5065673,5065344,5064928,5064909,5064890,5064623,5060134,5060131,5060129,5060127,5060091,5060090,5060089,5060088,5060025,5060021,5060020,5060005,5060004,5060001,5059999,5059996,5059993,5059992,5059020,5059017,5059015,5059014,5059013,5059011,5059009,5059003,5059001,5059000,5058999,5058998,5058997,5058994,5058992,5058990,5058989,5058987";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/keithjohn/images";break}switch(a){case 1:b="http://www1.clikpic.com/keithjohn/images";break}switch(a){case 2:b="http://admin.clikpic.com/keithjohn/images";break}switch(a){case 24:b="http://tpc15/clikpic/keithjohn/images";break}switch(a){case 4:b="http://www.clikchurch.com/keithjohn/images";break}switch(a){case 5:b="http://www2.clikpic.com/keithjohn/images";break}switch(a){case 22:b="http://tpc5/clikpic/keithjohn/images";break}switch(a){case 23:b="http://tpc10/clikpic/keithjohn/images";break}switch(a){case 25:b="http://tpc16/clikpic/keithjohn/images";break}switch(a){case 15:b="http://www3.clikpic.com/keithjohn/images";break}switch(a){case 18:b="http://www4.clikpic.com/keithjohn/images";break}switch(a){case 19:b="http://www5.clikpic.com/keithjohn/images";break}switch(a){case 31:b="http://www7.clikpic.com/keithjohn/images";break}switch(a){case 32:b="http://admin2.clikpic.com/keithjohn/images";break}switch(a){case 33:b="http://www8.clikpic.com/keithjohn/images";break}switch(a){case 34:b="http://www9.clikpic.com/keithjohn/images";break}switch(a){case 35:b="http://admin3.clikpic.com/keithjohn/images";break}switch(a){case 37:b="http://admin4.clikpic.com/keithjohn/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="Chroma-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<100){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+'")'})}}};