function changeTab(act,layOn,isSubYears){
	var chg = act.parentNode.parentNode;
	var list = act.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('div');
	for (i=0; i<(list.length-1); i++) {
		if (list[i].className == 'tabSxOn') list[i].className = 'tabSxOff'
		else if (list[i].className == 'tabDxOn') list[i].className = 'tabDxOff';
		if ((list[i].className == 'tabOn') || (list[i].className == 'tabOff')) {
			if (list[i].className == 'tabOn') list[i].className = 'tabOff'
		}
	}
	if ((chg.className == 'tabOn') || (chg.className == 'tabOff')) {
		chg.className = 'tabOn';
		lato = chg.parentNode.getElementsByTagName('div');
		for (s=0; s<(lato.length); s++){
			if ((lato[s].className == 'tabSxOff') || (lato[s].className == 'tabSxOn')) {
				lato[s].className = 'tabSxOn';
			} else if ((lato[s].className == 'tabDxOff') || (lato[s].className == 'tabDxOn')) {
				lato[s].className = 'tabDxOn';
			}
		}
	}
	var elencoTab = $$('div.contTab');
	for (var i=0;i<elencoTab.length;i++){
		elencoTab[i].style.display='none';
	}
	document.getElementById('tab'+layOn).style.display = 'block';
	if(isSubYears){
		for (i=0;i<$('btnYears').childNodes.length;i++){
			if($('btnYears').childNodes[i].tagName=='DIV') $('btnYears').childNodes[i].className="years"
		}
		document.getElementById('years_'+layOn).className = "years see"
	}
}

function changeMonth(id,size) {
	for (var i =0; i<size; i++ ) {
		if (document.getElementById("t"+i).style.display == "block") {
			document.getElementById("t"+i).style.display = "none";
			document.getElementById("d"+i).style.display = "none";
			document.getElementById("dd"+i).style.display = "block";
			document.getElementById("dd"+id).style.display = "none";
			document.getElementById("d"+id).style.display = "block";
			document.getElementById("t"+id).style.display = "block";
			break;
		}
	}
}

function tree(arg) 
{
	var d = "uca_" + arg;
	var d1 = "uca__" + arg;
	if (document.getElementById(d).style.display == "none") {
		document.getElementById(d).style.display = "block";
		document.getElementById(d1).style.display = "block";
	}
	else if (document.getElementById(d).style.display == "block") {
		document.getElementById(d).style.display = "none";
		document.getElementById(d1).style.display = "none";
	} 
}

function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}

function fontSizer(){
	var sizer=document.getElementById('fontSizer').childNodes[0].nodeValue;
	switch (sizer){
	case 'AAA': 
		document.body.style.fontSize="80%";
		document.getElementById('fontSizer').childNodes[0].nodeValue='A';
		setCookie("UCS_fontsize",'80%',7);
		break;
	case 'AA':
		document.body.style.fontSize="200%";
		document.getElementById('fontSizer').childNodes[0].nodeValue='AAA';
		setCookie("UCS_fontsize",'200%',7);
		break;
	case 'A':
		document.body.style.fontSize="100%";
		document.getElementById('fontSizer').childNodes[0].nodeValue='AA';
		setCookie("UCS_fontsize",'100%',7);
		break;
	}
}

function setCookie(name,value,expdays){
	var now = new Date();
	var exp = new Date(now.getTime() + (1000*60*60*24*expdays));
	document.cookie = name + "=" + escape(value) + ";" + "expires=" + exp.toGMTString() + ";" + "path=/";
}

function getCookie(name){
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0) {
		var start = dc.indexOf(cname);
		if (start != -1){
			start += cname.length;
			var stop = dc.indexOf(";", start);
			if (stop == -1) stop = dc.length;
			return unescape(dc.substring(start,stop));
		}
	}
	return null;
}

window.onload = function(){
	sizer=getCookie("UCS_fontsize");
	switch (sizer){
	case '80%': 
		document.body.style.fontSize="80%";
		if (querySt("mode") != 'print') {
			document.getElementById('fontSizer').childNodes[0].nodeValue='A';
		}
		break;
	case '200%':
		document.body.style.fontSize="200%";
		if (querySt("mode") != 'print') {
			document.getElementById('fontSizer').childNodes[0].nodeValue='AAA';
		}
		break;
	case '100%':
		document.body.style.fontSize="100%";
		if (querySt("mode") != 'print') {
			document.getElementById('fontSizer').childNodes[0].nodeValue='AA';
		}
		break;
	}
}

function ZoomMap() { 
	window.open("/map.asp","","left=0,top=0,width=515,height=477,resizable=no,scrollbars=no,status=no"); 
}

