function closeme() {
	self.close();
}
function resizewin(w,h) {
	leftwin = (screen.width - w) / 2;
	topwin = (screen.height - h) / 2;
	w = w + 10;
	h = h + 50;
	if (navigator.appName=="Netscape") {
		resizeTo(w,h);
		moveTo(leftwin,topwin);
	} else {
		top.resizeTo(w,h);
		top.moveTo(leftwin,topwin);
	}
}
function fillScreen() {
		moveTo(0,0);
		//windowWidth = screen.width;
		windowWidth = screen.availWidth;
		//windowHeight = screen.height;
		windowHeight = screen.availHeight;
		if (navigator.appName=="Netscape") {
			resizeTo(windowWidth,windowHeight);
		} else {
			top.resizeTo(windowWidth,windowHeight);
		}
}
function findLivePageHeight() {
	if (window.innerHeight) {
		//alert ('uses Inner');
		return window.innerHeight;
		}
	if (document.body.clientHeight) {
		//alert ('uses Client');
		return document.body.clientHeight;
		}
	return (null);
}

function findLivePageWidth() {
	if (window.innerWidth)
		return window.innerWidth;
	if (document.body.clientWidth)
		return document.body.clientWidth;
	return (null);
}
function pageDim() {
	livePageHeight = findLivePageHeight();
	livePageWidth = findLivePageWidth();
	//alert ('Visible Page Width: ' + livePageWidth + 'px; Visible Page Height: ' + livePageHeight + 'px');
}


function findWidth(objectID) {
	var object = document.getElementById(objectID);
	if (object.offsetWidth)
		return object.offsetWidth;
	return (null);
}

function findHeight(objectID) {
	var object = document.getElementById(objectID);
	if (object.offsetHeight)
		return object.offsetHeight;
	return (null);
}
function moveObject(objectID,objw,objh) { // v1.0
	var object = document.getElementById(objectID);
	var w = findLivePageWidth();
	var h = findLivePageHeight();
	//objw = objw / 2; objh = objh / 2;
	h = (h - objh) / 2;
	w = (w - objw) / 2;
	object.style.top = h + 'px';
	object.style.left = w +'px';

	//alert("width "+w+" px");
	//alert("height "+h+" px");
}
function moveObject2(objectID) { // v2.1
	var object = document.getElementById(objectID);
	var objh = findHeight(objectID);
	var objw = findWidth(objectID);
	var screenHeight = screen.height;
	var screenWidth = screen.width;
	var w = findLivePageWidth();
	var h = findLivePageHeight();
	
	if (screenHeight > objh) {
		h = (h - objh) / 2;
		object.style.top = h + 'px';
	}
	w = (w - objw) / 2;
	object.style.left = w +'px';
}
function popUp(URL, w, h) { // main
	day = new Date();
	id = day.getTime();
	var leftwin = (screen.width - w) / 2;
	var topwin = (screen.height - h) / 2;
	eval("page2 = window.open(URL, 'mywin2', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=' + w + ',height=' + h + ',left = ' + leftwin + ',top =' + topwin);");
	//self.close();
}
function popUpmicro(URL) {
	eval("page = window.open(URL, 'mywin', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');");
	//self.close();
}
//==================
function dateMsg() { // Daylong, Month DD, YYYY
	var dayarray=new Array("Sunday","Monday",
						   "Tuesday","Wednesday",
						   "Thursday","Friday",
						   "Saturday");
	var months = new Array("","January", "February",
						   "March", "April", "May", 
						   "June", "July", "August",
						   "September", "October",
						   "November", "December");
	var today = new Date(); // today
	var mon = months[today.getMonth() + 1]; // month
	var day = today.getDate(); // day
	var dayindex=today.getDay();
	var daytxt=dayarray[dayindex]; // day long txt
	var year = y2k(today.getYear()); // year
	return(daytxt + ", " + mon + " " + day + ", " + year); 
}
function todaytxt() { // MM/DD/YYYY
   var Today=new Date();
   return Today.getMonth()+1+"/"+Today.getDate()+"/"+Today.getFullYear();
}
function y2k(year) {
	if (year < 2000)
	year = year + 1900;
	return year;
}
//==============
