function chk(email)
{
invalid = "";

if (!email)
invalid = "No email address found!  Try reloading the page then use the 'email a script' feature again.";

else {

if ( (email.indexOf("@") == -1) || (email.indexOf(".") == -1) )
invalid += "\n\nInvalid email address.  Your email address is missing an '@' sign and a '.' in the domain name (like '.com').  Please check your address then submit again.";

if (email.indexOf("email") > -1)
invalid += "\n\nInvalid email address.  Make sure your email address included your username, the '@' sign, and the domain name (like '.com').";

if (email.indexOf("\\") > -1)
invalid += "\n\nemail address contains an invalid back-slash (\\) character.  Remove the character and submit again.";

if (email.indexOf("/") > -1)
invalid += "\n\nemail address contains an invalid forward-slash (/) character.  Remove the character and submit again.";

if (email.indexOf("'") > -1)
invalid += "\n\nemail address contains an invalid apostrophe (') character.  Remove the character and submit again.";

if (email.indexOf("zaz.com.br") > -1)
invalid += "\n\nPlease do not use an email address that has an autoresponder set up for it.  Thanks.";

if (email.indexOf("!") > -1)
invalid += "\n\nemail address contains an invalid exclamation point (!) character.  Remove the character or correct the email address then submit again.";

if ( (email.indexOf(",") > -1) || (email.indexOf(";") > -1) )
invalid += "\n\nPlease only enter one email address in the box at a time.  Remove the extra addresses and submit again.";

if (email.indexOf("?subject") > -1)
invalid += "\n\nPlease do not add '?subject=...' to your email address.  Scriptbot will send you the script with a pre-defined subject already.  Please remove the '?subject=...' from your email address and submit again.";
return(invalid);
}
}

function strblank(str1)
{
	if (str1.charAt(0)==' ')                  
	{
		errstr1="can not be Left Blank"
		return false
	}
	if (str1.charAt(str1.length-1)==' ')                  
	{
		errstr1="can not be Right Blank"
		return false
	}
	return true;
}

function post_comments_form_Validator(theForm)
{  
		
  if (theForm.name.value =="")
  {
    alert("Please enter a value for the \"name\" field.");
    theForm.name.focus();
    return (false);
  }
  	
  
	if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }
  else
  {
	theForm_invalid=chk(theForm.email.value);
	if (theForm_invalid!="")
	{
		alert(theForm_invalid);
		theForm.email.focus();
		return(false);
	}	
  }

	if (strblank(theForm.email.value)==false)
	{
		alert("Check Your Email Entry");
		theForm.email.focus();
		return(false);
	}

	
//  if (theForm.date_from.value == "")
//   {
//     alert("Please enter a value for the \"date_from\" field.");
//     theForm.date_from.focus();
//     return (false);
//   } 
//   
//    if (theForm.date_from_months.value == "")
//   {
//     alert("Please enter a value for the \"month\" field.");
//     theForm.date_from_months.focus();
//     return (false);
//   }

//   
//      if (theForm.date_from_years.value == "")
//   {
//     alert("Please enter a value for the \"years\" field.");
//     theForm.date_from_years.focus();
//     return (false);
//   }
//   
//    if (theForm.date_to.value == "")
//   {
//     alert("Please enter a value for the \"date_to\" field.");
//     theForm.date_to.focus();
//     return (false);
//   } 
//      if (theForm.date_to_months.value == "")
//   {
//     alert("Please enter a value for the \"Months\" field.");
//     theForm.date_to_months.focus();
//     return (false);
//   } 
//      if (theForm.date_to_years.value == "")
//   {
//     alert("Please enter a value for the \"years\" field.");
//     theForm.date_to_years.focus();
//     return (false);
//   }  

// 	
// 	
// 	if (theForm.country.value == "")
//   {
//     alert("Please enter a value for the \"country\" field.");
//     theForm.country.focus();
//     return (false);
//   }  
// 	
	
	if (theForm.comments.value == "")
  {
    alert("Please enter a value for the \"comment\" field.");
    theForm.comments.focus();
    return (false);
  }  
  
  if (theForm.code.value == "")
  {
    alert("Please enter a value for the \"Image Code\" field.");
    theForm.code.focus();
    return (false);
  }  
  
  
//   	if (theForm.postdate.value == "")
//   {
//     alert("Please enter a value for the \"postdate\" field.");
//     theForm.postdate.focus();
//     return (false);
//   }
//   
//   	if (theForm.postdate_months.value == "")
//   {
//     alert("Please enter a value for the \"postdate_months\" field.");
//     theForm.postdate_months.focus();
//     return (false);
//   }
//   
//   	if (theForm.postdate_years.value == "")
//   {
//     alert("Please enter a value for the \"postdate_years\" field.");
//     theForm.postdate_years.focus();
//     return (false);
//   }

	
}