window.thumbnails = {};
															thumbnails[5719234] = clik.newPhoto({"id":5719234,"src":"portrait_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5719264] = clik.newPhoto({"id":5719264,"src":"DrRickGarage_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Dr Rick's 'Gallerage' in Tennessee where he stores his precious Porsche Speedster <br>\r\nreplica, Morgan and Thunderbird as well as his mighty collection of automobilia. <br>\r\nOur Mille Miglia and Aston Martin posters can be seen on the wall.","height":74});
															thumbnails[5728744] = clik.newPhoto({"id":5728744,"src":"COOPER_89CC1C3C-1EC9-D45B-1C73D71E9C648E43_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"<strong>BUGATTI OWNERS CLUB OFFICIAL POSTER.<\/strong> <br>\r\nOriginal 70cm x 50cm offset litho event poster.<br>\r\n<strong>£12.00 ($18.25) incl p&p<\/strong><br>\r\n","height":182});
															thumbnails[5728748] = clik.newPhoto({"id":5728748,"src":"BugattiRoyale_89CD99A5-1EC9-D45B-1CD7AD0E6BB62561_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"<strong>BUGATTI ROYALE POSTER.<\/strong><br>\r\n70cm x 50cm offset litho poster<br>\r\n<strong>£12.00 ($18.25) incl p&p<\/strong>","height":182});
															thumbnails[6037488] = clik.newPhoto({"id":6037488,"src":"surfhut_11_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Florida surf hut","height":88});
															thumbnails[6037546] = clik.newPhoto({"id":6037546,"src":"Surfkids_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"surf kids","height":125});
															thumbnails[6040927] = clik.newPhoto({"id":6040927,"src":"Surfkids2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":112});
															thumbnails[6258570] = clik.newPhoto({"id":6258570,"src":"AmericanDream_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":182});
															thumbnails[6275456] = clik.newPhoto({"id":6275456,"src":"selfportrait_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":101});
															thumbnails[6275632] = clik.newPhoto({"id":6275632,"src":"selfportrait_sm_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":101});
															thumbnails[6285824] = clik.newPhoto({"id":6285824,"src":"AmericanDream_A27579D8-1EC9-D45B-1C448D2044EF44EC_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":181});
															thumbnails[5701564] = clik.newPhoto({"id":5701564,"src":"Bugatti23_thumb.jpg","galleries_id":322940,"server_id":32,"link":"photo_5701564.html","width":130,"caption":"BUGATTI TYPE 23 'BRESCIA' POSTER","height":182});
															thumbnails[5701621] = clik.newPhoto({"id":5701621,"src":"BugattiRoyale_thumb.jpg","galleries_id":322940,"server_id":32,"link":"photo_5701621.html","width":130,"caption":"BUGATTI ROYALE TYPE 41 POSTER","height":182});
															thumbnails[5701624] = clik.newPhoto({"id":5701624,"src":"BDLC_thumb.jpg","galleries_id":322974,"server_id":32,"link":"photo_5701624.html","width":130,"caption":"BAL DE LA COUTURE POSTER","height":182});
															thumbnails[5701628] = clik.newPhoto({"id":5701628,"src":"Aston-Gill_thumb.jpg","galleries_id":322967,"server_id":32,"link":"photo_5701628.html","width":130,"caption":"ASTON MARTIN ENGLISH POSTER","height":182});
															thumbnails[5701648] = clik.newPhoto({"id":5701648,"src":"BentleyLeMans_thumb.jpg","galleries_id":322973,"server_id":32,"link":"photo_5701648.html","width":130,"caption":"BENTLEY, LE MANS 1930 POSTER","height":182});
															thumbnails[5701649] = clik.newPhoto({"id":5701649,"src":"RedAston_thumb.jpg","galleries_id":322967,"server_id":32,"link":"photo_5701649.html","width":130,"caption":"RED ASTON MARTIN POSTER","height":182});
															thumbnails[5701653] = clik.newPhoto({"id":5701653,"src":"Nurburgring_thumb.jpg","galleries_id":322970,"server_id":32,"link":"photo_5701653.html","width":130,"caption":"NURBURGRING 1961 POSTER","height":182});
															thumbnails[5701656] = clik.newPhoto({"id":5701656,"src":"Martini_pair_thumb.jpg","galleries_id":322974,"server_id":32,"link":"photo_5701656.html","width":130,"caption":"MARTINI COUPLE POSTER","height":182});
															thumbnails[5701666] = clik.newPhoto({"id":5701666,"src":"Carmen3_thumb.jpg","galleries_id":322974,"server_id":32,"link":"photo_5701666.html","width":130,"caption":"GRAN TEATRO DEL LICEO POSTER","height":181});
															thumbnails[5702592] = clik.newPhoto({"id":5702592,"src":"BUGATTI_GS_thumb.jpg","galleries_id":322940,"server_id":32,"link":"photo_5702592.html","width":130,"caption":"BUGATTI GRAND SPORT POSTER","height":220});
															thumbnails[5702606] = clik.newPhoto({"id":5702606,"src":"COOPER_thumb.jpg","galleries_id":322970,"server_id":32,"link":"photo_5702606.html","width":130,"caption":"BUGATTI OWNERS CLUB OFFICIAL POSTER","height":182});
															thumbnails[5702608] = clik.newPhoto({"id":5702608,"src":"LePurSang_thumb.jpg","galleries_id":322940,"server_id":32,"link":"photo_5702608.html","width":130,"caption":"BUGATTI, LE PUR SANG DES AUTOMOBILES POSTER","height":182});
															thumbnails[5705925] = clik.newPhoto({"id":5705925,"src":"MARTINI_GIRL_thumb.jpg","galleries_id":322974,"server_id":32,"link":"photo_5705925.html","width":130,"caption":"MARTINI GIRL POSTER","height":230});
															thumbnails[5705927] = clik.newPhoto({"id":5705927,"src":"MartiniMan_thumb.jpg","galleries_id":322974,"server_id":32,"link":"photo_5705927.html","width":130,"caption":"MARTINI MAN POSTER","height":230});
															thumbnails[5705943] = clik.newPhoto({"id":5705943,"src":"CadillacGrille_thumb.jpg","galleries_id":323239,"server_id":32,"link":"photo_5705943.html","width":130,"caption":"Cadillac Coupe de Ville Poster (grille). ","height":99});
															thumbnails[5705946] = clik.newPhoto({"id":5705946,"src":"CaddieTail_thumb.jpg","galleries_id":323239,"server_id":32,"link":"photo_5705946.html","width":130,"caption":"1959 Cadillac Coupe de Ville poster(tail)","height":99});
															thumbnails[5711820] = clik.newPhoto({"id":5711820,"src":"1930_Ford_ModelA_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711820.html","width":130,"caption":"Ford Model A Coupe print","height":85});
															thumbnails[5711883] = clik.newPhoto({"id":5711883,"src":"1932_Austin7_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711883.html","width":130,"caption":"1932 Austin 7 Tourer print","height":92});
															thumbnails[5711935] = clik.newPhoto({"id":5711935,"src":"1960_MercedesBenz190SL_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711935.html","width":130,"caption":"1960 Mercedes Benz 190SL print","height":94});
															thumbnails[5711988] = clik.newPhoto({"id":5711988,"src":"Alvis_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711988.html","width":130,"caption":"1925 Alvis 12\/50 print ","height":99});
															thumbnails[5711989] = clik.newPhoto({"id":5711989,"src":"Alvis2_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711989.html","width":130,"caption":"1933 Alvis Speed 20 print","height":86});
															thumbnails[5711991] = clik.newPhoto({"id":5711991,"src":"Austin7_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711991.html","width":130,"caption":"1933 Austin 7 Box Saloon print","height":82});
															thumbnails[5711999] = clik.newPhoto({"id":5711999,"src":"Ford_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5711999.html","width":130,"caption":"1930 Ford Model A print","height":90});
															thumbnails[5712000] = clik.newPhoto({"id":5712000,"src":"JaguarXK120_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5712000.html","width":130,"caption":"1952 Jaguar XK120 print","height":99});
															thumbnails[5712010] = clik.newPhoto({"id":5712010,"src":"Lea-Francis_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5712010.html","width":130,"caption":"1927 'K' Type Lea-Francis print","height":89});
															thumbnails[5712012] = clik.newPhoto({"id":5712012,"src":"MG_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5712012.html","width":130,"caption":"1938 MG VA Tourer print","height":91});
															thumbnails[5712025] = clik.newPhoto({"id":5712025,"src":"Morris_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5712025.html","width":130,"caption":"1921 Bullnose Morris Cowley print","height":90});
															thumbnails[5712027] = clik.newPhoto({"id":5712027,"src":"RileyAlpine_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5712027.html","width":130,"caption":"1932 Riley Alpine print","height":95});
															thumbnails[5712028] = clik.newPhoto({"id":5712028,"src":"XK150_sepia_thumb.jpg","galleries_id":323220,"server_id":32,"link":"photo_5712028.html","width":130,"caption":"1959 Jaguar XK150 'S' print","height":92});
															thumbnails[5719145] = clik.newPhoto({"id":5719145,"src":"Blue_Aston_thumb.jpg","galleries_id":322967,"server_id":32,"link":"photo_5719145.html","width":130,"caption":"BLUE ASTON MARTIN POSTER","height":184});
															thumbnails[5910363] = clik.newPhoto({"id":5910363,"src":"Racer_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910363.html","width":130,"caption":"1961 Cooper Climax photo print","height":105});
															thumbnails[5910366] = clik.newPhoto({"id":5910366,"src":"1926_MorrisOxford_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910366.html","width":130,"caption":"1926 Morris Oxford photo print","height":106});
															thumbnails[5910368] = clik.newPhoto({"id":5910368,"src":"1930_AstonMartin_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910368.html","width":130,"caption":"1930 Aston Martin International photo print","height":100});
															thumbnails[5910422] = clik.newPhoto({"id":5910422,"src":"Bentley2_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910422.html","width":130,"caption":"1930 Bentley Speed Six photo print","height":109});
															thumbnails[5910435] = clik.newPhoto({"id":5910435,"src":"FordA_Coupe-a_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910435.html","width":130,"caption":"Green 1930 Ford Model A photo print","height":90});
															thumbnails[5910440] = clik.newPhoto({"id":5910440,"src":"FordA-Coupe2_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910440.html","width":130,"caption":"1930 Ford Model A photo print","height":89});
															thumbnails[5910450] = clik.newPhoto({"id":5910450,"src":"Jag1_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910450.html","width":130,"caption":"1952 Jaguar XK120 Roadster photo print","height":146});
															thumbnails[5910452] = clik.newPhoto({"id":5910452,"src":"Jag2_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5910452.html","width":130,"caption":"1954 Jaguar XK140 Fixedhead Coupe photo print","height":146});
															thumbnails[5919611] = clik.newPhoto({"id":5919611,"src":"1957Masarati450S_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919611.html","width":130,"caption":"1957 Maserati 450S photo print","height":153});
															thumbnails[5919612] = clik.newPhoto({"id":5919612,"src":"BeachCaddie1_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919612.html","width":130,"caption":"1959 Cadillac On The Beach photo print.","height":130});
															thumbnails[5919613] = clik.newPhoto({"id":5919613,"src":"PinkCaddillac1_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919613.html","width":130,"caption":"Sunshine Cadillac photo print.","height":144});
															thumbnails[5919614] = clik.newPhoto({"id":5919614,"src":"RedCaddie2a_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919614.html","width":130,"caption":"Cadillac Red Rocket photo print.","height":132});
															thumbnails[5919615] = clik.newPhoto({"id":5919615,"src":"RedCadGrille2_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919615.html","width":130,"caption":"Cadillac Loner photo print.","height":162});
															thumbnails[5919616] = clik.newPhoto({"id":5919616,"src":"PinkCadillacFin_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919616.html","width":130,"caption":"Pink Cadillac Tail Fin photo print.","height":185});
															thumbnails[5919620] = clik.newPhoto({"id":5919620,"src":"RedCadillacFin1_thumb.jpg","galleries_id":333584,"server_id":32,"link":"photo_5919620.html","width":130,"caption":"Red Cadillac Tail Fin photo print.","height":224});
															thumbnails[6974416] = clik.newPhoto({"id":6974416,"src":"WisemenPoster1_thumb.jpg","galleries_id":322974,"server_id":32,"link":"photo_6974416.html","width":130,"caption":"Christmas Peace poster","height":181});
															thumbnails[9005803] = clik.newPhoto({"id":9005803,"src":"Alfa_Monza_thumb.jpg","galleries_id":322939,"server_id":32,"link":"photo_9005803.html","width":130,"caption":"ALFA ROMEO 'MONZA' POSTER","height":181});
															thumbnails[5701488] = clik.newPhoto({"id":5701488,"src":"MilleMiglia_thumb.jpg","galleries_id":322939,"server_id":32,"link":"photo_5701488.html","width":130,"caption":"ALFA ROMEO MILLE MIGLIA POSTER","height":182});
															thumbnails[5701411] = clik.newPhoto({"id":5701411,"src":"AlfaLeMans_thumb.jpg","galleries_id":322939,"server_id":32,"link":"photo_5701411.html","width":130,"caption":"ALFA ROMEO LE MANS POSTER","height":182});
															thumbnails[5701491] = clik.newPhoto({"id":5701491,"src":"AlfaPirelli_50x70_thumb.jpg","galleries_id":322939,"server_id":32,"link":"photo_5701491.html","width":130,"caption":"ALFA ROMEO PIRELLI POSTER","height":93});
															thumbnails[5705931] = clik.newPhoto({"id":5705931,"src":"PIRELLI-POSTER_front_thumb.jpg","galleries_id":322939,"server_id":32,"link":"photo_5705931.html","width":130,"caption":"PIRELLI FRONT POSTER","height":148});
															thumbnails[5705935] = clik.newPhoto({"id":5705935,"src":"PIRELLI-POSTER_back_thumb.jpg","galleries_id":322939,"server_id":32,"link":"photo_5705935.html","width":130,"caption":"PIRELLI REAR POSTER","height":148});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[322939] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Alfa Romeo Posters","link":"gallery_322939.html","maxRecords":0.0,"photoIDs":[9005803.0,5701488.0,5701411.0,5701491.0,5705931.0,5705935.0],"skipIndex":0,"section_code":"gallery","featured_images":"9005803,5705935,5705931,5701491,5701488,5701411","id":322939,"singleSection":false});				  						galleries[322940] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bugatti Posters","link":"gallery_322940.html","maxRecords":0.0,"photoIDs":[5701564.0,5701621.0,5702592.0,5702608.0],"skipIndex":0,"section_code":"gallery","featured_images":"5702608,5702592,5701621,5701564","id":322940,"singleSection":false});				  						galleries[322967] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Aston Martin Posters","link":"gallery_322967.html","maxRecords":0.0,"photoIDs":[5701628.0,5701649.0,5719145.0],"skipIndex":0,"section_code":"gallery","featured_images":"5719145,5701649,5701628","id":322967,"singleSection":false});				  						galleries[322970] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cooper Posters","link":"gallery_322970.html","maxRecords":0.0,"photoIDs":[5701653.0,5702606.0],"skipIndex":0,"section_code":"gallery","featured_images":"5702606,5701653","id":322970,"singleSection":false});				  						galleries[322973] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bentley Posters","link":"gallery_322973.html","maxRecords":0.0,"photoIDs":[5701648.0],"skipIndex":0,"section_code":"gallery","featured_images":5701648.0,"id":322973,"singleSection":false});				  						galleries[323239] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cadillac Posters","link":"gallery_323239.html","maxRecords":0.0,"photoIDs":[5705943.0,5705946.0],"skipIndex":0,"section_code":"gallery","featured_images":"5705946,5705943","id":323239,"singleSection":false});				  						galleries[322974] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lifestyle Posters","link":"gallery_322974.html","maxRecords":0.0,"photoIDs":[5701624.0,5701656.0,5701666.0,5705925.0,5705927.0,6974416.0],"skipIndex":0,"section_code":"gallery","featured_images":"6974416,5705927,5705925,5701666,5701656,5701624","id":322974,"singleSection":false});				  						galleries[323220] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"drawings","link":"gallery_323220.html","maxRecords":0.0,"photoIDs":[5711820.0,5711883.0,5711935.0,5711988.0,5711989.0,5711991.0,5711999.0,5712000.0,5712010.0,5712012.0,5712025.0,5712027.0,5712028.0],"skipIndex":0,"section_code":"gallery","featured_images":"5712028,5712027,5712025,5712012,5712010,5712000,5711999,5711991,5711989,5711988","id":323220,"singleSection":false});				  						galleries[333584] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"photographs","link":"gallery_333584.html","maxRecords":0.0,"photoIDs":[5910363.0,5910366.0,5910368.0,5910422.0,5910435.0,5910440.0,5910450.0,5910452.0,5919611.0,5919612.0,5919613.0,5919614.0,5919615.0,5919616.0,5919620.0],"skipIndex":0,"section_code":"gallery","featured_images":"5919620,5919616,5919615,5919614,5919613,5919612,5919611,5910452,5910450,5910440","id":333584,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9005803';
imageSets[3] = '5712028,5712027,5712025,5712012,5712010,5712000,5711999,5711991,5711989,5711988,5711935,5711883,5711820';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/newvintageposters/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/newvintageposters/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 = 'new posters from a golden age: ' + 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="NEWVINTAGEPOSTERS">';
			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;
	}
}

			

