// This function opens links in an external window in a standards compliant way.
// To use it, code the link like this:
// 		<a href="document.html" rel="external">external link</a>
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
	     	anchor.target = "_blank";
		}
 	}
}
window.onload = externalLinks;

// Set a form target to a new target.  Use this to open a form in a new window, like this:
// <form action="whatever.php" method="post" onsubmit="return setFormTarget(this, '_blank');">
function setFormTarget(formname, new_target) {
	formname.target = new_target;
}

// Validates required form input fields
function mb_validate(formname) {
	if (formname.poster.value == "") {
		alert("You did not enter your name!");
		formname.poster.focus();
		return false;
	}
	if (formname.message.value == "") {
		alert("You did not enter a message!");
		formname.message.focus();
		return false;
	}
}
