window.thumbnails = {};
															thumbnails[2562578] = clik.newPhoto({"id":2562578,"src":"camera 2005 to 2008 darren 00152_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Junior\/Senior Team 2008","height":98});
															thumbnails[3583440] = clik.newPhoto({"id":3583440,"src":"_MG_2544_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":2544.0,"height":92});
															thumbnails[3583441] = clik.newPhoto({"id":3583441,"src":"_MG_2547_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":2547.0,"height":188});
															thumbnails[3583443] = clik.newPhoto({"id":3583443,"src":"_MG_2546_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":2546.0,"height":92});
															thumbnails[5237745] = clik.newPhoto({"id":5237745,"src":"IMG_1838_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Monica & Emilia","height":184});
															thumbnails[5237749] = clik.newPhoto({"id":5237749,"src":"IMG_1839_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Kirsty & Darren","height":184});
															thumbnails[5237752] = clik.newPhoto({"id":5237752,"src":"IMG_1841_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Brooke Le page","height":184});
															thumbnails[5237755] = clik.newPhoto({"id":5237755,"src":"IMG_1842_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Natalie Collas","height":184});
															thumbnails[5237776] = clik.newPhoto({"id":5237776,"src":"IMG_1843_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Hannah","height":184});
															thumbnails[5237778] = clik.newPhoto({"id":5237778,"src":"IMG_1845_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Pauline Bianco","height":184});
															thumbnails[5662616] = clik.newPhoto({"id":5662616,"src":"IMG_7221_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5662628] = clik.newPhoto({"id":5662628,"src":"IMG_7222_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7222.0,"height":196});
															thumbnails[5662631] = clik.newPhoto({"id":5662631,"src":"IMG_7223_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7223.0,"height":195});
															thumbnails[5662636] = clik.newPhoto({"id":5662636,"src":"IMG_7225_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7225.0,"height":196});
															thumbnails[5662639] = clik.newPhoto({"id":5662639,"src":"IMG_7226_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7226.0,"height":195});
															thumbnails[5662641] = clik.newPhoto({"id":5662641,"src":"IMG_7227_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7227.0,"height":196});
															thumbnails[5662643] = clik.newPhoto({"id":5662643,"src":"IMG_7230_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7230.0,"height":196});
															thumbnails[5662645] = clik.newPhoto({"id":5662645,"src":"IMG_7232CR2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7232.0,"height":195});
															thumbnails[5662648] = clik.newPhoto({"id":5662648,"src":"IMG_7235_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7235.0,"height":196});
															thumbnails[5662650] = clik.newPhoto({"id":5662650,"src":"IMG_7236_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7236.0,"height":196});
															thumbnails[5662653] = clik.newPhoto({"id":5662653,"src":"IMG_7238_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7238.0,"height":195});
															thumbnails[5662658] = clik.newPhoto({"id":5662658,"src":"IMG_7240_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7240.0,"height":195});
															thumbnails[5662659] = clik.newPhoto({"id":5662659,"src":"IMG_7241CR2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7241.0,"height":196});
															thumbnails[5662665] = clik.newPhoto({"id":5662665,"src":"IMG_7245_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7245.0,"height":196});
															thumbnails[5662668] = clik.newPhoto({"id":5662668,"src":"IMG_7248_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7248.0,"height":196});
															thumbnails[5662672] = clik.newPhoto({"id":5662672,"src":"IMG_7249CR2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7249.0,"height":195});
															thumbnails[5662676] = clik.newPhoto({"id":5662676,"src":"IMG_7251_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7251.0,"height":195});
															thumbnails[5662678] = clik.newPhoto({"id":5662678,"src":"IMG_7253_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7253.0,"height":195});
															thumbnails[5662680] = clik.newPhoto({"id":5662680,"src":"IMG_7255CR2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7255.0,"height":196});
															thumbnails[5662682] = clik.newPhoto({"id":5662682,"src":"IMG_7258_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":7258.0,"height":196});
															thumbnails[7518443] = clik.newPhoto({"id":7518443,"src":"IMG_1683_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518444] = clik.newPhoto({"id":7518444,"src":"IMG_1686_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518456] = clik.newPhoto({"id":7518456,"src":"IMG_1688_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518457] = clik.newPhoto({"id":7518457,"src":"IMG_1692_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518459] = clik.newPhoto({"id":7518459,"src":"IMG_1695_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518462] = clik.newPhoto({"id":7518462,"src":"IMG_1697_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518463] = clik.newPhoto({"id":7518463,"src":"IMG_1701_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518464] = clik.newPhoto({"id":7518464,"src":"IMG_1704_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518466] = clik.newPhoto({"id":7518466,"src":"IMG_1706_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518467] = clik.newPhoto({"id":7518467,"src":"IMG_1711_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518468] = clik.newPhoto({"id":7518468,"src":"IMG_1713_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518470] = clik.newPhoto({"id":7518470,"src":"IMG_1716_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518471] = clik.newPhoto({"id":7518471,"src":"IMG_1719_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518472] = clik.newPhoto({"id":7518472,"src":"IMG_1723_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518475] = clik.newPhoto({"id":7518475,"src":"IMG_1725_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518476] = clik.newPhoto({"id":7518476,"src":"IMG_1728_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518478] = clik.newPhoto({"id":7518478,"src":"IMG_1731_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7518479] = clik.newPhoto({"id":7518479,"src":"IMG_1736_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[3226462] = clik.newPhoto({"id":3226462,"src":"IMG_0564web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Darren & Kirsty","height":182});
															thumbnails[3226458] = clik.newPhoto({"id":3226458,"src":"IMG_0557web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Chloe & Monica","height":182});
															thumbnails[3226459] = clik.newPhoto({"id":3226459,"src":"IMG_0559web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Jodene","height":182});
															thumbnails[3226460] = clik.newPhoto({"id":3226460,"src":"IMG_0561web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Laura","height":182});
															thumbnails[8783436] = clik.newPhoto({"id":8783436,"src":"IMG_5189_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783436.html","width":130,"caption":"Jodene","height":195});
															thumbnails[8783439] = clik.newPhoto({"id":8783439,"src":"IMG_5197_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783439.html","width":130,"caption":"Jodene","height":195});
															thumbnails[8783442] = clik.newPhoto({"id":8783442,"src":"IMG_5266_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783442.html","width":130,"caption":"Jodene","height":195});
															thumbnails[8783445] = clik.newPhoto({"id":8783445,"src":"IMG_5268_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783445.html","width":130,"caption":"Jodene","height":195});
															thumbnails[8783446] = clik.newPhoto({"id":8783446,"src":"IMG_5621_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783446.html","width":130,"caption":"Jodene","height":195});
															thumbnails[8783449] = clik.newPhoto({"id":8783449,"src":"IMG_5672_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783449.html","width":130,"caption":"Jodene","height":195});
															thumbnails[8783454] = clik.newPhoto({"id":8783454,"src":"IMG_5743_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783454.html","width":130,"caption":"Chloe","height":195});
															thumbnails[8783455] = clik.newPhoto({"id":8783455,"src":"IMG_5740_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783455.html","width":130,"caption":"Chloe","height":196});
															thumbnails[8783459] = clik.newPhoto({"id":8783459,"src":"IMG_5744_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783459.html","width":130,"caption":"Chloe","height":195});
															thumbnails[8783461] = clik.newPhoto({"id":8783461,"src":"IMG_5355_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783461.html","width":130,"caption":"Chloe","height":195});
															thumbnails[8783463] = clik.newPhoto({"id":8783463,"src":"IMG_5356_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783463.html","width":130,"caption":"Chloe","height":196});
															thumbnails[8783468] = clik.newPhoto({"id":8783468,"src":"IMG_5537_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783468.html","width":130,"caption":"Chloe","height":195});
															thumbnails[8783471] = clik.newPhoto({"id":8783471,"src":"IMG_5548_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783471.html","width":130,"caption":"Chloe","height":195});
															thumbnails[8783476] = clik.newPhoto({"id":8783476,"src":"IMG_5397_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783476.html","width":130,"caption":"Emilia","height":195});
															thumbnails[8783481] = clik.newPhoto({"id":8783481,"src":"IMG_5405_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783481.html","width":130,"caption":"Emilia","height":195});
															thumbnails[8783491] = clik.newPhoto({"id":8783491,"src":"IMG_5401_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783491.html","width":130,"caption":"Emilia","height":195});
															thumbnails[8783501] = clik.newPhoto({"id":8783501,"src":"IMG_5723_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783501.html","width":130,"caption":"Emilia","height":195});
															thumbnails[8783506] = clik.newPhoto({"id":8783506,"src":"IMG_5727_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783506.html","width":130,"caption":"Emilia","height":195});
															thumbnails[8783509] = clik.newPhoto({"id":8783509,"src":"IMG_5585_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783509.html","width":130,"caption":"Natalie","height":195});
															thumbnails[8783514] = clik.newPhoto({"id":8783514,"src":"IMG_5591_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783514.html","width":130,"caption":"Natalie","height":195});
															thumbnails[8783519] = clik.newPhoto({"id":8783519,"src":"IMG_5593_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783519.html","width":130,"caption":"Natalie","height":195});
															thumbnails[8783527] = clik.newPhoto({"id":8783527,"src":"IMG_5759_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783527.html","width":130,"caption":"Natalie","height":195});
															thumbnails[8783530] = clik.newPhoto({"id":8783530,"src":"IMG_5772_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783530.html","width":130,"caption":"Natalie","height":195});
															thumbnails[8783537] = clik.newPhoto({"id":8783537,"src":"IMG_5770_thumb.jpg","galleries_id":462578,"server_id":1,"link":"photo_8783537.html","width":130,"caption":"Natalie","height":195});
															thumbnails[8979260] = clik.newPhoto({"id":8979260,"src":"SG1S33271_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979260.html","width":130,"caption":"","height":196});
															thumbnails[8979263] = clik.newPhoto({"id":8979263,"src":"SG1S3329_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979263.html","width":130,"caption":"","height":87});
															thumbnails[8979264] = clik.newPhoto({"id":8979264,"src":"SG1S3333_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979264.html","width":130,"caption":"","height":87});
															thumbnails[8979270] = clik.newPhoto({"id":8979270,"src":"SG1S3341_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979270.html","width":130,"caption":"","height":87});
															thumbnails[8979274] = clik.newPhoto({"id":8979274,"src":"SG1S3353_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979274.html","width":130,"caption":"","height":87});
															thumbnails[8979276] = clik.newPhoto({"id":8979276,"src":"SG1S3354_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979276.html","width":130,"caption":"","height":196});
															thumbnails[8979280] = clik.newPhoto({"id":8979280,"src":"SG1S3356_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979280.html","width":130,"caption":"","height":196});
															thumbnails[8979281] = clik.newPhoto({"id":8979281,"src":"SG1S3358_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979281.html","width":130,"caption":"","height":87});
															thumbnails[8979284] = clik.newPhoto({"id":8979284,"src":"SG1S3332_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979284.html","width":130,"caption":"","height":196});
															thumbnails[8979286] = clik.newPhoto({"id":8979286,"src":"SG1S3344_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979286.html","width":130,"caption":"","height":196});
															thumbnails[8979289] = clik.newPhoto({"id":8979289,"src":"SG1S3342_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979289.html","width":130,"caption":"","height":196});
															thumbnails[8979292] = clik.newPhoto({"id":8979292,"src":"SG1S3331_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979292.html","width":130,"caption":"","height":196});
															thumbnails[8979295] = clik.newPhoto({"id":8979295,"src":"SG1S3347_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979295.html","width":130,"caption":"","height":87});
															thumbnails[8979300] = clik.newPhoto({"id":8979300,"src":"SG1S3336_thumb.JPG","galleries_id":472879,"server_id":1,"link":"photo_8979300.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[462578] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Cup of Europe 2011","link":"gallery_462578.html","maxRecords":0.0,"photoIDs":[8783436.0,8783439.0,8783442.0,8783445.0,8783446.0,8783449.0,8783454.0,8783455.0,8783459.0,8783461.0,8783463.0,8783468.0,8783471.0,8783476.0,8783481.0,8783491.0,8783501.0,8783506.0,8783509.0,8783514.0,8783519.0,8783527.0,8783530.0,8783537.0],"skipIndex":0,"section_code":"gallery","featured_images":"8783537,8783530,8783527,8783519,8783514,8783509,8783506,8783501,8783491,8783481","id":462578,"singleSection":false});				  						galleries[472879] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Xmas Extravaganza Photos","link":"gallery_472879.html","maxRecords":0.0,"photoIDs":[8979260.0,8979263.0,8979264.0,8979270.0,8979274.0,8979276.0,8979280.0,8979281.0,8979284.0,8979286.0,8979289.0,8979292.0,8979295.0,8979300.0],"skipIndex":0,"section_code":"gallery","featured_images":"8979300,8979295,8979292,8979289,8979286,8979284,8979281,8979280,8979276,8979274","id":472879,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8979300,8979295,8979292,8979289,8979286,8979284,8979281,8979280,8979276,8979274,8979270,8979264,8979263,8979260,8783514,8783509,8783491,8783481,8783463,8783455,8783454,8783439,8783436,7518479';
imageSets[2] = '5662659';
imageSets[3] = '5662659';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/phoenix02/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/phoenix02/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 = 'PHOENIX ARTISTIC ROLLER SKATING CLUB: ' + 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.item_price !== '') {
			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;
	}
}

			

