var oCA = new Array();
var tmpArray = new Array();

function cBg(tr) {
	if(tr == null) return;

	if (isTrMarked(tr)) return;
	var children = tr.childNodes;
	tmpArray = new Array();
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			if(tr.children[i]){
				var bgColor = tr.children[i].bgColor;
				if(!bgColor || bgColor == ""){
					bgColor = tr.bgColor;
				}
				tmpArray[i] = bgColor;
				tr.children[i].bgColor='D6CFCD';
			}
		}
	}
	oCA[tr.id] = tmpArray;
}
function rBg(tr) {
	if(tr == null) return;
	
	if (isTrMarked(tr)) return;
	tmpArray = oCA[tr.id];
	var children = tr.childNodes;
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			if(tmpArray[i]){
				if(tr.children[i]){
					tr.children[i].bgColor=tmpArray[i];
				}
			}
		}
	}
}
function isTrMarked(tr) {
	if(tr == null) return false;

	if (tr.children && tr.children[0].bgColor=='#b2b2b2') {
		return true;
	}
	return false;
}
function mTr(tr) {
	if(tr == null) return;

	var children = tr.childNodes;
	var doStyle = true;
	if (isTrMarked(tr)) {
		umTr(tr);
	} else {
		if (tr.children) {
			for (var i=0;i < children.length; i++) {
				if(tr.children[i]){
					tr.children[i].bgColor='b2b2b2';
					tr.children[i].style.color="ffffff";
				}
			}
		}
	}
}
function umTr(tr) {
	if(tr == null) return;

	var children = tr.childNodes;
	tmpArray = oCA[tr.id];
	if (tr.children) {
		for (var i=0;i < children.length; i++) {
			if(tmpArray[i]){
				tr.children[i].bgColor=tmpArray[i];
				tr.children[i].style.color="#365772";
			}
		}
	}
}

