JS error redirect handler function move

needed to find a global available function placement in case of recurring errors and set function call to window.top.fncname() to be seen in plain/iframed pages