Ah! Sorry, my fault for not making it clear.
The JavaScript is invoked by the ‘Calculate’ button in the M1 design. You will see in the Design Centre – if you click on the button, its properties are displayed on the right hand panel. The important part is the Actions section. I have selected ‘Run JavaScript’ for the ‘On Click’ event and in the associated ‘Code:’ window (accessed by clicking the tiny ‘…’ button on the right) I have invoked the _custom.js by the code snippet “return Calculation();”.
I hope this is now more easy to understand.
If in your future pages of the development you need to access the computed values of CF & ICR this is facilitated by moving the declaration of these variables outside the function thus making them globals.