// Java Document
function validate_state(field,alerttxt)
{
with (field)
{
if(value =='AK'||value =='CA'||value =='HI'||value =='NV')
{alert(alerttxt);return false;}
else {return true;}
}
}
function validate_checkbox(field,alerttxt) 
{
with(field){
if(field.checked ==false)  {alert(alerttxt);return false;}
else {return true;}
}
}
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}
function validate_required(field,alerttxt)
{
with (field)
{
  if (value==null||value=="")
  {
  alert(alerttxt);return false;
  }
  else
  {
  return true;
  }
}
} 
function validate_phone(field)
{
with (field){
var error = "";
if (value == "") {
   error = "You didn't enter a phone number.\n";
}
var stripped = value.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
    if (isNaN(parseInt(stripped))) {
       error = "The phone number contains illegal characters.";
    }
    if (!(stripped.length >= 10)) {
	error = "The phone number is the wrong length. Make sure you included an area code.\n";
    } 
	else value = stripped;
	}
if(error!=""){
alert(error); 
return false;
}
else return true;
}