	function procLoginForm() {
		var un = document.getElementById('username');
		var pw = document.getElementById('password');
		if (!empty(un) && !empty(pw)) {
			pw.value = hex_md5(pw.value);
			return true;
		} else {
			return false;
		}
	}

	function empty(strCheck) {
		if (strCheck.value.length == 0 || strCheck.value == null) {
			return true;
		} else {
			return false;
		}
	}

	function deletePost($postid) {
		if (confirm("Are you sure you want to delete this post?")) {
			top.location="/?page=admin&delid="+$postid;
		} else {
			return false;
		}
	}

	function highlightBlock(eleID) {
		ele = document.getElementById(eleID);
		ele.oldClass = ele.className;
		ele.className = "calsel";
	}

	function unhighlightBlock(eleID) {
		ele = document.getElementById(eleID);
		ele.className = ele.oldClass;
	}

	function goDate(strDay, strMonth, strYear) {
		strNewUrl = "/?page=calendar&date=" + strMonth + "/" + strDay + "/" + strYear;
		top.location=strNewUrl;
	}

	function toggleAddEventForm() {
		ele = document.getElementById('addform');
		btn = document.getElementById('showbutton');
		if (ele.style.display == 'none') {
			ele.style.display = 'block';
			btn.innerHTML = 'Hide Add Event Form';
		} else {
			ele.style.display = 'none';
			btn.innerHTML = 'Show Add Event Form';
		}
	}

	function deleteCalEvent() {
		return confirm("Are you sure you want to delete this event?");
	}
