function OpenPhoto(hiddenImg2,tit2) {
  hiddenImg3 = hiddenImg2;
  if(hiddenImg3.complete)
  {
  myWin.close();
  myWin= open("","displayWindow","width="+hiddenImg2.width+",height="+hiddenImg2.height+"");
  // открыть объект document для последующей печати 
  myWin.document.open();
  
  // генерировать новый документ 
  myWin.document.write("<html><head><title>",tit2);
  myWin.document.write("</title></head><body leftmargin=0 topmargin=0>");
  myWin.document.write("<img src=\""+hiddenImg3.src+"\" width=\""+hiddenImg3.width+"\" height=\""+hiddenImg3.height+"\" border=\"0\">");
  myWin.document.write("</body></html>");

  // закрыть документ - (но не окно!)
  myWin.document.close(); }
  else{setTimeout('OpenPhoto(hiddenImg3,tit2)',100);}
}

function OpenPhotoLoad(img,tit) {
  hiddenImg = new Image();
  tit2 = tit;
  myWin= open("","displayWindow","width=150,height=50");
  myWin.document.open();
  myWin.document.write("<html><head><title>",tit);
  myWin.document.write("</title></head><body>");
  myWin.document.write("<b><table><td><tr><font size=\"+2\">Loading...</font></tr></td></table></b>");
  myWin.document.write("</body></html>");
  myWin.document.close();

  hiddenImg.src = img;
  setTimeout('OpenPhoto(hiddenImg,tit2)',100);
}

function ShowHide(id)
{
	  if (document.getElementById(id).style.display == "none"||document.all[id].visibility == "hidden"){
		  Show(id);
	  } else{
			 Hide(id);
		}
}
function Show(id)
{
	  if (document.getElementById) {
		  itm = document.getElementById(id)
		  itm.style.display = "block"
	  }
	  if (document.all){
		  itm = document.all[id];
		  itm.visibility = "show"
	  }
}
function Hide(id) {
		   if (document.getElementById) {
			   itm = document.getElementById(id)
			   itm.style.display = "none"
		   }
		   if (document.all){
			   itm = document.all[id];
			   itm.visibility = "hidden"
		   }
}