function getRealOffsetLeft(objSource) {
	var iLeft = 0;
	while(objSource != null) {
		iTemp = parseInt(objSource.offsetLeft);
		if (!isNaN(iTemp)) { iLeft = iLeft + iTemp; }
		objSource = objSource.parentNode
	}
	return iLeft;
}

var iCenterMenuCurrent = 272;

function openCenterMenu(iId, objSource, bDisable) {
	if (iCenterMenuCurrent>0) {
		document.getElementById('CenterMenuSub_'+iCenterMenuCurrent).style.display = 'none';
	}

	if (bDisable) {
		for (i=0; i<document.getElementsByTagName("*").length; i++) {
			if (document.getElementsByTagName("*").item(i).className == "menu_on"){
				document.getElementsByTagName("*").item(i).className="menu_off";
			}
		}
	}
	
	oCurrentMenuItem = objSource;
	oCurrentMenuItem.className = 'menu_on';
	var oMenuBalk = document.getElementById('CenterMenu');
	iCenter = getRealOffsetLeft(objSource)- getRealOffsetLeft(oMenuBalk) + Math.floor(objSource.offsetWidth/2);
	var oMenuSubBalk = document.getElementById('CenterMenuSub_'+iId);
	oMenuSubBalk.style.display = '';
	iCenter = iCenter - Math.floor(oMenuSubBalk.offsetWidth/2);
	if (iCenter < 0) { iCenter = 1; }
	if (iCenter+oMenuSubBalk.offsetWidth>document.getElementById('CenterMenu').offsetWidth) {
		iCenter = parseInt(oMenuBalk.offsetWidth)-oMenuSubBalk.offsetWidth;
	}
	oMenuSubBalk.style.marginLeft = iCenter;
	iCenterMenuCurrent = iId;
}

function popup (mylink, popup) {
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'popup')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, popup, 'width=400, height=150, scrollbars=no');
	return false;
}