updated javascript to show/hide elements.