function show_mid(layer)
	{
		var l = document.getElementById(layer);

		if(l.style.visibility != 'visible'){
			
			try {
				l.style.visibility = "visible";
			} catch(e){
			}
			
			try {
				l.style.display = "block";
			} catch(e){
			}
					return true;
		}else{
			try {
				l.style.display = "none";
			} catch(e){
			}
			try {
				l.style.visibility = "hidden";
			} catch(e){
			}
			return true;
			
		}	
	}

var newWindow;

function makeNewWindow1_old(title, img_path, width, height, content) {
    if (!newWindow || newWindow.closed) {
        newWindow = window.open("","sub","resizable,status,height="+height+",width="+width+"");
        writeToWindow1(title, img_path, width, height, content);
    } else if (newWindow.focus) {
		newWindow.close();
		writeToWindow1(title, img_path, width, height, content);
        newWindow.focus( );
    }
}

function makeNewWindow1(title, img_path, width, height, content) {
    if (!newWindow || newWindow.closed) {
        newWindow = window.open("","sub","resizable,status,height=600,width=800,scrollbars=yes");
        writeToWindow1(title, img_path, width, height, content);
    } else if (newWindow.focus) {
		newWindow.close();
        newWindow = window.open("","sub","resizable,status,height=600,width=800,scrollbars=yes");
		writeToWindow1(title, img_path, width, height, content);
        newWindow.focus( );
    }
}

function writeToWindow1(new_title, img_path, width, height, content) {
	width = width-50;
	height = height-150;
    var newContent = "<html><head><title>"+new_title+"</title></head>";
	newContent += "<LINK rel=stylesheet href=/style.css>";
    newContent += "<body><center><br /><img width="+width+" heigth="+height+" src=\""+img_path+"\" align=\"left\" style=\"padding:10px; margin:10px;\">"+content+"<br /><br />";
	newContent += "<a href=\"#\" OnClick=\"window.close()\">Закрыть Окно</a></center>";
    newContent += "</body></html>";
    newWindow.document.write(newContent);
    newWindow.document.close();
}
