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[3199492]=new thumbnail(3199492,"225169","Fowlsheugh Waterfall","_MG_0870_1_2smallbw_thumb.jpg",130,195,32);thumbnails[3199531]=new thumbnail(3199531,"225169","Dunottar Panorama","castlepanosmall_thumb.jpg",130,52,32);thumbnails[3199634]=new thumbnail(3199634,"225169","Stonehaven Harbour","panoharboursmall_thumb.jpg",130,36,32);thumbnails[3201711]=new thumbnail(3201711,"225167","McDonalds Double Exposure.","3101747703_40480e99b7_b[1]_thumb.jpg",130,48,32);thumbnails[3201712]=new thumbnail(3201712,"225167","Plane Landing","3101748851_af7bf9eb8b_b[1]_thumb.jpg",130,37,32);thumbnails[3201714]=new thumbnail(3201714,"225167","Car.","3102582586_e3f43e9f5b[1]_thumb.jpg",130,85,32);thumbnails[3201737]=new thumbnail(3201737,"225170","Fraser","2015370889_ce11657682[1]_thumb.jpg",130,87,32);thumbnails[3201748]=new thumbnail(3201748,"225170","Nicola","2412593857_efff4b4a7f[1]_thumb.jpg",130,87,32);thumbnails[3201749]=new thumbnail(3201749,"225170","My niece Holly.","2104961123_f23aabb69e[1]_thumb.jpg",130,195,32);thumbnails[3201751]=new thumbnail(3201751,"225169","Stonehaven Bay","3044914285_71bd7fc214[1]_thumb.jpg",130,87,32);thumbnails[3202760]=new thumbnail(3202760,"225169","Boat at Stonehaven Harbour","2041013481_13dec6d346[1]_thumb.jpg",130,87,32);thumbnails[3202907]=new thumbnail(3202907,"225169","Catterline","2917655805_2be9e68c6a[1]_thumb.jpg",130,195,32);thumbnails[3203085]=new thumbnail(3203085,"225167","Caravan Site","2889781398_bef2961b49[1]_thumb.jpg",130,87,32);thumbnails[3203089]=new thumbnail(3203089,"225167","Light Double exposure","3102579754_492cd9c2ef[1]_thumb.jpg",130,85,32);thumbnails[3203183]=new thumbnail(3203183,"225167","Bauble","3101748503_a457567d4e[1]_thumb.jpg",130,85,32);thumbnails[3209266]=new thumbnail(3209266,"225169","Field","2547964602_3899f052bd[1]_thumb.jpg",130,195,32);thumbnails[3655342]=new thumbnail(3655342,"225169","St Cyrus","3323576856_794b7c1b0d_b1_thumb.jpg",130,87,32);thumbnails[3685657]=new thumbnail(3685657,"225167","Bloody hand print","3170578718_ebd6ae232f_b1_thumb.jpg",130,87,32);thumbnails[3685665]=new thumbnail(3685665,"225169","Stonehaven harbour","3294365529_4f4096e83e_b1_thumb.jpg",130,87,32);thumbnails[3685670]=new thumbnail(3685670,"225169","St Cyrus","3322748809_4c969a75e9_b1_thumb.jpg",130,195,32);thumbnails[3685688]=new thumbnail(3685688,"225169","Balmedie","3395767585_361924d265_b1_thumb.jpg",130,63,32);thumbnails[3685695]=new thumbnail(3685695,"225169","Windmill farm","3407529196_b81ae5e843_b1_thumb.jpg",130,196,32);thumbnails[3685700]=new thumbnail(3685700,"225167","Chris","3411628947_f269532f81_b1_thumb.jpg",130,87,32);thumbnails[3685702]=new thumbnail(3685702,"225167","Work","3412444126_2eab04fa5b_b1_thumb.jpg",130,87,32);thumbnails[4077572]=new thumbnail(4077572,"225170","Jennifer","DSC_25291_thumb.jpg",130,197,32);thumbnails[4077573]=new thumbnail(4077573,"225170","Leoni","DSC_25301_thumb.jpg",130,195,32);thumbnails[4077583]=new thumbnail(4077583,"225170","Leoni","DSC_25351_thumb.jpg",130,195,32);thumbnails[4077597]=new thumbnail(4077597,"225170","Leoni","DSC_25501_thumb.jpg",130,87,32);thumbnails[4077604]=new thumbnail(4077604,"225170","Leoni","DSC_25571_thumb.jpg",130,195,32);thumbnails[4077614]=new thumbnail(4077614,"225170","Leoni","DSC_25641_thumb.jpg",130,87,32);thumbnails[4130966]=new thumbnail(4130966,"225169","Sailing Boat","DSC_1205web_thumb.jpg",130,86,32);thumbnails[4130967]=new thumbnail(4130967,"225169","Stonehaven Harbour","DSC_1185web_thumb.jpg",130,86,32);thumbnails[4130971]=new thumbnail(4130971,"225169","St James' Church","DSC_1173_5web_thumb.jpg",130,195,32);thumbnails[4735530]=new thumbnail(4735530,"225169","Aberdeen Harbour","DSC_33771_thumb.jpg",130,53,32);thumbnails[4750557]=new thumbnail(4750557,"225169","Sun over feild","3821732396_ac94f2fed21_thumb.jpg",130,87,32);thumbnails[4750562]=new thumbnail(4750562,"225169","Sunset at horizon","3821740914_5520861bc7_b1_thumb.jpg",130,196,32);thumbnails[4770734]=new thumbnail(4770734,"225169","Stormy Sea","3937919118_000031d3b81_thumb.jpg",130,138,32);thumbnails[4820050]=new thumbnail(4820050,"225170","Alanah","3582213722_4d0c6acec91_thumb.jpg",130,195,32);thumbnails[4820052]=new thumbnail(4820052,"225170","Alanah","3584732533_9b4e73f3e31_thumb.jpg",130,195,32);thumbnails[4820520]=new thumbnail(4820520,"225169","River","DSC_362011_thumb.jpg",130,87,32);thumbnails[4820527]=new thumbnail(4820527,"225169","River","DSC_3625_thumb.jpg",130,87,32);thumbnails[4843183]=new thumbnail(4843183,"225170","Lucy","3659929007_bc49104569_o11_thumb.jpg",130,87,32);thumbnails[4843184]=new thumbnail(4843184,"225170","Lucy","3659940133_b14d3454a9_o11_thumb.jpg",130,195,32);thumbnails[4843187]=new thumbnail(4843187,"225170","Jennifer","DSC_38411_thumb.jpg",130,87,32);thumbnails[4843190]=new thumbnail(4843190,"225170","Roseanne","DSC_37801_thumb.jpg",130,163,32);thumbnails[4843204]=new thumbnail(4843204,"225170","Roseanne","DSC_37381_thumb.jpg",130,163,32);thumbnails[4915727]=new thumbnail(4915727,"225170","Some editorial work.","mickey1_thumb.jpg",130,87,32);thumbnails[4917112]=new thumbnail(4917112,"225170","Editorial work.","mickey2_thumb.jpg",130,195,32);thumbnails[5076170]=new thumbnail(5076170,"287183","Holly and Jillian","DSC_4537_thumb.jpg",130,195,32);thumbnails[5076183]=new thumbnail(5076183,"287183","Jillian and Keith","DSC_4567_thumb.jpg",130,202,32);thumbnails[5076187]=new thumbnail(5076187,"287183","Jillian with Bridesmaids","DSC_4615_thumb.jpg",130,195,32);thumbnails[5076195]=new thumbnail(5076195,"287183","Last Dance","DSC_4599_thumb.jpg",130,87,32);thumbnails[5076254]=new thumbnail(5076254,"287183","Dance!","DSC_4540_thumb.jpg",130,87,32);thumbnails[5076309]=new thumbnail(5076309,"225170","Holly","DSC_4273web_thumb.jpg",130,130,32);thumbnails[5076312]=new thumbnail(5076312,"225170","Holly","DSC_4227web_thumb.jpg",130,63,32);thumbnails[5076316]=new thumbnail(5076316,"225170","Holly","DSC_4229web_thumb.jpg",130,87,32);thumbnails[5106893]=new thumbnail(5106893,"288697","Stonehaven Fireworks","1_thumb.jpg",130,85,32);thumbnails[5106897]=new thumbnail(5106897,"288697","Stonehaven Fireworks","DSC_47301_thumb.jpg",130,211,32);thumbnails[5106900]=new thumbnail(5106900,"288697","Stonehaven Fireworks","DSC_47361_thumb.jpg",130,195,32);thumbnails[5106902]=new thumbnail(5106902,"288697","Stonehaven Fireworks","DSC_47441_thumb.jpg",130,241,32);thumbnails[5106908]=new thumbnail(5106908,"288697","","DSC_47451_thumb.jpg",130,209,32);thumbnails[5106910]=new thumbnail(5106910,"288697","Stonehaven Fireworks","DSC_47631_thumb.jpg",130,277,32);thumbnails[5106917]=new thumbnail(5106917,"288697","Stonehaven Fireworks","DSC_47721_thumb.jpg",130,195,32);thumbnails[5118203]=new thumbnail(5118203,"289221","Scottish Bioenergy Bioreactor ","distillery_1511_1_thumb.jpg",130,195,32);thumbnails[5118206]=new thumbnail(5118206,"289221","Scottish Bioenergy Bioreactor ","distillery_1511_3_thumb.jpg",130,195,32);thumbnails[5118214]=new thumbnail(5118214,"289221","Scottish Bioenergy Bioreactor ","distillery_1511_2_thumb.jpg",130,195,32);thumbnails[5176051]=new thumbnail(5176051,"225170","Jennifer","DSC_5319_thumb.jpg",130,196,32);thumbnails[5176093]=new thumbnail(5176093,"225170","Darren","DSC_5290_thumb.jpg",130,86,32);thumbnails[5181533]=new thumbnail(5181533,"225169","Balmedie","DSC_5176web_thumb.jpg",130,87,32);thumbnails[5181538]=new thumbnail(5181538,"225169","Balmedie","DSC_5175web_thumb.jpg",130,86,32);thumbnails[5206760]=new thumbnail(5206760,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5462_thumb.jpg",130,195,32);thumbnails[5206765]=new thumbnail(5206765,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5489_thumb.jpg",130,87,32);thumbnails[5206766]=new thumbnail(5206766,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5522_thumb.jpg",130,195,32);thumbnails[5206770]=new thumbnail(5206770,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5537_thumb.jpg",130,195,32);thumbnails[5206773]=new thumbnail(5206773,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5577_thumb.jpg",130,87,32);thumbnails[5206774]=new thumbnail(5206774,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5637_thumb.jpg",130,195,32);thumbnails[5206776]=new thumbnail(5206776,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5680_thumb.jpg",130,195,32);thumbnails[5206778]=new thumbnail(5206778,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5741_thumb.jpg",130,195,32);thumbnails[5206779]=new thumbnail(5206779,"287183","Chris Hoy and Anna Kasinska Wedding","DSC_5752_thumb.jpg",130,195,32);var galleries=new Object();galleries[289221]=new gallery(289221,"5118214,5118206,5118203","Commercial","section275626",[5118203,5118206,5118214]);galleries[225167]=new gallery(225167,"3685702","Documentary","section275626",[3201711,3201712,3201714,3203085,3203089,3203183,3685657,3685700,3685702]);galleries[288697]=new gallery(288697,"5106917,5106910,5106908,5106902,5106900,5106897,5106893","Events","section275626",[5106893,5106897,5106900,5106902,5106908,5106910,5106917]);galleries[225169]=new gallery(225169,"4820527,4820520,4770734,4750562,4750557","Landscape","section275626",[3199492,3199531,3199634,3201751,3202760,3202907,3209266,3655342,3685665,3685670,3685688,3685695,4130966,4130967,4130971,4735530,4750557,4750562,4770734,4820520,4820527,5181533,5181538]);galleries[225170]=new gallery(225170,"4843187,4843184,4843183,4820052,4820050","Portrait","section275626",[3201737,3201748,3201749,4077572,4077573,4077583,4077597,4077604,4077614,4820050,4820052,4843183,4843184,4843187,4843190,4843204,4915727,4917112,5076309,5076312,5076316,5176051,5176093]);galleries[287183]=new gallery(287183,"5206779,5206778,5206776,5206774,5206773,5206770,5206766,5206765,5206760,5076254","Weddings","section275626",[5076170,5076183,5076187,5076195,5076254,5206760,5206765,5206766,5206770,5206773,5206774,5206776,5206778,5206779]);var imageSets=new Object();imageSets[1]="5181533,5076309,4843187,4843183,4820527,4820520,4820052,4820050,4770734,4750562,4750557,4735530,4130971,4130967,4130966,4077614,4077604,4077597,4077583,4077573,3685688,3685670,3685665,3655342,3209266,3202907,3202760,3201751,3201749,3201748,3199492";imageSets[2]="4843187,4843184,4843183,4820527,4820520,4820052,4820050,4770734,4750562,4750557,3685702";imageSets[3]="4843187,4843183,4820527,4820520,4820052,4820050,4770734,4750562,4750557";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/calumriddell/images";break}switch(a){case 1:b="http://www1.clikpic.com/calumriddell/images";break}switch(a){case 2:b="http://admin.clikpic.com/calumriddell/images";break}switch(a){case 24:b="http://tpc15/clikpic/calumriddell/images";break}switch(a){case 4:b="http://www.clikchurch.com/calumriddell/images";break}switch(a){case 5:b="http://www2.clikpic.com/calumriddell/images";break}switch(a){case 22:b="http://tpc5/clikpic/calumriddell/images";break}switch(a){case 23:b="http://tpc10/clikpic/calumriddell/images";break}switch(a){case 25:b="http://tpc16/clikpic/calumriddell/images";break}switch(a){case 15:b="http://www3.clikpic.com/calumriddell/images";break}switch(a){case 18:b="http://www4.clikpic.com/calumriddell/images";break}switch(a){case 19:b="http://www5.clikpic.com/calumriddell/images";break}switch(a){case 31:b="http://www7.clikpic.com/calumriddell/images";break}switch(a){case 32:b="http://admin2.clikpic.com/calumriddell/images";break}switch(a){case 33:b="http://www8.clikpic.com/calumriddell/images";break}switch(a){case 34:b="http://www9.clikpic.com/calumriddell/images";break}switch(a){case 35:b="http://admin3.clikpic.com/calumriddell/images";break}switch(a){case 37:b="http://admin4.clikpic.com/calumriddell/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("section275626"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section275626.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("section275626"!=""){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="Calum Riddell Photography | 07826899439: "+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>"}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="CALUMRIDDELL">';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+'")'})}}};