function countchars() {
		 var max = document.getElementById('TX').rows*document.getElementById('TX').cols;
	  	 var myvalue = document.getElementById('TX').value ;
	  	 var mylength = myvalue.length;
	  	 if (mylength > max) {
  		   	 alert ( "\n You have reached the maximum character limit of " +max );
	  	     myvalue = myvalue.substring(0,max) ;
			 document.getElementById('TX').value = myvalue;
		 }
}
	  
function validinput(myForm) { 
	message = ""						/* message buffer */
	t1 = 0								/* error found */
	email = myForm.contact_mail.value	/* input email value */

	if (email =="" ) {					/* IS mail null */
		message += ( "\n * Enter a Valid Email Address")
		t1 = 1 
	}
    if ( t1 == 0 ) {					/* bypass if no email */
	  invalidchars = "/:,;"				/* invalid char in email check */
	  for ( i=0; i<invalidchars.length; i++ ) {
		notval = invalidchars.charAt(i)
		if (email.indexOf(notval,0) > -1 ) {
		message += ( "\n * " + notval + " is not a valid character in an email address \n")
		}
	  }
							/* @ found flag */
	  symbolcheck1 = "@"				/* check that one @ exists */
	  atposition1 = email.indexOf(symbolcheck1,1)
	  if ( atposition1 == -1 ) {
		message +=  (  "\n * " + email + " is not a valid as it does not have a '@' symbol ")
		t1 = 1
	  }
	  if (email.indexOf(symbolcheck1, atposition1+1) > -1 ) {
		message +=  ( "\n * " + email + " is not a valid as it has two '@' symbols in it ")
	  }

	  if ( t1 == 0 ) {		/* only do if @ has been found */
	    symbolcheck2 = "."		/* check that one . exists  after @ */
		atposition2 = email.indexOf(symbolcheck2,1)
		if ( atposition2 == -1 ) {
		   message += ( "\n * " + email + " is not a valid as it does not have a '.' ")
		}
	  } 
	  myForm.contact_mail.focus()
	  myForm.contact_mail.select() 
    }						/* end of no mail bypass */

	if (myForm.contact_comments.value =="" ) {	/* message area is null */
		message += ( "\n * Enter your request in the message area ")
		myForm.contact_comments.focus()
		myForm.contact_comments.select()
	}  

	if (myForm.contact_from.value =="" ) {	/* sender area is null */
		message += ( "\n * Enter your name")
		myForm.contact_from.focus()
		myForm.contact_from.select()
	}  
	
	var myvalue = myForm.contact_comments.value ;
	var mylength = myvalue.length;
	if (mylength > max) {
  	  	 message += ( "\n You have reached the maximum character limit of " +max );
	     myvalue = myvalue.substring(0,max) ;
		 myForm.contact_comments.value = myvalue;
	}
	
	var max = document.getElementById('TX').rows*document.getElementById('TX').cols;
	var myvalue = document.getElementById('TX').value ;
	var mylength = myvalue.length ;
	if (mylength > max) {
  	  	 message += ( "\n * You have reached the maximum character limit of " +max );
	     myvalue = myvalue.substring(0,max) ;
		document.getElementById('TX').value = myvalue;
	}
		
	if ( message != "" ) {
		message1 = "\nPlease correct the following errors found on the form.\n" + message
		alert (message1)
		return false
	}
return true	
}