Hide empty tabs using javascript