// custom object constructor
function MainMenuItem(id, name, href, target)
{
    this.id = id
    this.showname = name
    this.href = href
    this.target = target
}

// create new main array
var MainMenu = new Array();
// stuff main array entries with objects
MainMenu[0] = new MainMenuItem("Default", "鹤壁招生考试信息网", "/", "_top");
MainMenu[1] = new MainMenuItem("PZ", "普通高招", "/PZ/", "contentpage");
MainMenu[2] = new MainMenuItem("YJ", "研究生考试", "/YJ/", "contentpage");
MainMenu[3] = new MainMenuItem("CR", "成人高招", "/CR/", "contentpage");
MainMenu[4] = new MainMenuItem("ZK", "自学考试", "/ZK/", "contentpage");
MainMenu[5] = new MainMenuItem("ZZ", "普通中招", "/ZZ/", "contentpage");
MainMenu[6] = new MainMenuItem("HK", "毕业会考", "/HK/", "contentpage");
MainMenu[7] = new MainMenuItem("SK", "社会考试", "/SK/", "contentpage");
MainMenu[8] = new MainMenuItem("DataCenter", "查询中心", "/DataCenter/", "contentpage");
MainMenu[9] = new MainMenuItem("LT", "招考论坛", "/TechBBS/", "_blank");


// custom object constructor
function SubMenuItem(id, label)
{
    this.id = id
    this.label = label
}

