var ImLeft= new Image(); ImLeft.src="/im/engl_l.gif";
var ImRight= new Image(); ImRight.src="/im/engl_r.gif";
var ImNone= new Image(); ImNone.src="/im/engl00.gif";
var ImYes= new Image(); ImYes.src="/im/engl11.gif";
var ImBack=new Image(); ImBack.src="im/back.gif";

function coord_X(){
var mouseX=0;
mouseX=window.event.clientX+document.body.scrollLeft;
return(mouseX);
}


function coord_Y(){
var MouseY=0;
mouseY=window.event.clientY+document.body.scrollTop;
return(mouseY);
}


nameTd=""; nameTd1="";
var nSh; var X,Y=142+5-10;
var navShown=false;
var TdBg=false;
var NNN=(document.layers)?true:false;
var NIE=(document.all)?true:false;
var nameShown = ""; 
//nameShownl="";
var navFade=null;


function onMclick(im)
{

if(im!=0){
nSh=im;
var sl='lay' + im;
//TopMOver(im);
//var x=coord_X();
//var y=coord_Y();
var ww=document.body.clientWidth-760;
if(ww<0)ww=0
X=2-5+30+(im)*191+(ww)/2;
//3
showNav(sl);
}// if

if(TdBg){TdBgColor('#4271A5',nameTd.substring(1,2)); TdImg(nameTd.substring(1,2),0); TdBg=false;} //снять тек
nameTd="t"+im; nameTd1="tb"+im; 
TdBgColor('#7CAAD6',im); TdImg(im,1); // восст. выделеный

//function Table_Over(name, name1){document.all[name].bgColor='#A6C9F0'; name1.color='#20334A';}
}

function TdBgColor(Ncolor, eNum){
document.all[nameTd].style.backgroundColor=Ncolor;
document.all[nameTd1].style.backgroundColor=Ncolor;
if(nameTd=='t0'){
document.all[nameTd+"0"].style.backgroundColor=Ncolor;
document.all[nameTd1+"0"].style.backgroundColor=Ncolor;
document.all[nameTd1+"00"].style.backgroundColor=Ncolor;
}
TdBg=true;
}

function TdImg(iName, iNum){
var imUrl1="", imUrl="";
if(iNum>0){
if(SelectMenu[iName+1]){imUrl1=ImYes.src;}else{imUrl1=ImRight.src;}
if(SelectMenu[iName-1]){imUrl=ImYes.src;}else{imUrl=ImLeft.src; }
}else{
if(SelectMenu[(iName-0)-1]){imUrl=ImRight.src;}else{imUrl=ImNone.src;}
if(SelectMenu[(iName-0)+1]){imUrl1=ImLeft.src;}else{imUrl1=ImNone.src;}

//imUrl="im/engl00.gif";
//imUrl1="im/engl_l.gif";
}
//SelectMenu[iName+1]

if((iName>0)&&(iName<3)){document.images['eng'+iName].src=imUrl1; document.images['eng'+(iName-1)].src=imUrl;}

else if(iName==0){document.images['eng'+iName].src=imUrl1}
else if(iName==3){document.images['eng'+(iName-1)].src=imUrl}
}


function showNav(name)
{
//var name1='lay'; 
//alert(document.body.clientWidth)

if (navFade) {
	clearTimeout(navFade);
	navFade=null;
}

if(nameShown!=name)
{
if (navShown) hideNav();
if (NNN) {
	document.layers[name].top=Y;
	document.layers[name].left=X;
	document.layers[name].visibility="show";
}else if (NIE){
	document.all[name].style.top=Y;
	document.all[name].style.left=X;
	document.all[name].style.visibility="visible";
	
//	document.all[name1].style.top=Y-40;
//	document.all[name1].style.left=X;
//	document.all[name1].style.visibility="visible";

}
nameShown = name;
//nameShownl = name1;
}


navShown=true;
return true;
}

function closeNav()
{
navFade=setTimeout("hideNav();",100);
return true;

}



function hideNav()
{
if (navFade) {
clearTimeout(navFade);
navFade=null
}

if(navShown) {

if (NNN) {document.layers[nameShown].visibility="hide";}else{
	document.all[nameShown].style.visibility="hidden";
//	document.all[nameShownl].style.visibility="hidden";
}
	//TopMOut(nSh);
}


if(TdBg){
TdBgColor('#4271A5',nameTd.substring(1,2));
TdImg(nameTd.substring(1,2),0);
nameTd=""; TdBg=false;

}


navShown=false;
nameShown="";
//nameShownl="";
return true;
}
