Added callback option for open/close events

Thanks for sharing this nice script :-)