Just using onmouseover on the main menu items will just display the submenu items and they will stay displayed.
What you might want to consider is clicking on the main menu items to display the submenu items
and use onmouseout to close the submenu items.
Here I use onclick and onmouseout in the main menu items.
This causes the submenu items to display when a main menu item is clicked.
And when you mouseout of the main menu item the submenu item will hide.
Now when you traverse from the main menu item to the submenu item you do not want the submenu item to hide until you mouseout of the submenu.
So to make this happen correctly I use onmouseover and onmouseout in the submenu items.
Example: