Compatibility with phonegap 2.0 (Cordova)

With this change the plugin works perfecly on phonegap 2.0