function win(file,win,width,height) 
        {
        if (self.screen) {s_width = screen.width; s_height = screen.height;} else if (self.java) {var jkit = java.awt.Toolkit.getDefaultToolkit(); var scrsize = jkit.getScreenSize(); s_height = scrsize.height;} else {s_width = s_height = 'x' }
        center_h=(s_width - (width+20))/2;
        center_v=(s_height - (height+40))/2;
        new_win = window.open("","Фото","width="+(width+20)+",height="+(height+40)+",top="+center_v+",left="+center_h+",titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=1");
        new_win.document.write("<HTML><TITLE>"+win+"</TITLE><BODY bgcolor=#ffffff style=\"margin:0px;font-size:11px; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif\">");
        new_win.document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"100%\">");
        new_win.document.write("<tr><td height=\"100%\" valign=\"center\" align=\"center\"><b>"+win+"</b><br><img src=\""+file+"\" width=\""+width+"\" height=\""+height+"\" border=\"0\" onclick=\"window.close()\" alt=\"нажмите для закрытия окна\"></td></tr>");
        new_win.document.write("<tr>");
//        new_win.document.write("<td align=\"center\" height=\"29\" class=\"cm\"><img src=\"/common/img/btn_bw1.gif\" border=\"0\" width=\"97\" height=\"29\" alt=\"<< =Назад\" name=\"bt_bw\" onmouseover=\"images['bt_bw'].src='/common/img/btn_bw2.gif'\" onmouseout=\"images['bt_bw'].src='/common/img/btn_bw1.gif'\" onclick=\"window.close()\"></td>");
        new_win.document.write("<td><div align=center style=\"font-weight:normal;font-size:10px;color:#555555\">нажмите для закрытия окна</div></td>");
        new_win.document.write("</tr>");
        new_win.document.write("</table>");
        new_win.document.write("</BODY></HTML>");
        new_win.document.close();       
        new_win.focus();
        }

function win2(file,win,width,height) 
        {
        if (self.screen) {s_width = screen.width; s_height = screen.height;} else if (self.java) {var jkit = java.awt.Toolkit.getDefaultToolkit(); var scrsize = jkit.getScreenSize(); s_height = scrsize.height;} else {s_width = s_height = 'x' }
        center_h=(s_width - (width))/2;
        center_v=(s_height - (height))/2;
        new_win = window.open("","Фото","width="+(width)+",height="+(height)+",top="+center_v+",left="+center_h+",titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");
        new_win.document.write("<HTML><TITLE>"+win+"</TITLE><BODY bgcolor=#ffffff style=\"margin:0px\">");
        new_win.document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
        new_win.document.write("<tr><td align=\"center\"><img src=\""+file+"\" width=\""+width+"\" height=\""+height+"\" border=\"0\"></td></tr>");
        new_win.document.write("</table>");
        new_win.document.write("</BODY></HTML>");
        new_win.document.close();       
        new_win.focus();
        }

var tr = null;
function h(td)
{
if (null != tr) tr.className = "";
tr = td.parentNode;
tr.className = "tr_selected";
}
function fixPNG(element)
{
        if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent))
        {
                var src;
                
                if (element.tagName=='IMG')
                {
                        if (/\.png$/.test(element.src))
                        {
                                src = element.src;
                                element.src = "/common/img/spacer.gif";
                        }
                }
                else
                {
                        src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i)
                        if (src)
                        {
                                src = src[1];
                                element.runtimeStyle.backgroundImage="none";
                        }
                }
                
                if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
        }
}