function validate_step1()
{
	var theValue = document.donorform.amount.value;
	var field_comment = document.donorform.comment.value;
	var msgInvalid = "Please enter a valid amount in the 'Amount' field";
	var msgBlank = "Field was left blank.";
	var field_title = document.donorform.title.value;
	var field_firstname = document.donorform.firstname.value;	
	var field_lastname = document.donorform.lastname.value;
	var field_address = document.donorform.address.value;
	var field_city = document.donorform.city.value;
	var field_state = document.donorform.state.value;
	var field_zip = document.donorform.zip.value;
	var field_email = document.donorform.email.value;
	var field_h_phone = document.donorform.h_phone.value;

	if (theValue == "")
	{
		alert(msgInvalid);
		document.donorform.amount.color="#CCCCCC";
		document.donorform.amount.focus();
	}
	else if (field_comment == "")
	{
		document.donorform.comment.value = msgBlank;
	}
	else if (field_title == "0")
	{
		var msgInvalid = "Please select a title from the 'Title' field";		
		alert(msgInvalid);
		document.donorform.title.focus();
	}
	else if (field_firstname == "")
	{
		var msgInvalid = "Please enter your first name in the 'First Name' field";		
		alert(msgInvalid);
		document.donorform.firstname.focus();
	}
	else if (field_lastname == "")
	{
		var msgInvalid = "Please enter your last name in the 'Last Name' field";		
		alert(msgInvalid);
		document.donorform.lastname.focus();
	}
	else if (field_address == "")
	{
		var msgInvalid = "Please enter your address in the 'Address' field";		
		alert(msgInvalid);
		document.donorform.address.focus();
	}
	else if (field_city == "")
	{
		var msgInvalid = "Please enter the city in which you live in the 'City' field";		
		alert(msgInvalid);
		document.donorform.city.focus();
	}
	else if (field_state == "")
	{
		var msgInvalid = "Please enter the state in the 'State' field";		
		alert(msgInvalid);
		document.donorform.state.focus();
	}
	else if (field_zip == "")
	{
		var msgInvalid = "Please enter your zip code in the 'Zip' field";		
		alert(msgInvalid);
		document.donorform.zip.focus();
	}
	else if (field_email == "")
	{
		var msgInvalid = "Please enter your email in the 'E-mail Address' field";		
		alert(msgInvalid);
		document.donorform.email.focus();
	}
	else if ((field_email.indexOf("@") < 0) || (field_email.indexOf(".") < 0))
		{
			var msgInvalid = "You have not entered a valid email address in the 'E-mail Address' field.";		
			alert(msgInvalid);
			document.donorform.email.focus();
	}
	else if (field_h_phone == "")
	{
		var msgInvalid = "Please enter your phone number in the 'Home Phone' field";		
		alert(msgInvalid);
		document.donorform.h_phone.focus();
	}
	else
	{
	document.donorform.submit();
	}	
}

function StripChars(theField)
{
	var strOut,i,curChar
	var theFilter;

	strOut = ""
	theFilter = "*() -./_\n\r";
	for (i=0;i < theField.length; i++)
	{		
		curChar = theField.charAt(i)
		if (theFilter.indexOf(curChar) < 0)	// if it's not in the filter, send it thru
			strOut += curChar		
	}	
	return strOut
}


function validate_step3()
{
	var field_creditcard = document.donorform2.creditcard.value;	
	var field_CARDNUM = document.donorform2.CARDNUM.value;
	var field_expdate = document.donorform2.expdate.value;
	var field_nameoncard = document.donorform2.nameoncard.value;
	
	if ((document.donorform2.creditcard[0].checked==false) && (document.donorform2.creditcard[1].checked==false) && (document.donorform2.creditcard[2].checked==false) && (document.donorform2.creditcard[3].checked==false))
	{
		var msgInvalid = "Please select your preferred card.";
		alert(msgInvalid);
	}
	else	if ((field_CARDNUM == ""))
	{
		var msgInvalid = "Please enter your credit card number. Do not use spaces or dashes.";
		alert(msgInvalid);
	}
	else	if ((field_nameoncard == ""))
	{
		var msgInvalid = "Please enter the exact name as it appears on the credit card.";
		alert(msgInvalid);
	}
	else	if ((field_expdate == ""))
	{
		var msgInvalid = "Please enter the expiration date as it appears on the credit card.";
		alert(msgInvalid);
	}
	else
	{
	document.donorform2.submit();
	}
}
