Detect if app is being accessed in offline mode and change attribute value

I'm working on an offline app and need to be able to detect if the device on which the app (phonegap) is being viewed is currently offline. How would i be able to detect this? What would be the best way to alter the value of an attribute when the device is detected to be in offline mode? I don't need to necessarily save the attribute back to the object but just want to show a modified value. If anyone has done something similar before and could provide some pointers/examples?
1 answers

The functionality (MF's) in offline modus are known to you right, why dont you associate a custom attribute when entering these areas of offline functionality?