function OkToSubmit()
{
	var result = false;   //don't submit
	
	try
	{
		var form = document.getElementById("reunionForm");
		var errors = 0;
		var errorMsg = "Please fix the following:\n";

		if( form )
		{
			var cost          = form.cost.value;
			var hasCost       = (cost.length > 0);		
			var isValidCents  = false;

			if( hasCost )
			{
				if( !isNaN(cost) )
				{
					if( cost.indexOf(".") != -1 )
					{

						var re_validCents = /^\d*[.](\d{1,2})$/;
						var hasCents = re_validCents.test(cost);
						if(hasCents)
						{
							var cents = parseInt(cost.replace(re_validCents, "$1"));
							isValidCents = (cents >= 0) && (cents <= 99);
						}
					}
					else
						isValidCents = true;    //whole number
				}
			}

			var costIsValid   = (cost.length == 0 || (cost.length > 0 && !isNaN(cost) && isValidCents));

			var rsvpDeadline	= form.rsvp_deadline.value;
			var reunionDate		= form.reunion_datetime.value;
			var reunionTime		= "";
			var rsvpTo        = form.rsvp_to.value;
			var payableTo     = form.payable_to.value;
			var details       = form.extra_detail.value;
			
			//validate cost
			if( !costIsValid )
			{
				errors++;
				errorMsg += "\tInvalid cost.\n";
				costIsValid = false;
			}

			//validate RSVP To
			if( rsvpTo.length == 0 )
			{
				errors++;
				errorMsg += "\tPlease enter some RSVP contact information.\n";
			}

			//validate dates
			var dRSVP         = (rsvpDeadline.length > 0) ? new Date(rsvpDeadline) : null;
			var dReunion      = (reunionDate.length > 0) ? new Date(reunionDate + " " + reunionTime) : null;
			var rightNow         = new Date();

			if( dReunion <= rightNow )
			{
				errors++;
				errorMsg += "\tInvalid Reunion Date.\n";
			}

			//validate details
			if( details.length == 0 )
			{
				errors++;
				errorMsg += "\tPlease enter the reunion details.\n";
			}
		}

		if( errors == 0 )
		{
			result = confirm("Confirm that everything is accurate.\n" +
											"Once submitted, you won't be able to change it.\n" +
											"Click 'Cancel' to make revisions.\n" +
											"Click 'OK' to proceed.");
		}
		else
			alert(errorMsg);
	}
	catch(err)
	{
		alert(err.message);
	}

  return result;
}

