Complexing of nickel(II) and cobalt(II) by a polymethacrylic acid gel and its linear polyelectrolyte analog