﻿
var whichOpen = '';
var whichContinue = '';

document.getElementsByClassName = function(eleClassName) {
    var getEleClass = []; //定义一个数组
    var myclass = new RegExp("\\b" + eleClassName + "\\b"); //创建一个正则表达式对像
    var elem = this.getElementsByTagName("*"); //获取文档里所有的元素
    for (var h = 0; h < elem.length; h++) {
        var classes = elem[h].className; //获取class对像
        if (myclass.test(classes)) getEleClass.push(elem[h]); //正则比较，取到想要的CLASS对像
    }
    return getEleClass; //返回数组
}


function index_move(name) {
     var layer = document.getElementById(name);
    //var layer = document.getElementsByClassName(name);
    //if (layer != null) {
    try {
        layer.style.top = document.body.scrollTop + 20 + 'px';
    } catch (e) {

    }
       // alert("fddsfg");
    //}
    eval(setTimeout("index_move('" + name + "')", 0));

}

function sleep(n) {
    var start = new Date().getTime();
    while (true) if (new Date().getTime() - start > n) break;
} 

window.document.onreadystatechange = function() {
    if (document.readyState == "complete") {
        index_move('table');
        whichOpen = menuTitle1;
        whichContinue = menuTitle1;
    }
} 


function menuShow(obj, maxh, obj2) {
    whichContinue = obj2;
    whichOpen = obj2;
    obj.style.pixelHeight = maxh;
    obj.style.display = 'block';
}
function menuHide(obj, maxh, obj2) {
    whichOpen = "";
    whichContinue = "";
    obj.style.display = 'none';
}
function menuChange(obj, maxh, obj2) {
    if (whichOpen == obj2 && whichContinue == obj2) {
        menuHide(obj, maxh, obj2);
    } else {
        if (whichContinue != "")
            whichContinue.click();
        menuShow(obj, maxh, obj2);
    }
}
