function turnpage(elements) { for (var i = 0; i < elements.length; i++) if (i == curpage) { $w(elements[i]).show(); } else { $w(elements[i]).hide(); } };