function $(o) { return (typeof o == "object") ? o : document.getElementById(o); };
var UI = {
    undefined: undefined,
    setDisplay: function(dType, args) {
        var display = (dType === 0 ? "none" : "block");
        var arg;
        while (arg = args.pop()) {
            arg.style.display = display;
        }
    },
    show: function() {
        UI.setDisplay(1, [].slice.call(arguments, 0));
    },
    hide: function() {
        UI.setDisplay(0, [].slice.call(arguments, 0));
    },
    replaceClass: function(obj, oldClassName, newClassName) {
        obj.className = obj.className.replace(oldClassName, newClassName);
    },
    addClass: function(obj, className) {
        obj.className += " " + className;
    }
};
function showPos(p_srcElement, p_entID, p_PageID) {
    if (!$("entPosLogo" + p_entID)) return;
    //$("entPosLogo" + p_entID).src = p_srcElement.getAttribute("src");
    var obj = $("entPos" + p_entID);
    if (!obj) {
        var oDiv = document.createElement("div");
        oDiv.setAttribute("id", "entPos" + p_entID);
        oDiv.className = "popupPos";
        oDiv.innerHTML = "<a href='/member/person/company_view.asp?id=" + p_entID + "' target='_blank'><img border=0 id='entPosLogo" + p_entID + "' src='" + p_srcElement.getAttribute("src") + "' /></a><h3>数据读取中...</h3>"
        $("PositionShowBox").appendChild(oDiv);
        obj = $("entPos" + p_entID);
        obj.onmouseover = showPosSelf;
        obj.onmouseout = hidPosSelf;
    }
    if (!$("entPosLogo" + p_entID) || $("entPosLogo" + p_entID).src == "") {
        obj.onmouseover = showPosSelf;
        obj.onmouseout = hidPosSelf;
    }
    $("entPosLogo" + p_entID).src = p_srcElement.getAttribute("src");
    if (obj) {
        var x = -6, y = -5;
        var oRect = p_srcElement.getBoundingClientRect();
        x += oRect.left; //+ Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);
        y += oRect.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        obj.style.left = x + "px";
        obj.style.top = y + "px";
        UI.show(obj);
        var shadow = $(obj.id + "shadow");
        if (!shadow) {
            shadow = document.createElement("div");
            shadow.setAttribute("id", obj.id + "shadow");
            shadow.className = "popupPos-shadow";
            shadow.style.height = (obj.clientHeight + 4) + "px"; //边框为2
            document.body.appendChild(shadow);
        }
        shadow.style.left = x + 2 + "px";
        shadow.style.top = y + 2 + "px";
        UI.show(shadow);
    }
};
function hidPos(p_entID) {
    if (!$("entPoslogo" + p_entID)) return;
    UI.hide($("entPos" + p_entID), $("entPos" + p_entID + "shadow"));
};
function showPosSelf() {
    UI.show(this, $(this.id + "shadow"));
};
function hidPosSelf() {
    UI.hide(this, $(this.id + "shadow"));
};
function showPNames(event, objID) {
    var x, y;
    if (document.all) {//  IE
        x = window.event.clientX + document.documentElement.scrollLeft;
        y = window.event.clientY + document.documentElement.scrollTop;
    } else if (document.layers || document.getElementById) {    //  Netscape
        x = event.pageX;
        y = event.pageY;
    }
    var obj = $(objID);
    if (!obj) {
        var oDiv = document.createElement("div");
        oDiv.className = "pos";
        oDiv.setAttribute("id", objID);
        oDiv.innerHTML = "正在获取职位数据...";
        $("PositionShowBox").appendChild(oDiv);
        obj = $(objID);
    }
    obj.style.display = "block";
    obj.style.left = (x) + "px";
    obj.style.top = (y + 20) + "px";
};
function hidPNames(objID) {
    $(objID).style.display = "none";
};
window.onload = function() {
    $("ifPositionShow").src = "ggrcposition02.asp";
};
function AddLogoCLick(purlid) {
    window.open("/member/person/company_view.asp?id="+purlid);
};
