// n6dhz_header.js

document.write ('<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">');

// STC E-mail Script
document.write ('<SCRIPT SRC="stcllp.js"></SCRIPT>');

// Frame Popout
   if (window != top.window)
   {
   top.window.location = "" + window.location;
   }

var i;

var gsDateMod = new Date(document.lastModified);   
var gbDebugMode = "F";

gnDocuments = 1;
gsCurrentName = document.location.pathname.toLowerCase ();
gasDocumentName = new createDocList (10, '');
gasDocumentTitle = new createDocList (10, '');

gasDocumentName[gnDocuments] = 'index';
gasDocumentTitle[gnDocuments] = 'Home';
gnDocuments++;

gasDocumentName[gnDocuments] = 'qsl';
gasDocumentTitle[gnDocuments] = 'QSL Stuff';
gnDocuments++;

gasDocumentName[gnDocuments] = 'irc-chart';
gasDocumentTitle[gnDocuments] = 'IRC Chart';
gnDocuments++;

gasDocumentName[gnDocuments] = 'n6dhz_search';
gasDocumentTitle[gnDocuments] = 'Log Search';
gnDocuments++;

gasDocumentName[gnDocuments] = 'crash';
gasDocumentTitle[gnDocuments] = '1984 Crash';
gnDocuments++;

gasDocumentName[gnDocuments] = 'station-info';
gasDocumentTitle[gnDocuments] = 'Station Info';
gnDocuments++;

if (gbDebugMode == "T")
{
    document.write ('DEBUG: Current Document -&gt;', gsCurrentName, '&lt;<BR>');
    document.write ('DEBUG: Current Length -&gt;', gsCurrentName.length, '&lt;<BR>');
}

if (gsCurrentName == '/')
{
    gsCurrentName = 'index';
    if (gbDebugMode == "T")
    {
	document.write ('DEBUG: New Document -&gt;', gsCurrentName, '&lt;<BR>');
	document.write ('DEBUG: New Length -&gt;', gsCurrentName.length, '&lt;<BR>');
    }
}
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="50%" Align="Left" VAlign="Middle" BgColor="#0080C8">');
//    document.write ('<TD Width="50%" Align="Left" VAlign="Middle" BackGround="images/bgn-wht-blu.gif">');
    document.write ('<FONT Face="Verdana, Arial, Helvetica" Size="2" COLOR="White">');
    document.write ('<B>The Cyber Ham Shack of N6DHZ</B></FONT><BR>');
    document.write ('<FONT Size=2 Face="Verdana, Arial, Helvetica" COLOR="White">');
    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="40%" Align="Center" VALIGN="middle" BGCOLOR="#0080C8">');
//    document.write ('<TD Width="50%" Align="Right" VALIGN="middle" BackGround="images/bgn-wht-red.gif">');
    document.write ('<FONT face="Verdana, Arial, Helvetica" COLOR="white" SIZE="-3">');
    document.write ('Page updated on:<BR> ');   
    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 Width="80" BGCOLOR="cc0000">');
//	document.write ('<TD Width="80" BackGround="images/bgn-wht-red-1.gif">');
	doc_name = document.location.pathname.toLowerCase ();
//	document.write ('<A HREF="index.html"><FONT SIZE="5" color="white"><B>DX IS</B></FONT></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(\'n6dhz\');">E-mail N6DHZ</A>');
	document.write ('</TD>');

// CLOSE INNER TABLE
	document.write ('</TD></TABLE>');

// CLOSE OUTER TABLE
	document.write ('</TD></TR></TABLE>');
	document.write ('</CENTER>');

	
}

// 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.n6dhz.com/', 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 ('January 1, 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] = 'B12R';
	gasAnnounceLine[gnAnnounceLines] = 'QST QST QST';
	gnAnnounceLines++

	// LINE #1
	gasAnnounceStyle[gnAnnounceLines] = 'B12';
	gasAnnounceLine[gnAnnounceLines] = 'Spam Notice';
	gnAnnounceLines++

	// LINE #2
	gasAnnounceStyle[gnAnnounceLines] = 'B10';
	//gasAnnounceLine[gnAnnounceLines] = 'DX Stations and QSL Managers (outside of USA)';
	gnAnnounceLines++

	// LINE #3
	gasAnnounceStyle[gnAnnounceLines] = 'B10';
	gasAnnounceLine[gnAnnounceLines] = 'If you have received a spam e-mail from an e-mail at this domain you should know it was not sent through nor by the owner of this domain. Some scum sucking spammer (read asshole) has used this domain in their e-mails.';
	gnAnnounceLines++

	// LINE #4
	gasAnnounceStyle[gnAnnounceLines] = 'B10';
	gasAnnounceLine[gnAnnounceLines] = '&nbsp;';
	gnAnnounceLines++

	// LINE #5
	gasAnnounceStyle[gnAnnounceLines] = 'B10';
	gasAnnounceLine[gnAnnounceLines] = 'The solution? Simple, STOP responding to and buying products from spam e-mails. The only reason spam exists is that stupid people buy their products.';
	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="cc0000" 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>');
}



