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('/'+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();
}
var mmenu=6;
var styleSwitch
var layerPostfix
var layerRef
var onDiv = false;
var timer;
var timeout = 300;

//Пустышка
function nothing() {
  }
image_temp=new Array();
for (i=1; i<=mmenu;i++)  {
image_temp[(2*i)]=new Image();
image_temp[(2*i)].src="/images/p1_"+(i)+".gif";
image_temp[(2*i+1)]=new Image();
image_temp[(2*i)].src="/images/m1_"+(i)+".gif";
    }
arr_menu=new Array(0,161,249,338,427,526,606,480);
function setVisibility(lay,mode) { 
	var num;
	document.getElementById("menu"+lay).style.visibility = mode;
	if (mode=="hidden") { num=2; } else {
		num=1;
		var w;
		w=( window.innerWidth ) ? window.innerWidth : document.body.clientWidth ;
		w= (w<=775) ? 775 : w ;
		document.getElementById("menu"+lay).style.left = (w-775)/2 + arr_menu[lay];
	}
	document.images["p"+lay].src="/images/p"+( mode=="hidden" ? 2 : 1  )+"_"+(lay)+".gif";
	document.images["m"+lay].src="/images/m"+( mode=="hidden" ? 2 : 1  )+"_"+(lay)+".gif";
}

function hideAll() {
  var i
  if (!onDiv) {
   for (i=1; i<=mmenu;i++)  setVisibility(i,"hidden");
    }
  }

function showMenu(menu) {
  hideAll();
  onDiv = true;
  setVisibility(menu,"visible");
}

function hideMenu() {
  onDiv = false;
  timer = setTimeout('hideAll();', timeout);
 }

function setPointer(theRow,cl) { var theCells = null; if (typeof(theRow.style) == 'undefined') { return false; }; if (typeof(document.getElementsByTagName) != 'undefined') { theRow.setAttribute('bgcolor', cl, 0); }; return true; }

