


var endspan = new Array();
var hi = 0;
var highlength = 7;	//can=longstring.length, 11 here, or x0.62
var longstring = "";
var startred = new Array();
var endred = new Array();
var endblue = new Array();
var endgreen = new Array();

function storymenu()
{
	var s = "";
/*
	s += '<span id="menubar" style="display:">';
	s += '<table border=0 cellpadding=5 cellspacing=0 bgColor="#FFFFFF" width="100%">';
	s += '<tr>';
	s += '<td><SPAN ID="d1" onmouseover="show(this, ds1);" class="menu" style="cursor:default">Science Fiction</SPAN></td>';
	s += '<td><SPAN ID="d2" onmouseover="show(this, ds2);" class="menu" style="cursor:default">Oriental/Asian</SPAN></td>';
	s += '<td><SPAN ID="d3" onmouseover="show(this, ds3);" class="menu" style="cursor:default">Philosophical</SPAN></td>';
	s += '<td><SPAN ID="d4" onmouseover="show(this, ds4);" class="menu" style="cursor:default">Religious</SPAN></td>';
	s += '<td><font color="#0000FF" size=4 face="Verdana, Arial, Helvetica, sans-serif"><b><i><a href="stolist.htm">Martin\'s Short Stories</a></b></i></font></td>';
	s += '<td><SPAN ID="d5" onmouseover="show(this, ds5);" class="menu" style="cursor:default">View</SPAN></td>';
	s += '</tr>';
	s += '</table>';
	s += '</span>';
*/
	s += '<DIV ID="ds1" CLASS="submenu" style="display:none">';
	s += '&nbsp;&nbsp;&nbsp;<a href="12Hz.htm"><span title=" Is mankind\'s Search for Extra Terrestrial Intelligence using the wrong frequency ? ">12 Hz</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="stealth2.htm"><span title=" How the world\'s poorest country outwits the technology of the richest. ">Stealthy No More</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="interlin.htm"><span title=" How the chance discovery of an unwanted computer program made Adrian\'s dreams come true ">Interlin</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="paralleltime.htm"><span title=" Life, death, a parallel universe, love - and back again, or was it just a dream ? ">Parallel Time</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="justintime.htm"><span title=" How to make money from banks by using different time zones ">Just in Time</span></a>&nbsp;';
	s += '<BR>';
	s += '</DIV>';

	s += '<DIV ID="ds2" CLASS="submenu" style="display:none">';
	s += '&nbsp;&nbsp;&nbsp;<a href="stealth2.htm"><span title=" How the world\'s poorest country outwits the technology of the richest. ">Stealthy No More</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="mongfusa.htm"><span title=" A difficult choice for a young woman in China. This rock really exists. ">Mong Fu San</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="wishwell.htm"><span title=" A very determined young woman has to overcome setbacks - and her own mistakes, to get what she wants. ">The Wishing Well</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="swimsuit.htm"><span title=" A misunderstanding about cultural differences nearly leads to disaster ">The Swimsuit</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="3lives.htm"><span title=" Did this lady really know her husband in the life before, and in her life before that ? ">Three Lives</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="2sisters.htm"><span title=" Two Indian sisters in England, and one Englishman. ">Two Sisters</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="engineer.htm"><span title=" Fate, destiny or karma ? ">The Engineer</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="freetahiti.htm"><span title=" Which is better - friendship or love ? Two people eventually find the answer ">Free Tahiti</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="eastwest.htm"><span title=" A Chinese lady and an English man, but tensions mount ">East and West</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="son.htm"><span title=" Traditions die hard when a Chinese family moves to England ">A Son</span></a>&nbsp;';
	s += '<BR>';
	s += '</DIV>';

	s += '<DIV ID="ds3" CLASS="submenu" style="display:none">';
	s += '&nbsp;&nbsp;&nbsp;<a href="2dollars.htm"><span title=" Grinding poverty in a Third World country, honour and the need for money to live ">What does Two Dollars Cost ?</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="lottery.htm"><span title=" A statistically improbable story showing that gambling doesn\'t pay ">Winners, Losers</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="friend.htm"><span title=" Have you ever wanted a special, secret and totally loyal friend ? ">My Special Friend</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="claudia.htm"><span title=" Black woman activist,civil rights leader and social reformer, campaigned in both USA and UK, started the Notting Hill Carnival, died in London 1964 ">Claudia Jones</span></a>&nbsp;';
	s += '<BR>';
	s += '</DIV>';

	s += '<DIV ID="ds4" CLASS="submenu" style="display:none">';
	s += '&nbsp;&nbsp;&nbsp;<a href="mindwars.htm"><span title=" A sceptic discovers that after death there is life, conflict and even romance ">Mind Wars</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="monica.htm"><span title=" A passionate insight into the emotional struggles of a nun ">Sister Monica</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="tarana.htm"><span title=" Two people, two religions, and each seeing the failings of their own and the strengths of the other\'s ">Tarana</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="womanwel.htm"><span title=" The Bible story in John 4 - from the woman\'s point of view ">The Woman by the Well</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="youngold.htm"><span title=" About giving advice to the younger generation ">The Young Man and the Old Man</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="andsinnomore.htm"><span title=" The Bible story in John 8:3-11 - from the woman\'s point of view ">... and Sin No More</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="unchanged.htm"><span title=" Sometimes we can still be recognised from a long distant past ">Unchanged</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="modestique.htm"><span title="  ">Modestique</span></a>&nbsp;';
	s += '<BR>';
	s += '&nbsp;&nbsp;&nbsp;<a href="lukegospel.htm"><span title=" Is there really an earlier gospel of Saint Luke waiting to be discovered ? ">Another Gospel of Saint Luke ? </span></a>&nbsp;';
	s += '<BR>';
	s += '</DIV>';
/*
	s += '<DIV ID="ds5" CLASS="submenu" style="display:none">';
	s += '<span onClick="viewmenu(';
	s += 'reading';
	s += ')" style="cursor:default">';
	s += '&nbsp;&nbsp;&nbsp;Reading&nbsp;';
	s += '</span>';
	s += '<BR>';
	s += '<span onClick="viewmenu(';
	s += 'printing';
	s += ')" style="cursor:default">';
	s += '&nbsp;&nbsp;&nbsp;Printing&nbsp;';
	s += '</span>';
	s += '<BR>';
	s += '</DIV>';
*/
	document.write(s);
}

