// Get browser type
var axi_IE = 1;
var axi_NS = 2;
function axi_BrowserType()
{
	if (navigator.appName.toLowerCase().indexOf('microsoft') >= 0) {
		return axi_IE;
	} else if (navigator.appName.toLowerCase().indexOf('netscape') >= 0) {
		return axi_NS;
	}
}

function axi_CreateXMLHttp()
{
	var xmlHttp = null;
	if (axi_BrowserType() == axi_IE) {
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
	} else if (axi_BrowserType() == axi_NS) {
		xmlHttp = new XMLHttpRequest();
	}
	return xmlHttp;
}

function axi_IsAllow(pth)
{
	var xmlHttp = axi_CreateXMLHttp();
	xmlHttp.open('GET', pth, false);
	xmlHttp.send(null);
	return xmlHttp.status == 200;
}

function axi_ShowContent(obj, iLev, pth)
{
	return true;
/*
	if(
		pth == '/company/fotoalb.php' ||
		pth == '/company/news_1/events.php' ||
		pth == '/company/press-center/interview.php' ||
		pth == '/company/press-center/index.php' ||
		pth == '/company/news_1/subscribe.php' ||
		pth == '/company/news_1/iz.php' ||
		pth == '/company/news_1/index.php' ||
		pth == '/partners/become.php' ||
		pth == '/company/press-center/inthepress.php' ||
		pth == '/services/personal_data.php'
	)
		return true;
	var axi_Cont = document.getElementById('axi_ContentPanel');
	if(axi_Cont == null) return false;

       axi_ClearSelectA(obj, iLev);
       axi_SetSelect(obj);

	var xmlHttp = axi_CreateXMLHttp();
	xmlHttp.open('GET', '/axi_getcontent.php?a=' + pth, false);
	xmlHttp.send(null);
	axi_Cont.innerHTML = xmlHttp.responseText;
	axi_BreadCrumb(pth)
	return false;
*/
}

function axi_BreadCrumb(pth)
{
	var axi_Cont = document.getElementById('axi_BreadCrumb');
	if(axi_Cont == null) return false;

	var xmlHttp = axi_CreateXMLHttp();
	xmlHttp.open('GET', '/axi_breadcrumb.php?a=' + pth, false);
	xmlHttp.send(null);
	var resp = xmlHttp.responseText

	xmlHttp.open('GET', '/axi_gettitle.php?a=' + pth, false);
	xmlHttp.send(null);

	axi_Cont.innerHTML = axi_str_replace('<a href=""></a>','<a href="' + pth + '">' + xmlHttp.responseText + '</a>',resp);
}


function axi_str_replace(search, replace, subject) {
    return subject.split(search).join(replace);
}


    function axi_ClearSelectA(obj,iLev) {
        if (obj == null || obj.tagName == null || obj.tagName.toLowerCase() != 'a') return;
        if (iLev)
            axi_ClearSelectUL(obj.parentNode.parentNode.parentNode.parentNode);
        else
            axi_ClearSelectUL(obj.parentNode.parentNode);
    }

    function axi_SetSelect(obj) {
        if (obj == null) return;
        obj.className = 'selected'
        if (obj.parentNode.parentNode.parentNode != null && obj.parentNode.parentNode.parentNode.tagName.toLowerCase() == 'li') {
            for (var c = 0; c < obj.parentNode.parentNode.parentNode.childNodes.length; c++)
                if (obj.parentNode.parentNode.parentNode.childNodes[c].tagName == 'A')
                    obj.parentNode.parentNode.parentNode.childNodes[c].className = 'selected';

        }
    }

    function axi_ClearSelectLI(obj) {
        if (obj == null || obj.tagName == null || obj.tagName.toLowerCase() != 'li') return;
        // ??? ??? ??? ??????? ?????????
        for (var c = 0; c < obj.childNodes.length; c++) {
            if (obj.childNodes[c].tagName == 'A')
                obj.childNodes[c].className = '';
            if (obj.childNodes[c].tagName == 'UL')
                axi_ClearSelectUL(obj.childNodes[c]);
        }
    }

    function axi_ClearSelectUL(obj) {
        if (obj == null || obj.tagName == null || obj.tagName.toLowerCase() != 'ul') return;
        for (var c = 0; c < obj.childNodes.length; c++)
            axi_ClearSelectLI(obj.childNodes[c]);
    }

function axi_PreOpen(liId)
{
	if(_getCookie(liId) != null) return;
	var liObj = document.getElementById(liId);
	if(liObj == null) return;
	OpenMenuNode(liObj.childNodes[1]);
}
