function updatecomment() {
     if(document.myform.authorid.value.length==0||
        document.myform.emailaddr.value.length==0||
        document.myform.inst.value.length==0) {
        alert("can not submit form, please provide at least \nyour email and institution, thanks");
        return false;
     }
     var e=/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/.exec(document.myform.emailaddr.value);
     if(e==null){
        alert("invalid email address");
        return false;
     }
     if(document.myform.comment.value.length>1024){
        alert("comment can not be longer than 1024 characters!");
        return false;
     }
     if(document.getElementById('captchaans') && document.getElementById('captchaans').value.length==0){
        alert("You must give the answer to the simple equation in red at the bottom");
        return false;
     }
     var curdate = new Date();
     document.myform.comment.value.replace("<","<");
     document.myform.comment.value.replace(">",">");
        document.myform.text.value="<commblock>\n<author>"+document.myform.authorid.value+"\n";
        document.myform.text.value+="<email>"+document.myform.emailaddr.value+"\n";
        document.myform.text.value+="<inst>"+document.myform.inst.value+"\n";
        document.myform.text.value+="<comment>\n"+document.myform.comment.value+"\n</comment>\n";
     document.myform.text.value+="<timestamp>: "
               +curdate.toString()+"</timestamp>\n</commblock>\n";
        return true;
} function submitform() {
        if(updatecomment()!=false){
            var answer = confirm  ("Thank you for your registration! You will now be redirected to the download site.\n\nYou may have to accept a certificate in your browser in order to browse the secure download page.\n\nPress 'OK' to continue; press 'Cancel' to change your registration form.");
            if(answer)
                document.myform.submit();
        }
} function doemail() {
        document.getElementById("do_email_notify").checked=true;
} window.onload=doemail;
Powered by Habitat