logHtml =
		'<form action="" method="post" onsubmit="return logFormChk();">' +
		'<label for="lu">Логин</label>' +
		'<input name="lu" id="lu" type="text" onkeyup="logFormChk();" />' +
		'<br style="clear:both;" />' +
		
		'<label for="pu">Пароль</label>' +
		'<input name="pu" id="pu" type="password" onkeyup="logFormChk();" />' +
		'<br style="clear:both;" />' +
		
		'<input type="checkbox" value="1" name="rem" id="rem" checked="checked" style="margin-left:50px;" /> <label for="rem">запомнить</label>' +
		'<br style="clear:both;" />' +
		
		'<label for="submit">&nbsp;</label>' +
		'<input type="submit" disabled="disabled" id="logFormSubmit" value="Войти" />' +
		'<br style="clear:both;" />' +
		'</form>';

function logForm(src1) {
	
	if ( typeof(dest1) != "undefined" ) {
		dest1.parentNode.removeChild(dest1);
		delete dest1;
		
		src1.innerHTML = 'Вход';
		src1.style.color = 'blue';
		return false;
	}

	src1.innerHTML = 'Закрыть';
	src1.style.color = 'red';
	
	
	dest1 = document.createElement('div');
	dest1.style.display = 'block';
	dest1.innerHTML = logHtml;
	src1.parentNode.appendChild(dest1);
	return false;
}

function logFormChk() {
	if ( document.getElementById('lu').value=='' || document.getElementById('pu').value=='' ) {
	
		document.getElementById('logFormSubmit').setAttribute('disabled','disabled');
		return false;
	} else {
	
		document.getElementById('logFormSubmit').removeAttribute('disabled');
	}
	
}