function ValidateContactUs()
{
    if(document.ContactUsForm.Name.value == "")
	{
        alert ("Please enter your name");
		document.ContactUsForm.Name.focus();
        return (false);
	}

    if(document.ContactUsForm.EMail.value == "")
	{
        alert ("Please enter your email address");
		document.ContactUsForm.EMail.focus();
        return (false);
	}

    if(document.ContactUsForm.Comments.value == "")
	{
        alert ("Please enter your comments");
		document.ContactUsForm.Comments.focus();
        return (false);
	}

	//EMail validation
	if((document.ContactUsForm.EMail.value.indexOf("@") < 1) || (document.ContactUsForm.EMail.value.indexOf(" ") >= 0))
	{
		alert("Please enter a valid email address");
		document.ContactUsForm.EMail.focus();
		return (false);
	}

	EMailarr = document.ContactUsForm.EMail.value.split("@");
	if (EMailarr.length > 2) 
	{
		alert("Please enter a valid email address");
		document.ContactUsForm.EMail.focus();
		return false;
	}
	if (EMailarr[0].length == 0 || EMailarr[1].length == 0) 
	{
		alert("Please enter a valid email address");
		document.ContactUsForm.EMail.focus();
		return false;
	}
	if (EMailarr[1].length !=0) 
	{
		if (EMailarr[1].indexOf(".") == -1) 
		{
			alert("Please enter a valid email address");
			document.ContactUsForm.EMail.focus();
			return false;
		}

		EMailarrnext=EMailarr[1].split(".");
		if (EMailarrnext[0].length == 0 || EMailarrnext[1].length == 0) 
		{
			alert("Please enter a valid email address");
			document.ContactUsForm.EMail.focus();
			return false;
		}
											
//		if (EMailarrnext.length > 2) 
//		{
//			alert("Please enter a valid email address");
//			document.ContactUsForm.EMail.focus();
//			return false;
//		}
	}
	// end of EMail validation
	return true;
}



function ValidateTellAFriend () 
{ 
	//Initialise variables
	var errorMsg = "";

	//Check for a visitors name
	if (document.TellAFriendForm.VisitorsName.value == "")
	{
			alert("Please enter your name");
			document.TellAFriendForm.VisitorsName.focus();
			return false;
	}
		 	
	//Check for a visitors email address and that it is valid
	if(document.TellAFriendForm.VisitorsEmail.value == "") 
	{ 
			alert("Please enter your email address");
			document.TellAFriendForm.VisitorsEmail.focus();
			return false;
	}


	//EMail validation
	if((document.TellAFriendForm.VisitorsEmail.value.indexOf("@") < 1) || (document.TellAFriendForm.VisitorsEmail.value.indexOf(" ") >= 0))
	{
		alert("Please enter a valid email address");
		document.TellAFriendForm.VisitorsEmail.focus();
		return (false);
	}

	EMailarr = document.TellAFriendForm.VisitorsEmail.value.split("@");
	if (EMailarr.length > 2) 
	{
		alert("Please enter a valid email address");
		document.TellAFriendForm.VisitorsEmail.focus();
		return false;
	}
	if (EMailarr[0].length == 0 || EMailarr[1].length == 0) 
	{
		alert("Please enter a valid email address");
		document.TellAFriendForm.VisitorsEmail.focus();
		return false;
	}
	if (EMailarr[1].length !=0) 
	{
		if (EMailarr[1].indexOf(".") == -1) 
		{
			alert("Please enter a valid email address");
			document.TellAFriendForm.VisitorsEmail.focus();
			return false;
		}

		EMailarrnext=EMailarr[1].split(".");
		if (EMailarrnext[0].length == 0 || EMailarrnext[1].length == 0) 
		{
			alert("Please enter a valid email address");
			document.TellAFriendForm.VisitorsEmail.focus();
			return false;
		}
											
		if (EMailarrnext.length > 2) 
		{
			alert("Please enter a valid email address");
			document.TellAFriendForm.VisitorsEmail.focus();
			return false;
		}
	}


	//Check for a friends name
	if (document.TellAFriendForm.FriendsName.value == "")
	{
			alert("Please enter your friend's name");
			document.TellAFriendForm.FriendsName.focus();
			return false;
	}
	
	//Check for a friends email address and that it is valid
	if(document.TellAFriendForm.FriendsEmail.value == "")
	{ 
			alert("Please enter your friend's email address");
			document.TellAFriendForm.FriendsEmail.focus();
			return false;
	}
	


	//EMail validation
	if((document.TellAFriendForm.FriendsEmail.value.indexOf("@") < 1) || (document.TellAFriendForm.FriendsEmail.value.indexOf(" ") >= 0))
	{
		alert("Please enter a valid email address");
		document.TellAFriendForm.FriendsEmail.focus();
		return (false);
	}

	EMailarr = document.TellAFriendForm.FriendsEmail.value.split("@");
	if (EMailarr.length > 2) 
	{
		alert("Please enter a valid email address");
		document.TellAFriendForm.FriendsEmail.focus();
		return false;
	}
	if (EMailarr[0].length == 0 || EMailarr[1].length == 0) 
	{
		alert("Please enter a valid email address");
		document.TellAFriendForm.FriendsEmail.focus();
		return false;
	}
	if (EMailarr[1].length !=0) 
	{
		if (EMailarr[1].indexOf(".") == -1) 
		{
			alert("Please enter a valid email address");
			document.TellAFriendForm.FriendsEmail.focus();
			return false;
		}

		EMailarrnext=EMailarr[1].split(".");
		if (EMailarrnext[0].length == 0 || EMailarrnext[1].length == 0) 
		{
			alert("Please enter a valid email address");
			document.TellAFriendForm.FriendsEmail.focus();
			return false;
		}
											
		if (EMailarrnext.length > 2) 
		{
			alert("Please enter a valid email address");
			document.TellAFriendForm.FriendsEmail.focus();
			return false;
		}
	}

	return true;
}





