script handling calendar, and next step with validation for  index page