/*
 * header.js
 * REQUIRES config.js
 * REQUIRES stclib.js
 * statewidepaint.com
 */

///////////////////////////////////////////////////////////////////////////////
// START: VARIABLES
///////////////////////////////////////////////////////////////////////////////

var i;
var agt = navigator.userAgent.toLowerCase();
var aname = navigator.appName;
var aver = parseInt(navigator.appVersion.substring(0,1));
var mie = false;

var gbAlert = "F";
var gbAnnounceOk = "T";
var gbCookiesOn = "T";
var gbCurrentHome = "F";
var gbDebugMode = "F";
var gbExplorer = false;

var gnAnnLimit = 1;
var gnAnnDays = 1; // NUMBER OF DAYS THE ANNOUNCEMENT COOKIE SHOULD LAST
var gnAnnounceLines = 0;
var gnBrowserVers = parseInt(navigator.appVersion.substring(0,1));
var gnDateEnd;
var gnDateCur;;
var gnDocuments = 1;
var gnYearCur;
var gnYearEnd;

var gasAnnounceLine = new createDocList (10, '');
var gasAnnounceStyle = new createDocList (10, '');
var gasDateEnd;
var gasDocumentName = new createDocList (10, '');
var gasDocumentTitle = new createDocList (10, '');
var gasMenuItems = new Array();

var gsAnnExpires = new Date();
var gsBrowserAgent = navigator.userAgent.toLowerCase();
var gsBrowserName = navigator.appName;
var gsCurrentDoc;
var gsCurrentPath = '';
var gsDateCur = new Date ();
var gsDateModified = new Date (document.lastModified);   
var gsDefaultName = '';
var gsDomainName = "";
var gsDomainURL = "";
var gsIcon = "";
var gsLT_ARROW = '&#9668;';
var gsUP_ARROW = '&#9650;';
var gsRT_ARROW = '&#9658;';

if ((STC_DOMAIN == null) || (STC_DOMAIN == ""))
{
    gsDomainName = window.location.hostname;
    gsDomainURL = 'http://' + window.location.hostname + '/';
    tnPosWWW = gsDomainURL.indexOf ("www."); 
    if (tnPosWWW < 0)
    {
	gsDomainURL = 'http://www.' + window.location.hostname + '/';
    }
}
else
{
    gsDomainName = STC_DOMAIN;
    gsDomainURL = STC_DOMAIN;
    tnPosWWW = STC_DOMAIN.indexOf ("www."); 
    if (tnPosWWW < 0)
    {
	gsDomainURL = 'http://www.' + STC_DOMAIN + '/';
    }
}
var gnDomainLen = gsDomainURL.length;
tnPosWWW = gsDomainName.indexOf ("www."); 
if (tnPosWWW > -1)
{
    gsDomainName = gsDomainName.substring(tnPosWWW + 4, 9999);
}

// CONVERT TO LOWERCASE TO FUNCTION
STC_COMMAND = STC_COMMAND.toLowerCase();

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

String.prototype.tld = function()
{
	return (m = this.match(new RegExp("\.([a-z,A-Z]{2,6})$") )) ? m[1] : false;
}

NS6 = (document.getElementById && !document.all)
IE = (document.all)
NS = (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) == "4")

tempBar = '';
barBuilt = 0;
gasItems = new Array();
moving = setTimeout('null',1)
    
///////////////////////////////////////////////////////////////////////////////
// FINISH: VARIABLES
///////////////////////////////////////////////////////////////////////////////

checkBrowser();

document.write ('<TITLE>' + LOC_SHORT_NAME + '</TITLE>'); 

// ASSUME COOKIES ARE ENABLED, BUT IF NOT, SET FLAG FOR ALL COOKIE-RELATED FUNCTIONS
if (navigator.cookieEnabled == 0) 
{
    gbCookiesOn = "F";
}
if ((STC_STYLE == null) || (STC_STYLE == ""))
{
    gsStyleSheet = gsDomainURL + "include/style.css";
}
else
{
    gsStyleSheet = STC_STYLE;
}
document.write ('<LINK rel=stylesheet href=' + gsStyleSheet + ' type="text/css">');

gbAdminMode = STC_getCookie("Admin");
if (gbAdminMode == "F")
{
    document.write ('<TABLE border=3 bgcolor=Red cellpadding=3 cellspacing=0>');
    document.write ('<TR>');
    document.write ('<TH align=center>');
    document.write ('gbAdminMode='+gbAdminMode);
    document.write ('</TH>');
    document.write ('</TR>');
    document.write ('</TABLE>');
}

if ((LOC_ICON_LOGO == null) || (LOC_ICON_LOGO == ""))
{
    // STANDARD ICON NAME
    gsIcon = "favicon.ico";
}
else
{
    // LOCALLY DEFINED ICON PATH & NAME (config.js)
    gsIcon = LOC_ICON_LOGO;
}
document.write ('<LINK rel="shortcut icon" href="' + gsDomainURL + "/" + gsIcon + '">');

