function getBgColor(root) {
	var bgColor = '';
	if (typeof root.style != '') {
		if (typeof root.style.backgroundColor != 'undefined' && root.style.backgroundColor != '') {
			bgColor = root.style.backgroundColor;
		}
	} else if (typeof root.bgColor != 'undefined' && root.bgColor != '') {
		bgColor = root.bgColor;
	} else {
		bgColor = getBgColor(root.parentNode);
	}
	return bgColor;
}

