<!--
function checkData() {
	var er   = false;
	var eMsg = "The following errors were found:\n\n";
	
	//firstname
	if(stripSpaces(document.afterinnocence.first_names.value) == "") {
		er = true;
		eMsg = eMsg + "First Name is Required.\n";
	}
	//lastname
	if(stripSpaces(document.afterinnocence.last_name.value) == "") {
		er = true;
		eMsg = eMsg + "Last Name is Required.\n";
	}
	//e-mail
	if(stripSpaces(document.afterinnocence.email.value) == "" || isEmailValid(document.afterinnocence.email.value,"yo") != "") {
		er = true;
		eMsg = eMsg + "Email Address is Invalid.\n";
	}
	//city
	if(stripSpaces(document.afterinnocence.city.value) == "" ) {
		er = true;
		eMsg = eMsg + "City is Required.\n";
	}
	//state
	if(stripSpaces(document.afterinnocence.state.value) == "" ) {
		er = true;
		eMsg = eMsg + "State is Required.\n";
	}
	if (er == false) {
		document.afterinnocence.submit();
	} else {
		alert(eMsg);
		return false;
	}
}
function stripSpaces(string) {
	var quote = " ";
	var replacement ="";
	var newStr = "";
	var strTxt = "";
	var text = string;
	strTxt = text;
	//check for character in the string
	if (strTxt.indexOf(quote) != -1) { 
		var arrayOfStrings = strTxt.split(quote);
		//insert a escape character if the special character is found
		for (var i=0; i < arrayOfStrings.length-1; i++){
			newStr = newStr + arrayOfStrings[i] + replacement;
		}
		newStr = newStr + arrayOfStrings[arrayOfStrings.length-1];
		strTxt=newStr;
		newStr="";
	}
	return strTxt;
}
function isEmailValid(check_email,error_msg) {
	var email = check_email;
	var filter  = /^([a-zA-Z0-9]+[a-zA-Z0-9_\-\.]*\@([a-zA-Z0-9]+[a-zA-Z0-9\_-]*\.)+[a-zA-Z0-9]+)$/;
	if (filter.test(email)) {
		return "";
	} else {
		return error_msg;
	}
}
//-->
