

var onDiv = false;
var timer;
var timeout = 500;


function setVisibility(menu,mode) 
{
	
	
	var w;
		w=( window.innerWidth ) ? window.innerWidth : document.body.clientWidth ;
		w= (w<=775) ? 775 : w ;
	
	document.getElementById("smenu"+menu).style.left = ((w-775)/2 + In_left[menu])+"px";
    document.getElementById('smenu'+menu).style.top  = In_top[menu]+"px";
	document.getElementById('smenu'+menu).style.visibility = mode;
}


function hideAll() {
  var i
  if (!onDiv) {
   for (i=0; i<Menu_top.length;i++)  setVisibility(i,"hidden");
  }
}

In_left=new Array(-52,72,261,344,528,620);
In_top=new Array(120,120,120,120,120,120);
In_width=new Array(100,0,0,0,0,0);
Menu_top=new Array(120,0,0,0,0,0);

function showMenu(menu) {
  hideAll();
	if ( menu < Menu_top.length ) {
	  onDiv = true;
  	setVisibility(menu,"visible");
	}
	//document.getElementById("2_"+menu).style.textDecoration= 'Underline';
	//document.getElementById("2_"+menu).style.color= 'BF0023';
	//document.getElementById("1_"+menu).style.background='url(/images/zhelt.gif)';
	//document.getElementById("1_"+menu).style.color='BF0023';
}

function hideMenu(menu) {
	var i;
	onDiv = false;
	for (i=0; i<9;i++) 
	{
	//document.getElementById("2_"+i).style.textDecoration= 'None';
	//document.getElementById("2_"+i).style.color='DCF7E4';
	//document.getElementById("1_"+i).style.background='url(/images/zelen.gif)';
	//document.getElementById("1_"+i).style.color='DCF7E4';
	}

  timer = setTimeout('hideAll();', timeout);

}

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
function activeflash (nf,ni,w,h,colr) {
	if ( MM_FlashCanPlay ) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" height="'+h+'" id="falsh" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+nf+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	//document.write('<param name="bgcolor" value="'+colr+'" />');
	document.write('<embed src="'+nf+'" wmode="transparent" quality="high" bgcolor="'+colr+'" width="'+w+'" height="'+h+'" name="falsh" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	} else{
		document.write('<IMG SRC="'+ni+'" WIDTH="'+w+'" HEIGHT="'+h+'" BORDER=0>');
	}
}

function open_Picture(id, name, w, h, title) {
	vvv=open('',id+'pic', 'width='+w+',height='+h+', top=40, left=50, toolbar=0, location=0, directories=0, status=0,menuBar=0,scrollBars=0,resizable=1'); 
	vvv.document.write('<html><head><title>'+title+'</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>'); 
	vvv.document.write('<img border=0  ondblclick="window.close();" alt="Окно закрывается по двойному щелчку" src="'+name+'"  width='+w+' height='+h+'>');
	vvv.document.write('</body></html>'); 
	vvv.document.close(); 
	vvv.focus();
}

function open_g_Picture(id, url, w, h, title) {
	vvv=open('/images'+url+'full/?id='+id,id+'pic', 'width='+(w+42)+',height='+(h+62)+', top=40, left=50, toolbar=0, location=0, directories=0, status=0,menuBar=0,scrollBars=1,resizable=1'); 
	vvv.focus();
}
function nodework(id1) {
	if (document.getElementById("c_"+id1).style.display=='none') 
	{
		document.getElementById("c_"+id1).style.display='block';
		
		//document.getElementById("i_"+id1).style.backgroundImage="url(/images/ushi3.gif)";
	} else {
		document.getElementById("c_"+id1).style.display='none';
		//document.getElementById("i_"+id1).style.backgroundImage="url(/images/ushi2.gif)";
	}
}