gsCurrentDoc = document.location.href.toLowerCase ();
tsCurrentPath = gsCurrentDoc.substring(gnDomainLen, 9999);// + "/";
tnCurrentPos = tsCurrentPath.indexOf ("/");
gsCurrentPath = tsCurrentPath.substr(0,tnCurrentPos+1);

// TEST IF CURRENT PAGE IS SAME AS DOMAIN (MEANING HOME PAGE) OR...
// IF CURRENT PAGE IS STANDARD HOME PAGE (index.html). 
// THIS WORKS WITH OR WITHOUT "www"
//if ((gsCurrentDoc == gsDomainURL) || (gsCurrentDoc == gsDomainURL + "index.html"))
if ((gsCurrentDoc == gsDomainURL) || (gsCurrentDoc == gsDomainURL + gsCurrentPath + LOC_HOME_PAGE))
{
    gbCurrentHome = "T";
}

gnLenDoc = gsCurrentDoc.length;

gsTLD = window.location.hostname.tld();

gnPosTLD = gsCurrentDoc.indexOf (gsTLD);
gnDocCurrentPos = gsCurrentDoc.indexOf (gsTLD) + 3;

gnPosDoc = gnLenDoc - gnDocCurrentPos;

gsCurrentName = gsCurrentDoc.substr (gnDocCurrentPos, gnPosDoc);
gnDocHostPos = gsCurrentDoc.indexOf ("://www.");
gnDocNamePos = gnDocHostPos + 11;
if (gnDocHostPos > -1)
{
    gnDocHostPos = gsCurrentDoc.indexOf ("://");
    gnDocNamePos = gnDocHostPos + 7;
}

gsDOM = gsCurrentDoc.substr (gnDocNamePos, gnLenDoc - (gnLenDoc - gnPosTLD) - 12);

if (gbDebugMode == "T")
{
    dispDebug();
}

gasDocumentName[gnDocuments] = gsDefaultName + 'wwwnews.html';
gasDocumentTitle[gnDocuments] = 'News';
gnDocuments++;

gasDocumentName[gnDocuments] = gsDefaultName + 'calendar.html';
gasDocumentTitle[gnDocuments] = 'Calendar';
gnDocuments++;

gasDocumentName[gnDocuments] = gsDefaultName + 'photos.html';
gasDocumentTitle[gnDocuments] = 'Photos';
gnDocuments++;

gasDocumentName[gnDocuments] = gsDefaultName + 'odpa_rules.pdf';
gasDocumentTitle[gnDocuments] = 'Rules';
gnDocuments++;

gasDocumentName[gnDocuments] = gsDefaultName + 'members.html';
gasDocumentTitle[gnDocuments] = 'Membership' ;
gnDocuments++;

gsCSSBrow = "def";
if (BrowserDetect.browser == "Firefox")
{
    gsCSSBrow = "mo";
    gsCSSVers = BrowserDetect.version.toString();
    gsCSSVers = gsCSSVers.substring(0,1);
}
else
{
    if (BrowserDetect.browser == "Explorer")
    {
	gsCSSBrow = "ie";
	gsCSSVers = BrowserDetect.version;
    }
}
document.write ('<LINK rel=stylesheet href="' + gsDomainURL + 'include/site-' + gsCSSBrow + gsCSSVers + '.css" type="text/css">');

if (gsCurrentName == '/')
{
    gsCurrentName = '/';
}
gnDocCurrentLength = gsCurrentName.length;
gsCurrentPage = gsCurrentName.substring(1, gnDocCurrentLength);
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));

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 hours = gsDateModified.getHours ();
var minutes = gsDateModified.getMinutes ();
var seconds = gsDateModified.getSeconds ();
var timeValue = "" + ((hours > 12) ? hours - 12 : hours);

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

timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += (hours >= 12) ? " p.m." : " a.m.";

