dynamic display position (top/bottom)

makes the calendars show on top when the container exceeds document viewport at bottom.