Using HTML5 Offline Application Cache Events In Javascript