function dispHeader()
{
    document.write ('<DIV id="divHeader" style="border: 0px solid red; background-color: ' + LOC_BG_HEADER + ';">');
    if (LOC_BG_BANNER != "")
    {
	document.write ('<DIV ID=divBanner style="border: 0px solid cyan; background-color: ' + LOC_BG_BANNER + ';">');
    }
    document.write ('<TABLE id=tblBanner class=tiny border="0" width="100%" cellpadding=5 cellspacing=0>');
    document.write ('<TR id=tr1Banner>');

    // DATA CELL 1,1 SHORT NAME
    document.write ('<TD id=td1Banner width=25% align=left valign=middle class=spnBannerLarge style="color: ' + LOC_FG_BANNER + ';">');
    document.write (LOC_SHORT_NAME);
    document.write ('</TD> <!-- td1Banner -->');

    // DATA CELL 1,2 BANNER LOGO
    document.write ('<TD id=td2Banner width=' + LOC_COL_PCT + ' align="center" valign="middle" class="spnBannerLarge" style="color: ' + LOC_FG_BANNER + ';">');
    if (LOC_LARGE_LOGO != "")
    {
	document.write ('<IMG align="bottom" align="left" border=0 src="' + LOC_LARGE_LOGO + '"' + LOC_WIDTH_LOGO + ' title="' + LOC_SHORT_NAME + ' Banner" alt="Small ' + LOC_SHORT_NAME + ' Banner">');
    }
    else
    {
	document.write ('&nbsp;');
    }
    document.write ('</TD> <!-- td2Banner -->');

    // DATA CELL 1,3  UPDATE OR ALT CODE
    document.write ('<TD id=td3Banner width=' + LOC_COL_PCT + ' align="right" valign="middle" class="spnBannerSmall" style="color: ' + LOC_FG_BANNER + ';">');
    if (LOC_UPDATE_TM == "T")
    {
	document.write ('Updated: ');   
	sDay = DOWArray[(gsDateModified.getDay()+1)];
	sMonth = MOYArray[(gsDateModified.getMonth()+1)];
	document.write (sDay.substring(0, 3) + ', ');
	document.write (sMonth.substring(0, 3) + ' ');
	document.write (gsDateModified.getDate (), ', '); 
	if (navigator.appName == ("Netscape"))
	{
	    document.write (gsDateModified.getYear () + 1900);
	}
	else
	{
	    document.write (gsDateModified.getYear ());
	}
 
	document.write (' ', timeValue);
    }
    else
    {
	document.write ('&nbsp;');
    }
    if (LOC_UPDATE_ALT != "")
    {
	document.write ('<BR>');
	document.write ('<SCRIPT src="/scripts/stc_ticker_words.js"></SCRIPT>');
	document.write ('<SCRIPT src="/scripts/stc_ticker_picts.js"></SCRIPT>');
	document.write ('<SCRIPT src="/scripts/stc_ticker.js"></SCRIPT>');
	document.write ('<SCRIPT>STC_dispTickerPicts();</SCRIPT>');
    }

    if ((LOC_UPDATE_TM == "T") && (LOC_CREATE_TM != ""))
    {
	document.write ('<BR>');
    }

    if (LOC_CREATE_TM != "")
    {
	document.write ('Created:&nbsp;' + LOC_CREATE_TM);
    }
    else
    {
	document.write ('&nbsp;');
    }
 
    document.write ('</TD> <!-- td3Banner -->');

    // DATA CELL 1,4 HOME LOGO
    document.write ('<TD id=td4Banner width=5% align=center valign=middle class=spnBannerSmall style="color: ' + LOC_FG_BANNER + ';">');
    doc_name = document.location.pathname.toLowerCase ();
    if (gbCurrentHome == "T")
    {
	if (LOC_SMALL_APP == "")
	{
	    document.write ('&nbsp;&nbsp;<IMG align="bottom" align="left" border=0 src="' + LOC_SMALL_LOGO + '" width=50 title="' + LOC_SHORT_NAME + ' Logo" alt="Small ' + LOC_SHORT_NAME + ' Logo">');
	}
	else
	{
	}
    }
    else
    {
	document.write ('<A class=spnBannerSmall href="/index.html" onmouseover="linkPopIn(\'Return to<BR>' + LOC_SHORT_NAME + ' Home Page\', \'\');" onmouseout="linkPopOff();"><IMG align="bottom" align="left" border=0 src="' + LOC_SMALL_LOGO + '" width=50 title="' + LOC_SHORT_NAME + '" alt="Small ' + LOC_SHORT_NAME + ' Logo"><BR>Home</A>');
    }

    document.write ('</TD> <!-- td4Banner -->');
    document.write ('</TR> <!-- tr1Benner -->');
    document.write ('</TABLE> <!-- tblBanner -->');

    if (LOC_BG_BANNER != "")
    {
	document.write ('</DIV> <!-- divBanner -->');
    }
    if (LOC_HR_HEADER != 0)
    {
	document.write ('<HR id=linHead size=' + LOC_HR_HEADER + '>');
    }
    document.write ('</DIV> <!-- divHeader -->');
}

dispHeader();

function initBody()
{
    document.write ('<DIV ID="divPop"></DIV>');

    document.write ('<DIV id="divBody" style="border: 10px solid red; margin: 0 0 0 0; '); 

    if (LOC_BG_COLOR != "")
    {
	document.write ('background-color: ' + LOC_BG_COLOR + ';');
    }

    if (LOC_PG_BORDER != "")
    {
	document.write (LOC_PG_BORDER);
    }

    if ((LOC_BG_IMAGE != "") && (gbCurrentHome == "T"))
    {
	document.write ('background-image: url(' + LOC_BG_IMAGE + ');');
    }

    document.write ('">');

    if (ns4)
    {
	gsPopStyle = document.divPop
    }
    else if (ns6)
    {
	gsPopStyle = document.getElementById("divPop").style
    }
    else if (ie4)
    {
	gsPopStyle = document.all.divPop.style
    }

    if (ns4)
    {
	document.captureEvents(Event.MOUSEMOVE);
    }
    else
    {
	gsPopStyle.visibility = "visible"
	gsPopStyle.display = "none"
    }

    document.onmousemove = get_mouse;

}

