var menu1 = new Array();
var menu1order = new Array();
var menu2 = new Array();
var menu3 = new Array();
var menu1_url = new Array();
var menu2_url = new Array();
var menu3_url = new Array();

var relink1 = new Array();
var relink2 = new Array();
var relink1_url = new Array();
var relink2_url = new Array();

//设置根目录
//rootpath="file:///E:/My%20Documents/0%20Documents/2%20Personal%20Documents/Scripts/Web/xuelian/";
rootpath="http://www.sgcssa.org/";

//设置一级菜单
menu1[1]='首页';
menu1[2]='新闻中心';
menu1[3]='学联信息';
menu1[4]='会务公开';
menu1[5]='专题活动';
menu1[6]='留学生活';
menu1[7]='归国创业与工作';
menu1[8]='新加坡创业与工作';
menu1[9]='网上办公';

menu1_url[1]=rootpath+'index.php';
menu1_url[2]=rootpath+'_news/index.php';
menu1_url[3]=rootpath+'_intro/index.html';
menu1_url[4]=rootpath+'_pub/index.html';
menu1_url[5]=rootpath+'_events/index.html';
menu1_url[6]=rootpath+'_life/index.html';
menu1_url[7]=rootpath+'_career/index.html';
menu1_url[8]=rootpath+'_pr/index.html';
menu1_url[9]=rootpath+'_eoffice/index.html';

//一级菜单排序
menu1order[1]=1;
menu1order[2]=2;
menu1order[3]=3;
menu1order[4]=4;
menu1order[5]=5;
menu1order[6]=6;
menu1order[7]=7;
menu1order[8]=8;
menu1order[9]=9;

//设置二级菜单
for (i=1; i<menu1.length; i++){
	menu2[i] = new Array();
	menu2_url[i] = new Array();
	menu2[i][0] = menu1[i];
	menu2_url[i][0] = menu1_url[i];
}

menu2[3][1]='领导致辞';
menu2[3][2]='机构设置';
menu2[3][3]='分支机构';
menu2[3][4]='历史沿革';
menu2[3][5]='联系我们';

menu2[4][1]='章程条例';
menu2[4][2]='学联文件';
menu2[4][3]='财务公开';
menu2[4][4]='人事任免';
menu2[4][5]='申请加入';

menu2[5][1]='学联活动';
menu2[5][2]='分会活动';

menu2[6][1]='留学政策';
menu2[6][2]='新加坡教育';
menu2[6][3]='留学服务';
menu2[6][4]='文化生活';
menu2[6][5]='浮光掠影';

menu2[7][1]='归国政策与新闻';
menu2[7][2]='高新创业园区合作';
menu2[7][3]='重点高校合作';

menu2[8][1]='最新动向';
menu2[8][2]='友好单位';

menu2[9][1]='电子邮件';
menu2[9][2]='文档下载';
menu2[9][3]='电子表格';
menu2[9][4]='内部管理';

menu2_url[3][1]=rootpath+'_intro/oration.html';
menu2_url[3][2]=rootpath+'_intro/orginization/index.html';
menu2_url[3][3]=rootpath+'_intro/branches/index.html';
menu2_url[3][4]=rootpath+'_intro/history/index.html';
menu2_url[3][5]=rootpath+'_intro/contacts.html';

menu2_url[4][1]=rootpath+'_pub/rules/index.html';
menu2_url[4][2]=rootpath+'_pub/documentations/index.html';
menu2_url[4][3]=rootpath+'_pub/finance/index.html';
menu2_url[4][4]=rootpath+'_pub/hr/index.html';
menu2_url[4][5]=rootpath+'_pub/memberapply/index.html';

menu2_url[5][1]=rootpath+'_events/index.html#central';
menu2_url[5][2]=rootpath+'_events/index.html#branches';

menu2_url[6][1]=rootpath+'_life/policy/index.html';
menu2_url[6][2]=rootpath+'_life/education/index.html';
menu2_url[6][3]=rootpath+'_life/life/index.html';
menu2_url[6][4]=rootpath+'_life/writing/index.html';
menu2_url[6][5]=rootpath+'_life/photo/index.html';

