
function compare(there,id)
{
	var array = new Array();

	var value = getcookie('compare')
	if(value)
	{
		var cookie = value.split(',');
		for(var i=0; i<cookie.length; i++)
		{
			if(cookie[i]!=id)
			{
				array.push(cookie[i]);
			}
		}
	}

	if(there.className=='checked')
	{
		there.className = '';
	}
	else
	{
		there.className = 'checked';
		array.push(id);
	}

	setcookie('compare',array.join(','));

	if(array.length>1)
	{
		var width = Math.round(screen.width*3/4);
		var height = Math.round(screen.height*3/4);
		var win = window.open('./simple/compare.html?'+Math.random(),'compare','left=20,top=20,width='+ width +',height='+ height +',toolbar=0,resizable=1,scrollbars=1')
		win.focus();
	}
}

function compare_remove(id)
{
	var array = new Array();

	var value = getcookie('compare')
	if(value)
	{
		var cookie = value.split(',');
		for(var i=0; i<cookie.length; i++)
		{
			if(cookie[i]!=id)
			{
				array.push(cookie[i]);
			}
		}
	}

	setcookie('compare',array.join(','));
}

