function checkboxState(id, type, which)
{
	var cb = document.getElementById(id + 'I');
	var cbb = document.getElementById(id);
	var cbbh = cbb.style.height.substr(0, cbb.style.height.length -2);
	if (which == 1)
	{
		if (type == 'mousedown')
		{
			if (cb.checked)
			{
				cbb.style.backgroundPosition = "0px " + cbbh*-3 + "px";
			}
			else
			{
				cbb.style.backgroundPosition = "0px " + cbbh*-1 + "px";
			}
		}
		if (type == 'mouseup')
		{
			if (cb.checked)
			{
				cb.checked = false;
				cbb.style.backgroundPosition = "0px 0px";
				cbb.custom.clicking=false;
				alert (cbb.custom.clicking);
			}
			else
			{
				cb.checked = true;
				cbb.style.backgroundPosition = "0px " + cbbh*-2 + "px";
				cbb.custom.clicking=false;
				alert (cbb.custom.clicking);
			}
		}
	}
	if (type == 'mouseout')
	{
		if (cb.checked && (cbb.style.backgroundPosition == "0px " + cbbh*-3 + "px"))
		{
			cbb.style.backgroundPosition = "0px " + cbbh*-2 + "px";
		}
		if (cb.checked == false && (cbb.style.backgroundPosition == "0px " + cbbh*-1 + "px"))
		{
			cbb.style.backgroundPosition = "0px 0px";
		}
	}
}