var sunt_cu_mausul_pe_bara = false

function bara_init(update_interval) {
	//bara show-hide animations
	$("#hide_footer")
	.click(function() {
		$("#footer_fixed")
		.slideUp()
		
		$("#arata_bara")
		.slideDown()
		
	//	$.cookie('hide_bara', 'true', {expires: 30, path: '/', domain: 'trilulilu.ro'})
	})
	
	$("#show_footer")
	.click(function() {
		$("#arata_bara").slideUp()
		
		$("#footer_fixed").slideDown()
		
		//$.cookie('hide_bara', null, {expires: -30, path: '/', domain: 'trilulilu.ro'})
	})
	
	//click pe butoanele din bara
	$('.footer_tab_button, .footerbar_title span')
	.click(function() {
		toggler = $(this).is('.footer_button_on') || $(this).is('span')
		
		$('.footer_tab_holder').hide()
		$('.footer_button_on').removeClass('footer_button_on')
		
		if (!toggler) {
			holder = $('#' + $(this).attr('id').replace(/_tab_/, '_'))
			holder.show()
			$(this).addClass('footer_button_on')
			
			loader = $('[tag=loader]', holder)
			if (loader.length) {
				$('.' + holder.attr('id') + '_content')
				.load(
					$(loader).attr('href')
				)
			}
		}
		
		if ($(this).is('#footer_tab_notificari')) {
			$(this)
			.removeClass('footer_button_flashy')
		}
	})


	
}

function bara_mesaje_reload(with_mass, delete_message_id, page) {
	$(delete_message_id ? '#bara_mesaje_sterge_loader_' + delete_message_id : '.footer_mesaje_content')
	.html('<img src="http://static.trilulilu.ro/images/loader.gif" />')
	
	$('.footer_mesaje_content')
	.load(
		'/source/bara/bara_mesaje.php?u=' + _username,
		{
			with_mass			: with_mass ? 1 : 0,
			delete_message_id	: delete_message_id,
			page				: page
		}
	)
}


