function popup_image(url, w, h, closetext) {

	wWidth = w;
	wHeight = h + 20;
	if ( wWidth > screen.width ) wWidth = screen.width - 100;
	if ( wHeight > screen.height ) wHeight = screen.height - 200;
	if ( !closetext ) closetext = 'Close';

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=no,scrollbars=no,toolbar=no,menubar=no');
	wnd.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><title>Увеличенное изображение</title><link rel="stylesheet" href="/style.css" type="text/css" /></head><body style="margin:0; padding:0; background-image:none;">');
	wnd.document.write('<div align="center" style="width:100%">');
	wnd.document.write('<img src="' + url + '" width="' + w + '" height="' + h + '" border="0" alt="" /><br />');
	wnd.document.write('<p style="text-align:center; margin:0; font-size:10px;"><a href="javascript:window.close();">'+closetext+'</a></p>');
	wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();

}


function popup_text(txt, w, h) {

	wWidth = w + 50;
	wHeight = h + 200;
	if (wWidth > screen.width) wWidth = screen.width - 100;
	if (wHeight > screen.height) wHeight = screen.height - 200;

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=1,scrollbars=1,toolbar=no,menubar=no');
	wnd.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /><title>Просмотр текста</title><link rel="stylesheet" href="/style.css" type="text/css" /></script></head><body>');
	wnd.document.write('<div style="margin:10px; padding:10px; border:1px solid #DEDEDE;">');
	wnd.document.write('<p>'+txt+'</p>');
	wnd.document.write('<div align="center"><a href="javascript:window.close();">Закрыть окно</a></div>');
	wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();

}


function gtu(u)
{
	wnd = window.open('http://'+u, '_blank');
	wnd.focus();
}
