﻿var vS = ';',
jS = '职位类别',
sjS = '职位名称',
cS = '工作地点',
dS = '发布时间',
iS = '行业类别',
pImg = 'http://myimg.zhaopin.com/images/blank.gif';
var allLibJobsearch = [];
function lib_searchItem(o, i, v, t, fn, fn2, pid) {
    this.C_ID = o;
    this.id = i;
    this.val = v;
    this.txt = t;
    this.fn = fn ? fn : 'fnClickItem';
    this.fn2 = fn2 ? fn2 : null;
    this.pid = pid ? pid : null;
    this.child = [];
    this.parent = null;
    this.childF = false;
    this.childN = 0;
    this.check = false
};
lib_searchItem.prototype.add = function(c) {
    c.parent = this;
    this.child[c.id] = c;
    if (!this.childF) this.childF = true;
    this.childN++
};
lib_searchItem.prototype.toString = function() {
    var obj = eval(this.C_ID);
    if (obj.nowID.indexOf(vS) > -1) var flag = (vS + obj.nowID + vS).indexOf(vS + this.id + vS) > -1 ? true : false;
    else var flag = obj.nowID == this.id ? true : false;
    return '<span id="' + this.C_ID + '_aItem_' + this.id + '" onclick="' + this.C_ID + '.' + this.fn + '(\'' + this.id + '\',event)" onmouseover="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',true)" onmouseout="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',false)" class="' + (flag ? 'focus' : '') + ' substitute4a itemSpan"><div class="cityItemPadding">' + this.txt + '</div></span>'
};
lib_searchItem.prototype.toString_c = function() {
    var flag = this.check;
    return '<label for="' + this.C_ID + '_cBox_' + this.id + '" class="' + (flag ? 'boxFocus' : 'boxBlur') + '" onmouseover="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',true)" onmouseout="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',false)"><input type="checkbox" name="' + this.C_ID + '_cBox" id="' + this.C_ID + '_cBox_' + this.id + '" value="' + this.id + '"' + (flag ? ' checked="checked"' : '') + (this.fn2 ? ' onclick="' + this.C_ID + '.' + this.fn2 + '(this,event)"' : '') + ' onfocus="this.blur()">' + this.txt + '</label>'
};
function lib_jobsearch(o, d, h, b, t, p) {
    allLibJobsearch.push(this);
    this.C_ID = o;
    this.h = eval(h) ? eval(h) : null;
    this.b = eval(b) ? eval(b) : null;
    this.data = d;
    this.$_d = [];
    this.tit = t;
    this.nowID = '';
    this.config = {};
    this.parent = p ? p : null;
    this.child = null;
    if (p) p.child = this;
    this.hFlag = 'open';
    this.pFlag = 'open';
    this.oFlag = 'close';
    this.pID = '';
    this.dataF = false;
    this.cacheID = ''
};
lib_jobsearch.prototype.A = myAttachEvent;
lib_jobsearch.prototype.fnIniButton = function() {
    var T = this;
    if (this.b != null) {
        this.P = function(e) {
            T.fnClickButton(e)
        };
        if (typeof (window.event) != 'undefined') this.b.onclick = new Function(this.C_ID + ".fnClickButton(event)");
        else if (typeof (window.Event) != 'undefined') this.b.onclick = new Function(this.C_ID + ".fnClickButton(Event)")
    }
    var i, txtStr = '',
    v = this.h.value;
    switch (this.tit) {
        case jS:
            txtStr = v == '' ? '' : v.charAt(v.length - 1) == vS ? v.substring(0, v.length - 1) : v;
            break;
        case sjS:
            if (v != '') txtStr = f2t(v, this.data, 0, 2);
            break;
        case iS:
            txtStr = v != '' ? v.replace(new RegExp(vS, 'g'), '+') : '';
            break;
        case dS:
            if (v != '') txtStr = f2t(v, this.data, 0, 1);
            break;
        case cS:
            break
    }
    if (txtStr != '') this.fnTxt2Button(txtStr);
    if (this.parent) {
        if (this.parent.h.value != '') this.b.disabled = false;
        else this.b.disabled = true
    } else this.b.disabled = false
};
lib_jobsearch.prototype.fnFixButton = function() {
    if (!this.dataF && this.h.value != '') {
        var i, txtStr = null,
        v = this.h.value;
        switch (this.tit) {
            case jS:
            case iS:
                if (v != '') txtStr = f2t(v, this.data, 1, 1);
                if (txtStr == '') txtStr = '不限';
                break;
            case sjS:
            case dS:
                break;
            case cS:
                break
        }
        if (txtStr == '不限') {
            this.h.value = '';
            this.fnTxt2Button(txtStr)
        }
        if (this.parent) {
            if (this.parent.b.value != '不限') this.b.disabled = false;
            else {
                this.b.disabled = true;
                this.h.value = '';
                this.fnTxt2Button('不限')
            }
        } else this.b.disabled = false
    }
};
lib_jobsearch.prototype.fnIniDiv = function() {
    if (!this.divF) {
        var newDiv = document.createElement('div');
        newDiv.id = this.C_ID + '_popupDiv';
        newDiv.className = 'searchPopupDiv';
        if (typeof (this.config.width) != 'undefined' && this.config.width != 0) newDiv.style.width = this.config.width + 'px';
        if (this.b.parentNode && this.b.parentNode.nodeType == 1 && this.b.parentNode.tagName.toLowerCase() != 'html') this.b.parentNode.appendChild(newDiv);
        else document.body.appendChild(newDiv);
        newDiv.innerHTML = this.divHTML();
        this.div = newDiv;
        this.dDiv = document.getElementById(this.C_ID + '_dDiv');
        this.nowSpan = document.getElementById(this.C_ID + '_nowSpan');
        if (this.tit == cS) {
            this.dDiv_c = document.getElementById(this.C_ID + '_dDiv_c');
            this.dDiv_h = document.getElementById(this.C_ID + '_dDiv_h');
            this.dDiv_p = document.getElementById(this.C_ID + '_dDiv_p');
            this.dDiv_o = document.getElementById(this.C_ID + '_dDiv_o')
        }
        var T = this;
        this.dMouse = document.getElementById(this.C_ID + '_mMove');
        this.MOVER = function() {
            w_mmover(T.div.id)
        };
        this.MOUT = function() {
            w_mmout()
        };
        this.MSELECT = function() {
            return false
        };
        this.A(this.dMouse, 'selectstart', this.MSELECT);
        this.div.onselectstart = this.MSELECT;
        this.A(this.dMouse, 'mouseover', this.MOVER);
        this.A(this.dMouse, 'mouseout', this.MOUT);
        this.divF = true
    }
};
lib_jobsearch.prototype.fnIni$_d = function() {
    if (!this.dataF) {
        var i, v = this.h.value;
        switch (this.tit) {
            case jS:
                this.vT = 0;
                for (i = 0; this.data[i]; i++) {
                    this.$_d[this.data[i][0]] = new lib_searchItem(this.C_ID, this.data[i][0], this.data[i][0], this.data[i][1], 'fnClickItem');
                    if (this.$_d[this.data[i][0]].val == v) this.nowID = this.$_d[this.data[i][0]].id
                };
                break;
            case sjS:
                this.vT = 1;
                var tempValueStr = vS + v + vS;
                var checkN = 0;
                for (i = 0; this.data[i]; i++) {
                    this.$_d[this.data[i][0]] = new lib_searchItem(this.C_ID, this.data[i][0], this.data[i][0], this.data[i][2], null, 'fnCheckItem');
                    if (this.parent != null) this.parent.$_d[this.data[i][1]].add(this.$_d[this.data[i][0]]);
                    if (tempValueStr.indexOf(vS + this.$_d[this.data[i][0]].val + vS) != -1) {
                        this.$_d[this.data[i][0]].check = true;
                        checkN++
                    }
                }
                if (this.parent.nowID != '' && v != '') {
                    var pid = this.parent.nowID;
                    if (this.parent.$_d[pid] && this.parent.$_d[pid].childN == checkN) this.parent.$_d[pid].check = true
                };
                break;
            case iS:
                this.vT = 1;
                var tempValueStr = vS + v + vS;
                for (i = 0; this.data[i]; i++) {
                    this.$_d[this.data[i][0]] = new lib_searchItem(this.C_ID, this.data[i][0], this.data[i][1], this.data[i][1], null, 'fnCheckItemMax');
                    if (tempValueStr.indexOf(vS + this.$_d[this.data[i][0]].val + vS) != -1) {
                        this.$_d[this.data[i][0]].check = true
                    }
                };
                break;
            case dS:
                this.vT = 0;
                for (i = 0; this.data[i]; i++) {
                    this.$_d[this.data[i][0]] = new lib_searchItem(this.C_ID, this.data[i][0], this.data[i][0], this.data[i][1]);
                    if (this.$_d[this.data[i][0]].val == v) this.nowID = this.$_d[this.data[i][0]].id
                };
                break;
            case cS:
                this.vT = 0;
                for (i = 0; this.data[i]; i++) {
                    this.$_d[this.data[i][0]] = new lib_searchItem(this.C_ID, this.data[i][0], this.data[i][2], this.data[i][2], 'fnClickItem_city', null, this.data[i][1]);
                    if ((vS + v + vS).indexOf(vS + this.$_d[this.data[i][0]].val + vS) > -1) this.nowID += this.nowID == '' ? this.$_d[this.data[i][0]].id : vS + this.$_d[this.data[i][0]].id;
                    if (this.$_d[this.data[i][0]].pid != 0 && this.$_d[this.$_d[this.data[i][0]].pid]) this.$_d[this.$_d[this.data[i][0]].pid].add(this.$_d[this.data[i][0]])
                }
                break
        }
        this.dataF = true
    }
};
lib_jobsearch.prototype.setHTML = function() {
    if (this.tit == cS) {
        this.dDiv.innerHTML = '';
        this.dDiv.style.display = 'none';
        this.setStatus();
        this.dDiv_h.innerHTML = this.hotHTML();
        this.dDiv_p.innerHTML = this.proHTML();
        this.dDiv_o.innerHTML = this.oveHTML()
    } else this.dDiv.innerHTML = this.dDivHTML();
    this.checkboxLabel(this.dDiv);
    this.setNow()
};
lib_jobsearch.prototype.checkboxLabel = function(html) {
    if (html) {
        var arrBox = html.getElementsByTagName('input');
        for (var i = 0; arrBox[i]; i++) {
            if (arrBox[i].type.toLowerCase() == 'checkbox' && arrBox[i].parentNode.tagName.toLowerCase() == 'label') arrBox[i].parentNode.htmlFor = arrBox[i].id
        }
    }
};
lib_jobsearch.prototype.fnClickButton = function(e) {
    e.preventDefault ? e.stopPropagation() : (e.cancelBubble = true);
    if (!this.divF) this.fnIniDiv();
    this.setLoading();
    this.div.style.zIndex = 99;
    switchVisibility(this.div.id, e, getXY(this.b).x, getXY(this.b).y + 22);
    if (!this.dataF) {
        if (this.parent && !this.parent.dataF) this.parent.fnIni$_d();
        this.fnIni$_d()
    } else {
        if (this.C_ID == 'cityF') {
            var inputTxt = this.h.value;
            this.nowID = '';
            for (var i in this.$_d) if (this.$_d[i].txt == inputTxt) {
                this.nowID = this.$_d[i].id;
                break
            }
        }
    }
    this.setHTML();
    if (this.div.style.visibility != 'hidden') {
        setShim(this.div);
        positionObject(this.div.id, getXY(this.b).x, getXY(this.b).y + 22)
    }
    if (window.currentlyVisiblePopup2) {
        changeObjectVisibility(window.currentlyVisiblePopup2, 'hidden');
        window.currentlyVisiblePopup2 = false
    }
};
lib_jobsearch.prototype.setLoading = function() {
    this.dDiv.innerHTML = '请稍等...';
    this.dDiv.style.display = ''
};
lib_jobsearch.prototype.getStatus = function() {
    var id = this.nowID.toString().indexOf(vS) > -1 ? this.nowID.toString().split(vS)[0] : this.nowID,
    i;
    if (this.$_d[id]) {
        if (id == 489) {
            this.pID = '';
            return 'default'
        }
        if (id == 480) {
            this.pID = '';
            return 'oversea'
        }
        for (i = 0; arrOversea[i]; i++) if (arrOversea[i][0] == id) {
            this.pID = '';
            return 'oversea'
        }
        for (i = 0; arrProvince[i]; i++) {
            if (arrProvince[i][0] == id) {
                if (this.$_d[id].childF) this.pID = id;
                else this.pID = '';
                break
            }
        }
        if (i == arrProvince.length) {
            if (this.$_d[id] && this.$_d[id].parent != null) this.pID = this.$_d[id].pid
        }
        if (this.pID == 489) this.pID = '';
        return 'province'
    } else {
        this.pID = '';
        return 'default'
    }
};
lib_jobsearch.prototype.setStatus = function() {
    var type = this.getStatus();
    switch (type) {
        case 'default':
            this.hFlag = 'open';
            this.pFlag = 'open';
            this.oFlag = 'close';
            break;
        case 'province':
            this.hFlag = 'open';
            this.pFlag = 'open';
            this.oFlag = 'close';
            break;
        case 'oversea':
            this.hFlag = 'open';
            this.pFlag = 'close';
            this.oFlag = 'open';
            break
    }
};
lib_jobsearch.prototype.fn2Provinces = function() {
    this.pID = '';
    this.dDiv_p.innerHTML = this.proHTML();
    setShim(this.div)
};
lib_jobsearch.prototype.fnClickProvince = function(pid) {
    this.pID = pid;
    this.h.value = this.$_d[pid].val;
    if (this.nowID != '') {
        var arr = this.nowID.toString().split(vS),
        i;
        for (i = 0; arr[i]; i++) if (document.getElementById(this.C_ID + '_aItem_' + arr[i])) document.getElementById(this.C_ID + '_aItem_' + arr[i]).className = document.getElementById(this.C_ID + '_aItem_' + arr[i]).className.replace(' focus', '').replace('focus', '')
    }
    this.nowID = pid;
    this.fnTxt2Button(this.$_d[pid].txt);
    this.setNow();
    this.dDiv_p.innerHTML = this.proHTML();
    setShim(this.div)
};
lib_jobsearch.prototype.fnCloseOpen = function(id) {
    var html = document.getElementById(id);
    var img = document.getElementById(id + 'Icon');
    var status = '';
    if (html) {
        if (html.style.display == 'none') {
            html.style.display = '';
            status = 'open'
        } else {
            html.style.display = 'none';
            status = 'close'
        }
        if (img) img.className = 'icon' + status;
        switch (id) {
            case this.C_ID + '_hCon': this.hFlag = status;
                break;
            case this.C_ID + '_pCon': this.pFlag = status;
                break;
            case this.C_ID + '_oCon': this.oFlag = status;
                break
        }
        setShim(this.div)
    }
};
lib_jobsearch.prototype.fnChangeParent = function() {
    if (window.currentlyVisiblePopup2) switchFocus(this.parent.div.id);
    else {
        if (!this.div.mask) this.div.mask = new divMask(this.div);
        this.div.mask.showMask();
        if (!this.parent.divF) this.parent.fnIniDiv();
        this.parent.dDiv.innerHTML = this.parent.dDivHTML();
        this.parent.setNow();
        positionObject(this.parent.div.id, getXY(this.parent.b).x, getXY(this.parent.b).y + 22);
        this.parent.div.style.zIndex = this.div.style.zIndex * 1 + 2;
        changeObjectVisibility(this.parent.div.id, 'visible');
        window.currentlyVisiblePopup2 = this.parent.div.id
    }
};
lib_jobsearch.prototype.fnCheckAllLink = function(v) {
    var arrInput = this.dDiv.getElementsByTagName('input');
    var cAll = (arrInput[0].type.toLowerCase() == 'checkbox' && arrInput[0].name == this.C_ID + '_cBox_all') ? arrInput[0] : null;
    if (cAll) {
        cAll.checked = v;
        this.fnCheckAll(cAll)
    }
};
lib_jobsearch.prototype.fnCheckAll = function(c) {
    var arrInput = this.dDiv.getElementsByTagName('input'),
    i;
    for (i = 1; arrInput[i]; i++) {
        if (arrInput[i].type.toLowerCase() == 'checkbox' && arrInput[i].name == this.C_ID + '_cBox') {
            arrInput[i].checked = c.checked;
            if (c.checked) {
                if (arrInput[i].parentNode.className.indexOf('boxFocus') == -1) {
                    if (arrInput[i].parentNode.className.indexOf('boxBlur') > -1) arrInput[i].parentNode.className = arrInput[i].parentNode.className.replace('boxBlur', 'boxFocus');
                    else arrInput[i].parentNode.className += arrInput[i].parentNode.className == '' ? 'boxFocus' : ' boxFocus'
                }
            } else {
                if (arrInput[i].parentNode.className.indexOf('boxBlur') == -1) {
                    if (arrInput[i].parentNode.className.indexOf('boxFocus') > -1) arrInput[i].parentNode.className = arrInput[i].parentNode.className.replace('boxFocus', 'boxBlur');
                    else arrInput[i].parentNode.className += arrInput[i].parentNode.className == '' ? 'boxBlur' : ' boxBlur'
                }
            }
        }
    }
};
lib_jobsearch.prototype.fnCheckItemMax = function(c, e) {
    e.preventDefault ? e.stopPropagation() : (e.cancelBubble = true);
    if (this.config.max && c.checked) {
        if (c.parentNode.className.indexOf('boxFocus') == -1) {
            if (c.parentNode.className.indexOf('boxBlur') > -1) c.parentNode.className = c.parentNode.className.replace('boxBlur', 'boxFocus');
            else c.parentNode.className += c.parentNode.className == '' ? 'boxFocus' : ' boxFocus'
        }
        var num = 0,
        i;
        var arrInput = this.dDiv.getElementsByTagName('input');
        for (i = 0; arrInput[i]; i++) if (arrInput[i].type.toLowerCase() == 'checkbox' && arrInput[i].name == c.name && arrInput[i].checked) {
            num++;
            if (num > this.config.max) {
                c.checked = false;
                if (c.parentNode.className.indexOf('boxBlur') == -1) {
                    if (c.parentNode.className.indexOf('boxFocus') > -1) c.parentNode.className = c.parentNode.className.replace('boxFocus', 'boxBlur');
                    else c.parentNode.className += c.parentNode.className == '' ? 'boxBlur' : ' boxBlur'
                }
                alert('您最多可以选择' + this.config.max + '个' + this.tit);
                return
            }
        }
    } else {
        if (c.parentNode.className.indexOf('boxBlur') == -1) {
            if (c.parentNode.className.indexOf('boxFocus') > -1) c.parentNode.className = c.parentNode.className.replace('boxFocus', 'boxBlur');
            else c.parentNode.className += c.parentNode.className == '' ? 'boxBlur' : ' boxBlur'
        }
        return
    }
};
lib_jobsearch.prototype.fnCheckItem = function(c, e) {
    e.preventDefault ? e.stopPropagation() : (e.cancelBubble = true);
    var arrInput = this.dDiv.getElementsByTagName('input'),
    i;
    var allC = arrInput[0];
    if (!c.checked) {
        if (allC.checked) allC.checked = false;
        if (c.parentNode.className.indexOf('boxBlur') == -1) {
            if (c.parentNode.className.indexOf('boxFocus') > -1) c.parentNode.className = c.parentNode.className.replace('boxFocus', 'boxBlur');
            else c.parentNode.className += c.parentNode.className == '' ? 'boxBlur' : ' boxBlur'
        }
    } else {
        var flag = true;
        if (c.parentNode.className.indexOf('boxFocus') == -1) {
            if (c.parentNode.className.indexOf('boxBlur') > -1) c.parentNode.className = c.parentNode.className.replace('boxBlur', 'boxFocus');
            else c.parentNode.className += c.parentNode.className == '' ? 'boxFocus' : ' boxFocus'
        }
        for (i = 1; arrInput[i]; i++) if (!arrInput[i].checked) {
            flag = false;
            break
        }
        allC.checked = flag
    }
};
lib_jobsearch.prototype.fnClickItem = function(id, e) {
    e.preventDefault ? e.stopPropagation() : (e.cancelBubble = true);
    this.h.value = this.$_d[id].val;
    this.fnTxt2Button(this.$_d[id].txt);
    if (this.nowID != '') {
        if (this.$_d[this.nowID]) {
            if (this.$_d[this.nowID].check) this.$_d[this.nowID].check = false;
            if (this.child != null) {
                if (!this.child.dataF) this.child.fnIni$_d();
                var i, data = this.$_d[this.nowID].child;
                for (i in data) if (data[i].check) data[i].check = false
            }
        } else if (this.nowID.toString().indexOf(vS) > -1) {
            var arr = this.nowID.toString().split(vS),
            i,
            j;
            for (i = 0; arr[i]; i++) {
                if (this.$_d[arr[i]].check) this.$_d[arr[i]].check = false;
                if (this.child != null) {
                    if (!this.child.dataF) this.child.fnIni$_d();
                    var data = this.$_d[arr[i]].child;
                    for (j in data) if (data[j].check) data[j].check = false
                }
            }
        }
    }
    this.nowID = id;
    this.cacheID = '';
    if (this.child != null) this.fnClearCVal();
    closeAllDiv()
};
lib_jobsearch.prototype.fnClickItem_city = function(id, e) {
    e.preventDefault ? e.stopPropagation() : (e.cancelBubble = true);
    this.h.value = this.$_d[id].val;
    this.fnTxt2Button(this.$_d[id].txt);
    if (this.nowID != '') {
        if (this.$_d[this.nowID]) {
            if (this.$_d[this.nowID].check) this.$_d[this.nowID].check = false;
            if (this.child != null) {
                if (!this.child.dataF) this.child.fnIni$_d();
                var i, data = this.$_d[this.nowID].child;
                for (i in data) if (data[i].check) data[i].check = false
            }
        } else if (this.nowID.toString().indexOf(vS) > -1) {
            var arr = this.nowID.toString().split(vS),
            i,
            j;
            for (i = 0; arr[i]; i++) {
                if (this.$_d[arr[i]].check) this.$_d[arr[i]].check = false;
                if (this.child != null) {
                    if (!this.child.dataF) this.child.fnIni$_d();
                    var data = this.$_d[arr[i]].child;
                    for (j in data) if (data[j].check) data[j].check = false
                }
            }
        }
    }
    this.nowID = id;
    this.cacheID = '';
    if (this.child != null) this.fnClearCVal();
    closeAllDiv();
    trySetDefaultText(this.h, '输入城市名称')
};
lib_jobsearch.prototype.fnClickOpenIcon = function(id, img, e) {
    e.preventDefault ? e.stopPropagation() : (e.cancelBubble = true);
    var flag = false;
    if (!this.child.divF) this.child.fnIniDiv();
    if (!this.child.dataF) this.child.fnIni$_d();
    if (this.cacheID != id) {
        flag = true;
        this.cacheID = id
    }
    if (flag || !window.currentlyVisiblePopup2) {
        this.child.dDiv.innerHTML = this.child.dDivHTML();
        setShim(this.child.div)
    }
    if (window.currentlyVisiblePopup2) {
        switchFocus(this.child.div.id);
        positionObject(this.child.div.id, getXY(this.div).x + getXY(img).x + 22, getXY(this.div).y + getXY(img).y + 18)
    } else {
        if (!this.div.mask) this.div.mask = new divMask(this.div);
        this.div.mask.showMask();
        positionObject(this.child.div.id, getXY(this.div).x + getXY(img).x + 22, getXY(this.div).y + getXY(img).y + 18);
        this.child.div.style.zIndex = this.div.style.zIndex * 1 + 2;
        changeObjectVisibility(this.child.div.id, 'visible');
        window.currentlyVisiblePopup2 = this.child.div.id
    }
};
lib_jobsearch.prototype.fnSaveCheckbox = function() {
    var arrInput = this.dDiv.getElementsByTagName('input'),
    i,
    strId = '',
    strTxt = '',
    id,
    pid = this.parent.nowID;
    if (arrInput[0].checked) {
        this.parent.$_d[pid].check = false;
        var data = this.parent.$_d[pid].child;
        for (i in data) data[i].check = false;
        this.h.value = '';
        this.fnTxt2Button('不限')
    } else {
        this.parent.$_d[pid].check = false;
        for (i = 1; arrInput[i]; i++) {
            if (arrInput[i].type.toLowerCase() == 'checkbox' && arrInput[i].name == this.C_ID + '_cBox') {
                id = arrInput[i].value;
                if (arrInput[i].checked) {
                    this.$_d[id].check = true;
                    strId += strId == '' ? this.$_d[id].val : vS + this.$_d[id].val;
                    strTxt += strTxt == '' ? this.$_d[id].txt : '+' + this.$_d[id].txt
                } else this.$_d[id].check = false
            }
        }
        this.h.value = strId;
        if (strTxt != '') this.fnTxt2Button(strTxt);
        else this.fnTxt2Button('不限')
    }
    closeAllDiv()
};
lib_jobsearch.prototype.fnSaveCheckbox2 = function() {
    var arrInput = this.dDiv.getElementsByTagName('input'),
    i,
    strId = '',
    strTxt = '',
    id;
    for (i = 0; arrInput[i]; i++) {
        if (arrInput[i].type.toLowerCase() == 'checkbox' && arrInput[i].name == this.C_ID + '_cBox') {
            id = arrInput[i].value;
            if (arrInput[i].checked) {
                this.$_d[id].check = true;
                strId += strId == '' ? this.$_d[id].val : vS + this.$_d[id].val;
                strTxt += strTxt == '' ? this.$_d[id].txt : '+' + this.$_d[id].txt
            } else this.$_d[id].check = false
        }
    }
    this.h.value = strId;
    if (strTxt != '') this.fnTxt2Button(strTxt);
    else this.fnTxt2Button('不限');
    closeAllDiv()
};
lib_jobsearch.prototype.fnSaveCheckbox3 = function() {
    this.fnSaveParent();
    this.fnSaveCheckbox()
};
lib_jobsearch.prototype.setNow = function() {
    if (this.nowSpan) this.nowSpan.innerHTML = this.nowHTML()
};
lib_jobsearch.prototype.fnClearVal3 = function() {
    this.fnSaveParent();
    this.fnClearVal()
};
lib_jobsearch.prototype.fnSaveParent = function() {
    if (this.parent && this.parent.cacheID != '') {
        if (this.parent.cacheID != this.parent.nowID) {
            if (this.parent.$_d[this.parent.nowID]) {
                if (this.parent.$_d[this.parent.nowID].check) this.parent.$_d[this.parent.nowID].check = false;
                var data = this.parent.$_d[this.parent.nowID].child;
                for (i in data) if (data[i].check) data[i].check = false
            }
            this.parent.nowID = this.parent.cacheID;
            this.parent.h.value = this.parent.$_d[this.parent.cacheID].val;
            this.parent.fnTxt2Button(this.parent.$_d[this.parent.cacheID].txt)
        }
        this.parent.cacheID = ''
    }
    if (this.h.value != '' || (this.parent && this.parent.h.value != '')) this.b.disabled = false;
    else this.b.disabled = true
};
lib_jobsearch.prototype.fnClearVal = function() {
    var i, data;
    if (!this.vT && this.nowID != '' && this.$_d[this.nowID]) {
        var obj = this.$_d[this.nowID];
        if (obj.check) obj.check = false;
        if (this.child != null) {
            if (!this.child.dataF) this.child.fnIni$_d();
            data = obj.child;
            for (i in data) if (data[i].check) data[i].check = false
        }
    }
    if (this.vT) {
        data = this.$_d;
        for (i in data) if (data[i].check) data[i].check = false
    }
    this.nowID = '';
    this.cacheID = '';
    this.h.value = '';
    this.fnTxt2Button('不限');
    if (this.child != null) this.fnClearCVal();
    closeAllDiv()
};
lib_jobsearch.prototype.fnClearCVal = function() {
    if (this.child != null) {
        var c = this.child;
        if (!c.dataF) c.fnIni$_d();
        c.h.value = '';
        c.nowID = '';
        c.cacheID = '';
        c.fnTxt2Button('不限');
        if (this.$_d[this.nowID] && this.$_d[this.nowID].childF) c.b.disabled = false;
        else c.b.disabled = true
    }
};
lib_jobsearch.prototype.fnCloseDiv = function() {
    closeAllDiv();
    this.cacheID = ''
};
lib_jobsearch.prototype.fnCloseDiv3 = function() {
    if (this.parent && this.parent.cacheID != '') {
        changeObjectVisibility(this.div.id, 'hidden');
        this.parent.div.mask.hideMask();
        if (!document.body.mask) document.body.mask = new divMask(document.body);
        document.body.mask.showMask2();
        window.currentlyVisiblePopup = this.parent.div.id;
        window.currentlyVisiblePopup2 = null;
        this.parent.cacheID = ''
    } else closeAllDiv()
};
lib_jobsearch.prototype.fnTxt2Button = function(txt) {
    if (this.tit == cS) return;
    var txtL = this.config.buttonTxtLength;
    var tempTxt = (GetRealLength(txt) < txtL) ? txt : (subStringPro(txt, txtL - 2) + '...');
    this.b.value = tempTxt;
    this.b.title = txt
};
lib_jobsearch.prototype.trHTML = function(arrData, fn) {
    var i, colIndex, str = '',
    data = arrData,
    col = this.config.col,
    tdWidth = parseInt(100 / col) + '%';
    var fName = fn ? fn : 'fnClickItem';
    for (i = 0; data[i]; i++) {
        colIndex = i % col;
        if (colIndex == 0) str += '<tr>';
        if (!this.$_d[data[i][0]].childF) fName = 'fnClickItem_city';
        str += '<td width="' + tdWidth + '"><span id="' + this.C_ID + '_aItem_' + data[i][0] + '" onclick="' + this.C_ID + '.' + fName + '(\'' + data[i][0] + '\',event)" class="' + ((vS + this.nowID + vS).indexOf(vS + data[i][0] + vS) > -1 ? 'focus' : '') + ' substitute4a itemSpan" onmouseover="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',true)" onmouseout="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',false)"><div class="cityItemPadding">' + data[i][2] + '</div></span></td>';
        if (colIndex == col - 1) str += '</tr>'
    }
    return str
};
lib_jobsearch.prototype.chiHTML = function() {
    return '<div class="chinaTitle">' + this.$_d[489] + '</div>'
};
lib_jobsearch.prototype.hotHTML = function() {
    var str = '',
    data = arrHotcity;
    str += '<div class="hotcitysTitle"><span class="substitute4a" onclick="' + this.C_ID + '.fnCloseOpen(\'' + this.C_ID + '_hCon\')"><img src=' + pImg + ' class="' + (this.hFlag == 'close' ? 'iconclose' : 'iconopen') + '" id="' + this.C_ID + '_hConIcon"></span>&nbsp;&nbsp;主要城市</div>';
    str += '<div id="' + this.C_ID + '_hCon" class="hotcitysCon" style="display:' + (this.hFlag == 'close' ? 'none' : '') + ';">';
    str += '<table cellpadding="0" cellspacing="0" border="0" class="hotcitysItemTab">';
    str += this.trHTML(data, 'fnClickItem_city');
    str += '</table></div>';
    return str
};
lib_jobsearch.prototype.proHTML = function() {
    var str = '',
    i, itemIndex = -1,
    colIndex, col = this.config.col,
    tdWidth = parseInt(100 / col);
    var data = this.pID == '' ? arrProvince : this.$_d[this.pID].child;
    str += '<div class="provincesTitle"><table cellspacing="0" cellpadding="0" border="0"><tr><td><span onclick="' + this.C_ID + '.fnCloseOpen(\'' + this.C_ID + '_pCon\')" class="substitute4a"><img src=' + pImg + ' class="' + (this.pFlag == 'close' ? 'iconclose' : 'iconopen') + '" id="' + this.C_ID + '_pConIcon"></span>&nbsp;&nbsp;</td><td>' + (this.pID == '' ? '其他省市' : '<span class="currentProvince substitute4a itemSpan' + ((vS + this.nowID + vS).indexOf(vS + this.pID + vS) > -1 ? ' focus' : '') + '" onclick="' + this.C_ID + '.fnClickItem(\'' + this.pID + '\',event)" onmouseover="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',true)" onmouseout="lib_jobsearch.fnChangeBg(this,\'dataItemCSS4mouseover\',false)">' + this.$_d[this.pID].txt + '</span></td><td>&nbsp;&nbsp;&nbsp;&nbsp;[ <span class="backtoProvinces substitute4a" onclick="' + this.C_ID + '.fn2Provinces()">返回其他省市</span> ]') + '</td></tr></table></div>';
    str += '<div id="' + this.C_ID + '_pCon" class="provincesCon" style="display:' + (this.pFlag == 'close' ? 'none' : '') + ';">';
    str += '<table cellpadding="0" cellspacing="0" border="0" class="provincesItemTab">';
    if (this.pID == '') str += this.trHTML(data, 'fnClickProvince');
    else {
        for (i in data) {
            itemIndex++;
            colIndex = itemIndex % col;
            if (colIndex == 0) str += '<tr>';
            if (data[i].txt.length < this.config.tdTxtLength) str += '<td width="' + tdWidth + '%">' + data[i] + '</td>';
            else {
                if (colIndex < col - 1) {
                    str += '<td width="' + tdWidth * 2 + '%" colspan="2">' + data[i] + '</td>';
                    colIndex++;
                    itemIndex++
                } else if (colIndex == col - 1) {
                    str += '<td width="' + tdWidth + '%"></td></tr>';
                    str += '<tr><td width="' + tdWidth * 2 + '%" colspan="2">' + data[i] + '</td>';
                    colIndex = 0;
                    itemIndex = itemIndex + 2
                }
            }
            if (colIndex == col - 1) str += '</tr>'
        }
    }
    str += '</table></div>';
    return str
};
lib_jobsearch.prototype.oveHTML = function() {
    var str = '',
    data = arrOversea;
    str += '<div class="overseasTitle"><table cellspacing="0" cellpadding="0" border="0"><tr><td><span class="substitute4a" onclick="' + this.C_ID + '.fnCloseOpen(\'' + this.C_ID + '_oCon\')"><img src=' + pImg + ' class="' + (this.oFlag == 'close' ? 'iconclose' : 'iconopen') + '" id="' + this.C_ID + '_oConIcon"></span>&nbsp;&nbsp;</td><td class="conGuowai">' + this.$_d[480] + '</td></tr></table></div>';
    str += '<div id="' + this.C_ID + '_oCon" class="overseasCon" style="display:' + (this.oFlag == 'close' ? 'none' : '') + ';">';
    str += '<table cellpadding="0" cellspacing="0" border="0" class="overseasItemTab">';
    str += this.trHTML(data, 'fnClickItem_city');
    str += '</table></div>';
    return str
};
lib_jobsearch.prototype.dDivHTML = function() {
    var str = '',
    i, dataIndex = -1,
    colIndex, col = this.config.col,
    tdWidth = parseInt(100 / col) + '%';
    switch (this.tit) {
        case sjS:
            if (this.parent.cacheID != '' || this.parent.nowID != '') {
                var pId = this.parent.cacheID != '' ? this.parent.cacheID : this.parent.nowID;
                var data = this.parent.$_d[pId].child;
                str += '<table cellpadding="0" cellspacing="0" border="0" class="searchItemDataTab">';
                str += '<tr><td colspan="' + col + '"><div style="float:left;"><input type="checkbox" name="' + this.C_ID + '_cBox_all" value="' + pId + '" onclick="' + this.C_ID + '.fnCheckAll(this)"' + (this.parent.$_d[pId].check ? ' checked="checked"' : '') + ' style="display:none;">&nbsp;&nbsp;<span class="parentTxt">所属' + this.parent.tit + '：<b>' + this.parent.$_d[pId].txt + '</b></span>&nbsp;&nbsp;[ <span onclick="' + this.C_ID + '.fnChangeParent()" class="substitute4a" title="更换一个' + this.parent.tit + '">修改</span> ]</div><!--<div style="float:right;"><span class="substitute4a" onclick="' + this.C_ID + '.fnCheckAllLink(1)" title="选中所有' + this.tit + '"><img src="' + pImg + '" class="selAll"></span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="substitute4a" onclick="' + this.C_ID + '.fnCheckAllLink(0)" title="清空所有' + this.tit + '"><img src="' + pImg + '" class="unselAll"></span></div>--></td></tr>';
                str += '<tr><td colspan="' + col + '" height="12"><div style="border-top:#999999 1px dotted;"><img src="' + pImg + '" height="0" width="0"></div></td></tr>';
                for (i in data) {
                    dataIndex++;
                    colIndex = dataIndex % col;
                    if (colIndex == 0) str += '<tr>';
                    str += '<td>' + data[i].toString_c() + '</td>';
                    if (colIndex == col - 1) str += '</tr>'
                }
                str += '</table>'
            };
            break;
        case jS:
            str += '<table cellpadding="0" cellspacing="0" border="0" class="searchItemDataTab">';
            for (i in this.$_d) {
                dataIndex++;
                colIndex = dataIndex % col;
                if (colIndex == 0) str += '<tr>';
                str += '<td width="' + tdWidth + '"><table cellspacing="0" cellpadding="0" border="0"><tr><td width="1"><span class="substitute4a" onclick="' + this.C_ID + '.fnClickOpenIcon(\'' + this.$_d[i].id + '\',this,event)" title="点击可选择“' + this.$_d[i].txt + '”类别下的具体' + this.child.tit + '"><img src="' + pImg + '" class="icon2subjobtype" align="absmiddle"></span></td><td width="100%">' + this.$_d[i] + '</td></tr></table></td>';
                if (colIndex == col - 1) str += '</tr>'
            }
            str += '</table>';
            break;
        case iS:
            str += '<table cellpadding="0" cellspacing="0" border="0" class="searchItemDataTab">';
            for (i in this.$_d) {
                dataIndex++;
                colIndex = dataIndex % col;
                if (colIndex == 0) str += '<tr>';
                str += '<td width="' + tdWidth + '">' + this.$_d[i].toString_c() + '</td>';
                if (colIndex == col - 1) str += '</tr>'
            }
            str += '</table>';
            break;
        case dS:
            str += '<table cellpadding="0" cellspacing="0" border="0" class="searchItemDataTab">';
            for (i in this.$_d) {
                dataIndex++;
                colIndex = dataIndex % col;
                if (colIndex == 0) str += '<tr>';
                str += '<td width="' + tdWidth + '">' + this.$_d[i] + '</td>';
                if (colIndex == col - 1) str += '</tr>'
            }
            str += '</table>';
            break
    }
    return str
};
lib_jobsearch.prototype.divHTML = function() {
    var str = '';
    str += '<table cellpadding="0" cellspacing="0" border="0" class="searchItemTab">';
    str += '<tr><td class="topleft"><img src=' + pImg + ' width="8" height="8"></td><td class="topcenter"><img src=' + pImg + ' width="' + parseInt(this.config.width - 16) + '" height="7"></td><td class="topright"><img src=' + pImg + ' width="8" height="8"></td></tr>';
    str += '<tr><td colspan="3" class="title" id="' + this.C_ID + '_mMove"><div class="left">' + this.tit + '：</div><div class="right">' + this.genLinkHTML() + '</div></td></tr>';
    str += '<tr><td colspan="3" class="content">';
    str += '<div>' + this.iDivHTML() + '</div>';
    str += '<div id="' + this.C_ID + '_dDiv"></div>';
    if (this.tit == cS) {
        str += '<div id="' + this.C_ID + '_dDiv_h"></div>';
        str += '<div id="' + this.C_ID + '_dDiv_p"></div>';
        str += '<div id="' + this.C_ID + '_dDiv_c"></div>';
        str += '<div id="' + this.C_ID + '_dDiv_o"></div>'
    }
    str += '</td></tr>';
    str += '<tr><td class="bottomleft"><img src=' + pImg + ' width="8" height="8"></td><td class="bottomcenter"><img src=' + pImg + ' width="' + parseInt(this.config.width - 16) + '" height="4"></td><td class="bottomright"><img src=' + pImg + ' width="8" height="8"></td></tr>';
    str += '</table>';
    return str
};
lib_jobsearch.prototype.iDivHTML = function() {
    var str = '';
    switch (this.tit) {
        case jS:
            str = '<div class="jobtypeInfo"><table cellspacing="0" cellpadding="2" border="0" class="jobtypeTip"><tr><td>&bull;&nbsp;直接点击' + this.tit + '名称，即可选定一个类别进行搜索</td></tr><tr><td>&bull;&nbsp;点击<img src="' + pImg + '" class="icon2subjobtype">选择该' + this.tit + '下的一个或多个' + this.child.tit + '，可更准确地锁定目标职位</td></tr></table></div>';
            break;
        case iS:
            str = '<div class="industryInfo">您最多可以选择 <span class="focus">10</span> 个' + this.tit + '</div>';
            break
    }
    return str
};
lib_jobsearch.prototype.nowHTML = function() {
    var str = '',
    strT = '',
    showTxt, str1 = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="selectedTxt">(当前选择的' + this.tit + '--<span class="itemName">',
    str2 = '</span>)</span>';
    if (this.nowID != '') {
        var arr = this.nowID.toString().split(vS),
        i;
        for (i = 0; arr[i]; i++) if (this.$_d[arr[i]]) strT += strT == '' ? this.$_d[arr[i]].txt : '+' + this.$_d[arr[i]].txt;
        str = str1 + strT + str2
    } else {
        switch (this.tit) {
            case jS:
            case cS:
                str = str1 + '不限' + str2;
                break;
            case dS:
                str = str1 + '所有日期' + str2;
                break
        }
    }
    return str
};
lib_jobsearch.prototype.linksHTML = function(t) {
    var fn, txt, tit;
    switch (t) {
        case 'nospecified':
            fn = 'fnClearVal';
            txt = '不限';
            tit = '选择“不限”将包含所有' + this.tit;
            break;
        case 'close':
            fn = 'fnCloseDiv';
            txt = '关闭';
            tit = '';
            break;
        case 'save':
            fn = 'fnSaveCheckbox';
            txt = '确认';
            tit = '';
            break;
        case 'save2':
            fn = 'fnSaveCheckbox2';
            txt = '确认';
            tit = '';
            break;
        case 'cancel':
            fn = 'fnCloseDiv';
            txt = '取消';
            tit = '';
            break;
        case 'save3':
            fn = 'fnSaveCheckbox3';
            txt = '确认';
            tit = '';
            break;
        case 'cancel3':
            fn = 'fnCloseDiv3';
            txt = '取消';
            tit = '';
            break;
        case 'nospecified3':
            fn = 'fnClearVal3';
            txt = '不限';
            tit = '选择“不限”将包含所有' + this.tit + '，等同于“全选”';
            break
    }
    return '<span onclick="' + this.C_ID + '.' + fn + '()" class="substitute4a" title="' + tit + '">' + txt + '</span>'
};
lib_jobsearch.prototype.genLinkHTML = function() {
    var str = '';
    switch (this.tit) {
        case jS:
            str = '[ ' + this.linksHTML('nospecified') + ' ]&nbsp;&nbsp;[ ' + this.linksHTML('close') + ' ]';
            break;
        case iS:
            str = '[ ' + this.linksHTML('nospecified') + ' ]&nbsp;&nbsp;[ ' + this.linksHTML('save2') + ' ]&nbsp;&nbsp;[ ' + this.linksHTML('cancel') + ' ]';
            break;
        case sjS:
            str = '[ ' + this.linksHTML('nospecified3') + ' ]&nbsp;&nbsp;[ ' + this.linksHTML('save3') + ' ]&nbsp;&nbsp;[ ' + this.linksHTML('cancel3') + ' ]';
            break;
        case cS:
        case dS:
            str = '[ ' + this.linksHTML('close') + ' ]';
            break
    }
    return str
};
function f2t(s, d, f, t) {
    var s2 = '',
    i, txt = '';
    var s1 = s;
    var spe1 = arguments[4] ? arguments[4] : vS;
    var spe2 = arguments[5] ? arguments[5] : '+';
    if (s1 != '') {
        s1 = s1.charAt(0) != spe1 ? spe1 + s1 : s1;
        s1 = s1.charAt(s1.length - 1) != spe1 ? s1 + spe1 : s1
    }
    for (i = 0; d[i]; i++) {
        s2 = spe1 + d[i][f] + spe1;
        if (s1 != '') {
            if (s1.indexOf(s2) > -1) {
                txt += txt == '' ? d[i][t] : spe2 + d[i][t];
                s1.replace(s2, '')
            }
        } else break
    }
    return txt
};
function setShim(div) {
    if (div.shim) div.shim.setStyle('visibility', 'visible')
};
function closeAllDiv() {
    hideCurrentPopup();
    if (window.currentlyVisiblePopup2) {
        changeObjectVisibility(window.currentlyVisiblePopup2, 'hidden');
        window.currentlyVisiblePopup2 = false
    }
};
function switchFocus(divId) {
    if (window.currentlyVisiblePopup && window.currentlyVisiblePopup2) {
        var toFocusId = divId;
        var toBlurId = toFocusId == window.currentlyVisiblePopup ? window.currentlyVisiblePopup2 : window.currentlyVisiblePopup;
        var toFocusDiv = document.getElementById(toFocusId);
        var toBlurDiv = document.getElementById(toBlurId);
        if (toFocusDiv && toBlurDiv) {
            toFocusDiv.style.zIndex = toBlurDiv.style.zIndex * 1 + 2;
            if (toFocusDiv.mask) toFocusDiv.mask.hideMask();
            if (!toBlurDiv.mask) toBlurDiv.mask = new divMask(toBlurDiv);
            toBlurDiv.mask.showMask()
        }
    }
};
function myAttachEvent(d, e, f) {
    try {
        if (d.attachEvent) d.attachEvent("on" + e, f);
        else if (d.addEventListener) d.addEventListener(e, f, false);
        else {
            var oldF = eval('d.on' + e);
            if (typeof oldF != 'function') eval('d.on' + e + '=f');
            else eval('d.on' + e) = function() {
                oldF();
                f()
            }
        }
    } catch (error) { }
};
function GetRealLength(strTemp) {
    var i, sum = 0;
    for (i = 0; i < strTemp.length; i++) {
        if ((strTemp.charCodeAt(i) >= 0) && (strTemp.charCodeAt(i) <= 255)) sum = sum + 1;
        else sum = sum + 2
    }
    return sum
};
function subStringPro(str, length) {
    var stri = '';
    for (i = 0, j = 0; j < length; ) {
        if ((str.charCodeAt(i) >= 0) && (str.charCodeAt(i) <= 255)) {
            stri += str.charAt(i);
            j++
        } else {
            stri += str.charAt(i);
            j += 2
        }
        i++
    }
    return stri
};
function divMask(theObj) {
    this.obj = theObj;
    this.obj.selectObj = this.obj.getElementsByTagName('select');
    var newDiv = document.createElement("div");
    newDiv.className = "divMask";
    newDiv.style.zIndex = getCurrentStyle(this.obj, 'zIndex') * 1 + 1;
    var offsetLeft = getLocalOffsetLeft(this.obj);
    newDiv.style.left = offsetLeft;
    var offsetTop = getLocalOffsetTop(this.obj);
    newDiv.style.top = offsetTop;
    newDiv.style.width = this.obj.scrollWidth ? this.obj.scrollWidth : this.obj.offsetWidth ? this.obj.offsetWidth : this.obj.clientWidth;
    newDiv.style.height = this.obj.scrollHeight ? this.obj.scrollHeight : this.obj.offsetHeight ? this.obj.offsetHeight : this.obj.clientHeight;
    if (typeof (newDiv.style.filter) != 'undefined') newDiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
    else newDiv.style.MozOpacity = 0.7;
    newDiv.style.position = "absolute";
    newDiv.style.visibility = 'hidden';
    if (theObj.tagName.toLowerCase() != 'body') {
        var id = this.obj.id;
        newDiv.onclick = function() {
            switchFocus(id)
        }
    }
    this.div = newDiv;
    this.maskFlag = false;
    if (this.obj.parentNode.tagName.toLowerCase() != 'html') this.obj.parentNode.insertBefore(this.div, this.obj);
    else if (arguments[1] && arguments[1].nodeType == 1 && arguments[1].tagName.toLowerCase() != 'body') arguments[1].appendChild(this.div);
    else document.body.appendChild(this.div);
    if (this.obj.currentStyle) {
        this.setOpacity = this.setOpacityIE;
        this.getOpacity = this.getOpacityIE
    } else {
        this.setOpacity = this.setOpacityNonIE;
        this.getOpacity = this.getOpacityNonIE
    }
};
divMask.prototype = {
    setStyle: function(prop, val) {
        this.obj.style[prop] = val;
        if (prop != 'position') {
            this.div.style[prop] = val
        }
        this.div.style.width = (this.obj.scrollWidth ? this.obj.scrollWidth : this.obj.offsetWidth ? this.obj.offsetWidth : this.obj.clientWidth) + "px";
        this.div.style.height = (this.obj.scrollHeight ? this.obj.scrollHeight : this.obj.offsetHeight ? this.obj.offsetHeight : this.obj.clientHeight) + "px";
        this.div.style.left = getLocalOffsetLeft(this.obj) + "px";
        this.div.style.top = getLocalOffsetTop(this.obj) + "px"
    },
    getStyle: function(prop) {
        return this.div.style[prop]
    },
    setOpacityNonIE: function(val) {
        if (val < 0) val = 0;
        if (val > 1) val = 1;
        this.obj.style.opacity = val
    },
    setOpacityIE: function(val) {
        if (val < 0) val = 0;
        if (val > 1) val = 1;
        this.obj.filters.alpha.opacity = (val * 100)
    },
    getOpacityNonIE: function() {
        return getCurrentStyle(this.obj, 'opacity')
    },
    getOpacityIE: function() {
        return this.obj.filters.alpha.opacity / 100.0
    },
    showMask2: function() {
        this.div.style.width = (this.obj.scrollWidth ? this.obj.scrollWidth : this.obj.offsetWidth ? this.obj.offsetWidth : this.obj.clientWidth) + "px";
        this.div.style.height = (this.obj.scrollHeight ? this.obj.scrollHeight : this.obj.offsetHeight ? this.obj.offsetHeight : this.obj.clientHeight) + "px";
        this.div.style.left = getLocalOffsetLeft(this.obj) + "px";
        this.div.style.top = getLocalOffsetTop(this.obj) + "px";
        this.div.style.zIndex = getCurrentStyle(this.obj, 'zIndex') * 1 + 1;
        this.div.style.visibility = 'visible';
        if (this.div.currentStyle) for (var i = 0; this.obj.selectObj[i]; i++) this.obj.selectObj[i].disabled = true;
        this.maskFlag = true
    },
    hideMask: function() {
        this.div.style.visibility = 'hidden';
        if (this.div.currentStyle) for (var i = 0; this.obj.selectObj[i]; i++) this.obj.selectObj[i].disabled = false;
        this.maskFlag = false
    },
    showMask: function() {
        if (this.obj.tagName.toLowerCase() == 'body') {
            if (!this.maskFlag2 || this.maskFlag) {
                if (!this.maskFlag2) this.maskFlag2 = true;
                if (isDocumentLoaded()) {
                    this.showMask2();
                    if (this.timeoutID) this.timeoutID = null;
                    this.maskFlag2 = false
                } else {
                    this.showMask2();
                    var T = this;
                    this.timeoutID = setTimeout('document.body.mask.showMask()', 100)
                }
            } else {
                if (this.timeoutID) this.timeoutID = null;
                this.maskFlag2 = false
            }
        } else this.showMask2()
    }
};
function isDocumentLoaded() {
    return (null != document.readyState && "complete" != document.readyState) ? false : true
};
if (!document.readyState) myAttachEvent(window, 'load',
function() {
    if (document.body.mask && document.body.mask.maskFlag) document.body.mask.showMask()
});
function dashify(str) {
    return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
};
function getCurrentStyle(element, styleProp) {
    var retVal;
    if (element.currentStyle) {
        retVal = element.currentStyle[styleProp]
    } else if (document.defaultView && document.defaultView.getComputedStyle) {
        retVal = document.defaultView.getComputedStyle(element, null).getPropertyValue(dashify(styleProp))
    } else {
        retVal = null
    }
    return retVal
};
function getLocalOffset(offset, direction) {
    var y = offset['offset' + direction];
    var div;
    try {
        div = offset.offsetParent
    } catch (ex) {
        return y
    }
    while (div && getCurrentStyle(div, 'position') == 'static') {
        y += div['offset' + direction];
        try {
            div = div.offsetParent
        } catch (ex) {
            return y
        }
    }
    return y
};
function getLocalOffsetTop(offset) {
    return getLocalOffset(offset, 'Top')
};
function getLocalOffsetLeft(offset) {
    return getLocalOffset(offset, 'Left')
};
function getXY(object) {
    var pt = new Point(0, 0);
    pt.x = getLocalOffsetLeft(object);
    pt.y = getLocalOffsetTop(object);
    return pt
};
function Point(iX, iY) {
    this.x = iX;
    this.y = iY
};
var zp_moveObj = new Object();
zp_moveObj.dragover = null;
zp_moveObj.dragobj = null;
document.onmousemove = mmove;
document.onmousedown = mdown;
document.onmouseup = mup;
function w_mmover(id) {
    zp_moveObj.dragover = id
};
function w_mmout() {
    zp_moveObj.dragover = null
};
function mup(e) {
    zp_moveObj.dragobj = null
};
function mdown(e) {
    if (zp_moveObj.dragover != null) {
        zp_moveObj.dragobj = document.getElementById(zp_moveObj.dragover);
        var x = (!document.all) ? e.pageX : event.x || event.clientX;
        var y = (!document.all) ? e.pageY : event.y || event.clientY;
        if (document.all) y += document.body.scrollTop;
        var id = zp_moveObj.dragover;
        if (zp_moveObj.dragobj != null) {
            zp_moveObj.clickedX = x - parseInt(document.getElementById(id).style.left + 0);
            zp_moveObj.clickedY = y - parseInt(document.getElementById(id).style.top + 0)
        }
    }
};
function mmove(e, y) {
    var x = (!document.all) ? e.pageX : event.x || event.clientX;
    var y = (!document.all) ? e.pageY : event.y || event.clientY;
    if (document.all) y += document.body && document.body.scrollTop ? document.body.scrollTop : 0;
    if (zp_moveObj.dragobj != null) {
        nx = x - zp_moveObj.clickedX;
        ny = y - zp_moveObj.clickedY;
        var OK = moveOK(zp_moveObj.dragobj, nx, ny);
        if (!OK.x) nx = getLocalOffsetLeft(zp_moveObj.dragobj);
        if (!OK.y) ny = getLocalOffsetTop(zp_moveObj.dragobj);
        zp_moveObj.dragobj.style.left = nx + "px";
        zp_moveObj.dragobj.style.top = ny + "px";
        if (zp_moveObj.dragobj.shim && zp_moveObj.dragobj.shim.iframe) {
            zp_moveObj.dragobj.shim.iframe.style.left = nx + "px";
            zp_moveObj.dragobj.shim.iframe.style.top = ny + "px"
        }
    }
};
function moveOK(d, x, y) {
    var objOK = {
        x: true,
        y: true
    };
    var w = d.offsetWidth;
    var h = d.offsetHeight;
    var dWH = getDocumentWH();
    var t = 10;
    var r = dWH.w - w - 10;
    var b = dWH.h - h - 10;
    var l = 10;
    if (x < l || (r > 0 && r > l && x > r)) objOK.x = false;
    if (y < t || (b > 0 && b > t && y > b)) objOK.y = false;
    return objOK
};
function resizeWin() {
    if (document.body.mask && document.body.mask.maskFlag) {
        var documentWH = getDocumentWH();
        document.body.mask.div.style.width = documentWH.w;
        document.body.mask.div.style.height = documentWH.h
    }
};
myAttachEvent(window, 'resize', resizeWin);
function getDocumentWH() {
    var d = {
        w: 0,
        h: 0
    };
    if (window.innerHeight && window.scrollMaxY) d.h = window.innerHeight + window.scrollMaxY;
    else if (document.body.scrollHeight > document.body.offsetHeight) d.h = document.body.scrollHeight;
    else d.h = document.body.offsetHeight + document.body.offsetTop;
    if (window.innerWidth && window.scrollMaxX) d.w = window.innerWidth + window.scrollMaxX;
    else if (document.body.scrollWidth > document.body.offsetWidth) d.w = document.body.scrollWidth;
    else d.w = document.body.offsetWidth + document.body.offsetLeft;
    return d
};
lib_jobsearch.fnChangeBg = function(o, c, t) {
    if (o && o.nodeType == 1) {
        if (t) {
            if (o.className.indexOf(c) == -1) o.className += o.className == '' ? c : ' ' + c
        } else {
            if (o.className.indexOf(c) > -1) o.className = o.className.replace(' ' + c, '').replace(c, '')
        }
    }
}
