function nw(){
	win=window.open("new_window.html","photo", "width=410, height=390, menubar=0, toolbar=0, scrollbars=1,resizable=0, location=0, status=0");
	win.focus();
}

function showPopupImgWindow(im,w,h,alt){
  w = eval(w);
  h = eval(h);
	imgwindow = window.open('',"_blank","resizable=yes,menubar=no,status=no,top=30,left=100;scrollbars=no,width=" + (w+50) + ",height=" + (h+90));
	imgwindow.document.open("text/html");
  imgwindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
  imgwindow.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml"><head>');
  imgwindow.document.writeln('<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/style.css" />');
  imgwindow.document.writeln('<title>' + alt + '</title>');
  imgwindow.document.writeln('</head><body >');
  imgwindow.document.writeln('<div class="page" style="font-size:70%">');
  imgwindow.document.writeln('<div style="text-align:right; display:block; width:' + w + 'px; margin:6px auto 6px; font-size:110%"><a href="#" onclick="self.close()">Закрыть окно</a></div>');
  imgwindow.document.writeln('<img width="' + w + 'px" height="' + h + 'px" src="' + im +'" alt="' + alt +'" style="margin:0 auto 0 auto" /><br />');
  imgwindow.document.writeln('<p style="display:block; width:' + w + 'px; margin:6px auto 6px auto">' + alt + '</p>');
  imgwindow.document.writeln('<div class="copy" style="display:block; width:' + w + 'px; margin:0 auto 0 auto">');
  imgwindow.document.writeln('&copy;&nbsp;2006&nbsp;Prolab Перепечатывание материалов с&nbsp;сайта возможно только при соглашении с&nbsp;Prolab');
  imgwindow.document.writeln('</div></div>');
  imgwindow.document.writeln('</body></html>');
	imgwindow.focus();
}

function showBigPicture(id, middle, alt, big, w, h, num)
{
  var t = thumbs[num];

  if (t.length > 0)
  {
    for (i = 0; i < t.length; i++) if (document.getElementById(t[i])) document.getElementById(t[i]).className = '';
    if (document.getElementById('thumb' + id)) document.getElementById('thumb' + id).className = 'enabled';
  }

  if (w > 0 || h > 0) str = "<img onclick=\"showPopupImgWindow('" + big + "', '" + w + "', '" + h + "', '" + alt + "');\" src='" + middle + "' alt='" + alt + "' title='" + alt + "' />";
  else str = "<img style='cursor:default;' src='" + middle + "' alt='" + alt + "' title='" + alt + "' />";
  
  document.getElementById('big_picture' + num).innerHTML = str;
  document.getElementById('alt_bp' + num).innerHTML = alt;
}

function showPopupWindow(path,w,h){
	win = window.open(path,"_blank","resize=yes,resizable=yes,menubar=no,status=no,top=30,left=100,scrollbars=yes,width="+w+",height="+h);
	win.focus();
}

function show_menu(id, id2)
{
	clearTimeout(timer[id2]);
	document.getElementById(id).style.display = 'inline';
}

var timer = new Array();

function start_hiding(id, id2)
{
	timer[id2] = setTimeout("hide_menu('" + id + "', " + id2 + ")", 1000);	
}

function hide_menu(id, id2)
{
	clearTimeout(timer[id2]);
	document.getElementById(id).style.display = 'none';
}

function showMap(im,w,h,alt){
  w = eval(w);
  h = eval(h);
	imgwindow = window.open('',"_blank","resizable=yes,menubar=no,status=no,top=30,left=100;scrollbars=no,width=" + (w+50) + ",height=" + (h+90));
	imgwindow.document.open("text/html");
  imgwindow.document.writeln('<?xml version="1.0" encoding="windows-1251"?>');
  imgwindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
  imgwindow.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml"><head>');
  imgwindow.document.writeln('<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/style.css" />');
  imgwindow.document.writeln('<title>' + alt + '</title>');
  imgwindow.document.writeln('</head><body >');
  imgwindow.document.writeln('<div class="page" style="font-size:70%">');
  imgwindow.document.writeln('<div style="text-align:right; display:block; width:' + w + 'px; margin:6px auto 6px; font-size:110%"><a href="#" onclick="self.close()">Закрыть окно</a></div>');
  imgwindow.document.writeln('<img width="' + w + 'px" height="' + h + 'px" src="' + im +'" alt="' + alt +'" style="margin:0 auto 0 auto" /><br />');
  imgwindow.document.writeln('<p style="display:block; width:' + w + 'px; margin:6px auto 6px auto">' + alt + '</p>');
  imgwindow.document.writeln('<div class="copy" style="display:block; width:' + w + 'px; margin:0 auto 0 auto">');
  imgwindow.document.writeln('&copy;&nbsp;2006&nbsp;Prolab Перепечатывание материалов с&nbsp;сайта возможно только при соглашении с&nbsp;Prolab');
  imgwindow.document.writeln('</div></div>');
  imgwindow.document.writeln('</body></html>');
	imgwindow.focus();
}
