Compatibility with all phonegap versions

Fixed compatibilty changes under phonegap plugin specifications.
Compatibility with phonegap 2.0 (Cordova)
Merge pull request #992 from aetchegoyen/master

Compatibility with phonegap 2.0 (js and java) (Cordova) and previuos versions (in JS file)