function chkForm() {
if((document.contactform.name.value == null) || (document.contactform.name.value == "")) {
      alert("Please enter your name.");
          document.contactform.name.focus();
          return false;
}
if((document.contactform.email.value == null) || (document.contactform.email.value == "")) {
      alert("Please enter your email address.");
          document.contactform.email.focus();
          return false;
}
if ((document.contactform.email.value.indexOf('@') == -1) || (document.contactform.email.value.indexOf('.') == -1)) {
     alert("You must enter a valid email address.");
          document.contactform.email.focus();
          return false;
}
if((document.contactform.subject.selectedIndex==0)) {
      alert("Please select a subject for this email message.");
          document.contactform.subject.focus();
          return false;
}


if((document.contactform.commentschk.checked)) {
        if((document.contactform.comments.value == null) || (document.contactform.comments.value == "")) {
                alert("Please enter your comments for this message.");
                document.contactform.comments.focus();
                return false;
        }
}

}

<!-- display and hide options -->
function agreesubmit(el){
checkobj=el
var browserType;
if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}

switch (el.name){
case "commentschk":
        if ((checkobj.checked == false)) {
                if (browserType == "gecko" )
                        document.poppedLayer = eval('document.getElementById(\'q_comments\')');
                else if (browserType == "ie")
                        document.poppedLayer = eval('document.all[\'q_comments\']');
                else
                        document.poppedLayer = eval('document.layers[\'`q_comments\']');
                        document.poppedLayer.style.display = "none";
                        document.contactform.comments.value = "";
        } else {
                if (browserType == "gecko" )
                        document.poppedLayer = eval('document.getElementById(\'q_comments\')');
                else if (browserType == "ie")
                        document.poppedLayer = eval('document.all[\'q_comments\']');
                else
                        document.poppedLayer = eval('document.layers[\'`q_comments\']');
                        document.poppedLayer.style.display = "block";
        }
        break;

}
}

