ensurePackage('SuchMuch');

SuchMuch.dom = new (function dom() {
	
	this.getAncestorByAttribute = function (obj, attrName, attrValue) {
		return obj[attrName].toLowerCase() === attrValue.toLowerCase() ? obj : arguments.callee(obj.parentNode, attrName, attrValue); 
	};
	
	this.showHiddenBlock = function (obj, target, showText, hideText) {
		if (typeof obj === 'string') {
			obj = document.getElementById(obj);
		}
		if (typeof target === 'string') {
			target = document.getElementById(target);
		}
		obj.style.display = (obj.style.display === 'block') ? 'none' : 'block';
		target.innerHTML = target.innerHTML === showText ? hideText : showText;
		
	};
	
})();