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.

I have also made a check to see that doc.location is available before trying to use it.

This seems only to be a problem in the 1.3x branch.