// sars_header.js

// Frame Popout
   if (window != top.window)
   {
   top.window.location = "" + window.location;
   }

document.write ('<SCRIPT SRC="stcllp.js"></SCRIPT>');

document.write ('<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">');
   
var i;

var gsDateMod = new Date(document.lastModified);   

gnDocuments = 1;
gsCurrentName = document.location.pathname.toLowerCase ();
gasDocumentName = new createDocList (10, '');
gasDocumentTitle = new createDocList (10, '');

gasDocumentName[gnDocuments] = 'index';
gasDocumentTitle[gnDocuments] = 'Home';
gnDocuments++;

gasDocumentName[gnDocuments] = 'newsroom';
gasDocumentTitle[gnDocuments] = 'The News Room';
gnDocuments++;

gasDocumentName[gnDocuments] = 'users';
gasDocumentTitle[gnDocuments] = 'Users Only';
gnDocuments++;

gasDocumentName[gnDocuments] = 'wwwnews';
gasDocumentTitle[gnDocuments] = 'Qst Qst Qst!!';
gnDocuments++;

gasDocumentName[gnDocuments] = 'guest';
gasDocumentTitle[gnDocuments] = 'Virtual Log';
gnDocuments++;


if (gsCurrentName == '/')
{
    gsCurrentName = '/index';
}
gnCurrentLength = gsCurrentName.length;
gsCurrentPage = gsCurrentName.substring(1, gnCurrentLength);
gsCurrentTitle = document.title + '(' + gsCurrentPage + ')';

var agt=navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);

this.ie = (agt.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major < 4));

this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1))

this.nav4 = (this.nav && (this.major == 4));

if (this.ie3)
{
	document.write ('<TABLE border="0" width="100%" cellpadding=3 cellspacing=0>');
	document.write ('<TR>');
	document.write ('<TD width="700" ALIGN="right" VALIGN="middle">');
    document.write ('<FONT face="Verdana, Arial, Helvetica" COLOR="#000000" SIZE="-3">');

	document.write ('Internet Explorer (old): ', agt, ', ', this.major, ', ', this.minor);
	document.write ('</FONT>');
	document.write ('</TD>');
	document.write ('</TR>');
	document.write ('</TABLE>');
	document.write ('<HR SIZE="1" ALIGN="RIGHT" WIDTH="50%">');
}
else
{
    var DOWArray = new initArray ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");   
    var MOYArray = new initArray ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");   

    var mod_date = new Date (document.lastModified);   

    var hours = mod_date.getHours ();
    var minutes = mod_date.getMinutes ();
    var seconds = mod_date.getSeconds ();

    var timeValue = "" + ((hours > 12) ? hours - 12 : hours);

    var currname = document.location.pathname.toLowerCase ();

    timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
//    timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
    timeValue += (hours >= 12) ? " PM" : " AM";

    document.write ('<TABLE Border="0" Width="100%" CellPadding=3 CellSpacing=0>');
// ROW 1
    document.write ('<TR>');

// DATA CELL 1,1
    document.write ('<TD Width="350" Align="Left" VAlign="Middle" BgColor="Black">');
    document.write ('<FONT Face="Verdana, Arial, Helvetica" COLOR="White">');
    document.write ('<B>N6CRO</B></FONT><BR>');
    document.write ('<FONT Size=2 Face="Verdana, Arial, Helvetica" COLOR="White">');
    document.write ('<B>Sasquatch Amateur Radio System (SARS)</B>');
    document.write ('</FONT>');
    document.write ('</TD>');

    gnYearMod = mod_date.getYear ();
    if ((gnYearMod > 29) && (gnYearMod < 130))
    {
	gnYearMod += 1900
    }
    if (gnYearMod < 30)
    {
	gnYearMod += 2000
    }

    document.write ('<TD Width="600" Align="Right" VALIGN="middle" BGCOLOR="black">');
    document.write ('<FONT face="Verdana, Arial, Helvetica" COLOR="white" SIZE="-3">');
    document.write ('Page updated on: ');   
    if (gnYearMod != 1969)
    {
	// DATA CELL 1,2
	document.write (DOWArray[(mod_date.getDay()+1)], ', ');   
	document.write (MOYArray[(mod_date.getMonth()+1)], ' ');   
	document.write (mod_date.getDate (), ', '); 
	document.write (gnYearMod);
	document.write (', ', timeValue);
    }
    else
    {
	//document.write (document.title);
	document.write (document.frmDocMod.date.value);
    }
 
    document.write ('</FONT>');
    document.write ('</TD>');

// DATA CELL 1,3
	document.write ('<TD BGCOLOR="black">');
	doc_name = document.location.pathname.toLowerCase ();
	document.write ('<A HREF="index.html"><IMG SRC="images/sasfeet2.gif" Width="30" Height="30" ALIGN="bottom" ALIGN="Right" ALT="Home Page"></A>');
	document.write ('</TD>');

    	document.write ('</TR>');
	document.write ('</TABLE>');

	document.write ('<CENTER>');

// CREATE OUTER TABLE WITH A BORDER AND 1 DATA CELL CONTAINING THE INNER TABLE
	document.write ('<TABLE Border="1" Width="100%" CellPadding="0" CellSpacing="0"><TR><TD>');

// CREATE INNER TABLE
	document.write ('<CENTER><TABLE Border="0" Width="100%" CellPadding="3" CellSpacing="0"><TR>');

	menuBar();

// MAILTO LINK
	document.write ('<TD Class="MenuLink" Align="center" vAlign="middle">');

// IF CURRENT DOCUMENT IS NOT THIS DOCUMENT # IN LIST, PRINT AS LINK
	document.write ('<A HREF="javaScript:stcllp(\'n6cro\');">E-mail Us</A>');
	document.write ('</TD>');

// CLOSE INNER TABLE
	document.write ('</TD></TABLE>');

// CLOSE OUTER TABLE
	document.write ('</TD></TR></TABLE>');
	document.write ('</CENTER>');

	if (gsCurrentName.indexOf ("user") == -1)
	{
//		hostAnnounce ();
	}
}

