//-----------------------------------------------------------------------------
	var timer1;			//for dateClock
	var timer2;			//for rollover message flasher
	var timeIntrvl1 = 1000;		//1000 = 1 second
	var timeIntrvl2 = 500;		//500 = 1/2 second
	var counter = 1;
	var timeString;
	var dateboxElement;
	var flasherElement;
	var flashPic1 = "IMAGES/butBoxLeft.jpg";
	var flashPic2 = "IMAGES/butBoxLeftMsg.jpg";
//-----------------------------------------------------------------------------
if (document.images) {

	graphic_00 = new Image;
	graphic_01 = new Image;
	graphic_02 = new Image;
	graphic_03 = new Image;
	graphic_04 = new Image;
	graphic_05 = new Image;
	graphic_06 = new Image;
	graphic_07 = new Image;
	graphic_08 = new Image;
	graphic_09 = new Image;
	graphic_10 = new Image;
	graphic_11 = new Image;
	graphic_12 = new Image;
	graphic_13 = new Image;
	graphic_14 = new Image;
	graphic_15 = new Image;

	graphic_00.src = 'IMAGES/homeOff.jpg';
	graphic_01.src = 'IMAGES/homeOn.jpg';
	graphic_02.src = 'IMAGES/aboutOff.jpg';
	graphic_03.src = 'IMAGES/aboutOn.jpg';
	graphic_04.src = 'IMAGES/contactOff.jpg';
	graphic_05.src = 'IMAGES/contactOn.jpg';
	graphic_06.src = 'IMAGES/horlink_0a.jpg';
	graphic_07.src = 'IMAGES/horlink_0b.jpg';
	graphic_08.src = 'IMAGES/horlink_1a.jpg';
	graphic_09.src = 'IMAGES/horlink_1b.jpg';
	graphic_10.src = 'IMAGES/horlink_2a.jpg';
	graphic_11.src = 'IMAGES/horlink_2b.jpg';
	graphic_12.src = 'IMAGES/horlink_3a.jpg';
	graphic_13.src = 'IMAGES/horlink_3b.jpg';
	graphic_14.src = 'IMAGES/horlink_4a.jpg';
	graphic_15.src = 'IMAGES/horlink_4b.jpg';

} else {

	graphic_00 = '';
	graphic_01 = '';
	graphic_02 = '';
	graphic_03 = '';
	graphic_04 = '';
	graphic_05 = '';
	graphic_06 = '';
	graphic_07 = '';
	graphic_08 = '';
	graphic_09 = '';
	graphic_10 = '';
	graphic_11 = '';
	graphic_12 = '';
	graphic_13 = '';
	graphic_14 = '';
	graphic_15 = '';

}
//-----------------------------------------------------------------------------
//explanation of args...
//date: 0 if dateClock off, 1 if on
//flasher: 0 if rollover message flasher off, 1 if on
function runJSTools(date, flasher) {

	if (date) {
		dateboxElement = document.getElementById('datebox');
		timer1 = setInterval("updateTime()", timeIntrvl1);
	}
	if (flasher) {
		flasherElement = document.getElementById('hotbox');
		timer2 = setInterval("flashMessage()", timeIntrvl2);
	}
}
function updateTime() {
	var day, mon, date, year, hour, min, sec, ampm;
	dayName = new Array ('SUN', 'MON', 'TUE', 'WED', 'THU',
		'FRI', 'SAT');
	monName = new Array ('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
		'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC');
	dateObj = new Date;
	day = dayName[dateObj.getDay()];
	mon = monName[dateObj.getMonth()];
	date = dateObj.getDate();
	year = getFormattedYear(dateObj.getYear());
	hour = getFormattedHour(dateObj.getHours());
	min = getFormattedValue(dateObj.getMinutes());
	sec = getFormattedValue(dateObj.getSeconds());
	ampm = getAMPM(dateObj.getHours());
	//Use either the next 2 lines with the 3rd commented OR comment the next 2 lines
	//and use the 3rd...
	//////////timeString = day + ' ' + mon + ' ' + date + ', ' + year;
	//////////timeString = timeString + ' ' + hour + ':' + min + ' ' + ampm;
	timeString = day + ' ' + hour + ':' + min + ' ' + ampm;
	//timeString = day + ' ' + hour + ':' + min + ' ' + ampm;
	dateboxElement.innerHTML = timeString;
}
function flashMessage() {

	if (counter % 2 == 0)
		flasherElement.src = flashPic2;
	else
		flasherElement.src = flashPic1;

	if (counter == 10) {
		clearInterval(timer2);
		startTurnOffMessageDelay();
	}

	counter++;
}
function startTurnOffMessageDelay() {

	timer2 = setTimeout("turnOffMessage()", 3000);
}
function turnOffMessage() {
	
	//alert("Timer Stopped");
	flasherElement.src = flashPic1;	
	clearTimeout(timer2);
}
function getFormattedYear(theYear) {
	if (theYear < 200) {
		theYear += 1900;
	}
	return theYear;
}
function getFormattedHour(rawHour) {
	if (rawHour == 0) {
		return (12);
	}
	if (rawHour < 13) {
		return (rawHour);
	}
	return (rawHour-12);
}
//this func is used for BOTH minutes and seconds
function getFormattedValue(rawValue) {
	if (rawValue < 10) {
		return ('0' + rawValue);
	}
	return (rawValue);
}
function getAMPM(rawHour) {
	if (rawHour < 12) {
		return ('AM');
	}
	return ('PM');
}
function buttonRoll(id, image, mouseCur, status){
	document.getElementById(id).src=image;
	document.getElementById(id).style.cursor=mouseCur;
	window.status=status;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function expand(arg, id) {

	//return 0;

	var coords1 = new Array(2);	//left & top of the thumbnail image
	var coords2 = new Array(2);	//left & top of the footerbox
	var leftCoordAdjustment;
	var topCoord;

	var bigPicWidth;
	var bigPicHeight;
	var src = "../IMAGES/SLIDES/EXPANDED/" + arg + ".jpg";

	var newImage = new Image;
	newImage.src = src;
	bigPicWidth = newImage.width; //don't need this var
	bigPicHeight = newImage.height;
	
	var str = "<img src=" + src + " />";
 	var picbox = document.createElement("div");
	picbox.id = "picturebox";
	document.body.appendChild(picbox);

	//get the thumbnail's position:
	var elem = document.getElementById(id);
	coords1 = findPos(elem);

	//get the max height position:
	var elem2 = document.getElementById("footerbox");
	coords2 = findPos(elem2);

	if ((coords1[1] + bigPicHeight) > coords2[1])
		coords1[1] = coords2[1] - bigPicHeight - 7; //7=approx sum of the borders

	leftCoordAdjustment = coords1[0] + 170;	// added this positioning coord May 3, 2010
	leftCoordAdjustment += "px";
	topCoord = coords1[1] + "px";
	picbox.style.left = leftCoordAdjustment;
	picbox.style.top = topCoord;
	picbox.innerHTML = str;

	var info = "Expanded image size = " + bigPicWidth + " x " + bigPicHeight;
	info += "\n" + "Left = " + leftCoordAdjustment;
	info += "\n" + "Top = " + coords1[1];
	//alert(info);

	if (counter == 11)
		flasherElement.src = flashPic1;
		
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//gets the left & top coords of the object passed in
//this function is from: http://www.quirksmode.org/js/findpos.html 
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function contract() {

	//return 0;

	//AFTER SOME CHECKING IT APPEARS THAT removeChild() TRIGGERS A BUG IN
	//IE v.6.0 -- CAN'T LOCATE A WORKAROUND... fixed! ...see comments below...
	var elem = document.getElementById("picturebox");
	//document.body.removeChild(elem); //works in Mozi, errors in IE
	// fix by Andrian Gorohovschi... only call removeChild if elem is NOT NULL...
	if (elem != null)
		elem.parentNode.removeChild(elem);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
