function zoomImg(imgSrc, imgW, imgH) {
	nw = window.open('', '', 'scrollbars=yes, height=' + imgH + ', width=' + imgW + ', top=' + (screen.height-imgH)/2 + ', left=' + (screen.width-imgW)/2);
	nw.document.writeln('<BODY style="margin:0px; padding: 0px">');
	nw.document.write('<img src="' + imgSrc + '">');
	nw.document.writeln('</BODY>');
}

function popup(targetLink) {
	
	open(targetLink, '', 'scrollbars=yes, width=600, height=400, left='+(screen.width-600)/2+', top='+(screen.height-400)/2)
}

var activeMenu = 'about';
var menuTimeout;

function showMenu(eName, lPos, tPos) {

	clearMenu();
	
	//alert(document.body.clientWidth)
	e = document.all('menu_'+eName);
	b = document.all('menu_back');
	i = document.all('menu_img');
	
	b.style.top = e.style.top = tPos+12;
	if(eName != 'links')
		b.style.left = e.style.left = lPos;
	else {
		b.style.left = e.style.left = null;
		b.style.right = e.style.right = 10;
	}
	i.height = e.offsetHeight;
	i.width = e.offsetWidth;
	
	activeMenu = eName;
}

function clearMenu() {
	
	e = document.all('menu_'+activeMenu);
	b = document.all('menu_back');
	b.style.top = e.style.top = -1000;
	b.style.left = e.style.left = -1000;
	
	dropTimeout()
}

function hideMenu() {

	menuTimeout = setTimeout('clearMenu()', 1000);
}

function dropTimeout() {
	
	clearTimeout(menuTimeout);
}

function trOver(e) {
	e.className = 'tr_over';
}
function trOut(e) {
	e.className = 'tr_out';
}

function renameItem(trg) {
	frm = document.forms['rename'];
	frm.id.value = trg;
	if(frm.newname.value = prompt('Переименовать раздел', ''))
		frm.submit();
}
