window.thumbnails = {};
															thumbnails[2604954] = clik.newPhoto({"id":2604954,"src":"FirstFoalweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604954.html","width":130,"caption":"First Foal","height":98});
															thumbnails[7244233] = clik.newPhoto({"id":7244233,"src":"Coquette2WebA1_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_7244233.html","width":130,"caption":"Coquette","height":173});
															thumbnails[2600003] = clik.newPhoto({"id":2600003,"src":"BundleCweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2600003.html","width":130,"caption":"A Bundle of Love","height":98});
															thumbnails[8008454] = clik.newPhoto({"id":8008454,"src":"Spirit_of_FireCWeb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_8008454.html","width":130,"caption":"Spirit of Fire","height":98});
															thumbnails[8008461] = clik.newPhoto({"id":8008461,"src":"TheGiftCWeb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_8008461.html","width":130,"caption":"The Gift","height":197});
															thumbnails[4489178] = clik.newPhoto({"id":4489178,"src":"HackneyMagicPrintCA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_4489178.html","width":130,"caption":"Hackney Magic","height":97});
															thumbnails[8933496] = clik.newPhoto({"id":8933496,"src":"Nason.K_untitledCWeb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_8933496.html","width":130,"caption":"Molten","height":130});
															thumbnails[7376677] = clik.newPhoto({"id":7376677,"src":"voodoo_child_WebA_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_7376677.html","width":130,"caption":"Voodoo Child","height":189});
															thumbnails[8933484] = clik.newPhoto({"id":8933484,"src":"SophieGabrielaCweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_8933484.html","width":130,"caption":"A Christmas commission","height":98});
															thumbnails[2604917] = clik.newPhoto({"id":2604917,"src":"corintoweb4A_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604917.html","width":130,"caption":"Schooling Corinto","height":95});
															thumbnails[4488937] = clik.newPhoto({"id":4488937,"src":"Aidenweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_4488937.html","width":130,"caption":"Aiden","height":97});
															thumbnails[7160946] = clik.newPhoto({"id":7160946,"src":"BlackonBlack_bestWeb12_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_7160946.html","width":130,"caption":"Black on Black","height":130});
															thumbnails[8933501] = clik.newPhoto({"id":8933501,"src":"Nason.K-ITouchNotEarthWebC_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_8933501.html","width":130,"caption":"I Touch Not Earth","height":96});
															thumbnails[2842359] = clik.newPhoto({"id":2842359,"src":"MOAHSweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2842359.html","width":130,"caption":"Master of All he Surveys","height":163});
															thumbnails[2630208] = clik.newPhoto({"id":2630208,"src":"blacksmithweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2630208.html","width":130,"caption":"Sol y Sombras","height":84});
															thumbnails[4489182] = clik.newPhoto({"id":4489182,"src":"GrandeePrintCbestA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_4489182.html","width":130,"caption":"Grandee","height":97});
															thumbnails[2605049] = clik.newPhoto({"id":2605049,"src":"motherCWebA_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2605049.html","width":130,"caption":"Mother","height":174});
															thumbnails[4489246] = clik.newPhoto({"id":4489246,"src":"SpiritofYouthPrintCA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_4489246.html","width":130,"caption":"Spirit of Youth","height":165});
															thumbnails[4488940] = clik.newPhoto({"id":4488940,"src":"Blissweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_4488940.html","width":130,"caption":"Bliss","height":173});
															thumbnails[9005779] = clik.newPhoto({"id":9005779,"src":"SonOTMoonWebMod6forupload_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_9005779.html","width":130,"caption":"Son of the Moon","height":98});
															thumbnails[4488949] = clik.newPhoto({"id":4488949,"src":"Bud_web_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_4488949.html","width":130,"caption":"Bud","height":95});
															thumbnails[8008464] = clik.newPhoto({"id":8008464,"src":"doubly_delicious_004C_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_8008464.html","width":130,"caption":"Doubly Delicious","height":98});
															thumbnails[4489250] = clik.newPhoto({"id":4489250,"src":"YoungStallionPrintC1A_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_4489250.html","width":130,"caption":"Young Stallion","height":182});
															thumbnails[2599993] = clik.newPhoto({"id":2599993,"src":"SentinelwebA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2599993.html","width":130,"caption":"Sentinel - HACLC","height":190});
															thumbnails[2604621] = clik.newPhoto({"id":2604621,"src":"Alweb2_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604621.html","width":130,"caption":"Al Andaluz","height":90});
															thumbnails[2604310] = clik.newPhoto({"id":2604310,"src":"CopenhagenWeb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604310.html","width":130,"caption":"Copenhagen","height":97});
															thumbnails[2630174] = clik.newPhoto({"id":2630174,"src":"evaleaweb2_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2630174.html","width":130,"caption":"Lea and Eva","height":91});
															thumbnails[7244156] = clik.newPhoto({"id":7244156,"src":"KnowingPrintCA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_7244156.html","width":130,"caption":"Knowing","height":173});
															thumbnails[2630123] = clik.newPhoto({"id":2630123,"src":"dandpweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2630123.html","width":130,"caption":"Danielle and Paige","height":100});
															thumbnails[9005772] = clik.newPhoto({"id":9005772,"src":"LoveinaMist_CWeb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_9005772.html","width":130,"caption":"Love in a Mist","height":92});
															thumbnails[2605063] = clik.newPhoto({"id":2605063,"src":"RioCWebA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2605063.html","width":130,"caption":"Rio","height":181});
															thumbnails[2604624] = clik.newPhoto({"id":2604624,"src":"ABreathWebA_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604624.html","width":130,"caption":"A Breath of Autumn","height":173});
															thumbnails[2612595] = clik.newPhoto({"id":2612595,"src":"BettywebA_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2612595.html","width":130,"caption":"The Bonus of Laughter","height":173});
															thumbnails[8008465] = clik.newPhoto({"id":8008465,"src":"pretty_in_pink_14KiB_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_8008465.html","width":130,"caption":"Pretty in Pink","height":121});
															thumbnails[2605087] = clik.newPhoto({"id":2605087,"src":"SpringLoadedCweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2605087.html","width":130,"caption":"Spring-loaded","height":98});
															thumbnails[2604959] = clik.newPhoto({"id":2604959,"src":"HarryCwebA_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2604959.html","width":130,"caption":"Harry","height":173});
															thumbnails[2604626] = clik.newPhoto({"id":2604626,"src":"Fire1_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604626.html","width":130,"caption":"Fire","height":97});
															thumbnails[2605084] = clik.newPhoto({"id":2605084,"src":"soxCweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2605084.html","width":130,"caption":"Tiger Sox","height":189});
															thumbnails[2619350] = clik.newPhoto({"id":2619350,"src":"Maliweb-upload_thumb.jpg","galleries_id":165784,"server_id":32,"link":"photo_2619350.html","width":130,"caption":"Mali","height":158});
															thumbnails[2605042] = clik.newPhoto({"id":2605042,"src":"MartinsmumWebA_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2605042.html","width":130,"caption":"Watching Over You Always","height":173});
															thumbnails[7244198] = clik.newPhoto({"id":7244198,"src":"GatheriingStormPrintC1_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_7244198.html","width":130,"caption":"A Gathering Storm","height":89});
															thumbnails[2632670] = clik.newPhoto({"id":2632670,"src":"Nightfiresweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2632670.html","width":130,"caption":"Nightfires","height":108});
															thumbnails[2605089] = clik.newPhoto({"id":2605089,"src":"thelookCWebA_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2605089.html","width":130,"caption":"The Look","height":173});
															thumbnails[2605047] = clik.newPhoto({"id":2605047,"src":"MiaCweb_thumb.jpg","galleries_id":165784,"server_id":32,"link":"photo_2605047.html","width":130,"caption":"Mia","height":176});
															thumbnails[2604994] = clik.newPhoto({"id":2604994,"src":"LevanteC_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604994.html","width":130,"caption":"Levante","height":90});
															thumbnails[2604558] = clik.newPhoto({"id":2604558,"src":"bolCweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2604558.html","width":130,"caption":"Time for Prayer","height":158});
															thumbnails[2605057] = clik.newPhoto({"id":2605057,"src":"lailaCweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2605057.html","width":130,"caption":"Laila","height":98});
															thumbnails[2604969] = clik.newPhoto({"id":2604969,"src":"Impatienceweb2_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604969.html","width":130,"caption":"Impatience","height":88});
															thumbnails[2604245] = clik.newPhoto({"id":2604245,"src":"AlHeadWeb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604245.html","width":130,"caption":"Desioso","height":173});
															thumbnails[2605097] = clik.newPhoto({"id":2605097,"src":"willowweb_680570E3-24E8-5EC4-4F69BF31E252E8C2_thumb.jpg","galleries_id":165784,"server_id":32,"link":"photo_2605097.html","width":130,"caption":"Willow","height":204});
															thumbnails[2605077] = clik.newPhoto({"id":2605077,"src":"ritasCweb_thumb.jpg","galleries_id":165784,"server_id":32,"link":"photo_2605077.html","width":130,"caption":"Sallycat","height":164});
															thumbnails[2609528] = clik.newPhoto({"id":2609528,"src":"Youth_1_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2609528.html","width":130,"caption":"Youth","height":90});
															thumbnails[2605036] = clik.newPhoto({"id":2605036,"src":"MandCC_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2605036.html","width":130,"caption":"Marcus and Chantal","height":98});
															thumbnails[2605080] = clik.newPhoto({"id":2605080,"src":"royalathleteCweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2605080.html","width":130,"caption":"Royal AthleteGrand National winner 1995","height":176});
															thumbnails[2630198] = clik.newPhoto({"id":2630198,"src":"latest_182d_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2630198.html","width":130,"caption":"Silver Patriarch","height":173});
															thumbnails[2604934] = clik.newPhoto({"id":2604934,"src":"bensonweb_thumb.jpg","galleries_id":165784,"server_id":32,"link":"photo_2604934.html","width":130,"caption":"Benson","height":173});
															thumbnails[2605071] = clik.newPhoto({"id":2605071,"src":"puppiesCweb_thumb.jpg","galleries_id":165784,"server_id":32,"link":"photo_2605071.html","width":130,"caption":"Guilty","height":113});
															thumbnails[2612516] = clik.newPhoto({"id":2612516,"src":"teenagersweb_676DA220-24E8-5EC4-4F6814CD94B0C4CE_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2612516.html","width":130,"caption":"Daughters","height":209});
															thumbnails[2604560] = clik.newPhoto({"id":2604560,"src":"EdwinCweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2604560.html","width":130,"caption":"Edwin","height":173});
															thumbnails[2604647] = clik.newPhoto({"id":2604647,"src":"HiSteppinweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2604647.html","width":130,"caption":"Hi Steppin'","height":87});
															thumbnails[2604559] = clik.newPhoto({"id":2604559,"src":"Derrickweb2_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2604559.html","width":130,"caption":"Derrick","height":173});
															thumbnails[2605058] = clik.newPhoto({"id":2605058,"src":"OldTimerCweb_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2605058.html","width":130,"caption":"Old Timer","height":178});
															thumbnails[2632660] = clik.newPhoto({"id":2632660,"src":"indoorschoolweb_thumb.jpg","galleries_id":164667,"server_id":32,"link":"photo_2632660.html","width":130,"caption":"The Indoor School","height":130});
															thumbnails[2900755] = clik.newPhoto({"id":2900755,"src":"charlesbleu_thumb.jpg","galleries_id":164668,"server_id":32,"link":"photo_2900755.html","width":130,"caption":"HAC Light Cavalry","height":177});
															thumbnails[7242314] = clik.newPhoto({"id":7242314,"src":"GatheriingStormPrintC_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7242314.html","width":130,"caption":"A Gathering Storm","height":89});
															thumbnails[7242249] = clik.newPhoto({"id":7242249,"src":"KnowingPrintC_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7242249.html","width":130,"caption":"Knowing","height":173});
															thumbnails[7242255] = clik.newPhoto({"id":7242255,"src":"GrandeePrintCbest_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7242255.html","width":130,"caption":"Grandee","height":97});
															thumbnails[7242328] = clik.newPhoto({"id":7242328,"src":"YoungStallionPrintC1_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7242328.html","width":130,"caption":"Young Stallion","height":182});
															thumbnails[7242206] = clik.newPhoto({"id":7242206,"src":"SpiritofYouthPrintC_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7242206.html","width":130,"caption":"Spirit of Youth","height":165});
															thumbnails[7242240] = clik.newPhoto({"id":7242240,"src":"HackneyMagicPrintC_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7242240.html","width":130,"caption":"Hackney Magic","height":97});
															thumbnails[7280918] = clik.newPhoto({"id":7280918,"src":"Impatienceweb2_74CCCB43-24E8-5EC4-4F4148562C44074D_thumb.jpg","galleries_id":404448,"server_id":32,"link":"photo_7280918.html","width":130,"caption":"Impatience  ","height":88});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[164667] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Horses","link":"gallery_164667.html","maxRecords":0.0,"photoIDs":[2604954.0,7244233.0,8008454.0,4489178.0,8933496.0,2604917.0,7160946.0,8933501.0,2842359.0,2630208.0,4489182.0,4489246.0,9005779.0,4488949.0,4489250.0,2599993.0,2604621.0,2604310.0,7244156.0,9005772.0,2605063.0,2604624.0,2605087.0,2604626.0,2605084.0,7244198.0,2632670.0,2604994.0,2604969.0,2604245.0,2605080.0,2630198.0,2604647.0,2632660.0],"skipIndex":0,"section_code":"gallery","featured_images":8008454.0,"id":164667,"singleSection":false});				  						galleries[164668] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_164668.html","maxRecords":0.0,"photoIDs":[2600003.0,8008461.0,7376677.0,8933484.0,4488937.0,2605049.0,4488940.0,8008464.0,2630174.0,2630123.0,2612595.0,8008465.0,2604959.0,2605042.0,2605089.0,2604558.0,2605057.0,2609528.0,2605036.0,2612516.0,2604560.0,2604559.0,2605058.0,2900755.0],"skipIndex":0,"section_code":"gallery","featured_images":8008461,"id":164668,"singleSection":false});				  						galleries[404448] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Prints","link":"section483269.html","maxRecords":0.0,"photoIDs":[7242314.0,7242249.0,7242255.0,7242328.0,7242206.0,7242240.0,7280918.0],"skipIndex":0,"section_code":"section483269","featured_images":"7280918,7242328,7242314,7242255,7242249,7242240,7242206","id":404448,"singleSection":true});				  						galleries[165784] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cats & Dogs","link":"gallery_165784.html","maxRecords":0.0,"photoIDs":[2619350.0,2605047.0,2605097.0,2605077.0,2604934.0,2605071.0],"skipIndex":0,"section_code":"gallery","featured_images":2605047.0,"id":165784,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2600003,8008454,8008461,8933496,8933484,7376677,7160946,8933501,4489182,9005779,8008464,4489250,9005772,2605063,7244198,2605097';
imageSets[2] = '2600003,8008454,2605047';
imageSets[3] = '9005779,9005772,8933501,8933496,8933484,8008465,8008464,8008461,8008454,7376677,7280918,7244233,7244198,7244156,7242328,7242314,7242255,7242249,7242240,7242206,7160946,4489250,4489246,4489182,4489178,4488949,4488940,4488937,2900755,2842359,2632670,2632660,2630208,2630198,2630174,2630123,2619350,2612595,2612516,2609528,2605097,2605089,2605087,2605084,2605080,2605077,2605071,2605063,2605058,2605057';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kristinenason/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/kristinenason/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 || photos || {})[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 = 'kristine nason - portraiture & equestrian art: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="KRISTINENASON">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