var SubMenu = new Array();
SubMenu[0] = new SubMenuItem('Default', '<a zzz class="linkcolors" href="/" target="_top">首页</a>');
SubMenu[1] = new SubMenuItem("Default", '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">招办简介</a>');
SubMenu[2] = new SubMenuItem("Default", '<a zzz class="linkcolors" href="/exam" target="contentpage">考试一览</a>'); 
SubMenu[3] = new SubMenuItem('Default', '<a zzz class="linkcolors" href="/News" target="contentpage">招考快讯</a>');
SubMenu[4] = new SubMenuItem('Default', '<a zzz class="linkcolors" href="/Announce" target="contentpage">重要提示</a>');
SubMenu[5] = new SubMenuItem('Default', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Class=Rule" target="contentpage">政策法规</a>');
SubMenu[6] = new SubMenuItem('Default', '<a zzz class="end" href="/KSZL/default.aspx?Class=Guide" target="contentpage">报考指南</a>');

SubMenu[7] = new SubMenuItem('PZ', '<a zzz class="linkcolors" href="/PZ" target="contentpage">首页</a>');
SubMenu[8] = new SubMenuItem('PZ', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">普招简介</a>');
SubMenu[9] = new SubMenuItem('PZ', '<a zzz class="linkcolors" href="/News/default.aspx?Site=PZ" target="contentpage">普招快讯</a>');
SubMenu[10] = new SubMenuItem('PZ', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=PZ" target="contentpage">重要提示</a>');
SubMenu[11] = new SubMenuItem('PZ', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=PZ&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[12] = new SubMenuItem('PZ', '<a zzz class="end" href="/KSZL/default.aspx?Site=PZ&Class=Guide" target="contentpage">报考指南</a>');

SubMenu[13] = new SubMenuItem('YJ', '<a zzz class="linkcolors" href="/YJ" target="contentpage">首页</a>');
SubMenu[14] = new SubMenuItem('YJ', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">研究生考试简介</a>');;
SubMenu[15] = new SubMenuItem('YJ', '<a zzz class="linkcolors" href="/News/default.aspx?Site=YJ" target="contentpage">研究生考试快讯</a>');
SubMenu[16] = new SubMenuItem('YJ', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=YJ" target="contentpage">重要提示</a>');
SubMenu[17] = new SubMenuItem('YJ', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=YJ&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[18] = new SubMenuItem('YJ', '<a zzz class="end" href="/KSZL/default.aspx?Site=YJ&Class=Guide" target="contentpage">报考指南</a>');

SubMenu[19] = new SubMenuItem('CR', '<a zzz class="linkcolors" href="/CR" target="contentpage">首页</a>');
SubMenu[20] = new SubMenuItem('CR', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">成招招简介</a>');
SubMenu[21] = new SubMenuItem('CR', '<a zzz class="linkcolors" href="/News/default.aspx?Site=CR" target="contentpage">成招快讯</a>');
SubMenu[22] = new SubMenuItem('CR', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=CR" target="contentpage">重要提示</a>');
SubMenu[23] = new SubMenuItem('CR', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=CR&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[24] = new SubMenuItem('CR', '<a zzz class="end" href="/KSZL/default.aspx?Site=CR&Class=Guide" target="contentpage">报考指南</a>');

SubMenu[25] = new SubMenuItem('ZK', '<a zzz class="linkcolors" href="/ZK" target="contentpage">首页</a>');
SubMenu[26] = new SubMenuItem('ZK', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">自考简介</a>');
SubMenu[27] = new SubMenuItem('ZK', '<a zzz class="linkcolors" href="/News/default.aspx?Site=ZK" target="contentpage">自考快讯</a>');
SubMenu[28] = new SubMenuItem('ZK', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=ZK" target="contentpage">重要提示</a>');
SubMenu[29] = new SubMenuItem('ZK', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=ZK&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[30] = new SubMenuItem('ZK', '<a zzz class="end" href="/KSZL/default.aspx?Site=ZK&Class=Guide" target="contentpage">报考指南</a>');

SubMenu[31] = new SubMenuItem('ZZ', '<a zzz class="linkcolors" href="/ZZ" target="contentpage">首页</a>');
SubMenu[32] = new SubMenuItem('ZZ', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">中招简介</a>');
SubMenu[33] = new SubMenuItem('ZZ', '<a zzz class="linkcolors" href="/News/default.aspx?Site=ZZ" target="contentpage">中招快讯</a>');
SubMenu[34] = new SubMenuItem('ZZ', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=ZZ" target="contentpage">重要提示</a>');
SubMenu[35] = new SubMenuItem('ZZ', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=ZZ&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[36] = new SubMenuItem('ZZ', '<a zzz class="end" href="/KSZL/default.aspx?Site=ZZ&Class=Guide" target="contentpage">报考指南</a>');

SubMenu[37] = new SubMenuItem('HK', '<a zzz class="linkcolors" href="/HK" target="contentpage">首页</a>');
SubMenu[38] = new SubMenuItem('HK', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">会考简介</a>');
SubMenu[39] = new SubMenuItem('HK', '<a zzz class="linkcolors" href="/News/default.aspx?Site=HK" target="contentpage">会考快讯</a>');
SubMenu[40] = new SubMenuItem('HK', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=HK" target="contentpage">重要提示</a>');
SubMenu[41] = new SubMenuItem('HK', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=HK&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[42] = new SubMenuItem('HK', '<a zzz class="end" href="/KSZL/default.aspx?Site=HK&Class=Guide" target="contentpage">报考指南</a>');

SubMenu[43] = new SubMenuItem('SK', '<a zzz class="linkcolors" href="/SK" target="contentpage">首页</a>');
SubMenu[44] = new SubMenuItem('SK', '<a zzz class="linkcolors" href="/introduce/zbjjxx.htm" target="contentpage">社考简介</a>');
SubMenu[45] = new SubMenuItem('SK', '<a zzz class="linkcolors" href="/News/default.aspx?Site=SK" target="contentpage">社考快讯</a>');
SubMenu[46] = new SubMenuItem('SK', '<a zzz class="linkcolors" href="/Announce/default.aspx?Site=SK" target="contentpage">重要提示</a>');
SubMenu[47] = new SubMenuItem('SK', '<a zzz class="linkcolors" href="/KSZL/default.aspx?Site=SK&Class=Rule" target="contentpage">政策法规</a>');
SubMenu[48] = new SubMenuItem('SK', '<a zzz class="end" href="/KSZL/default.aspx?Site=SK&Class=Guide" target="contentpage">报考指南</a>');

function MakeMainMenu()
{
    var m = "";   
    
    for (var i = 0; i < MainMenu.length; i++) 
    {
        m = m + '<a href="' + MainMenu[i].href + '" id="' + MainMenu[i].id + '" ';
        
        if (i == MainMenu.length - 1) m = m + 'class="end" ';

        m = m + 'onclick="MyClick(\'' + MainMenu[i].id + '\')" target="' + MainMenu[i].target + '" onmouseover="menuShow(\'' + MainMenu[i].id + '\')" onmouseout="menuHide()">' + MainMenu[i].showname + '</a>'
    }
    
    document.getElementById("mainmenu").innerHTML =  m;
}

/* click menu show*/
function MakeMenu(id, object)
{
    var m = document.getElementById(object);

    if (object == "menuword")
    {
        m.style.display = 'block';
        document.getElementById("menushow").style.display = 'none';
    }

    if (object == "menushow")
    {
        document.getElementById("menuword").style.display = 'none';
        m.style.display = 'block';
    }

    var out = "";
    for (var i = 0; i < SubMenu.length; i++) 
    {
        if (SubMenu[i].id == id)
            out = out + SubMenu[i].label;
    }

    var r = /zzz/g;
    m.innerHTML = out.replace(r, '');
}

/* change the clicked word's color */
function ChangeColor(mid)
{
    for (j = 0; j < MainMenu.length; j++)
    {
        if (MainMenu[j].id == mid) document.getElementById(mid).style.color = 'navy';
        else document.getElementById(MainMenu[j].id).style.color = '#000';
    }
}

/* onclick script */
function MyClick(id)
{
    MakeMenu(id, 'menuword');
    ChangeColor(id); 

	if(id != 'LT') 
	{   
		document.getElementById('access').src = 'counter/genCounter.aspx?item=' + id;
	}
}

function ChangeSite(id)
{
    for(j = 0; j < MainMenu.length; j++)
   {
     if(id.toUpperCase() == MainMenu[j].id.toUpperCase())
       {
          MyClick(MainMenu[j].id)
          return;
       }
    }
    MyClick('Default');
}

/* mouseover script */
function menuShow(id)
{
    MakeMenu(id, 'menushow');
}

/* mouseover script */
function menuHide()
{
    document.getElementById('menushow').style.display = 'none';
    document.getElementById('menuword').style.display = 'block';
}

/* click menu show*/
function MakeNav()
{
    var out = "";
    var m, n, id;
    var r = /zzz/g;

    for (var i = 0; i < MainMenu.length; i++) 
    {
		id = MainMenu[i].id;
        m = '<div class="kuohao">[<span class="colorksmc">' + MainMenu[i].showname + '</span>]</div>';
        
        n = '<div>'
		for (var j = 0; j < SubMenu.length; j++) 
		{
			if (SubMenu[j].id == id)
				n = n + SubMenu[j].label;
		}
		n = n + '</div>'
		
		if (n != '<div></div>') out = out + m + n

	    out = out.replace(r, 'onclick="top.MyClick(\'' + id + '\')"');
    }

    return out;
}

MakeMainMenu();
MyClick('Default');



