as i had said before, error occur because you're trying to trigger a handler that isn't defined at the child window. so, the funcion alertHandler is defined on the parent and child window doesn't inherit directly the content of the parent. in order to a child window call a funcion defined on parent you need to callback the parent window with the opener property, which become a reference to the window that opened the child:
<a ... onclick='opener.alertHandler();'>...</a>
however, as i had stated before. the function might not work because statement refer to object or property where they where defined, not where they're called. what i mean is, when you click the link, the statement event.scrElement.id refer to the event object of the main window, not of the child window. you can check it by alerting the event object which will return an null value. that is because an event has not occured on the main window.
a better solution. instead of having a function that depend on the event object, you can pass a reference of the element to the handler:
<a ... onclick='opener.alertHandler(this);'>link</a>