My editor does have an ID of Editor1 so Editor1.ClientID returns
'CE_ctl00_ContentPlaceHolder1_Editor1_Editor1_ID'
So I've used the script as-is from your example.
by using editor1.getElementsByTagName("IFrame").id i managed to find the editor's IFrame id.
However using:
'document.getElementById('<%=Editor1.ClientID%>_Frame').onclick = helloworld;'
still doesn't fire the alert when clicking inside the document.