var loginDialog; var registerDialog; function LoginForm(newLocation) { newLocation = (typeof newLocation == 'undefined' ? window.location.href : newLocation); return "
Логин:
Пароль:
Зарегистрироваться
"; } function crLoginDialog() { if (loginDialog == null) { loginDialog = document.createElement('div'); document.body.appendChild(loginDialog); loginDialog.outerHTML = "
X

Введите, пожалуйста, логин и пароль.

" + LoginForm() + "
"; loginDialog = document.getElementById('LoginDialog'); } else loginDialog.classList.add('shown'); } function RegisterForm(newLocation) { newLocation = (typeof newLocation == 'undefined' ? window.location.href : newLocation); return "
Логин:
Пароль:
e-mail:
ФИО:
Поток:
"; } function crRegisterDialog() { if (registerDialog == null) { registerDialog = document.createElement('div'); document.body.appendChild(registerDialog); registerDialog.outerHTML = "
X

Регистрация

" + RegisterForm() + "
"; registerDialog = document.getElementById('RegisterDialog'); } else registerDialog.classList.add('shown'); } function checkLoginForm() { var checkForm=document.forms['loginForm']; if (checkForm['password']==null || checkForm['password'].value == '' || checkForm['login']==null || checkForm['login'].value == ''){ document.getElementById('loginerror').style.display='inline'; return false; } else return true; } function checkRegistrForm() { var checkForm=document.forms['RegisterForm']; var emailChecker=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i if (checkForm['password']==null || checkForm['password'].value == '' || checkForm['login']==null || checkForm['login'].value == '' || checkForm['email']==null || checkForm['email'].value == '' || checkForm['fio']==null || checkForm['fio'].value == '' || checkForm['group'].selectedIndex==0 || !emailChecker.test(checkForm['email'].value)){ document.getElementById('registererror').style.display='inline'; return false; } else return true; }