var ComparedProducts1 = new Array();
var ComparedProducts2 = new Array();

function PacketIntoHiddenValue1()
{
	str = '';
	for(i=0; i<ComparedProducts1.length; i++)
		str += ComparedProducts1[i] + ' ';
	document.ComparisonForm1.ComparisonHidden1.value = str;

	if ( str != '' )
		document.ComparisonForm1.submit();
}

function PacketIntoHiddenValue2()
{
	str = '';
	for(i=0; i<ComparedProducts2.length; i++)
		str += ComparedProducts2[i] + ' ';
	document.ComparisonForm1.ComparisonHidden2.value = str;

	if ( str != '' )
		document.ComparisonForm2.submit();
}


function tsvComparison( tsvCompID, tsvDispType )
{
	_checked = eval( 'document.MainForm3'+tsvDispType+'_'+tsvCompID+'.ComparisonCheckBox_'+tsvCompID+'.checked' );
	_index = -1;
	
	for(i=0; i<ComparedProducts1.length; i++)
		
		if ( ComparedProducts1[i] == tsvCompID )
		{
			_index = i;
			break;
		}

	if ( _checked )

	{
		if ( _index == -1 )
		{
			ComparedProducts1.push( tsvCompID );
			ComparedProducts2.push( tsvCompID );
		}
	}
	else
	{
		if ( _index != -1 )
		{
			ComparedProducts1.splice( _index, 1 );
			ComparedProducts2.splice( _index, 1 );

		}
	}
}