
  function validEMAIL(email) {
        invalidChars=" /:,;"
        if(email==""){
          return false
          }
          for(i=0;i<invalidChars.length;i++){
          badChar=invalidChars.charAt(i)
          if(email.indexOf(badChar,0)!=-1){
            return false
          }
        }
        atPos=email.indexOf("@",1)
        if(atPos==-1){
          return false
        }
        if(email.indexOf("@",atPos+1)!=-1){
          return false
        }
        periodPos=email.indexOf(".",atPos)
        if(periodPos==-1){
          return false
                }
        if(periodPos+3>email.length){
          return false
              }
        return true
              }


function validCOMMENT(comment) {
        invalidChars="§$%=/#\\'<>´`&"
  
        if(comment==""){
          alert("Please add content to the comment field before sending the form")
          return false
        } 

        for(i=0;i<invalidChars.length;i++){
          badChar=invalidChars.charAt(i)
          if(comment.indexOf(badChar,0)!=-1){
            alert("You must not use special characters (e.g.: #, %, $)  within the comment field")
            return false
            
          }
        }
        return true
     }


function submitIt(form){

       if(!validEMAIL(form.email.value)){
                alert("Please use an accurate email address.")
                form.email.focus()
                form.email.select()
                return false
              }

        if(!validCOMMENT(form.comment.value)){
                form.comment.focus()
                form.comment.select()
                return false
                      }


              return true
      }


