function validate(field,alerttext)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttext);
return false;
}
else
{
return true;
}
}
}

function val_email(field,alerttext)
{
with(field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{
alert(alerttext);
return false;
}
else
{
return true;
}
}
}

function val_Form(thisform)
{
with(thisform)
{
if (validate(name,"Please provide your name.")==false)
{
name.focus();
return false;
}
if(validate(email,"Please provide your e-mail address.")==false || val_email(email,"Please enter a valid e-mail address in the form someone@somewhere.com")==false)
{
email.focus();
return false;
}
}
}
