function openResCategory(iCatId) {
  var ProductsBlock = $('catContainer_'+iCatId);
  var currentStatus = ProductsBlock.getStyle('display');
  var ProdContainer = $$('div.productContainer');
  var iProdCount    = ProdContainer.length;
  var i             = 0;
  for (i;i<iProdCount;i++) {
  	ProdContainer[i].hide();
  }
  if (currentStatus == 'none') {
  	ProductsBlock.setStyle({display: "block"});
  } else {
    ProductsBlock.setStyle({display: "none"});
  }
}

function closeResBlock(iResId) {
	var bigBlock = $('ResCatResourceBox_'+iResId);
	var smallBlock = $('resLittle_'+iResId);
	
	//bigBlock.setStyle({display: "none"});
	//smallBlock.setStyle({display: "block"});
	bigBlock.hide();
	smallBlock.show();
	return false;
	}

function openResBlock(iResId) {
	var bigBlock = $('ResCatResourceBox_'+iResId);
	var smallBlock = $('resLittle_'+iResId);
	
	//bigBlock.setStyle({display: "none"});
	//smallBlock.setStyle({display: "block"});
	bigBlock.show();
	smallBlock.hide();
	return false;
	}


function openNewsBlock(iContentId, sOpener, sClose) {
	  var newsBlock = $('hContent_'+iContentId);
	  var descBlock = $('sDescription_'+iContentId);
	  var currentStatus = newsBlock.getStyle('display');

	  if (currentStatus == 'none') {
	  	$('openerBtn_'+iContentId).innerHTML = '&raquo;'+sClose;
	  	newsBlock.setStyle({display: "block"});
	  	descBlock.setStyle({display: "none"});
	  } else {
	    $('openerBtn_'+iContentId).innerHTML = '&raquo;'+sOpener;
	    newsBlock.setStyle({display: "none"});
	  	descBlock.setStyle({display: "block"});
	  }
	}

function hideProdContainer() {
	$('resourceDetailFrame').hide();
}

function movingFooter() {
    var contentHeight   = $('contentFrame').getHeight();
    var leftHeight      = $('leftFrame').getHeight();
    var topHeight       = $('topFrame').getHeight();
    var totalHeight     = contentHeight+topHeight;
    var totalLeftHeight = leftHeight+topHeight;
    var footerTop       = $('footerRow').getStyle('top');

    var windowSize      = document.viewport.getHeight();
    var frameHeight     = $('frameContainer').getHeight();

    if(totalHeight > windowSize) {
    	$('footerRow').setStyle({ position: 'static'}).addClassName('clearingItem');
    } else {
    	var content = windowSize - topHeight - 40;
    	$('contentFrame').setStyle({height: content+"px"});
    }

    //alert(totalHeight+" "+frameHeight+" "+contentHeight);
    /*if (footerTop != null) {
      var footerTopValue = footerTop.split('px');
    }
    else {
    	var footerTopValue = 0;
    }

    if ((totalHeight > footerTopValue[0]) || (totalLeftHeight > footerTopValue[0])) {
       //var marginBottom = totalHeight-footerTopValue[0];

       $('footerRow').setStyle({ position: 'static'}).addClassName('clearingItem');
    }*/
    //Event.observe(window, 'resize', movingFooter);
}
function init() {
var aMenus     = $$('#leftFrame > ul ul');
var iMenuCount = aMenus.length;
var oUpperLi   = null;

//	alert(iMenuCount);

  for (i = 0; i < iMenuCount; i++) {
	var oActiveMenu = aMenus[i];
	if (((oUpperLi = oActiveMenu.up('li')).hasClassName('active')) || (oActiveMenu.down('.active'))) {
		oActiveMenu.show();

		if (oUpperLi) {
			oUpperLi.addClassName('active');
		}
	} else {
		oActiveMenu.hide();
	}

	oUpperLi = null;
  }
}
function invisibleMenu () {
 var menuField = $('')
}

