startList = function() {
	if (document.all&&document.getElementById) {
		var navRoot = document.getElementById("nav");
		var navRootLIs = navRoot.getElementsByTagName("LI");
		for (i=0; i<navRootLIs.length; i++) {
			var node = navRootLIs[i];
			if(navRoot.contains(node)) {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function GetVerticalLayout()
{
   /* Параметры */
   var fontFamily = "Tahoma"; /* задаем шрифт */
   var fontSize = 12; /* задаем размер шрифта */
   var notIE = !(navigator.appVersion.indexOf("MSIE") != -1 && navigator.systemLanguage);
   if(!notIE){ return true; }
   var supportSVG = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG", "1.1");

	if (notIE && supportSVG)
	{
		/* Собираем все ячейки */
		var td = document.getElementsByTagName("th");

		/* Находим ячейки с классом vertical и заменяем в них текст svg-изображением */
		var objElement = document.createElement("object");

		for(i = 0; i < td.length; i++)
		{
			if (td[i].className.match(/td_vertical/i))
			{
				var text = td[i].innerHTML;
				var h = td[i].clientHeight;
				var w = td[i].clientWidth;

				var obj = objElement.cloneNode(true);
				//obj.height = (h > w) ? h : w;
				obj.height = 350;
				obj.type = "image/svg+xml";
				obj.width = fontSize + 3;
				obj.data = "data:image/svg+xml;charset/windows-1251,<svg xmlns='http://www.w3.org/2000/svg'><text x='" + (-obj.height/2) + "' y='" + fontSize + "' style='font-family:" + fontFamily + "; font-size:" + fontSize + "px; text-anchor:middle; fill: #55565A;' transform='rotate(-90)'>" + text + "</text></svg>";
				td[i].replaceChild(obj, td[i].firstChild);
			}
		}
	}
}

function OnLoadWindow(e){
if(!e){
	e = window.event;
}
try {
	startList();
	GetVerticalLayout();
}catch(ex){}
}
window.onload = OnLoadWindow;
