function settab(name, cursel, n) { for (i = 1; i <= n; i++) { var menu = document.getelementbyid(name + i); var con = document.getelementbyid("con_" + name + "_" + i); menu.classname = i == cursel ? "hover" : ""; con.style.display = i == cursel ? "block" : "none"; } }