// JavaScript Document
var son;
function $(id)
{
  var obj=document.getElementById(id);
  if(obj!=null)
  {
	  return obj;
  }
  return null;
}

function IlSelected(index)
{
  var obj=$("barul");
  son=obj.childNodes;
  for(var i=0;i<son.length;i++)
  {
	if(i==index)
	{
	  setClass(index,"selected");
	  setClass(index-1,"oth");
	}else
	{
	  setClass(i,"");
	}
  }
  if((son.length-1)!=index)
  {
	 setClass(son.length-1,"oth");
  }
}
function setClass(flag,state)
{
  if(document.all)
  {
	var o=son[flag];
	if(typeof(o)=="object")
	{
	  o.className =state;
	}
  }else
  {
	flag++;
	var o=son[(2*flag)-1];
	if(typeof(o)=="object")
	{
	  o.setAttribute("class",state);
	}
  }
}
function SetHeight(offheight,margin)
{
  if(offheight==undefined){offheight=210;}
  if(margin==undefined){margin=170;}
  var l=$("l");              
  var t=$("t");
  l.style.height=t.offsetHeight+offheight+"px";
  var logo=$("log");
  logo.style.marginTop=(t.offsetHeight<=50)?(t.offsetHeight+"px"):(t.offsetHeight-margin+"px");
}
function SetState(height)
{
  if(height==undefined){height=0;}
  var t=$("t");
  var hidden=$("hidden");
  if(t.offsetHeight+height<0){hidden.style.height=0+"px";return;}
  hidden.style.height=t.offsetHeight+(t.offsetHeight<=50?"":height)+"px";
}