function checkForm(form) {

	var errorMsg = "";

	errorMsg += isFieldValid(form.amt.value,"donation amount",1,14,"num");
	
	return errorMsg;
}

function submitForm(form) {

	var errorMsg = checkForm(form);
	var reEnterMsg = " <p> Please click the 'Close' button and reenter it.</p>";

		
	if (isEmpty(errorMsg)) {
//		globalWindowOpen('','ocrf_win',350,300,1,0,0,1,0,0,0,300,300);
		document.ocrfForm.mtid.value = ranGen();
		form.submit();
   
	} else {

		popup = window.open("","ocrfDonation","width=400,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1");
		popup.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head>");
		popup.document.write("<link rel='stylesheet' href='/css/National/GlobalStyle.css' type='text/css'></head>");
		popup.document.write("<title>OCRF</title>");
		popup.document.write("<body>");
		
		popup.document.write("<strong>OCRF</strong><br><br>");
		popup.document.write(errorMsg);
		popup.document.write("<br>");
		popup.document.write(reEnterMsg);
		popup.document.write("<center><form><input type=button value=Close onClick=javascript:window.close();></center></form>");
		popup.document.write("</body>");
		popup.document.write("</html>");
		popup.document.close();

	}
}


function ranGen(){

	var ranGenOcrf=Math.floor(Math.random()*1001);
	var thetime=new Date();
	var mtid = (thetime.getHours()+''+thetime.getMinutes()+''+thetime.getSeconds()+''+ranGenOcrf);
	return mtid;

}
