function validate_required(field,alerttxt) {	with (field) {		if (value==null||value=="")		  {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_chapter(alerttxt) {	var selected_value = $('chapter').options[$('chapter').selectedIndex].value;	 if (selected_value == "DNS")	{alert(alerttxt);return false;}	else {return true;}}/* function validate_state(alerttxt) {	var selected_value = $('billstate').options[$('billstate').selectedIndex].value;	 if (selected_value == "DNS")	{alert(alerttxt);return false;}	else {return true;}} *//* function check_billtype(alerttxt) {	for (i=0;i<document.form.paymenttype.length;i++) {	if (document.form.paymenttype[i].checked) {		var selected_type = document.form.paymenttype[i].value;		}	}    if (selected_value == "creditcard")    {return false;}    else {return true;} }	function validate_card(alerttxt) {	var selected_value = $('cardtype').options[$('cardtype').selectedIndex].value;	 if (selected_value == "DNS")	{alert(alerttxt);return false;}	} */function validate_form(thisform) {	with (thisform) {		/*if (check_billtype("Please check a payment choice.")==false) {		if (validate_card("Please select a card type.")==false)		  {return false;}		if (validate_required(cardnumber,"Please enter a credit card number.")==false)		  {cardnumber.focus();return false;}		if (validate_required(expirationmonth,"Please enter the expiration month.")==false)		  {expirationmonth.focus();return false;}		if (validate_required(expirationyear,"Please enter the expiration year.")==false)		  {expirationyear.focus();return false;}		if (validate_required(CSC,"Please enter the security code.")==false)		  {CSC.focus();return false;}			}*/						if (validate_required(firstname,"Please enter a first name.")==false)		  {firstname.focus();return false;}		if (validate_required(lastname,"Please enter a last name.")==false)		  {lastname.focus();return false;}		 if (validate_chapter("Please select a chapter.")==false)		  {return false;}		  if (validate_required(graduation,"Please enter a graduation year.")==false)		  {graduation.focus();return false;}		  if (validate_required(billfname,"Please enter a name.")==false)		  {billfname.focus();return false;}		if (validate_required(billlname,"Please enter a last name.")==false)		  {billlname.focus();return false;}		if (validate_required(billaddress,"Please provide an address.")==false)		  {billaddress.focus();return false;}		if (validate_required(billcity,"Please add a city.")==false)		  {billcity.focus();return false;}		/*  if (validate_state("Please select a state.")==false)		  {return false;} */		/*if (validate_required(billZIP, "Please add a ZIP code.")==false)		  {billZIP.focus();return false;} */		if (validate_required(billemail,"Please enter an email address.")==false)		  {billemail.focus();return false;}		if (validate_email(billemail,"Please enter a valid email address.")==false)		  {billemail.focus();return false;}		  if (validate_required(billphone,"Please enter a phone number.")==false)		  {billphone.focus();return false;}			}}