JS isn’t my area either but as you are using jquery it would be:
$(this).hide();
Not:
this.hide();
However I don’t quite follow the logic? You are opening the menu on click and closing it on click but now you also want it to close when you hover away? That doesn’t make any sense and would confuse the user and indeed if you hide it then you can’t get it back again as it won’t be there (unless you are clicking something else to show it again). If you just wanted a hover menu then you can do that in CSS anyway.
You may need to define your logic a little more depth and then I’m sure one of the JS experts here can help you
Your menu should be in a list structure rather than bare anchors (or at least a nav tag).
Also as you are using jquery you may as well use it for the other routines as shown in my code. Keep the onclick handlers out of the html and back in the js where they belong.
Don’t try and change css with js (most of the time). Just add and remove classes so the whole lot can be controlled through css.