window.thumbnails = {};
															thumbnails[1227191] = clik.newPhoto({"id":1227191,"src":"Copy of _M5A0159_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Steve Downer","height":87});
															thumbnails[1227279] = clik.newPhoto({"id":1227279,"src":"_B162807b_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"EMMY Awards","height":173});
															thumbnails[1230498] = clik.newPhoto({"id":1230498,"src":"HD Cinematography Ocean_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1242974] = clik.newPhoto({"id":1242974,"src":"_C102784-04_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"ARRI D20","height":70});
															thumbnails[1242984] = clik.newPhoto({"id":1242984,"src":"_C102784-03_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"ARRI D20","height":49});
															thumbnails[1242987] = clik.newPhoto({"id":1242987,"src":"_C102807-01crop_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Steve Downer with ARRI D20","height":117});
															thumbnails[6031835] = clik.newPhoto({"id":6031835,"src":"pref_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":55});
															thumbnails[6032199] = clik.newPhoto({"id":6032199,"src":"_DSC1411_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[6032469] = clik.newPhoto({"id":6032469,"src":"_DSC1413_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":87});
															thumbnails[6970382] = clik.newPhoto({"id":6970382,"src":"Wildscreen_2010_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Wildscreen 2010 logo","height":45});
															thumbnails[1227287] = clik.newPhoto({"id":1227287,"src":"Untitled_Frame_07314_021_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1227287.html","width":130,"caption":"Frame capture from GORGEOUS LABOUR OF LOVE","height":80});
															thumbnails[1230162] = clik.newPhoto({"id":1230162,"src":"Untitled_Frame_03035_015_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1230162.html","width":130,"caption":"Frame capture from GORGEOUS LABOUR OF LOVE","height":79});
															thumbnails[1230201] = clik.newPhoto({"id":1230201,"src":"Untitled_Frame_02519_007_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1230201.html","width":130,"caption":"Frame capture from GORGEOUS LABOUR OF LOVE","height":80});
															thumbnails[1230235] = clik.newPhoto({"id":1230235,"src":"Untitled_Frame_09622_067_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1230235.html","width":130,"caption":"Frame capture from GORGEOUS LABOUR OF LOVE","height":77});
															thumbnails[1230238] = clik.newPhoto({"id":1230238,"src":"Untitled_Frame_10225_085_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1230238.html","width":130,"caption":"Frame capture from GORGEOUS LABOUR OF LOVE","height":79});
															thumbnails[1230241] = clik.newPhoto({"id":1230241,"src":"Nadine flyer jpeg_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1230241.html","width":130,"caption":"NADINE","height":93});
															thumbnails[1230249] = clik.newPhoto({"id":1230249,"src":"Untitled_Frame_06840_059_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1230249.html","width":130,"caption":"Frame capture from GORGEOUS LABOUR OF LOVE","height":76});
															thumbnails[1230525] = clik.newPhoto({"id":1230525,"src":"MicroCosmos6_thumb.2001.jpg","galleries_id":87973,"server_id":18,"link":"photo_1230525.html","width":130,"caption":"MicroCosmos","height":98});
															thumbnails[1231067] = clik.newPhoto({"id":1231067,"src":"_1283088_thumb.jpg","galleries_id":88028,"server_id":18,"link":"photo_1231067.html","width":130,"caption":"Extreme Trial Biking","height":98});
															thumbnails[1231077] = clik.newPhoto({"id":1231077,"src":"_1182980_thumb.jpg","galleries_id":88028,"server_id":18,"link":"photo_1231077.html","width":130,"caption":"Urban Football","height":173});
															thumbnails[1231079] = clik.newPhoto({"id":1231079,"src":"_1243060 crop001_thumb.jpg","galleries_id":88028,"server_id":18,"link":"photo_1231079.html","width":130,"caption":"Urban Basketball, Crystal Palace","height":257});
															thumbnails[1231097] = clik.newPhoto({"id":1231097,"src":"Copy of _A130331-01_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_1231097.html","width":130,"caption":"Vampire Squid","height":98});
															thumbnails[1231100] = clik.newPhoto({"id":1231100,"src":"Golden Eagle 001_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_1231100.html","width":130,"caption":"Golden Eagle, Gobi Desert","height":85});
															thumbnails[1231104] = clik.newPhoto({"id":1231104,"src":"Golden Eagle 5_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_1231104.html","width":130,"caption":"Kazakh nomad and Golden Eagle","height":113});
															thumbnails[1233506] = clik.newPhoto({"id":1233506,"src":"Untitled_Frame_00324_000_thumb.jpg","galleries_id":88035,"server_id":18,"link":"photo_1233506.html","width":130,"caption":"Frame capture from E SANAM","height":87});
															thumbnails[1233515] = clik.newPhoto({"id":1233515,"src":"DSCF2583_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233515.html","width":130,"caption":"Frame capture from the feature film NADINE","height":77});
															thumbnails[1233533] = clik.newPhoto({"id":1233533,"src":"DSCF2729_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233533.html","width":130,"caption":"Frame capture from NADINE","height":75});
															thumbnails[1233539] = clik.newPhoto({"id":1233539,"src":"DSCF2750_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233539.html","width":130,"caption":"Frame capture from NADINE","height":76});
															thumbnails[1233542] = clik.newPhoto({"id":1233542,"src":"DSCF2800_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233542.html","width":130,"caption":"Frame capture from NADINE","height":68});
															thumbnails[1233544] = clik.newPhoto({"id":1233544,"src":"DSCF2834_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233544.html","width":130,"caption":"Frame capture from NADINE","height":88});
															thumbnails[1233547] = clik.newPhoto({"id":1233547,"src":"DSCF2846_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233547.html","width":130,"caption":"Frame capture from NADINE","height":67});
															thumbnails[1233548] = clik.newPhoto({"id":1233548,"src":"DSCF2951_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1233548.html","width":130,"caption":"Frame capture from NADINE","height":96});
															thumbnails[1301228] = clik.newPhoto({"id":1301228,"src":"Highway522 copy_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1301228.html","width":130,"caption":"JVC Highway magazine NADINE feature","height":175});
															thumbnails[1301233] = clik.newPhoto({"id":1301233,"src":"11Artwork1_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1301233.html","width":130,"caption":"LAST CHANCE ROMANCE","height":185});
															thumbnails[1301234] = clik.newPhoto({"id":1301234,"src":"11ArtworkLCR_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1301234.html","width":130,"caption":"Artwork for LAST CHANCE ROMANCE","height":185});
															thumbnails[1939511] = clik.newPhoto({"id":1939511,"src":"_A130052 crop_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_1939511.html","width":130,"caption":"European Eagle Owl","height":86});
															thumbnails[1939522] = clik.newPhoto({"id":1939522,"src":"_A130058_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_1939522.html","width":130,"caption":"Blue Screen filming on HDCAM-SR for Animals on Blue Ltd","height":113});
															thumbnails[1939537] = clik.newPhoto({"id":1939537,"src":"_2263859_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_1939537.html","width":130,"caption":"Bacteria - MicroCosmos","height":98});
															thumbnails[1939540] = clik.newPhoto({"id":1939540,"src":"_2073433_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_1939540.html","width":130,"caption":"Bacteria - MicroCosmos","height":104});
															thumbnails[1939561] = clik.newPhoto({"id":1939561,"src":"Gull_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_1939561.html","width":130,"caption":"Gull. BBC COAST","height":104});
															thumbnails[1939577] = clik.newPhoto({"id":1939577,"src":"_A140160_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_1939577.html","width":130,"caption":"Chameleon on blue screen for Animals On Blue Ltd","height":103});
															thumbnails[1939601] = clik.newPhoto({"id":1939601,"src":"_9260050_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1939601.html","width":130,"caption":"Scene from A MOMENT OF GUILT","height":173});
															thumbnails[1939609] = clik.newPhoto({"id":1939609,"src":"_9280144_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1939609.html","width":130,"caption":"Scene from A MOMENT OF GUILT","height":98});
															thumbnails[1939616] = clik.newPhoto({"id":1939616,"src":"_9280119_thumb.jpg","galleries_id":87796,"server_id":18,"link":"photo_1939616.html","width":130,"caption":"Scene from A MOMENT OF GUILT","height":98});
															thumbnails[1939621] = clik.newPhoto({"id":1939621,"src":"_9290163_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1939621.html","width":130,"caption":"Scene from THE CHAUFFEUR'S HAT","height":98});
															thumbnails[1939625] = clik.newPhoto({"id":1939625,"src":"_9290210_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1939625.html","width":130,"caption":"Scene from THE CHAUFFEUR'S HAT","height":173});
															thumbnails[1939652] = clik.newPhoto({"id":1939652,"src":"_9290191_thumb.jpg","galleries_id":87822,"server_id":18,"link":"photo_1939652.html","width":130,"caption":"Scene from THE CHAUFFEUR'S HAT","height":173});
															thumbnails[5051949] = clik.newPhoto({"id":5051949,"src":"_51900171_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_5051949.html","width":130,"caption":"Red Kangaroo joey in pouch. <br>\r\nFrom EXTRAORDINARY ANIMALS IN THE WOMB. Channel 4","height":98});
															thumbnails[5052044] = clik.newPhoto({"id":5052044,"src":"_5210177_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_5052044.html","width":130,"caption":"Eastern Grey Kangaroo joey in pouch.<br>\r\nFrom EXTRAORDINARY ANIMALS IN THE WOMB. Channel 4","height":100});
															thumbnails[5052066] = clik.newPhoto({"id":5052066,"src":"_5210159_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_5052066.html","width":130,"caption":"Steve Downer filming kangaroo joeys in the pouch using Olympus HD endoscope camera.<br>\r\nFor EXTRAORDINARY ANIMALS IN THE WOMB. Channel 4","height":98});
															thumbnails[5052082] = clik.newPhoto({"id":5052082,"src":"_DSC3430_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052082.html","width":130,"caption":"Harvest mouse. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":87});
															thumbnails[5052167] = clik.newPhoto({"id":5052167,"src":"_DSC42071_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052167.html","width":130,"caption":"Sunflowers. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":87});
															thumbnails[5052175] = clik.newPhoto({"id":5052175,"src":"_DSC0993_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052175.html","width":130,"caption":"Jumping spider. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":87});
															thumbnails[5052185] = clik.newPhoto({"id":5052185,"src":"_DSC2638_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052185.html","width":130,"caption":"Frog. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":87});
															thumbnails[5052193] = clik.newPhoto({"id":5052193,"src":"_DSC1358_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052193.html","width":130,"caption":"Scarlet Lily Beetle. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":195});
															thumbnails[5052198] = clik.newPhoto({"id":5052198,"src":"_DSC3493-2_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052198.html","width":130,"caption":"Marmalade fly. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":87});
															thumbnails[5052206] = clik.newPhoto({"id":5052206,"src":"_DSC2258-2_thumb.jpg","galleries_id":87975,"server_id":18,"link":"photo_5052206.html","width":130,"caption":"Harlequin Ladybird larva & pupa. THE SEASONS, WITH ALAN TITCHMARSH. Tiger Aspect","height":87});
															thumbnails[5052219] = clik.newPhoto({"id":5052219,"src":"_4200179_thumb.jpg","galleries_id":129862,"server_id":18,"link":"photo_5052219.html","width":130,"caption":"Labrador & puppies against blue screen. Animals on Blue Ltd","height":98});
															thumbnails[6865622] = clik.newPhoto({"id":6865622,"src":"_DSC1388crop_thumb.jpg","galleries_id":372693,"server_id":18,"link":"photo_6865622.html","width":130,"caption":"Samsung HMX R10 1080p camera mounted on the Acuter Merlin remote head","height":163});
															thumbnails[6865624] = clik.newPhoto({"id":6865624,"src":"SNV82022crop_thumb.jpg","galleries_id":372693,"server_id":18,"link":"photo_6865624.html","width":130,"caption":"Sony Alpha 700 shooting Time Lapse on the Acuter Merlin remote head","height":122});
															thumbnails[6865630] = clik.newPhoto({"id":6865630,"src":"SNV82027_crop_thumb.jpg","galleries_id":372693,"server_id":18,"link":"photo_6865630.html","width":130,"caption":"Olympus E1 shooting Time Lapse on the Acuter Merlin remote head","height":123});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[88028] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Corporate \/ DVD's","link":"gallery_88028.html","maxRecords":0.0,"photoIDs":[1231067.0,1231077.0,1231079.0],"skipIndex":0,"section_code":"gallery","featured_images":1231067.0,"id":88028,"singleSection":false});				  						galleries[88035] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Music Videos","link":"gallery_88035.html","maxRecords":0.0,"photoIDs":[1233506.0],"skipIndex":0,"section_code":"gallery","featured_images":1233506.0,"id":88035,"singleSection":false});				  						galleries[87796] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Feature Films","link":"gallery_87796.html","maxRecords":0.0,"photoIDs":[1230241.0,1233515.0,1233533.0,1233539.0,1233542.0,1233544.0,1233547.0,1233548.0,1301228.0,1939601.0,1939609.0,1939616.0],"skipIndex":0,"section_code":"gallery","featured_images":1230241.0,"id":87796,"singleSection":false});				  						galleries[87822] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Short Films","link":"gallery_87822.html","maxRecords":0.0,"photoIDs":[1227287.0,1230162.0,1230201.0,1230235.0,1230238.0,1230249.0,1301233.0,1301234.0,1939621.0,1939625.0,1939652.0],"skipIndex":0,"section_code":"gallery","featured_images":1227287.0,"id":87822,"singleSection":false});				  						galleries[87973] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Video Art Installations","link":"gallery_87973.html","maxRecords":0.0,"photoIDs":[1230525.0],"skipIndex":0,"section_code":"gallery","featured_images":1230525.0,"id":87973,"singleSection":false});				  						galleries[87975] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Broadcast TV","link":"gallery_87975.html","maxRecords":0.0,"photoIDs":[1231097.0,1231100.0,1231104.0,5052082.0,5052167.0,5052175.0,5052185.0,5052193.0,5052198.0,5052206.0],"skipIndex":0,"section_code":"gallery","featured_images":"5052206,5052198,5052193,5052185,5052175,5052167,5052082,1231104,1231100,1231097","id":87975,"singleSection":false});				  						galleries[129862] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Specialist Filming","link":"gallery_129862.html","maxRecords":0.0,"photoIDs":[1939511.0,1939522.0,1939537.0,1939540.0,1939561.0,1939577.0,5051949.0,5052044.0,5052066.0,5052219.0],"skipIndex":0,"section_code":"gallery","featured_images":1939540.0,"id":129862,"singleSection":false});				  						galleries[372693] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Specialist Equipment","link":"gallery_372693.html","maxRecords":0.0,"photoIDs":[6865622.0,6865624.0,6865630.0],"skipIndex":0,"section_code":"gallery","featured_images":"6865630,6865624,6865622","id":372693,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1301233,1242974,1233515,1230498,1230201,1230162,1227287,1227279,1227191';
imageSets[2] = '1939540,1233506,1231067,1230525,1230241,1227287';
imageSets[3] = '6970382,6865630,6865624,6865622,6032469,6032199,6031835,5052219,5052206,5052198,5052193,5052185,5052175,5052167,5052082,5052066,5052044,5051949,1939652,1939625,1939621,1939616,1939609,1939601,1939577,1939561,1939540,1939537,1939522,1939511,1301234,1301233,1301228,1242987,1242984,1242974,1233548,1233547,1233544,1233542,1233539,1233533,1233515,1233506,1231104,1231100,1231097,1231079,1231077,1231067';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/HDCinematography/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/HDCinematography/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'HD Cinematography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

