

function ShowSearchPanel() {
    var x = event.clientX - 20;
    var y = event.clientY + 7 + document.body.scrollTop;
    var phd = document.getElementById("outside");
    document.getElementById("searchPanel").style.left = (x - phd.offsetLeft) + 'px';
    document.getElementById("searchPanel").style.top = (y - phd.offsetTop) + 'px';
    document.getElementById("searchPanel").style.visibility = 'visible';
    return false;
}

function checkForm() {
    var email_exp = /^[a-z\.\-_0-9]+@[a-z\.\-_0-9]+\.[a-z]{2,}$/i;
    if (!email_exp.test(document.forms.subs.email.value)) {
        alert("Ââåäåííûé àäðåñ íå ïîõîæ íà E-mail");
        document.forms.subs.email.focus();
        return false;
    }
    return true;
}

function getElementPosition(elem) {

    var w = elem.offsetWidth;
    var h = elem.offsetHeight;

    var l = 0;
    var t = 0;
    while (elem) {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }
    return {"left":l, "top":t, "width": w, "height":h};
}

function showp(id) {
    var phd = document.getElementById("outside");
    var pos = getElementPosition(document.getElementById("outside"));
    var wx = 0;
    var wy = 0;
    if (window.screenTop) {
        wy = window.screenTop;
    } else {
        wy = window.screenY + 150;
    }
    if (window.screenLeft) {
        wx = window.screenLeft;
    } else {
        wx = window.screenX;
    }

    var mx = wx + phd.offsetLeft + 166;
    var my = wy + document.body.scrollTop - phd.offsetTop + 28;
    var Win = window.open(id.href, '', 'toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,resizable=1,width=880,height=550,border=thin,top=' + my + ',left=' + mx + ',help=0');
    Win.focus();
    return false;
}

function startList(id) {
    var sfEls = document.getElementById(id).getElementsByTagName("LI");
    for (var i = 0; i < sfEls.length; i++) {
        sfEls[i].onmouseover = function() {
            this.className += " over";
        }
        sfEls[i].onmouseout = function() {
            this.className = "";
        }
    }
}

if (document.addEventListener)
    document.addEventListener("click", function(e) {
        window.event = e;
    }, true);

 

