function add_shadow(name, path){
if(path==null) path="";
if(document.all && !window.opera) {
    if (/MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32") {
        document.write("<style>."+name+" {filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/i/"+path+name+".png', sizingMethod='crop');}</style>");
    }
    } else if (document.getElementById) {
    document.write("<style>."+name+" {background:url('/i/"+path+name+".png') no-repeat ;}</style>");
}
}

var active=null;
var can_hide=true;
var tm;

function show_menu(obj){
if(tm=null) clearTimeout(tm);
if(active!=null){
	can_hide=true;
	hide_menu();
	active=null;
	}
can_hide=false;
menu=document.getElementById("menu_"+obj.id);
menu.style.visibility = 'visible';
active=menu;
}

function start_hiding(){
if(tm=null) clearTimeout(tm);
can_hide=true; 
tm=setTimeout("hide_menu()",500)
}

function hide_menu(){
if(!can_hide) return;
if(active==null) return;
active.style.visibility = 'hidden';
}


// menu functions
function init_menu_section(num,shift){
	mi=document.getElementById("mi"+num);
	mi.onmouseover=function() {show_menu(this)} 
	mi.onmouseout= function() {start_hiding()}

	menu=document.getElementById("menu_"+mi.id);	
	menu.onmouseover=function() {can_hide=false;} 
	menu.onmouseout= function() {start_hiding()}
	
	bot_block=document.getElementById("m_bot_block");
	bot_block.onmouseover=function() {can_hide=false;} 
	bot_block.onmouseout= function() {start_hiding()}
	
	//menu.style.marginLeft=mi.parentNode.offsetLeft-121;
	menu.style.marginLeft=shift;
	lis=menu.getElementsByTagName("TD"); 
	for (i=0; i<lis.length; i++)  
		if(lis[i].getElementsByTagName("TABLE").length){
			if(document.all) set_for_IE(lis[i]);
			lis[i].getElementsByTagName("A")[0].className="sub";
			lis[i].getElementsByTagName("TABLE")[0].style.marginTop=-lis[i].offsetHeight;		
			lis[i].getElementsByTagName("TABLE")[0].style.marginLeft=+lis[i].offsetWidth;
		}
}

function set_for_IE(obj){ // blya
obj.onmouseover=function() {this.getElementsByTagName("TABLE")[0].style.visibility = 'visible';} 
obj.onmouseout= function() {this.getElementsByTagName("TABLE")[0].style.visibility = 'hidden';}
}
//-------------


var cur_step=0;
function step_exec(direction){
step=cur_step+direction;
if(step<=-1) step=8;
if(step>=9) step=0;
document.getElementById("arr8").style.visibility=(step==0?"visible":"hidden");
document.getElementById("step"+step).style.display="block";
document.getElementById("step"+cur_step).style.display="none";
cur_step=step;
return false;
}


function blink_arr(){
obj=document.getElementById("arr8");
if(!obj) return;
obj.src="/i/arr_s"+(obj.alt=="0"?2:1)+".gif";
obj.alt=(obj.alt=="0"?1:0);
setTimeout(function() {blink_arr()}, 200);
}

function map_exec(num){
mapa=document.getElementById("map"+num);
mapa.style.display=(mapa.style.display=="block" ? "none" : "block");
return false;
}

function map_open(url){
window.open(url, 'mapa', 'width=499,height=199');
return false;
}

function op_win(file,w,h){
window.open(file, 'new', 'width='+w+',height='+h+',scrollbars=1');
return false;
}

window.onload=function(){
blink_arr();
//document.body.getElementsByTagName("TABLE")[0].style.position="relative";
document.body.getElementsByTagName("TABLE")[0].style.zIndex="100";
} 