      var menuWidth = 134;
      var topCorrection = 18;
      var corrFirst = -1;
      var corrLast = 0;
      var bottonWidth = 37;
      var alignRight = true;	  
      var rightHideCartCorrect = 0;

      var nn4 = (document.layers)? true:false;
      var ie4 = (document.all)? true:false;
      var idMenu = "";
      var showedCart = false;
      var curPath = "";
	  var prods = new Array;
      var curTr;
      var curTrBgColorBuff;
      var tTrBgColor = "#E4EFFF";
	  var showed;
	  
function showCart(prod_id,prodPrice,obj,price1,price2,count,count1,count2) {
       var idBotton = 'cartLayer';
       idMenu = idBotton;
       if ((ie4)&&showedCart&&idMenu!=('menu'+ idBotton)) {
          hide(idMenu);
       }
       
	   curProdPrice = prodPrice;
	   curProdID = prod_id;
	   curProdPrice1 = price1;
	   curProdPrice2 = price2;
       curProdCount  = count;
	   curProdCount1 = count1;
	   curProdCount2 = count2;
       if (!curProdCount) {
           curProdCount = 1;
       }

        if(ie4&&document.all(idMenu)!=null){
	   calc(prods[prod_id],"");
	   setStatus(document);
	     curTr = obj.parentElement.parentElement;
		 curTrBgColorBuff = curTr.bgColor;
		 if(curTr.bgColor) curTr.bgColor = tTrBgColor;
         if(idMenu == "menu1")document.all(idMenu).style.left = calculateSumOffset(obj,"offsetLeft") - corrFirst;
         else if(alignRight)
         document.all(idMenu).style.left = calculateSumOffset(obj,"offsetLeft") + obj.offsetWidth - menuWidth + corrLast;
              else
         document.all(idMenu).style.left = calculateSumOffset(obj,"offsetLeft")/* + obj.offsetWidth/2 - menuWidth/2*/;
         document.all(idMenu).style.top = calculateSumOffset(obj,"offsetTop") /*+ obj.offsetHeight*/ + topCorrection;
         document.all(idMenu).style.visibility = "Visible";showedCart = true;}
      }

function calculateSumOffset(item, offsetName)
{
	var totalOffset = 0;
	do
	{
		totalOffset += eval('item.'+offsetName);
		item = item.offsetParent;
	} while (item != null);
	return totalOffset;
}


function hideCart(e) {
    if(showed||(showedCart&&!cartFrozen)){
      if(ie4&& document.all(idMenu)!=null&&(event.clientY + document.body.scrollTop > document.all(idMenu).offsetHeight + document.all(idMenu).offsetTop
        || event.clientY + document.body.scrollTop + bottonWidth < document.all(idMenu).offsetTop
        || event.clientX + document.body.scrollLeft > document.all(idMenu).offsetWidth + document.all(idMenu).offsetLeft + rightHideCartCorrect
        || event.clientX + document.body.scrollLeft < document.all(idMenu).offsetLeft))
          {hide(idMenu); if(showed) showed = false; if(showedCart) showedCart = false;}
      }
}

function hide(id) {
       if(ie4&&document.all(id)!=null) { document.all(id).style.visibility = "hidden";
	    if(curTr!=null&&curTr.bgColor!=null) curTr.bgColor = curTrBgColorBuff; }
}

function hideCartOnClick(e) {
// if(cartFrozen) cartFrozen = false;
 hideCart(e);
}

if(nn4||ie4){

document.onclick = hideCartOnClick;
document.onmousemove = hideCart;

}


function initPath(path){if(path!="")curPath = path + "/";}


