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[5315304]=new thumbnail(5315304,"298519","Hippopotamus","hippo2_thumb.jpg",130,77,5);thumbnails[5315308]=new thumbnail(5315308,"298519","Lion, Serengeti","lion1_thumb.jpg",90,130,5);thumbnails[5315309]=new thumbnail(5315309,"298519","Sally Lightfoot Crab","sally_thumb.jpg",130,90,5);thumbnails[5316379]=new thumbnail(5316379,"298519","Dolphin, Galapagos","dolphin2_thumb.jpg",130,77,5);thumbnails[5316380]=new thumbnail(5316380,"298519","Bottle-nosed Dolphins","dolphinsguernsey_thumb.jpg",130,62,5);thumbnails[5316381]=new thumbnail(5316381,"298519","Giraffe","giraffe5_thumb.jpg",86,130,5);thumbnails[5316382]=new thumbnail(5316382,"298519","Atlantic Grey Seal","seal_thumb.jpg",130,77,5);thumbnails[5316383]=new thumbnail(5316383,"298519","Sea lion, Galapagos","sealion_thumb.jpg",130,70,5);thumbnails[6302296]=new thumbnail(6302296,"298519","Male polar bear","male_polar_bear_2_thumb.jpg",130,89,5);thumbnails[6302301]=new thumbnail(6302301,"298519","Polar bear aggression","polar_bear_aggression_2_thumb.jpg",130,100,5);thumbnails[5316812]=new thumbnail(5316812,"299271","The 'Gherkin'","gherkin_thumb.jpg",76,130,5);thumbnails[5316815]=new thumbnail(5316815,"299271","'Gherkin' 2","gerkhiM-bw_thumb.jpg",81,130,5);thumbnails[5316860]=new thumbnail(5316860,"299271","Millennium Bridge","milenniumbridge_thumb.jpg",130,75,5);thumbnails[5318420]=new thumbnail(5318420,"299271","Thames - side","cityscape_thumb.jpg",130,83,5);thumbnails[5315314]=new thumbnail(5315314,"298520","Harris Hawk","harrishawk_thumb.jpg",130,92,5);thumbnails[5315315]=new thumbnail(5315315,"298520","Kestrel","IMG_7626_thumb.jpg",130,82,5);thumbnails[5315322]=new thumbnail(5315322,"298520","Maltese Falcon","maltesefalcon1_thumb.jpg",130,85,5);thumbnails[5315324]=new thumbnail(5315324,"298520","Pale Chanting Goshawk","palechantinggoshawk1_thumb.jpg",130,82,5);thumbnails[5315409]=new thumbnail(5315409,"298520","Weaver, Tanzania","weaver_thumb.jpg",83,130,5);thumbnails[5316443]=new thumbnail(5316443,"298520","Frigate Bird, Galapagos","frigate-bird_thumb.jpg",85,130,5);thumbnails[5316445]=new thumbnail(5316445,"298520","Kingfisher, Tanzania","kingfisher1_thumb.jpg",100,130,5);thumbnails[5316448]=new thumbnail(5316448,"298520","Puffin. Skomer","puffin1_thumb.jpg",89,130,5);thumbnails[5316450]=new thumbnail(5316450,"298520","Red-footed Booby ","refootedbooby_thumb.jpg",98,130,5);thumbnails[5316452]=new thumbnail(5316452,"298520","Snowy Egret, Brasil","Snowy-Egret-with-fish_thumb.jpg",130,93,5);thumbnails[5317563]=new thumbnail(5317563,"298520","Southern lapwing - Brasil","southern-lapwing_thumb.jpg",130,89,5);thumbnails[5318511]=new thumbnail(5318511,"298520","Short-eared owl","short-eared-owl_thumb.jpg",130,87,5);thumbnails[6302309]=new thumbnail(6302309,"298520","Brunnich's guillemots","IMG_1214_thumb.jpg",127,130,5);thumbnails[6302319]=new thumbnail(6302319,"298520","Arctic tern","IMG_1236_thumb.jpg",130,97,5);thumbnails[5307424]=new thumbnail(5307424,"298209","Flamenco 4","flamenco4_thumb.jpg",130,127,5);thumbnails[5307494]=new thumbnail(5307494,"298209","Juan Martin","juanmartin_thumb.jpg",113,130,5);thumbnails[5318105]=new thumbnail(5318105,"298209","Flamenco 1","Flamenco-11_thumb.jpg",83,130,5);thumbnails[5318109]=new thumbnail(5318109,"298209","Flamenco 2","flamenco-21_thumb.jpg",94,130,5);thumbnails[5318112]=new thumbnail(5318112,"298209","Flamenco 3","flamenco-31_thumb.jpg",72,130,5);thumbnails[5318117]=new thumbnail(5318117,"298209","Guitarrista","guitarrista_thumb.jpg",130,96,5);thumbnails[5307404]=new thumbnail(5307404,"298521","","birdofparadise_thumb.jpg",130,126,5);thumbnails[5307426]=new thumbnail(5307426,"298521","","flower013_thumb.jpg",130,130,5);thumbnails[5307427]=new thumbnail(5307427,"298521","","flower014_thumb.jpg",130,130,5);thumbnails[5307428]=new thumbnail(5307428,"298521","","flower015_thumb.jpg",130,130,5);thumbnails[5307429]=new thumbnail(5307429,"298521","","flower021_thumb.jpg",130,130,5);thumbnails[5307431]=new thumbnail(5307431,"298521","","flower032_thumb.jpg",130,130,5);thumbnails[5307432]=new thumbnail(5307432,"298521","","flower033_thumb.jpg",130,130,5);thumbnails[5307433]=new thumbnail(5307433,"298521","","flower0381_thumb.jpg",130,130,5);thumbnails[5307435]=new thumbnail(5307435,"298521","","flower0667_thumb.jpg",130,123,5);thumbnails[5307436]=new thumbnail(5307436,"298521","","flower2785_thumb.jpg",130,130,5);thumbnails[5307437]=new thumbnail(5307437,"298521","","flower3187_thumb.jpg",128,130,5);thumbnails[5307438]=new thumbnail(5307438,"298521","","flower9966_thumb.jpg",130,130,5);thumbnails[5317405]=new thumbnail(5317405,"298210","Cauliflower fungus - sparassis crispa","cauliflower-fungus---sparassis-crispa_8756_thumb.jpg",100,130,5);thumbnails[5317406]=new thumbnail(5317406,"298210","Clathrus ruber","clathrus-ruber_1235_thumb.jpg",102,130,5);thumbnails[5317407]=new thumbnail(5317407,"298210","Coral fungus","coralfungus_F45F1F95-2219-B5B5-4C7B23EF45E22333_thumb.jpg",130,87,5);thumbnails[5317408]=new thumbnail(5317408,"298210","Dung mottlegill ","dung-mottlegill-paneolus-semiovatus_thumb.jpg",130,95,5);thumbnails[5317415]=new thumbnail(5317415,"298210","Fly agaric","fly-agaric-9324_thumb.jpg",96,130,5);thumbnails[5317421]=new thumbnail(5317421,"298210","Jelly Ear","jellyear_thumb.jpg",130,100,5);thumbnails[5317423]=new thumbnail(5317423,"298210","King Alfred's cakes","kingalfred_thumb.jpg",110,130,5);thumbnails[5317425]=new thumbnail(5317425,"298210","Parasol mushroom","parasol--macrolepiota-procera_0688_thumb.jpg",110,130,5);thumbnails[5317428]=new thumbnail(5317428,"298210","Russula queletii","russula-queletii_9432_thumb.jpg",130,84,5);thumbnails[5317433]=new thumbnail(5317433,"298210","Tremella mesenterica","tremella-mesenterica_9417-small_thumb.jpg",130,91,5);thumbnails[5317434]=new thumbnail(5317434,"298210","Unidentified 1","unidentified-1_thumb.jpg",130,98,5);thumbnails[5317435]=new thumbnail(5317435,"298210","Unidentified 2","unidentified-2_thumb.jpg",119,130,5);thumbnails[5317437]=new thumbnail(5317437,"298210","Unidentified 3","unidentified-3_thumb.jpg",97,130,5);thumbnails[5316457]=new thumbnail(5316457,"298523","The harbour","harbour_thumb.jpg",130,90,5);thumbnails[5316459]=new thumbnail(5316459,"298523","Lloyds Bank","lloydsbank2_thumb.jpg",105,130,5);thumbnails[5316460]=new thumbnail(5316460,"298523","Mount Durand","mountdurand1_thumb.jpg",130,93,5);thumbnails[5316461]=new thumbnail(5316461,"298523","St Julian's Court","stjulianscourt_thumb.jpg",81,130,5);thumbnails[5316464]=new thumbnail(5316464,"298523","Les Hanois","hanoissea_thumb.jpg",130,82,5);thumbnails[5316466]=new thumbnail(5316466,"298523","Town Church","townchurch_thumb.jpg",71,130,5);thumbnails[5316467]=new thumbnail(5316467,"298523","St Peter Port","townscape_thumb.jpg",130,76,5);thumbnails[5317417]=new thumbnail(5317417,"298523","Groynes","groynes_thumb.jpg",95,130,5);thumbnails[5317420]=new thumbnail(5317420,"298523","Groynes 2","groynes-2_thumb.jpg",106,130,5);thumbnails[5317431]=new thumbnail(5317431,"298523","Townscape","townscape1_thumb.jpg",130,76,5);thumbnails[5317573]=new thumbnail(5317573,"298523","Evening at Les Hanois ","hanois_thumb.jpg",130,100,5);thumbnails[5318330]=new thumbnail(5318330,"298523","Herm harbour","hermharbour_thumb.jpg",130,94,5);thumbnails[5318335]=new thumbnail(5318335,"298523","Police patrol - Herm","police-patrol_thumb.jpg",130,87,5);thumbnails[5318339]=new thumbnail(5318339,"298523","Alderney Point - Herm","alderney-point_thumb.jpg",130,80,5);thumbnails[5316465]=new thumbnail(5316465,"298522","'Prosperity' engine block","prosperity_thumb.jpg",130,87,5);thumbnails[5318282]=new thumbnail(5318282,"298522","Market Pharmacy","marketpharmacy_thumb.jpg",130,85,5);thumbnails[5318290]=new thumbnail(5318290,"298522","'Orion' rescue 1974","Orion-rescue_thumb.jpg",130,89,5);thumbnails[5318302]=new thumbnail(5318302,"298522","'Sarnia' farewell 1978","Sarnia-farewell-1978_thumb.jpg",130,90,5);thumbnails[5318427]=new thumbnail(5318427,"298522","RBS building","rbs-house1_thumb.jpg",105,130,5);thumbnails[5320652]=new thumbnail(5320652,"298522","Fruit Export development","progress_thumb.jpg",130,76,5);thumbnails[5307509]=new thumbnail(5307509,"298586","Seajay","seajay_thumb.jpg",130,79,5);thumbnails[5307516]=new thumbnail(5307516,"298586","Skaters","skaters_thumb.jpg",130,130,5);thumbnails[5317429]=new thumbnail(5317429,"298586","The juggler","the-juggler_thumb.jpg",81,130,5);thumbnails[5317530]=new thumbnail(5317530,"298586","Skater 2","skater-2_thumb.jpg",73,130,5);thumbnails[5318154]=new thumbnail(5318154,"298586","Skateboarder","skateboarder_thumb.jpg",130,71,5);thumbnails[5316639]=new thumbnail(5316639,"299258","Looking west","altar_thumb.jpg",86,130,5);thumbnails[5316743]=new thumbnail(5316743,"299258","Bell-tower","bell-tower_thumb.jpg",88,130,5);thumbnails[5316796]=new thumbnail(5316796,"299258","Part of fresco","drinking-pals_thumb.jpg",130,118,5);thumbnails[5316797]=new thumbnail(5316797,"299258","North window","glass_thumb.jpg",87,130,5);thumbnails[5316799]=new thumbnail(5316799,"299258","East window","glassnorth_thumb.jpg",89,130,5);thumbnails[5316800]=new thumbnail(5316800,"299258","The Chapel","stapolline_thumb.jpg",130,87,5);thumbnails[5316866]=new thumbnail(5316866,"299258","Fresco detail","yellow-flower_thumb.jpg",96,130,5);thumbnails[5317529]=new thumbnail(5317529,"299258","Flower fresco","flower_thumb.jpg",130,113,5);var galleries=new Object();galleries[298519]=new gallery(298519,"6302301,6302296,5316383,5316382,5316381,5316380,5316379,5315309,5315308,5315304","Animals","gallery",[5315304,5315308,5315309,5316379,5316380,5316381,5316382,5316383,6302296,6302301]);galleries[299271]=new gallery(299271,"5318420,5316860,5316815,5316812","Architecture","gallery",[5316812,5316815,5316860,5318420]);galleries[298520]=new gallery(298520,"5318511,5316448","Birds","gallery",[5315314,5315315,5315322,5315324,5315409,5316443,5316445,5316448,5316450,5316452,5317563,5318511,6302309,6302319]);galleries[298209]=new gallery(298209,"5307494","Flamenco","gallery",[5307424,5307494,5318105,5318109,5318112,5318117]);galleries[298521]=new gallery(298521,"5307432","Flowers","gallery",[5307404,5307426,5307427,5307428,5307429,5307431,5307432,5307433,5307435,5307436,5307437,5307438]);galleries[298210]=new gallery(298210,"5317437,5317435,5317434,5317433,5317428,5317425,5317423,5317421,5317415,5317408","Fungi","gallery",[5317405,5317406,5317407,5317408,5317415,5317421,5317423,5317425,5317428,5317433,5317434,5317435,5317437]);galleries[298523]=new gallery(298523,"5318339,5318335,5318330,5317573,5317431,5317420,5317417,5316467,5316466,5316464","Guernsey & Herm","gallery",[5316457,5316459,5316460,5316461,5316464,5316466,5316467,5317417,5317420,5317431,5317573,5318330,5318335,5318339]);galleries[298522]=new gallery(298522,"5318290","Guernsey History","gallery",[5316465,5318282,5318290,5318302,5318427,5320652]);galleries[298586]=new gallery(298586,"5318154","Speed","gallery",[5307509,5307516,5317429,5317530,5318154]);galleries[299258]=new gallery(299258,"5316800","St Apolline's Chapel","gallery",[5316639,5316743,5316796,5316797,5316799,5316800,5316866,5317529]);var imageSets=new Object();imageSets[1]="5317573";imageSets[2]="5318511,5318290,5318154,5316800,5316448,5307494,5307432";imageSets[3]="6302319,6302309,6302301,6302296,5320652,5318511,5318427,5318420,5318339,5318335,5318330,5318302,5318290,5318282,5318154,5318117,5318112,5318109,5318105,5317573,5317563,5317530,5317529,5317437,5317435,5317434,5317433,5317431,5317429,5317428,5317425,5317423,5317421,5317420,5317417,5317415,5317408,5317407,5317406,5317405,5316866,5316860,5316815,5316812,5316800,5316799,5316797,5316796,5316743,5316639";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/willsajjh/images";break}switch(a){case 1:b="http://www1.clikpic.com/willsajjh/images";break}switch(a){case 2:b="http://admin.clikpic.com/willsajjh/images";break}switch(a){case 24:b="http://tpc15/clikpic/willsajjh/images";break}switch(a){case 4:b="http://www.clikchurch.com/willsajjh/images";break}switch(a){case 5:b="http://www2.clikpic.com/willsajjh/images";break}switch(a){case 22:b="http://tpc5/clikpic/willsajjh/images";break}switch(a){case 23:b="http://tpc10/clikpic/willsajjh/images";break}switch(a){case 25:b="http://tpc16/clikpic/willsajjh/images";break}switch(a){case 15:b="http://www3.clikpic.com/willsajjh/images";break}switch(a){case 18:b="http://www4.clikpic.com/willsajjh/images";break}switch(a){case 19:b="http://www5.clikpic.com/willsajjh/images";break}switch(a){case 31:b="http://www7.clikpic.com/willsajjh/images";break}switch(a){case 32:b="http://admin2.clikpic.com/willsajjh/images";break}switch(a){case 33:b="http://www8.clikpic.com/willsajjh/images";break}switch(a){case 34:b="http://www9.clikpic.com/willsajjh/images";break}switch(a){case 35:b="http://admin3.clikpic.com/willsajjh/images";break}switch(a){case 37:b="http://admin4.clikpic.com/willsajjh/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="Digital Guernsey: "+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>"}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(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<120){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+'")'})}}};