var page_z_index=2000;
var page_i=0;

function show_img (src, w, h, size, tip, bits)
{
	if (_cubator)
	{
		dop_put="cubator/";
	}
	else
	{
		dop_put='';
	}
	sost="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>";
	sost+="<td class=\"foto_drag_zag_td\" nowrap=\"nowrap\"><input type=\"text\" class=\"foto_drag_zag_input\" value=\""+src+"\" readonly=\"readonly\" /></td>";
	sost+="<td class=\"foto_drag_zag_td\" nowrap=\"nowrap\">"+size+"</td>";
	sost+="<td class=\"foto_drag_zag_td\" nowrap=\"nowrap\">"+tip+"</td>";
	sost+="<td class=\"foto_drag_zag_td\" nowrap=\"nowrap\">"+bits+" бит</td>";
	sost+="<td class=\"foto_drag_zag_td\" nowrap=\"nowrap\">"+w+"&times;"+h+"</td>";
	sost+="<td class=\"foto_drag_zag_td\" nowrap=\"nowrap\" align=\"right\"><img src=\""+dop_put+"img/foto_close.jpg\" border=0 width=16 height=16 class=\"foto_close\" align=\"absmiddle\" /></td>";
	sost+="</tr></table>";
	
	var im=$("<div class=\"foto_drag_div\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">      <tr>        <td class=\"foto_t_l\"><img src=\"box/spacer.gif\" width=\"3\" height=\"1\" /></td>        <td class=\"foto_t\"><div class=\"foto_drag_zag\">"+sost+"</div></td>        <td class=\"foto_t_r\"><img src=\"box/spacer.gif\" width=\"4\" height=\"1\" /></td>      </tr>      <tr>        <td class=\"foto_l\"><img src=\"box/spacer.gif\" width=\"1\" height=\"1\" /></td>        <td class=\"foto_center\"><img src=\""+src+"\" border=\"0\"></td>        <td class=\"foto_r\"><img src=\"box/spacer.gif\" width=\"1\" height=\"1\" /></td>      </tr>      <tr>        <td><img src=\"box/spacer.gif\" width=\"1\" height=\"1\" /></td>        <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  <tr>    <td class=\"foto_b_l\"><img src=\"box/spacer.gif\" width=\"1\" height=\"1\" /></td>    <td class=\"foto_b\"><img src=\"box/spacer.gif\" width=\"1\" height=\"1\" /></td>  </tr></table></td>        <td class=\"foto_b_r\"><img src=\"box/spacer.gif\" width=\"1\" height=\"1\" /></td>      </tr>    </table></div>");
	page_i++;
	if (page_i>10) { page_i=1; }
	$(im).find(".foto_center").height(h);
	$(im).find(".foto_center").width(w);
	$(im).height(h);
	$(im).width(w);
	$(im).css('top', getBodyScrollTop()+30+30*page_i);
	$(im).css('left', 30*page_i);
	page_z_index++;
	$(im).css('z-index', page_z_index);
	$(im).bind('mousedown', function()
		{
			page_z_index++;
			$(im).css('z-index', page_z_index);
		}
	);
	$(im).find("img.foto_close").click(function()
		{
			//$(im).fadeOut(200, function() { $(im).remove(); });
			$(im).remove();
		}
	);
	$(im).find("img.foto_close").hover(
		function()
		{
			$(this).attr('src', dop_put+'img/foto_close1.jpg');
		},
		function()
		{
			$(this).attr('src', dop_put+'img/foto_close.jpg');
		}
	);
	$(im).hide();
	$("body").prepend(im);
	$(im).show();
	$(im).draggable();
	//$(im).draggable({zIndex: 2000, stack: { group: 'products', min: 1000 }}).css("z-index", 2001);
};