function hidden_block(block_id) {

    f = document.getElementById(block_id);
	f.style.display = "none";
	f.removeChild(f.firstChild);
}
function attachEnlarger(block_id, src, w, h) {

    f = document.getElementById(block_id);
	
	// Если картинка уже загружена , удалить ее
	if (f.firstChild) f.removeChild(f.firstChild);
	
    // Для начала узнаем размеры видимой области страницы
    var myWidth = 0, myHeight = 0;
    if (typeof(window.innerWidth) == 'number') {
      // для всего кроме MSIE
      myWidth = window.innerWidth;
      myHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
      // IE6+
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
      // IE4
      myWidth = document.body.clientWidth;
      myHeight = document.body.clientHeight;
    }
  
    // Теперь уточняем, насколько страница прокручена вниз и вбок
    var scrOfX = 0, scrOfY = 0;
    if(typeof(window.pageYOffset) == 'number') {
      // Netscape и его родственники
      scrOfY = window.pageYOffset;
      scrOfX = window.pageXOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
      // DOM
      scrOfY = document.body.scrollTop;
      scrOfX = document.body.scrollLeft;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
    // IE6
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
   
    //Создаем в блоке картинку
    var new_img = new Image();
	new_img.src = src;
	f.appendChild(new_img);
	  
    // А теперь позиционируем наш блок
    f.style.top = String(Math.round((myHeight - h) / 2) + scrOfY) + 'px';
    f.style.left = String(Math.round((myWidth - w) / 2) + scrOfX) + 'px';
    f.style.width = w;
    f.style.height = h;
	f.style.display = "block";
	// показываем блок
} // attachEnlarger
