//
// Открывает ссылку в новом окне
//
// wUrl    - ссылка
// wWidth  - ширина окна
// wHeight - высота окна
// 

function windowPopup(wUrl, wWidth, wHeight) 
{
    var xPos = (screen.availWidth  / 2) - (wWidth / 2);
    var yPos = (screen.availHeight / 2) - (wHeight / 2);
    window.open(wUrl, '', 'directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width='+wWidth+',height='+wHeight+',left='+xPos+',top='+yPos);
}

// юЄюсЁрцрхЄ яюфърЄхуюЁшш яЁш Ёрё°шЁхээюь яюшёъх
function showSubParts(partId, allCount) 
{
    var pointer  = document.getElementById('pointer');
    var subparts = document.getElementById('subparts');
    var slist    = document.getElementById('slist'+partId);

    if (partId =='') {
        if (pointer.style) {
            pointer.style.display = "none";
        } else {
            pointer.visibility = "hidden";
        }
        if (subparts.style) {
                subparts.style.display = "none";
        } else {
            subparts.visibility = "hidden";
        }
    } else {
        if (slist.length > 0) {
            if (pointer.style) {
                if (pointer.style.display == "none") {
                    pointer.style.display = "";
                }
            } else {
                pointer.visibility = "show";
            }
            if (subparts.style) {
                if (subparts.style.display == "none") {
                    subparts.style.display = "";
                }
            } else {
                subparts.visibility = "show";
            }
            if (slist.style) {
                if (slist.style.display == "none") {
                    slist.style.display = "";
                }
            } else {
                slist.visibility = "show";
            }
            slist.name = 'parent';
        } 
    }
    if (slist) {
        for (i = 0; i < allCount; i++) {
            if (i == partId) {
                continue;
            }
            tmp = document.getElementById('slist'+i);        
            if (tmp && tmp != slist) {
                tmp.style.display = "none";
            }
        }
    }
}  
