Server side script
after MANGO upgrade to v.1.8.1 (last version available) the control statement if (expr) then ... do not work any more. I've tested also the mango example page in the function "toggle", have the same problem I've found in my code. I you are in the ON sate yu can go to the OFF state. But it is impossible to go back to ON by clicking on TOGGLE. :(
This is a bug. A fix will be included in 1.8.2.