$(document).ready(function(){
	$('.float').numeric({allow:"., "});
	$('.num').numeric();
	
	$("a#inline_reg").fancybox({ 
		'hideOnContentClick': false
	}); 
	
	$("form.login_only").submit(function(){
		if (!registred_user){
			$("a#inline_reg").click(); 
			return false;
		}
		return true;
	});
	
	$("a.login_only").click(function(){
		if (!registred_user){
			$("a#inline_reg").click(); 
			return false;
		}
		return true;
	});

    $('.edit .comment_spam_button').click(function(){
        var button = $(this);
        if (confirm('Вы уверены?')){
            $.post('/forum/spamComment', {comment_id: button.attr('comment_id')}, function(result){
                button.attr('title', result);
            });
        }
        return false;
    });

    $(".modal_window_link").fancybox({
        'hideOnContentClick': false,
        'width' : 420,
        'padding': '15',
        'autoDimensions': false
    });

// Всплывающее окно на подозрительные сообщения
    $('.modal_window_suspect_check').fancybox({
        'autoDimensions': false,
        'height' : 250,
        'width' : 420,
        'modal' : true,
        'padding': '15'
    });

    $('.modal_window_suspect_check').click();

    $('#fancy_outer').delegate('.change_captcha', 'click', function(){
       $('.captcha', $(this).closest('FORM')).attr('src', '/captcha.php?'+Math.random());
       $('INPUT[name="captcha"]', $(this).closest('FORM')).attr('value', '');
       return false;
   });
});