function readingprintingmenu()
{
	var s = "";

	//document.write(s);
}

function highlightletter()	//hi at end of highlight, green at first, blue highlight, red finally
{
	var slongred = "";
	var slongblue = "";
	var slonggreen = "";

	if (hi <= longstring.length + highlength)
		hi++;

	if (hi <= highlength)
	{
		endred[1] = 0;
		endblue[1] = hi;
	}
	if ( (hi > highlength) && (hi <= endspan[1]) )
	{
		endred[1] = hi - highlength;
		endblue[1] = hi;
	}
	if ( (hi > endspan[1] ) && (hi <= endspan[1] + highlength) )
	{
		endred[1] = hi - highlength;
		endblue[1] = endspan[1];
		endblue[2] = hi;
	}
	if ( (hi > endspan[1] + highlength) && (hi <= endspan[2] ) )
	{
		endred[1] = endspan[1];
		endred[2] = hi - highlength;
		endblue[2] = hi;
	}
	if ( (hi > endspan[2] ) && (hi <= endspan[2] + highlength) )
	{
		endred[2] = hi - highlength;
		endblue[2] = endspan[2];
		endblue[3] = hi;
	}	
	if ( (hi > endspan[2] + highlength) && (hi <= endspan[3] ) )
	{
		endred[2] = endspan[2];
		endred[3] = hi - highlength;
		endblue[3] = hi;
	}
	if ( (hi > endspan[3] ) && (hi <= endspan[3] + highlength) )
	{
		endred[3] = hi - highlength;
		endblue[3] = endspan[3];
		endblue[4] = hi;
	}

	if ( (hi > endspan[3] + highlength) && (hi <= endspan[4] ) )
	{
		endred[3] = endspan[3];
		endred[4] = hi - highlength;
		endblue[4] = hi;
	}
	if ( (hi > endspan[4] ) && (hi <= endspan[4] + highlength) )
	{
		endred[4] = hi - highlength;
		endblue[4] = endspan[4];
		//endblue[5] = hi;	//omit last one
	}

	for (var n = 1; n <= numberofspans; n++)
	{
		slongred = longstring.substring(startred[n], endred[n]);	//start, end
		slongblue = longstring.substring(endred[n], endblue[n]);	//start, end
		slonggreen = longstring.substring(endblue[n], endspan[n]);	//start, end
		slongred = slongred.replace(/ /gi, "&nbsp;");	// g=global in string, i=insensitive case
		slongblue = slongblue.replace(/ /gi, "&nbsp;");	// g=global in string, i=insensitive case
		slonggreen = slonggreen.replace(/ /gi, "&nbsp;");	// g=global in string, i=insensitive case
		document.getElementById("span" + n + "red").innerHTML = slongred;
		document.getElementById("span" + n + "blue").innerHTML = slongblue;
		document.getElementById("span" + n + "green").innerHTML = slonggreen;
	}
}

function settimeout()	//n = word number
{
	var wordarray = new Array();
	wordarray[0] = 0;
	endspan[0] = 0;

	var longstringlength = 0;

	var timeinterval = 50;	//between each character, 30 okay at Buchan, 40 good for P166
	var elapsedtime = 1000;	//start delay

	for (var n = 1; n <= numberofspans; n++)
	{
		wordarray[n] = document.getElementById("span" + n + "green").innerHTML;
		endspan[n] = endspan[n - 1] + wordarray[n].length;
		longstring += wordarray[n];	//must be global
		startred[n] = endspan[n - 1];
		endred[n] = endspan[n - 1];
		endblue[n] = endspan[n - 1];
		endgreen[n] = endspan[n];
	}

	for (var n = 1; n <= longstring.length + highlength; n++)
	{
		elapsedtime += timeinterval;
		setTimeout('highlightletter()', elapsedtime );	//function variable arguments must be global
	}
}

