var LinkDivActive = 0;
var onDiv;
var timeOnDiv;
var layerRef;
var styleRef;
var showVar;
var hideVar;

if (navigator.appName == "Netscape") {
 layerRef="document.";
 styleRef="";
 showVar="'show'";
 hideVar="'hide'";
} else {
 layerRef="document.all.";
 styleRef=".style";
 showVar="'visible'";
 hideVar="'hidden'";
}

function hideDiv(divn) {
 if (onDiv!=""){
	 eval(layerRef+divn+styleRef+'.visibility = '+hideVar);
	 onDiv="";
 }
}

function showDiv(divn) {
 eval(layerRef+divn+styleRef+'.visibility = '+showVar);
}

function showLinkDiv(divn) {
 if (timeOnDiv != null) {
  clearTimeout(timeOnDiv);
  hideDiv(onDiv);
 }
 showDiv(divn);
 onDiv = divn;
}

function divTimer() {
 timeOnDiv = setTimeout("divOut()",500)
}

function divOut() {
 if (LinkDivActive == 0) {
  hideDiv(onDiv);
 } 
}

function LinkDivOver() {
 LinkDivActive = 1;
 clearTimeout(timeOnDiv);
}

function LinkDivOut() {
 LinkDivActive = 0;
 timeOnDiv = setTimeout("divOut()",500)
}







function lefthover(a_nomer,a_check) {
Elmt="trleft_"+a_nomer
if (document.all(Elmt).className !="trleft_on"){
document.all(Elmt).className = (a_check) ? "trleft_hover" : "";
};
event.returnValue = false;
}


//подгонка левого края при загрузке
function SetLeftMargin(a_DivWidth) {
	var RightSves, RightDelta;
	var i, SumRightWidth;
	RightDelta=10
	RightSves=2
	SumRightWidth=0;
	if (document.all.RightNomerTD!=null){
		for (i = document.all.RightNomerTD.length-1; i > 0; i--){
			SumRightWidth=SumRightWidth + document.all.RightNomerTD[i].clientWidth;
			if ((a_DivWidth>SumRightWidth+RightDelta)&(document.all.RightNomerTD[i].all.tags("div").length>0)) {
				document.all.RightNomerTD[i].all.tags("div")[0].style.marginLeft=parseInt(document.all.RightNomerTD[i].all.tags("div")[0].style.marginLeft)-a_DivWidth + document.all.RightNomerTD[i].clientWidth+RightSves;
				};
			};
		};
}
