Код:
<script type="text/javascript">
var a =document.getElementById('pun-status').innerHTML
if (a.indexOf("Гость")!=-1)
{document.getElementById('pun-status').innerHTML="<div class='formal'>"+"<form id='login'"+" class='container'"+" method='post'"+" action='http://testingmyforum1.4bb.ru/login.php?action=in'"+" onsubmit='return my_form(this)'>"+"<fieldset><legend><span>Введите ваше имя и пароль ниже</span></legend><div class='fs-box inline'>"+"<input type='hidden'"+" name='form_sent'"+" value='1' />"+"<input type='hidden'"+" name='redirect_url'"+" value='index.php' />"+"<p class='inputfield required'>"+"<label for='fld1'>Имя <em>(Обязательно)</em></label><br />"+"<span class='input'>"+"<input type='text'"+" id='fld1'"+" name='req_username'"+" size='25'"+" maxlength='25' /></span></p>"+"<p class='inputfield required'>"+"<label for='fld2'>Пароль <em>(Обязательно)</em></label><br />"+"<span class='input'>"+"<input type='password'"+" id='fld2'"+" name='req_password'"+" size='16'"+" maxlength='16' /></span></p></div></fieldset>"+"<p class='formsubmit'>"+"<input type='submit'"+" class='button'"+" name='login'"+" value='Войти' /></p></form></div>"}
function my_form(the_form)
{
var element_names = new Object()
    element_names["req_username"] = "Имя"
    element_names["req_password"] = "Пароль"

if (document.all || document.getElementById)
{
    for (i = 0; i < the_form.length; ++i)
    {
    var elem = the_form.elements[i]
    if (elem.name && elem.name.substring(0, 4) == "req_")
    {
        if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
        {
        alert("\"" + element_names[elem.name] + "\" это поле обязательно для заполнения в этой форме.")
        elem.focus()
        return false
        }
    }
    }
}

return true
}
</script>