title: Phonegap Online event fire only after state change
body: <p>I have to check for network connection on app start, but PhoneGap online/offline event fires after any state change to it. If the app starts in online mode, the online events doesn't fired, until it gets offline, then comes online.</p>
  
  <p>This is the code,</p>
  
  <pre><code>initialize: function() {
      this.bindEvents();
  },
  
  bindEvents: function() {
      document.addEventListener('deviceready', this.onDeviceReady, false);
  },
  
  onDeviceReady: function() {        
      document.addEventListener("offline", this.onOffline, false);
      document.addEventListener("online", this.onOnline, false);
  },
  </code></pre>
  
  <p>That's wrong with the code ?</p>