$(document).ready(function() { $("#toolbar > .don").hover(function() { $("#toolbar > .tips-don").fadeIn(400); }, function() { $("#toolbar > .tips-don").fadeOut(200); }); });

$(document).ready(function(){
	$('li', '#footer-menu').hover(footerHoverOver, footerHoverOut);
	
});

function footerHoverOver() {
	$(this).find(".sub").stop().fadeTo('fast', 1).show();
	(function($) {
		jQuery.fn.calcSubWidth = function() {
			rowWidth = 0;
			$(this).find("ul").each(function() {
				rowWidth += $(this).width();
			});
		};
	})(jQuery); 
	
	if ( $(this).find(".row").length > 0 ) {
		var biggestRow = 0;
		
		$(this).find(".row").each(function() {
			$(this).calcSubWidth();
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
		});
	
		$(this).find(".sub").css({'width' :biggestRow});
		$(this).find(".row:last").css({'margin':'0'});
	} else {
		$(this).calcSubWidth();
		$(this).find(".sub").css({'width' : rowWidth});
	}
}

function footerHoverOut() {
	$(this).find(".sub").stop().fadeTo('fast', 0, function() {
		$(this).hide();
	});
}

function login() {
	if(parseInt($("#login").css("height").replace("px","")) > 10) {
		$("#login").animate({height:0},1000);
		$("#login .subscribe").fadeOut(1000);
		$("#lienBG").animate({top:150},1000);
	} else {
		$("#login").animate({height:100},1000);
		$("#lienBG").animate({top:250},1000);
	}
}

function subscribe() {
	$("#login").animate({height:300},1000);
	$("#login .subscribe").fadeIn(1000);
	$("#lienBG").animate({top:450},1000);
}
