Added simple validator for forms. Added close events for popups