function enlarge(path,width,height){
   if(width>600) width=600;
   if(height>600) height=600;

/*
   wdth=width;
   hgth=height+15;

  hgth+=20;
  LeftPosition=(screen.width)?(screen.width-wdth)/2:100;
  TopPosition=(screen.height)?(screen.height-hgth)/2:100;
  settings='width='+ wdth + ',height='+ hgth + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no';
  wnd=window.open("", "popup", settings); //"img{$v.ID}"
  appl='<div align=center ><a href=\'#\' onClick=\'window.close()\'><img src="files/thumb.php?img='+path+'&w=600&h=600" border=0></a></div>';
  appl+="<div align=center ><a href='#' onClick='window.close()' style='color:#000000'>Закрыть окно</a></div>";

  bg="#EEEEEE";
  wnd.document.write("<html><head><title>Увеличенное изображение</title><link rel='stylesheet' href='<#ROOTHTML#>main.css' type='text/css'></head><body style='margin:0px' bgcolor='"+bg+"'>"+appl+"</body></html>");
*/

  var html="";
html+="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">";
html+="<html>";
html+="<head>";
html+="<META http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">";
html+="<META http-equiv=\"content-language\" content=\"ru\">";
html+="<META NAME=\"description\" CONTENT=\"\">";
html+="<meta name=\"Keywords\" content=\"\">";
html+="<style type=\"text/css\">";
html+="body {";
html+="        background-color: #fcd259;";
html+="        margin: 0px 0px 0px 0px;";
html+="        padding: 0px 0px 0px 0px;";
html+="}";
html+=".img {";
//html+="        background-image: url(img/bg_popup.gif);";
//html+="        background-position: 0px 100%;";
//html+="        background-repeat: repeat-x;";
html+="        text-align: center;";
html+="        padding: 5px 5px 5px 5px;";
html+="}";
html+=".img img {";
html+="        border: 5px solid #ce0004;";
html+="        margin: 0px 0px 7px 0px;";
html+="}";
html+=".close {";
html+="        background-image: url(img/logo.gif);";
html+="        background-position: 16px 16px;";
html+="        background-repeat: no-repeat;";
html+="        text-align: right;";
html+="}";
html+="input {";
html+="        background-image: url(img/bg_input.gif);";
html+="        background-repeat: no-repeat;";
html+="        border: none;";
html+="        color: #FFFFFF;";
html+="        font-family: Tahoma, Verdana, Arial;";
html+="        font-size: 10px;";
html+="        height: 17px;";
html+="        margin: 25px 16px 25px 0px;";
html+="        width: 70px;";
html+="}";
html+="</style>";
html+="<title>Изображение</title>";
html+="</head>";
html+="<body>";
html+="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
html+="<tr>";
html+="        <td class=\"img\"><img src=\"files/"+path+"\" alt=\"\" width=\""+width+"\" height=\""+height+"\" border=\"0\"></td>";
html+="</tr>";
html+="<tr>";
html+="        <td class=\"close\"><input type=\"button\" value=\"Закрыть\" onClick=\"window.close();\"></td>";
html+="</tr>";
html+="</table>";
html+="</body>";
html+="</html>";

  var LeftPosition=(screen.width)?(screen.width-(width+40))/2:100;
  var TopPosition=(screen.height)?(screen.height-(height+80))/2:100;
  var settings='width='+(width+40)+',height='+(height+120)+',top='+TopPosition+',left='+LeftPosition+',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no';


  var wnd=window.open("", "popup", settings);
  wnd.document.write(html);
}
