//--------------------------------------------FIRST NAME VALIDATION------------------------------------------------------------------

function testFirst ()
{
if (document.form.first_name.value == "")
{
alert ("Please enter your first name!")
document.form.first_name.focus()
document.form.first_name.select()

return false
}

else
return true
}


//--------------------------------------------LAST NAME VALIDATION------------------------------------------------------------------

function testLast ()
{
if (document.form.last_name.value == "")
{
alert ("Please enter your last name")
document.form.last_name.focus()
document.form.last_name.select()
}
else
return true
}


//----------------------------EMAIL VALIDATION------------------------------------------------------------------

function testEmail()
{

if (document.form.submit_by.value.indexOf ("@")  == "-1" ||
    document.form.submit_by.value.indexOf(".")  == "-1" || document.form.submit_by.value == "" || document.form.submit_by.value.length<6)
{	
alert ("Please check your email address!")
	document.form.submit_by.focus()
    document.form.submit_by.select()
return false
}

else
return true
	
}

//-------------------------------FORM VALIDATION-----------------------------------------------------------------

function testFields()
{
if
(testFirst () && testLast () && testEmail ())

document.form.submit()
else
{
return false
}
}

