tidied up js and updated htmlResponse to accept GET-Param "frame=none" to
just deliver an html snippet without applicationframe