// JavaScript Document

//层切换
function $(element) {
    return document.getElementById(element);
}
function caseSroll(str){
    var bt=$(str+"_b").getElementsByTagName("h2");
    for(var i=0;i<bt.length;i++){
        bt[i].subj=str;
        bt[i].pai=i;
        bt[i].style.cursor="pointer";
        bt[i].onmouseover=function(){
            /*$(this.subj+"_v").className="ieie";*/
            $(this.subj+"_v").innerHTML=$(this.subj+"_h").getElementsByTagName("blockquote")[this.pai].innerHTML;
            for(var j=0;j<$(this.subj+"_b").getElementsByTagName("h2").length;j++){
                var _bt=$(this.subj+"_b").getElementsByTagName("h2")[j];
                var ison=j==this.pai;
                _bt.className=(ison?"":"h2bg");
            }
        }
    }
    $(str+"_h").className="none";
    $(str+"_v").innerHTML=$(str+"_h").getElementsByTagName("blockquote")[0].innerHTML;
}

// 滚动




function s(){
    if (!canroll) return;
    if (dir) {
if((awidth+mData)>=0)
{
mData=mData-step;
}
else
{
mData=-step;
}
} else {
    if(mData>=0)
    {
    mData=-awidth;
    }
    else
    {
    mData+=step;
    }
}

obox.style.marginLeft=mData+"px";

if (isStop) return;

setTimeout(s,speed)
}


function moveLeft() {
        var wasStop = isStop;
        dir = 1;
        speed = 50;
        isStop=0;
        if (wasStop) {
            setTimeout(s,speed);
        }
}

function moveRight() {
        var wasStop = isStop;
        dir = 0;
        speed = 50;
        isStop=0;
        if (wasStop) {
            setTimeout(s,speed);
        }
}

function scrollStop() {
    isStop=1;
}

function clickLeft() {
        var wasStop = isStop;
        dir = 1;
        speed = 25;
        isStop=0;
        if (wasStop) {
            setTimeout(s,speed);
        }
}

function clickRight() {
        var wasStop = isStop;
        dir = 0;
        speed = 25;
        isStop=0;
        if (wasStop) {
            setTimeout(s,speed);
        }
}