var historys;
var menuClass = new Array ();

NS4 = (document.layers);
IE4 = (document.all);

appVer = navigator.appVersion;
IEmac = (IE4 && appVer.indexOf("Mac") != -1);
IE4mac = (IEmac && appVer.indexOf("MSIE 4") != -1);
IE40mac = (IE4mac && appVer.indexOf("4.0;") != -1);
IE45mac = (IE4mac && appVer.indexOf("4.5;") != -1);
NSpre401 = (NS4 && (parseFloat(appVer) <= 4.01));
NSpre403 = (NS4 && (parseFloat(appVer) <= 4.03));

function Sho(idTag,isAct)
{

	var Tag, Y, tab, pat;
	Tag = eval("O"+idTag.id);
	pat = eval(idTag.id);
	tab = "menuTab";

	if (!menuClass[idTag.id]) { menuClass[idTag.id] = idTag.className;}

	if ((idTag.className == menuClass[idTag.id]))
	{
		var xa, xa2, xa3;
		xa2 = Tag.id;
		xa3 = "Нет";
		xa = xa2.indexOf(historys,0);

		Tag.style.display = "inline";
		Tag.style.onfocusin = true;
		idTag.className = "menuAction";
		idTag.className = "Un"+menuClass[idTag.id];
		if (xa != -1) {xa3 = "Да"; /*alert (historys+"    "+Tag.id);*/}
		if (historys && historys !=Tag.id && xa3 != "Да") {document.all[historys].style.display = "none";}
//		historys = Tag.id;
		if (xa == -1) {historys = Tag.id;}

//				Tag.style.posLeft = event.clientX - event.offsetX + 10;
//				Y = event.clientY - event.offsetY + event.srcElement.scrollHeight - 2;
				if (xa == -1)
				 {
					Tag.style.posTop = Y;
				 }
				else
				 {
					Tag.style.Top = 10;
				 }
	}
	else
	{
		Tag.style.display = "none";
		idTag.className = menuClass[idTag.id];
	}

}

function op()
{
		if (historys)
		 {
		  document.all[historys].style.display = "inline";
		  var str;
		  str = historys.substring(1,100);
		  document.all[str].className = "Un"+menuClass[str];
		 }
}

function clos()
{
		if (historys)
		 {
		  document.all[historys].style.display = "none";
		  var str;
		  str = historys.substring(1,100);
		  document.all[str].className = menuClass[str];
		 }
}

    function show(ob)
    {
      var okno = "scrollbars=1,fullscreen=0,status=0,toolbar=0,"+
                 "top=0,left=0,width=600,height=460,resizable=1";
      var Win=window.open("", null, okno);
      Win.document.open();
      var i;
      var s = "";
      for (i in ob) s += "<B>"+i+"</B>"+" = "+ob[i]+"<BR>";
      Win.document.write(s);
      Win.document.close();
    }
