fix for doc being assumed to be window.document

I found a problem with the jasmine.HtmlReporter class. When you pass a HTML document element it should be using that to append the results into. However it was assuming that document was always passed.

I have changed this to check that the document element has a body or not to determine which element location it should append the report to.

Additionally there is a fix for assuming the doc is the window.document element.