function checkForm(searchform)
{
	if (searchform.words.value == "")
	{
		alert("Please enter some words to search our recipe database for.")
		return false;
	}
}

function changeCat()
{
	var current = document.category.categories.selectedIndex;

	if(document.category.categories.options[current].value == -1)
	{
		alert("You must select a real category from the dropdown menu to continue.")
		document.category.categories.focus();
		return false;
	}
}

function changeCuisine()
{
	var current = document.cuisine.categories.selectedIndex;

	if(document.cuisine.categories.options[current].value == -1)
	{
		alert("You must select a real cuisine from the dropdown menu to continue.")
		document.cuisine.categories.focus();
		return false;
	}
}

function createVoteWindow(id)
{
	var ids = id
	var page = "rate.php?id=" + ids
	NewWindow = window.open(page,"TheWindow" ,"toolbar=no, width= 400, height = 400, top=10,left=10,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no")
	NewWindow.focus()
}

function novalues(addform)
{
	if (addform.recipename.value == "")
	{
		alert("You must enter a title in the title field. Your recipe cannot be saved without a title.")
		document.addform.recipename.focus();
		return false;
	}

	if (addform.instructions.value == "")
	{
		alert("You must enter some cooking instructiona in the instructions field. Without a instructions your recipe cannot be saved.")
		document.addform.instructions.focus();
		return false;
	}
}

function check4name()
{
	if(document.catform.catname.value == "")
	{
		alert("Please enter a name for the category you would like to create")
		document.catform.catname.focus();
		return false;
	}
}
