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[693889]=new thumbnail(693889,"53088","sunset  SOLD","sunset 2_thumb.jpg",130,174,1);thumbnails[693929]=new thumbnail(693929,"53216","flowering on the beach<br>\r\nSOLD","flowering on the beach 21_thumb.jpg",130,173,1);thumbnails[695209]=new thumbnail(695209,"53216","steps to the garden<br>\r\nSOLD","steps to the garden 21_thumb.jpg",130,98,1);thumbnails[703795]=new thumbnail(703795,"53088","village life<br>\r\nSOLD","village life_thumb.jpg",130,98,1);thumbnails[780003]=new thumbnail(780003,"53088","three boats<br>\r\nSOLD","three boats_thumb.jpg",130,98,1);thumbnails[789786]=new thumbnail(789786,"53216","sea of tulips<br>\r\n36x91 cm SOLD","sea of tulips1_thumb.jpg",130,98,1);thumbnails[813730]=new thumbnail(813730,"53216","in the garden SOLD<br>\r\n61x91cm","in the garden4_thumb.jpg",130,98,1);thumbnails[838353]=new thumbnail(838353,"53218","primavera<br>\r\n51x61cm","primavera1_thumb.jpg",130,98,1);thumbnails[933731]=new thumbnail(933731,"80329","across the water<br>\r\n60x90cm    SOLD","across the water2_thumb.jpg",130,98,1);thumbnails[1047336]=new thumbnail(1047336,"80329","close to the sea SOLD<br>\r\n76x100cm","close to the sea7_thumb.jpg",130,98,1);thumbnails[1089639]=new thumbnail(1089639,"80329","above the clouds<br>\r\n60 x 120 cm","above the clouds_thumb.jpg",130,97,1);thumbnails[1277884]=new thumbnail(1277884,"53218","over the bay  SOLD<br>\r\n40x40cm","over the bay 2_thumb.jpg",130,98,1);thumbnails[1492546]=new thumbnail(1492546,"80329","in the pond of life SOLD<br>\r\n40x100cm","in the pond of life1_thumb.JPG",130,98,1);thumbnails[1523899]=new thumbnail(1523899,"80329","moonlight across the bay SOLD<br>\r\n90x90cm","moonlight across the bay8_thumb.jpg",130,98,1);thumbnails[1537194]=new thumbnail(1537194,"53088","orange roof SOLD<br>\r\n41x51cm","orange roof_thumb.JPG",130,98,1);thumbnails[1680664]=new thumbnail(1680664,"80329","so far away SOLD<br>\r\n50x100cm","so far away_thumb.JPG",130,98,1);thumbnails[1690888]=new thumbnail(1690888,"80329","swimming away<br>\r\n50x100cm","swimming away_thumb.JPG",130,98,1);thumbnails[1938146]=new thumbnail(1938146,"80329","splashing out  SOLD<br>\r\n50 x 100cms","splashing _thumb.JPG",130,98,1);thumbnails[2227091]=new thumbnail(2227091,"53218","seasandstones<br>\r\n30x40cm SOLD","seasandstones2_thumb.JPG",130,98,1);thumbnails[2302540]=new thumbnail(2302540,"53088","Be my friend<br>\r\n40x100cm","Be my friend1_thumb.JPG",130,98,1);thumbnails[2302550]=new thumbnail(2302550,"53088","campfire<br>\r\n40x50cm SOLD","Campfire_thumb.JPG",130,98,1);thumbnails[2472574]=new thumbnail(2472574,"53088","little village<br>\r\n30x40cm SOLD","little village_thumb.JPG",130,98,1);thumbnails[2472581]=new thumbnail(2472581,"80329","pure stream<br>\r\n30x40cm SOLD","pure stream_thumb.JPG",130,98,1);thumbnails[2472587]=new thumbnail(2472587,"80329","Drift 40x50cm<br>\r\nSOLD","adrift 40x50cm acrylic&ink_thumb.JPG",130,98,1);thumbnails[2472595]=new thumbnail(2472595,"53216","in the jardin<br>\r\n40x30cm SOLD","in the garden 1 acrylic&ink 50x40cm_thumb.JPG",130,174,1);thumbnails[3124390]=new thumbnail(3124390,"53218","by the water<br>\r\n50x70cm SOLD","by the lake_thumb.JPG",130,98,1);thumbnails[3124440]=new thumbnail(3124440,"53216","across the field<br>\r\n20x25cm SOLD","across the field _thumb.JPG",130,98,1);thumbnails[3124495]=new thumbnail(3124495,"194152","over there<br>\r\n20x20cm<br>\r\nSOLD","over there_thumb.JPG",130,98,1);thumbnails[3128293]=new thumbnail(3128293,"194152","pots<br>\r\n20x25cm<br>\r\nSOLD","pots_thumb.JPG",130,98,1);thumbnails[3171448]=new thumbnail(3171448,"194152","cream sundae<br>\r\n20x20cm","cream sundae_thumb.JPG",130,173,1);thumbnails[3171452]=new thumbnail(3171452,"194152","islands<br>\r\n20x20cm<br>\r\nSOLD","islands_thumb.JPG",130,173,1);thumbnails[3171455]=new thumbnail(3171455,"194152","through the clouds<br>\r\n20x20cm<br>\r\nSOLD","through the clouds_thumb.JPG",130,173,1);thumbnails[3183609]=new thumbnail(3183609,"194152","away<br>\r\n20x20cm SOLD","away_thumb.JPG",130,173,1);thumbnails[3183613]=new thumbnail(3183613,"194152","windy day<br>\r\n12x18cm<br>\r\nSOLD","windy day1_thumb.JPG",130,98,1);thumbnails[3257345]=new thumbnail(3257345,"194152","upside down<br>\r\n20x20cm SOLD","upside down_thumb.JPG",130,173,1);thumbnails[3257347]=new thumbnail(3257347,"194152","side to side<br>\r\n20x20cm SOLD","side to side_thumb.JPG",130,98,1);thumbnails[3312015]=new thumbnail(3312015,"194152","hi  SOLD<br>\r\n20x20cm<br>\r\n","hi_thumb.JPG",130,98,1);thumbnails[3312021]=new thumbnail(3312021,"194152","lone boat SOLD<br>\r\n12x16cm","lone boat_thumb.JPG",130,98,1);thumbnails[3388751]=new thumbnail(3388751,"194152","somewhere over there<br>\r\n20x20cm SOLD","somewhere over there2_thumb.JPG",130,98,1);thumbnails[3395457]=new thumbnail(3395457,"53088","across the sands SOLD<br>\r\n45x61cm","across the sands_thumb.JPG",130,98,1);thumbnails[3568799]=new thumbnail(3568799,"80329","in the harbour too<br>\r\n25x50cm","in_the_harbour_thumb.JPG",130,98,1);thumbnails[3568804]=new thumbnail(3568804,"80329","round the harbour<br>\r\n30x50cm","round_the_harbour_thumb.JPG",130,98,1);thumbnails[3568819]=new thumbnail(3568819,"53218","playground<br>\r\n40x50cm SOLD","playground_1_thumb.JPG",130,98,1);thumbnails[3613126]=new thumbnail(3613126,"194152","pink rose<br>\r\n20x20cm","pink_rose_thumb.JPG",130,173,1);thumbnails[3641622]=new thumbnail(3641622,"80329","skipping along the beach<br>\r\n50x100cm","skipping_along_the_beach_thumb.JPG",130,98,1);thumbnails[3641633]=new thumbnail(3641633,"194152","fishing <br>\r\n20x20cm","fishing_thumb.JPG",130,173,1);thumbnails[3700655]=new thumbnail(3700655,"53216","spring fever SOLD<br>\r\n70x50cm","spring_fever_thumb.JPG",130,173,1);thumbnails[3700682]=new thumbnail(3700682,"194152","spring SOLD <br>\r\n20x20cm","spring2_thumb.JPG",130,173,1);thumbnails[3700686]=new thumbnail(3700686,"194152","harbour race SOLD<br>\r\n20x20cm","_harbour_race_2_thumb.JPG",130,173,1);thumbnails[3700716]=new thumbnail(3700716,"53088","village life too<br>\r\n50x50cm","village_life_too1_thumb.JPG",130,98,1);thumbnails[3723927]=new thumbnail(3723927,"80329","sometimes there are stormy days<br>\r\n40x100cm  SOLD","sometimes_there_are_stormy_days1_thumb.JPG",130,98,1);thumbnails[3723981]=new thumbnail(3723981,"80329","rain over the bay SOLD<br>\r\n70x90cm","rain_over_the_bay_thumb.JPG",130,98,1);thumbnails[3723984]=new thumbnail(3723984,"80329","in the bay SOLD<br>\r\n138cmx75cm","in_the_bay_thumb.JPG",130,173,1);thumbnails[4057474]=new thumbnail(4057474,"80329","mermaid finding treasure<br>\r\n40x100cm SOLD","mermaid_finding_treasure_thumb.JPG",130,98,1);thumbnails[4065201]=new thumbnail(4065201,"53218","playing in the valley<br>\r\n40x50cm SOLD","playing_in_the_valley_thumb.JPG",130,98,1);thumbnails[4117118]=new thumbnail(4117118,"53218","stepping stones<br>\r\n30x40cm","stepping_stones_thumb.JPG",130,98,1);thumbnails[4239872]=new thumbnail(4239872,"53218","running to the beach<br>\r\n40x50cm","running_to_the_beach_thumb.JPG",130,173,1);thumbnails[4258798]=new thumbnail(4258798,"53088","south of france<br>\r\n50x40cm SOLD","south_of_france_thumb.JPG",130,173,1);thumbnails[4475801]=new thumbnail(4475801,"80329","in the harbour SOLD<br>\r\n50x40cm","in_the_harbour_1_thumb.JPG",130,173,1);thumbnails[4475812]=new thumbnail(4475812,"80329","coastal<br>\r\n40x50cm","coastal__thumb.JPG",130,98,1);thumbnails[4475838]=new thumbnail(4475838,"53218","fruit on the beach<br>\r\n30x40cm SOLD","fruit_on_the_beach_thumb.JPG",130,98,1);thumbnails[4475845]=new thumbnail(4475845,"194152","little boat<br>\r\n20x20cm","little_boat_thumb.JPG",130,173,1);thumbnails[4475848]=new thumbnail(4475848,"194152","on the hillside<br>\r\n20x20cm SOLD","on_the_hillside_thumb.JPG",130,98,1);thumbnails[4475851]=new thumbnail(4475851,"53218","round the table SOLD<br>\r\n50x60cm","round_the_table_thumb.JPG",130,98,1);thumbnails[4598354]=new thumbnail(4598354,"53218","telling the tale <br>\r\n80 x 100cm SOLD","telling_the_tale_thumb.JPG",130,98,1);thumbnails[4611670]=new thumbnail(4611670,"194152","looking to the future<br>\r\n20x20cm","looking_to_the_future_thumb.JPG",130,173,1);thumbnails[4611717]=new thumbnail(4611717,"80329","still SOLD<br>\r\n50x100cm","still_thumb.JPG",130,98,1);thumbnails[4740503]=new thumbnail(4740503,"53218","slipping out of the storm<br>\r\n50x70cm  ","slipping_out_of_the_storm_thumb.JPG",130,98,1);thumbnails[5085292]=new thumbnail(5085292,"194152","owl and moon<br>\r\n20x20cm","cat_and_moon_thumb.JPG",130,173,1);thumbnails[5085319]=new thumbnail(5085319,"194152","place by the sea<br>\r\n20x20cm","place_by_the_sea_thumb.JPG",130,173,1);thumbnails[5444292]=new thumbnail(5444292,"80329","wide open 40x100cm<br>\r\nSOLD","wide_open1_thumb.JPG",130,98,1);thumbnails[5559416]=new thumbnail(5559416,"80329","jump for joy 100x100cm<br>\r\nSOLD","jumping_for_joy_thumb.jpg",130,173,1);thumbnails[5559446]=new thumbnail(5559446,"53218","swim in the garden<br>\r\n40x100cm SOLD","swim_in_the_garden_thumb.jpg",130,98,1);thumbnails[5559452]=new thumbnail(5559452,"53216","flowers in the sea<br>\r\n40x100cm","flowers_in_the_sea_thumb.jpg",130,98,1);thumbnails[5567411]=new thumbnail(5567411,"53218","having a chat with the fishes in the sea<br>\r\n76x100cm","having_a_chat_with_the_fishes_in_the_sea_thumb.jpg",130,98,1);thumbnails[5583806]=new thumbnail(5583806,"53088","dancing along the path<br>\r\n60x40cm","dancing_along_the_path_thumb.jpg",130,173,1);thumbnails[5868663]=new thumbnail(5868663,"80329","she's somewhere<br>\r\n40x100cm","shes_somewhere1_thumb.jpg",130,98,1);thumbnails[5987831]=new thumbnail(5987831,"53218","storytelling<br>\r\n60x80cm SOLD","storytelling_thumb.jpg",130,98,1);thumbnails[6198009]=new thumbnail(6198009,"53218","holding hands<br>\r\n40x50cm","holding_hands_thumb.jpg",130,98,1);thumbnails[6312020]=new thumbnail(6312020,"53218","laying on the beach<br>\r\n40x50cm","laying_on_the_beach_thumb.jpg",130,173,1);thumbnails[6388136]=new thumbnail(6388136,"53218","see you 20x20cm","see_you_thumb.jpg",130,173,1);var galleries=new Object();galleries[53218]=new gallery(53218,"4239872","abstractive","section78229",[838353,1277884,2227091,3124390,3568819,4065201,4117118,4239872,4475838,4475851,4598354,4740503,5559446,5567411,5987831,6198009,6312020,6388136]);galleries[53216]=new gallery(53216,"5559452,3700655,3124440,2472595,813730,789786,695209,693929","floral","section78229",[693929,695209,789786,813730,2472595,3124440,3700655,5559452]);galleries[53088]=new gallery(53088,"5583806,4258798,3700716,3395457,2472574,2302550,2302540,1537194,780003,703795","landscape","section78229",[693889,703795,780003,1537194,2302540,2302550,2472574,3395457,3700716,4258798,5583806]);galleries[80329]=new gallery(80329,"5868663,5559416,5444292,4611717,4475812,4475801,4057474,3723984,3723981,3723927","seascapes","section78229",[933731,1047336,1089639,1492546,1523899,1680664,1690888,1938146,2472581,2472587,3568799,3568804,3641622,3723927,3723981,3723984,4057474,4475801,4475812,4611717,5444292,5559416,5868663]);galleries[194152]=new gallery(194152,"5085319,5085292,4611670,4475848,4475845,3700686,3700682,3641633,3613126,3388751","small gallery","section78229",[3124495,3128293,3171448,3171452,3171455,3183609,3183613,3257345,3257347,3312015,3312021,3388751,3613126,3641633,3700682,3700686,4475845,4475848,4611670,5085292,5085319]);var imageSets=new Object();imageSets[1]="3124390";imageSets[2]="4239872";imageSets[3]="6388136,6312020,6198009,5987831,5868663,5583806,5567411,5559452,5559446,5559416,5444292,5085319,5085292,4740503,4611717,4611670,4598354,4475851,4475848,4475845,4475838,4475812,4475801,4258798,4239872,4117118,4065201,4057474,3723984,3723981,3723927,3700716,3700686,3700682,3700655,3641633,3641622,3613126,3568819,3568804,3568799,3395457,3388751,3312021,3312015,3257347,3257345,3183613,3183609,3171455";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/sarahstokes/images";break}switch(a){case 1:b="http://www1.clikpic.com/sarahstokes/images";break}switch(a){case 2:b="http://admin.clikpic.com/sarahstokes/images";break}switch(a){case 24:b="http://tpc15/clikpic/sarahstokes/images";break}switch(a){case 4:b="http://www.clikchurch.com/sarahstokes/images";break}switch(a){case 5:b="http://www2.clikpic.com/sarahstokes/images";break}switch(a){case 22:b="http://tpc5/clikpic/sarahstokes/images";break}switch(a){case 23:b="http://tpc10/clikpic/sarahstokes/images";break}switch(a){case 25:b="http://tpc16/clikpic/sarahstokes/images";break}switch(a){case 15:b="http://www3.clikpic.com/sarahstokes/images";break}switch(a){case 18:b="http://www4.clikpic.com/sarahstokes/images";break}switch(a){case 19:b="http://www5.clikpic.com/sarahstokes/images";break}switch(a){case 31:b="http://www7.clikpic.com/sarahstokes/images";break}switch(a){case 32:b="http://admin2.clikpic.com/sarahstokes/images";break}switch(a){case 33:b="http://www8.clikpic.com/sarahstokes/images";break}switch(a){case 34:b="http://www9.clikpic.com/sarahstokes/images";break}switch(a){case 35:b="http://admin3.clikpic.com/sarahstokes/images";break}switch(a){case 37:b="http://admin4.clikpic.com/sarahstokes/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("section78229"!=""){if(backgrounds[imageID].galleries_id!=""){html+='<a href="'+backgrounds[imageID].section_code+"_"+backgrounds[imageID].galleries_id+'.html">'}else{html+='<a href="section78229.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("section78229"!=""){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="sarahstokesart: "+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>"}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(b,a){imageID=randomListVal(galleries[b].featured_images);if(imageID!=0){a.src=thumbnails[imageID].src;a.width=thumbnails[imageID].width;a.height=thumbnails[imageID].height}}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+'")'})}}};