Light refraction

This app shows the refraction of a light beam when passing from a medium to another. Use the sliders and to set the values of the refractive indexes of the media, then move around the position of the light source.
See what happens when increases or decreases. Try putting the light source in medium 2 and see what happens the incident angle is wide enough. Can you obtain the same result when the source is in medium 1?