ayerPopup.offsetHeight + 20  <  window.pageYOffset + gBsClientHeight) {
			nEventY += 20;
		} else {
			nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
		}

		if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
			if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
				nEventX = 5;
			} else {
				nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
			}
		} else {
			nEventX += 20;
		}
		layerPopup.st