menu2_url[7][1]=rootpath+'_career/index.html#china';
menu2_url[7][2]=rootpath+'_career/index.html#local';
menu2_url[7][3]=rootpath+'_career/index.html#etc';

menu2_url[8][1]=rootpath+'_pr/latest.html';
menu2_url[8][2]=rootpath+'_pr/friends.html';

menu2_url[9][1]=rootpath+'_eoffice/email.html';
menu2_url[9][2]=rootpath+'_eoffice/downloads/index.html';
menu2_url[9][3]=rootpath+'_eoffice/eforms/index.html';
menu2_url[9][4]=rootpath+'_eoffice/manage/index.php';

//设置三级菜单
for (i=1; i<menu1.length; i++){
	menu3[i] = new Array();
	menu3_url[i] = new Array();
	for (j=1; j<menu2[i].length; j++){
		menu3[i][j] = new Array();
		menu3_url[i][j] = new Array();
		menu3[i][j][0]=menu2[i][j];
		menu3_url[i][j][0]=menu2[i][j];
	}
}

menu3[3][1][1]='大使致辞';
menu3[3][1][2]='参赞致辞';

menu3[3][2][1]='各部门职能';
menu3[3][2][2]='现任委员'
menu3[3][2][3]='主要干部简介';

menu3[3][3][1]='研究生分会';
menu3[3][3][2]='新加坡国立大学分会';
menu3[3][3][3]='南洋理工大学分会';
menu3[3][3][4]='新加坡管理大学分会';
menu3[3][3][5]='新加坡理工学院分会';
menu3[3][3][6]='南洋理工学院分会';
menu3[3][3][7]='淡马锡理工学院分会';
menu3[3][3][8]='共和理工学院分会';
menu3[3][3][9]='义安理工学院分会';
menu3[3][3][10]='英华美学院分会';
menu3[3][3][11]='物流管理学院分会';

menu3[3][4][1]='历届委员';

menu3[6][3][1]='亲身感受';
menu3[6][3][2]='生活服务';
menu3[6][3][3]='权益保障';


menu3_url[3][1][1]=rootpath+'_intro/oration.html#amb';
menu3_url[3][1][2]=rootpath+'_intro/oration.html#counsellor'; 

menu3_url[3][2][1]=rootpath+'_intro/orginization/departments.html';
menu3_url[3][2][2]=rootpath+'_intro/orginization/list.html';
menu3_url[3][2][3]=rootpath+'_intro/orginization/persons.html';

menu3_url[3][3][1]=rootpath+'_intro/branches/gsc/index.html';
menu3_url[3][3][2]=rootpath+'_intro/branches/nus/index.html';
menu3_url[3][3][3]=rootpath+'_intro/branches/ntu/index.html';
menu3_url[3][3][4]=rootpath+'_intro/branches/smu/index.html';
menu3_url[3][3][5]=rootpath+'_intro/branches/sp/index.html';
menu3_url[3][3][6]=rootpath+'_intro/branches/nyp/index.html';
menu3_url[3][3][7]=rootpath+'_intro/branches/tp/index.html';
menu3_url[3][3][8]=rootpath+'_intro/branches/rp/index.html';
menu3_url[3][3][9]=rootpath+'_intro/branches/np/index.html';
menu3_url[3][3][10]=rootpath+'_intro/branches/informatics/index.html';
menu3_url[3][3][11]=rootpath+'_intro/branches/simm/index.html';

menu3_url[3][4][1]=rootpath+'_intro/history/prcomm.html';

menu3_url[6][3][1]=rootpath+'_life/life/mylife/index.html';
menu3_url[6][3][2]=rootpath+'_life/life/lifeservice/index.html';
menu3_url[6][3][3]=rootpath+'_life/life/rights/index.html';

//设置相关链接
//设置相关链接的大类
relink1[1]='使馆、国内有关单位';
relink1[2]='各分支机构';
relink1[3]='友好团体';
relink1[4]='更多……';

