show and hide dynamic menu items.

I have login/register in my top menu, then also log out and account drop down. I can show and hide with javascript file, but it does not load fast enough so you can see the menu change after the page loads. I also tried to put the script outside of the $(document).ready(function () {}); but it's still not fast enough.

I want this to happen when the page is requested but before it's rendered to the user so they can't see the menu change in front of them, how can I do that?

am I the only one with this problem?? I hear crickets!