function checkStr(str){
	var result = true;
	validate = new String(str);
	re = /<|>|&/g;
	if (validate.search(re)>-1){
		alert("Sorry, special characters are not allowed.");
		result=false;
	}
	return result;
}

function isEmailAddr(email){
	var result = false
	var theStr = new String(email)
	var index = theStr.indexOf("@");
	if (index > 0){
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1)){
			result = true;
		}
	}
	return result;
}

function valQuickForm(theForm){
	var result = true;

	if (!checkStr(theForm.first_name.value)){
		theForm.first_name.value="";
		theForm.first_name.focus();
		return (false);
	}
	if (!checkStr(theForm.last_name.value)){
		theForm.last_name.value="";
		theForm.last_name.focus();
		return (false);
	}
	if (!checkStr(theForm.phone_work.value)){
		theForm.phone_work.value="";
		theForm.phone_work.focus();
		return (false);
	}
	if (!checkStr(theForm.email1.value)){
		theForm.email1.value="";
		theForm.email1.focus();
		return (false);
	}
	if (!checkStr(theForm.account.value)){
		theForm.account.value="";
		theForm.account.focus();
		return (false);
	}
	if (!checkStr(theForm.message.value)){
		theForm.message.value="";
		theForm.message.focus();
		return (false);
	}

	if (theForm.last_name.value == "" || theForm.last_name.value == "Name" || theForm.last_name.value == "Last Name"){
		alert("Please enter your Last Name to request information.");
		theForm.last_name.focus();
		return (false);
	}
	if (theForm.phone_work.value == "" || theForm.phone_work.value == "Phone" || theForm.phone_work.value.length < 10 || theForm.phone_work.value.length > 20 ){
		if (theForm.email1.value == ""){
			alert("Please enter either an email address or phone number with area code in the format ###-###-#### to request information.");
			theForm.phone_work.focus();
			return (false);
		}
		if (!isEmailAddr(theForm.email1.value)){
			alert("Please enter either a valid email address or phone number with area code in the format ###-###-#### to request information.");
			theForm.email1.focus();
			return (false);
		}  
	}
  return (true);

}