relink1_url[1]=rootpath+'relinks.html#gov';
relink1_url[2]=rootpath+'_intro/branches/index.html';
relink1_url[3]=rootpath+'relinks.html#friends';
relink1_url[4]=rootpath+'relinks.html#etc';

//设置每一个类下属的链接
for (i=1; i<relink1.length; i++){
	relink2[i] = new Array();
	relink2_url[i] = new Array();
	relink2[i][0]=relink1[i];
	relink2_url[i][0]=relink1_url[i];
}

relink2[1][1]='中国驻新加坡大使馆';
relink2[1][2]='驻新加坡使馆教育处';
relink2[1][3]='神州学人';
relink2[1][4]='国家留学基金委员会';
relink2[1][5]='全国青联留学人员联谊会';
relink2[1][6]='舟山人才网';
relink2[1][7]='常州海外人才网';

relink2[2][1]='研究生分会';
relink2[2][2]='新加坡国立大学分会';
relink2[2][3]='南洋理工大学分会';
relink2[2][4]='新加坡管理大学分会';
relink2[2][5]='新加坡理工学院分会';
relink2[2][6]='南洋理工学院分会';
relink2[2][7]='淡马锡理工学院分会';
relink2[2][8]='共和理工学院分会';
relink2[2][9]='义安理工学院分会';
relink2[2][10]='英华美学院分会';
relink2[2][11]='物流管理学院分会';

relink2[3][1]='新中友好协会';
relink2[3][2]='全法中国学联';
relink2[3][3]='全英中国学联';
relink2[3][4]='墨尔本中华青联';
relink2[3][5]='在韩中国学联';
relink2[3][6]='全日本中国学联';
relink2[3][7]='中国留俄学生总会';
relink2[3][8]='马来西亚中国学联';
relink2[3][9]='海归网';
relink2[3][10]='华新网';

relink2_url[1][1]='http://www.chinaembassy.org.sg';
relink2_url[1][2]='http://www.edusg.org.cn';
relink2_url[1][3]='http://www.chisa.edu.cn';
relink2_url[1][4]='http://www.csc.edu.cn/';
relink2_url[1][5]='http://www.qinglian.org';
relink2_url[1][6]='http://www.93rc.com';
relink2_url[1][7]='http://www.czite.com';

relink2_url[2][1]='http://gsc.sgcssa.org'
relink2_url[2][2]='http://www.nuscsc.com';
relink2_url[2][3]='http://www.prcsu.org';
relink2_url[2][4]=rootpath+'smu';
relink2_url[2][5]=rootpath+'sp';
relink2_url[2][6]=rootpath+'nyp';
relink2_url[2][7]=rootpath+'tp';
relink2_url[2][8]=rootpath+'rp';
relink2_url[2][9]=rootpath+'np';
relink2_url[2][10]=rootpath+'informatics';
relink2_url[2][11]=rootpath+'simm';

relink2_url[3][1]='http://www.singasino.org';
relink2_url[3][2]='http://www.ucecf.org';
relink2_url[3][3]='http://www.cssauk.org.uk';
relink2_url[3][4]='http://www.melbcy.org';
relink2_url[3][5]='http://www.csaik.com';
relink2_url[3][6]='http://www.liurixueren.org';
relink2_url[3][7]='http://www.lexszh.cn';
relink2_url[3][8]='http://www.csfmy.net';
relink2_url[3][9]='http://www.haiguinet.com';
relink2_url[3][10]='http://www.huasing.org';


//定义网页标题
title_ch = '新加坡中国学者学生联合会';
title_en = 'CHINESE SCHOLARS AND STUDENTS ASSOCIATION IN SINGAPORE';

//获取当前路径(URL)
curr_url=window.location.href;


/*下拉菜单中鼠标指向一级菜单后，二级菜单自动下拉出来的函数*/ 
 sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);




//以下为整个标题＋下拉菜单部分的函数--------------------------------------------------------------------------------------

