<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// -------------------------------------------------------------
// フォームの無効化
// -------------------------------------------------------------
function disableAll() {
	for( i = 0; i < document.form_2out.elements.length; i++ ) {
		document.form_2out.elements[i].disabled = true;
	}
}

function actFileUp( mode ) {
	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

//	document.form_2out.enctype = "multipart/form-data";
	document.form_2out.encoding = "multipart/form-data";
	document.form_2out.action = "./" + url_data[0] + "?mode=" + mode + "&t=" + t;

	this.document.form_2out.submit();
	disableAll();

	return true;

}

function act( mode ) {
	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	this.document.form_2out.action = "./" + url_data[0] + "?mode=" + mode + "&t=" + t;

	this.document.form_2out.submit();
	disableAll();

	return true;

}

// -------------------------------------------------------------
// 遷移用スクリプト
//
// function actSetPm( mode, name, val )
// $mode  :  画面ID
// $name  :  パラメータの名前（カンマ区切り）
// $val   :  パラメータの値（カンマ区切り）
//
// 例     :  actSetPm( 'i0000', '', '' )
//        :  actSetPm( 'i0000', '', '1,2,3,4' )
//        :  actSetPm( 'i0000', '1,2,3,4', '' )
//        :  actSetPm( 'i0000', '1,,3,4', ',2,3,4' )
// -------------------------------------------------------------
function actSetPm( mode, name, val ) {
	var tmp = "";

	tmpName = new Array();
	tmpVal = new Array();

	if ( name != "" ) {
		tmpName = name.split(",");
	}
	if ( val != "" ) {
		tmpVal = val.split(",");
	}

	var count = 1;
	for ( $i = 0; $i < tmpVal.length; $i++ ) {
		if ( tmpName[$i] == "" || tmpName.length <= $i ) {
			tmp = tmp + "&id" + $count + "=" + tmpVal[$i];
			count++;
		} else {
			tmp = tmp + "&" + tmpName[$i] + "=" + tmpVal[$i];
		}
	}

	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	this.document.form_2out.action= "./" + url_data[0] + "?mode=" + mode + tmp + "&t=" + t;
	this.document.form_2out.submit();
	disableAll();
	return true;
}

// -------------------------------------------------------------
// 遷移用スクリプト
//
// function actSetPmNm( mode, name, val, href )
// $mode  :  画面ID
// $name  :  パラメータの名前（カンマ区切り）
// $val   :  パラメータの値（カンマ区切り）
//
// 例     :  actSetPm( 'i0000', '', '' )
//        :  actSetPm( 'i0000', '', '1,2,3,4' )
//        :  actSetPm( 'i0000', '1,2,3,4', '' )
//        :  actSetPm( 'i0000', '1,,3,4', ',2,3,4' )
// -------------------------------------------------------------
function actSetPmNm( mode, name, val, href ) {
	var tmp = "";

	tmpName = new Array();
	tmpVal = new Array();

	if ( name != "" ) {
		tmpName = name.split(",");
	}
	if ( val != "" ) {
		tmpVal = val.split(",");
	}

	var count = 1;
	for ( $i = 0; $i < tmpVal.length; $i++ ) {
		if ( tmpName[$i] == "" || tmpName.length <= $i ) {
			tmp = tmp + "&id" + $count + "=" + tmpVal[$i];
			count++;
		} else {
			tmp = tmp + "&" + tmpName[$i] + "=" + tmpVal[$i];
		}
	}

	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	this.document.form_2out.action= "./" + url_data[0] + "?mode=" + mode + tmp + "&t=" + t + "#" + href;
	this.document.form_2out.submit();
	disableAll();
	return true;
}

// -------------------------------------------------------------
// 遷移用スクリプト
//
// function actSetPm( mode, name, val )
// $mode  :  画面ID
// $name  :  パラメータの名前（カンマ区切り）
// $val   :  パラメータの値（カンマ区切り）
//
// 例     :  actSetPm( 'i0000', '', '' )
//        :  actSetPm( 'i0000', '', '1,2,3,4' )
//        :  actSetPm( 'i0000', '1,2,3,4', '' )
//        :  actSetPm( 'i0000', '1,,3,4', ',2,3,4' )
// -------------------------------------------------------------
function actFileUpSetPm( mode, name, val ) {
	var tmp = "";

	tmpName = new Array();
	tmpVal = new Array();

	if ( name != "" ) {
		tmpName = name.split(",");
	}
	if ( val != "" ) {
		tmpVal = val.split(",");
	}

	var count = 1;
	for ( $i = 0; $i < tmpVal.length; $i++ ) {
		if ( tmpName[$i] == "" || tmpName.length <= $i ) {
			tmp = tmp + "&id" + $count + "=" + tmpVal[$i];
			count++;
		} else {
			tmp = tmp + "&" + tmpName[$i] + "=" + tmpVal[$i];
		}
	}

	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	document.form_2out.encoding = "multipart/form-data";

	this.document.form_2out.action= "./" + url_data[0] + "?mode=" + mode + tmp + "&t=" + t;
	this.document.form_2out.submit();
	disableAll();
	return true;
}


