//login and restore forms
$(document).ready(function(){

	$(".enter").toggle(
		function(){
			$(".login_form").fadeIn("fast");
		},
		function(){
			$(".login_form").fadeOut("fast");
			$(".restore_form").fadeOut("fast");
	});

	$(".forgot_link").click(function(){
		$(".login_form").hide();
		$(".restore_form").show();
		return false;
	});

	$('.remember_link').click(function(){
		$('.restore_form').hide();
		$('.login_form').show();
		return false;
	});
});

//post z-index for IE
$(document).ready(function() {
    var zIndexNumber = 1000;
    $('div.post').each(function() {
        $(this).css('zIndex', zIndexNumber);
        zIndexNumber -= 1;
    });
});

//hide selected tag
$(document).ready(function(){
	$(".close").click(function(){
		$(".tags_holder").fadeOut("slow");
		return false;
	});
});

//hint
$(function(){
    $('INPUT.hint, TEXTAREA.hint').each(function(){
        var $input = $(this);
        $input.focus(function(){
            if ($input.val() == $input.attr('title')) {
                $input.val('');
                $input.removeClass('empty');
            }
        })
        .blur(function(){
            if ($input.val().length == 0) {
                $input.val($input.attr('title'));
                $input.addClass('empty');
            }
        }).blur();
    })

    $('FORM').submit(function(){
        $(this).find('.hint.empty').val('');
    });

});
