function resetForm()
{
	document.forms.frmContact == "";
}

function submitForm()
{
	if (isSender() && isSender_email() && isRecipient() && isRecipient_email() && isMessage())
	{
		if (confirm("You are about to submit your submission."))
		{
			return true;
		}
		else
		{
			alert("You have chosen to abort the submission.");
			return false;
		}
	}
	
	return false;
}

function isSender()
{
	if (document.all.frmEmailAFriend.sender.value == "")
	{
		alert("The Sender field is blank. Please enter your Fullname!")
		document.all.frmEmailAFriend.sender.focus();
		return false;
	}

	return true;
}

function isSender_email()
{
	if (document.all.frmEmailAFriend.sender_email.value == "")
	{
		alert("The Sender_Email field is blank. Please enter your Email address!")
		document.all.frmEmailAFriend.sender_email.focus();
		return false;
	}
	if (document.all.frmEmailAFriend.sender_email.value.indexOf('@', 0) == -1 || document.all.frmEmailAFriend.sender_email.value.indexOf('.', 0) == -1)
	{
		alert ("The Sender_Email field requires a \"@\" and a \".\"be used. Please re-enter your Email address!")
		document.all.frmEmailAFriend.sender_email.select();
		document.all.frmEmailAFriend.sender_email.focus();
		return false;
	}
	
	return true;
}

function isRecipient()
{
	if (document.all.frmEmailAFriend.recipient.value == "")
	{
		alert("The Recipient field is blank. Please enter your friend's Fullname!")
		document.all.frmEmailAFriend.recipient.focus();
		return false;
	}

	return true;
}

function isRecipient_email()
{
	if (document.all.frmEmailAFriend.recipient_email.value == "")
	{
		alert("The Recipient_Email field is blank. Please enter your friend's Email address!")
		document.all.frmEmailAFriend.recipient_email.focus();
		return false;
	}
	if (document.all.frmEmailAFriend.recipient_email.value.indexOf('@', 0) == -1 || document.all.frmEmailAFriend.recipient_email.value.indexOf('.', 0) == -1)
	{
		alert ("The Recipient_Email field requires a \"@\" and a \".\"be used. Please re-enter your friend's Email address!")
		document.all.frmEmailAFriend.recipient_email.select();
		document.all.frmEmailAFriend.recipient_email.focus();
		return false;
	}
	
	return true;
}

function isMessage()
{
	if (document.all.frmEmailAFriend.message.value == "")
	{
		alert("The Message field is blank. Please enter your Message!")
		document.all.frmEmailAFriend.message.focus();
		return false;
	}
	
	else if (document.all.frmEmailAFriend.message.value.length > 1000)
	{
		alert("Your message exceeds the maximum limit (1000 characters). Please try again!")
		document.all.frmEmailAFriend.message.focus();
		return false;
	}

	return true;
}
