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 valForm(theForm){
	if (!checkStr(theForm.invest_amount.value)){
		theForm.invest_amount.value="$";
		theForm.invest_amount.focus();
		return (false);
	}
	if (!checkStr(theForm.name.value)){
		theForm.name.value="";
		theForm.name.focus();
		return (false);
	}
	if (!checkStr(theForm.phone1.value)){
		theForm.phone1.value="";
		theForm.phone1.focus();
		return (false);
	}
	if (!checkStr(theForm.phone2.value)){
		theForm.phone2.value="";
		theForm.phone2.focus();
		return (false);
	}
	if (!checkStr(theForm.fax.value)){
		theForm.fax.value="";
		theForm.fax.focus();
		return (false);
	}
	if (!checkStr(theForm.best.value)){
		theForm.best.value="";
		theForm.best.focus();
		return (false);
	}
	if (!checkStr(theForm.email.value)){
		theForm.email.value="";
		theForm.email.focus();
		return (false);
	}
	if (!checkStr(theForm.comment.value)){
		theForm.comment.value="";
		theForm.comment.focus();
		return (false);
	}
	if (theForm.name.value == "") {
		alert("Please enter your name");
		theForm.name.focus();
		return (false);
	}  
	if (theForm.email.value == "" || !isEmailAddr(theForm.email.value)){
		alert("Please enter an email address");
		theForm.email.focus();
		return (false);
	}  
  return (true);
}