﻿function dolayerChange_1(id) {
    //招聘会和最新资讯滑动块
    var obj;
    for (var i = 1; i < 3; i++) {
        if (id == i) {
            document.getElementById("bott_" + i).style.display = "block";
            document.getElementById("td_" + i).className = "overImage_1";

        } else {
            document.getElementById("bott_" + i).style.display = "none";
            document.getElementById("td_" + i).className = "outImage_1";
        }
    }
}
function dolayertChange_1(id) {
    //紧急招聘和热门招聘滑动块
    var obj;
    for (var i = 1; i < 3; i++) {
        if (id == i) {
            document.getElementById("bottt_" + i).style.display = "block";
            document.getElementById("tdt_" + i).className = "overImage_1";

        } else {
            document.getElementById("bottt_" + i).style.display = "none";
            document.getElementById("tdt_" + i).className = "outImage_1";
        }
    }
}

function wkdolayerChange_1(id) {
    //招聘会和最新资讯滑动块
    var obj;
    for (var i = 1; i < 10; i++) {
        if (id == i) {
            document.getElementById("wkbott_" + i).style.display = "block";
            document.getElementById("wktd_" + i).className = "wkoverImage_1";

        } else {
            document.getElementById("wkbott_" + i).style.display = "none";
            document.getElementById("wktd_" + i).className = "wkoutImage_1";
        }
    }
}

function Scroll(ClassName, divObj, marqueesHeight, timeToScroll, pixelToScroll) {
    this.mOjb = divObj; 
    this.mBlStopScroll = false;
    this.mPreTop = 0;
    this.mTimeToScroll = timeToScroll;      
    //设定多少时间滚动一次
    this.mMarqueesHeight = marqueesHeight; 
    //内容区高度
    this.mTemplayer = null;    
    this.mClassName = ClassName;
    this.mPixelToScroll = pixelToScroll;  
    //每次滚动条向下移动几个像素//55555
    this.SetStop = function(isScrolled)
    {
        this.mBlStopScroll = isScrolled;
    }
    this.start = function()  
    {
        with (this.mOjb) {
            noWrap = true; 
            style.width = 0; 
            style.height = this.mMarqueesHeight;
            style.overflowY = "hidden"; 
            onmouseover = new Function(this.mClassName + ".SetStop(true)"); 
            onmouseout = new Function(this.mClassName + ".SetStop(false)"); }
        var tmp_id = "templayer" + this.mClassName;
        document.write('<div id="' + tmp_id + '" style="position:absolute;z-index:1;visibility:hidden"></div>');
        this.mTemplayer = document.getElementById(tmp_id); 
        this.init();
    }
    this.init = function()
    {
        var tmp_height = this.mTemplayer.offsetHeight;
        while (this.mTemplayer.offsetHeight < this.mMarqueesHeight) {
            this.mTemplayer.innerHTML += this.mOjb.innerHTML;
            if (this.mTemplayer.offsetHeight == tmp_height)   
                break;
        } this.mOjb.innerHTML = this.mTemplayer.innerHTML + this.mTemplayer.innerHTML; }

    this.scrollUp = function(pixelToScroll)
    {
        if (this.mBlStopScroll == true) return;
        this.mPreTop = this.mOjb.scrollTop; 
        this.mOjb.scrollTop += pixelToScroll;     
        if (this.mPreTop == this.mOjb.scrollTop) { this.mOjb.scrollTop = this.mTemplayer.offsetHeight - this.mMarqueesHeight + 1; }
    }
    this.start();
    setInterval(this.mClassName + ".scrollUp(" + this.mPixelToScroll + ")", this.mTimeToScroll);
}