function dispFooter()
{
    document.write ('</DIV> <!-- divBody -->');
    document.write ('<DIV id="divFooter" style="background-color: ' + LOC_BG_FOOTER + ';">');
    if (LOC_HR_FOOTER != 0)
    {
	document.write ('<HR id=linFoot size=' + LOC_HR_FOOTER + '>');
    }

    document.write ('<TABLE id=tblFooter class=tiny bgcolor=' + LOC_BG_FOOTER + ' class=FootLinkBold style="color: ' + LOC_FG_FOOTER + ';" border=0 width="100%" cellpadding=5 cellspacing=0>');
    document.write ('<TR id=tr1Footer>');

    ////////////////////////////////////////////////////////////////////////
    // LT: WEB SERVICE
    document.write ('<TD id=td1Footer width=35% align="left" valign="middle">');
    document.write ('Web <A href="/scripts/partners.php" style="text-decoration: none; color: ' + LOC_FG_FOOTER + '; cursor: text;">Services</A> provided by: <A href="http://www.stcllp.com" target="_blank" title="Internet, Web and E-mail Services by STC Network Systems" style="color: ' + LOC_FG_FOOTER + '; text-decoration: none; cursor: pointer;"> <IMG src="/images/stc.gif" border="0" align="middle" align="right" title="Internet, Web and E-mail Services by STC Network Systems" alt="[STC Star Logo]"><SPAN style="text-decoration: underline;">STC Systems</SPAN></A>');
    document.write ('</TD> <!-- td1Footer -->');
    
    ////////////////////////////////////////////////////////////////////////
    // CT: BUTTONS
    document.write ('<TD id=td2Footer width=30% align="center" valign="middle">');
    if (gbCurrentHome == "F")
    {
	document.write ('<FORM name=frmFoot>');
	document.write ('<BR>');
	document.write ('<INPUT type="Button" name="btnHome" value="' + gsUP_ARROW + '&nbsp;Home" class=button2 onclick="document.location.href=\'' + LOC_HOME_URL + '\';">');
    }
    else
    {
	// IF NO ALTERNATE CODE FOR HOME BUTTON, DISPLAY SPACE
	if ((LOC_HOME_ALT == null) || (LOC_HOME_ALT == ""))
	{
	    document.write ('&nbsp;');
	}
	else
	{
	    document.write (LOC_HOME_ALT);
	}
    }

    document.write ('&nbsp;');
    document.write ('&nbsp;');
    
    // IF NOT ON THE HOME PAGE, DISPLAY BACK BUTTON
    if (gbCurrentHome == "F")
    {
	document.write ('<INPUT type="Button" name="btnBack" value="' + gsLT_ARROW + '&nbsp;Back" class=button2 onclick="history.go(-1);">');
	document.write ('</FORM>');
    }
    else
    {
	// IF NO ALTERNATE CODE FOR BACK BUTTON, DISPLAY SPACE
	if ((LOC_BACK_ALT == null) || (LOC_BACK_ALT == ""))
	{
	    document.write ('&nbsp;');
	}
	else
	{
	    document.write (LOC_BACK_ALT);
	}
    }
    document.write ('</TD> <!-- td2Footer -->');

    ////////////////////////////////////////////////////////////////////////
    // RT: COPYRIGHT NOTICE
    document.write ('<TD id=td3Footer width=35% align="right" valign="middle">');
    tsToday = new Date();
    tsYear = tsToday.getFullYear();
    if (LOC_COPY_YEAR == tsYear)
    {
	document.write ('Copyright &copy; ' + LOC_COPY_YEAR + '&nbsp;' + LOC_LONG_NAME);
    }
    else
    {
	document.write ('Copyright &copy; ' + LOC_COPY_YEAR + '-' + tsYear + '&nbsp;' + LOC_LONG_NAME);
    }
    if (LOC_FOOT_LOGO != "")
    {
	if (gbCurrentHome == "F")
	{
	    document.write ('<A href="' + LOC_HOME_URL + '"><IMG src="' + LOC_FOOT_LOGO + '" width=20 height=20 border=0"></A>');
	}
	else
	{
	    document.write ('<IMG src="' + LOC_FOOT_LOGO + '" width=20 height=20 border=0">');
	}
    }
    document.write ('<A href="email.html"><IMG src="/images/mail_lst.gif" width=1 height=1 border=0 alt="e-mail"></A>');
    document.write ('<A href="members.html"><IMG src="/images/mail_lst.gif" width=1 height=1 border=0 alt="e-mail"></A>');
    document.write ('</TD> <!-- td3Footer -->');

    document.write ('</TR> <!-- tr1Footer -->');

    document.write ('</TABLE> <!-- tblFooter -->');
    document.write ('</DIV> <!-- divFooter -->');
}

// { BEG: COOKIE/ANNOUNCEMENT

