function checkform(myform)
{	
	if (myform.yourname.value == "")
	{ 
		alert("Please enter your Name.");
		myform.yourname.focus();
		return false;
	} 
	else if (myform.youremail.value == "")
	{ 
		alert("Please enter your Email.");
		myform.youremail.focus();
		return false;
	}
	else if (myform.friendname.value == "")
	{ 
		alert("Please enter your friend Name.");
		myform.friendname.focus();
		return false;
	} 
	else if (myform.youremail.value == "")
	{ 
		alert("Please enter your friend Email");
		myform.friendemail.focus();
		return false;
	}
  	return checkEmail1(myform.friendemail.value);
  	return checkEmail2(myform.youremail.value);
}

function checkEmail1(email)
{
	if(email.indexOf("/")>-1)
	{
		alert("Email address has invalid character: /");
  	    return false;
	}
	if(email.indexOf(":")>-1)
	{
		alert("Email address has invalid character: :");
  	    return false;
	}
	if(email.indexOf(",")>-1)
	{
		alert("Email address has invalid character: ,");
  	    return false;
	}
	if(email.indexOf(";")>-1)
	{
		alert("Email address has invalid character: ;");
  	    return false;
	}
	if(email.indexOf("@")<0)
	{
		alert("Email address is missing @");
  	    return false;
	}
	if(email.indexOf("\.")<0)
	{
		alert("Email address is missing .");
  	    return false;
	}
	return true;
}

function checkEmail2(email)
{
	if(email.indexOf("/")>-1)
	{
		alert("Email address has invalid character: /");
  	    return false;
	}
	if(email.indexOf(":")>-1)
	{
		alert("Email address has invalid character: :");
  	    return false;
	}
	if(email.indexOf(",")>-1)
	{
		alert("Email address has invalid character: ,");
  	    return false;
	}
	if(email.indexOf(";")>-1)
	{
		alert("Email address has invalid character: ;");
  	    return false;
	}
	if(email.indexOf("@")<0)
	{
		alert("Email address is missing @");
  	    return false;
	}
	if(email.indexOf("\.")<0)
	{
		alert("Email address is missing .");
  	    return false;
	}
	return true;
}