// JavaScript Document

function validate()

{
//---------------Validate that first name is entered---------

	if (document.form1.fname.value=="")
	{
		alert("Please enter your first name")
		document.form1.fname.focus()
		return false
	}
		
//---------------Validate that last name is entered---------

	if (document.form1.lname.value=="")
	{
		alert("Please enter your last name")
		document.form1.lname.focus()
		return false
	}
		
//---------------------Validate Email @ symbol---------------------------------
	
	if (document.form1.email.value.indexOf("@") == -1)
	{
		alert ("Please enter a valid email address")
		document.form1.email.focus()
		document.form1.email.select()
		return false
	}
		
//-----------------------Validate Email DOT symbol------------------------
	
	if (document.form1.email.value.indexOf(".") == -1)
	{
		alert ("Please enter a valid email address. There needs to be a dot in your email address")
		document.form1.email.focus()
		document.form1.email.select()
		return false
	}
		
//------------Validate that Email has an @ before the DOT symbol----------
	
	if (document.form1.email.value.indexOf("@") == -1 || 
	    document.form1.email.value.indexOf(".") == -1 ||
	    document.form1.email.value.lastIndexOf(".") <  document.form1.email.value.indexOf("@"))
	{
		alert ("Please enter a valid email address. There must be an @ before the dot")
		document.form1.email.focus()
		document.form1.email.select()
		return false
	}
		
//------------End of Javascript----------
}


