wrapping the javascript hide in a function