// Главное меню (Menu)
queued = new Object;
visible = new Object;
intr = 800;
isMos = 64;
if (navigator.appName == "Netscape")
	isMos = 1;

function cancel_queue()
	{try {clearTimeout(ti);}
	catch(f) {}}

function popup(ev, pa, ch) {
	try {visible.style.visibility = 'hidden';visible.style.display = 'none';}
	catch(f) {}
	try {clearTimeout(ti);queued.style.visibilty = 'hidden';queued.style.display = 'none';}

	catch(f) {}
	ch = document.getElementById(ch);
	var rr = getDim(pa);
	if (isMos != 1) {
		ch.style.pixelLeft = - 16 + rr.x;
		ch.style.pixelTop = rr.y - 56 + pa.offsetHeight;}
	if (navigator.appName == "Opera") {
		ch.style.pixelLeft = - 16 + rr.x;
		ch.style.pixelTop = rr.y - 59 + pa.offsetHeight;}
	else {
		ch.style.left = -16 + rr.x + 'px';
		ch.style.top = (rr.y - 56 + pa.offsetHeight) + 'px';}
		ch.style.visibility = 'visible';ch.style.display = 'block';visible = ch;}

function popdown(event, wh) {
	if (isMos != 1) {
		if (!wh.contains(event.toElement)) {ti = setTimeout(hide, intr);queued = wh;}}
	else {
		ti = setTimeout(hide, intr);queued = wh;}

function hide() {wh.style.visibility = 'hidden';wh.style.display = 'none';}}

function popdown_1(event, pa, ch) {ch = document.getElementById(ch);
	if (isMos != 1) {
		if (event.toElement != ch && !ch.contains(event.toElement) && !pa.contains(event.toElement)) {ti = setTimeout(hide, intr);queued = ch;}}

	else {
		if (event.relatedTarget != ch && event.relatedTarget.parentNode != ch && event.relatedTarget.parentNode.parentNode != ch && event.relatedTarget.parentNode != pa)
		ti = setTimeout(hide, hide);queued = ch;}

function hide() {ch.style.visibility = 'hidden';ch.style.display = 'none';}}

