

function popWinOpen(winW,winH,sUrl,sName,iResize,iScroll,iStatus) {
	if (screen) {
		if ((screen.height - winH) < 150) {
			var winX = (screen.width - winW) / 2;
			var winY = 0;
		} else {
			var winX = (screen.width - winW) / 2;
			var winY = (screen.height - winH) / 2;
		}
		var popWindow = window.open(sUrl,sName,"resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH + ",top=" + winY + ",left=" + winX + "");
		if (popWindow) popWindow.focus();
	} else {
		window.open(sUrl,sName,"resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH);
	}
}

function getElementTop(el) {
	try {
		if (!el && this) {
			el = this ;
		}
		var posTop = el.offsetTop ;
		var elPar = el.offsetParent ;
		while (elPar != null) {
			posTop += elPar.offsetTop ;
			elPar = elPar.offsetParent ;
		}
		return isNaN(posTop) ? -1 : posTop;
	} catch (e) {
		return -1 ;
	}
}