// -------------------------------------------------------------
// 別Window表示用スクリプト
//   【mode】 処理モード
// -------------------------------------------------------------
function actSetPmW( mode, name, val, w, h ) {
	var tmp = "";

	tmpName = new Array();
	tmpVal = new Array();

	if ( name != "" ) {
		tmpName = name.split(",");
	}
	if ( val != "" ) {
		tmpVal = val.split(",");
	}

	var count = 1;
	for ( $i = 0; $i < tmpVal.length; $i++ ) {
		if ( tmpName[$i] == "" || tmpName.length <= $i ) {
			tmp = tmp + "&id" + $count + "=" + tmpVal[$i];
			count++;
		} else {
			tmp = tmp + "&" + tmpName[$i] + "=" + tmpVal[$i];
		}
	}

	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	url = "./" + url_data[0] + "?mode=" + mode + tmp + "&t=" + t;
	set = "top=0,left=0,width="+ w + ",height=" + h + ",location=no,menubar=no,status=no,scrollbars=yes,resizable=yes";
	subwin = window.open( url, "subwindow", set );
	subwin.focus();

}


// -------------------------------------------------------------
// 別Window表示用スクリプト
//   【mode】 処理モード
// -------------------------------------------------------------
function actSetPmW2( mode, name, val, w, h ) {
	var tmp = "";

	tmpName = new Array();
	tmpVal = new Array();

	if ( name != "" ) {
		tmpName = name.split(",");
	}
	if ( val != "" ) {
		tmpVal = val.split(",");
	}

	var count = 1;
	for ( $i = 0; $i < tmpVal.length; $i++ ) {
		if ( tmpName[$i] == "" || tmpName.length <= $i ) {
			tmp = tmp + "&id" + $count + "=" + tmpVal[$i];
			count++;
		} else {
			tmp = tmp + "&" + tmpName[$i] + "=" + tmpVal[$i];
		}
	}

	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	url = "./" + url_data[0] + "?mode=" + mode + tmp + "&t=" + t;
	set = "top=0,left=0,width="+ w + ",height=" + h + ",location=yes,menubar=yes,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes";
	subwin = window.open( url, "subwindow", set );
	subwin.focus();

}


// -------------------------------------------------------------
// 別Window表示用スクリプト
//   【mode】 処理モード
// -------------------------------------------------------------
function actW( mode, w, h ) {

	dd = new Date();
	t = dd.getTime();

	var tmp_location = location.href;
	var tmp_url = tmp_location.split( "/" );
	var url_data = tmp_url[tmp_url.length - 1].split( "?" );

	url = "./" + url_data[0] + "?mode=" + mode + "&t=" + t;
	set = "top=0,left=0,width="+ w + ",height=" + h + ",location=no,menubar=no,status=no,scrollbars=yes,resizable=yes";
	subwin = window.open( url, "subwindow", set );
	subwin.focus();

}

// -------------------------------------------------------------
// 日付用
// -------------------------------------------------------------
// 閏年を判別
function leapyear( year ) {
	return ( year % 4 == 0 && year % 100 != 0 || year % 400 == 0 );
}

function actCngDay( data01, data02, nullitem ) {
	var day = new Array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 );
	var flag = 0;

	var year_data = 0;
	var month_data = 0;
	var tmp_data = new Array();

	tmp_data = data01.value.split("@");
	year_data = tmp_data[0];
	month_data = tmp_data[1];

	if ( year_data != "" && month_data != "" ) {
		if( month_data == 2 && leapyear( year_data ) ) {
			loop_day = 29;
		} else {
			loop_day = day[month_data - 1];
		}

		if ( data02.value > loop_day ) {
			flag = 1;
		}

		if ( nullitem == 0 ) {
			data02.options.length = loop_day;
			for ( i = 0; i < loop_day; i++ ) {
				data02.options[i].text = i + 1;
				data02.options[i].value = i + 1;
			}
			if ( flag == 1 ) {
				data02.selectedIndex = loop_day - 1;
			}
		} else {
			data02.options.length = loop_day + 1;
			data02.options[0].text = "−";
			data02.options[0].value = "";
			for ( i = 1; i <= loop_day; i++ ) {
				data02.options[i].text = i;
				data02.options[i].value = i;
			}
			if ( flag == 1 ) {
				data02.selectedIndex = loop_day;
			}
		}
	} else {
		data02.options.length = 1;
		data02.options[0].text = "−";
		data02.options[0].value = "";
	}
}

