//	list.js
//
// This file is generated automatically.
// See the cgi-script if you want to edit this file.

var cols = 3;

var g = new Array();	// genres
g.push([ "属性なし", "フリーエージェント" ]);
g.push([ "1年生", "まだまだフレッシュ" ]);
g.push([ "2年生", "少し大学生らしくなってきた" ]);
g.push([ "3年生", "働き盛り" ]);
g.push([ "4年生以上", "そろそろ学校の方が忙しい" ]);
g.push([ "定年退職組", "老兵は消え去るのみ" ]);
g.push([ "派遣社員", "イベントを手伝ってくれる人たち" ]);


var m = new Array();	// members
m.push([ 1, "AtsshSj", "東海林　敦士" ]);
m.push([ 1, "E田", "飯田亮一" ]);
m.push([ 1, "くめ", "久米　健太郎" ]);
m.push([ 1, "さよこ", "中山小夜子" ]);
m.push([ 1, "すぎやま", "杉山智美" ]);
m.push([ 1, "たっき", "滝沢健太" ]);
m.push([ 1, "だいち", "新井大地" ]);
m.push([ 1, "のりみそ", "高橋　紀光" ]);
m.push([ 1, "ふじつば", "藤井翼" ]);
m.push([ 1, "みを", "新井美央" ]);
m.push([ 1, "アルファ", "金子　和哉" ]);
m.push([ 1, "インド", "加藤　北都" ]);
m.push([ 1, "クニ", "国崎愛子" ]);
m.push([ 2, "あずき", "永井小豆" ]);
m.push([ 2, "さと", "太田さとみ" ]);
m.push([ 2, "のざき", "野崎耀平" ]);
m.push([ 2, "みずの", "水野陽介" ]);
m.push([ 2, "キタハラ", "北原　寛章" ]);
m.push([ 3, "あずMAX", "東　拓矢" ]);
m.push([ 3, "くらた", "倉田浩平" ]);
m.push([ 3, "たくろう", "青木　拓朗" ]);
m.push([ 3, "ばっしー", "石橋　一輝" ]);
m.push([ 3, "ゆうれい", "西塚 智也" ]);
m.push([ 4, "7010", "深澤　直人" ]);
m.push([ 4, "あいちゃん", "小松愛" ]);
m.push([ 4, "あきお", "山田明生" ]);
m.push([ 4, "おがわ", "尾川 慎介" ]);
m.push([ 4, "おなべ", "小鍋 祐輔" ]);
m.push([ 4, "かよこ", "今飯田　佳代子" ]);
m.push([ 4, "くりりん", "栗林康太" ]);
m.push([ 4, "ぐろちゃん", "石黒斐蘭" ]);
m.push([ 4, "さいとう", "齋藤 鷹一" ]);
m.push([ 4, "さかねぇ", "坂根彩" ]);
m.push([ 4, "しょうだ", "庄田侑矢" ]);
m.push([ 4, "たみ～", "只見　聡" ]);
m.push([ 4, "とむ", "小泉智洋" ]);
m.push([ 4, "なかがわ", "中川慎太郎" ]);
m.push([ 4, "まぁ", "菱沼円" ]);
m.push([ 4, "まっつん", "松尾悠里" ]);
m.push([ 4, "まゆ", "竹下　真由" ]);
m.push([ 4, "まる", "丸尾美奈子" ]);
m.push([ 4, "まるまる", "一丸　晋太郎" ]);
m.push([ 4, "みずよし", "小宮 自由" ]);
m.push([ 4, "みむら", "三村　伊予" ]);
m.push([ 4, "みらい", "田中未来" ]);
m.push([ 4, "やま", "山崎　敦子" ]);
m.push([ 4, "ゆうこりん", "伊藤　由布子" ]);
m.push([ 4, "アフロ", "横山真之介" ]);
m.push([ 4, "オオグマ", "大熊　雄也" ]);
m.push([ 4, "オクタン", "野坂　惇郎" ]);
m.push([ 4, "サーヤ", "柴田　清夏" ]);
m.push([ 4, "タカヒロ", "鈴木崇弘" ]);
m.push([ 4, "ダイ", "松尾　大輔" ]);
m.push([ 4, "大☆冒☆険", "金田祐輔" ]);
m.push([ 4, "菅井", "菅井　直人" ]);
m.push([ 5, "いなだ", "稲田　涼平" ]);
m.push([ 5, "くまさん", "大熊　孝広" ]);
m.push([ 5, "げん", "田中　玄弥" ]);
m.push([ 5, "こーさか", "高坂 泰弘" ]);
m.push([ 5, "だいご", "藤田　大悟" ]);
m.push([ 5, "ハム", "村上　公也" ]);


