function all(form)
{
	var form = document.forms['add'];

	for (i=0; i<form.length; i++)
	form[i].checked = true;
}

function none(form)
{
	var form = document.forms['add'];

	for (i=0; i<form.length; i++)
	form[i].checked = false;
}

function check(id)
{
	document.getElementById(id).checked ? document.getElementById(id).checked = false : document.getElementById(id).checked = true;
}

function check_true(id)
{
	if (!document.getElementById(id).checked) document.getElementById(id).checked = true;
}

function check_false(id)
{
	if (document.getElementById(id).checked) document.getElementById(id).checked = false;
}

function filter(attr,max)
{
	filter_ = document.getElementById(attr).value;
	if (filter_ == "") { none("add");}
	else for(i=1;i<max+1;i++)
	{
		id = attr+"-"+i;
		i_ = "ckb_"+i;
		if (document.getElementById(id))
		{
			if(document.getElementById(id).innerHTML.match(filter_))
			{ check_true(i_);}
			else
			{ check_false(i_);}
		}
	}
}

function inactive(attr)
{
	
	//document.getElementById(attr).className = "_inactive";
}

function active(attr,max)
{
	//if (document.getElementById(attr).value != "") filter(attr,max);
	//document.getElementById(attr).className = "_active";
}

function showfilter()
{
	document.getElementById('filter').style.display = document.getElementById('filter').style.display == "none" ? "block" : "none";

}

function reset(attr)
{
	document.getElementById(attr).value = "";
}