var lastRow = null;
var lastColor = null;

function selectRow(e,c,f)
{
	var lc = lastColor;
	
	if (e.style.backgroundColor != "#cccccc" && e.style.backgroundColor != c)
	{
		lastColor = e.style.backgroundColor;
		e.style.backgroundColor = (c) ? c : "#cccccc";
		if(f) e.style.color = f;
	}	

	if (lastRow && lastRow!=e)
	{		
		lastRow.style.backgroundColor = lc;
	}	
	lastRow = e;
}

function upColor(t,c)
{
	t.style.color = c;
}

function outColor(t,c)
{
	t.style.color = c;
}

function upbgColor(t,c,f)
{
	t.style.backgroundColor = c;
	t.style.color = f;
}

