<!--
oDrop=new Array();
oTop=new Array();
oBut=new Array();
oDec=new Array();
oImg=new Array();
var tOut;

function findPosX(id)
{
  var curleft = 0;

 obj=document.getElementById(id);
  while (obj.offsetParent)
  {
   curleft += obj.offsetLeft
   obj = obj.offsetParent;
  }
 return curleft;
}

function findPosY(id)
{
 var curtop = 0;
 obj=document.getElementById(id);
  while (obj.offsetParent)
  {
   curtop += obj.offsetTop
   obj = obj.offsetParent;
  }
 return curtop;
}

function makeMenu(obj){

	this.className=eval('document.getElementById("'+obj+'").className');
	this.css=eval('document.getElementById("'+obj+'").style');
	this.x=this.css.pixelLeft; this.y=this.css.pixelTop;
	this.hideIt=b_hideIt;	this.showIt=b_showIt; this.moveIt=b_moveIt;								
	return this
}
function b_showIt(){this.css.visibility="visible"}
function b_hideIt(){this.css.visibility="hidden"}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}


function init(){
var x;
var y;
	for (i=0;i<=6;i++)
	{
		oDec[i]=document.getElementById(eval("'dectd'+i"));
		oBut[i]=document.getElementById(eval("'buttd'+i"));
		oTop[i]=document.getElementById(eval("'top'+i"));
		
		x=findPosX(eval("'pos'+i"));
		y=findPosY(eval("'pos'+i"));
		oImg[i]=new makeMenu(eval("'imgAct'+i"));
		oImg[i].moveIt(x,y);

		if (eval("document.getElementById('drop'+i)!=null")){
			oDrop[i]=new makeMenu(eval("'drop'+i"));
			oDrop[i].moveIt(x-85,y+12);
		} else oDrop[i]='';
		
		
	}
}

function initall()
{
ready=1;
var x=findPosX("posbk");
var y=findPosY("posbk");
var obj=document.getElementById("bk");
obj.style.left=x;
obj.style.top=y;
obj.style.visibility='visible';

init();
}

function show_it(num)
{
if (ready) {
	clear_timeout();
	hide_all();
	oTop[num].className='toptd1';
	oBut[num].className='but1';
	oDec[num].className='dec1';
	oImg[num].showIt();	
	if (oDrop[num]) oDrop[num].showIt();
	}
}

function hide_it(num)
{
if (ready) {
	if (oDrop[num]) {time_out(num);}
	else {
		oTop[num].className='toptd0';
		oBut[num].className='but0';
		oDec[num].className='dec0';
		oImg[num].hideIt();	
	}
	}
}

function hide_all()
{
	for (i=0;i<oDrop.length;i++) {
		if (oDrop[i]) oDrop[i].hideIt();
		oTop[i].className='toptd0';
		oBut[i].className='but0';
		oDec[i].className='dec0';
		oImg[i].hideIt();	
	}
	
}

onresize=initall;
onload=initall;
// задает время запаздывания
function time_out(num)
{
	tOut = eval('setTimeout("oDrop['+num+'].hideIt();oTop['+num+'].className=\'toptd0\';oBut['+num+'].className=\'but0\';oDec['+num+'].className=\'dec0\';oImg['+num+'].hideIt();", 700)');
}

// обнуляет время запаздывания
function clear_timeout()
{
	clearTimeout(tOut);
}

//-->
