window.onload = init;

function init() {
	
	var form = document.getElementById("membform");
	form.Donation_amount.optional = true;
	form.Other.optional = true;
	form.Other.isValid = "isValidOtherdonation";
	form.onsubmit = verifySubmit;
	var ftyp = form.ftyp.value;
	checkPersInfo(form);
	if (ftyp == 'new' || ftyp == 'ren') {
		checkMembInfo(form);
		document.getElementsByName("1_q")[0].validate = "posint";
		document.getElementsByName("2_q")[0].validate = "posint";
		document.getElementsByName("3_q")[0].validate = "posint";
	//  document.getElementsByName("4_q")[0].validate = "posint";
	}
}
function isValidOtherdonation(e) {

	var err = 0;
	OtherbuttonIX = document.getElementsByName("Donation_amount").length-1
	Otherbutton = document.getElementsByName("Donation_amount").item(OtherbuttonIX).checked;
	if (Otherbutton) { 
		if (is_numeric(e.value) && e.value > 0) return true; 
		e.msg = "amount for Donation must be a number";
		return false;
	}	
	return true;
}	
