
function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function validateForm(theForm)
{
	// Customize these calls for your form
	var sTexti = '';
	if (theForm.fullname.value.length < 3) {
		sTexti =  sTexti  + 'Enter full name\n';
	}
	if (!isEmailAddr(theForm.email.value)) {
		sTexti = sTexti + 'Enter email\n';
	}
	if (theForm.text.value.length < 3) {
		sTexti = sTexti + 'Enter some text';
	}
	if (sTexti.length != '') {
		alert(sTexti);
		return false;
	} else{

		return true;
	}
}

