//SCRIPT LANGUAGE="JavaScript"
// woc java script for home auto image 2009


// fnAutoLink - [onload] builds from arrays image+link code to load, aray index from time
//	pElement=division in which to load the html code
//	pImage=style id for img display
//	pCaption=style id for text
//	nFix=index to use (test new entry)
// return=picked url
function fnAutoLink(pElement,pImage,pCaption,nFix)
{
	var aLink = new Array (
// Cecilia
new Array('media/cecilia_albi.jpg', 'cecilia.html', 
	'Cecilia - controvertial adaptation from Chaucer'),
// Change at Crewe
new Array('media/endorse_al.jpg', 'ix_fic.html#change_crewe', '&nbsp;'),
// CJW collaboration
new Array('media/cjw_text_curtain.jpg', 'cjw.html',
	'Collaboration with visual artist Christine Wilkinson'),
// Computer Dating
new Array('media/bcs_fforde.jpg', 'ix_evt.html#bcs_win', 
	'Story wins British Computer Society competition'),
// Corridor Press
new Array('media/corridor_airs_reibl.jpg', 'corridor.html',
	'Airs & Graces book with Corridor Press'),
// Face & Place
new Array('media/fp_119c.jpg', 'fp.html',
	'Ongoing exercise - Face & Place'),
// Family Men
new Array('media/family_bill.jpg', 'ix_fic.html#family_men',
	'Winning poem inspired by my family'),
// Feet First
new Array('media/feet1st_wac_2.jpg', 'ix_prj.html#feet1st',
	'Working with Feet First Dance Theatre'),
// Fiction Recall series
new Array('media/time_matrix_cat.jpg', 'fiction_recall.html',
	'Fiction Recall series of stories'),
// First Move
new Array('media/endorse_cm.jpg', 'ix_fic.html#first_move', '&nbsp;'),
// Fresh After 50
new Array('media/fresh50_ps.jpg', 'ix_evt.html#fresh50_last',
	'Fresh After Fifty - series for Slough Observer'),
// Fresh After 50
new Array('media/endorse_as.jpg', 'ix_prj.html#fresh50', '&nbsp;'),
// Guernica Goodbye
new Array('media/guernica_seesaw.jpg', 'ix_evt.html#seesaw',
	'Guernica Goodbye wins more awards'),
// Her Glass Ceiling
new Array('media/endorse_cc.jpg', 'ix_fic.html#glass_ceiling', '&nbsp;'),
// Landmark Place
new Array('media/landmark_up.jpg', 'landmark.html',
	'Community glasswork with Martin Donlin'),
// Love Locked
new Array('media/love_locked_ledger_3.jpg', 'love_locked.html',
	'My latest novel, the period drama - Love Locked'),
// Mayor & Monkey
new Array('media/mayor_monkey_waterstone.jpg', 'ix_evt.html#waterstones',
	'Live reading for The Mayor and the Monkey'),
// Mirror Mirror
new Array('media/mirror_rgs_04.jpg', 'mirror.html',
	'School&rsquo;s play about drugs - Mirror, Mirror'),
// No Picnic
new Array('media/no_picnic_manet.jpg', 'no_picnic.html',
	'First award winning play - No Picnic'),
// Parallel Kleins
new Array('media/kleins_bottle.jpg', 'fiction_recall.html#klein',
	'Performance story - Parallel Kleins'),
// Relief
new Array('media/relief_women_van.jpg', 'relief.html',
	'Festival play - Relief'),
// RGS
new Array('media/rgs_improvising.jpg', 'rgs.html',
	'Dramaturge at Reading Girls&rsquo; School'),
// RG PI
new Array('media/endorse_jd.jpg', 'ix_scr.html#rg_pi', '&nbsp;'),
// Reviews - Post
new Array('media/rv_post_005.jpg', 'rv_post.html',
	'Drama reviews for Reading Post'),
// Skin Seep
new Array('media/cellar_tattoo.jpg', 'ix_scr.html#skin_deep',
	'Short double play - Skin Deep'),
// Story cellar
new Array('media/cellar_11-fc.jpg', 'cellar.html',
	'Founding editor of Story Cellar magazine'),
// Troubles Along Kennet
new Array('media/love_locked_ww.jpg', 'ix_evt.html#wworld',
	'Troubles Along the Kennet article from research for novel'),
// WOC biog
new Array('media/woc_roses_bike.jpg', 'ix_woc.html',
	'William struggling with a non-writing interest')
		);
	var code_in = '';
	var now = new Date();
	var base = now.getMilliseconds();
	var idx = base % aLink.length;	// modulus is 0 to array index length

	if (nFix >= 0) {idx = nFix };
	code_in = '<a href="' + aLink [idx][1] + '">';
	code_in += '<img class="' + pImage + '" src="' + aLink [idx][0] + '"></a>';
	code_in += '<p class="' + pCaption + '">' + aLink [idx][2] + '</p>';
	document.getElementById(pElement).innerHTML = code_in;
	return;
}

