added save before leave functionality
`onkeypress` changed to `onchange` 

Codes works well with `onchange`  as pointed out. Lets have the `window.rezPageSaved = false;` on `onchange` event.
Merge pull request #65 from agentmilindu/master

Resource Pages - Fails to prompt the user of unsaved changes when leaving the page