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[531347]=new thumbnail(531347,"278368","","photo1_thumb.jpg",130,196,18);thumbnails[1315415]=new thumbnail(1315415,"278368","","group8x10 copy_thumb.jpg",130,86,18);thumbnails[1315427]=new thumbnail(1315427,"278368","","storm11x14 copy_thumb.jpg",130,165,18);thumbnails[1471013]=new thumbnail(1471013,"278368","Ranaletti Wedding Party","r4_thumb.jpg",130,87,18);thumbnails[3004636]=new thumbnail(3004636,"278368","Ben & Emily Shell w/ wedding party","DSC_2276_thumb.JPG",130,86,18);thumbnails[3004645]=new thumbnail(3004645,"278368","Beth & Josh","pic1sepiascratched_thumb.jpg",130,195,18);thumbnails[3004655]=new thumbnail(3004655,"278368","Warner-Uglow","pic67_thumb.jpg",130,87,18);thumbnails[5405927]=new thumbnail(5405927,"278368","","fb4_thumb.jpg",130,194,18);thumbnails[5405936]=new thumbnail(5405936,"278368","","fb1_5B869E93-2219-B5B5-4C756AB8D8965549_thumb.jpg",130,194,18);thumbnails[5668272]=new thumbnail(5668272,"278368","Brittany and Preston","DSC_0139_thumb.JPG",130,87,18);thumbnails[5668283]=new thumbnail(5668283,"278368","Brittany and Preston","DSC_0153_thumb.JPG",130,87,18);thumbnails[5668285]=new thumbnail(5668285,"278368","","DSC_0222_295_thumb.jpg",130,87,18);thumbnails[5668291]=new thumbnail(5668291,"278368","","DSC_0226_299_thumb.jpg",130,194,18);thumbnails[5668295]=new thumbnail(5668295,"278368","","DSC_0246_thumb.JPG",130,194,18);thumbnails[5668297]=new thumbnail(5668297,"278368","","DSC_0263_thumb.JPG",130,194,18);thumbnails[5668300]=new thumbnail(5668300,"278368","Baran","DSC_1518_thumb.JPG",130,86,18);thumbnails[5668310]=new thumbnail(5668310,"278368","Baran","DSC_1553_thumb.JPG",130,86,18);thumbnails[5668314]=new thumbnail(5668314,"278368","","DSC_2292_thumb.JPG",130,86,18);thumbnails[5668317]=new thumbnail(5668317,"278368","Castro","photo2_copy_thumb.jpg",130,196,18);thumbnails[5668318]=new thumbnail(5668318,"278368","James","pic5bw_thumb.jpg",130,195,18);thumbnails[5668322]=new thumbnail(5668322,"278368","James","pic42bw_thumb.jpg",130,86,18);thumbnails[5668323]=new thumbnail(5668323,"278368","Warner-Uglow","pic65bw_thumb.jpg",130,194,18);thumbnails[5668327]=new thumbnail(5668327,"278368","","pic72bw_thumb.jpg",130,195,18);thumbnails[5668329]=new thumbnail(5668329,"278368","Ranalletti","wed1_thumb.jpg",130,86,18);thumbnails[1452419]=new thumbnail(1452419,"278372","Josh & Beth","jbdiffused copy_thumb.jpg",130,195,18);thumbnails[1452431]=new thumbnail(1452431,"278372","Josh & Beth","jb1_thumb.jpg",130,195,18);thumbnails[3004476]=new thumbnail(3004476,"278372","Scott & Crystal w/ the kids","fam11_thumb.jpg",130,196,18);thumbnails[3004478]=new thumbnail(3004478,"278372","Scott & Crystal w/ the kids","fam21_thumb.jpg",130,86,18);thumbnails[3004480]=new thumbnail(3004480,"278372","Suzie and family","pic19_thumb.jpg",130,87,18);thumbnails[3004483]=new thumbnail(3004483,"278372","Suzie and family","pic4_thumb.jpg",130,195,18);thumbnails[3381788]=new thumbnail(3381788,"278372","","cb9_thumb.jpg",130,90,18);thumbnails[3381792]=new thumbnail(3381792,"278372","","s20_thumb.jpg",130,165,18);thumbnails[3381857]=new thumbnail(3381857,"278372","","s81_thumb.jpg",130,108,18);thumbnails[5007904]=new thumbnail(5007904,"278372","Aruna","web1_thumb.jpg",130,194,18);thumbnails[5007906]=new thumbnail(5007906,"278372","Aruna","web2_thumb.jpg",130,87,18);thumbnails[5007909]=new thumbnail(5007909,"278372","Aruna","web3_thumb.jpg",130,87,18);thumbnails[5308072]=new thumbnail(5308072,"278372","Jalon and Jessica","fb2_thumb.jpg",130,87,18);thumbnails[5308077]=new thumbnail(5308077,"278372","Jalon and Jessica","fb3_thumb.jpg",130,112,18);thumbnails[5308144]=new thumbnail(5308144,"278372","Danielle","dfb4_thumb.jpg",130,87,18);thumbnails[5308150]=new thumbnail(5308150,"278372","Danielle","dfb5_thumb.jpg",130,194,18);thumbnails[5308152]=new thumbnail(5308152,"278372","Jessica","fb5_thumb.jpg",130,195,18);thumbnails[5308178]=new thumbnail(5308178,"278372","Jessica","fb1_thumb.jpg",130,195,18);thumbnails[5308187]=new thumbnail(5308187,"278372","Katie","kbfb_thumb.jpg",130,87,18);thumbnails[5308189]=new thumbnail(5308189,"278372","Katie","kbfbb_thumb.jpg",130,120,18);thumbnails[5308199]=new thumbnail(5308199,"278372","Tim","fb21_thumb.jpg",130,194,18);thumbnails[5308204]=new thumbnail(5308204,"278372","Tim","fb31_thumb.jpg",130,194,18);thumbnails[5405924]=new thumbnail(5405924,"278372","","fb1_5B79F623-2219-B5B5-4C6C0A289C831D58_thumb.jpg",130,194,18);thumbnails[5405926]=new thumbnail(5405926,"278372","","fb3_5B7B8087-2219-B5B5-4C2A37694895A378_thumb.jpg",130,194,18);thumbnails[5667936]=new thumbnail(5667936,"278372","Jalon","jfbk2_thumb.jpg",130,190,18);thumbnails[5667941]=new thumbnail(5667941,"278372","Jalon","jfbk5_thumb.jpg",130,195,18);thumbnails[5667949]=new thumbnail(5667949,"278372","Jessica","jfb5_thumb.jpg",130,195,18);thumbnails[5667959]=new thumbnail(5667959,"278372","Jessica","fb3_7774515B-1D09-001F-999F4BD6F32B2587_thumb.jpg",130,195,18);thumbnails[524016]=new thumbnail(524016,"99678","Brittany","brit1_thumb.JPG",130,195,18);thumbnails[524029]=new thumbnail(524029,"99678","Grace","grace1_thumb.JPG",130,192,18);thumbnails[524099]=new thumbnail(524099,"99678","Sasha","sashabwcolor_thumb.jpg",130,86,18);thumbnails[524100]=new thumbnail(524100,"99678","Sasha","sashadreams_thumb.jpg",130,195,18);thumbnails[1470982]=new thumbnail(1470982,"99678","Ashley ","aa11_thumb.jpg",130,195,18);thumbnails[1470986]=new thumbnail(1470986,"99678","Ashley ","aa31_thumb.jpg",130,195,18);thumbnails[1470987]=new thumbnail(1470987,"99678","Ashley ","aa41_thumb.jpg",130,195,18);thumbnails[1470988]=new thumbnail(1470988,"99678","Brittany ","bw11_thumb.jpg",130,87,18);thumbnails[1470989]=new thumbnail(1470989,"99678","Brittany ","bw21_thumb.jpg",130,162,18);thumbnails[1470990]=new thumbnail(1470990,"99678","Brittany ","bw31_thumb.jpg",130,163,18);thumbnails[1470991]=new thumbnail(1470991,"99678","Brittany ","bw41_thumb.jpg",130,87,18);thumbnails[1470992]=new thumbnail(1470992,"99678","Hugh ","h11_thumb.jpg",130,195,18);thumbnails[1470994]=new thumbnail(1470994,"99678","Hugh ","h21_thumb.jpg",130,104,18);thumbnails[1470995]=new thumbnail(1470995,"99678","Hugh ","h31_thumb.jpg",130,195,18);thumbnails[1470998]=new thumbnail(1470998,"99678","Jamie ","jh21_thumb.jpg",130,162,18);thumbnails[1470999]=new thumbnail(1470999,"99678","Jamie ","jh31_thumb.jpg",130,182,18);thumbnails[1826935]=new thumbnail(1826935,"99678","Shannon","s2_thumb.jpg",130,93,18);thumbnails[1826937]=new thumbnail(1826937,"99678","Shannon","s1_1_thumb.jpg",130,183,18);thumbnails[1826953]=new thumbnail(1826953,"99678","Shannon","s4_1_thumb.jpg",130,195,18);thumbnails[2071232]=new thumbnail(2071232,"99678","Clay","w1_1_thumb.jpg",130,147,18);thumbnails[2071235]=new thumbnail(2071235,"99678","Clay","w21_thumb.jpg",130,163,18);thumbnails[2071240]=new thumbnail(2071240,"99678","Stephan","w6_thumb.jpg",130,163,18);thumbnails[2071241]=new thumbnail(2071241,"99678","Stephan","w7_thumb.jpg",130,195,18);thumbnails[3004515]=new thumbnail(3004515,"99678","Eric","kneelguit4 copy_thumb.jpg",130,166,18);thumbnails[3004520]=new thumbnail(3004520,"99678","James","pic3_thumb.jpg",130,163,18);thumbnails[3004537]=new thumbnail(3004537,"99678","James","port11_thumb.jpg",130,104,18);thumbnails[3004540]=new thumbnail(3004540,"99678","","s1 copy_thumb.jpg",130,166,18);thumbnails[3004563]=new thumbnail(3004563,"99678","Jessica","sr1_thumb.jpg",130,195,18);thumbnails[3004571]=new thumbnail(3004571,"99678","Jessica","sr2_thumb.jpg",130,194,18);thumbnails[3004575]=new thumbnail(3004575,"99678","Jessica","sr3_thumb.jpg",130,183,18);thumbnails[4403470]=new thumbnail(4403470,"99678","Gretchen","ghighkey_copy_thumb.jpg",130,194,18);thumbnails[4403474]=new thumbnail(4403474,"99678","","001desat_thumb.jpg",130,195,18);thumbnails[4403479]=new thumbnail(4403479,"99678","","002_thumb.jpg",130,195,18);thumbnails[4403480]=new thumbnail(4403480,"99678","","004desat_thumb.jpg",130,195,18);thumbnails[4879412]=new thumbnail(4879412,"278373","Abandoned Farmhouse","fh_thumb.jpg",130,87,18);thumbnails[4967247]=new thumbnail(4967247,"278373","Twins","flowers_thumb.jpg",130,87,18);thumbnails[4967249]=new thumbnail(4967249,"278373","Helmet","helmut_thumb.jpg",130,87,18);var galleries=new Object();galleries[278368]=new gallery(278368,"5668329,5668327,5668323,5668322,5668318,5668317,5668314,5668310,5668300,5668297","The Wedding Gallery","gallery",[531347,1315415,1315427,1471013,3004636,3004645,3004655,5405927,5405936,5668272,5668283,5668285,5668291,5668295,5668297,5668300,5668310,5668314,5668317,5668318,5668322,5668323,5668327,5668329]);galleries[278372]=new gallery(278372,"5667959,5667949,5667941,5667936,5405926,5405924,5308204,5308199,5308189,5308187","Portraiture","gallery",[1452419,1452431,3004476,3004478,3004480,3004483,3381788,3381792,3381857,5007904,5007906,5007909,5308072,5308077,5308144,5308150,5308152,5308178,5308187,5308189,5308199,5308204,5405924,5405926,5667936,5667941,5667949,5667959]);galleries[99678]=new gallery(99678,"4403480,4403479,4403474,4403470,3004575,3004571,3004563,3004540,3004537,3004520","Senior High Portraits ","gallery",[524016,524029,524099,524100,1470982,1470986,1470987,1470988,1470989,1470990,1470991,1470992,1470994,1470995,1470998,1470999,1826935,1826937,1826953,2071232,2071235,2071240,2071241,3004515,3004520,3004537,3004540,3004563,3004571,3004575,4403470,4403474,4403479,4403480]);galleries[278373]=new gallery(278373,"4967249,4967247,4879412","The Fine Art Gallery","gallery",[4879412,4967247,4967249]);var imageSets=new Object();imageSets[1]="5668329,5668327,5668323,5668322,5668318,5668317,5668314,5668310,5668300,5668297,5668295,5668291,5668285,5668283,5668272,5667959,5667949,5667941,5667936,5405936,5405927,5405926,5405924,5308204,5308199,5308189,5308187,5308178,5308152,5308150,5308144,5308077,5308072,5007909,5007906,5007904,4967249,4967247,4879412,4403480,4403479,4403474,4403470,3381857,3381792,3381788,3004655,3004645,3004636,3004575";imageSets[3]="5668329,5668327,5668323,5668322,5668318,5668317,5668314,5668310,5668300,5668297,5668295,5668291,5668285,5668283,5668272,5667959,5667949,5667941,5667936,5405936,5405927,5405926,5405924,5308204,5308199,5308189,5308187,5308178,5308152,5308150,5308144,5308077,5308072,5007909,5007906,5007904,4967249,4967247,4879412,4403480,4403479,4403474,4403470,3381857,3381792,3381788,3004655,3004645,3004636,3004575";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/wyntersrayne/images";break}switch(a){case 1:b="http://www1.clikpic.com/wyntersrayne/images";break}switch(a){case 2:b="http://admin.clikpic.com/wyntersrayne/images";break}switch(a){case 24:b="http://tpc15/clikpic/wyntersrayne/images";break}switch(a){case 4:b="http://www.clikchurch.com/wyntersrayne/images";break}switch(a){case 5:b="http://www2.clikpic.com/wyntersrayne/images";break}switch(a){case 22:b="http://tpc5/clikpic/wyntersrayne/images";break}switch(a){case 23:b="http://tpc10/clikpic/wyntersrayne/images";break}switch(a){case 25:b="http://tpc16/clikpic/wyntersrayne/images";break}switch(a){case 15:b="http://www3.clikpic.com/wyntersrayne/images";break}switch(a){case 18:b="http://www4.clikpic.com/wyntersrayne/images";break}switch(a){case 19:b="http://www5.clikpic.com/wyntersrayne/images";break}switch(a){case 31:b="http://www7.clikpic.com/wyntersrayne/images";break}switch(a){case 32:b="http://admin2.clikpic.com/wyntersrayne/images";break}switch(a){case 33:b="http://www8.clikpic.com/wyntersrayne/images";break}switch(a){case 34:b="http://www9.clikpic.com/wyntersrayne/images";break}switch(a){case 35:b="http://admin3.clikpic.com/wyntersrayne/images";break}switch(a){case 37:b="http://admin4.clikpic.com/wyntersrayne/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="Celtic Dreams 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;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> 				$"+(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="WYNTERSRAYNE">';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+'")'})}}};