javascript to handle contact modal