JavaScript cannot see the ItemInserting event as it is code-behind (running on the server, not the browser). If you want to run JavaScript when inserting, add an onClientClick event to your Insert button on the form and execute the JavaScript there.
'Howard