//////////////////////////////////////////
// 昇順・降順処理
//////////////////////////////////////////
function ListOrder(URL, ListOrder){
	var Tag = '';
	if(ListOrder == 'asc'){
		Tag += '古い文書から表示しています。';
		Tag += '　<A href="' + URL + '?Template=List&QuerySelect=No&List=Top&ListOrder=desc" class="ListLink">新しい文書から表示する &gt;&gt;<\/A>';
	}else{
		Tag += '新しい文書から表示しています。';
		Tag += '　<A href="' + URL + '?Template=List&QuerySelect=No&List=Top&ListOrder=asc" class="ListLink">古い文書から表示する &gt;&gt;<\/A>';
	}
	Tag = Tag + '<BR>';
	document.write(Tag);
}


/////////////////////////////////////////////////
//
//現在の検索条件
//
/////////////////////////////////////////////////
function Condition(URL, Template, ImgPath, Result, StartKikan, EndKikan, Cabinet, Classes, RecordName, VoiceName, Phrase, ExpandItem1, ExpandItem2, ExpandItem3){
	var Tag = '';
	ImgTag = '<IMG src="' + ImgPath + '/eraser.gif" alt="条件を取り消す" width="18" height="16" border="0">';
	ResultLinkTag = '<A href="' + URL + '?Template=' + Template + '&ResultSelect=Clear&QueryType=Modify">';
	KikanLinkTag = '<A href="' + URL + '?Template=' + Template + '&KikanSelect=Clear&QueryType=Modify">';
	CabinetLinkTag = '<A href="' + URL + '?Template=' + Template + '&CabinetSelect=Clear&QueryType=Modify">';
	ClassLinkTag = '<A href="' + URL + '?Template=' + Template + '&ClassSelect=Clear&QueryType=Modify">';
	RecordNameLinkTag = '<A href="' + URL + '?Template=' + Template + '&RecordNameSelect=Clear&QueryType=Modify">';
	VoiceLinkTag = '<A href="' + URL + '?Template=' + Template + '&VoiceSelect=Clear&QueryType=Modify">';
	PhraseLinkTag = '<A href="' + URL + '?Template=' + Template + '&PhraseSelect=Clear&QueryType=Modify">';
	ExpandItem1LinkTag = '<A href="' + URL + '?Template=' + Template + '&ExpandItemSelect1=Clear&QueryType=Modify">';
	ExpandItem2LinkTag = '<A href="' + URL + '?Template=' + Template + '&ExpandItemSelect2=Clear&QueryType=Modify">';
	ExpandItem3LinkTag = '<A href="' + URL + '?Template=' + Template + '&ExpandItemSelect3=Clear&QueryType=Modify">';

	if(Result != ''){
		Tag += '<TR valign="top"><TD nowrap>履歴<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + ResultLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + Result + '<\/SPAN><\/TD><\/TR>';
	}
	if(StartKikan != ''){
		Tag += '<TR valign="top"><TD nowrap>日付の範<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + KikanLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + StartKikan + " - " + EndKikan + '<\/SPAN><\/TD><\/TR>';
	}
	if(Cabinet != ''){
		Tag += '<TR valign="top"><TD nowrap>会議の種類<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + CabinetLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + Cabinet + '<\/SPAN><\/TD><\/TR>';
	}
	if(Classes != ''){
		Tag += '<TR valign="top"><TD nowrap>文書の種類<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + ClassLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + Classes + '<\/SPAN><\/TD><\/TR>';
	}
	if(RecordName != ''){
		Tag += '<TR valign="top"><TD nowrap>文書名<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + RecordNameLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + RecordName + '<\/SPAN><\/TD><\/TR>';
	}
	if(VoiceName != ''){
		Tag += '<TR valign="top"><TD nowrap>発言者<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + VoiceLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + VoiceName + '<\/SPAN><\/TD><\/TR>';
	}
	if(Phrase != ''){
		Tag += '<TR valign="top"><TD nowrap>本文中の言葉<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + PhraseLinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + Phrase + '<\/SPAN><\/TD><\/TR>';
	}
	if(ExpandItem1 != ''){
		Tag += '<TR valign="top"><TD nowrap>目次<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + ExpandItem1LinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + ExpandItem1 + '<\/SPAN><\/TD><\/TR>';
	}
	if(ExpandItem2 != ''){
		Tag += '<TR valign="top"><TD nowrap>発言の内容<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + ExpandItem2LinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + ExpandItem2 + '<\/SPAN><\/TD><\/TR>';
	}
	if(ExpandItem3 != ''){
		Tag += '<TR valign="top"><TD nowrap>質問者<\/TD><TD>：<\/TD>';
		Tag += '<TD>' + ExpandItem3LinkTag + ImgTag + '<\/A><\/TD>';
		Tag += '<TD><SPAN class="Condition">' + ExpandItem3 + '<\/SPAN><\/TD><\/TR>';
	}
	if(Tag != ''){
		Tag = '<TABLE border="0" cellspacing="0" cellpadding="0">' + Tag + '<\/TABLE>';
		document.write(Tag);
	}
}


