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[2258105]=new thumbnail(2258105,"138813","View from Sulphur Mountain, Banff","the Finger webcopy_thumb.jpg",98,130,32);thumbnails[2258108]=new thumbnail(2258108,"138813","Sulphur Mountain, Banff","IMG_4308_thumb.JPG",130,195,32);thumbnails[2258198]=new thumbnail(2258198,"138813","Tranquility","Tranquilitywebres_thumb.jpg",130,87,32);thumbnails[2258223]=new thumbnail(2258223,"138813","Fenland Trail, Banff","IMG_4477_thumb.JPG",130,87,32);thumbnails[2258528]=new thumbnail(2258528,"138813","City Life","Downtown Vancouver British Columbia Canada webcopy_thumb.jpg",130,93,32);thumbnails[2258684]=new thumbnail(2258684,"148509","Jungle Stream","_MG_2683_thumb.jpg",130,87,32);thumbnails[2258687]=new thumbnail(2258687,"138813","Reflections","_MG_52282_thumb.jpg",130,60,32);thumbnails[2258692]=new thumbnail(2258692,"138813","Fishing Village","Prince Edward Island, Canada_thumb.jpg",130,95,32);thumbnails[2258697]=new thumbnail(2258697,"138813","Peggy's Cove","1c2bd998-bcfb-4e59-95e8-84e7dd9816bd_thumb.JPG",130,87,32);thumbnails[2309386]=new thumbnail(2309386,"138813","There's a storm coming...","IMG_4154_thumb.JPG",87,130,32);thumbnails[2309401]=new thumbnail(2309401,"148509","If a tree fell...","496d6722-a8ee-4d58-ba72-0096a878cb73_thumb.JPG",130,87,32);thumbnails[2309408]=new thumbnail(2309408,"138813","Red sands","Cavendish Beach webcopy_thumb.jpg",130,92,32);thumbnails[2322472]=new thumbnail(2322472,"148509","Fire","_MG_2177_thumb.jpg",87,130,32);thumbnails[2332359]=new thumbnail(2332359,"148509","Lily","IMG_6021-12_thumb.JPG",90,130,32);thumbnails[2338547]=new thumbnail(2338547,"138813","Orange sunset","IMG_5411_thumb.JPG",130,87,32);thumbnails[2749455]=new thumbnail(2749455,"138813","Vancouver at night","IMG_5585_thumb.JPG",130,61,32);thumbnails[2884477]=new thumbnail(2884477,"138813","Dramatic Mountain Range","IMG_4290 copy_thumb.jpg",130,93,32);thumbnails[2884605]=new thumbnail(2884605,"138813","Colourful Houses","Lunenberg webcopy_thumb.jpg",130,88,32);thumbnails[2884724]=new thumbnail(2884724,"138813","Mahone Bay","Mahone Bay_thumb.jpg",130,61,32);thumbnails[2924318]=new thumbnail(2924318,"148509","Orchid","_MG_7755_thumb.jpg",130,87,32);thumbnails[2931097]=new thumbnail(2931097,"138813","Athabasca Glacier","Athabasca Glacierwebcopy_thumb.jpg",130,93,32);thumbnails[2931121]=new thumbnail(2931121,"138813","Scenic Waterfall","Johnson canyon alberta webcopy_thumb.jpg",98,130,32);thumbnails[3047866]=new thumbnail(3047866,"148509","Autumn Colours","IMG_7974_thumb.JPG",130,124,32);thumbnails[2258681]=new thumbnail(2258681,"138813","The Green City","IMG_5732_thumb.JPG",87,130,32);thumbnails[2258683]=new thumbnail(2258683,"138813","Downtown Vancouver","IMG_5737_thumb.JPG",102,130,32);thumbnails[2258688]=new thumbnail(2258688,"138813","Castle Mountain, Alberta","IMG_4933_thumb.JPG",130,33,32);thumbnails[2258527]=new thumbnail(2258527,"138813","Pyramid Lake, Jasper","IMG_5234_thumb.JPG",130,67,32);thumbnails[2258245]=new thumbnail(2258245,"138813","Highway 93","IMG_4913_thumb.JPG",130,49,32);thumbnails[2258186]=new thumbnail(2258186,"138813","Icefields Parkway","_MG_5098_thumb.jpg",130,41,32);thumbnails[2258138]=new thumbnail(2258138,"138813","Dramatic Mountains","IMG_4358_thumb.JPG",130,68,32);thumbnails[2078457]=new thumbnail(2078457,"138740","Ruined Temple in the Jungle","_MG_2403_thumb.jpg",130,63,32);thumbnails[2078554]=new thumbnail(2078554,"138740","The Taj Mahal","The Tajwebcopy_thumb.jpg",130,95,32);thumbnails[2078566]=new thumbnail(2078566,"138740","Chaos on the Road","IMG_1197_thumb.JPG",130,37,32);thumbnails[2077914]=new thumbnail(2077914,"138740","The Golden Temple, Amritsar","Golden Temple Amritsar Indiaweb_thumb.jpg",130,59,32);thumbnails[2077963]=new thumbnail(2077963,"138740","Sikh Guards at the Golden Temple","IMG_1100_thumb.JPG",130,195,32);thumbnails[2078422]=new thumbnail(2078422,"138740","The Golden Temple, Amritsar","IMG_1127_thumb.JPG",130,195,32);thumbnails[2078445]=new thumbnail(2078445,"138740","The Golden Temple, Amritsar","IMG_1116_thumb.JPG",130,87,32);thumbnails[2078455]=new thumbnail(2078455,"138740","Street Scene","IMG_1137_thumb.JPG",130,87,32);thumbnails[2077909]=new thumbnail(2077909,"138740","Hard work...","IMG_0765_thumb.JPG",130,57,32);thumbnails[2077912]=new thumbnail(2077912,"138740","Indian truck","IMG_1060_thumb.JPG",130,87,32);thumbnails[2078441]=new thumbnail(2078441,"138740","Travelling to work","IMG_0772_thumb.JPG",130,49,32);thumbnails[2080410]=new thumbnail(2080410,"138740","The Two Indias","IMG_0836_thumb.JPG",130,57,32);thumbnails[2308939]=new thumbnail(2308939,"138740","Rural Transport...","IMG_1944_thumb.jpg",130,155,32);thumbnails[2952475]=new thumbnail(2952475,"138740","Foothills of The Western Ghats","The foothills of the Western Ghats webcopy_thumb.jpg",130,68,32);thumbnails[2078559]=new thumbnail(2078559,"138740","Mumbai at night","IMG_1835_thumb.JPG",130,195,32);thumbnails[2078463]=new thumbnail(2078463,"151009","Shrike","IMG_1188_thumb.jpg",130,94,32);thumbnails[2308910]=new thumbnail(2308910,"151009","Wild Peacock","_MG_2886_thumb.jpg",130,87,32);thumbnails[2308915]=new thumbnail(2308915,"151009","Wild Peacocks","_MG_2888_thumb.jpg",89,130,32);thumbnails[2308920]=new thumbnail(2308920,"151009","White Tailed Deer","IMG_1108_thumb.jpg",130,171,32);thumbnails[2308930]=new thumbnail(2308930,"151009","Squirrels","IMG_1746_thumb.JPG",130,50,32);thumbnails[2309318]=new thumbnail(2309318,"151009","Red Squirrel","IMG_4674_thumb.JPG",130,175,32);thumbnails[2309328]=new thumbnail(2309328,"151009","Columbia Ground Squirrel","IMG_4507_thumb.JPG",130,191,32);thumbnails[2309398]=new thumbnail(2309398,"151009","I'm watching you...","_MG_2872_thumb.jpg",130,87,32);thumbnails[2309419]=new thumbnail(2309419,"151009","Guar","IMG_1258_thumb.jpg",130,97,32);thumbnails[2310031]=new thumbnail(2310031,"151009","The Herd","_MG_2267_thumb.JPG",130,85,32);thumbnails[2310382]=new thumbnail(2310382,"151009","Pig at peace","IMG_3214_thumb.JPG",130,87,32);thumbnails[2322039]=new thumbnail(2322039,"151009","Peacock","IMG_1047_thumb.jpg",130,195,32);thumbnails[2322072]=new thumbnail(2322072,"151009","Cheeky Monkey!","281_8187_thumb.JPG",130,121,32);thumbnails[2322105]=new thumbnail(2322105,"151009","Elephants in the wild","_MG_6147_thumb.jpg",130,86,32);thumbnails[2338508]=new thumbnail(2338508,"151009","Cute monkey","IMG_3206_thumb.JPG",130,87,32);thumbnails[2338679]=new thumbnail(2338679,"151009","Duck","IMG_9518_thumb.JPG",130,87,32);thumbnails[2338685]=new thumbnail(2338685,"151009","Who are you looking at?","IMG_9610_thumb.JPG",130,87,32);thumbnails[2749432]=new thumbnail(2749432,"151009","Jellyfish","IMG_5858_thumb.JPG",130,87,32);thumbnails[2258691]=new thumbnail(2258691,"138849","The Lowry","IMG_0242_thumb.JPG",130,195,32);thumbnails[2309088]=new thumbnail(2309088,"138849","London at Night","London at Night1webcopy_thumb.jpg",130,115,32);thumbnails[2309385]=new thumbnail(2309385,"138849","The Bullring","IMG_3545_thumb.JPG",130,195,32);thumbnails[2310036]=new thumbnail(2310036,"138849","Cloisters","IMG_1017_thumb.JPG",130,77,32);thumbnails[2310063]=new thumbnail(2310063,"138849","Beach House","IMG_1386_thumb.JPG",130,195,32);thumbnails[2310083]=new thumbnail(2310083,"138849","Scottish Sunset","piperdam web_thumb.jpg",130,86,32);thumbnails[2322047]=new thumbnail(2322047,"138849","Big Ben","IMG_0802_thumb.JPG",130,87,32);thumbnails[2322138]=new thumbnail(2322138,"138849","Modern Offices","IMG_0654_thumb.JPG",130,75,32);thumbnails[2336322]=new thumbnail(2336322,"138849","Golden Sunset","IMG_9571_thumb.JPG",130,195,32);thumbnails[2336365]=new thumbnail(2336365,"138849","Busy station","282_8256_thumb.JPG",130,99,32);thumbnails[2338494]=new thumbnail(2338494,"138849","Traditional English Pub","IMG_1815_thumb.JPG",130,87,32);thumbnails[2338590]=new thumbnail(2338590,"138849","Old and New","IMG_8217_thumb.jpg",130,87,32);thumbnails[2882782]=new thumbnail(2882782,"138849","Two children exploring in the woods.","IMG_7600-1_thumb.JPG",130,195,32);thumbnails[2882783]=new thumbnail(2882783,"138849","A typical rural scene in Worcestershire, UK.","IMG_7554_thumb.JPG",130,195,32);thumbnails[2924132]=new thumbnail(2924132,"138849","Field in Summer","IMG_7559 copy copy_thumb.jpg",130,84,32);thumbnails[6320132]=new thumbnail(6320132,"138849","Colourful Escalators","mailbox1_thumb.jpg",130,62,32);thumbnails[6320120]=new thumbnail(6320120,"138849","St Pancras International Station, London","kings_cross_copy_thumb.jpg",130,87,32);var galleries=new Object();galleries[148509]=new gallery(148509,"3047866,2924318,2332359,2322472,2309401,2258684","Nature","gallery",[2258684,2309401,2322472,2332359,2924318,3047866]);galleries[138813]=new gallery(138813,"2258198","Oh Canada!","gallery",[2258105,2258108,2258198,2258223,2258528,2258687,2258692,2258697,2309386,2309408,2338547,2749455,2884477,2884605,2884724,2931097,2931121,2258681,2258683,2258688,2258527,2258245,2258186,2258138]);galleries[138740]=new gallery(138740,"2077914","Incredible India","gallery",[2078457,2078554,2078566,2077914,2077963,2078422,2078445,2078455,2077909,2077912,2078441,2080410,2308939,2952475,2078559]);galleries[151009]=new gallery(151009,"2308920","Creatures","gallery",[2078463,2308910,2308915,2308920,2308930,2309318,2309328,2309398,2309419,2310031,2310382,2322039,2322072,2322105,2338508,2338679,2338685,2749432]);galleries[138849]=new gallery(138849,"6320132,6320120,2924132,2882783,2882782,2338590,2338494,2336365,2336322,2322138","Around the UK","gallery",[2258691,2309088,2309385,2310036,2310063,2310083,2322047,2322138,2336322,2336365,2338494,2338590,2882782,2882783,2924132,6320132,6320120]);var imageSets=new Object();imageSets[1]="6320120,3047866,2952475,2931121,2931097,2924318,2924132,2884605,2884477,2882783,2882782,2749432,2338685,2338679,2338590,2338547,2338508,2336365,2336322,2332359,2322138,2322105,2322072,2322047,2322039,2310382,2310083,2310063,2310036,2310031,2309419,2309408,2309401,2309398,2309386,2309385,2309328,2309318,2309088,2308939,2308920,2308910,2258697,2258692,2258691,2258688,2258687,2258527,2258245,2258223,2258138,2258105,2078554,2078463,2078457,2078445,2078422,2077914";imageSets[2]="2308920,2258198,2077914";imageSets[3]="6320132,6320120,3047866,2952475,2931121,2931097,2924318,2924132,2884724,2884605,2884477,2882783,2882782,2749455,2749432,2338685,2338679,2338590,2338547,2338508,2338494,2336365,2336322,2332359,2322472,2322138,2322105,2322072,2322047,2322039,2310382,2310083,2310063,2310036,2310031,2309419,2309408,2309401,2309398,2309386,2309385,2309328,2309318,2309088,2308939,2308930,2308920,2308915,2308910,2258697";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/johncave/images";break}switch(a){case 1:b="http://www1.clikpic.com/johncave/images";break}switch(a){case 2:b="http://admin.clikpic.com/johncave/images";break}switch(a){case 24:b="http://tpc15/clikpic/johncave/images";break}switch(a){case 4:b="http://www.clikchurch.com/johncave/images";break}switch(a){case 5:b="http://www2.clikpic.com/johncave/images";break}switch(a){case 22:b="http://tpc5/clikpic/johncave/images";break}switch(a){case 23:b="http://tpc10/clikpic/johncave/images";break}switch(a){case 25:b="http://tpc16/clikpic/johncave/images";break}switch(a){case 15:b="http://www3.clikpic.com/johncave/images";break}switch(a){case 18:b="http://www4.clikpic.com/johncave/images";break}switch(a){case 19:b="http://www5.clikpic.com/johncave/images";break}switch(a){case 31:b="http://www7.clikpic.com/johncave/images";break}switch(a){case 32:b="http://admin2.clikpic.com/johncave/images";break}switch(a){case 33:b="http://www8.clikpic.com/johncave/images";break}switch(a){case 34:b="http://www9.clikpic.com/johncave/images";break}switch(a){case 35:b="http://admin3.clikpic.com/johncave/images";break}switch(a){case 37:b="http://admin4.clikpic.com/johncave/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="John Cave 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>John Cave </strong>'+photos[b].photographer+"</p>"}a=a+fnGetPaymentInfo(photos[b]);if(a!=""){a=a+'<div class="spacer"></div>'}return a}function fnGetPaymentInfo(c){var b="";if(c.item_price!==""){b=b+"<p>Buy now using PayPal:</p>";b=b+'<p class="imageinfo" id="imagePrice"><strong>'+c.purchase_instruction+"</strong> 				&pound;"+(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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';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+'<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';b=b+'	<input type="hidden" name="item_option" value="'+a+'">';b=b+'	<input type="hidden" name="site" value="JOHNCAVE">';b=b+'	<input type="hidden" name="item_number" value="'+c.id+'">';b=b+'	<input type="hidden" name="quantity" value="1">';b=b+'	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button">';b=b+'	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';b=b+"</form>";b=b+'<div class="clearing">&nbsp;</div>';b=b+'<div id="confirmContainer">';b=b+'<div id="paymentConfirm">Item added to cart</div>';b=b+"</div>";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+'")'})}}};