var start_year = 2002;
function actCngYear( data01, data02, nullitem ) {

	dd = new Date();
	yy = dd.getYear();
//	mm = dd.getMonth() + 1;
//	dd = dd.getDate();
	if ( yy < 2000 ) {
		yy += 1900;
	}

	loop_start = data01.value - start_year;
	loop_max = ( yy - start_year ) + 1;

	if ( nullitem == 0 ) {
		data02.options.length = ( loop_max - loop_start );
		for ( i = loop_start, j = 0; i < loop_max; i++, j++ ) {
			data02.options[j].text = start_year + i;
			data02.options[j].value = start_year + i;
		}
		data02.selectedIndex = 0;
	} else {
		data02.options.length = ( loop_max - loop_start ) + 1;
		data02.options[0].text = "";
		data02.options[0].value = "";
		for ( i = loop_start, j = 1; i < loop_max; i++, j++ ) {
			data02.options[j].text = start_year + i;
			data02.options[j].value = start_year + i;
		}
		data02.selectedIndex = 0;
	}
}

function actCngMonth( data01, data02, nullitem ) {

	loop_start = data01.value;
	loop_max = 13;

	if ( nullitem == 0 ) {
		old_length = data02.options.length;
		data02.options.length = ( loop_max - loop_start );
		for ( i = loop_start, j = 0; i < loop_max; i++, j++ ) {
			data02.options[j].text = i;
			data02.options[j].value = i;
		}
		data02.selectedIndex = 0;
	} else {
		data02.options.length = ( loop_max - loop_start ) + 1;
		data02.options[0].text = "";
		data02.options[0].value = "";
		for ( i = loop_start, j = 1; i < loop_max; i++, j++ ) {
			data02.options[j].text = i;
			data02.options[j].value = i;
		}
		data02.selectedIndex = 0;
	}
}

function resetAll(daiso) {
	document.form_2out.select00.selectedIndex=0;
	document.form_2out.select01.selectedIndex=0;
	document.form_2out.select02.selectedIndex=0;
	document.form_2out.select03.selectedIndex=0;
	document.form_2out.select04.selectedIndex=0;
	document.form_2out.select05.selectedIndex=0;
	document.form_2out.select06.selectedIndex=0;
	document.form_2out.select07.selectedIndex=0;
	document.form_2out.select08.selectedIndex=0;
	document.form_2out.select09.selectedIndex=0;
	document.form_2out.select78.selectedIndex=0;
	document.form_2out.select89.selectedIndex=0;
	document.form_2out.doru.selectedIndex=0;
	document.form_2out.daiso.selectedIndex=0;
	
	if (daiso == 0) {
		document.form_2out.daida.selectedIndex=0;
		document.form_2out.daten.selectedIndex=0;
		document.form_2out.tokuten1.selectedIndex=0;
		document.form_2out.tokuten2.selectedIndex=0;
		document.form_2out.tokuten3.selectedIndex=0;
		document.form_2out.tokuten4.selectedIndex=0;
	}
}

function delplyr(url, comments, plyrid) {
	res=confirm(comments);
	if(res==true)actSetPm( url, 'plyrid', plyrid + ""  );
}
	

function nameBanCheck(url) {
	
	if (document.form_2out.plyrname.value=="" || document.form_2out.playnum.value=="") {
		alert('名前と番号は必ず入力してください。');
		return false;
	}
	
	act( url );
}

function resetSeiseki(url, comments, gameid, userid) {
	res=confirm(comments);
	if(res==true)actSetPm( url, 'gameid, userid', gameid + "," + userid );
}
function resetPit(url, comments, gkey, userid) {
	res=confirm(comments);
	if(res==true)actSetPm( url, 'gkey, userid', gkey + "," + userid );
}

	function msgbox1( ) {
		alert('1個だけ選んでください。');
	}

	
//-->