// MENU BAR
function menuBar()
{
	var i;

	// CHECK EACH DOCUMENT NAME IN LIST
	for (i = 1; i < gnDocuments; i++)
	{

		// CHECK IF CURRENT PAGE CONTAINS DOCUMENT #[i]	
		if (gsCurrentName.indexOf (gasDocumentName[i]) > -1)
		{
			document.write ('<TD Class="MenuCurr" Align="center" vAlign="middle">');
			// IF CURRENT DOCUMENT IS THIS DOCUMENT # IN LIST, USE BOLD TITLE
			document.write ('<B>', gasDocumentTitle[i], '</B>');
		}
		else
		{
			document.write ('<TD Class="MenuLink" Align="center" vAlign="middle">');
			// IF CURRENT DOCUMENT IS NOT THIS DOCUMENT # IN LIST, PRINT AS LINK
			document.write ('<A HREF="http://www.sasquatchnet.org/', gasDocumentName[i], '.html">', gasDocumentTitle[i], '</A>');
		}
		document.write ('</TD>');
	}
}

// INITIALIZE ARRAY
function initArray() 
{  
    this.length = initArray.arguments.length;
    for (var i = 0; i < this.length; i++)      
    {
		this[i+1] = initArray.arguments[i];
    }
}   

// REQUIRED JAVASCRIPT FUNCTION TO CREATE ARRAYS/LISTS
function createDocList(n, init)
{
	this.size = n;
	for (i = 1; i <= n; i++)
	{
		this[i] = init;
	}
	return this;
}

