(function($) {

	$(document).ready(function() {
		resizeCols();
		
		$("#tmenu td div").hover(function() {
			$(this).children("a").addClass("active");
			$(this).find("div.sub").css("display","block");
		}, function() {
			$(this).children("a").removeClass("active");
			$(this).find("div.sub").css("display","none");
		}); 
		
		
	});

	$(window).resize(function() {
		if ($("#right_block")) $("#right_block").height("auto");
		if ($("#left_block")) $("#left_block").height("auto");
		resizeCols();
	});

	function resizeCols() {
		var cH = $("#container").height(); // #container height();
		var mHs = $("#main").css("padding-bottom"); // #main bottom padding;
		var mH = mHs.substring(0,mHs.length-2);
		var hH = $("#header").height(); // #main bottom padding;

		if ($("#right_block")) $("#right_block").height(cH - mH - hH - 10);
		if ($("#left_block")) $("#left_block").height(cH - mH - hH - 10);
	}

})(jQuery); 

