// JavaScript Document
//<![CDATA[
    var bmUrl = encodeURIComponent(location.href);
    var bmTitle = encodeURIComponent(window.document.title);
    var My_ClickTimeout = 0, My_PopUp = 0;
    DeleteOn = new Image();
    DeleteOn.src = "/images/DeleteOn.gif";
    function getWindowRect() {
        var de = document.documentElement,db = document.body;
        return {
            "left": window.pageXOffset || (db &&db.scrollLeft) || (de && de.scrollLeft),
            "top": window.pageYOffset || (db && db.scrollTop) || (de && de.scrollTop),
            "width": window.innerWidth || (de &&de.clientWidth) ||document.body.clientWidth,
            "height": window.innerHeight || (de &&de.clientHeight) ||document.body.clientHeight
        }
    }
    function getElementRect(elem) {
        var l = 0, t = 0, w = elem.offsetWidth,h = elem.offsetHeight;
        while (elem) {
            l += elem.offsetLeft;
            t += elem.offsetTop;
            elem = elem.offsetParent;
        }
        return { "left": l, "top": t, "width": w,
            "height": h
        };
    }
    function setBookmarksPos(parent, target) {
        target.style.top = '0';
        target.style.left = '0';
        var p = getElementRect(parent),
           p1 = getElementRect(target),
           s = getWindowRect(), h;
        if (p.top + p.height + target.offsetHeight + 3 <
           s.top + s.height)
            h = p.top + p.height + 3; else
            if (p.top - target.offsetHeight - 6 > s.top ||
              (p.top - target.offsetHeight - 6 >= 0 &&
              s.top - p.top + target.offsetHeight
              + 6 < p.top + p.height +
              target.offsetHeight + 3 - s.top - s.height))
                h = p.top - target.offsetHeight - 6; else
                h = p.top + p.height + 3;
        target.style.top = (h - p1.top) + 'px';
        target.style.left = (p.left - p1.left) - 3 + 'px';
    }
    function My_BookmarkOpen(This) {
        if (My_ClickTimeout)
            clearTimeout(My_ClickTimeout);
        if (My_PopUp && My_PopUp !=This.nextSibling)
            My_PopUp.style.display = "none";
        My_PopUp = This.nextSibling;
        My_PopUp.style.display = "";
        setBookmarksPos(This, My_PopUp);
    }
    function My_BookmarClose() {
        My_ClickTimeout = setTimeout("My_PopUp.style.display=" +"'none';My_PopUp=0;" +"My_ClickTimeout=0",300);
    }
    function __add_favourite(a, u, t) {
        try {
            window.external.AddFavorite(u, t);
        }
        catch (e) {
            try {
                window.sidebar.addPanel(t, u, "");
            }
            catch (e) {
                if (typeof (opera) == "object") {
                    a.rel = "sidebar";
                    a.title = t;
                    a.url = u;
                    return true;
                } else {
                    alert('Нажмите Ctrl-D чтобы' + 'добавить страницу в' + 'закладки');
                }
            }
        }
        return false;
    }
//]]>
