//Copyright © 2003 PAULGRANT.CA
//http://actionfigurechecklist.com

function DoSearch(oLink)
{
	if(!oLink)
		return false;

	var oForm = document.frmSearch;
	if(!oForm)
		return false;

	var oSelect = oForm.selFigureType;
	if(!oSelect)
		return false;

	if(oSelect.selectedIndex < 1)
		return true;

	var iFigureType = oSelect.options[ oSelect.selectedIndex ].value;

	oLink.href += "&FigureType=" + iFigureType;

	return true;
}

function DoFigure(oForm)
{
	if(!oForm)
		return false;

	var oText = oForm.txtFigure;
	if(!oText)
		return false;

	if(oText.value == "")
	{
		oText.focus();
		return false;
	}

	var iTribe = 1;
	var oTribe = oForm.Tribe;
	if(oTribe)
		iTribe = oTribe.value;

	if(!gbWebTV)
	{
		var re = /\W/g;
		oText.value = oText.value.replace(re, "_");
	}

	var oRad = oForm.radFigure;
	if(!oRad)
		return false;

	var sContaining = ((oRad[ 1 ].checked == true) ? "Containing=1" : "");

	var sUrl = "./ChecklistSearch.php?Tribe=" + iTribe + "&FigureName=" + oText.value + ((sContaining) ? ("&" + sContaining) : "");

	window.location = sUrl;

	return true;
}

//End.

