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[483578]=new thumbnail(483578,"37878","Hand made silk bag","bag1_thumb.jpg",130,98,15);thumbnails[483580]=new thumbnail(483580,"37878","","bag5_thumb.jpg",130,86,15);thumbnails[483581]=new thumbnail(483581,"37878","","bag2_thumb.jpg",130,98,15);thumbnails[483584]=new thumbnail(483584,"37878","","bag4_thumb.jpg",130,78,15);thumbnails[483585]=new thumbnail(483585,"23576","Hand decorated silk fan","fan_thumb.jpg",130,98,15);thumbnails[483586]=new thumbnail(483586,"37878","","bag3_thumb.jpg",130,112,15);thumbnails[292457]=new thumbnail(292457,"24192","","DSCN3529_thumb.JPG",130,92,15);thumbnails[292460]=new thumbnail(292460,"24192","","DSCN3537_thumb.JPG",130,91,15);thumbnails[292462]=new thumbnail(292462,"24192","The joy of music cards","DSCN3545_thumb.JPG",130,97,15);thumbnails[292466]=new thumbnail(292466,"25580","I was inspired by the clouds I saw one day in my mums back garden.","DSCN3561_thumb.JPG",130,98,15);thumbnails[292452]=new thumbnail(292452,"25580","My mums garden and the Peak District inspired me for this painting.","DSCN2418_thumb.JPG",130,112,15);thumbnails[292463]=new thumbnail(292463,"25580","I painted this in an Art Class at the Lyndhurst Centre Gateshead. Land and Sea by Vernon Kerr -Walter Foster press was used as the source book.","DSCN3547_thumb.JPG",130,146,15);thumbnails[292464]=new thumbnail(292464,"25580","I painted this picture at an Art class with Dave Paul at the Lyndhurst Centre, Gateshead. I regret that I do not know where the original image came from.","DSCN3553_thumb.JPG",130,177,15);thumbnails[292465]=new thumbnail(292465,"25580","I painted this picture in an Art class with Dave Paul, at the Lyndhurst Centre, Gateshead. The source book was Land and Sea by Vernon Kerr, Walter Foster press","DSCN3556_thumb.JPG",130,175,15);thumbnails[263268]=new thumbnail(263268,"23575","I have used a source book for the image of the bird but regret at present that I do not have the details of the book. I hope to update this shortly.","scarves14_thumb.jpg",130,98,15);thumbnails[269655]=new thumbnail(269655,"23576","I have used a source book for the picture of the bird and I regret at present I do not have the book details. But I hope to update this shortly ","1a_thumb.jpg",130,165,15);thumbnails[263237]=new thumbnail(263237,"23576","This is based on the famous - Angel of the North in Gateshead.","angel_thumb.jpg",130,98,15);thumbnails[263238]=new thumbnail(263238,"23576","","bag_thumb.jpg",130,98,15);thumbnails[263240]=new thumbnail(263240,"23576","","bow_thumb.jpg",130,98,15);thumbnails[263241]=new thumbnail(263241,"63266","","bowtie_thumb.jpg",130,98,15);thumbnails[263242]=new thumbnail(263242,"23576","","scrunchie_thumb.jpg",130,98,15);thumbnails[263243]=new thumbnail(263243,"63253","","screen2_thumb.jpg",130,173,15);thumbnails[263246]=new thumbnail(263246,"63253","","screen-3_thumb.jpg",130,114,15);thumbnails[263249]=new thumbnail(263249,"23575","","scarves2_thumb.jpg",130,98,15);thumbnails[263250]=new thumbnail(263250,"23575","","scarves3_thumb.jpg",130,130,15);thumbnails[263251]=new thumbnail(263251,"23575","","green-scarves_thumb.jpg",130,213,15);thumbnails[263252]=new thumbnail(263252,"23575","","scarves6_thumb.jpg",130,98,15);thumbnails[263256]=new thumbnail(263256,"23576","","flowers2_thumb.jpg",130,98,15);thumbnails[263259]=new thumbnail(263259,"23576","","flowers_thumb.jpg",130,98,15);thumbnails[263264]=new thumbnail(263264,"23576","","lion_thumb.jpg",130,98,15);thumbnails[263265]=new thumbnail(263265,"23575","Garden Flower Designs by Polly Pinder, Search Press was used for the flower images.  ","scarves16_thumb.jpg",130,98,15);thumbnails[263274]=new thumbnail(263274,"23575","Flower Designs by Mandy Southan, Search Press has been used for the flower image. ","scarves13_thumb.jpg",130,98,15);thumbnails[263275]=new thumbnail(263275,"23575","I have used a source book for the flowers but I regret at present that I do not have the details and i will update as soon as possible.","scarves12_thumb.jpg",130,98,15);thumbnails[263280]=new thumbnail(263280,"23575","Garden Flower Designs by Polly Pinder, Search Press has been used for the flower images.","scarves15_thumb.jpg",130,98,15);thumbnails[263304]=new thumbnail(263304,"","","f4_thumb.jpg",130,98,15);thumbnails[263307]=new thumbnail(263307,"","","f6_thumb.jpg",130,98,15);thumbnails[264641]=new thumbnail(264641,"23575","","scarves5_thumb.jpg",130,154,15);thumbnails[264642]=new thumbnail(264642,"23575","","scarves11_thumb.jpg",130,98,15);thumbnails[269656]=new thumbnail(269656,"24000","Resting in Love. I have used a source book for the birds but I regret at present that I do not have the details of the book. I will update shortly.","1b_thumb.jpg",130,145,15);thumbnails[269658]=new thumbnail(269658,"23576","","1d_thumb.jpg",130,145,15);thumbnails[269660]=new thumbnail(269660,"24000","My Beloved. Art Nouveau Designs by Judy Balchin, Search Press has been used for the image of the girl.  ","10_thumb.jpg",130,168,15);thumbnails[269661]=new thumbnail(269661,"24000","My Beloved One. Art Nouveau Designs by Judy Balchin, Search Press has been used for the image of the girl.","1n_thumb.jpg",130,207,15);thumbnails[269666]=new thumbnail(269666,"24000","Receiving the Beloveds love. Art Nouveau Designs by Judy Balchin, Search Press has been used for the image of the girl.","1j_thumb.jpg",130,163,15);thumbnails[269668]=new thumbnail(269668,"24000","Flames of love","1i_thumb.jpg",130,187,15);thumbnails[269671]=new thumbnail(269671,"24000","Flames of love","1h_thumb.jpg",130,147,15);thumbnails[272556]=new thumbnail(272556,"24192","","DSCN3486_thumb.jpg",130,106,15);thumbnails[272558]=new thumbnail(272558,"24192","","DSCN3487_thumb.jpg",130,136,15);thumbnails[272559]=new thumbnail(272559,"24192","","DSCN3488_thumb.jpg",130,144,15);thumbnails[272563]=new thumbnail(272563,"24192","","DSCN3493_thumb.jpg",130,158,15);thumbnails[272564]=new thumbnail(272564,"24192","","DSCN3499_thumb.jpg",130,118,15);thumbnails[272565]=new thumbnail(272565,"24192","","DSCN3500_thumb.jpg",130,130,15);thumbnails[272567]=new thumbnail(272567,"24192","","DSCN3502_thumb.jpg",130,150,15);thumbnails[272568]=new thumbnail(272568,"24192","","DSCN3501_thumb.jpg",130,101,15);thumbnails[272668]=new thumbnail(272668,"24192","","DSCN3513_thumb.jpg",130,167,15);thumbnails[815937]=new thumbnail(815937,"63252","Hand painted waistcoat","DSCN4020_thumb.JPG",130,183,15);thumbnails[815941]=new thumbnail(815941,"63252","","DSCN4011_thumb.JPG",130,134,15);thumbnails[815945]=new thumbnail(815945,"63252","Hand painted on Satin with black satin lining","DSCN4264_thumb.JPG",130,156,15);thumbnails[815946]=new thumbnail(815946,"63252","","DSCN4266_thumb.JPG",130,134,15);thumbnails[815947]=new thumbnail(815947,"63252","","DSCN4267_thumb.JPG",130,162,15);thumbnails[815948]=new thumbnail(815948,"63252","","DSCN4269_thumb.JPG",130,157,15);thumbnails[815951]=new thumbnail(815951,"63252","Musical Theme ","DSCN4270_thumb.JPG",130,156,15);thumbnails[815952]=new thumbnail(815952,"63253","","DSCN4225_thumb.JPG",130,123,15);thumbnails[815953]=new thumbnail(815953,"63253","","DSCN4224_thumb.JPG",130,136,15);thumbnails[815958]=new thumbnail(815958,"63266","Swimming in the deep sea","DSCN3988_thumb.JPG",130,191,15);thumbnails[815959]=new thumbnail(815959,"63266","Sheep ","DSCN3986_thumb.JPG",130,312,15);thumbnails[815960]=new thumbnail(815960,"63266","Sailing on a lake","DSCN3985_thumb.JPG",130,337,15);thumbnails[815962]=new thumbnail(815962,"63266","Music Notes","DSCN3983_thumb.JPG",130,215,15);thumbnails[815963]=new thumbnail(815963,"63266","","DSCN3979_thumb.JPG",130,151,15);thumbnails[816226]=new thumbnail(816226,"63266","","DSCN4274_thumb.JPG",130,184,15);thumbnails[816227]=new thumbnail(816227,"63252","Singing birds waistcoat","DSCN4278_thumb.JPG",130,147,15);thumbnails[816229]=new thumbnail(816229,"63252","Singing birds waistcoat","DSCN4276_thumb.JPG",130,147,15);thumbnails[319331]=new thumbnail(319331,"22308","","DSCN3564_thumb.JPG",130,92,15);thumbnails[319337]=new thumbnail(319337,"22308","","DSCN3575_thumb.JPG",130,130,15);thumbnails[319340]=new thumbnail(319340,"22308","","DSCN3577_thumb.JPG",130,132,15);thumbnails[319342]=new thumbnail(319342,"22308","","DSCN3582_thumb.JPG",130,87,15);thumbnails[366952]=new thumbnail(366952,"22308","Silk Cushions designed for my friends weddings. Wedding Designs by Sonia Griffin, Search Press was used for the Dove Images.","DSCN3586_thumb.JPG",130,73,15);thumbnails[263226]=new thumbnail(263226,"22308","","cushions_thumb.jpg",130,78,15);thumbnails[263227]=new thumbnail(263227,"22308","","cushions2_thumb.jpg",130,98,15);thumbnails[263231]=new thumbnail(263231,"22308","","belovedcushion_thumb.jpg",130,98,15);thumbnails[263232]=new thumbnail(263232,"22308","","fishcushion_thumb.jpg",130,98,15);thumbnails[263234]=new thumbnail(263234,"22308","","cushions8_thumb.jpg",130,98,15);thumbnails[263235]=new thumbnail(263235,"22308","","cushions9_thumb.jpg",130,98,15);thumbnails[272553]=new thumbnail(272553,"22308","","DSCN3483_thumb.jpg",130,96,15);thumbnails[272554]=new thumbnail(272554,"22308","<p>Art Nouveau,Borders & Motifs by Judy Balchin, Search Press was used for the main butterfly image.</p> ","DSCN3484_thumb.jpg",130,121,15);thumbnails[272555]=new thumbnail(272555,"22308","","DSCN3485_thumb.jpg",130,121,15);thumbnails[319335]=new thumbnail(319335,"22308","","DSCN3566_thumb.JPG",130,62,15);thumbnails[319336]=new thumbnail(319336,"22308","","DSCN3573_thumb.JPG",130,116,15);var galleries=new Object();galleries[24192]=new gallery(24192,"292462,292460,292457,272668,272568,272567,272565,272564,272563,272559","Cards ","section42067",[292457,292460,292462,272556,272558,272559,272563,272564,272565,272567,272568,272668]);galleries[25580]=new gallery(25580,"292466,292465,292464,292463,292452","Oil Paintings","section43696",[292466,292452,292463,292464,292465]);galleries[37878]=new gallery(37878,"483586,483584,483581,483580,483578","Silk Bags","section59152",[483578,483580,483581,483584,483586]);galleries[23576]=new gallery(23576,"483585,269658,269655,263264,263259,263256,263242,263240,263238,263237","SILK DREAMS","section41236",[483585,269655,263237,263238,263240,263242,263256,263259,263264,269658]);galleries[23575]=new gallery(23575,"264642,264641,263280,263275,263274,263268,263265,263252,263251,263250","SILK SCARVES","section41235",[263268,263249,263250,263251,263252,263265,263274,263275,263280,264641,264642]);galleries[63253]=new gallery(63253,"815953,815952,263246,263243","Silk Screens","section91784",[263243,263246,815952,815953]);galleries[63266]=new gallery(63266,"816226,815963,815962,815960,815959,815958,263241","Silk Ties","section91801",[263241,815958,815959,815960,815962,815963,816226]);galleries[24000]=new gallery(24000,"269671,269668,269666,269661,269660,269656","Song of Songs","section41861",[269656,269660,269661,269666,269668,269671]);galleries[63252]=new gallery(63252,"816229,816227,815951,815948,815947,815946,815945,815941,815937","Waistcoats","section91782",[815937,815941,815945,815946,815947,815948,815951,816227,816229]);galleries[22308]=new gallery(22308,"366952,319342,319340,319337,319336,319335,319331,272555,272554,272553","SILK CUSHIONS","section41233",[319331,319337,319340,319342,366952,263226,263227,263231,263232,263234,263235,272553,272554,272555,319335,319336]);var imageSets=new Object();imageSets[1]="263307,263304";imageSets[3]="816229,816227,816226,815963,815962,815960,815959,815958,815953,815952,815951,815948,815947,815946,815945,815941,815937,483586,483585,483584,483581,483580,483578,366952,319342,319340,319337,319336,319335,319331,292466,292465,292464,292463,292462,292460,292457,292452,272668,272568,272567,272565,272564,272563,272559,272558,272556,272555,272554,272553";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/beloved/images";break}switch(a){case 1:b="http://www1.clikpic.com/beloved/images";break}switch(a){case 2:b="http://admin.clikpic.com/beloved/images";break}switch(a){case 24:b="http://tpc15/clikpic/beloved/images";break}switch(a){case 4:b="http://www.clikchurch.com/beloved/images";break}switch(a){case 5:b="http://www2.clikpic.com/beloved/images";break}switch(a){case 22:b="http://tpc5/clikpic/beloved/images";break}switch(a){case 23:b="http://tpc10/clikpic/beloved/images";break}switch(a){case 25:b="http://tpc16/clikpic/beloved/images";break}switch(a){case 15:b="http://www3.clikpic.com/beloved/images";break}switch(a){case 18:b="http://www4.clikpic.com/beloved/images";break}switch(a){case 19:b="http://www5.clikpic.com/beloved/images";break}switch(a){case 31:b="http://www7.clikpic.com/beloved/images";break}switch(a){case 32:b="http://admin2.clikpic.com/beloved/images";break}switch(a){case 33:b="http://www8.clikpic.com/beloved/images";break}switch(a){case 34:b="http://www9.clikpic.com/beloved/images";break}switch(a){case 35:b="http://admin3.clikpic.com/beloved/images";break}switch(a){case 37:b="http://admin4.clikpic.com/beloved/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("section59152"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section59152.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("section59152"!=""){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="Ruth Chesterman: "+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;resizePhotoInfo();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 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="BELOVED">';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+'")'})}}};