function addToFavorites(){
var ua=navigator.userAgent;
if (window.opera){
document.getElementById("bm_OP").style.display="inline";
}else if (document.all && ua.indexOf("Mac")==-1){
if(document.getElementById) document.getElementById("bm_IE").style.display="inline";
else document.all.bm_DISABLED.style.display="inline";
}else if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")){
document.getElementById("bm_MZ").style.display="inline";
}else if( ua.indexOf("Mac")!=-1 && (document.all || ua.indexOf("Safari")!=-1) ){
document.getElementById("bm_DISABLED").style.display="inline";
}
}
function disabledBookmarks(){
var ua=navigator.userAgent;
if(document.all)alert("To add this page to Favorites use [APPLE] + [D]")
else if (ua.indexOf("Safari")!=-1)alert("To add this page to Favorites use [APPLE] + [D]\nor drag the link on Favorites bar")
else alert("Sorry! Your browser doesn't support this function.")
}
function disabledBookmarksRus(){
var ua=navigator.userAgent;
if(document.all)alert("Для добавления этой страницы в Избранное используйте [APPLE] + [D]")
else if (ua.indexOf("Safari")!=-1)alert("Для добавления этой страницы в Избранное используйте [APPLE] + [D]\nили перетащите ссылку на панель Избранное")
else alert("Извините! Ваш браузер не поддерживает эту функцию.")
}

if (window.location.hostname == 'www.unicreditaton.ru' || window.location.hostname == 'unicreditaton.ru' || window.location.hostname == 'www.ucaton.ru' || window.location.hostname == 'ucaton.ru' || window.location.hostname == 'www.unicreditaton.com' || window.location.hostname == 'unicreditaton.com' || window.location.hostname == 'www.ucaton.com' || window.location.hostname == 'ucaton.com')
{
fileName = "http://www.unicreditsecurities.ru" + window.location.pathname + window.location.search + window.location.hash;
window.location.replace(fileName);
}

function dTomb(logoName,compName,amnt,role,yr)
{
	document.write("<table cellpadding=0 cellspacing=0 border=0 class=tmb>");
	document.write("<tr><td colspan=3 height=1><img src=\"/logos/px.gif\" width=168 height=1></td></tr>");
	document.write("<tr><td rowspan=3><img src=\"/logos/px.gif\" width=1 height=224></td><td height=155>");
	document.write("<table cellpadding=0 cellspacing=0 height=155 border=0 width=166>");
	document.write("<tr><td class=cmp>" + compName + "</td></tr>");
	document.write("<tr><td class=lg><img src=\"/logos/" + logoName + ".gif\"></td></tr>");
	document.write("<tr><td class=amnt>" + amnt + "</td></tr>");
	document.write("</table>");
	document.write("</td><td rowspan=3><img src=\"/logos/px.gif\" width=1 height=224></td></tr>");
	document.write("<tr><td class=rl height=58> <br>" + role + "</td></tr>");
	document.write("<tr><td class=yr height=10>" + yr + "</td></tr>");
	document.write("<tr><td colspan=3><img src=\"/logos/px.gif\" width=168 height=1></td></tr>");
	document.write("</table>");
}
function dTombGroup()
{
	var a = dTombGroup.arguments;
	var first=1;
	var groupCount=0;
	for(i=0;i<a.length;i+=5)
	{
		if(groupCount==0)
		{
			if(first!=1){document.write("</tr><tr><td colspan=5><img src=\"/logos/px.gif\" width=1 height=15></td></tr></table>");}
			document.write("<table cellpadding=0 cellspacing=0 border=0><tr>");
		}
		else{document.write("<td width=15><img src=\"/logos/px.gif\" width=15></td>");}
		document.write("<td width=170 height=213>");dTomb(a[i],a[i+1],a[i+2],a[i+3],a[i+4]);document.write("</td>");
		groupCount++;groupCount=groupCount%3;first=0;
	}
	document.write("</tr><tr><td colspan=5><img src=\"/logos/px.gif\" width=1 height=15></td></tr></table>");
}

function showban_1() {
if ($.browser.webkit || $.browser.safari)
{
	$("#banX").css('display','block');
}
else
{
	$("#banX").show("normal");	
}
setTimeout('showban_2()', 300);
}
function showban_2() {
if ($.browser.webkit || $.browser.safari)
{
	$("#banX").css('display','none');
	$("#ban1").css('display','block');
}
else
{
	$("#banX").hide("slow");
	$("#ban1").show(1000);
}
setTimeout('showban_3()', 5000);
}
function showban_21() {
if ($.browser.webkit || $.browser.safari)
{
	$("#ban5").css('display','none');
	$("#ban1").css('display','block');
}
else
{
	$("#ban5").hide(1000);
	$("#ban1").show(1000);
}
setTimeout('showban_3()', 5000);
}
function showban_3() {
if ($.browser.webkit || $.browser.safari)
{
	$("#ban1").css('display','none');
	$("#ban2").css('display','block');
}
else
{
	$("#ban1").hide(1000);
	$("#ban2").show(1000);
}
setTimeout('showban_4()', 5000);
}
function showban_4() {
if ($.browser.webkit || $.browser.safari)
{
	$("#ban2").css('display','none');
	$("#ban3").css('display','block');
}
else
{
	$("#ban2").hide(1000);
	$("#ban3").show(1000);
}
setTimeout('showban_5()', 5000);
}
function showban_5() {
if ($.browser.webkit || $.browser.safari)
{
	$("#ban3").css('display','none');
	$("#ban4").css('display','block');
}
else
{
	$("#ban3").hide(1000);
	$("#ban4").show(1000);
}
setTimeout('showban_6()', 5000);
}
function showban_6() {
if ($.browser.webkit || $.browser.safari)
{
	$("#ban4").css('display','none');
	$("#ban5").css('display','block');
}
else
{
	$("#ban4").hide(1000);
	$("#ban5").show(1000);
}
setTimeout('showban_21()', 5000);
}

