YUI().use( 'node', function(Y) {
    var pageList = Y.all('#content .paginated');
	var curPageIndex = 0;

	Y.one('#content .next').on('click', function(e) {
		e.preventDefault();
		if (pageList.item(1)) {
			if (pageList.item(curPageIndex+1)) {
				pageList.item(curPageIndex+1).addClass("active");
				pageList.item(curPageIndex).removeClass("active");
				curPageIndex++;
			}
			else {
				pageList.item(0).addClass("active");
				pageList.item(curPageIndex).removeClass("active");
				curPageIndex=0;
			}
		}
	});
    
});
