function MoveUp() { //?????????? ?????????? ?????????????? ???? ???? ????????		
        source = document.getElementById('introtext');
        target = document.getElementById('cloudtags');
        myparent = document.getElementById('leftcol');
        if (source!=null) myparent.insertBefore(source,target);

}

function HideBorder (Drop) { //??????? border ? ??????????? ???????? ???? ??? ????????? ?? ?????????? ??????? 
        d=Drop.previousSibling;
        if (navigator.appName!="Microsoft Internet Explorer"){
                d=d.previousSibling;
        }
        else
        {
                Drop.className+=" jshover";
        }
        if (Drop.className.indexOf("dropdown")!=-1)
        {
                d.style.border = "none";
                d.style.paddingRight="1px"; //??? ?????????? ???????? ??????
        }
        else
        {
                if (Drop.className.indexOf("active")==-1) Drop.childNodes[0].style.borderRightColor="#94bf2d";
                if ((d!=null) && (d.className.indexOf("active")==-1) && (Drop.className.indexOf("active")==-1)) {
                        d.childNodes[0].style.border = "none";
                        d.childNodes[0].style.paddingRight="16px";
                }
        }
}

function ShowBorder(Drop) { //??????? ??????? HideBorder (Drop)
        d=Drop.previousSibling;
        if (navigator.appName!="Microsoft Internet Explorer"){
                d=d.previousSibling;
        }
        else
        {
                Drop.className=Drop.className.replace(" jshover", "");
        }

        if (Drop.className.indexOf("dropdown")!=-1){
                d.style.borderRight = "1px solid";
                d.style.paddingRight="0";
        }
        else
        {
                if (Drop.className.indexOf("active")==-1) Drop.childNodes[0].style.borderRightColor="#99c441";
                if ((d!=null) && (d.className.indexOf("active")==-1) && (Drop.className.indexOf("active")==-1))  {
                        d.childNodes[0].style.borderRight = "1px solid #99c441";
                        d.childNodes[0].style.paddingRight="15px";
                }
        }
}

function HidePanel()
{
        if (document.getElementById('query').style.display == "block")
        {
                document.getElementById('query').style.display = "none";
                document.getElementById('openlink').innerHTML = "развернуть поиск";
                document.getElementById('openlink').style.marginLeft = "453px"
        }
        else
        {
                document.getElementById('query').style.display = "block";
                document.getElementById('openlink').innerHTML = "свернуть поиск";
                document.getElementById('openlink').style.marginLeft = "455px"
        }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
        if (init==true) with (navigator) {
                if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
                        document.MM_pgW=innerWidth;
                        document.MM_pgH=innerHeight;
                        onresize=MM_reloadPage;
                }
        }
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
        eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
        if (restore) selObj.selectedIndex=0;
}

function OnSpecial(trObj, upObj, downObj) {
        trObj = document.getElementById(trObj);
        upObj = document.getElementById(upObj);
        downObj = document.getElementById(downObj);
        var hidden = (trObj.style.display == 'none');
        trObj.style.display = hidden ? '' : 'none';
        upObj.style.display = hidden ? '' : 'none';
        downObj.style.display = !hidden ? '' : 'none';
}

function MM_findObj(n, d) { //v4.01
        var p,i,x;
        if(!d) d=document;
        if((p=n.indexOf("?"))>0&&parent.frames.length) {
                d=parent.frames[n.substring(p+1)].document;
                n=n.substring(0,p);
        }
        if(!(x=d[n])&&d.all) x=d.all[n];
        for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
        for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
        if(!x && d.getElementById) x=d.getElementById(n);
        return x;
}

function MM_showHideLayers() { //v6.0
        var i,p,v,obj,args=MM_showHideLayers.arguments;
        for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) {
                v=args[i+2];
                if (obj.style) {
                        obj=obj.style;
                        v=(v=='show')?'visible':(v=='hide')?'hidden':v;
                }
                obj.visibility=v;
        }
}

function CorrectLeftHeaders() {

        var contentDiv = document.getElementById('contentDiv');
        if (!contentDiv) return;
        contentDiv.style.width = '1px';
        var newWidth = (contentDiv.parentNode.clientWidth - 5);
        if (newWidth > 0)
                newWidth = newWidth + 'px';
        else
                newWidth = '';
        contentDiv.style.width = newWidth;
        var headerTable = document.getElementById('headerTable');
        var contentTable = document.getElementById('contentTable');
        if (!(headerTable && contentTable))
                return;
        var rowSpannedCell = null;
        var topSpannedHeight = 0;
        var spanesLeft = 0;
        for(i = 0; i < headerTable.rows.length; i++) {

                var hRow = headerTable.rows[i];
                var cRow = contentTable.rows[i];
                var hCell = hRow.cells[0];
                if (hCell.rowSpan > 1) {
                        rowSpannedCell = hCell;
                        hCell = hRow.cells[1];
                        topSpannedHeight = 0;
                        spanesLeft = hCell.rowSpan;
                }
                var cCell = cRow.cells[0];
                hCell.style.marginBottom = 0 + 'px';
                hCell.style.paddingBottom = 4 + 'px';
                hCell.style.marginTop = 0 + 'px';
                hCell.style.paddingTop = 4 + 'px';
                cCell.style.marginTop = 0 + 'px';
                cCell.style.paddingTop = 4 + 'px';
                cCell.style.marginBottom = 0 + 'px';
                cCell.style.paddingBottom = 4 + 'px';
                var hRowHeight = hCell.clientHeight;
                var cRowHeight = cCell.clientHeight;
                if (hRowHeight > cRowHeight) {
                        cCell.style.height = hRowHeight + 'px';
                        hCell.style.height = hRowHeight + 'px';
                } else {
                        hCell.style.height = cRowHeight + 'px';
                        cCell.style.height = cRowHeight + 'px';
                }

                if (spanesLeft > 0) {
                        topSpannedHeight += hCell.clientHeight;
                        if (spanesLeft == 1)
                                rowSpannedCell.style.height = topSpannedHeight + 'px';
                        spanesLeft--;
                }
        }
}
window.onload = CorrectLeftHeaders();
//window.onresize = CorrectLeftHeaders();
function RemoveItem(itemId) {
        var removeForm = document.getElementById('removeForm');
        removeForm.removeId.value = itemId;
        removeForm.submit();
}
function OpenComparePage(strUrl) {
        var compareWindow = window.open(strUrl, 'compareWindow');
        compareWindow.focus();
        return false;
}
