Validate your html code.
First off, there is no element called <head tag>, it's called <head>.
Secondly, you have to properly nest elements. You can't close an element before closing its child elements (<body tag><body></body tag> is incorrect). Either (assuming there was an element called <body tag> which there isn't, but this is to display nesting, not existing elements)
<body tag></body tag>
<body>...</body>
or
<body tag>
<body></body>
</body tag>
Finally, if I understand you correctly, what you want is called a modal dialog or modal popup (keyword modal). However, doing this requires a lot more than a few lines of code, especially if you want to support IE6.
A simple web search for modal dialog window or modal dialog popup should give you some examples.
But I recommend that you make use of an existing js library for this. There should be one for whatever js framework you prefer. For example, both ModalBox and Lightbox Gone Wild are written using the Prototype & Scriptaculous frameworks.