function valid_contact()
{
invalidChars_comments = "<'\>"
invalidChars = "'\""
invalidChars_phone = "/\"<>'[]{}%^&zxcvbnm,asdfghjkl:qwertyuiopZXCVBNMASDFGHJKLQWERTYUIOP=_+`~!@#$*"

var fullname = document.contact.fullname.value
var fullnameLength = document.contact.fullname.value.length

if(fullnameLength<2 || fullname=="")
	{
	alert("Please enter your name");
	document.contact.fullname.focus()
	return false
	}

var phone = document.contact.phone.value
if(phone==""){
	   	 alert("Invalid phone number Please check");
		 document.contact.phone.focus()
	     return false
	}

function validEmail(email)
{
var email = document.contact.email.value

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;
  }


 if(!validEmail(document.contact.email.value))
{
    alert("Invalid email addsess")
    document.contact.email.focus()
    document.contact.email.select()
    return false
}

var comments = document.contact.comments.value
var commentsLength = document.contact.comments.value.length

if(comments=="")
	{
	alert("Please enter your messages.");
	document.contact.comments.focus()
	return false
	}
if(comments!="")
	{
	  for(i=0; i<invalidChars_comments.length; i++)
	  {
	    badChar = invalidChars_comments.charAt(i)
	    if(comments.indexOf(badChar,0) > -1)
	   {
	   	 alert("Invalid character(s) " + invalidChars_comments + "\n Please check");
		 document.contact.comments.focus()
	     return false
	   }
	}
	}
if(commentsLength>250)
	{
	alert("Sorry, your message is too long.");
	document.contact.comments.focus()
	return false
	}
}