// -------------------------------------------
//-close popup windows 0-j when parent unloads
// -------------------------------------------
function closeWindows(j)
{
	for(i=0; i<=j; i++)
	if (win[i]) win[i].close();
}
// ------------------------------------------
// get todays date
// ------------------------------------------
var today = new Date();

var months = new Array();
months[0] = "January";
months[1] = "February";
months[2] = "March";
months[3] = "April";
months[4] = "May";
months[5] = "June";
months[6] = "July";
months[7] = "August";
months[8] = "September";
months[9] = "October";
months[10] = "November";
months[11] = "December";

var month = today.getMonth();
var date = today.getDate();
var year = today.getYear();
if (year <= 1999) year += 1900; 
var todaysDate= months[month] + " " + date + ", " + year; 

//Menu Components
var validBrowser = false;
activate = false; //make sure page is fully loaded before activating menus

if (navigator.userAgent.substring(0,9) == "Mozilla/4") validBrowser = true;

var govcnt = 0;

function openMenu(menu, link){

	if(validBrowser) {
		if (activate) {
			displayMenu(menu); 
		}
		else {
			history.go(0);
                }
	}
	else {
		location.href = link;
	}
}
//-----------------------------------------
// PreLoad Images
//-----------------------------------------

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;

function preloadImages() {
	if (document.images) {
		about_us_over = newImage("images2/about_us-over.gif");
		tech_support_over = newImage("images2/tech_support-over.gif");
		sitemap_over = newImage("images2/sitemap-over.gif");
		preloadFlag = true;
	}
}

// -------------------------------------------------
// Pop Up Info Box
// -------------------------------------------------

/*
 * infobox.js - Information in style.
 *
 * :tabSize=4:indentSize=4:noTabs=false:
 * :folding=explicit:collapseFolds=1:
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the 
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

var posX;	// Mouse X position
var posY;	// Mouse Y position
 
// Listen for mouse move events so we can get the mouse position.
document.onmousemove = getMousePos;

/**
 * Function: getMousePos
 *
 * Retrieves the position of the mouse cursor and sets the values of posX
 * and posY.
 */

function getMousePos(e)
{
	if (!e) var e = window.event;
	
	if (e.pageX || e.pageY)
	{	// Mozilla.
		posX = e.pageX;
		posY = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		if (document.documentElement && document.documentElement.scrollTop)
		{	// IE6 "standards compliance" mode. Heh.
			posX = e.clientX + document.documentElement.scrollLeft;
			posY = e.clientY + document.documentElement.scrollTop;
		}
		else
		{	// IE5, Opera, etc.
			posX = e.clientX + document.body.scrollLeft;
			posY = e.clientY + document.body.scrollTop;
		}
	}
}

/**
 * Function: infoBoxOn
 *
 * Displays an infobox at the location of the mouse cursor.
 *
 * Parameters:
 *
 *     source  - Source element.
 *     content - HTML content to be displayed in the infobox.
 */ 

function infoBoxOn(source, content)
{
	var infobox = document.getElementById("infoBox");
	
	infobox.innerHTML = content;
	
	infobox.style.left    = (posX + 25) + "px";
	infobox.style.top     = posY + "px";
	infobox.style.display = "block";
}

/**
 * Function: infoBoxOff
 *
 * Turns the infobox off.
 */

function infoBoxOff()
{
	var infobox = document.getElementById("infoBox");
	
	infobox.style.display = "none";
}

