﻿RealVu_ff=navigator.userAgent.match(/Firefox/i);
RealVu_ff_o=(RealVu_ff && (navigator.userAgent.match(/Firefox\/2./i) || navigator.userAgent.match(/Firefox\/1./i)));
RealVu_ff_n=(RealVu_ff && !RealVu_ff_o);
RealVu_ie=navigator.appVersion.match(/MSIE/);
RealVu_saf=(navigator.userAgent.match(/Safari/)  && !navigator.userAgent.match(/Chrome/));


function drop_shadow(e) {
   var nel = e.cloneNode(1);
    nel.style.position = "absolute";
    e.style.color = "white";
    var q = findPosG(e);
    nel.style.top = (q.y - 1) + "px";
    e.parentNode.insertBefore(nel, e);
    //alert(nel.style.top);
    //nel.style.left = q.x + "px";
}
var dropped = false;
function ie_shadow(e) {
    if (!dropped && RealVu_ie) {
        var ar = document.getElementsByTagName("h1");
        if(ar[0]) drop_shadow(ar[0]);
        //drop_shadow(document.getElementById("dd1"));
        if(document.getElementById("dd2")) drop_shadow(document.getElementById("dd2"));
        dropped = true;
    }
}
RealVu_addEvent = function (elem, evtType, func) {
    if (elem) {
        if (elem.addEventListener) {
            elem.addEventListener(evtType, func, true);
        } else if (elem.attachEvent) {
            elem.attachEvent("on" + evtType, func);
        } else {
            elem["on" + evtType] = func;
        }
    }
}
RealVu_addEvent(document, "load", ie_shadow);

findPosG = function (adi) //<%// this function must NOT to be "" %>
{
    var ad = adi;
    var q = new Object();
    q.x = 0;
    q.y = 0;
    var xp = 0, yp = 0;
    var wnd = window.self; //<%//we use this variable to go thrue iframes %>
    try {
        while (ad != null && typeof (ad) != 'undefined') {
            if (ad.tagName.toLowerCase() == 'iframe') { //<% //added Feb 17, 2011 %>
                var adbw = RealVu_gbw(ad);
                xp += adbw.left;
                yp += adbw.top;
            }
            xp += ad.offsetLeft;
            yp += ad.offsetTop;
            var op = ad.offsetParent;
            var pn = ad.parentNode;
            var bw = null;
            while (op != null && typeof (op) != 'undefined') {
                xp += op.offsetLeft;
                yp += op.offsetTop;
                var ptn = op.tagName.toLowerCase();
                if ((RealVu_ie && ptn != "table") || (RealVu_ff_n && ptn == "td") || RealVu_saf) {
                    bw = RealVu_gbw(op);
                    xp += bw.left;
                    yp += bw.top;
                }
                if (ad.tagName.toLowerCase() != 'iframe' && op != document.body && op != document.documentElement) {
                    xp -= op.scrollLeft;
                    yp -= op.scrollTop;
                }
                if (!RealVu_ie) {
                    while (op != pn && pn != null) {
                        xp -= pn.scrollLeft;
                        yp -= pn.scrollTop;
                        if (RealVu_ff_o) {
                            bw = RealVu_gbw(pn);
                            xp += bw.left;
                            yp += bw.top;
                        }
                        pn = pn.parentNode;
                    }
                }
                pn = pn.parentNode;
                op = op.offsetParent;
            }
            ad = wnd.frameElement; //<%//in case Ad is allocated inside iframe here we go up %>
            wnd = wnd.parent;
        }
    }
    catch (e) {
        //RealVu_log.write("Exception 070: "+e.message+ "xp="+xp+" yp="+yp );
    }
    q.x = xp;
    q.y = yp;
    return q;
}
RealVu_gbw = function (e) {
    var w = new Object();
    w.left = 0; w.top = 0; w.right = 0; w.bottom = 0;
    if (window.getComputedStyle) {
        s = window.getComputedStyle(e, null);
        w.left = parseInt(s.borderLeftWidth.slice(0, -2));
        w.top = parseInt(s.borderTopWidth.slice(0, -2));
        w.right = parseInt(s.borderRightWidth.slice(0, -2));
        w.bottom = parseInt(s.borderBottomWidth.slice(0, -2));
    }
    else {
        w.left = RealVu_pbw(e.style.borderLeftWidth);
        w.top = RealVu_pbw(e.style.borderTopWidth);
        w.right = RealVu_pbw(e.style.borderRightWidth);
        w.bottom = RealVu_pbw(e.style.borderBottomWidth);
    }
    return w;
}
RealVu_pbw = function (w) {
    var bw = 0;
    if (typeof (w) == "string" && w != null && w != "") {
        p = w.indexOf("px");
        if (p >= 0) {
            bw = parseInt(w.substring(0, p));
        }
        else {
            bw = 1;
        }
    }
    return bw;
}
