$(function() {	
	$('ul.nav').superfish();

	// FORUM
	$('.topic:odd').addClass('stripes');
	$('.topic').hover(function(){
		$(this).find('.delete-topic').toggle();
	});

	// TEXTAREA HEIGHT ANIMATION
	var textAreaHeight = $('#post_message_to_stream_message').css('height');
	var divHeight = $('.status-message').css('height');
	
	var $postMessageBox = $('.status-message');
	var $postMessage = $('#post_message_to_stream_message');
	
	$postMessage.css('overflow', 'hidden');
	$postMessage.focus(function() {
		$(this).css('overflow', 'visible').stop(true, true).animate( { height: '100px' }, 0.6 * 1000 );
		$postMessageBox.animate( { height: '110px' }, 0.6 * 1000 );
	});
	$postMessage.blur(function() {
		$(this).css('overflow', 'hidden').stop(true, true).animate( { height: textAreaHeight }, 0.5 * 1000 );
		$postMessageBox.animate( { height: divHeight }, 0.5 * 1000 );
	});
	
	// Profile Avatar
	$(window).load(function() {
		var avatarSize = $('#member-profile').find('img.avatar').width(),
			avatarMargin = avatarSize + 20,
			memberProfile = $('#member-profile').find('.profile-head');
		if ( avatarSize != 130 ) {
			memberProfile.css('margin-left', avatarMargin);
		}
	});
});
