Oh, ick.... the Moodle JavaScript cookbook is very out of date I'm afraid.
I've been trying to update the documentation in the developer wiki (http://docs.moodle./dev/YUI is a good place to start), and the documentation on the YUI website is really rather good (http://yuilibrary.com).
If you're after a decent book on YUI (not specific to Moodle) then I can highly recommend the YUI 3 Cookbook by Evan Goer. There is a PDF sample of it online somewhere. It's an O'Reilly book and I've found it useful.
So on to your code...
This is basically what the code you have above does, but using up-to-date techniques and modules:
YUI.use('node', 'moodle-core-notification', function(Y) {
// Don't set up the dialogue until it's needed
var dialogue = null;
// Use a delegate rather than on. It's much more efficient for large numbers of nodes. This one will call
// display_popup whenever anything with the class 'clickedcell' is called anywhere within the document.
Y.delegate('click', display_popup, Y.config.doc, '.clickedcell');
display_popup = function(thisevent) {
if (!dialogue) {
dialogue = new M.core.dialogue({
visible: false,
modal: true,
close: true,
draggable: true
});
dialogue.render();
}
dialogue.set('bodyContent', Y.one('#somecontent');
dialogue.show();
};
});
This should get you pointed in the right direction. You should be able to apply specific styling to the dialogue based on it's existing CSS path.
Andrew