  var isDOM = (document.getElementById ? true : false);
  var isIE4 = ((document.all && !isDOM) ? true : false);
  var isNS4 = (document.layers ? true : false);
  var isNS = navigator.appName == "Netscape";

  function getRef(id) {
    if (isDOM) return document.getElementById(id);
    if (isIE4) return document.all[id];
    if (isNS4) return document.layers[id];
  }

  function show_pop(opt) {
    var Sel = window.open ( '' + '', '_blank', 'toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no,width=400,height=500' );
  }

  function waca_shophelper() {
    var yMenuFrom, yMenuTo, yOffset,xMenuFrom, xMenuTo, xOffset, timeoutNextCheck;

    if (isNS4) {
      yMenuFrom   = ShopHelper.top;
      yMenuTo     = windows.pageYOffset + 0;
      xMenuFrom   = ShopHelper.left;
      xMenuTo     = window.innerWidth + window.pageXOffset;
    } else if (isDOM) {
      yMenuFrom   = parseInt (ShopHelper.style.top, 0);
      yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop);
      xMenuFrom   = parseInt (ShopHelper.style.left, 0);
      xMenuTo     = parseInt (document.body.clientWidth,0);
    }
    timeoutNextCheck = 10;

    if (yMenuFrom != yMenuTo) {
      yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
      if (yMenuTo < yMenuFrom)
        yOffset = -yOffset;
      if (isNS4)
        ShopHelper.top += yOffset;
      else if (isDOM)
        ShopHelper.style.top = parseInt (ShopHelper.style.top, 0) + yOffset;
        timeoutNextCheck = 0;
    }
    
    if (xMenuFrom != xMenuTo) {
      xOffset = Math.ceil(Math.abs(xMenuTo - xMenuFrom) / 20);
      if (xMenuTo < xMenuFrom)
        xOffset = -xOffset;
      if (isNS4)
        ShopHelper.left = parseInt (xMenuTo/2, 0) + 374 + 5;
      else if (isDOM)
        //ShopHelper.style.left = parseInt (ShopHelper.style.left, 0) + xOffset;
		// 
		ShopHelper.style.left = parseInt (xMenuTo/2, 0) + 374 + 5;
        timeoutNextCheck = 10;
    }
    setTimeout ("waca_shophelper()", timeoutNextCheck);
  }

  if (isNS4) {
    var ShopHelper = document["ShopHelper"];
    ShopHelper.visibility = "visible";
    ShopHelper.top = top.pageYOffset - 500 ;
    ShopHelper.left = window.innerWidth + window.pageXOffset - 147 - 20;
    if (window.scrollbars.visible == true) ShopHelper.left-= nScrollBarWidth;
    waca_shophelper();
  } else if (isDOM) {
    var ShopHelper = getRef('ShopHelper');
    ShopHelper.style.visibility = "visible";
    ShopHelper.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) - 500;
    ShopHelper.style.left = parseInt (document.body.clientWidth - 190,0);
    waca_shophelper();
  }
