Outsourced toggle script for menu