function Validate()
{
	var jobNum = document.getElementById("Job Number");
	var address = document.getElementById("Property Address");
	var amount = document.getElementById("Report");
	var type = document.getElementById("Job Type");
	var vendor = document.getElementById("vendor_name");
	var pf = document.getElementById("payment_reference");
	var onlinePayment = document.getElementById("onlinePayment");
	

	if (isNaN(jobNum.value) || jobNum.value == "" || (jobNum.value.length > 9) || (jobNum.value.length < 5))
	{
		alert("The invoice number suppled is invalid. \n " +
				"Must be a 5-6 digit number and can optionally be followed by a decimal place and up to 2 digits! \n \n" +
				"The following are valid invoice number formats: \n " +
				"12345 \n 12345.1 \n 12345.12");
		jobNum.select();
		return;
	}

	if (jobNum.value.length > 9)
	{
		alert("The invoice number suppled is invalid. \n " +
			"Must be a 6 digit number and can optionally be followed by a decimal place and up to 2 digits! \n \n" +
			"The following are valid invoice number formats: \n " +
			"123456 \n 123456.1 \n 123456.12");
		jobNum.select();
		return;
	}


	if (isNaN(amount.value) || amount.value == "" || amount.value <= 0)
	{
		alert("The amount suppled is invalid.");
		amount.select();
		return;
	}
	
	if (!(isNaN(address.value)) || address.value == "")
	{
		alert("The property address suppied is invalid.");
		address.select();
		return;
	}

	if (type.value == "Other")
		vendor.value ="BMA0021";
	else
		vendor.value ="BMT0021";


	pf.value = jobNum.value;

	onlinePayment.submit();
}

