// bash_sub_header.js
//

// Frame Popout
   if (window != top.window)
   {
   top.window.location = "" + window.location;
   }

var i;

var gsDateMod = new Date(document.lastModified);   

gnMenuItems = 1;
gsCurrentName = document.location.pathname.toLowerCase ();
gasMenuItemName = new createDocList (10, '');
gasMenuItemTitle = new createDocList (10, '');

gasMenuItemName[gnMenuItems] = 'bash_02';
gasMenuItemTitle[gnMenuItems] = '2002 Pictures';
gnMenuItems++;


//gasMenuItemName[gnMenuItems] = '';
//gasMenuItemTitle[gnMenuItems] = '&nbsp;';
//gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_03';
gasMenuItemTitle[gnMenuItems] = '2003 Pictures';
gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_04';
gasMenuItemTitle[gnMenuItems] = '2004 Pictures';
gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_05';
gasMenuItemTitle[gnMenuItems] = '2005 Pictures';
gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_06';
gasMenuItemTitle[gnMenuItems] = '2006 Pictures';
gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_07';
gasMenuItemTitle[gnMenuItems] = '2007 Pictures';
gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_08';
gasMenuItemTitle[gnMenuItems] = '2008 Pictures';
gnMenuItems++;

gasMenuItemName[gnMenuItems] = 'bash_09';
gasMenuItemTitle[gnMenuItems] = '2009 Pictures';
gnMenuItems++;

document.write ('<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">');

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";

// DATA CELL 1,3

// 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>');

	submenuBar();
	
// CLOSE INNER TABLE
	document.write ('</TD></TABLE>');

// CLOSE OUTER TABLE
	document.write ('</TD></TR></TABLE>');
	document.write ('</CENTER>');

}

// MENU BAR
function submenuBar()

{
	var i;

	// CHECK EACH DOCUMENT NAME IN LIST
	for (i = 1; i < gnMenuItems; i++)
	{

		// CHECK IF CURRENT PAGE CONTAINS DOCUMENT #[i]	
		if (gsCurrentName.indexOf (gasMenuItemName[i]) > -1)
		{
			document.write ('<TD Class="SubMenuCurr" Align="center" vAlign="middle">');
			// IF CURRENT DOCUMENT IS THIS DOCUMENT # IN LIST, USE BOLD TITLE
			document.write ('<B>', gasMenuItemTitle[i], '</B>');
		}
		else
		{
			document.write ('<TD Class="SubMenuLink" Align="center" vAlign="middle">');
			// IF CURRENT DOCUMENT IS NOT THIS DOCUMENT # IN LIST, PRINT AS LINK
			document.write ('<A HREF="http://www.scdxc.org/', gasMenuItemName[i], '">', gasMenuItemTitle[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;
}


