/**
* Validate Javascript.
* For web programming CSci
* October 02, 2004
*/
function checkEmail(){
        email = document.form.email.value;
        if(email == ''){
                return invalid("Please enter your email (name@domain.end)");
        }
        return true;
}
/**
* Validate Javascript.
* For web programming CSci
* October 02, 2004
*/
function checkSubject(){
        subject = document.form.subject.value;
   		if (subject.length < 5){
                  return invalid("Your subject length is too small (5+)");
          }
        return true;
}


/**
* Validate Javascript.
* For web programming CSci
* October 02, 2004
*/
function checkDescription(){
        description = document.form.description.value;
		if (description.length < 10){
				 return invalid("Your description is too short (10+ characters)");
		}
        return true;
}


function invalid($msg){
        alert($msg);
        return false;
}

function validate(){
  if(!checkEmail()) return false;
  if(!checkSubject()) return false;
   if(!checkDescription()) return false;
    
  
   
   
  
  return true;

}
