// JavaScript Document
function comment_form(form){
	if(form.name.value==''){
		alert("Please enter name");
		form.name.focus();
		return false;
	}

	if(form.comment.value==''){
		alert("Please enter your comment");
		form.comment.focus();
		return false;
	}

	if (form.email.value.indexOf("@") <= 0 || form.email.value.indexOf(".") <= 0 ){
		alert("The format of the \"e-mail\" address is incorrect. Please enter in the format 'john@aol.com'");
		form.email.focus();
		return(false);
	}
	return true;
}

function batch_memorabilia(form){
	if(form.name.value==''){
		alert("Please enter name");
		form.name.focus();
		return false;
	}

	if(form.chk_number.value==''){
		alert("Please enter Cheque / Draft Details");
		form.chk_number.focus();
		return false;
	}

	if(form.client_tel.value==''){
		alert("Please enter telephone number");
		form.client_tel.focus();
		return false;
	}	

	if (form.client_email.value.indexOf("@") <= 0 || form.client_email.value.indexOf(".") <= 0 ){
		alert("The format of the \"e-mail\" address is incorrect. Please enter in the format 'john@aol.com'");
		form.client_email.focus();
		return(false);
	}
	return true;
}


function contribution_member_form(form){
	if(form.full_name.value==''){
		alert("Please enter name");
		form.full_name.focus();
		return false;
	}

	if(form.nic_college.value==''){
		alert("Please enter nic name");
		form.nic_college.focus();
		return false;
	}

	if(form.sc_house.value==''){
		alert("Please enter house name");
		form.sc_house.focus();
		return false;
	}	

	if (form.email.value.indexOf("@") <= 0 || form.email.value.indexOf(".") <= 0 ){
		alert("The format of the \"e-mail\" address is incorrect. Please enter in the format 'john@aol.com'");
		form.email.focus();
		return(false);
	}
	return true;
}


function contribution_form(form){
	if(form.client_name.value==''){
		alert("Please enter name");
		form.client_name.focus();
		return false;
	}

	if(form.client_address.value==''){
		alert("Please enter address");
		form.client_address.focus();
		return false;
	}

	if(form.client_tel.value==''){
		alert("Please enter telephone number");
		form.client_tel.focus();
		return false;
	}	

	if(Number(form.amount_donated.value)==0 || isNaN(Number(form.amount_donated.value))){
		alert("Please enter a valid amout to contribute");
		form.amount_donated.value = 0;
		form.amount_donated.focus();
		return false;
	}


	if (form.client_email.value.indexOf("@") <= 0 || form.client_email.value.indexOf(".") <= 0 ){
		alert("The format of the \"e-mail\" address is incorrect. Please enter in the format 'john@aol.com'");
		form.client_email.focus();
		return(false);
	}
	return true;
}