
		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_required(field,alerttxt)
		{
		with (field)
			{
			if (value==null || value=="")
				{
				alert(alerttxt);return false;
				}
			else
				{
				return true;
				}
			}
		}

		function validate_form(thisform)
		{
		with (thisform)
			{
			if (validate_required(newsname,"Please enter a name")==false)
				{newsname.focus();return false;}
			if (validate_email(newsemail,"Not a valid e-mail address!")==false)
				{newsemail.focus();return false;}
			if (validate_required(newsec,"Please enter the code")==false)
				{newsec.focus();return false;}
			}
		}
