var older;
    var nowid;
    var nowtime;
    var timeOnMen;
    function change(id, timer) {

      if (document.getElementById(id)) {
      var theObj = getObject(id);
             if (!theObj) theObj=getByID(id).style;

        if (timeOnMen) {
    clearTimeout(timeOnMen);
   }

   if (older && older != theObj) hide(older);

      if (theObj.visibility == "visible" || theObj.display == "block")
{ hide(theObj); nowid=null; }
      else { show(theObj); nowid=id; }

      older2=older=theObj;
         nowtime = timer * 1000;

      if (timer) timeOnMen=setTimeout("hide(older2)", nowtime);
    }
    }


    function change_r(id, cat) {
      if (document.getElementById(id)) {
       var theObj = getObject(id);

       if (theObj.visibility && theObj.visibility == "visible" ||
theObj.display == "block") {
        hide(theObj);
        if (cat) document.getElementById(cat).src='/img/open.gif';
       }
       else {
         show(theObj);
            if (cat) document.getElementById(cat).src='/img/close.gif';
       }
      }
    }

//???????? ???????
   function getObject(obj)
    {
 var theObj;
     if (document.layers) {
      if (typeof obj == "string") return document.layers(obj);
      else alert(2);// return null; return obj;
      }

     if (document.all) {
      if (typeof obj == "string")
       {
        if (typeof document.all(obj) != null) return document.all
(obj).style;
        else alert(1);// return null;
       }
      else return obj.style;
     }

     if (document.getElementById) {
      if (typeof obj == "string") return document.getElementById
(obj).style;
      else alert(3);// return null;return obj.style;
       }
       return alert(4);// return null;return obj.style;
    }

// ??????? ??????\??????? ???????? ?? ???????

   function display(object, noblock) {
     if(!noblock) getByID(object).style.display="block";
     getByID(object).style.visibility="visible";
   }

   function nodisplay(object, noblock) {
     if(!noblock) getByID(object).style.display="none";
     getByID(object).style.visibility="hidden";
   }

   var old_objclass=false;
   function change_class(obj, oclass, oclassold) {
          if (IE) {
      if (old_objclass) old_objclass.setAttribute("className", oclassold);
      obj.setAttribute("className", oclass);
       }
       else {
        if (old_objclass) old_objclass.setAttribute("class", oclassold);
      obj.setAttribute("class", oclass);
       }

       old_objclass=obj;
   }

   function show(obj, menu, table_tr) {

 if (menu == true) var theObj = getObject(obj);
 else var theObj = obj;

   if (!table_tr) {
  if (typeof theObj.visibility != "undefined") theObj.visibility =
"visible";
  if (typeof theObj.display != "undefined") theObj.display = "block";
   }
   else obj.style.display = IE ? "block" : "table-row";
   }

  function hide(obj, menu, table_tr) {

    table_tr = table_tr ? true : false;

  if (menu == true) var theObj = getObject(obj);
  else var theObj = obj;

   if (!table_tr) {
  if (typeof theObj.visibility != "undefined" && !table_tr)
theObj.visibility = "hidden";
  if (typeof theObj.display != "undefined") theObj.display = "none";
   }
   else obj.style.display = "none";
    } 
