// -----------------------------------------------------------------------
// This JavaScript controls the navigation buttons for the guestbook, as
// well as validation for the add entry form

function buttonAction(ButtonValue)
{
	document.forms(0).item("ButtonAction").value = ButtonValue;
	document.forms(0).submit();
}

function validateGBForm()
{
	var name;
	name = document.forms(0).item("iname").value
	if (name.length == 0)
	{
		alert("Please provide a name.");
		document.forms(0).item("iname").focus();
		return false;
	}

	var location;
	location = document.forms(0).item("ilocation").value
	if (location.length == 0)
	{
		alert("Please provide a location.");
		document.forms(0).item("ilocation").focus();
		return false;
	}

	var comments;
	comments = document.forms(0).item("icomments").value
	if (comments.length == 0)
	{
		alert("Please provide comments.");
		document.forms(0).item("icomments").focus();
		return false;
	}

	document.forms(0).submit();
}

function deleteEntries()
{
	document.forms(0).action = "gbDeleteGuest.asp";
	document.forms(0).submit();
}