function zviewmenu(mode)
{
	if (mode == "reading")
	{
		document.bgColor = "FFFFDD";	//ok
		menubar.style.display = "";
		title.style.color = "0000FF";
		maintext.style.color = "800000";
		email.style.display = "";
		forreading.style.display = "none";
	}
	if (mode == "printing")
	{
		document.bgColor = "FFFFFF";
		menubar.style.display = "none";
		title.style.color = "000000";
		maintext.style.color = "000000";
		email.style.display = "none";
		forreading.style.display = "";
	}
}

function zbeforeinsidepageloads()
{
}

function zafterinsidepageloads()
{
}

function websitedesignby()	//uses webdata.js   030304
{
	//alert(window.location);
	var localsite = '/0our/chorus/';	//change this directory
	var endslice = 0;
	endslice = localsite.length + 10;
	var s = "";

	var winloc = window.location + "";	//file:///C:/0our... IE  file:///C|/0our... NN  locks without + ""
	if ( (winloc.substring(0, 9) == "file:///C") && (winloc.substring(10, endslice) == localsite) )
	{
		//s += '<A HREF=' + localpublishaddress + '>';
		//s += '<span title=" Get PUBLISHED on the WWW for only £48 ! ">';
	}
	else
	{
		//s += '<A HREF=' + webpublishaddress + '>';
		//s += '<span title=" Get PUBLISHED on the WWW for only £48 ! ">';
	}

	//s += '<FONT COLOR="#0000FF">Website</FONT></span></A> design by ';
	s += '<span title=" ';
	s += martinemail;
	s += ' ">';
	s += '<A HREF="mailto:';
	s += martinemail;
	s += '?subject=' + document.URL + ' ">';  //ok
	//s += '<span title=" Tel 01223 860150 ">';
	//s += '<FONT COLOR="#0000FF">Martin</FONT></span></A>';
	s += '<FONT COLOR="#0000FF">e-mail</FONT></span></A>';
	document.write(s);
}

var cm=null;
document.onclick = new Function("show(null)")

function whenleaveinsidepage()
{
}

function whenleaveinsidepage()
{
}

function viewmenu(mode)
{
	if (mode == "reading")
	{

//<h2 style=font-size: 35pt; color: lime; line-height:


		document.bgColor = "FFFFDD";	//ok
		//document.color = "0000DD";
		//document.forecolor = "0000DD";
		//document.text = "0000DD";
		//text = "0000DD";
		menubar.style.display = "";
		title.style.color = "0000FF";
		maintext.style.color = "800000";
		email.style.display = "";
		forreading.style.display = "none";
		span1red.style.color = "FF0000";
	}
	if (mode == "printing")
	{	
		document.bgColor = "FFFFFF";		
		menubar.style.display = "none";		
		title.style.color = "000000";		
		maintext.style.color = "000000";		
		email.style.display = "none";		
		forreading.style.display = "";		
		span1red.style.color = "000000";
		//title.style.color = "000000";
	}
}

function getPos(el,sProp)
{
	var iPos = 0;
	while (el!=null)
	{
		iPos+=el["offset" + sProp];
		el = el.offsetParent;
	}
	return iPos;
}
function show(el,m)
{
	if (m)
	{
		m.style.display='';
		m.style.pixelLeft = getPos(el,"Left")
		m.style.pixelTop = getPos(el,"Top") + el.offsetHeight
	}
	if ((m!=cm) && (cm))
		cm.style.display='none';
	cm=m;
}

function zwebsitedesignby()	//uses webdata.js   030304
{
	//alert(window.location);
	var localsite = '/0our/chorus/';	//change this directory
	var endslice = 0;
	endslice = localsite.length + 10;
	var s = "";

	var winloc = window.location + "";	//file:///C:/0our... IE  file:///C|/0our... NN  locks without + ""
	if ( (winloc.substring(0, 9) == "file:///C") && (winloc.substring(10, endslice) == localsite) )
	{
		//s += '<A HREF=' + localpublishaddress + '>';
		//s += '<span title=" Get PUBLISHED on the WWW for only £48 ! ">';
	}
	else
	{
		//s += '<A HREF=' + webpublishaddress + '>';
		//s += '<span title=" Get PUBLISHED on the WWW for only £48 ! ">';
	}

	//s += '<FONT COLOR="#0000FF">Website</FONT></span></A> design by ';
	s += '<span title=" ';
	s += martinemail;
	s += ' ">';
	s += '<A HREF="mailto:';
	s += martinemail;
	s += '?subject=' + document.URL + ' ">';  //ok
	//s += '<span title=" Tel 01223 860150 ">';
	//s += '<FONT COLOR="#0000FF">Martin</FONT></span></A>';
	s += '<FONT COLOR="#0000FF">e-mail</FONT></span></A>';
	document.write(s);
}

