

	var activeTree = -1 ;
	function changeTree(which) {
		if (treeOpen[which]) {
				for (i in treeItems[which]) removeElem(treeItems[which][i]);
				treeOpen[which] = false;
				if( activeTree == which )
 					activeTree = -1;
		} else {
				for (i in treeItems[which]) {
				putElem(treeItems[which][i]);
			}
		treeOpen[which] = true;
		if( activeTree!=-1 && which!=activeTree)
			changeTree(activeTree);
		activeTree = which;
	   }
	}

	function putElem(elemId) {
	  getElem(elemId).style.display = "block";
  }

	function removeElem(elemId) {
		getElem(elemId).style.display = "none";
	}

	var selId = 0;

function mover(mId){
 if( mId.parentNode.id != 'menu'+selId )
	mId.parentNode.style.background='url(/i/bg_menu_2.gif)';
}
function mout(mId){
 if( mId.parentNode.id != 'menu'+selId )
	mId.parentNode.style.background='url(/i/bg_menu_1.gif)';
}

function setSel(mId){
   getElem(mId).style.background='url(/i/bg5.gif)';
}
function setSels(mId){
    getElem(mId).className='secondlevelselect';
}
function setSelmup(mId){
    getElem(mId).style.background='#AEB5C5';
}

function getElem(mId)
{
   if (ie)
       return document.all[mId];
	else
	  return document.getElementById(mId);
}
function BigImage(img,w,h)
{
  var obj_window = window.open(img,"","toolbar=no,directories=no,status = no,resizable=yes,menubar=no,scrollbars=auto,width="+w+"pt, height="+h+"pt");
  obj_window.focus();
}

function showWnd(url, width, height)
{
	var newx = width+50;
	var newy = height+115;
	wnd = window.open(url, null, "height=" + newx + ", width=" + newy + ", top=" + (window.screen.availHeight / 2 - height / 2) + ", left=" + (window.screen.availWidth / 2 - width / 2) + ", status=yes, toolbar=no, menubar=no, location=no", true);
	
	if(wnd)
	{
		wnd.focus();
		wnd.moveTo(window.screen.availWidth / 2 - width / 2, window.screen.availHeight / 2 - height / 2);
		

		wnd.resizeTo(newx, newy);
		
		if(!wnd.opener)
			wnd.opener = self;
	}
	return wnd;
}