function getDim(el){
for (var lx=0,ly=0;el!=null;
lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
return {x:lx,y:ly}}


// Кнопки меню (Buttons)
v=parseInt(navigator.appVersion.substring(0,1));
stored=null;storedLocation=null;
    if (v>=3){
	m1=load('activity_to_press');
	m2=load('enterprise_to_press');
	m3=load('territory_to_press');
	m4=load('services_to_press');}

function load(n){
	image=new Image();
	image.src="Details/"+n+".gif";
	return image;}

function show(where,what){
    if (v>=3) {
	stored=where;
	storedLocation=document.images[where].src;
	document.images[where].src=eval(what+".src");}}

function hide(){
    if (v>=3) document.images[stored].src=storedLocation;}


// Стиль меню (Style)
document.writeln('<style>');
	if (navigator.appName == "Microsoft Internet Explorer") {
		document.writeln('.menu {display:block; padding-left:8px; padding-top:7px; padding-right:8px; padding-bottom:7px; width:148px;}')
		document.writeln('.contents {display:block; color:#555555; padding-left:5px; text-decoration: none; width:164;}')}
	else {
		document.writeln('.menu	{display:block; padding-left:8px; padding-top:7px; padding-right:8px; padding-bottom:7px;}')
		document.writeln('.contents {display:block; color:#555555; padding-left:5px; padding-right:10px; text-decoration: none;}')}
document.writeln('</style>');


// Деятельность (Activity)
document.write("<div id=popactivity onmouseout=\"popdown(event, this);\" onmouseover=\"cancel_queue();\">");
document.write("<table width=160 border=0 cellspacing=0 cellpadding=0>");
document.write("<tr><td colspan=3 height=30 background=Details/illumination.gif></td></tr>");
document.write("<tr><td width=16></td><td><a onmouseover=show('activity','m1') onmouseout=hide() href=activity.html><img src=Details/point.gif height=26 width=128 border=0 name=activity></a></td><td width=16></td></tr>");
document.write("<tr><td width=16 height=4></td><td height=4 background=Details/underline.gif></td><td width=16 height=4></td></tr>");
document.write("<tr><td colspan=3 height=3></td></tr>");
document.write("<tr><td class=border colspan=3>");
document.write("<a class=menu style='padding-top:16px' href=news.html>Новости предприятия</a>");
document.write("<a class=menu href=info.html>Стандарт раскрытия информации предприятия</a>");
document.write("<a class=menu href=financial-reporting-2009.html>Годовая финансовая отчётность за 2009 год</a>");
document.write("<a class=menu href=financial-reporting-2008.html>Годовая финансовая отчётность за 2008 год</a>");
document.write("<a class=menu href=financial-reporting-2007.html>Годовая финансовая отчётность за 2007 год</a>");
document.write("<a class=menu href=annual-report-2006.html>Годовой отчет<br/>за 2006 год</a>");
document.write("<a class=menu href=accounting-reporting-2006.html>Бухгалтерская отчётность за 2006 год</a>");
document.write("<a class=menu href=financial-reporting-2005.html>Годовая финансовая отчётность за 2005 год</a>");
document.write("<a class=menu href=charter.html>Устав предприятия</a>");
document.write("<a class=menu href=history.html>Историческая справка</a>");
document.write("<a class=menu href=80.html>80 Лет ОАО «ПЭС»</a>");
document.write("<a class=menu style='padding-bottom:11px' href=http://www.pes-spb.ru/Purchases/show.php>Закупки</a>");
document.write("</td></tr></table>");
document.write("</div>");

// Предприятие (Enterprise)
document.write("<div id=popenterprise onmouseout=\"popdown(event, this);\" onmouseover=\"cancel_queue();\">");
document.write("<table width=160 border=0 cellspacing=0 cellpadding=0>");
document.write("<tr><td colspan=3 height=30 background=Details/illumination.gif></td></tr>");
document.write("<tr><td width=16></td><td><a onmouseover=show('enterprise','m2') onmouseout=hide() href=enterprise.html><img src=Details/point.gif height=26 width=128 border=0 name=enterprise></a></td><td width=16></td></tr>");
document.write("<tr><td width=16 height=4></td><td height=4 background=Details/underline.gif></td><td width=16 height=4></td></tr>");
document.write("<tr><td colspan=3 height=3></td></tr>");
document.write("<tr><td class=border colspan=3>");
document.write("<a class=menu style='padding-top:16px' href=administration.html>Руководство</a>");
document.write("<a class=menu href=controller.html>Диспетчерская</a>");
document.write("<a class=menu href=service-joining.html>Служба по присоединению</a>");
document.write("<a class=menu href=capital-construction.html>Отдел капитального строительства</a>");
document.write("<a class=menu href=technological.html>Производственно - техническая служба</a>");
document.write("<a class=menu href=ste.html>Служба транспорта электроэнергии</a>");
document.write("<a class=menu href=accounts-department.html>Бухгалтерия</a>");
document.write("<a class=menu href=economic-department.html>Планово - экономический отдел</a>");
document.write("<a class=menu href=lawyer.html>Юридическая служба</a>");
document.write("<a class=menu href=office.html>Делопроизводство</a>");
document.write("<a class=menu href=laboratory.html>Электротехническая лаборатория</a>");
document.write("<a class=menu href=transport-service.html>Транспортная служба</a>");
document.write("<a class=menu href=personnel.html>Отдел кадров</a>");
document.write("<a class=menu style='padding-bottom:11px' href=safety.html>Отдел охраны труда</a>");
document.write("</td></tr></table>");
document.write("</div>");

// Территория (Territory)
document.write("<div id=popterritory onmouseout=\"popdown(event, this);\" onmouseover=\"cancel_queue();\">");
document.write("<table width=160 border=0 cellspacing=0 cellpadding=0>");
document.write("<tr><td colspan=3 height=30 background=Details/illumination.gif></td></tr>");
document.write("<tr><td width=16></td><td><a onmouseover=show('territory','m3') onmouseout=hide() href=territory.html><img src=Details/point.gif height=26 width=128 border=0 name=territory></a></td><td width=16></td></tr>");
document.write("<tr><td width=16 height=4></td><td height=4 background=Details/underline.gif></td><td width=16 height=4></td></tr>");
document.write("<tr><td colspan=3 height=3></td></tr>");
document.write("<tr><td class=border colspan=3>");
document.write("<a class=menu style='padding-top:16px' href=area-1.html>1 Электросетевой район</a>");
document.write("<a class=menu href=area-2.html>2 Электросетевой район</a>");
document.write("<a class=menu href=area-3.html>3 Электросетевой район</a>");
document.write("<a class=menu style='padding-bottom:11px' href=area-4.html>4 Электросетевой район</a>");
document.write("</td></tr></table>");
document.write("</div>");

// Услуги (Services)
document.write("<div id=popservices onmouseout=\"popdown(event, this);\" onmouseover=\"cancel_queue();\">");
document.write("<table width=160 border=0 cellspacing=0 cellpadding=0>");
document.write("<tr><td colspan=3 height=30 background=Details/illumination.gif></td></tr>");
document.write("<tr><td width=16></td><td><a onmouseover=show('services','m4') onmouseout=hide() href=services.html><img src=Details/point.gif height=26 width=128 border=0 name=services></a></td><td width=16></td></tr>");
document.write("<tr><td width=16 height=4></td><td height=4 background=Details/underline.gif></td><td width=16 height=4></td></tr>");
document.write("<tr><td colspan=3 height=3></td></tr>");
document.write("<tr><td class=border colspan=3>");
document.write("<a class=menu style='padding-top:16px' href=application.html>Технологическое присоединение к сетям ОАО «ПЭС»</a>");
document.write("<a class=menu href=activity-services.html>Прейскурант на оказание услуг по неосновной деятельности</a>");
document.write("<a class=menu href=commercial-account.html>ТУ по организации узлов коммерческого учета</a>");
document.write("<a class=menu style='padding-bottom:11px' href=tariffs.html>Тарифы на электроэнергию</a>");
document.write("</td></tr></table>");
document.write("</div>");