function cpager_init(amount, listId) {
	var list = document.getElementById(listId);
	var htmlobjectcount = 0;
	for (var i = 0; i < list.childNodes.length; i++) {
		if (list.childNodes[i].nodeType == 1) {
			list.childNodes[i].style.display = (htmlobjectcount++ < amount) ? "block" : "none";
		}
	}
}

function cpager_next(amount, listId) {
	var list = document.getElementById(listId);
	var visible = false;
	var htmlobjectcount = 0;
	for (var i = 0; i < list.childNodes.length; i++) {
		if (list.childNodes[i].nodeType == 1) {
			if (list.childNodes[i].style.display == "block") {
				visible = true;
				list.childNodes[i].style.display = "none";
			}
			else {
				if (visible = true) {
					list.childNodes[i].style.display = (htmlobjectcount++ < amount) ? "block" : "none";
				}
			}
		}
	}
	if (htmlobjectcount == 0) cpager_init(amount, listId);
	var button = document.getElementById(listId + "-button");
	if (button != null) {
		if (button.style.backgroundPosition != "0% 0%") {
			button.style.backgroundPosition = "0% 0%";
		}
		else {
			button.style.backgroundPosition = "14px 0%";
		}
	}
}
