<!--
function Check() {
	// 生年月日チェック
	cyear=document.form1.year.options[document.form1.year.selectedIndex].value;
	cmonth=document.form1.month.options[document.form1.month.selectedIndex].value;
	cday=document.form1.day.options[document.form1.day.selectedIndex].value;
	var chour;
	var cminute;
		
	if (document.form1.hour.options[document.form1.hour.selectedIndex].value==99)	{
		chour=0;
	} else {
		chour=document.form1.hour.options[document.form1.hour.selectedIndex].value;
	}
	
	if (document.form1.minute.options[document.form1.minute.selectedIndex].value==99) {
		cminute=0;
	} else {
		cminute=document.form1.minute.options[document.form1.minute.selectedIndex].value;
	}

	//ニックネームチェック　全角15文字まで、半角30文字まで
	if (GetLength(document.form1.nickname.value) > 30) {
		alert("全角15文字以上は入力できません");
		return false;
	}
			
	if (IsTrueDate( cyear,cmonth,cday)==false || IsTrueBirthDay( cyear,cmonth,cday,chour,cminute)==false) {
		alert("生年月日が正しく選択されていません");
		return false;
	}

	if ((document.form1.hour.options[document.form1.hour.selectedIndex].value==99) && (document.form1.minute.options[document.form1.minute.selectedIndex].value!=99)) {
		alert("出生時間が正しく選択されていません");
		return false;
	} 
	
	return true;
}

function CheckBoth() {
	// 生年月日チェック(ユーザー)
	cyear=document.form1.year.options[document.form1.year.selectedIndex].value;
	cmonth=document.form1.month.options[document.form1.month.selectedIndex].value;
	cday=document.form1.day.options[document.form1.day.selectedIndex].value;
	var chour;
	var cminute;

	if (document.form1.hour.options[document.form1.hour.selectedIndex].value==99)	{
		chour=0;
	} else {
		chour=document.form1.hour.options[document.form1.hour.selectedIndex].value;
	}
	
	if (document.form1.minute.options[document.form1.minute.selectedIndex].value==99) {
		cminute=0;
	} else {
		cminute=document.form1.minute.options[document.form1.minute.selectedIndex].value;
	}

	//ニックネームチェック　全角15文字まで、半角30文字まで
	if (GetLength(document.form1.nickname.value) > 30) {
		alert("全角15文字以上は入力できません");
		return false;
	}
		
	if (IsTrueDate( cyear,cmonth,cday)==false || IsTrueBirthDay( cyear,cmonth,cday,chour,cminute)==false) {
		alert("あなたの生年月日が正しく選択されていません");
		return false;
	}

	if ((document.form1.hour.options[document.form1.hour.selectedIndex].value==99) && (document.form1.minute.options[document.form1.minute.selectedIndex].value!=99)) {
		alert("あなたの出生時間が正しく選択されていません");
		return false;
	} 
	
	// 生年月日チェック(パートナー)
	cyear2=document.form1.year2.options[document.form1.year2.selectedIndex].value;
	cmonth2=document.form1.month2.options[document.form1.month2.selectedIndex].value;
	cday2=document.form1.day2.options[document.form1.day2.selectedIndex].value;
		
	var chour2;
	var cminute2;
	if (document.form1.hour2.options[document.form1.hour2.selectedIndex].value==99)	{
		chour2=0;
	} else {
		chour2=document.form1.hour2.options[document.form1.hour2.selectedIndex].value;
	}
	
	if (document.form1.minute2.options[document.form1.minute2.selectedIndex].value==99) {
		cminute2=0;
	} else {
		cminute2=document.form1.minute2.options[document.form1.minute2.selectedIndex].value;
	}

	//ニックネームチェック　全角15文字まで、半角30文字まで
	if (GetLength(document.form1.nickname2.value) > 30) {
		alert("全角15文字以上は入力できません");
		return false;
	}
	
	if (IsTrueDate( cyear2,cmonth2,cday2)==false || IsTrueBirthDay( cyear2,cmonth2,cday2,chour2,cminute2)==false) {
		alert("お相手の生年月日が正しく選択されていません");
		return false;
	}

	if ((document.form1.hour2.options[document.form1.hour2.selectedIndex].value==99) && (document.form1.minute2.options[document.form1.minute2.selectedIndex].value!=99)){
		alert("お相手の出生時間が正しく選択されていません");
		return false;
	} 

	return true;
}

function GetLength(obj){   // 入力バイト数を返す
  var i,cnt = 0;
  for(i=0; i<obj.length; i++)
    if (escape(obj.charAt(i)).length >= 4 ) cnt+=2; else cnt++;
  return cnt;
}

function dounknown()
{

	if (document.form1.knowtime.checked)
	{
		alert("出生時間は不明にします");
		document.form1.hour.selectedIndex=0; //0時のこと
		document.form1.minute.selectedIndex=0;  //0分
		document.form1.minute.disable=true;
	} else {
		document.form1.hour.selectedIndex=0; 
		document.form1.minute.selectedIndex=0; 
		document.form1.minute.disable=false;
	}		
}


function IsTrueDate(year,month,day)
{
	if (month==2 || month==4 || month==6 || month==9 || month==11 )
		if(day==31)	return false;
	
	if (month !=2 ) return true;

	if ( IsLeap(year) ==false )
	{
		if ( day==29 || day==30 || day==31 )
			return false;
	}
	else
	{
		if (day==30 || day==31 )
			return false;
	}
	return true;
}

function IsTrueBirthDay(year,month,day,hour,minute) {
// 未来の生年月日を入れてないか？
	today=new Date();
	inpDate=year+"/"+month+"/"+day+" "+hour+":"+minute;
	chkDate=Date.parse(inpDate);
	curDate=today.getTime();
	if (chkDate>curDate)
		return false;
	return true;
}

function IsTrueFortuneDay(year,month,day)
//過去の年月日を入れていませんか？
{
	today=new Date();
	
	inpDate=year+"/"+month+"/"+day;
	chkDate=Date.parse(inpDate);
	curDate=today.getTime();
	if (chkDate>curDate){
		return false;
}else{
	return true;
	}
	
}

function IsLeap(year)
// 閏年かどうかのﾁｪｯｸをする
// ４で割り切れる年は閏年、但し１００で割れたら違う。ただし４００で割れたら閏年
{
	
	flag=false;
	y=eval(year);
	if (((y%4==0) && (y%100 !=0)) || (y%400==0)) 
		return true;
	else
		return false;
}

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 dounknown2()
{
	if (document.form1.knowtime2.checked)
	{
		alert("出生時間は不明にします");
		document.form1.hour2.selectedIndex=0; //12時のこと
		document.form1.minute2.selectedIndex=0;  //0分
	
	} else {
		document.form1.hour2.selectedIndex=0; 
		document.form1.minute2.selectedIndex=0; 
	}		
}

function backCheck(){
	x = 0;
	if(navigator.appName.charAt(0) == "N"){
		x = 1;
	}
	if(history.length == x){
		window.location="index.html";
	} else {
		history.back();
	}
}

function senddata(iPerson){

	if (iPerson == 2) {
		if (CheckBoth()) document.form1.submit();
	} else if (iPerson == 1) {
		if (Check()) document.form1.submit();
	} else {
		if (checkYear()) document.form1.submit();
	}
}
-->