function hostAnnounce()
{
	var i = 0;
	var gsExpireDate;
      var gsTodaysDate;
	var gsExpireTest;
	var gsTodaysTest;
	var gnCurYear;
	var gnExpYear;
	var gnExpires;
	var gnCurrent;

      var MONArray = new initArray ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");   

	// STEP:1
	// ENTER ANNOUNCEMENT EXPIRATION DATE IN "Month Date, Year" FORMAT
	// e.g. 'December 31, 1999'
	var gsExpireDate = new Date ('May 9, 2007');

	// ANNOUNCEMENT LINE COUNTER
	var gnAnnounceLines = 0;

	gasAnnounceLine = new createDocList (10, '');
	gasAnnounceStyle = new createDocList (10, '');

	// STEP:1
	// ENTER TEXT AND FONT STYLE FOR AS MANY LINES AS DESIRED
	// FONTS:  B=Bold, I=Italic, 10-18=Point Size
	
	// LINE #0
	gasAnnounceStyle[gnAnnounceLines] = 'B12';
	gasAnnounceLine[gnAnnounceLines] = '<Font Color="#FF0000"><B>QST QST QST</B></Font>';
	gnAnnounceLines++
	
	// LINE #1
	gasAnnounceStyle[gnAnnounceLines] = 'B12';
	gasAnnounceLine[gnAnnounceLines] = 'SILENT KEY';
	gnAnnounceLines++
	
	// LINE #2
	gasAnnounceStyle[gnAnnounceLines] = 'B10';
	gasAnnounceLine[gnAnnounceLines] = 'Thursday April 26';
	gnAnnounceLines++
		
	// LINE #3
	gasAnnounceStyle[gnAnnounceLines] = '10';
	gasAnnounceLine[gnAnnounceLines] = 'It is with heavy hearts that we announce the passing of another Sasquatch.';
	gnAnnounceLines++
	
	// LINE #4
	gasAnnounceStyle[gnAnnounceLines] = '10';
	gasAnnounceLine[gnAnnounceLines] = 'Pat Duffey, N6FFI, was killed Thursday evening April 26th in Whittier, Calif.';
	gnAnnounceLines++

	// LINE #5
	gasAnnounceStyle[gnAnnounceLines] = '10';
	gasAnnounceLine[gnAnnounceLines] = '&nbsp;';
	gnAnnounceLines++
	
	// LINE #6
	gasAnnounceStyle[gnAnnounceLines] = 'B12';
	gasAnnounceLine[gnAnnounceLines] = 'Information on services can be found on the<BR> <A HREF="http://www.sasquatchnet.org/n6ffi.html">N6FFI Memorial Page</A>';
	gnAnnounceLines++

	gsTodaysDate = new Date ();

	if (navigator.appName == ("Netscape"))
	{
		gnCurYear = gsTodaysDate.getYear () + 1900;
		gnExpYear = gsExpireDate.getYear () + 1900;
	}
	else
	{
		gnCurYear = gsTodaysDate.getYear ();
		gnExpYear = gsExpireDate.getYear ();
	}

	gsTodaysTest = MONArray[(gsTodaysDate.getMonth()+1)] + ' ' + gsTodaysDate.getDate () + ', ' + gnCurYear;

	gsExpireTest = MONArray[(gsExpireDate.getMonth()+1)] + ' ' + gsExpireDate.getDate () + ', ' + gnExpYear;

	gnExpires = Date.parse (gsExpireTest);
	gnCurrent = Date.parse (gsTodaysTest);

	if (gnExpires < gnCurrent)
	{
		return
	}

	document.write ('<BR>');

	// OUTER TABLE
	document.write ('<CENTER><TABLE Border="4" CellSpacing="0" Width="50%" BorderColor="Green" BGCOLOR="white"><TR><TD Align="Center">');

	// INNER TABLE
	document.write ('<TABLE Border="0" BgColor="White">');

	for (i = 0; i < gnAnnounceLines; i++)
	{

		document.write ('<TR><TD Align="Center" Class="', gasAnnounceStyle[i], '">');
		document.write (gasAnnounceLine[i]);
		document.write ('</TD></TR>');
	}

	document.write ('</TABLE>');
	document.write ('</TD></TR></TABLE></CENTER>');

	document.write ('<CENTER><FONT Size="-2">');
	document.write ('Announcement Expires after ', gsExpireTest);
	document.write ('</CENTER></FONT><BR>');
}



