//Copyright 2008 paulgrant.ca
//http://actionfigurechecklist.com

function DoShow(oSelect, sShow)
{
	if(!oSelect)
		return false;

	if(!sShow)
		sShow = "Show";

	var iIdx = oSelect.selectedIndex;
	if(iIdx < 0)
		return false;

	var iShow = oSelect.options[ iIdx ].value;
	if(iShow < 0)
		return false;

	var sQS = QS_ex(sShow);

	if(iShow > 0)
		sQS += "&" + sShow + "=" + iShow;

	//var sLocation	= window.location.host + window.location.pathname;

	window.location.search = "?" + sQS;

	return true;
}

function ShowSelectBox()
{
	var i			= 0;
	var oType		= null;
	var sString		= "";
	var iDefault	= QS_val("Show");
	var iValue		= 0;

	sString = "<form name='frmShow' id='frmShow' onSubmit='return false;' style='margin-bottom:0px;'>\n";
	sString += "Show <select name='selShow' onChange='DoShow(this, \"Show\")'>\n";
	sString += "<option value='0'>All</option>\n";
	sString += "<option value='1' " + ((1 == iDefault) ? "selected='selected'" : "") + ">Have</option>\n";
	sString += "<option value='2' " + ((2 == iDefault) ? "selected='selected'" : "") + ">Need</option>\n";

	document.write(sString);

	for(i = 0; i < gaFigureTypes.length; i++)
	{
		oType = gaFigureTypes[ i ];
		if(!oType)
			break;

		iValue = Number(oType[ 0 ]) + 4;

		sString = "<option value='" + iValue + "' " + ((iValue == iDefault) ? "selected='selected'" : "") + ">" + oType[ 1 ] + "</option>\n";

		document.write(sString);
	}

	sString = "<option value='10' " + ((10 == iDefault) ? "selected='selected'" : "") + " title='Subscribers'>Description/Price</option>\n";

	sString += "</select></form>\n";

	document.write(sString);

	return true;
}

var gaCompareTypes = new Array("Both Need", "Both Have", "You Have and Member Needs", "Member Has and You Need");

function ShowSelectBoxCompare()
{
	var i			= 0;
	var sString		= "";
	var sCompare	= "";
	var iValue		= 0;
	var iDefault	= QS_val("Compare");

	sString = "<form name='frmCompare' id='frmCompare' onSubmit='return false;' style='margin-bottom:0px;'>\n";
	sString += "Compare <select name='selCompare' onChange='DoShow(this, \"Compare\")'>\n";
	sString += "<option value='0'>All</option>\n";

	document.write(sString);

	for(i = 0; i < gaCompareTypes.length; i++)
	{
		sCompare = gaCompareTypes[ i ];
		if(!sCompare)
			break;

		iValue = i + 1;

		sString = "<option value='" + iValue + "' " + ((iValue == iDefault) ? "selected='selected'" : "") + ">" + sCompare + "</option>\n";

		document.write(sString);
	}

	sString = "</select></form>\n";

	document.write(sString);

	return true;
}

//End.

