js function to tell if a given element is really visible on a page