Resonant tunneling of Bose-Einstein condensates in optical lattices