function _eval(object) {
	if(document.getElementById)return document.getElementById(object);
	if(document.all)return eval('document.all.'+object); return false;
}

function show(menu, submenu) {
	coords = findPos(menu);
	_eval(submenu).style.left = coords[0] + 'px';
	max_w = (window.innerWidth ? window.innerWidth : document.body.clientWidth);
	if (navigator.appName=='Netscape') {
		_eval(submenu).style.top = coords[1] + menu.offsetHeight + 'px';
	} else {
		_eval(submenu).style.top = coords[1] + menu.offsetHeight+1 + 'px';
	}
	_eval(submenu).style.display = 'block';
	
	if (_eval(submenu).offsetLeft + _eval(submenu).offsetWidth > max_w) {
		leftcor = max_w - _eval(submenu).offsetWidth;
		if (navigator.appName=='Netscape') {
			leftcor = max_w - _eval(submenu).offsetWidth - 19;
		}
		_eval(submenu).style.left = leftcor + 'px';
	}

}

function hide(submenu) {
	_eval(submenu).style.display = 'none';
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	return [curleft,curtop];
	}
}

function checkheight() {
	if (_eval("news").offsetHeight > (_eval("mcont").offsetHeight - 102)) {
		_eval("mcont").style.height = (_eval("news").offsetHeight - 102) + 'px';
	}
}

function scheme() {
	newwindow('/scheme.html',610,767);
	return false;
}

function newwindow(addr,w,h) {
max_h = (window.innerHeight ? window.innerHeight : document.body.clientHeight);
max_w = (window.innerWidth ? window.innerWidth : document.body.clientWidth);
l = parseInt((max_w-w)/2);
t = 100;
if (h > max_h - 150) {
	h = 600;
}
pop = window.open(addr,'','left='+l+',top='+t+',width='+w+',height='+h+',toolbar=no,status=yes,scrollbars=yes,resize=yes,menubar=no');
}


