Well did you write a function named "camera_ToggleViewMode" in your script before the main function (best place to put this is in the camera code section of course).

See point #2 of my first post, thats all the function "camera_ToggleViewMode" needs to do in your case.