// <!- RandomTextColours Javascript source

/* This script, if placed above the <body> tag, will randomly set the text 
    colours as detailed in the array below.  The colours used have been
    selected as dark colours for text.  Pale shades should be used for background.
     R Scott  9-Jul-2003
 */
 
// Define 'random' numbers
var colcount = 16
var seed = .5;
function srand() 
  {  today = new Date();    
     seed = Math.abs(Math.sin(today.getTime())); }  
function rand()
  {  seed = seed + .3;  
     if (seed > 1.0) seed = seed - 1.0;    
	 return seed; }  
function randnum()
  {  return Math.floor(rand() * colcount); }
srand();

	// Create array of colours
	// Multi word colour names do not work too well unless spaces are omitted
	var Colour = new Array(15)
 	Colour[0] = "DarkOrange"
	Colour[1] = "Green"
	Colour[2] = "Purple"
	Colour[3] = "Brown"
	Colour[4] = "Tomato"
	Colour[5] = "Teal"
	Colour[6] = "Gray"
	Colour[7] = "Olive"
	Colour[8] = "DarkRed"
	Colour[9] = "SeaGreen"
	Colour[10] = "Orchid"
	Colour[11] = "DarkKhaki"
	Colour[12] = "Firebrick"
	Colour[13] = "YellowGreen"
	Colour[14] = "DarkSlateGray"
	Colour[15] = "Goldenrod"

	// Define RndCol for Heading and Text colours
	Random1 = randnum()
	Random2 = ((Random1 + 1) % colcount)
	Random3 = ((Random2 + 1) % colcount)
	Random4 = ((Random3 + 1) % colcount)
	Random5 = ((Random4 + 1) % colcount)

	Random1 = "brown"
	Random2 = "black"
	Random3 = "darkgreen"
	Random4 = "olive"
	Random5 = "DarkOrange"
	

	RndHdCol = Colour[Random1]
	RndTxtCol = Colour[Random2]
	RndTdCol = Colour[Random3]
	RndLinkCol = Colour[Random4]
	RndVlinkCol = Colour[Random5]
	
	RndHdCol = "brown"
	RndTxtCol = "black"
	RndTdCol = "darkgreen"
	RndLinkCol = "olive"
	RndVlinkCol = "DarkOrange"
	
     // Specify style for Headings and Text details
	 document.write('<style type="text/css">')
     document.write('H1, H2, H3, H4, H5 { color: "' + RndHdCol + '"}')
     document.write('TD { color: "' + RndTdCol + '"}')

     document.write('P { color:"' + RndTxtCol + '"}')
     document.write('A:link { color: "' + RndLinkCol + '"}')
     document.write('A:visited { color: "' + RndVlinkCol + '"}')
     document.write('<\/style>')
     // document.write('Headings ' + RndHdCol + '.  Text ' + RndTxtCol + ',  TD text ' + RndTdCol)

	//  End of RandomTextColours Javascript source ->
