function headerwrite(current,laydisp,pulldown){
//リスト設定  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

listArray = new Array(
	"0__学長挨拶__/info/gakuchou/__19",
	"0__大学の沿革__/info/enkaku/__19",
	"0__大学の組織（PDF）__/info/pdf/sosiki.pdf__19",
	"0__キャンパス__/camp/__19",
	"0__施設・設備__/info/setubi/socyanpa.html__19",
	"0__出版物__/info/publish/__19",
	"0__学校法人東京理科大学__/info/houjin/index.html__19",
	"0__同窓会（理窓会）__http://risoukai.rikadai.jp/__19",
	"0__父母会（こうよう会）__http://www.tus-koyokai.com/__19",
	"0__維持会__/125/ijikai/__19",
	"last__交通アクセス__/info/access/index.html__19",
	"#",
	"1__理学部第一部__/fac/ri1_index.html__19",
	"1__工学部第一部__/fac/ko1_index.html__19",
	"1__薬学部__/fac/yaku_index.html__19",
	"1__理工学部__/fac/riko_index.html__19",
	"1__基礎工学部__/fac/kiso_index.html__19",
	"1__経営学部__/fac/keiei_index.html__19",
	"1__理学部第二部__/fac/ri2_index.html__19",
	"1__工学部第二部__/fac/ko2_index.html__19",
	"1__教養（各学部共通）__/fac/liberal_index.html__19",
	"1__理学専攻科__/fac/math_sen.html__19",
	"1__シラバス__http://www.tus.ac.jp/fac/syllabus/index.html__19",
	"1__就職・進学情報__/fac/shushoku/toppage.html__19",
	"last__資格取得__/fac/shikaku/index.html__19",
	"#",
	"2__理学研究科__/grad/ri_index.html__19",
	"2__工学研究科__/grad/ko_index.html__19",
	"2__薬学研究科__/grad/yaku_index.html__19",
	"2__理工学研究科__/grad/riko_index.html__19",
	"2__基礎工学研究科__/grad/kiso_index.html__19",
	"2__経営学研究科__/grad/keiei_index.html__19",
	"2__生命科学研究科__/grad/seimei_index.html__19",
	"2__連携大学院__/grad/renkei.html__19",
	"2__シラバス__http://www.tus.ac.jp/fac/syllabus/index.html__19",
	"last__学位を申請される方へ__/grad/gakui.html__19",
	"#",
	"3__総合科学技術経営専攻__http://most.tus.ac.jp/mot/__19",
	"last__知的財産戦略専攻__http://most.tus.ac.jp/mip/__19",
	"#",
	"4__総合研究機構__/labo/research_synthesis.html__19",
	"4__生命科学研究所__/labo/research_life.html__19",
	"4__情報科学教育研究機構__/labo/research_info.html__19",
	"4__共同研究・受託研究__/labo/jutaku.html__19",
	"last__研究機器センター__/labo/kiki/__19",
	"#",
	"5__行事__/life/gyouji/index.html__19",
	"5__クラブ__/life/club/index.html__19",
	"5__クラブ大会参姥\定__/life/gakusei_news/__19",
	"5__よろず相談室__/life/soudan/index.html__19",
	"5__学習相談__/life/gakushu_soudan/index.html__19",
	"5__奨学金__/life/shougaku/index.html__19",
	"5__学生支援__/life/support/index.html__19",
	"last__窓口案内__/life/madoguchi/madoguchi.html__19",
	"#"
);

//プルダウン表示 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var selectmenu = '<td><table border="0" cellspacing="0" cellpadding="0"><form action="http://www.tus.ac.jp/" method="post"><tr><td><select name="site_menu" onChange="location.href=this.form.site_menu.options[this.form.site_menu.selectedIndex].value"><option value="">訪問者別メニュー<option value="/admis/">受験生の方<option value="/users/zaigaku.php">在学生の方<option value="/users/sotugyou.php">卒業生の方<option value="/users/kigyou.php">企業の方<option value="/users/fubo.php">ご父母の方</select></td><td><img src="/common/images/header_line.gif" width="13" height="20" border="0" alt=""></td></tr></form></table></td>'

if (pulldown == 'off'){
	selectmenu = ''
}

//マウスオーバー処理 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

//****リンク先の設定****
theLink = new Array(
	'/info/',
	'/fac/',
	'/grad/',
	'http://most.tus.ac.jp/',
	'/labo/',
	'/life/'
);
//****ターゲットの設定****
theTarget = new Array(
	'target="_top"',
	'target="_top"',
	'target="_top"',
	'target="_top"',
	'target="_top"',
	'target="_top"'
);
//****ALTの設定****
theAlt = new Array(
	'大学概要',
	'学部',
	'大学院',
	'専門職大学院',
	'研究所',
	'学生生活'
);

//NN4シリーズ用判定＆変数
var nnfoot = "";
var nnhead1 = "";
var nnhead2 = "";

if(document.layers){
	nnfoot = "</layer>";
}

//レイヤー設定  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var tempbottom ="</td><td width=6><img src=/common/images/sp.gif width=6 height=2 border=0 alt=></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=130 bgcolor=#000000><tr><td><img src=/common/images/sp.gif width=2 height=6 border=0 alt=></td></tr></table>" +nnfoot+ "</div>";

var temp ="";

//ループ生成  ----------------
menuArray = new Array();
var num = "";


for (n in listArray){
	splitlist = new Array();
	splitlist = listArray[n].split('__');


	if (splitlist[0] != "#"){


		if (temp == ""){
			num = splitlist[0];

			if(document.layers){	//NN判定
				nnhead1 = "<layer onmouseout=btnTimer() onmouseover=headnavi1('menu" +num+ "'," +num+ ");showLayer('ID" +num+ "')>";
				nnhead2 = "<layer onmouseout=headnavi2('menu" +num+ "'," +num+ ");btnTimer() onmouseover=headnavi1('menu" +num+ "'," +num+ ");showLayer('ID" +num+ "')>";
			}

			if (current == num){
				temp = "<div id=ID" +num+ ">" +nnhead1+ "<table border=0 cellspacing=0 cellpadding=0 width=130 bgcolor=#000000><tr><td width=6><img src=/common/images/sp.gif width=6 height=2 border=0 alt=></td><td width=118><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td height=6></td></tr></table>";
			}else{
				temp = "<div id=ID" +num+ ">" +nnhead2+ "<table border=0 cellspacing=0 cellpadding=0 width=130 bgcolor=#000000><tr><td width=6><img src=/common/images/sp.gif width=6 height=2 border=0 alt=></td><td width=118><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td height=6></td></tr></table>";
			}
			
		}
		if (splitlist[0] == "last"){
			if (current == num){
				var rooptemp = "<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td onclick= location='"+splitlist[2]+"' onmouseout= btnTimer();this.bgColor='#000000' onmouseover= headnavi1('menu" +num+ "'," +num+ ");showLayer('ID" +num+ "');this.bgColor='#de590e';className='n'><table border=0 cellspacing=0 cellpadding=3 width=100%><tr><td class=text10 height=" +splitlist[3]+ "><a class=header href="+splitlist[2]+">" +splitlist[1]+ "</a></td></tr></table></td></tr></table>";
			}else{
				var rooptemp = "<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td onclick= location='"+splitlist[2]+"' onmouseout= headnavi2('menu" +num+ "'," +num+ ");btnTimer();this.bgColor='#000000' onmouseover= headnavi1('menu" +num+ "'," +num+ ");showLayer('ID" +num+ "');this.bgColor='#de590e';className='n'><table border=0 cellspacing=0 cellpadding=3 width=100%><tr><td class=text10 height=" +splitlist[3]+ "><a class=header href="+splitlist[2]+">" +splitlist[1]+ "</a></td></tr></table></td></tr></table>";
			}

		}else{
			if (current == num){
				var rooptemp = "<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td onclick= location='"+splitlist[2]+"' onmouseout= btnTimer();this.bgColor='#000000' onmouseover= headnavi1('menu" +num+ "'," +num+ ");showLayer('ID" +num+ "');this.bgColor='#de590e';className='n'><table border=0 cellspacing=0 cellpadding=3 width=100%><tr><td class=text10 height=" +splitlist[3]+ "><a class=header href="+splitlist[2]+">" +splitlist[1]+ "</a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img src=/common/images/laymenuline.gif width=118 height=1 border=0 alt=></td></tr></table></td></tr></table>";
			}else{
				var rooptemp = "<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td onclick= location='"+splitlist[2]+"' onmouseout= headnavi2('menu" +num+ "'," +num+ ");btnTimer();this.bgColor='#000000' onmouseover= headnavi1('menu" +num+ "'," +num+ ");showLayer('ID" +num+ "');this.bgColor='#de590e';className='n'><table border=0 cellspacing=0 cellpadding=3 width=100%><tr><td class=text10 height=" +splitlist[3]+ "><a class=header href="+splitlist[2]+">" +splitlist[1]+ "</a></td></tr></table><table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img src=/common/images/laymenuline.gif width=118 height=1 border=0 alt=></td></tr></table></td></tr></table>";

			}
		}

	temp += rooptemp;

	}else{
		temp += tempbottom;
		var m = menuArray.length;
		menuArray[m] = temp;
		temp = "";
	}

}

temp = "<div id=ID6></div>";
var m = menuArray.length;
menuArray[m] = temp;


var layerMenu = "";
for (i in menuArray){
	layerMenu += menuArray[i]
}


//レイヤーON,OFF設定（ID6が空とする）----------------
defaultLyr='ID6';
onLayer=defaultLyr;

splitdata = new Array();
splitdata =  laydisp.split('__');


var GlobalMenu = '';
for(m=0;m<=5;m++){
	if (splitdata[m] == 'on'){
		if (current==m){
			GlobalMenu += '<a href="' +theLink[m]+ '" ' +theTarget[m]+'  onmouseover="showLayer(\'ID' +m+ '\')"><img src="/common/images/menu' +m+ '_r.gif" height="28" border="0" name="menu' +m+ '" alt="' +theAlt[m]+ '"></a>';
		}else{
			GlobalMenu += '<a href="' +theLink[m]+ '" onmouseover="headnavi1(\'menu' +m+ '\',' +m+ ');showLayer(\'ID' +m+ '\')"  onmouseout="headnavi2(\'menu' +m+ '\',' +m+ ');btnTimer()" ' +theTarget[m]+' ><img src="/common/images/menu' +m+ '.gif" height="28" border="0" name="menu' +m+ '" alt="' +theAlt[m]+ '"></a>';
		}
	}else{
		if (current==m){
			GlobalMenu += '<a href="' +theLink[m]+ '" ' +theTarget[m]+' ><img src="/common/images/menu' +m+ '_r.gif" height="28" border="0" name="menu' +m+ '" alt="' +theAlt[m]+ '"></a>';
		}else{
			GlobalMenu += '<a href="' +theLink[m]+ '" onmouseover="headnavi1(\'menu' +m+ '\',' +m+ ')"  onmouseout="headnavi2(\'menu' +m+ '\',' +m+ ')" ' +theTarget[m]+' ><img src="/common/images/menu' +m+ '.gif" height="28" border="0" name="menu' +m+ '" alt="' +theAlt[m]+ '"></a>';
		}
	}

}



//テンプレート  ----------------
var template = '<a name="top"></a><table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff"><tr><td height="5"></td></tr></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr valign="bottom"><td width="0%"><img src="/common/images/sp.gif" width="5" height="2" border="0" alt=""></td><td width="0%"><a href="/" target="_top"><img class="tus_logo" src="/common/images/tus_logo.gif" width="168" height="45" border="0" alt="東京理科大学"></a></td><td width="0%"><img src="/common/images/sp.gif" width="15" height="2" border="0" alt=""></td><td width="0%"><a href="/indexj.php" target="_top"><img src="/common/images/to_top.gif" width="33" height="10" border="0" alt=""></a></td><td width="0%"><img src="/common/images/sp.gif" width="15" height="2" border="0" alt=""></td><td width="0%"><a href="/en/" target="_top"><img src="/common/images/to_english.gif" width="58" height="10" border="0" alt=""></a></td><td width="100%" align="right"><table border="0" cellspacing="0" cellpadding="0"><tr valign=middle>' +selectmenu+ '<td><form  style="margin-bottom: 2px;" id="searchbox_014865889877293365565:rwcc0ynusug" action="/search.html"><input type="hidden" name="cx" value="014865889877293365565:rwcc0ynusug"><input name="q" type="text" size="20"><input type="submit" name="sa" value="Search"><input type="hidden" name="cof" value="FORID:11"><input type="hidden" name="safe" value="active" /><input type="hidden" name="ie" value="UTF-8" /></form><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_014865889877293365565%3Arwcc0ynusug"></script></td></tr></table></td><td width="0%"><img src="/common/images/sp.gif" width="5" height="2" border="0" alt=""></td></tr></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td height="7"></td></tr></table><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td nowrap background="/common/images/header_bg.gif">' + GlobalMenu + '</td></tr></table>' + layerMenu + ''

//出力
	document.write(template);
}






//マウスオーバー関数（サブルーチン）/////////////////////////////
var OverImg = new Array();
var OutImg = new Array();

for(i=0;i<=5;i++){
OutImg[i] = new Image;
OutImg[i].src = '/common/images/menu' + i + '.gif';
}

for(i=0;i<=5;i++){
OverImg[i] = new Image;
OverImg[i].src = '/common/images/menu' + i + '_r.gif';
}

function headnavi1(nam,num){
document.images[nam].src = OverImg[num].src;
}
function headnavi2(nam,num){
document.images[nam].src = OutImg[num].src;
}


 var img = new Array();

 img[0] = new Image();img[0].src = "/common/images/left_navi_r.gif";
 img[1] = new Image();img[1].src = "/common/images/left_navi.gif";
 img[2] = new Image();img[2].src = "/common/images/left_navi2.gif";

function _in(nam,num) {

 document.images[nam].src = img[num].src;

 return false;

}

//サーチ関数（サブルーチン）/////////////////////////////

function seek1SetCols(v) {
	for (i=0;i<document.seek1.elements.length;i++) {
		if (document.seek1.elements[i].name=='col') {
			document.seek1.elements[i].checked=v
		}
	}
}

