var a = window.open('', 'hw', 'height=192', 'width=256');
b = a.document;
b.appendChild(b.createElement('html'));
c = b.getElementsByTagName('html')[0];
c.setAttribute('lang', 'en-US');
c.setAttribute('xmlns', '
http://www.w3.org/1999/xhtml';);
c.appendChild(b.createElement('head'));
c.appendChild(b.createElement('body'));
c.childNodes[0].appendChild(b.createElement('title'));
c.childNodes[0].childNodes[0].appendChild(b.createTextNode('Saying Hello'));
c.childNodes[0].appendChild(b.createElement('link'));
c.childNodes[0].childNodes[1].setAttribute('rel', 'stylesheet');
c.childNodes[0].childNodes[1].setAttribute('type', 'text/css');
c.childNodes[0].childNodes[1].setAttribute('href', 'showoff.css');
c.childNodes[1].appendChild(b.createElement('p'));
c.childNodes[1].childNodes[0].appendChild(b.createTextNode('Hello World!'));
//and then your popup blocker squelches this
//yeah, hay, anyone know how to insert the encoding and doctype without resorting to .innerHTML?