﻿FAQs = new Object();

// searches for the definition element following the specified term
FAQs.findDefinition = function(term)
{
	while (term != null)
	{
		if (term.nodeName == "DD")
		{
			return term;
		}
		
		term = term.nextSibling;
	}
	
	return null;
}

// searches for definition terms and adds the appropriate script/styling
FAQs.load = function()
{
	var dts = document.getElementsByTagName("dt");
	
	for (var i = 0; i < dts.length; i++)
	{
		var dt = dts[i];
		
		dt.definition = FAQs.findDefinition(dt);
		dt.definition.style.display = "none";
		dt.onclick = function(){this.definition.style.display = (this.definition.style.display == "none") ? "block" : "none";}
		dt.onmouseover = function(){this.className = "hover";}
		dt.onmouseout = function(){this.className = "";}
		dt.style.cursor = "pointer";
	}
}


// check for common script
if (!Tactica)
{
	alert("Required script 'scripts/tactica.js' is missing. Did you forget a script tag?");
}

// add load function
//Tactica.addLoadFunction(FAQs.load);
