Rotating Menu/Panels. How to stop them onRelease?

Hi all,
I got this scripts from a tutorial site. It’s a 3D rotating menu/panels, reacting to the mouse movement. On mouse click, it will expand to a certain size, but I can’t stop the rotation. How can I stop the rotation with the specified panel facing front when mouse release, and return to rotating and its original size upon second mouse click??

And, I notice it’s a little buggy, sometimes the panel shink to a smaller size. :S

Help, pleaasse! =) Many thanks!! :pleased: