function addClassToParents(aNodes, sClassName, sParentClasses, eParent) {
	for (var i = 0; i < aNodes.length; i++) {
		var eThisParent = aNodes[i][0].parentNode;
		while (eThisParent && eThisParent != eParent) {
			if (eThisParent.tagName == 'TR') {
				if (!matchClass(eThisParent, 'country')) {
					var eCountryRow = getPrevSiblingByClassName( eThisParent, 'country', 'tr' );
					if (eCountryRow) addClass(eCountryRow, 'found');
				}
				addClass(eThisParent, 'found');
			}
			eThisParent = eThisParent.parentNode;
		}
	}
}


function removeClassFromParents(aNodes, sClassName, sParentClasses, eParent) {
	for (var i = 0; i < aNodes.length; i++) {
		var eThisParent = aNodes[i][0].parentNode;
		while (eThisParent && eThisParent != eParent) {
			if (eThisParent.tagName == 'TR') {
				if (!matchClass(eThisParent, 'country')) {
					var eCountryRow = getPrevSiblingByClassName( eThisParent, 'country', 'tr' );
					if (eCountryRow) removeClass(eCountryRow, 'found');
				}
				removeClass(eThisParent, 'found');
			}
			eThisParent = eThisParent.parentNode;
		}
	}
}
