function toggle_search_forms() {    
    jQuery('#search_container:visible').slideToggle('slow', function() {jQuery('#fast_nav_container').slideToggle('clip');});
    jQuery('#fast_nav_container:visible').slideToggle('slow', function() {jQuery('#search_container').slideToggle('clip');});
}

var error_msg = '';

function check_login_form() {
    var fields = jQuery(':input', document.login_form);
    if (!fields.filter('[name=email]').val() || !fields.filter('[name=pwd]').val()) {
        jQuery.msg_info('Пожалуйста, введите свой email и пароль.');
        return false;
    }
    var options = {                  
            url:  '../login.php',
            type: 'POST',
            success: function(msg) {
                if (msg == 'member') {
                    location.assign('http://www.bfx.ru/profile/');
                } else {
                    jQuery.msg_info(msg);
                }
                return false;
            }
    }; 
    jQuery(document.login_form).ajaxSubmit(options);
    return false;    
}
function check_reminder_form() {
    if (!jQuery(':input[name=email]', document.reminder_form).val()) {
        jQuery.msg_info('Пожалуйста, введите свой email.');
        return false;
    }
    var options = {                  
            url:  '../forgot.php',
            type: 'POST',
            success: function(msg) {
            jQuery.msg_info(msg);
                return false;
            }
    }; 
    jQuery(document.reminder_form).ajaxSubmit(options);
    return false;    
}
function toggle_forms() {    
    jQuery('#login_panel_container:visible').slideToggle('slow', function() {jQuery('#reminder_panel_container').slideToggle('clip');});
    jQuery('#reminder_panel_container:visible').slideToggle('slow', function() {jQuery('#login_panel_container').slideToggle('clip');});
}

jQuery(function(){
    jQuery('#fast_nav').change(function(){
        if (jQuery(this).val()) {
            location.assign(jQuery(this).val());
        }
    });
    jQuery('input[name=email]').focus(function(){
        if (this.value == 'e-mail') {
            this.value = '';
        }
    });
    jQuery('input[name=email]').blur(function(){
        if (this.value == '') {
            this.value = 'e-mail';
        }
    });
    jQuery('#pwd_text').focus(function(){
        jQuery(this).hide();
        jQuery('#pwd').show().focus();
    });
    jQuery('#pwd').blur(function(){
        if (this.value == '') {
            jQuery(this).hide();
            jQuery('#pwd_text').show();
        }
    });
});
