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];
		}
	}
}


function getLongDay(intDay) {
	var dayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday",
								 "Thursday", "Friday", "Saturday");
	return dayArray[intDay];
}

function getLongMonth(intMonth) {
	var monthArray = new Array("January", "February", "March",
								   "April", "May", "June",
								   "July", "August", "September",
								   "October", "November", "December");
	return monthArray[intMonth];
}

function getTodaysDate() {
	var today = new Date();
	var ld = today.getDay();
	var dayofweek = getLongDay(ld);
	var d = today.getDate();
	var day = (d < 10) ? '0'+d : d;
	var m = today.getMonth();
	var month = getLongMonth(m);
	var yy = today.getYear();
	var year = (yy < 2000) ? yy + 1900 : yy;
	
	var todayStr = dayofweek +",&nbsp;" + month + " " + day + ", " + year;
	
	return todayStr;
}

var bWinPopupTool = 0;

function popupTool() {
  if(bWinPopupTool == 0) {
    hWinPopupTool = window.open('popupTool.htm', 'hWinPopupTool', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=720,height=420,top=180,left=40');
    bWinPopupTool = 1;
  }
  else {
    if(hWinPopupTool.closed) {
      hWinPopupTool = window.open('popupTool.htm', 'hWinPopupTool', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=720,height=420,top=180,left=40');
    }
    else {
      hWinPopupTool.location.reload();
      hWinPopupTool.focus();
    }
  }
}

function popupWeather(URL, w, t, l) {
   
  day = new Date();
  id = day.getTime();

  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" +w +",top=" +t +",left=" +l +"');");
}

function popup(URL, w, h, t, l) {
   
  day = new Date();
  id = day.getTime();

  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" +w +",height=" +h +",top=" +t +",left=" +l +"');");
}

