function init() 
{
    if (arguments.callee.done) return;
    arguments.callee.done = true;
  	if($("3cols_layer")) { resize(); }   
	if($("2cols_layer")) { resize2(); }     
	atarget();
};
//for advanced browsers
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", init, false);
} else if ( document.attachEvent ) // IE
{   try { var isFrame = window.frameElement != null } 
	catch(e) {}	 
    if ( document.documentElement.doScroll && !isFrame ) 
	{   function tryScroll()
		{
	        if (arguments.callee.done) return
	        try { document.documentElement.doScroll("left"); init(); } 
			catch(e) { setTimeout(tryScroll, 10) }
        } tryScroll();
    }
}
//for other browsers
window.onload = init;

function resize() 
{
	var main = $("main");
	var first_block = $("first_block");
	var second_block = $("second_block");
	var third_block = $("third_block");
	newHeight = Math.max( first_block.offsetHeight, second_block.offsetHeight, third_block.offsetHeight ) + "px";
	first_block.style.height = newHeight; second_block.style.height = newHeight; third_block.style.height = newHeight;  
	return false;
}
function resize2() 
{
	var main = $("main");
	var first_block = $("first_block");
	var second_block = $("second_block_2cols");
	newHeight = Math.max( first_block.offsetHeight, second_block.offsetHeight ) + "px";
	first_block.style.height = newHeight; second_block.style.height = newHeight; 
	return false;
}

