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[5500539]=new thumbnail(5500539,"42347","","1_4328_thumb.JPG",120,80,18);thumbnails[5500541]=new thumbnail(5500541,"42347","","1_6447_thumb.JPG",120,80,18);thumbnails[5500576]=new thumbnail(5500576,"42347","","1_9310_thumb.JPG",120,80,18);thumbnails[5500553]=new thumbnail(5500553,"42347","","1_3808_1_thumb.JPG",53,80,18);thumbnails[5500564]=new thumbnail(5500564,"42347","","4_4791_1_thumb.JPG",53,80,18);thumbnails[5500569]=new thumbnail(5500569,"42347","","6_2137_1_thumb.JPG",53,80,18);thumbnails[5500574]=new thumbnail(5500574,"42347","","1_8415_thumb.JPG",120,80,18);thumbnails[5500550]=new thumbnail(5500550,"42347","","1_6834_1_thumb.JPG",120,80,18);thumbnails[5500577]=new thumbnail(5500577,"42347","","2_9258_1_thumb.JPG",120,80,18);thumbnails[5500579]=new thumbnail(5500579,"42347","","6_4986_1_thumb.JPG",53,80,18);thumbnails[5500582]=new thumbnail(5500582,"42347","","0019_thumb.jpg",53,80,18);thumbnails[5500583]=new thumbnail(5500583,"42347","","IMG_1505a_thumb.jpg",53,80,18);thumbnails[5500586]=new thumbnail(5500586,"42347","","3_0885_1_thumb.jpg",120,80,18);thumbnails[5500589]=new thumbnail(5500589,"42347","","5_9971_1_thumb.JPG",120,80,18);thumbnails[5500591]=new thumbnail(5500591,"42347","","5D_00509_R_thumb.JPG",120,80,18);thumbnails[5500593]=new thumbnail(5500593,"42347","","5D_00565_R_thumb.JPG",120,80,18);thumbnails[5500595]=new thumbnail(5500595,"42347","","6_2107_1_thumb.JPG",120,80,18);thumbnails[5500596]=new thumbnail(5500596,"42347","","IMG_5478_1_thumb.JPG",120,80,18);thumbnails[545258]=new thumbnail(545258,"42205","","IMG_8783_thumb.JPG",130,87,18);thumbnails[556480]=new thumbnail(556480,"42205","","IMG_8876_thumb.JPG",130,87,18);thumbnails[545307]=new thumbnail(545307,"42205","","IMG_8928_thumb.JPG",130,87,18);thumbnails[556481]=new thumbnail(556481,"42205","","IMG_9044_thumb.JPG",130,87,18);thumbnails[545327]=new thumbnail(545327,"42205","","IMG_9293_thumb.jpg",130,87,18);thumbnails[556482]=new thumbnail(556482,"42205","","IMG_9265_thumb.JPG",130,87,18);thumbnails[545324]=new thumbnail(545324,"42205","","IMG_9088_thumb.JPG",53,80,18);thumbnails[545321]=new thumbnail(545321,"42205","","IMG_8951_thumb.jpg",130,87,18);thumbnails[545329]=new thumbnail(545329,"42205","World Record!","IMG_9474_1_thumb.jpg",130,87,18);thumbnails[1451420]=new thumbnail(1451420,"99765","","ASChall07_0010_thumb.JPG",120,80,18);thumbnails[1451422]=new thumbnail(1451422,"99765","","ASChall07_0012_thumb.JPG",120,80,18);thumbnails[1451423]=new thumbnail(1451423,"99765","","ASChall07_0015_thumb.JPG",120,80,18);thumbnails[1451425]=new thumbnail(1451425,"99765","","ASChall07_0020_thumb.JPG",120,80,18);thumbnails[1451426]=new thumbnail(1451426,"99765","","ASChall07_0022_thumb.JPG",120,80,18);thumbnails[1451428]=new thumbnail(1451428,"99765","","ASChall07_0024_thumb.JPG",120,80,18);thumbnails[1451430]=new thumbnail(1451430,"99765","","ASChall07_0026_thumb.JPG",120,80,18);thumbnails[1451432]=new thumbnail(1451432,"99765","","ASChall07_0029_thumb.JPG",120,80,18);thumbnails[2207423]=new thumbnail(2207423,"145812","","3_6962_1_thumb.JPG",120,80,18);thumbnails[2207427]=new thumbnail(2207427,"145812","","3_6963_1_thumb.JPG",120,80,18);thumbnails[2207428]=new thumbnail(2207428,"145812","","3_6967_1_thumb.JPG",120,80,18);thumbnails[2207430]=new thumbnail(2207430,"145812","","3_6973_1_thumb.JPG",120,80,18);thumbnails[2207447]=new thumbnail(2207447,"145812","","3_7044_1_thumb.JPG",120,80,18);thumbnails[2207484]=new thumbnail(2207484,"145812","","3_7052_1_thumb.JPG",120,80,18);thumbnails[2207486]=new thumbnail(2207486,"145812","","3_7060_1_thumb.JPG",120,80,18);thumbnails[2207488]=new thumbnail(2207488,"145812","","3_7107_1_thumb.JPG",120,80,18);thumbnails[2207490]=new thumbnail(2207490,"145812","","3_7200_1_thumb.JPG",120,80,18);thumbnails[2207493]=new thumbnail(2207493,"145812","","3_7205_1_thumb.JPG",120,80,18);thumbnails[2207494]=new thumbnail(2207494,"145812","","3_7265_1_thumb.JPG",120,80,18);thumbnails[2207496]=new thumbnail(2207496,"145812","","3_7287_1_thumb.JPG",120,80,18);thumbnails[2207498]=new thumbnail(2207498,"145812","","3_7293_11_thumb.JPG",120,80,18);thumbnails[2207499]=new thumbnail(2207499,"145812","","3_7600_1_thumb.JPG",120,80,18);thumbnails[2207500]=new thumbnail(2207500,"145812","","3_7604_1_thumb.JPG",120,80,18);thumbnails[2207501]=new thumbnail(2207501,"145812","","3_7612_1_thumb.JPG",120,80,18);thumbnails[2207503]=new thumbnail(2207503,"145812","","3_7620_1_thumb.JPG",120,80,18);thumbnails[2207505]=new thumbnail(2207505,"145812","","3_7635_1_thumb.JPG",120,80,18);thumbnails[2207511]=new thumbnail(2207511,"145812","","3_7654_1_thumb.JPG",120,80,18);thumbnails[2207512]=new thumbnail(2207512,"145812","","3_7659_1_thumb.JPG",120,80,18);thumbnails[2207514]=new thumbnail(2207514,"145812","","3_7751_1_thumb.JPG",120,80,18);thumbnails[2207516]=new thumbnail(2207516,"145812","","3_7786_1_thumb.JPG",120,80,18);thumbnails[2207517]=new thumbnail(2207517,"145812","","3_7848_1_thumb.JPG",120,80,18);thumbnails[2207520]=new thumbnail(2207520,"145812","","3_7975_1_thumb.JPG",120,80,18);thumbnails[2207524]=new thumbnail(2207524,"145812","","3_7986_1_thumb.JPG",120,80,18);thumbnails[2207525]=new thumbnail(2207525,"145812","","3_8016_1_thumb.JPG",120,80,18);thumbnails[2844559]=new thumbnail(2844559,"177154","","4_7430_1_thumb.JPG",120,80,18);thumbnails[2844565]=new thumbnail(2844565,"177154","","4_7629_1_thumb.JPG",120,80,18);thumbnails[2844566]=new thumbnail(2844566,"177154","","4_7654_1_thumb.JPG",120,80,18);thumbnails[2844573]=new thumbnail(2844573,"177154","","4_7676_1_thumb.JPG",120,80,18);thumbnails[2844579]=new thumbnail(2844579,"177154","","4_7698_1_thumb.JPG",120,80,18);thumbnails[2844582]=new thumbnail(2844582,"177154","","4_7782_1_thumb.JPG",120,80,18);thumbnails[2844583]=new thumbnail(2844583,"177154","","4_7791_1_thumb.JPG",120,80,18);thumbnails[2844589]=new thumbnail(2844589,"177154","","4_7823_1_thumb.JPG",120,80,18);thumbnails[2844591]=new thumbnail(2844591,"177154","","4_7948_1_thumb.JPG",120,80,18);thumbnails[2844615]=new thumbnail(2844615,"177154","","4_8186_1_thumb.JPG",120,80,18);thumbnails[2844621]=new thumbnail(2844621,"177154","","4_8190_1_thumb.JPG",120,80,18);thumbnails[2844622]=new thumbnail(2844622,"177154","","4_8197_1_thumb.JPG",120,80,18);thumbnails[2844627]=new thumbnail(2844627,"177154","","4_8372_1_thumb.JPG",120,80,18);thumbnails[2844630]=new thumbnail(2844630,"177154","","4_8378_1_thumb.JPG",120,80,18);thumbnails[4764478]=new thumbnail(4764478,"272895","","6_2301_1_thumb.JPG",53,80,18);thumbnails[4764479]=new thumbnail(4764479,"272895","","6_2312_1_thumb.JPG",53,80,18);thumbnails[4764480]=new thumbnail(4764480,"272895","","6_2315_1_thumb.JPG",53,80,18);thumbnails[4764481]=new thumbnail(4764481,"272895","","6_2715_1_thumb.JPG",120,80,18);thumbnails[4764482]=new thumbnail(4764482,"272895","","6_2737_1_thumb.JPG",120,80,18);thumbnails[4764483]=new thumbnail(4764483,"272895","","6_2741_1_thumb.JPG",120,80,18);thumbnails[4764507]=new thumbnail(4764507,"272895","","6_2785_1_thumb.JPG",53,80,18);thumbnails[4764539]=new thumbnail(4764539,"272895","","6_2879_1_thumb.JPG",120,80,18);thumbnails[4764540]=new thumbnail(4764540,"272895","","6_2888_1_thumb.JPG",120,80,18);thumbnails[4764541]=new thumbnail(4764541,"272895","","6_2971_1_thumb.JPG",120,80,18);thumbnails[4764542]=new thumbnail(4764542,"272895","","6_2988_1_thumb.JPG",120,80,18);thumbnails[4764544]=new thumbnail(4764544,"272895","","6_3042_1_thumb.JPG",120,80,18);thumbnails[4764546]=new thumbnail(4764546,"272895","","6_3048_1_thumb.JPG",120,80,18);thumbnails[4764549]=new thumbnail(4764549,"272895","","6_3143_1_thumb.JPG",120,80,18);thumbnails[4764552]=new thumbnail(4764552,"272895","","6_3147_1_thumb.JPG",120,80,18);thumbnails[5500210]=new thumbnail(5500210,"311398","","5D_01375_R_thumb.JPG",120,80,18);thumbnails[5500212]=new thumbnail(5500212,"311398","","5D_01415_R_thumb.JPG",120,80,18);thumbnails[5500213]=new thumbnail(5500213,"311398","","5D_00689_1_thumb.JPG",120,80,18);thumbnails[5500214]=new thumbnail(5500214,"311398","","5D_01347_R_thumb.JPG",53,80,18);thumbnails[5500215]=new thumbnail(5500215,"311398","","5D_01396_R_thumb.JPG",53,80,18);thumbnails[5500218]=new thumbnail(5500218,"311398","","5D_01412_R_thumb.JPG",53,80,18);thumbnails[5500300]=new thumbnail(5500300,"311407","","3_1861_1_12_thumb.JPG",53,80,18);thumbnails[5500296]=new thumbnail(5500296,"311407","","3_1532_12_thumb.JPG",53,80,18);thumbnails[5500303]=new thumbnail(5500303,"311407","","3_1924_12_thumb.JPG",53,80,18);thumbnails[5500263]=new thumbnail(5500263,"311407","","5D_01031_R_thumb.jpg",120,80,18);thumbnails[5500307]=new thumbnail(5500307,"311407","","3_1546_11_thumb.JPG",120,80,18);thumbnails[5500308]=new thumbnail(5500308,"311407","","3_1563_11_thumb.JPG",120,80,18);thumbnails[5500310]=new thumbnail(5500310,"311407","","3_9682_R1_thumb.jpg",53,80,18);thumbnails[5500316]=new thumbnail(5500316,"311407","","5_9462_R1_thumb.jpg",53,80,18);thumbnails[5500324]=new thumbnail(5500324,"311407","","5_9772_R1_thumb.jpg",53,80,18);thumbnails[5500333]=new thumbnail(5500333,"311407","","3_1934_11_thumb.JPG",120,80,18);thumbnails[5500336]=new thumbnail(5500336,"311407","","5_9245_11_thumb.JPG",120,80,18);thumbnails[5500339]=new thumbnail(5500339,"311407","","5_9598_R1_thumb.jpg",120,80,18);var galleries=new Object();galleries[42347]=new gallery(42347,"5500595","Favourites","gallery",[5500539,5500541,5500576,5500553,5500564,5500569,5500574,5500550,5500577,5500579,5500582,5500583,5500586,5500589,5500591,5500593,5500595,5500596]);galleries[42205]=new gallery(42205,"545329,545307","World Team 2006","gallery",[545258,556480,545307,556481,545327,556482,545324,545321,545329]);galleries[311401]=new gallery(311401,"5500595,4764541,2844583,2207490,1451426,545329,545307","Skydiving","gallery",[]);galleries[99765]=new gallery(99765,"1451426","Ampuriabrava Airspeed Challenge 2007","gallery",[1451420,1451422,1451423,1451425,1451426,1451428,1451430,1451432]);galleries[145812]=new gallery(145812,"2207490","Langar Boogie 1, 2008","gallery",[2207423,2207427,2207428,2207430,2207447,2207484,2207486,2207488,2207490,2207493,2207494,2207496,2207498,2207499,2207500,2207501,2207503,2207505,2207511,2207512,2207514,2207516,2207517,2207520,2207524,2207525]);galleries[177154]=new gallery(177154,"2844583","Langar Boogie 2, 2008","gallery",[2844559,2844565,2844566,2844573,2844579,2844582,2844583,2844589,2844591,2844615,2844621,2844622,2844627,2844630]);galleries[272895]=new gallery(272895,"4764541","Langar Boogie 2 - 2009","gallery",[4764478,4764479,4764480,4764481,4764482,4764483,4764507,4764539,4764540,4764541,4764542,4764544,4764546,4764549,4764552]);galleries[311398]=new gallery(311398,"5500212","Buildings and architecture","gallery",[5500210,5500212,5500213,5500214,5500215,5500218]);galleries[311407]=new gallery(311407,"5500333","Animals","gallery",[5500300,5500296,5500303,5500263,5500307,5500308,5500310,5500316,5500324,5500333,5500336,5500339]);var imageSets=new Object();imageSets[1]="5500593";imageSets[2]="5500595,5500333,5500212,4764541,2844583,2207490,1451426,545329,545307";imageSets[3]="5500586";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/garywainwright/images";break}switch(a){case 1:b="http://www1.clikpic.com/garywainwright/images";break}switch(a){case 2:b="http://admin.clikpic.com/garywainwright/images";break}switch(a){case 24:b="http://tpc15/clikpic/garywainwright/images";break}switch(a){case 4:b="http://www.clikchurch.com/garywainwright/images";break}switch(a){case 5:b="http://www2.clikpic.com/garywainwright/images";break}switch(a){case 22:b="http://tpc5/clikpic/garywainwright/images";break}switch(a){case 23:b="http://tpc10/clikpic/garywainwright/images";break}switch(a){case 25:b="http://tpc16/clikpic/garywainwright/images";break}switch(a){case 15:b="http://www3.clikpic.com/garywainwright/images";break}switch(a){case 18:b="http://www4.clikpic.com/garywainwright/images";break}switch(a){case 19:b="http://www5.clikpic.com/garywainwright/images";break}switch(a){case 31:b="http://www7.clikpic.com/garywainwright/images";break}switch(a){case 32:b="http://admin2.clikpic.com/garywainwright/images";break}switch(a){case 33:b="http://www8.clikpic.com/garywainwright/images";break}switch(a){case 34:b="http://www9.clikpic.com/garywainwright/images";break}switch(a){case 35:b="http://admin3.clikpic.com/garywainwright/images";break}switch(a){case 37:b="http://admin4.clikpic.com/garywainwright/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="gary wainwright 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<120){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+'")'})}}};