Total reflection and tunneling of transient waves at a layer