function selectSearchSubject(sid) {
	var std;
	var table = '<table>';
	var target = document.getElementById('results');
	var db;
	
	if( sid == 0 ) {
		db = allUsers;
	} else {
		db = subdb[sid];
	}
	
	for(var i = 0; i < db.length; i++) {
		std = db[i];
		table += '<tr>';
		table += '<td>' + std.year + '</td>';
		table += '<td>' + std.id + '</td>';
		table += '<td>' + std.name + '</td>';
		table += '<td><a href="javascript:detailUser(\'' + std.id + '\');" class="operation">詳細</a></td>';
		table += '<td><a href="javascript:deleteUser(\'' + std.id + '\');"><img src="files/images/delete.gif" alt="削除"></a></td>';
		if(std.del) {
			table = table + '<td>ユーザ削除済</td>';
		} else {
			table = table + '<td></td>';
		}
		table = table + '</tr>';
	}
	table = table + '</table>';
	target.innerHTML = table;
	
	changeSubject(sid);
}

function deleteUser(uid) {
	if(confirm("削除してもよろしいですか？")) {
		var url = deleteURL;
		var params = 'del_id=' + uid;
		if(url.indexOf('?') > 0) {
			location.href = url + '&' + params;
		} else {
			location.href = url + '?' + params;
		}
	}
}

function detailUser(uid) {
	var url = detailURL;
	var params = 'uid=' + uid;
	if(url.indexOf('?') > 0) {
		location.href = url + '&' + params;
	} else {
		location.href = url + '?' + params;
	}
}

