function row_h(obj, colorObj) {
	obj.style.backgroundColor = colorObj;
}

function row_u(obj, colorObj) {
	obj.style.backgroundColor = colorObj;
}

function row_n(obj, id, colorObj, colorObjChecked) {
	obj.style.backgroundColor = document.getElementById(id).checked ? colorObjChecked : colorObj;
}

function showRowDetail(row, id, text) {
	detail = document.getElementById(id);
	detail.innerHTML = text;
	detail.style.top = computeRowPosition(row, "offsetTop") + 3 + "px";

	detail.style.display = 'block';
	detail.style.left = (computeRowPosition(row, "offsetLeft") + tableColumnLeftPx) + "px";
}

function hideRowDetail(id) {
	detail = document.getElementById(id);
	detail.innerHTML = "";

	detail.style.display = 'none';
}

function computeRowPosition(position_row, atribut) {
	var position = 0;
	
	while(position_row) {
		position += position_row[atribut];
		position_row = position_row.offsetParent;
	}
	
	return position;
}

function CheckAll(setColorObj, colorObj, colorObjChecked) {
	for(var i = 0; i < document.getElementById('tabForm').elements.length; i++) {
		var e = document.getElementById('tabForm').elements[i];

		if((e.type == 'checkbox') && (e.name != 'allbox')) {
			e.checked = document.getElementById('tabForm').allbox.checked;

			if(!document.layers && setColorObj) {
				var tr = document.getElementById('tr' + e.id.substring(3));

				if(e.checked)
					tr.style.backgroundColor = colorObjChecked;
				else
					tr.style.backgroundColor = colorObj;
			}
		}
	}
}

function OnlyCheckAll(colorObj, colorObjChecked) {
	var cb = document.getElementById('allbox');

	if(!cb.checked) {
		cb.checked = !cb.checked; 

		CheckAll(1, colorObj, colorObjChecked)
	}
}

function OnlyUnCheckAll(colorObj, colorObjChecked) {
	var cb = document.getElementById('allbox'); 

	if(cb.checked) {
		cb.checked = !cb.checked; 
	
		CheckAll(1, colorObj, colorObjChecked)	
	}
}