// Generated code from here.
var isMSIE = /*@cc_on!@*/false;	// This is a magic.
var book	= document.getElementById("memberlist");
var tabs__	= document.createElement("table");
var tabs_ 	= document.createElement("tbody");
var tabs 	= document.createElement("tr");
var note__	= document.createElement("table");
var note_	= document.createElement("tbody");
book.appendChild(tabs__);
book.appendChild(note__);
tabs__.appendChild(tabs_);
tabs_.appendChild(tabs);
note__.appendChild(note_);
setClass( tabs__, "tab"  );
setClass( note__, "note" );

// make tabs
for ( var i = 0; i < g.length; i++ ) {
	var tab = document.createElement("td");
	var text = document.createTextNode(g[i][0]);
	tab.appendChild(text);
	tab.setAttribute("title", g[i][1]);

	tabs.appendChild(tab);
	tab.no = i;
	tab.onclick = function() { changetab(this.no); }
}

// first call (window.onload)
{
	var handle = getHandle();
	var no = 1;
	for ( var i = 0; i < m.length; i++ ) {
		if ( handle != m[i][1] ) continue;
		no = m[i][0];
		break;
	}
	changetab(no);
}


// click tab
function changetab(no) {
	var ml		= document.getElementById("memberlist");
	var note	= ml.getElementsByTagName("table")[1];
	var tbody	= document.createElement("tbody");

	var handle	= getHandle();
	var count	= 0;
	var tr;

	for ( var i = 0; i < m.length; i++ ) {
		if ( m[i][0] < no ) continue;
		if ( m[i][0] > no ) break;

		var td		= document.createElement("td");
		var anchor	= document.createElement("a");
		var a_text	= document.createTextNode(m[i][1]);
		var t_text	= document.createTextNode(" （" + m[i][2] + "）");
		anchor.appendChild(a_text);
		anchor.setAttribute("href", m[i][1]);
		td.appendChild(anchor);
		td.appendChild(t_text);
		if ( m[i][1] == handle ) setClass(td, "selected");

		if ( count % cols == 0 ) { tr = document.createElement("tr"); }
		tr.appendChild(td);
		count++;
		if ( count % cols == 0 ) { tbody.appendChild(tr); }
	}

	if ( count == 0 ) {
		tr = document.createElement("tr");
		var td = document.createElement("td");
		var text = document.createTextNode("このカテゴリに所属するメンバーはいません。");
		td.appendChild(text);
		tbody.appendChild(tr);
		tr.appendChild(td);
	}
	else {
		// fill shortage of td
		while ( count % cols ) {
			var td = document.createElement("td");
			tr.appendChild(td);
			count++;
		}
	}
	
	note.replaceChild( tbody, note.firstChild );
	tbody.appendChild(tr);

	// change class of tab
	var tabs = ml.getElementsByTagName("table")[0].getElementsByTagName("td");
	for ( var i = 0; i < tabs.length; i++ ) {
		setClass( tabs[i], ( i != no ) ? "unselect" : "selected" );
	}
}

function getHandle() {
	var h = location.href;
	h = h.substr( h.lastIndexOf('/') + 1 );
	var p = h.lastIndexOf(".html");
	return ( p != -1 ) ? h.substr(0, p) : h;
}

function setClass(it, css) { return !isMSIE ? it.setAttribute("class", css) : it.className     = css; }
function setStyle(it, css) { return !isMSIE ? it.setAttribute("style", css) : it.style.cssText = css; }

