  var padding = new Array();
  var time = 5;
	var st=null;
	var tempId=0;
  padding[478] = 180;
  padding[479] = 110;
  padding[480] = 213;
  padding[481] = 50;
  padding[482] = 452;
  padding[483] = 450;
 
  function checkCatExist(catId)
  {
    var r = false;
    for(i in cats)
	{
	  if(i==catId)
	  {
	    r = true;
		break;
	  }
	}
	return r;
  }
  function CatInfo(Catid)
  {
    this.Id       = Catid;
    this.ParentId = cats[Catid][0];
    this.Layer    = cats[Catid][1];
    this.Name     = cats[Catid][2];
    this.CatHref  = cats[Catid][3];
  }
  function GetCatLink(Catid)
  {
	var c = new CatInfo (Catid);
  	var Path = "";
    var link = "";
	if (c.CatHref!="")
		link = c.CatHref;
	//if (link=="")
		//link = "../" + Path + "/index.jsp?root="+c.ParentId+"&catid=" + c.Id;*/		
	return link;
  }
  function GetCatChilds(id)
  {
    var f   = Object;
		var ids = new Array();
		var num = 0;
	  for(i in cats)
	  {
      f = new CatInfo(i);
      if(f.ParentId==id)
        ids[num++]=f.Id;
	  }
	  return ids;
  }
  function ClearTopCatChilds(){
	if(time>0)
	{  
		time--;
		st=setTimeout("ClearTopCatChilds()",1000);
	}
	else
	{  showCatChildsHere.innerHTML = " ";
			ShowTopCatChilds(478,false);
  }
	}
	function reChangeMenu(id,def)
	{
		if(def)
		{
			switch (id)
			{
				case 478:
					tempId=1;
					break;
				case 479:
					tempId=2;
					break;
				case 480:
					tempId=3;
					break;
				case 481:
					tempId=4;
					break;
				case 482:
					tempId=5;
					break;
				case 483:
					tempId=6;
					break;
				default:
					tempId=1;
					break;
				}
				eval("document.pic"+tempId+".src=\"../image/menu_0"+tempId+"b.gif\"");
				eval("menu"+tempId).bgColor="#FF8500";
			}
			else
			{
				if (tempId>0)
				{
						eval("document.pic"+tempId+".src=\"../image/menu_0"+tempId+".gif\"");
						eval("menu"+tempId).bgColor="";
						tempId=0;
				}
				}
			
		}
  function ShowTopCatChilds(id,def)
  {
    if (st!=null)
			clearTimeout(st);
		time = 5;
		reChangeMenu(id,def)
    var ids = GetCatChilds(id);
    var f   = Object;
    var wi  = "";
    wi += "<table><tr>";
    for(i in ids)
    {
      f = new CatInfo(ids[i]);
      wi += "<td style=\"padding-left:10px;padding-right:5px;\"><a href=\"javascript:GoToCat(" + f.Id + ");\" class=\"top\">" + f.Name + "</a></td><td style=\"color:#666666;\">|</td>";
    }
    wi += "</tr></table>";
    showCatChildsHere.innerHTML = wi;
	showCatChildsHere.style.paddingLeft=padding[id];
	
	if (!def)
	{
		ClearTopCatChilds();
	}
	//w.style.width=padding[id];
  }
  function GetFirstChildCatId(CatId)
  {
		var c;
    for(i in cats)
		{
			c = new CatInfo(i);
		  if(c.ParentId==CatId)
			{
				CatId = c.Id;
				break;
			}
		}
		return CatId;
  }
  function GoToCat(CatId)
  {
    location.href = GetCatLink(CatId);
  }
  //setInterval("ClearTopCatChilds()",1000);
