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[946094]=new thumbnail(946094,"54449","give you a penny for your thoughts!","give_you_a_penny_0084C_1 0602_thumb.jpg",130,87,1);thumbnails[946092]=new thumbnail(946092,"54449","pebbles","pebbles_one_0144 10_thumb.jpg",130,86,1);thumbnails[2746952]=new thumbnail(2746952,"54449","early morning sunshine","early morning sunshine_thumb.jpg",130,130,1);thumbnails[1852625]=new thumbnail(1852625,"54449","waiting for the sun","waiting_for_the_sun 44k_logo_thumb.jpg",130,92,1);thumbnails[2748287]=new thumbnail(2748287,"54449","the early bird...","the early bird_thumb....jpg",130,87,1);thumbnails[4308012]=new thumbnail(4308012,"54449","surfs up","surfs_up_9351_thumb.jpg",130,108,1);thumbnails[3664218]=new thumbnail(3664218,"54445","beach stroll","beach_stroll_6095_thumb.jpg",130,130,1);thumbnails[946099]=new thumbnail(946099,"54445","the bare roots","the bare roots_thumb.jpg",130,200,1);thumbnails[2677734]=new thumbnail(2677734,"54445","coopers cottage","coopers cottage_thumb.jpg",130,87,1);thumbnails[710550]=new thumbnail(710550,"54445","Ma 'n' Pa","ma_n_pa_thumb.jpg",130,86,1);thumbnails[708188]=new thumbnail(708188,"54445","diagonal huts","diagonal_huts_thumb.jpg",130,86,1);thumbnails[2677757]=new thumbnail(2677757,"54445","Throwleigh Sepia","throwleigh sepia_thumb.jpg",130,87,1);thumbnails[946098]=new thumbnail(946098,"54445","Roadford Dam","Roadford Dam_thumb.jpg",130,97,1);thumbnails[3664213]=new thumbnail(3664213,"54445","asleep on the beach","asleep_on_the_beach_8873_thumb.jpg",130,87,1);thumbnails[4309694]=new thumbnail(4309694,"54445","back to the earth","back_to_the_earth_1920_thumb.jpg",130,108,1);thumbnails[710600]=new thumbnail(710600,"54445","who did it?","who_did_it_thumb.jpg",130,86,1);thumbnails[4309993]=new thumbnail(4309993,"54445","double vision","double_vision_8782_thumb.jpg",130,108,1);thumbnails[4309818]=new thumbnail(4309818,"54445","satelite","satelite_1903_thumb.jpg",130,108,1);thumbnails[948648]=new thumbnail(948648,"54445","Poundstock Gild House,<br>the <em>only one</em> left in Cornwall!","poundstock_guildhouse_1308-15_thumb.jpg",130,87,1);thumbnails[948653]=new thumbnail(948653,"54445","long white clouds","long_white_clouds_004_5584_thumb.jpg",130,87,1);thumbnails[2782207]=new thumbnail(2782207,"54445","Phoenix United Mine","Phoenix United Mine_1728_thumb.jpg",130,87,1);thumbnails[3664222]=new thumbnail(3664222,"54445","escape!","escape_7957_thumb.jpg",130,87,1);thumbnails[1817514]=new thumbnail(1817514,"54445","Christ Church.","Christ_Church_DSC_5045_thumb.jpg",130,87,1);thumbnails[1817646]=new thumbnail(1817646,"54445","tree trunk near Waiotira.NZ","tree_trunk_near_waiotira_DSC_4381_thumb.jpg",130,87,1);thumbnails[2942380]=new thumbnail(2942380,"54445","Clapper Bridge","Clapper_Bridge_1403 B&Wcopy Tri-x 8x10 print_thumb.jpg",130,96,1);thumbnails[1817538]=new thumbnail(1817538,"54445","Hundertwasser Toilets, Kawakawa.NZ","Hundertwasser's Toilets, Kawakawa_thumb..jpg",130,195,1);thumbnails[2942824]=new thumbnail(2942824,"54445","Meldon Reservoir","Meldon_2233 b&w_red_thumb.jpg",130,96,1);thumbnails[3746110]=new thumbnail(3746110,"54445","monkey puzzle","Monkey_Puzzle_thumb.jpg",130,130,1);thumbnails[3746114]=new thumbnail(3746114,"54445","ghost train 2","ghost_train_2_thumb.jpg",130,87,1);thumbnails[3637284]=new thumbnail(3637284,"222322","commercial 1","commercial1_8616_thumb.jpg",130,194,1);thumbnails[3637286]=new thumbnail(3637286,"222322","commercial 2","commercial2_8623_thumb.jpg",130,91,1);thumbnails[3637290]=new thumbnail(3637290,"222322","commercial 3","commercial3_8571_thumb.jpg",130,88,1);thumbnails[2749389]=new thumbnail(2749389,"172631","pink","pink_DSC_7757_thumb.jpg",130,130,1);thumbnails[2749569]=new thumbnail(2749569,"172631","abstract reeds","abstract reeds_DSC_8103_thumb.jpg",130,87,1);thumbnails[710538]=new thumbnail(710538,"172631","HKA","HKA_thumb.jpg",130,87,1);thumbnails[1852665]=new thumbnail(1852665,"172631","wood and water","wood_&_water_ DSC_3480_thumb.jpg",130,87,1);thumbnails[2749702]=new thumbnail(2749702,"172631","rouge","rouge_04092007656_thumb.jpg",130,98,1);thumbnails[2749707]=new thumbnail(2749707,"172631","sunset beach","sunset beach_DSC_0101 ed fresco_thumb.jpg",130,87,1);thumbnails[2749724]=new thumbnail(2749724,"172631","electric lady","electric ladyDSC_0392_thumb.jpg",130,87,1);thumbnails[2749737]=new thumbnail(2749737,"172631","misty","misty_DSC_7142_thumb.jpg",130,87,1);thumbnails[2782274]=new thumbnail(2782274,"172631","whirlpool","whirlpool_1861_thumb.jpg",130,87,1);thumbnails[2677753]=new thumbnail(2677753,"54443","Throwleigh Church","throwleigh church_thumb.jpg",130,87,1);thumbnails[2942372]=new thumbnail(2942372,"54443","Alone","Alone_2376_thumb.jpg",130,194,1);thumbnails[1817679]=new thumbnail(1817679,"54443","view from above Ocean Beach.","Ocean Beach_thumb.jpg",130,51,1);thumbnails[735076]=new thumbnail(735076,"54443","alone at dusk","alone_at_dusk_thumb.jpg",130,90,1);thumbnails[1750299]=new thumbnail(1750299,"54443","swamp trees in NZ","swamp_trees_DSC_2732_thumb.jpg",130,91,1);thumbnails[2749201]=new thumbnail(2749201,"54443","moor water","moor water_DSC_6985_thumb.jpg",130,87,1);thumbnails[1852646]=new thumbnail(1852646,"54443","sunrise at Waipu Cove","sun comes up at Waipu Cove_thumb.jpg",130,87,1);thumbnails[2096121]=new thumbnail(2096121,"54443","Millook Beach","Millook_Beach_Photo05_1_thumb.jpg",130,87,1);thumbnails[948529]=new thumbnail(948529,"54443","Bude to the West-coast!","bude_to_the_west_three11_3A_thumb.jpg",130,87,1);thumbnails[2782249]=new thumbnail(2782249,"54443","Phoenix United Mine","Phoenix United Mine_1695_thumb.jpg",130,87,1);thumbnails[710530]=new thumbnail(710530,"54443","rapeseed storm","rapeseed storm_thumb.jpg",130,80,1);thumbnails[2782291]=new thumbnail(2782291,"54443","Golitha Falls","Golitha Falls_1832_thumb.jpg",130,87,1);thumbnails[2942485]=new thumbnail(2942485,"54443","Black-A-Tor Copse","BlackATor_2368_thumb.jpg",130,87,1);thumbnails[1817661]=new thumbnail(1817661,"54451","Pioneer Church","pioneer_church_DSC_3164_thumb.jpg",130,89,1);thumbnails[1885300]=new thumbnail(1885300,"54451","dark secret","dark_secret_DSC_7756_thumb.jpg",130,194,1);thumbnails[946104]=new thumbnail(946104,"54451","ghost train","Ghost Train_thumb.jpg",130,87,1);thumbnails[2749271]=new thumbnail(2749271,"54451","twolips","Twolips_DSC_7764_thumb.jpg",130,87,1);thumbnails[1852680]=new thumbnail(1852680,"54451","reflections of Auckland","reflections of Auckland_thumb.jpg",130,98,1);thumbnails[2749523]=new thumbnail(2749523,"54451","duck!","duck_DSC_1609_thumb.jpg",130,87,1);thumbnails[2942373]=new thumbnail(2942373,"54451","Dartmoor Pony","Dartmoor Pony_7061_thumb.jpg",130,194,1);thumbnails[2749231]=new thumbnail(2749231,"54451","green fern","green fern_300407 011_thumb.jpg",130,85,1);thumbnails[4878990]=new thumbnail(4878990,"167278","reportage","Reportage_4147_thumb.jpg",130,194,1);thumbnails[4516448]=new thumbnail(4516448,"167278","wedding reportage","weddings-006_3106_crop_thumb.jpg",130,130,1);thumbnails[2641416]=new thumbnail(2641416,"167278","'Jazzy'","jazzy_00121_thumb.jpg",130,130,1);thumbnails[3479221]=new thumbnail(3479221,"167278","all smiles","All Smiles_thumb.jpg",130,194,1);thumbnails[2641459]=new thumbnail(2641459,"167278","time for tea!","time for tea_0665_thumb.jpg",130,124,1);thumbnails[4516452]=new thumbnail(4516452,"167278","weddings","weds_2957_thumb.jpg",130,87,1);thumbnails[3479225]=new thumbnail(3479225,"167278","'Skye'","Skye_thumb.jpg",130,194,1);thumbnails[2641489]=new thumbnail(2641489,"167278","'Miss Scarlett'","scarlett_1017b_thumb.jpg",130,130,1);thumbnails[4879006]=new thumbnail(4879006,"167278","wedding photography, reportage & portraiture","Portraiture_4066_thumb.jpg",130,193,1);thumbnails[946101]=new thumbnail(946101,"54444","what a way to start the day!","what_a_way_0132_11_thumb.jpg",130,195,1);thumbnails[708226]=new thumbnail(708226,"54444","high tide","high_tide_0143_2A 0706_thumb.jpg",130,87,1);thumbnails[4309972]=new thumbnail(4309972,"54444","barrel rock","barrel_rock_sunset_0911_thumb.jpg",130,87,1);thumbnails[946110]=new thumbnail(946110,"54444","down into Millook","down_into_millook_06_11_thumb.jpg",130,183,1);thumbnails[4309927]=new thumbnail(4309927,"54444","the last glimpse","the_last_glimpse_0964_thumb.jpg",130,87,1);thumbnails[708216]=new thumbnail(708216,"54444","sunset behind the pepper-pot","sunset_behind_the_thumb.jpg",130,69,1);thumbnails[708172]=new thumbnail(708172,"54444","sunset as a back-drop to the canal.  Bude.Cornwall.","sunset_as_backdrop_0139_29 0606 _thumb.jpg",130,197,1);thumbnails[2677709]=new thumbnail(2677709,"168782","Auckland at night","auckland at night_thumb.jpg",130,87,1);thumbnails[2677739]=new thumbnail(2677739,"168782","hovering clouds","hovering clouds_thumb.jpg",130,73,1);thumbnails[2677719]=new thumbnail(2677719,"168782","clock museum","clock museum_thumb.jpg",130,194,1);thumbnails[2677760]=new thumbnail(2677760,"168782","near Tamaterau","near tamaterau_thumb.jpg",130,87,1);thumbnails[2677745]=new thumbnail(2677745,"168782","up a gum tree","kauri trunk_thumb.jpg",130,87,1);thumbnails[2680590]=new thumbnail(2680590,"168782","alone","alone_thumb.jpg",130,87,1);thumbnails[2677751]=new thumbnail(2677751,"168782","Mystic Kiwi","mystic kiwi_thumb.jpg",130,87,1);thumbnails[946093]=new thumbnail(946093,"168782","New Zealand sunrise","New Zealand sunrise_thumb.jpg",130,87,1);thumbnails[2680699]=new thumbnail(2680699,"168782","falls from below","overflow_thumb.jpg",130,87,1);thumbnails[2680686]=new thumbnail(2680686,"168782","me, myself & I","me, myself & I_thumb.jpg",130,82,1);thumbnails[2680608]=new thumbnail(2680608,"168782","The Duke","The Duke_thumb.jpg",130,87,1);thumbnails[2680694]=new thumbnail(2680694,"168782","Northland Polo","Northland Polo_thumb.jpg",130,94,1);thumbnails[710554]=new thumbnail(710554,"168782","gull on a stick","gull on a stick_thumb.jpg",130,130,1);thumbnails[2680704]=new thumbnail(2680704,"168782","Waka & Wave","wacca & wave_thumb.jpg",130,87,1);thumbnails[2680720]=new thumbnail(2680720,"168782","flat foot","flat foot_thumb.jpg",130,87,1);thumbnails[2680728]=new thumbnail(2680728,"168782","Dargaville","Dargaville_thumb.jpg",130,87,1);thumbnails[2749620]=new thumbnail(2749620,"168782","New Zealand at night!","New Zealand at night_thumb.jpg",130,87,1);thumbnails[2749815]=new thumbnail(2749815,"168782","sepia Heads","sepia Heads_DSC_1343C ed_thumb.jpg",130,76,1);thumbnails[4516451]=new thumbnail(4516451,"238721","wedding 3022","weddings-006_3022_thumb.jpg",130,108,1);thumbnails[4879058]=new thumbnail(4879058,"238721","weddings and stunning dresses!","Weddings_4158_thumb.jpg",130,193,1);thumbnails[3935648]=new thumbnail(3935648,"238721","Wedding Reportage","Wedding_photography-005_0116_thumb.jpg",130,130,1);thumbnails[4486333]=new thumbnail(4486333,"238721","wedding 9","Wedding-006_2813_thumb.jpg",130,108,1);thumbnails[3935680]=new thumbnail(3935680,"238721","Wedding Photography","Wedding_photography-005_0152_thumb.jpg",130,194,1);thumbnails[4879096]=new thumbnail(4879096,"238721","wedding reportage","Reportage_4317_thumb.jpg",130,87,1);thumbnails[4879049]=new thumbnail(4879049,"238721","wedding photography","Wedding_4100_thumb.jpg",130,194,1);thumbnails[4516449]=new thumbnail(4516449,"238721","sepia wedding","Weddings-006_2988_sepia2_thumb.jpg",130,193,1);thumbnails[3667216]=new thumbnail(3667216,"238721","cool chrome!","cool_chrome_8703_thumb.jpg",130,83,1);thumbnails[4879066]=new thumbnail(4879066,"238721","cutting the cake","cutting_the_cake_4249_thumb.jpg",130,88,1);thumbnails[4879138]=new thumbnail(4879138,"238721","gold toned reportage","gold_toned_reportage_4074_thumb.jpg",130,87,1);thumbnails[4879019]=new thumbnail(4879019,"238721","stylish wedding photography","stylish_wedding_photography_4162_thumb.jpg",130,194,1);thumbnails[4486310]=new thumbnail(4486310,"238721","weddings 7","Weddings-006_3435_thumb.jpg",130,194,1);thumbnails[4879055]=new thumbnail(4879055,"238721","wedding photography and reportage","Wedding_4118_thumb.jpg",130,194,1);thumbnails[4516453]=new thumbnail(4516453,"238721","wedding reportage","wedding_2693_mono_thumb.jpg",130,76,1);thumbnails[4486319]=new thumbnail(4486319,"238721","weddings 8","Weddings-006_3357_thumb.jpg",130,66,1);thumbnails[4486281]=new thumbnail(4486281,"238721","weddings 6","Weddings-006_2634_thumb.jpg",130,194,1);thumbnails[4486351]=new thumbnail(4486351,"238721","wedding 010","Weddings-006_3375_thumb.jpg",130,71,1);thumbnails[4486383]=new thumbnail(4486383,"238721","weddings 006","weddings_006_3019_sepia_thumb.jpg",130,87,1);thumbnails[3667219]=new thumbnail(3667219,"238721","polished chrome","polished_chrome_8713_thumb.jpg",130,130,1);thumbnails[3935686]=new thumbnail(3935686,"238721","Wedding Photography","Wedding_photography-005_0166_thumb.jpg",130,194,1);thumbnails[4486367]=new thumbnail(4486367,"238721","weddings 011","Weddings-006_2854_thumb.jpg",130,87,1);thumbnails[3935690]=new thumbnail(3935690,"238721","Wedding Photography","Wedding_photography-005_0209_thumb.jpg",130,163,1);thumbnails[3935692]=new thumbnail(3935692,"238721","Wedding Photography","Wedding_photography-005_2821_thumb.jpg",130,87,1);thumbnails[4516445]=new thumbnail(4516445,"238721","wedding 006","weddings006_30000_thumb.jpg",130,194,1);thumbnails[4516447]=new thumbnail(4516447,"238721","wedding reportage","weddings-006_3581_thumb.jpg",130,87,1);thumbnails[4878999]=new thumbnail(4878999,"238721","1st Dance","Weddings_4376_1st_Dance_thumb.jpg",130,87,1);thumbnails[4879035]=new thumbnail(4879035,"238721","weddings","Wedding_4106_thumb.jpg",130,194,1);var galleries=new Object();galleries[54449]=new gallery(54449,"2748287,2746952,1852625,946092","At The Beach","gallery",[946094,946092,2746952,1852625,2748287,4308012]);galleries[54445]=new gallery(54445,"4309993,4309694,3746114,3664222,3664218,3664213,2782207,2677757,2677734,1817646,1817538,1817514,948648,946098,710550,708188","Black & White","gallery",[3664218,946099,2677734,710550,708188,2677757,946098,3664213,4309694,710600,4309993,4309818,948648,948653,2782207,3664222,1817514,1817646,2942380,1817538,2942824,3746110,3746114]);galleries[222322]=new gallery(222322,"3637290,3637286","Commercial","gallery",[3637284,3637286,3637290]);galleries[172631]=new gallery(172631,"2782274,2749702,2749569,2749389,1852665,710538","Creative Abstract","gallery",[2749389,2749569,710538,1852665,2749702,2749707,2749724,2749737,2782274]);galleries[54443]=new gallery(54443,"2942485,2942372,2782291,2782249,2749201,2677753,1852646,1817679,1750299,710530","Landscapes","gallery",[2677753,2942372,1817679,735076,1750299,2749201,1852646,2096121,948529,2782249,710530,2782291,2942485]);galleries[54451]=new gallery(54451,"2749271,2749231,1885300,1852680,1817661","Other Images","gallery",[1817661,1885300,946104,2749271,1852680,2749523,2942373,2749231]);galleries[167278]=new gallery(167278,"4879006,4516452,4516448,2641489,2641459,2641416","Portraiture","gallery",[4878990,4516448,2641416,3479221,2641459,4516452,3479225,2641489,4879006]);galleries[54444]=new gallery(54444,"4309927,946110,946101,708216","Sunsets","gallery",[946101,708226,4309972,946110,4309927,708216,708172]);galleries[168782]=new gallery(168782,"2680728,2680704,2680686,2680608,2680590,2677760,2677745,2677739,2677719,2677709,946093,710554",'The Land of The "Long White Cloud"',"gallery",[2677709,2677739,2677719,2677760,2677745,2680590,2677751,946093,2680699,2680686,2680608,2680694,710554,2680704,2680720,2680728,2749620,2749815]);galleries[238721]=new gallery(238721,"4879138,4879096,4879066,4879055,4879035,4879019,4516453,4516451,4516449,4516445,4486383,4486333,4486319,4486310,3935692,3935690,3935686,3935648,3667219","Wedding Photography","gallery",[4516451,4879058,3935648,4486333,3935680,4879096,4879049,4516449,3667216,4879066,4879138,4879019,4486310,4879055,4516453,4486319,4486281,4486351,4486383,3667219,3935686,4486367,3935690,3935692,4516445,4516447,4878999,4879035]);var imageSets=new Object();imageSets[231442]="2749737";imageSets[1]="4879066,4878999,4516452,4516451,4516448,4309927,4309818,4309694,4308012,3746114,3664218,2782291,2749569,2749389,2749271,2748287,2680728,2680608,2680590,2677757,2677751,2677745,2096121,1852646,1817679,1817514,948648,948529,946104,946098,946094,710530";imageSets[2]="4879138,4879096,4879066,4879055,4879035,4879019,4879006,4516453,4516452,4516451,4516449,4516448,4516445,4486383,4486333,4486319,4486310,4309993,4309927,4309694,3935692,3935690,3935686,3935648,3746114,3667219,3664222,3664218,3664213,3637290,3637286,2942485,2942372,2782291,2782274,2782249,2782207,2749702,2749569,2749389,2749271,2749231,2749201,2748287,2746952,2680728,2680704,2680686,2680608,2680590,2677760,2677757,2677753,2677745,2677739,2677734,2677719,2677709,2641489,2641459,2641416,1885300,1852680,1852665,1852646,1852625,1817679,1817661,1817646,1817538,1817514,1750299,948648,946110,946101,946098,946093,946092,710554,710550,710538,710530,708216,708188";imageSets[3]="3935686,2749737,2749724,2749620,2748287";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/pwimages/images";break}switch(a){case 1:b="http://www1.clikpic.com/pwimages/images";break}switch(a){case 2:b="http://admin.clikpic.com/pwimages/images";break}switch(a){case 24:b="http://tpc15/clikpic/pwimages/images";break}switch(a){case 4:b="http://www.clikchurch.com/pwimages/images";break}switch(a){case 5:b="http://www2.clikpic.com/pwimages/images";break}switch(a){case 22:b="http://tpc5/clikpic/pwimages/images";break}switch(a){case 23:b="http://tpc10/clikpic/pwimages/images";break}switch(a){case 25:b="http://tpc16/clikpic/pwimages/images";break}switch(a){case 15:b="http://www3.clikpic.com/pwimages/images";break}switch(a){case 18:b="http://www4.clikpic.com/pwimages/images";break}switch(a){case 19:b="http://www5.clikpic.com/pwimages/images";break}switch(a){case 31:b="http://www7.clikpic.com/pwimages/images";break}switch(a){case 32:b="http://admin2.clikpic.com/pwimages/images";break}switch(a){case 33:b="http://www8.clikpic.com/pwimages/images";break}switch(a){case 34:b="http://www9.clikpic.com/pwimages/images";break}switch(a){case 35:b="http://admin3.clikpic.com/pwimages/images";break}switch(a){case 37:b="http://admin4.clikpic.com/pwimages/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="Paul Wright Images: "+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("your item has been added to cart").show()}else{$("#paymentConfirm").text("your item has been 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="PWIMAGES">';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">your item has been 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+'")'})}}};