

function menuInOut(id, way) {
	var newClass = "menuItem";

	if (way == "in") {
		newClass += "_over";
	}

	if (id == activeItem) {
		newClass += "_active";
	}

	var node = document.getElementById(id);
	if (node) {
		node.className = newClass;
	}
}

function menuClick(id) {
	if (id != activeItem) {
		var oldNode = document.getElementById(activeItem);
		if (oldNode) {
			oldNode.className = "menuItem";
		}

		var newNode = document.getElementById(id);
		if (newNode) {
			newNode.className = "menuItem_over_active";
		}

		var oldParts = activeItem.split("_", 2);
		var oldContent = document.getElementById("main_"+ oldParts[1]);
		if (oldContent) {
			oldContent.style.display = "none";
		}

		var newParts = id.split("_", 2);
		var newContent = document.getElementById("main_"+ newParts[1]);
		if (newContent) {
			newContent.style.display = "block";
		}

		activeItem = id;
	}
}


var ans = new Array;
var done = new Array;
var score = 0;

function Correct(n) {
			if (n == 1) {
			score++;
			document.getElementById('questionr'+currentfact).style.display = 'block';
			document.getElementById('questionw'+currentfact).style.display = 'none';			
			}
			else
			if (n == 2) {
			document.getElementById('questionw'+currentfact).style.display = 'block';
			document.getElementById('questionr'+currentfact).style.display = 'none';
			}
			}

function addScore(s) {
		if (s == 1) {
		score++;
		}
		}
		
function Score () {
		if (score >= 10) {
		alert("Great Job - Perfect Score!");
		}
		else
		if (score >= 9) {
		alert("Awesome - 9 out fo 10!")
		}
		else
		if (score >=8) {
		alert("Good job - 8 out of 10")
		}
		else
		if (score >= 7) {
		alert("Nice Job - 7 out of 10")
		}
		else
		if (score >=6)  {
		alert ("6 out of 10 - you may want to spend some time on the the Learn It page!.")
		}
		else {
		alert("You missed more than 4, you need to re-visit the Learn It page!");
		}
		}
		
function openURLsmall(url)	{
   			window.open(url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=1024, height=400');
		}
		
function openURL(url)	{
   			window.open(url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=1024, height=600');
		}

function openself(url)	{
   			window.open(url,'_self','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=800, height=600');
}



