function popup_image(url, w, h) {

	wWidth = w;
	wHeight = h + 20;
	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=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;">');
	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();">Закрыть окно</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;
	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;">');
	wnd.document.write( txt );
	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();
}



/****************************************************************************
 *                         Для "мигающего" меню
 */
var pics = new Array();
var objCount = 0;

function preload(name, first, second, third, fourth, flag) {

  // предварительна\я загрузка изображений и размещение их в массиве

    pics[objCount] = new Array(5);
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = second;
    pics[objCount][2] = name;
    pics[objCount][3] = new Image();
    pics[objCount][3].src = third;
    pics[objCount][4] = new Image();
    pics[objCount][4].src = fourth;
    pics[objCount][5] = flag;
    objCount++;
}

function On(name){
     for (i = 0; i < objCount; i++) {
      if (document.images[pics[i][2]] != null)
        if (name != pics[i][2]) {
			// вернуть в исходное систо\яние все другие изображени\я
			if (pics[i][5]) document.images[pics[i][2]].src = pics[i][3].src;
			else document.images[pics[i][2]].src = pics[i][0].src;
        }
		else {
			// показывать вторую картинку, поскольку курсор пересекает данное изображение
			if (pics[i][5]) document.images[pics[i][2]].src = pics[i][4].src;
			else document.images[pics[i][2]].src = pics[i][1].src;
        }
    }
}

function Off(){
	for (i = 0; i < objCount; i++) {
		// вернуть в исходное систо\яние все изображени\я
		if (document.images[pics[i][2]] != null) {
			if (pics[i][5]) document.images[pics[i][2]].src = pics[i][3].src;
			else document.images[pics[i][2]].src = pics[i][0].src;
		}
	}
}

function Selected(name){
	for (i = 0; i < objCount; i++) {
		// включить флаг использования кнопки
		if (document.images[pics[i][2]] != null)
			if (name == pics[i][2]) {
				pics[i][5] = true;
				document.images[pics[i][2]].src = pics[i][4].src;
			}
			else {
				pics[i][5] = false;
				document.images[pics[i][2]].src = pics[i][0].src;
			}
	}
}

/*
 *                         Для "мигающего" меню
 ****************************************************************************/
