function showCustomScrollBar(id)
{
	$(id).mCustomScrollbar("vertical",400,"easeOutCirc",1.05,"auto","yes","yes",10);
}

function initFloatingBox(autohide)
{
	if(autohide==null) {autohide = true}
	
	// cho thẻ div phía dưới dài bằng thẻ div chứa text
	var content1 = $(".box1 .content1");
	var content2 = $(".box1 .content2");
	var padding = Number(content2.css("padding-top").replace("px",""));
	content1.height(content2.height()+padding*2);
	
	if(! (location.hash=='#expand' || ! autohide)) {
		content1.hide();
		content2.hide();
	}
	
	// toggle box1
	$(".box1").find(".head2").click(function() {
		var t = $(this);
		
		$(".box1").children().each(function(){
			if($(this).parent().attr('id')==t.parent().parent().attr('id')) return;
			
			$(this).find(".arrow").removeClass("arrow-hover");
			$(this).find(".content1:visible").slideUp("fast","swing");
			$(this).find(".content2:visible").slideUp("fast","swing");
		});	
		t.find(".arrow").toggleClass("arrow-hover");
		t.parent().find(".content1").slideToggle("fast","swing");
		t.parent().find(".content2").slideToggle("fast","swing");
		
	});
}