/////////////////////////////////////////////////
//発言者を指定
/////////////////////////////////////////////////
function VoiceSel(RadioNo,ListNo){
	var i;
	self.document.forms[0].VoiceClass[RadioNo].checked = true;
	for(i = 1; i < self.document.forms[0].Voice.length; i++){
		if(ListNo != i){
			self.document.forms[0].Voice[i].selectedIndex = -1;
		}
	}
}


/////////////////////////////////////////////////
//トップページ期間指定フォーム処理
/////////////////////////////////////////////////
function SelectAction(Year){
	self.document.forms[0].StartKikanYear.value = Year;
	self.document.forms[0].EndKikanYear.value = Year;
}


/////////////////////////////////////////////////
//
// 詳細検索
//
/////////////////////////////////////////////////
function voice_set(VoiceClass, ListNo){
	var tmp = self.document.forms[0];
	tmp.VoiceClass.value = VoiceClass;
	flg = 0;
	for(i = 0; i <= tmp.Voice.length-1; i++){
		if(ListNo != i){
			tmp.Voice[i].selectedIndex = 0;
		}
		if(tmp.Voice[i].selectedIndex != 0){
			flg = 1;
		}
	}
	if((ListNo >= 0) && (flg != 0)){
		tmp.VoiceSelect[1].checked = true;
	}else{
		tmp.VoiceSelect[0].checked = true;
	}
}


function class_checked(){
	bool = true;
	var tmp = self.document.forms[0];
	for(i = 0; i <= tmp.Classes.length-1; i++){
		bool = bool && tmp.Classes[i].checked;
	}
	if(bool){
		tmp.ClassSelect[0].checked = true;
	}else{
		tmp.ClassSelect[1].checked = true;
	}
}


function cabinet_set(bool){
	var tmp = self.document.forms[0];
	if(bool == '1'){
		tmp.CabinetSelect[1].checked = true;
	}else if(bool == '-1'){
		tmp.Cabinets.selectedIndex = -1;
	}
}


function class_set(bool){
	var tmp = self.document.forms[0];
	for(i = 0; i <= 4; i++){
		tmp.Classes[i].checked = bool;
	}
}

function Kikan_set(){
	var tmp = self.document.forms[0];
	tmp.KikanSelect[1].checked = true;
}

function Kikan_reset(){
	var tmp = self.document.forms[0];
	tmp.KikanSelect[0].checked = true;
	tmp.StartKikanYear.selectedIndex = 0;
	tmp.StartKikanMonth.selectedIndex = 0;
	tmp.EndKikanYear.selectedIndex = tmp.EndKikanYear.length - 1;
	tmp.EndKikanMonth.selectedIndex = 11;
}


/////////////////////////////////////////////////
//
// 目次
//
/////////////////////////////////////////////////

/////////////////////////////////////////////////
//発言者リストジャンプ
/////////////////////////////////////////////////
function GotoFirist(){
	self.location.hash = 'hit0';
}


/////////////////////////////////////////////////
//ウィンドウを開く
/////////////////////////////////////////////////
function docopen(){
	doc = window.open("","doc","toolbar=no,lacation=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,close=no");
	doc.focus();
}


/////////////////////////////////////////////////
//日付で移動
/////////////////////////////////////////////////
function select_day(){
	n = self.document.forms[0].sel.selectedIndex;
	var hizuke = self.document.forms[0].sel.options[n].value;
	self.document.location.href = hizuke;
}


/////////////////////////////////////////////////
//
// ポップアップ処理
//
/////////////////////////////////////////////////

/////////////////////////////////////////////////
// 発言内容プレビュー画面
/////////////////////////////////////////////////
function PrevWindow(){
	OpenPrevWindow = window.open("","PrevWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,close=yes,width=600,height=600");
}


/////////////////////////////////////////////////
// 別窓表示画面
/////////////////////////////////////////////////
function OtherWindow(url){
	parent.windowNo++;
	OpenOtherWindow = window.open("",parent.windowNo,"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,close=yes,width=600,height=600");
	OpenOtherWindow.location = url;
}


/////////////////////////////////////////////////
// 印刷画面
/////////////////////////////////////////////////
function PrintWindow(url){
	OpenPrintWindow = window.open("","PrintWindow","toolbar=no,location=no,directories=no,status=yes,menubar=Yes,scrollbars=yes,resizable=yes,close=yes,width=600,height=600");
	OpenPrintWindow.location = url;
}


/////////////////////////////////////////////////
// ヘルプ画面
/////////////////////////////////////////////////
function HelpOpen(temp){
	Help = window.open(temp,"Help","scrollbars=yes,resizable=yes,width=650,height=600,dependent");
}

