mimic jquery's show/hide function for items