from bge import logic
def main():
scene = logic.getCurrentScene()
cont = logic.getCurrentController()
own = cont.owner
regiment = own.parent
over = cont.sensors['Mouse_Over']
click = cont.sensors['Mouse_Click']
if regiment['active']==True:
if over.positive and click.positive:
regiment['active'] = False
elif regiment['active']==False:
if over.positive and click.positive:
regiment['active'] = True
main()