function ValidateFeedback()
{
    if(document.FeedbackForm.Name.value == "")
	{
        alert ("Please enter your name");
		document.FeedbackForm.Name.focus();
        return (false);
	}

    if(document.FeedbackForm.EMail.value == "")
	{
        alert ("Please enter your email address");
		document.FeedbackForm.EMail.focus();
        return (false);
	}
    if(document.FeedbackForm.Feedback.value == "")
	{
        alert ("Please enter your feedback");
		document.FeedbackForm.Feedback.focus();
        return (false);
	}
    

	//EMail validation
	if((document.FeedbackForm.EMail.value.indexOf("@") < 1) || (document.FeedbackForm.EMail.value.indexOf(" ") >= 0))
	{
		alert("Please enter a valid email address");
		document.FeedbackForm.EMail.focus();
		return (false);
	}

	EMailarr = document.FeedbackForm.EMail.value.split("@");
	if (EMailarr.length > 2) 
	{
		alert("Please enter a valid email address");
		document.FeedbackForm.EMail.focus();
		return false;
	}
	if (EMailarr[0].length == 0 || EMailarr[1].length == 0) 
	{
		alert("Please enter a valid email address");
		document.FeedbackForm.EMail.focus();
		return false;
	}
	if (EMailarr[1].length !=0) 
	{
		if (EMailarr[1].indexOf(".") == -1) 
		{
			alert("Please enter a valid email address");
			document.FeedbackForm.EMail.focus();
			return false;
		}

		EMailarrnext=EMailarr[1].split(".");
		if (EMailarrnext[0].length == 0 || EMailarrnext[1].length == 0) 
		{
			alert("Please enter a valid email address");
			document.FeedbackForm.EMail.focus();
			return false;
		}
											
		if (EMailarrnext.length > 2) 
		{
			alert("Please enter a valid email address");
			document.FeedbackForm.EMail.focus();
			return false;
		}
	}

	// end of email validation
	return true;
}


function ValidateLogin()
{
	if(document.LoginForm.AccountID.value == "")
	{
		alert("Please enter your account ID.");
		document.LoginForm.AccountID.focus();
		return false;
	}
	if(document.LoginForm.Password.value == "")
	{
		alert("Please enter your password.");
		document.LoginForm.Password.focus();
		return false;
	}
	return true;
}
