This could possibly be achieved with a script.
The problematic part is identifying whether the user has internet access or not...
One possible way of doing that is to try to open a PDF file in a known location (on the web), and see if that works.
Unfortunately it isn't possible with just the JS API, as there's no timeout for a link to a remote URL - it's passed to the user's Web browser, and the browser won't return anything even if the file *was* opened. The app.openDoc() method won't pull remote content unless it's on a WebDAV server.
It's possible to sniff for specific network access using rich media, but it won't guarantee an accurate response as the user may have a network but chooses to deny the security dialog you see whenever a local PDF pings a remote host. It's also highly annoying if the ping is fired every time the document opens. I'll cover this workflow in an upcoming tutorial, stay tuned!