$(document).ready(function(){
	$("#search_field").click(function(){$(this).val("");});
	treeViewMenu();
	fluidDivTags();
});

function treeViewMenu(){
	$("#left_menu").find("ul li ul").hide();
	$("#lm_list li").click(function(){
		if($(this).children("ul").attr("class")=="opened"){
			$(this).children("ul").hide();
			$(this).children("ul").removeClass("opened");
			fluidDivLeft();
		}else{
			$(this).children("ul").show();
			$(this).children("ul").addClass("opened");
			fluidDivLeft();
		}
	});
}

function fluidDivTags(){
		$("#center_content_container").height($("#main_container").height()-390);
		$("#cc_center").height($("#center_content_container").height()-70);
}

function fluidDivLeft(){
	leftH = $("#left_menu").height()+$("#articles").height()+$("#calc").height()+$("#menu-list").height()+$("#last-articles").height();
	if($("#center_content_container").height() < leftH){
		$("#center_content_container").height(leftH+200);
		$("#cc_center").height($("#center_content_container").height()-70);
	}
}
