function getLastChildElement(parentElement) {
	for (var i = parentElement.childNodes.length; i > 0; i -= 1) {
		if (parentElement.childNodes[i - 1].nodeType == 1) {
			return parentElement.childNodes[i - 1];
		}
	}
	return null;
}

function getNextSiblingElement(sib) {
	while (sib = sib.nextSibling) {
		if (sib.nodeType == 1) {
			return sib;
		}
	}
	return null;
}

