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

  var windowSize      = document.viewport.getHeight();
  //var frameHeight     = $('frameContainer').getHeight();
  //alert("Content:" +contentHeight+ " Left:" +leftHeight+ " Top:" +topHeight+ " Window" +windowSize);
  if(totalHeight > windowSize-100) {
  	$('footerRow').setStyle({ position: 'static'}).addClassName('clearingItem');
  } else if(totalLeftHeight > windowSize-100) {
  	$('footerRow').setStyle({ position: 'static'}).addClassName('clearingItem');
  } else {
  	var content = windowSize - topHeight - historyHeight - 25;
  	$('contentFrame').setStyle({height: content+"px"});
  }
}

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 = $('')
}

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

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

function showProductInfo(iResourceId,iLangId) {
	//$('mainIndicator').show();
	new Ajax.Request(
	'<?php print $this->sAbsoluteRoot?>ajaxRequest/'+iResourceId+'/getResourceContent/'+iLangId+'.htm',
	{
		method: 'get',
		onFailure: function() {
			alert('FATAL ERROR!');
		},
		onSuccess: function(transport) {
			sContent = transport.responseText;
			$('contentFrame').update(sContent);
			//$('mainIndicator').hide();
		}
	}
	);//end - ajax-request
}