function validateTest(formInfo)
{
	var questions = "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n";
	for (var count = 1; count <= 20; count++)
	{
		for (var count2 = 0; count2 < formInfo['q' + count].length; count2++)
		{
			if (formInfo['q' + count][count2].checked)
			{
				var pattern = new RegExp(count + "\n");
				questions = questions.replace(pattern, "");
			}
		}
	}
	
	if (questions != "")
	{
		alert("The following questions have not been answered:\n" + questions);
		return false;
	}
	
	return true;
}

function validateChallenge(formInfo)
{
	var outTxt = "";
	if (formInfo.name.value == "")
	{ outTxt += "Please fill in the Name field.\n"; }
	if (!formInfo.email.value.match(/.+@.+\..+/))
	{ outTxt += "Your email is invalid.\n"; }
	if (!formInfo.friends.value.match(/.+@.+\..+/))
	{ outTxt += "Your friend's email is invalid.\n"; }
	
	if (outTxt != "")
	{
		alert("The following information is incorrect:\n" + outTxt);
		return false;
	}
	return true;
	
}

var catID = 1;
function getCategories(selectInfo)
{
	catID = selectInfo.value;
	URL2DIV('../scripts/getStories.php?catID=' + catID, 'storiesDiv');
}

function getStory(page)
{
	URL2DIV('../scripts/getStories.php?catID=' + catID + '&page=' + page, 'storiesDiv');
}
