
if ((top == self) || (top.frames[0].name == "frame")) writeHeader();

var currentDate = new Date();
var currentYear = currentDate.getYear();
if (currentYear < 1000) currentYear+= 1900;
var currentMonth = currentDate.getMonth()
var currentDay = currentDate.getDate()

var oldcolour=-1;
function onMouseOver()
{
	if(event.srcElement.tagName == "A")
	{	oldcolour = event.srcElement.style.color;
		event.srcElement.style.color = "#FF0000";
	}
	window.event.cancelBubble = true;
}
function onMouseOut()
{
	if (oldcolour!=-1)
	{	if(event.srcElement.tagName == "A")
		{	event.srcElement.style.color = oldcolour;
		}
		window.event.cancelBubble = true;
	}
}
function Init()
{
		document.linkColor = '#0000FF';
		document.vlinkColor = '#800080';
		document.alinkColor = '#FF0000';
//	if (navigator.appName == "Netscape")
//	{	document.linkColor = '#0000FF';
//		document.vlinkColor = '#800080';
//		document.alinkColor = '#FF0000';
//	}
//	else
//	{	document.onmouseout = onMouseOut;
//		document.onmouseover = onMouseOver;
//	}
}
function jumpto(form)
{
	var vIndex=form.sites.selectedIndex;
	var vUrl= form.sites.options[vIndex].value;
	if (!((vUrl == '') || (vUrl == '#')))
	{
	self.location=vUrl
  }
}
function writeHeader()
{
// if (top == self) self.location.replace("index.htm");
	document.write("<div id='wrapper'>");
	document.write("<div id='topnav'>");
	document.write("<style media='all' type='text/css'>@import '/menu_style.css';</style>");
	document.write("<div class='menu'>");
	document.write("<ul>");
	document.write("<li><a href='/index.php'>Home</a>");
	document.write("<ul>");
	document.write("<li><a href='/welcome.php'>Welcome</a>");
	document.write("</ul>");
	document.write("</li>");
	document.write("<li><a href='/about/index.php?page=about&dir='>About Us</a>");
	document.write("<ul>");
	document.write("<li><a href='/about/index.php'>About Index</a></li>");
	document.write("<li><a href='/about/index.php?page=about1&dir='>Re-enactment</a></li>");
	document.write("<li><a href='/about/index.php?page=about2&dir='>More About Us</a></li>");
	document.write("<li><a href='/about/index.php?page=about3&dir='>How to Join</a></li>");
	document.write("<li><a href='/about/index.php?page=britain&dir='>Britain and the ACW</a></li>");
	document.write("<li><a href='/about/index.php?page=director&dir='>ACWS Directors</a></li>");
	document.write("<li><a href='/about/index.php?page=links&dir='>Links to Sites</a></li>");
	document.write("</ul>");
	document.write("</li>");
	document.write("<li><a href='/about/index.php?page=events&dir='>Events</a>");
	document.write("</li>");
	document.write("<li><a href='/historyalive/index.php?page=alive&dir='>Hire Us</a>");
	document.write("<ul>");
	document.write("<li><a href='/historyalive/index.php?page=alive&dir='>History Alive!</a></li>");
	document.write("<li><a href='/historyalive/index.php?page=britain&dir='>Britain and ACW</a></li>");
	document.write("<li><a href='/historyalive/index.php?provide=alive&dir='>What We Provide</a></li>");
	document.write("<li><a href='/historyalive/index.php?page=safety&dir='>Event Safety</a></li>");
	document.write("<li><a href='/historyalive/index.php?page=doforyou&dir='>What We Can Do</a></li>");
	document.write("</ul>");
	document.write("</li>");
	document.write("<li><a href='/members/index.php'>Members</a>");
	document.write("<ul>");
	document.write("<li><a href='/members/attend.htm'>Attendance</a></li>");
	document.write("<li><a href='/members/download.htm'>Downloads</a></li>");
	document.write("<li><a href='/members/forum.htm'>Forum</a></li>");
	document.write("<li><a href='/about/index.php?page=about3&dir='>How to Rejoin</a></li>");
	document.write("<li><a href='/members/news.htm'>Latest News</a></li>");
	document.write("<li><a href='/members/lottery.htm'>Lottery</a></li>");
	document.write("<li><a href='/members/index.php?dir=notices'>Notices</a></li>");
	document.write("<li><a href='/members/rules.htm'>Rules &amp; Regs</a></li>");
	document.write("<li><a href='/armies/regiment.htm'>Regiments</a></li>");
	document.write("</ul>");
	document.write("</li>");
	document.write("<li><a href='/archives/index.php'>Archives</a>");
	document.write("<ul>");
	document.write("<li><a href='/archives/index.php?dir=biography'>Biography</a></li>");
	document.write("<li><a href='/archives/index.php?dir=history'>History</a></li>");
	document.write("<li><a href='/archives/index.php?dir=reenact'>Re-enacting</a></li>");
	document.write("<li><a href='/archives/index.php?dir=military'>Military</a></li>");
	document.write("<li><a href='/archives/index.php?dir=misc'>Misc</a></li>");
	document.write("<li><a href='/nl/index.htm'>Newsletters</a></li>");
	document.write("</ul>");
	document.write("</li>");
	document.write("<li><a href='/images/index.htm'>Multi-Media</a>");
	document.write("<ul>");
	document.write("<li><a href='/images/index.htm'>Images/Photos</a></li>");
	document.write("<li><a href='/sounds/index.htm'>Sounds</a></li>");
	document.write("<li><a href='/songs/index.htm'>Songs</a></li>");
	document.write("<li><a href='/images/video.htm'>Videos</a></li>");
	document.write("</ul>");
	document.write("</li>");
	document.write("<li><a href='/contact/index.php?page=contactus'>Contact Us</a>");
	document.write("<ul>");
	document.write("<li><a href='/contact/index.php?page=contacts'>Contacts List</a></li>");
	document.write("</ul>");
	document.write("</li>");
	document.write("</ul>");
	document.write("</div>");

	document.write("<br>");
	document.write("</div>");
//	document.write("<script type='text/javascript' language='JavaScript' src='leftbar.js'></SCRIPT>");

	if(typeof WriteLeftBar == 'function')
	{
		WriteLeftBar();
	}

//	WriteLeftBar();
	return;
}
function WriteCopywright()
{
  document.write("Copyright &copy; 1996-"+currentYear+" ACWS Ltd. &amp; Mike Bussey");
   return;
}
function WriteXmas()
{
  if ((currentMonth == 11)&&(currentDay > 15))
  {
  	document.write("<p style='text-align: center; font-size: 20; font-weight: bold; color:red'>")
  	document.write("<img src='images/xmas_tree.jpg' width=129 height=200 valign='bottom' align='left'>")
  	document.write("<img src='images/xmas_tree.jpg' width=129 height=200 valign='bottom' align='right'>")
  	document.write("Seasons Greetings<br>To all our Members and Guests")
  	document.write("<br><img src='images/xmas_santa.jpg' width=150 height=116 valign='bottom'>")
  	document.write("<a href='http://www.myfreeclipart.com/christmas.html' target='_blank'><div style='font-size:6pt'>Xmas Graphics from <I>My Free Clipart</I></a></div>")
  	document.write("</p>");
  }
  else
	  if ((currentMonth == 0)&&(currentDay < 10))
	  {
		document.write("<p style='text-align: center; font-size: 20; font-weight: bold; color:green'>Happy New Year<br>To all our Members and Guests</p>");
	  }
  else
  if ( (currentMonth == 10) && (currentDate.getDay() == 4) && (currentDay >= 22) && (currentDay <= 28) )
  {
	document.write("<p style='text-align: center'>")
	document.write("<img src='images/thanksgiving.jpg' width=300 height=210 valign='bottom' align='center'>")
	document.write("</p>");
  }

  return;
}
function ConvertDate(argDate)
{
  var dayofweek= argDate.getDate();
  var thisyear = argDate.getYear();
  if (thisyear < 50)   thisyear = thisyear + 2000;
  if (thisyear < 2000) thisyear = thisyear + 1900;
  return(GetDayString(argDate.getDay()).substring(0,3) +", "+ GetMonthString(argDate.getMonth()).substring(0,3)+" "+ dayofweek+", "+ thisyear + "");
}
function ConvertDateDDMMMYYYY(argDate)
{
  var dayofweek= argDate.getDate();
  var thisyear = argDate.getYear();
  if (thisyear < 50)   thisyear = thisyear + 2000;
  if (thisyear < 2000) thisyear = thisyear + 1900;
  return(dayofweek + "-" + GetMonthString(argDate.getMonth()).substring(0,3)+"-"+ thisyear);
}
function WriteDate()
{
  document.write(ConvertDate(currentDate));
  return;
}
function WriteDateDDMMMYYYY()
{
  document.write(ConvertDateDDMMMYYYY(currentDate));
  return;
}
function WriteDateLastMod(LastModDefault)
{
  lastmod = document.lastModified;
  lastmoddate = Date.parse(lastmod);
  moddate = new Date(lastmod);
  if(lastmoddate == 0)
	 document.write(LastModDefault)
  else
  	if (navigator.appVersion >= "4")
  	{
  	document.write(ConvertDate(moddate));
  	}
	else
	{
	document.write(lastmod);
	}
  return;
}
function GetDayString(s)
{
var days = new Array(8);
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
return days[s+1];
}
function GetMonthString(s)
{
var months = new Array(13);
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
return months[s+1];
}

function linkGetter()
{
msgWindow=window.open("","msg","width=400,height=400,scrollbars=yes,resizable=yes")
msgWindow.document.write("There are " + document.links.length + " links on this page<BR>")
for (var i = 0; i < document.links.length; i++)
	{ msgWindow.document.write("<a href='"+document.links[i]+"' target='_blank'>"+document.links[i] + "</A><BR>") }
}

