function validate_form() 
{
	validity=true;
	str="Invalid entry"+"\n"; 
	if (check_empty(document.Form.Fname.value))
    { validity = false; str=str+"Name";}
	if (!check_email(document.Form.email.value))
    { validity = false; str=str+" "+"Email"; }
    if (check_empty(document.Form.phno.value))
    { validity = false; str=str+" "+"Phone"; }


	if(validity)
	{
		document.Form.submit();
	}
	else
	{
		alert(str);
	}
}



function validate_form3() 
{
	validity=true;
	str="Invalid entry"+"\n"; 
	if (check_empty(document.Form.Fname.value))
    { validity = false; str=str+"Name";}
	if (!check_email(document.Form.email.value))
    { validity = false; str=str+" "+"Email"; }
    if (check_empty(document.Form.company.value))
    { validity = false; str=str+" "+"Company"; }


	if(validity)
	{
		document.Form.submit();
	}
	else
	{
		alert(str);
	}
}


function validate_form2() 
{
	validity=true; 
	if (!check_email(document.Form2.email.value))
    { validity = false; alert('Email is invalid!'); }

	if(validity)
	{
		document.Form2.submit();
	}
}



function check_email(address) {
  if ((address == "") || (address.indexOf ('@') == -1) || (address.indexOf ('.') == -1))
      return false;
  return true;
}

function check_empty(text) {
return (text.length<1|| !text.match(/[^\s]/));
}
