function checkField(id) {
    field=document.getElementById(id);
    if( field.value=='' )	
	return false
    else
	return true;		
}

function doLoginAction(action) {

    var str='';

    if( !checkField('lastname') )		     	
	str += 'Фамилия\n';

//    if( !checkField('firstname') )		     	
//	str += 'Имя\n';

//    if( !checkField('middlename') )		     	
//	str += 'Отчество\n';

//    if( !checkField('phone') )		     	
//	str += 'Телефон\n';

    if( !checkField('email') )		     	
	str += 'Электронная почта\n';

//    if( !checkField('zipcode') )		     	
//	str += 'Индекс\n';

    if( !checkField('city') )		     	
	str += 'Город\n';

//    if( !checkField('street') )		     	
//	str += 'Улица\n';

    if( !checkField('region') )		     	
	str += 'Область\n';

    if( !checkField('login') )		     	
	str += 'Логин\n';

    if( !checkField('pwd') )		     	
	str += 'Пароль\n';

    if(str.length > 0 )	{
	    alert('Ошибка! Не введены следующие поля: \n'+str);
    } else {
        	// check for passworss
	    ib1=document.getElementById('pwd');
	    ib2=document.getElementById('pconfirm');

	    if(ib1.value==ib2.value)	{
		    document.main.action.value = action;
		    document.main.submit();	
	    } else {
		alert('Введенные пароли не совпадают.');
		ib1.focus();
	    }
    }
}
