function popHelp(hid, webroot) {
	window.open(webroot + "index.php?view=help.pop&nolayout=1&hid=" + hid, "", "width=390,height=400");
	return false;
}
function popInfo(iid, webroot) {
	window.open(webroot + "index.php?view=info.pop&nolayout=1&iid=" + iid, "", "width=500,height=510");
	return false;
}
function localLogin(oForm) {
	oForm.login.value = "1";
	oForm.submit();
}
function sessionCancel(oForm) {
	oForm.cancel.value = "1";
	oForm.submit();
}
function helpoid(hid) {
	if (hid) {
		var divobj = document.getElementById("help_hid_" + hid);
		divobj.style.visibility = "visible";
	} else {
		var divlist = document.getElementsByTagName("div");
		for (var i = 0; i < divlist.length; i ++) {
			if (divlist.item(i).getAttribute("id").substr(0, 4) == "help")
				divlist.item(i).style.visibility = "hidden";
		}
	}
}
function UTCTime() {
   oDate = new Date();
   return "Current Time: " + oDate.toUTCString().replace("GMT", "UTC").substr(5);
}
function Modulus(a, b) {
	return a - (b * Math.floor(a / b));
}
function IsLeapYear(year) {
	var bulis = ((Modulus(year, 4) == 0) && ((Modulus(year, 100) != 0) || (Modulus(year, 400) == 0)));
	return bulis;
}
function HJDDate() {
	oDate = new Date();
	var hours = oDate.getUTCHours();
	var minutes = oDate.getUTCMinutes();
	var seconds = oDate.getUTCSeconds();
	var frac = ((hours * 3600.0) + (minutes * 60.0) + seconds) / 86400.0;
	var year = oDate.getUTCFullYear();
	var month = oDate.getUTCMonth();
	var day = oDate.getUTCDate();
	var GREGORIAN_EPOCH = 1721425.5;
	var hjd = frac + (GREGORIAN_EPOCH - 1) + (365 * (year - 1)) + Math.floor((year - 1) / 4) + (-Math.floor((year - 1) / 100)) + Math.floor((year - 1) / 400) + Math.floor((((367 * month) - 362) / 12) + ((month <= 2) ? 0 : (IsLeapYear(year) ? -1 : -2)) + day);
	return "Current Time: " + hjd.toPrecision(11) + " JD";
}