function write_head(page){
    document.write("<div class='site-title'>");

    //写入标题
    document.write("<div class='ch'>"+title_ch+"</div>");
    document.write("<div class='en'>"+title_en+"</div>");
  
    //写入下拉菜单内容
    document.write("<div id='nav'><ul>");

    for (jj=1; jj<menu1.length; jj++){
        j=menu1order[jj];

        //判断当前路径(URL)是否属于本次循环中引用的一级菜单的内容
        //menu_index=curr_url.search(menu_url[j][0]);
        if (j==page){
            class_t=' class=active';
        }
        else{
            class_t=' ';
        }

        document.write("<li"+class_t+"><a href='"+menu1_url[j]+"'>"+menu1[j]+"</a>");

        //判断是否有子菜单
        if (menu2[j].length > 1){
            document.write("<ul>");

　　　　　　　//创建子菜单
            for (k=1; k<menu2[j].length; k++){
                
                //判断是否为本一级菜单的最后一个二级菜单，如果是，设置不同的格式
                if (k==menu2[j].length-1){
                    document.write("<li class='last'><a href='"+menu2_url[j][k]+"'>"+menu2[j][k]+"</a></li>");
                }
                else{
                    document.write("<li><a href='"+menu2_url[j][k]+"'>"+menu2[j][k]+"</a></li>");
                }	
            }	
            document.write("</ul>");
        } /*关于子菜单，到此结束*/

        document.write("</li>");
    }

    document.write("</ul></div>");

    document.write("</div>");
}
//整个标题＋下拉菜单部分的函数到此结束-----------------------------------------------------------------------------------------


//以下为右侧链接栏的函数--------------------------------------------------------------------------------------
function write_relink(){
    document.write("<div id='relink'>");
    document.write("<ul>");
    document.write("<h2 style='margin:0; letter-spacing:3px; border-top:1px solid #ccc; text-indent:35px;'>相关链接</h2>")
    for (j=1; j<relink1.length; j++){

        document.write("<li><a target='_blank' href='"+relink1_url[j]+"'>"+relink1[j]+"</a>");
        document.write("<ul>");

        for (k=1; k<relink2[j].length; k++){
            document.write("<li><a target='_blank' href='"+relink2_url[j][k]+"'>"+relink2[j][k]+"</a></li>");
        }
	
        document.write("</ul>");
        document.write("</li>");
    }

    document.write("</ul></div>");
}
//右侧链接栏的函数到此结束-----------------------------------------------------------------------------------------


//以下为子页面左侧导航栏的函数(借用右侧链接的格式)--------------------------------------------------------------------
function write_navl(page){
    document.write("<div id='navl'>");
    document.write("<ul style='margin-top:3px; border-top:1px solid #ccc; padding-top:6px;'>");
    document.write("<a class='title' href='"+menu1_url[page]+"'>"+menu1[page]+"</a>");

    for (j=1; j<menu2[page].length; j++){

        document.write("<li><a href='"+menu2_url[page][j]+"'>"+menu2[page][j]+"</a>");
        document.write("<ul>");

        for (k=1; k<menu3[page][j].length; k++){
            document.write("<li><a href='"+menu3_url[page][j][k]+"'>"+menu3[page][j][k]+"</a></li>");
        }
	
        document.write("</ul>");
        document.write("</li>");
    }

    document.write("</ul></div>");
}

//子页面左侧导航栏的函数到此结束------------------------------------------------------------------------------------

function write_footer(){
    document.write("<div class='site-footer'></div>");
    document.write("<div style='margin:０; padding:0;'>新加坡中国学者学生联合会 版权所有</div>");
    document.write("<div style='margin:5px 0 30px 0; padding:0;'>http://www.sgcssa.org</div>");
    document.write("<span style='display:none'>");
    document.write("<script type='text/javascript' src='http://js.tongji.cn.yahoo.com/761097/ystat.js'></script>");
    document.write("<noscript><a href='http://tongji.cn.yahoo.com'><img src='http://img.tongji.cn.yahoo.com/761097/ystat.gif'/></a></noscript>");
    document.write("</span>");
}




