You can access to the document by 'ext' variable at the client side.
ext.item holds item values and attributes for the document.
ext.item[ '@noteid' ] keeps the note id for the document.
ext.item[ '@unid' ] keeps the unid for the document.
You can look at all of the properties by changing alert() statement to console.dir(ext.item) and run it using Firefox browser.