
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("<p style='text-align:center'><a href='index.htm' target='_top'>Return to Frame Menu</a> -  or - <a href='javascript:history.back()'>Previous Page</a></p>");
	document.write("<table id='topbar' width='100%' align='top' cellpadding='0' cellspacing='0' border='0' bgcolor='#000066'>");
	document.write("<tr valign='top'>");
	document.write("<td align='center'><div id='topnav'><a href='/' target='_top' title='The American Civil War Society (UK) Web Site'>Home</a></div></td>");
	document.write("<td align='center'><div id='topnav'><a href='/about/' target='_top'>About us</a></div></td>");
	document.write("<td align='center'><div id='topnav'><a href='/members/' target='_top'>Members</a></div></td>");
	document.write("<td align='center'><div id='topnav'><a href='/armies/' target='_top'>Regiments</a></div></td>");
	document.write("<td align='center'><div id='topnav'><a href='/archives/' target='_top'>Archives</a></div></td>");
	document.write("<td align='center'><div id='topnav'><a href='/contact/' target='_top'>Feedback</a></div></td>");
	document.write("<td align='right'><form name=dropdown>");
	document.write("<select name='sites' onChange='jumpto(this.form)'>");
	document.write("<option selected>Quick Link");
	document.write("<option>--------------");
	document.write("<option value='/welcome.htm'>Home");
	document.write("<option value='/amazon.htm'>Amazon Store");
	document.write("<option>--------------");
	document.write("<option value='/archives/OnThisDay/index.php'>On This Day");
	document.write("<option>--------------");
	document.write("<option value='/archives/archives.htm'>Archives");
	document.write("<option value='/gilhams/main.htm'>Gilhams Manual");
	document.write("<option value='/historyalive/main.htm'>History Alive!");
	document.write("<option value='/members/news.htm'>Members News");
	document.write("<option value='/nl/nl.htm'>Newsletter");
	document.write("<option value='/armies/regiment.htm'>Regiments");
	document.write("<option value='/sitemap.htm'>Site Map");
	document.write("<option value='/songs/main.htm'>Songs");
	document.write("<option value='/sounds/main.htm'>Sounds");
	document.write("<option value='/images/main.htm'>Images");
	document.write("<option value='/contact/contacts.htm'>Contacts");
	document.write("<option value='/contact/feedback.htm'>Feedback");
	document.write("<option value='/contact/forum.htm'>Forum");
	document.write("<option>--------------");
	document.write("<option value='/about/about.htm'>About ACWS");
	document.write("<option value='/members/attend.htm'>Attendance");
	document.write("<option value='/about/director.htm'>Directors");
	document.write("<option value='/about/events.php'>Events");
	document.write("<option value='/about/links.htm'>Links");
	document.write("<option value='/members/notices.htm'>Notices");
	document.write("<option value='/members/rules.htm'>Rules&amp;Regs");
	document.write("<option value='/members/sales.htm'>Sales");
	document.write("<option value='/members/sutlers.htm'>Sutlers");
	document.write("<option>--------------");
	document.write("<option value='/armies/cs.htm'>Confederates");
	document.write("<option value='/armies/us.htm'>Federals");
	document.write("<option>--------------");
	document.write("</select>");
	document.write("</form>");
	document.write("</td></tr>");
	document.write("</table>");
	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>") }
}
