function decline()
{
	window.close()
}

function Apply()
{
	var objName = document.all("IDname");
	var objEmail = document.all("IDemail");
	var objForm = document.all("FormDemo");
	if ((objName.value == "") || (objName.value == ""))
		alert('Please enter details in all the mandatory fields.')
	else if ((objEmail.value.indexOf("@") == -1) || (objEmail.value.indexOf(".") == -1))
		alert('Please specify a valid email address.')
	else
	{
		// Submit the form and let the PHP record the details in the database and
		// do all the emailing etc.  The form submit takes us to the record new user
		// PHP script which in turn redirects us to the demo page.
		objForm.submit();
		alert("Thank you for your interest in Programme Express.  A new browser window has been \n" +
				"opened where you will find the Programme Express demo.");
	}
}

