function checkform ( form )
{
  // see http://www.thesitewizard.com/archive/validation.shtml
  // for an explanation of this script and how to use it on your
  // own website

  // ** START **
	if(document.nlForm.nlName.value == "")
  		{
    		alert('Please enter a value into the "Name" field');
    		document.nlForm.nlName.focus();
    		return false ;
  		}
		
	if(document.nlForm.nlEmail.value == "")
		{
			alert('Please enter a value into the "Email" field');
			document.nlForm.nlEmail.focus();
			return false;
		}
	
	if(document.nlForm.nlEmail.value != "")
	{
		var checkEmail = document.nlForm.nlEmail.value;
		
		if( (checkEmail.indexOf('@') < 0) || ( (checkEmail.charAt(checkEmail.length - 4) != '.') && (checkEmail.charAt(checkEmail.length - 3) != '.') ) ) 
		{
			alert("Please enter a valid email address in the form of address@domain.com");
			document.nlForm.nlEmail.focus();
			return false;
		}
	}
	
	return true ;
}

function checkform2 ( form )
{
	
	if(document.friendForm.friendName.value == "")
  		{
    		alert('Please enter a value into the "Recipient\'s Name" field');
    		document.friendForm.friendName.focus();
    		return false ;
  		}
		
	if(document.friendForm.friendEmail.value == "")
		{
			alert('Please enter a value into the "Recipient\'s Email" field');
			document.friendForm.friendEmail.focus();
			return false;
		}
	
	if(document.friendForm.friendEmail.value != "")
	{
		var checkEmail = document.friendForm.friendEmail.value;
		
		if( (checkEmail.indexOf('@') < 0) || ( (checkEmail.charAt(checkEmail.length - 4) != '.') && (checkEmail.charAt(checkEmail.length - 3) != '.') ) ) 
		{
			alert("Please enter a valid email address in the form of address@domain.com");
			document.friendForm.friendEmail.focus();
			return false;
		}
	}
		
	if(document.friendForm.yourName.value == "")
  		{
    		alert('Please enter a value into the "Your Name" field');
    		document.friendForm.yourName.focus();
    		return false ;
  		}
		
	if(document.friendForm.yourEmail.value == "")
		{
			alert('Please enter a value into the "Your Email" field');
			document.friendForm.yourEmail.focus();
			return false;
		}
		
	if(document.friendForm.yourEmail.value != "")
	{
		var checkEmail = document.friendForm.yourEmail.value;
		
		if( (checkEmail.indexOf('@') < 0) || ( (checkEmail.charAt(checkEmail.length - 4) != '.') && (checkEmail.charAt(checkEmail.length - 3) != '.') ) ) 
		{
			alert("Please enter a valid email address in the form of address@domain.com");
			document.friendForm.yourEmail.focus();
			return false;
		}
	}
	
  	return true ;
}
