phonegap specific js code integrated that checks if mobile device is connected to internet