Theory of interfacial potential differences: effects of adsorption onto hydrated (gel) and nonhydrated surfaces