// icom.js
//

var i;

gnDocuments = 1;
gsCurrentName = document.location.pathname.toLowerCase ();
gasDocumentName = new createDocList (10, '');
gasDocumentTitle = new createDocList (10, '');

gasDocumentName[gnDocuments] = '#hf';
gasDocumentTitle[gnDocuments] = 'HF Radios &amp; Amplifiers';
gnDocuments++;

gasDocumentName[gnDocuments] = '#D-STAR';
gasDocumentTitle[gnDocuments] = 'D-STAR &amp; Satellite';
gnDocuments++;

gasDocumentName[gnDocuments] = '#mobile';
gasDocumentTitle[gnDocuments] = 'UHF/VHF Mobiles';
gnDocuments++;

gasDocumentName[gnDocuments] = '#handheld';
gasDocumentTitle[gnDocuments] = 'Handhelds';
gnDocuments++;

gasDocumentName[gnDocuments] = '#gov';
gasDocumentTitle[gnDocuments] = 'Gov/Export Only';
gnDocuments++;

gasDocumentName[gnDocuments] = '#acc';
gasDocumentTitle[gnDocuments] = 'Accessories';
gnDocuments++;

if (gsCurrentName == '/')
{
    gsCurrentName = '/index.html';
}
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) ? " p.m." : " a.m.";

	document.write ('<CENTER>');

	// CREATE OUTER TABLE WITH A BORDER AND 1 DATA CELL CONTAINING THE INNER TABLE
	document.write ('<TABLE Border="1" Width="900" CellPadding="0" CellSpacing="0"><TR><TD>');

	// CREATE INNER TABLE
	document.write ('<CENTER><TABLE Border="0" Align="Center" Width="100%" CellPadding="3" CellSpacing="0"><TR>');

	menuNews();

	// CLOSE INNER TABLE
	document.write ('</TD></TABLE>');
	// CLOSE OUTER TABLE
	document.write ('</TD></TR></TABLE>');
	document.write ('</CENTER>');

}

// MENU BAR
function menuNews()
{
	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="BirdCurr" 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="BirdLink" Align="center" vAlign="middle">');
			// IF CURRENT DOCUMENT IS NOT THIS DOCUMENT # IN LIST, PRINT AS LINK
			document.write ('<A Class="BirdLink" HREF="', gasDocumentName[i], '">', 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;
}