gsAnnExpires.setTime(gsAnnExpires.getTime() + (gnAnnDays*24*60*60*1000));

checkCount();

if (gbAnnounceOk == "T")
{
    document.write ('<SCRIPT src="/scripts/stc_ann.js"></SCRIPT>');
}
else
{
    if (gnAnnounceLines > 0)
    {
	document.write ('<TABLE name=tblAnn border=0 width=100%>');
	document.write ('<TR>');
	document.write ('<TD align=Right>');
	document.write ('<IMG border=1 src="/images/megaphone_on.jpg" width=50 onmouseover="linkPopIn(\'Turn<BR>Announcement<BR>On\', \'\');" onmouseout="linkPopOff();" onclick="toggleLimit();" style="cursor: pointer;">');
	document.write ('</TD>');
	document.write ('</TR>');
	document.write ('</TABLE> <!-- tblAnn -->');
    }
}

// } END: COOKIE/ANNOUNCEMENT

///////////////////////////////////////////////////////////////////////////////
// {START: FUNCTIONS
///////////////////////////////////////////////////////////////////////////////

// MENU BAR
function MenuBar(sColor, sMenuBg, sCurrBg, sOverBg, sOverFg)
{
    var i;
    var nWidth;

    nWidth = 100 / gnDocuments;

    document.write ('<TABLE border=1 width="100%">');
    document.write ('<TR>');
    // 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" style="color: ' + sCurrBg + '; background-color: ' + sColor + ';" width="' + nWidth + '%">');
// 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" style="cursor: pointer; color: ' + sColor + '; background-color: ' + sMenuBg + ';" onmouseover="this.style.backgroundColor=\'' + sOverBg + '\'; this.style.color=\'' + sOverFg + '\';" onmouseout="this.style.backgroundColor=\'' + sMenuBg + '\'; this.style.color=\'' + sColor + '\';" onclick="top.window.location.href=\'' + gasDocumentName[i] + '\';" width="' + nWidth + '%">' + gasDocumentTitle[i]);
	    // IF CURRENT DOCUMENT IS NOT THIS DOCUMENT # IN LIST, PRINT AS LINK
	}
	document.write ('</TD>');
    }
    document.write ('</TR>');
    document.write ('</TABLE>');
}

