//=========================================================================================================
//---------------------------------------------------------------------------------------------------------
//	Numark product filtering
//---------------------------------------------------------------------------------------------------------
//=========================================================================================================
function FilterCheck( filter_id )
{
//---------------------------------------------------------------------------------------------------------
//	Determine the base value
//---------------------------------------------------------------------------------------------------------
	//	0 is passed when "show all" is clicked
	if( filter_id == 0 )
	{
		//	Make full opacity
		filter_class	= "none";
	}
	//	Other value is the filter aritlce ID
	else
	{
		//	Arbitrary value to fade to
		filter_class	= "filter-off";
	}

//---------------------------------------------------------------------------------------------------------
//	Get the lite item objects
//---------------------------------------------------------------------------------------------------------
	itemslist	= document.getElementById( "productlist" );

	//	Get the list items within the tabs list
	items	= itemslist.getElementsByTagName( "LI" );

//---------------------------------------------------------------------------------------------------------
//	Set all objects to the base value
//---------------------------------------------------------------------------------------------------------
	for( i = 0; i < items.length; i++ )
	{
		items[i].className		= filter_class;
	}

//---------------------------------------------------------------------------------------------------------
//	Now set the ones that pass the filter and set full opacity (active)
//---------------------------------------------------------------------------------------------------------
	//	Only if "show all" not selected
	if( filter_id != 0 )
	{
		//	Get the array of objects that pass the filter
		test	= filters[ filter_id ];

		//	Toggle each one to full opacity
		for( i = 0; i < test.length; i++ )
		{
			//	Get the object DOM ID
			item_id	= "item" + test[i];

			document.getElementById( item_id ).className		= 'none';
		}
	}

//---------------------------------------------------------------------------------------------------------
//	Change the link
//---------------------------------------------------------------------------------------------------------
	filter_links	= document.getElementById( 'productfilter' );
	filter_links	= filter_links.getElementsByTagName( "A" );

	for( var i = 0; i < filter_links.length; i++ )
	{
		filter_links[ i ].className	= 'none';
	}
	
	document.getElementById( "fl" + filter_id ).className	= 'active';
}
