Код:
<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>