function dispDebug()
{
    document.write ('<TABLE border=3 bgcolor=Yellow cellpadding=3 cellspacing=0>');

    document.write ('<TR>');
    document.write ('<TH align=center ColSpan=2>');
    document.write ('DEBUG - Document Info');
    document.write ('</TH>');
    document.write ('</TR>');

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

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

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

    document.write ('<TR>');
    document.write ('<TD>');
    document.write ('gsDOM');
    document.write ('</TD>');
    document.write ('<TD>');
    document.write (gsDOM + ' (' + gnDocNamePos + ')');
    document.write ('</TD>');
    document.write ('</TR>');

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

    document.write ('<TR>');
    document.write ('<TD>');
    document.write ('location.host');
    document.write ('</TD>');
    document.write ('<TD>');
    document.write (location.host);
    document.write ('</TD>');
    document.write ('</TR>');

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

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

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

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

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

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

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

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

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

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

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

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

    document.write ('<TR>');
    document.write ('<TD>');
    document.write ('gsDomainURL + gsCurrentPath');
    document.write ('</TD>');
    document.write ('<TD>');
    document.write (gsDomainURL + gsCurrentPath);
    document.write ('</TD>');
    document.write ('</TR>');

    document.write ('<TR>');
    document.write ('<TD>');
    document.write ('gsDomainURL + gsCurrentPath + LOC_HOME_PAGE');
    document.write ('</TD>');
    document.write ('<TD>');
    document.write (gsDomainURL + gsCurrentPath + LOC_HOME_PAGE);
    document.write ('</TD>');
    document.write ('</TR>');

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

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

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

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

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

// 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 checkBrowser()
{    
    if (gsBrowserName.indexOf("Internet Explorer")!=-1)
    {
	if (gnBrowserVers >= 4)
	{
	    gbJavaEnabled = navigator.javaEnabled();
	}
	gbExplorer = true;
    }
    if (gsBrowserName.indexOf("Netscape") != -1)
    {
	if (gnBrowserVers >= 4)
	{
	    gbJavaEnabled = navigator.javaEnabled();
	}
    }

    if(aname.indexOf("Internet Explorer")!=-1)
    {
	if(aver >= 4)
	{
	    gbJavaEnabled=navigator.javaEnabled();
	}
	mie = true;
    }
    if(aname.indexOf("Netscape") != -1)
    {
	if(aver >= 4)
	{
	    gbJavaEnabled = navigator.javaEnabled();
	}
    }
}

function HostAnnounce()
{
    var i = 0;

    if ((gsDateBeg == "Invalid Date") || (gsDateBeg == "Invalid Date"))
    {
	return
    }

    if (navigator.appName == ("Netscape"))
    {
	gnYearCur = gsDateCur.getYear() + 1900;
	gnYearEnd = gsDateEnd.getYear() + 1900;
	gnYearBeg = gsDateBeg.getYear() + 1900;
    }
    else
    {
	gnYearCur = gsDateCur.getYear();
	gnYearEnd = gsDateEnd.getYear();
	gnYearBeg = gsDateBeg.getYear();
    }

    gasDateCur = MONArray[(gsDateCur.getMonth()+1)] + ' ' + gsDateCur.getDate () + ', ' + gnYearCur;

    gasDateEnd = MONArray[(gsDateEnd.getMonth()+1)] + ' ' + gsDateEnd.getDate () + ', ' + gnYearEnd;
    gasDateBeg = MONArray[(gsDateBeg.getMonth()+1)] + ' ' + gsDateBeg.getDate () + ', ' + gnYearBeg;

    gnDateBeg = Date.parse (gasDateBeg);
    gnDateEnd = Date.parse (gasDateEnd);
    gnDateCur = Date.parse (gasDateCur);

    if (gnDateBeg > gnDateCur)
    {
	return
    }

    if (gnDateEnd < gnDateCur)
    {
	return
    }

    document.write ('<BR>');
    document.write ('<CENTER>');
    document.write ('<TABLE border=0 width=500><TR><TD align=center><IMG src="/images/nail.gif"></TD></TR></TABLE>');
    // OUTER TABLE
    document.write ('<TABLE border=5 cellspacing=0 width=480 bgcolor="white"><TR><TD align="center">');

    // INNER TABLE

    document.write ('<TABLE border=0 bgcolor="#FFFFFF" width=475>');

    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 ('<TR>');
    document.write ('<TD align=center>');
    document.write ('<IMG border=1 src="/images/megaphone_off.jpg" width=50 onmouseover="linkPopIn(\'Turn<BR>Announcement<BR>Off\', \'\');" onmouseout="linkPopOff();" onclick="toggleLimit();">');
    document.write ('</TD>');
    document.write ('</TR>');

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

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

    document.write ('<CENTER><FONT color=#C0C0C0 size=-2>');
    document.write ('Announcement Valid ', gasDateBeg, ' through ', gasDateEnd);
    document.write ('</CENTER></FONT><BR>');
}

function toggleLimit() 
{
    var tnLimit = STC_getCookie('AnnLimit');
    if (tnLimit == 999)
    {
	tnLimit = 1;
    }
    else
    {
	tnLimit = 999;
    }
    STC_setCookie('AnnLimit', tnLimit, gsAnnExpires);
    location.reload(true);
}

function checkCount() 
{
    var tnCount = STC_getCookie('AnnCount');
    var tnLimit = STC_getCookie('AnnLimit');

    if (gbDebugMode == "T")
    {
	document.write ('<TABLE border=3 bgcolor=Pink cellpadding=3 cellspacing=0>');
	document.write ('<TR>');
	document.write ('<TH align=center>');
	document.write ('DEBUG - Cookie Info');
	document.write ('</TH>');
	document.write ('</TR>');

	document.write ('<TR>');
	document.write ('<TD>');
	document.write ('AnnCount=' + tnCount);
	document.write ('</TD>');
	document.write ('</TR>');

	document.write ('<TR>');
	document.write ('<TD>');
	document.write ('AnnLimit=' + tnLimit);
	document.write ('</TD>');
	document.write ('</TR>');

	document.write ('<TR>');
	document.write ('<TD>');
	document.write ('Lines=' + gnAnnounceLines);
	document.write ('</TD>');
	document.write ('</TR>');

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

    if (tnLimit == null) 
    {
	tnLimit = gnAnnLimit;
	STC_setCookie('AnnLimit', gnAnnLimit, gsAnnExpires);
    }
    if (tnCount == null) 
    {
	tnCount = 1;
	STC_setCookie('AnnCount', tnCount, gsAnnExpires);
    } 
    else 
    {
	tnCount++;
	STC_setCookie('AnnCount', tnCount, gsAnnExpires);
	if (tnCount > tnLimit)
	{
	    gbAnnounceOk = "F";
	}
    }
}

///////////////////////////////////////////////////////////////////////////////
/* LIBRARY: stc_cookie.js */
///////////////////////////////////////////////////////////////////////////////

function STC_getCookie(sName) 
{
  var arg = sName + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) 
  {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return STC_getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}

function STC_getCookieVal(nOffset) 
{
  var sEndstr = document.cookie.indexOf (";", nOffset);
  if (sEndstr == -1)
  sEndstr = document.cookie.length;
  return unescape(document.cookie.substring(nOffset, sEndstr));
}

function STC_setCookie(sName,sValue,nTime,sPath,sDomain,bSecure) 
{
    var argv = STC_setCookie.arguments;
    var argc = STC_setCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;

    var sDate = new Date();

    if (nTime != null)
    {
	// IF LESS THAN 1001, ASSUME DAYS
	if (nTime < 1001)
	{
	    sDate.setTime(sDate.getTime() + (nTime*24*60*60*1000));
	}
	// IF 1000 OR GREATER, ASSUME SECONDS SUBTRACTED FROM 1000
	if (nTime > 1000)
	{
	    nTime -= 1000;
	    sDate.setTime(sDate.getTime() + (nTime*1000));
	}
    }

    document.cookie = sName + "=" + escape (sValue) +
	((nTime == null) ? "" : ("; expires=" + sDate.toGMTString())) +
	((sPath == null) ? "" : ("; path=" + sPath)) +
	((sDomain == null) ? "" : ("; domain=" + sDomain)) +
	((bSecure == true) ? "; secure" : "");
}

function STC_delCookie(sName) 
{
  var gsAnnExpires = new Date();
  gsAnnExpires.setTime(gsAnnExpires.getTime() - 1);
  var cval = STC_getCookie(sName);
  document.cookie = sName + "=" + sName + "; expires=" + gsAnnExpires.toGMTString() + "; path=/";
}

function entity(str, mode) 
{
	str = (str) ? str : "";
	mode = (mode) ? mode : "string";

	var e = document.createElement("div");
	e.innerHTML = str;

	if (mode == "numeric") {
		return "&#" + e.innerHTML.charCodeAt(0) + ";";
	}
	else if (mode == "utf16") {
		var un = e.innerHTML.charCodeAt(0).toString(16);
		while (un.length < 4) un = "0" + un;
		return "\\u" + un;
	}
	else return e.innerHTML;
}

function moveOut() 
{
    if ((NS6||NS)&&parseInt(ssm.left)<0 || IE && ssm.pixelLeft<0) 
    {
	clearTimeout(moving);moving = setTimeout('moveOut()', slideSpeed);slideMenu(10)
    }
    else 
    {
	clearTimeout(moving);moving=setTimeout('null',1)
    }
};
function moveBack() 
{
    clearTimeout(moving);moving = setTimeout('moveBack1()', waitTime)
}

function moveBack1() 
{
    if ((NS6||NS) && parseInt(ssm.left)>(-menuWidth) || IE && ssm.pixelLeft>(-menuWidth)) 
    {
    clearTimeout(moving);moving = setTimeout('moveBack1()', slideSpeed);slideMenu(-10)
    }
    else {clearTimeout(moving);moving=setTimeout('null',1)}
}

function slideMenu(num)
{
    if (IE) {ssm.pixelLeft += num;}
    if (NS||NS6) {ssm.left = parseInt(ssm.left)+num;}
    if (NS) {bssm.clip.right+=num;bssm2.clip.right+=num;}
}

function makeStatic() 
{
    if (NS||NS6) {winY = window.pageYOffset;}
    if (IE) {winY = document.body.scrollTop;}
    if (NS6||IE||NS) 
    {
    if (winY!=lastY&&winY>YOffset-staticYOffset) 
    {
    smooth = .2 * (winY - lastY - YOffset + staticYOffset);}
    else if (YOffset-staticYOffset+lastY>YOffset-staticYOffset) 
    {
    smooth = .2 * (winY - lastY - (YOffset-(YOffset-winY)));}
    else {smooth=0}
    if(smooth > 0) smooth = Math.ceil(smooth);
    else smooth = Math.floor(smooth);
    if (IE) bssm.pixelTop+=smooth;
    if (NS6||NS) bssm.top=parseInt(bssm.top)+smooth
    lastY = lastY+smooth;
    setTimeout('makeStatic()', 1)}
}

function buildBar() 
{
    if(barText.indexOf('<IMG')>-1) 
    { 
	tempBar=barText;
    }
    else
    {
	for (b=0;b<barText.length;b++) 
	{
	    tempBar+=barText.charAt(b)+"<BR>";
	}
    }
    document.write('<TD align="center" rowspan="100" width="'+barWidth+'" bgcolor="'+barBGColor+'" valign="'+barVAlign+'"><P align="center"><FONT face="'+barFontFamily+'" size="'+barFontSize+'" COLOR="'+barFontColor+'"><B>'+tempBar+'</B></font></P></TD>');
    if (gbAlert == "T")
    {
	document.write('<TD align="center" rowspan="100" width="'+barWidth+'" bgcolor="red" valign="'+barVAlign+'"><P align="center"><FONT face="'+barFontFamily+'" size="'+barFontSize+'" color="white"><B>A<BR>l<BR>e<BR>r<BR>t</B></FONT></P></TD>');
    }
}

function initSlide() 
{
    if (NS6){ssm=document.getElementById("thessm").style;bssm=document.getElementById("basessm").style;
    bssm.clip="rect(0 "+document.getElementById("thessm").offsetWidth+" "+document.getElementById("thessm").offsetHeight+" 0)";ssm.visibility="visible";}
    else if (IE) {ssm=document.all("thessm").style;bssm=document.all("basessm").style
    bssm.clip="rect(0 "+thessm.offsetWidth+" "+thessm.offsetHeight+" 0)";bssm.visibility = "visible";}
    else if (NS) {bssm=document.layers["basessm1"];
    bssm2=bssm.document.layers["basessm2"];ssm=bssm2.document.layers["thessm"];
    bssm2.clip.left=0;ssm.visibility = "show";}
    if (menuIsStatic=="yes") makeStatic();
}

function buildMenu() 
{
    gnBoxWidth = 2;

    if (gbAlert == "T")
    {
	gnBoxWidth = 22;
    }

    if (IE||NS6) 
    {
	document.write('<DIV id="basessm" style="visibility:hidden;Position : Absolute ;Left : '+XOffset+' ;Top : '+YOffset+' ;Z-Index : 20;width:'+(menuWidth+barWidth+10)+'"><DIV id="thessm" style="Position : Absolute ;Left : '+(-menuWidth)+' ;Top : 0 ;Z-Index : 20;" onmouseover="moveOut();" onmouseout="moveBack();">');
    }
    if (NS) 
    {
	document.write('<LAYER name="basessm1" top="'+YOffset+'" LEFT='+XOffset+' visibility="show"><ILAYER name="basessm2"><LAYER visibility="hide" name="thessm" bgcolor="'+menuBGColor+'" left="'+(-menuWidth)+'" onmouseover="moveOut();" onmouseout="moveBack();">');
    }
    if (NS6)
    {
	document.write('<TABLE border="0" cellpadding="0" cellspacing="0" width="'+(menuWidth+barWidth+2)+'" bgcolor="'+menuBGColor+'"><TR><TD>')
    }
    document.write('<TABLE border="0" cellpadding="0" cellspacing="1" width="'+(menuWidth+barWidth+gnBoxWidth)+'" bgcolor="'+menuBGColor+'">');
    for(i=0;i<gasMenuItems.length;i++) 
    {
	if(!gasMenuItems[i][3]){gasMenuItems[i][3]=menuCols;gasMenuItems[i][5]=menuWidth-1}
	else if(gasMenuItems[i][3]!=menuCols)gasMenuItems[i][5]=Math.round(menuWidth*(gasMenuItems[i][3]/menuCols)-1);
	if(gasMenuItems[i-1]&&gasMenuItems[i-1][4]!="no"){document.write('<TR>')}
	if(!gasMenuItems[i][1])
	{
	    document.write('<TD bgcolor="'+hdrBGColor+'" height="'+hdrHeight+'" align="'+hdrAlign+'" valign="'+hdrVAlign+'" width="'+gasMenuItems[i][5]+'" colspan="'+gasMenuItems[i][3]+'">&nbsp;<FONT face="'+hdrFontFamily+'" size="'+hdrFontSize+'" color="'+hdrFontColor+'"><B>'+gasMenuItems[i][0]+'</B></FONT></TD>')
	}
	else 
	{
	    if(!gasMenuItems[i][2])gasMenuItems[i][2]=linkTarget;
	    document.write('<TD class=menugrey2 bgcolor="'+linkBGColor+'" onmouseover="this.style.backgroundColor=\''+linkOverBGColor+'\';" onmouseout="this.style.backgroundColor=\''+linkBGColor+'\';" width="'+gasMenuItems[i][5]+'" colspan="'+gasMenuItems[i][3]+'"><ILAYER><LAYER onmouseover="this.style.backgroundColor=\''+linkOverBGColor+'\';" onmouseout="this.style.backgroundColor=\''+linkBGColor+'\';" width="100%" align="'+linkAlign+'"><DIV align="'+linkAlign+'"><FONT face="'+linkFontFamily+'" size="'+linkFontSize+'">&nbsp;<A href="'+gasMenuItems[i][1]+'" target="'+gasMenuItems[i][2]+'" class="gasMenuItems" style="text-decoration: none;">'+gasMenuItems[i][0]+'</DIV></LAYER></ILAYER></TD>')
	}
	if(gasMenuItems[i][4]!="no"&&barBuilt==0)
	{
	    buildBar();
	    barBuilt=1;
	}
	if(gasMenuItems[i][4]!="no")
	{
	    document.write('</TR>');
	}
    }
    document.write('</table>')
    if (NS6){document.write('</TD></TR></TABLE>')}
    if (IE||NS6) {document.write('</DIV> <!-- thessm --> </DIV> <!-- basessm -->')}
    if (NS) {document.write('</LAYER></ILAYER></LAYER>')}
    theleft=-menuWidth;lastY=0;setTimeout('initSlide();', 1)
}

///////////////////////////////////////////////////////////////////////////////
// }FINISH: FUNCTIONS
///////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
/* 
 * {BEG: HTML
 *
    <SCRIPT type="text/javascript">
  	document.write ('Write to ');
  	STC_writeName ('First Last');
  	document.write (', ');
  	STC_writeName ('Position');
	STC_writeLine ('2581', '450', '888', '', '-'); 
	document.write (" -or- ");
	STC_writeLine ('9600', '744', '714', '', '-');
      </SCRIPT>
 *
 * }END HTML
 */


