
    var cur_index=1
    var num=8 //该值记录标签的个数
    var settime
    function GetObj(objName)
    {
        if(document.getElementById)
        {
            return eval('document.getElementById("' + objName + '")');
        }
        else if(document.layers)
        {
            return eval("document.layers['" + objName +"']");
        }
        else
        {
            return eval('document.all.' + objName);
        }
    }
    function change_Menu(index)
    {
        for(var i=1;i<=num;i++)
        {                    //最多支持8个标签
            if(GetObj("con"+i)&&GetObj("m"+i))
            {
                GetObj("con"+i).style.display = 'none';
                GetObj("m"+i).className = "menu"+i+"Off";
            }
        }
        if(GetObj("con"+index)&&GetObj("m"+index))
        {
            GetObj("con"+index).style.display = 'block';
            GetObj("m"+index).className = "menu"+index+"On";
        }

    }
    function Menu(c_index){
        clearTimeout(settime);
        if(!parseInt(c_index)){
            change_MenuByFullID(c_index);
            return;
        }
        change_Menu(c_index);        
    }
    
    function change_MenuByFullID(c_index){
        for(i=4;i<7;i++){
            if(GetObj("t"+i)&&GetObj("mt"+i)){
                GetObj("t"+i).style.display = 'none';
                GetObj("mt"+i).className = "menu"+i+"Off";
            }
        }
        if(GetObj(c_index)&&GetObj("m"+c_index))
        {
            
            GetObj(c_index).style.display = 'block';
            GetObj("m"+c_index).className = "menu"+c_index.substring(1,2)+"On";
        }
    }
    
MenuSet = function(tag_prefix,con_prefix)
    {
        this.tag = tag_prefix;
        this.con = con_prefix;
        this.item_collection = new Array();
        this.add = function(item)
        {
            this.item_collection[this.item_collection.length] = item.id;
        }
        
        this.Show = function(id)
        {
            this.Hide();
            GetObj(this.tag+id).className = "menu1On";
            GetObj(this.con+id).style.display = "block";            
        }
        
        this.Hide = function()
        {
            for(i=0;i<this.item_collection.length;i++)
            {
                document.getElementById(this.con+this.item_collection[i]).style.display = "none";
                document.getElementById(this.tag+this.item_collection[i]).className = "menu1Off";

            }
        }
    }
    
    MenuItem = function(id)
    {
        this.id = id;
    }
