JavaScript utility that determines whether an element is completely within the browser viewport