// JavaScript Document


function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {alert(alerttxt);return false;}
  else {return true;}
  }
}

function validate_text(field,alerttxt)
{
  if (field.value =="")
    {alert(alerttxt);
	return false;
	}
  else {return true;}
  
}


function validate_form(thisform)
{
with (thisform)
  {
  if (validate_text(nume,"Va rugam sa introduceti numele")==false)
    {nume.focus();return false;}
	 if (validate_email(email,"Addresa email invalida!")==false)
    {email.focus();return false;}
	if (validate_text(comment,"Lipseste commentul")==false)
    {comment.focus();return false;}

	
  }
}