implementing internet connection detection on a webpage (1)