
function _updateLayers() {
	var hmain = $("#main-block")[0].offsetWidth;
	var hm = $("#center")[0].offsetWidth;
	var hr = $("#right")[0].offsetWidth;
	var hmax = hm + hr;
	if(hmax<=hmain)	{
		$("#center").css("width", hmain - hr);
	} else {
		$("#main-block").css("width", hmax);
		$("#main-block-1").css("width", hmax);
	}
}
function updateLayers() {
	setTimeout(_updateLayers, 100);
}

$(document).ready(updateLayers);
window.onresize = updateLayers;

function fromClass(domObj, param) {
	var re = new RegExp(param+"([^\\s]+)"); 
	var match = domObj.className.match(re);
	if(match)
		return match[1];
	else
		return false;
}

function printPage() {
	if (window.print) {
		setTimeout('window.print();',200);
	} else {
		alert("Нажмите Ctrl+P или выберите в меню Файл->Печать");
	}
	return false;
}

//меню
$(document).ready(function(){
	$(".menu li.pu").bind("mouseenter", function(){
		var id = fromClass(this,"id_");
		$("#sm_"+id).show();
	});
	$(".menu li.pu").bind("mouseleave", function(){
		var id = fromClass(this,"id_");
		$("#sm_"+id).hide();
	});
});

