// date and time javascript
var isnMonths=new Array("1","2","3","4","5","6","7","8","9","10","11","12");
var isnDays= new Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sun");
today=new Date();
var now = new Date();
var day = now.getDay();
var hour = now.getHours();
var minutes = now.getMinutes();
var year = now.getFullYear();
var whathour;
	if (hour == 13) whathour = "1";
	if (hour == 14) whathour = "2";
	if (hour == 15) whathour = "3";
	if (hour == 16) whathour = "4";
	if (hour == 17) whathour = "5";
	if (hour == 18) whathour = "6";
	if (hour == 19) whathour = "7";
	if (hour == 20) whathour = "8";
	if (hour == 21) whathour = "9";
	if (hour == 22) whathour = "10";
	if (hour == 23) whathour = "11";
	if (hour == 0)  whathour = "12";
	if (hour >0 && hour <=12) whathour = hour
var whatminutes;
	if (minutes >=10) whatminutes = minutes
	else whatminutes = ("0" + minutes)
var houraorp = now.getHours();
var amorpm
	if (houraorp <=11) amorpm = "am";
	else amorpm = "pm"


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::			     Mega Popup Window Script       	  :::
// :::::			   Created by Justin Stephenson   		  :::
// :::::			 6/29/01; last revised 06/29/01 		  :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

var megaPopupWin = null;
lastName = null;

function megaPopup(URL,flexType,windowType,width,height,screenHorizPosition,screenVertPosition,stackOrder,temporaryName) {
	if	(screenHorizPosition == 'center')	{ leftPosition = (screen.width) ? (screen.width - width)/2:100; }
		else { leftPosition = screenHorizPosition; }
	if	(screenVertPosition == 'center')	{ topPosition = (screen.height) ? (screen.height - height)/2:100; }
		else { topPosition = screenVertPosition; }
	if (windowType == 'full') { styleAttributes = "toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes"; } else if (windowType == 'basic') { styleAttributes = "toolbar=yes,location=no,directories=no,menubar=no,status=no"; } else if (windowType == 'bare') { styleAttributes = "toolbar=no,location=no,directories=no,menubar=no,status=no"; } else { styleAttributes = "toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes"; }
	if (flexType == 'frozen') { flexAttributes = "scrollbars=no,resizable=no"; } else if (flexType == 'rigid') { flexAttributes = "scrollbars=yes,resizable=no"; } else if (flexType == 'loose') { flexAttributes = "scrollbars=yes,resizable=yes"; } else { flexAttributes = "scrollbars=yes,resizable=yes"; }
	if (width == 'total') { width = screen.width; }
	if (height == 'total') { height = screen.height; }
	// *** consider a browser sniff to serve screenX and screenY to Navigator 4 ***
	windowAttributes = 'width=' + width + ',height=' + height + ',top=' + topPosition + ',left=' + leftPosition + ',' + styleAttributes + ',' + flexAttributes;
	// if the temporary and last names match, the popup is repopulating an existing window; the existing window must be closed to allow its replacement to use new and different style, flexibility, and position attributes
	if (temporaryName == lastName) { if (megaPopupWin != null && !megaPopupWin.closed) { oldWin = megaPopupWin; oldWin.name = "oldWin"; oldWin.close(); } }
	lastName = temporaryName;
	megaPopupWin = window.open(URL,temporaryName,windowAttributes);
	if (stackOrder == 'top') { megaPopupWin.focus(); megaPopupWin.location = URL; }
		else if (stackOrder == 'bottom') { megaPopupWin.blur(); megaPopupWin.location = URL; megaPopupWin.blur(); self.focus(); }
}


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::			   Picture Popup Window Script            :::
// :::::			  Created by Justin Stephenson            :::
// :::::			 09/21/01; last revised 09/21/01          :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

var picPopupWin = null;

function picPopup(URL) {
	width=400;
	height=190;
	leftPosition = (screen.width) ? (screen.width - width)/2:100;
	topPosition = (screen.height) ? (screen.height - height)/2:100;
	picPopupWin = window.open(URL,'photo_loading','width=' + width + ',height=' + height + ',top=' + topPosition + ',left=' + leftPosition + ',toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no');
}


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::				  Closewindow Script		          :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function closeWin()
	{
		this.close();
		PrintWindow = null;
	}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::	      Random Masthead Assignment Script           :::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
var rand1 = 0;
var useRand = 0;
images = new Array;
images[1] = new Image();
images[1].src = "/images/masthead/01.jpg";
images[2] = new Image();
images[2].src = "/images/masthead/02.jpg";
images[3] = new Image();
images[3].src = "/images/masthead/03.jpg";
images[4] = new Image();
images[4].src = "/images/masthead/04.jpg";
images[5] = new Image();
images[5].src = "/images/masthead/05.jpg";
images[6] = new Image();
images[6].src = "/images/masthead/06.jpg";
images[7] = new Image();
images[7].src = "/images/masthead/07.jpg";

function swapMasthead() {
	var imgnum = images.length - 1;

	do {
		var randnum = Math.random();
		rand1 = Math.round((imgnum - 1) * randnum) + 1;
	}
	while (rand1 == useRand);

	useRand = rand1;
	document.masthead.src = images[useRand].src;
}