ar2=new Array();
ar=new Array();

function hide_1(DI)
{
	if (ar[DI]==0)
	{
	document.getElementById(DI).style.visibility="hidden";
	}
}

function hide_2(DI2)
{
	if (ar2[DI2]==0)
	{
	document.getElementById(DI2).style.visibility="hidden";
	}
}

function show_(DI)
{
	document.getElementById(DI).style.visibility="visible";
	ar[DI] = 1;
}

function hide1(DI)
{
	ar[DI] = 0;
	st=DI.toString();
	proc="hide_1('"+st+"')";
	setTimeout(proc,200);
}

function sl(DI)
{
	ar[DI] = 1;
	document.getElementById(DI).style.visibility="visible";
}

function sla(DI)
{	
	ar[DI] = 0;
	st=DI.toString();
	proc1="hide_1('"+st+"')";
	setTimeout(proc1,200);
}

function therd_l_on1(DI,DI1){
	ml(DI,DI1);
	DI2 = DI1+""+DI;
	ar2[DI2] = 1;
	document.getElementById(DI2).style.visibility="visible";
}

function therd_l_off1(DI,DI2){
	ar2[DI2] = 0;
	st=DI2.toString();
	proc1="hide_2('"+st+"')";
	setTimeout(proc1,200);
}

function therd_l_on(DI,DI2){
	ar[DI]	 = 1;
	ar2[DI2]	 = 1;
}

function therd_l_off(DI,DI2){
	ar[DI] = 0;
	ar2[DI2] = 0;
	st=DI2.toString();
	proc1="hide_2('"+st+"')";
	setTimeout(proc1,200);
	st2=DI.toString();
	proc2="hide_1('"+st2+"')";
	setTimeout(proc2,200);
}

function counter_top(name)
{
name_ = document.all[name];
top_ = 0;
while (name_.offsetParent) {
   top_=top_+name_.offsetTop;
   name_ = name_.offsetParent;
 }
top_ = top_-1;
return top_;
}

function counter_left(name)
{
name_ = document.all[name];
left_ = 0;
while (name_.offsetParent) {
   left_=left_+name_.offsetLeft;
   name_=name_.offsetParent;
 }
left_ = left_+1;
return left_;
}

function ml(DI,DI1)
{
num = "1"+(DI-1)+""+(DI1-1);
_left = counter_left('zero_xy'+num);
_top = counter_top('zero_xy'+num);
DI2 = DI1+""+DI;
document.getElementById(DI2).style.left = _left;
document.getElementById(DI2).style.top = _top;
}
