This sort of thing often happens in FrontPage and similar WYSIWYG/visual editors, when you paste the button code in raw-code HTML view first and then switch to Visual mode and start moving buttons around visually. As you have discovered, this can yank the menus/buttons outside of the rest of the code we provide that actually makes those menus/buttons work!
It's kind of like taking the volume knob off your car radio and sticking it on your trunklid to control the radio while you're having a tailgate cookout -- it doesn't work because the knob by itself doesn't control the volume, it connects to something inside the radio that controls the volume, and those parts are still inside your dashboard in the car! Likewise, when you move our menus/buttons around in Visual editing mode, it leaves other functional parts of the code behind wherever you last left them in HTML code view, and the menus/buttons don't work by themselves without being "hooked up" to those other parts.
A good approach to deal with this is to start by putting some placeholder text like XXXXX where you want the buttons to appear in Visual mode, move that around and format it however you wish, then once you've got that settled, switch to HTML mode and replace the placeholder XXXXX with our actual, complete button code. ;^)