popup = function()
	{
	var els = document.getElementsByTagName("div");
	for (var i = 0; i < els.length; i++)
		{
		el = els[i];
		if (el.className=='positioner')
			{
			el.onmouseover=function()
				{
				this.className+=" over";
				}
			el.onmouseout=function()
				{
				this.className=this.className.replace(" over", "");
				}
			}
		}
	}
window.onload=popup;
function pop_form()
	{
	var scrolledDown = document.body.parentNode.scrollTop;
	document.getElementById('popup').style.top=scrolledDown+150+'px';
	document.getElementById('popup').style.display="block";
	}

function ImgShw(ID, width, height, alt)
{
	var scroll = "no";
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-28);
	var wnd = open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
	wnd.document.write(
		"<html><head>"+
		"<"+"script type=\"text/javascript\">"+
		"function KeyPress()"+
		"{"+
		"	if(window.event.keyCode == 27) "+
		"		window.close();"+
		"}"+
		"</"+"script>"+
		"<title>"+(alt == ""? "Картинка":alt)+"</title></head>"+
		"<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\">"+
		"<img src=\""+ID+"\" border=\"0\" alt=\""+alt+"\" />"+
		"</body></html>"
	);
	wnd.document.close();
}

function popup_image(table,name,id,width,height,alt) {
	 ImgShw("/images.php?table="+table+"&record_id="+id+"&name="+name+"&small=0", width, height, alt)}
