function ADetails(href)
{
	document.writeln("  <a href='"+ href +"'><img src='imgs/arrow-ds.gif' border=0 alt='details'></a>");
}

function getPanel()
{
//	return (isIE && ieVers < 6) ? top.ifrm.panel :
//		top.document.getElementById("ifrm").contentWindow.document.getElementById("panel").contentWindow;
	if (isIE)
		return top.ifrm.panel;
	var panel = top.document.getElementById("ifrm").contentWindow.document.getElementById("panel");
	if (panel)
		panel = panel.contentWindow;
	return panel;
}

function onLoadCmn()
{
	var panel = getPanel();
	if (!panel)
	{
		if (document.title.length)
			top.document.title = document.title;
		Chars(this);
		return;
	}
/*	var issue;
	if (typeof(panel) != "undefined")
		issue = panel.document.getElementById("issue");
	if (typeof(issue) == "undefined")
	{
		setTimeout("onLoadCmn()", 1);
		return;
	}*/
	Chars(this);
	if (isIE && ieVers >= 5)
	{
		var sel;
	//	if (typeof(sel = document.body.getAttribute("issue")) != "undefined")
	//		issue.selectedIndex = sel;
		if (typeof(sel = document.body.getAttribute("section")) != "undefined")
			panel.selectSection(parseInt(sel));
	//	selIssue = issue.selectedIndex;
		selSection = panel.oselsect ? parseInt(panel.oselsect.id) : 0;
	}
	if (document.title == "" && panel.oselsect)
		document.title = "«Òß», " + panel.oselsect.innerText;
	if (document.title.length)
		top.document.title = document.title;
	var str = location.href;
	var i1 = str.indexOf("get.php?");
	var i2 = str.indexOf("|");
	if (i1 != -1 && i2 != -1)
	{
		str = str.slice(i1 + 8, i2);
		if (str.charAt(0) == '_')
			str = str.substr(1);
		str = parseInt(str);
	//	if (!isNaN(str))
	//		issue.value = str;
	}
}

function onSaveCmn()
{
//	if (typeof(selIssue) != "undefined")
//		document.body.setAttribute("issue", selIssue);
	if (typeof(selSection) != "undefined")
		document.body.setAttribute("section", selSection);
}

function toEmbedFont()
{
	return (!isNT || ntVers<5 || GetCookie("tatletts")) && GetCookie("chars") != "latin";
}

if (typeof(parent.isIE) == "undefined")
{
	location.href = "index.php?" +
		location.href.substr(Math.max(location.href.lastIndexOf("\\"),
									  location.href.lastIndexOf("/")) + 1);
}
else
{
	if (isIE = parent.isIE)
		ieVers = parent.ieVers;
	isNS = parent.isNS;
	isFirefox = parent.isFirefox;
	isOpera = parent.isOpera;
	if (isNT = parent.isNT)
		ntVers = parent.ntVers;
	appVers = parent.appVers;
	scrVers = parent.scrVers;
	Chars = parent.Chars;
	SetBrwSsnCookie = parent.SetBrwSsnCookie;
	SetCookie = parent.SetCookie;
	GetCookie = parent.GetCookie;
	getClientHeight = parent.getClientHeight;
	getClientWidth = parent.getClientWidth;
	onResponse = parent.onResponse;
	if (typeof(path) == "undefined")
		path = "";
	document.writeln("<META HTTP-EQUIV='Content-Type' CONTENT='text/html; CHARSET=Unicode'>");
	if (toEmbedFont())
		document.writeln("<link href='" + path + "fonts.css' type='text/css' rel='stylesheet' charset='windows-1251'>");
	document.writeln("<link href='" + path + "style.css' type='text/css' rel='stylesheet' charset='windows-1251'>");
}
