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

var date_time = document.estimate.date_time.value

if(date_time=="")
	{
	alert("Please enter your request date and time.");
	document.estimate.date_time.focus()
	return false
	}
	
var fullname = document.estimate.fullname.value
var fullnameLength = document.estimate.fullname.value.length

if(fullnameLength<2 || fullname=="")
	{
	alert("Please enter your name");
	document.estimate.fullname.focus()
	return false
	}
if(fullname!="")
	{
	  for(i=0; i<invalidChars.length; i++)
	  {
	    badChar = invalidChars.charAt(i)
	    if(fullname.indexOf(badChar,0) > -1)
	   {
	   	 alert("Invalid character(s) " + invalidChars + "\n Please check");
		 document.estimate.fullname.focus()
	     return false
	   }
	}
	}
var phone = document.estimate.phone.value

if(phone=="")
	{
	alert("Please enter your phone number.");
	document.estimate.phone.focus()
	return false
	}
	
if(phone!="")
	{
	  for(i=0; i<invalidChars_phone.length; i++)
	  {
	    badChar = invalidChars_phone.charAt(i)
	    if(phone.indexOf(badChar,0) > -1)
	   {
	   	 alert("Invalid phone number please check.");
		 document.estimate.phone.focus()
	     return false
	   }
	}
	}


function validEmail(email)
{
var email = document.estimate.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.estimate.email.value))
{
    alert("Invalid email addsess")
    document.estimate.email.focus()
    document.estimate.email.select()
    return false
}

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

if(comments=="")
	{
	alert("Please enter your messages.");
	document.estimate.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.estimate.comments.focus()
	     return false
	   }
	}
	}
if(commentsLength>250)
	{
	alert("Sorry, your messages must less then 249 chrs.");
	document.estimate.comments.focus()
	return false
	}
}