// JavaScript Document

function validate(form) {

var submitform = true;
var errortext = "Our computronics have computed an error detection (computerly):\n\n";
var url = window.location.href;

if (form.name.value == '') {
submitform = false;
errortext += "- You have to tell us your name.\n";
} else if (form.name.value == 'Name') {
errortext += "- You have to tell us your name.\n";
}

if (form.email.value == '') {
submitform = false;
errortext += "- You have to tell us your email address.\n";
} else if (!form.email.value.match(/^[A-Za-z0-9_-]+([.][A-Za-z0-9_-]+){0,4}[@][A-Za-z0-9_-]+([.][A-Za-z0-9_-]+){1,3}$/)) {
submitform = false;
errortext += "- That can't be your email address. Try a REAL one.\n";
}

if (form.comment.value == 'Share your insightful and witty comment (i.e., "u guyz r fags this aint true")') {
submitform = false;
errortext += "- Try writing your own comment. Just a thought.\n";
}

if (submitform == false) {
alert(errortext);
return false;
}

document.getElementById("url").value = url;

}
