Polling based network status inside PhoneGap