conditional show and hide tabs in edit view and detail view

I created a custom dropdown field in contact module. I also organized contact fields under some tabs in edit view and detail view.
I want some tabs in edit view and detail view to be shown or hidden based on the option selected in the dropdown field.
I also want some fields in edit view and detail view to be shown or hidden based on the option selected in the dropdown field.

Would you please let me know how should I do that.