'Description: Collection of validation
'Created: 15/feb/05
'BW (Programmer)
'========================================================================================

function form1_onSubmit()


	form1_onSubmit = True
	
	if NOT document.form1.Confirmation.checked then
	''if document.form1.Confirmation.checked = false then
		Msgbox "Would you like to be a member of the HUG Australasia - Please Tick Box"
		document.form1.Confirmation.focus()
		form1_onSubmit =  False
		
	elseif (document.form1.Title.value) = "- Select One -" then
		Msgbox "Please select a Title"
		document.form1.Title.focus()
		form1_onSubmit =  False
	
	elseif len(document.form1.FirstName.value) < 1 then
		Msgbox "Please enter First Name"
		document.form1.FirstName.focus()
		form1_onSubmit =  False
	
	elseif len(document.form1.Surname.value) < 1 then
		Msgbox "Please enter Surname"
		document.form1.Surname.focus()
		form1_onSubmit =  False
	
	elseif len(document.form1.Job_Title.value) < 1 then
		Msgbox "Please enter a Job Title"
		document.form1.Job_Title.focus()
		form1_onSubmit =  False
			
	elseif len(document.form1.Telephone.value) < 8 then
		Msgbox "Please enter a contact Telephone number"
		document.form1.Telephone.focus()
		form1_onSubmit =  False
		
	elseif len(document.form1.Email.value) < 1 then
		Msgbox "Please enter Email Address"
		document.form1.email.focus()
		form1_onSubmit =  False
	
	elseif len(document.form1.Email.value) < 6 then
		Msgbox "Please enter a valid Email Address (eg. yourname@yourdomain.com)"
		document.form1.Email.focus()
		form1_onSubmit =  False		
	
	elseif instr(document.form1.Email.value,"@") = 0 then
   		msgbox("Please enter a valid Email Address (eg. yourname@yourdomain.com)")
   		document.form1.Email.focus()
		form1_onSubmit = False
	
	'check if there is a .
	elseif instr(document.form1.Email.value,".") = 0 then
		msgbox("Please enter a valid Email Address (eg. yourname@yourdomain.com)")
   		document.form1.Email.focus()
		form1_onSubmit = False
	
	'check if there is 2 . in a row
	elseif InStr(document.form1.Email.value, "..") > 0 Then
		msgbox("Please enter a valid Email Address (eg. yourname@yourdomain.com)")
	   	document.form1.Email.focus()
		form1_onSubmit = False
		
	'check if there is @. in a row
	elseif InStr(document.form1.Email.value, "@.") > 0 Then
		msgbox("Please enter a valid Email Address (eg. yourname@yourdomain.com)")
		document.form1.Email.focus()
		form1_onSubmit = False
	
	'check if there is .@ in a row
	elseif InStr(document.form1.Email.value, ".@") > 0 Then
		msgbox("Please enter a valid Email Address (eg. yourname@yourdomain.com)")
		document.form1.Email.focus()
		form1_onSubmit = False

	elseif len(document.form1.Company_Name.value) < 1 then
		Msgbox "Please select a Company Name"
		document.form1.Company_Name.focus()
		form1_onSubmit =  False
		
	elseif (document.form1.Area_of_Activity.value) = "- Select One -" then
		Msgbox "Please select Main area of Activity"
		document.form1.Area_of_Activity.focus()
		form1_onSubmit =  False

	elseif len(document.form1.Address_Line_1.value) < 1 then
		Msgbox "Please select a Address Line 1"
		document.form1.Address_Line_1.focus()
		form1_onSubmit =  False
		
	elseif len(document.form1.City.value) < 1 then
		Msgbox "Please enter a City"
		document.form1.City.focus()
		form1_onSubmit =  False

	elseif (document.form1.State.value) = "- Select One -" then
		Msgbox "Please select a State"
		document.form1.State.focus()
		form1_onSubmit =  False
	
	elseif len(document.form1.PostalCode.value) < 1 then
		Msgbox "Please enter a Post Code"
		document.form1.PostalCode.focus()
		form1_onSubmit =  False
		
	elseif len(document.form1.Country.value) < 1 then
		Msgbox "Please enter a Country"
		document.form1.Country.focus()
		form1_onSubmit =  False
	
	end if

end function
