function myAge(){
var age=0;
var ranka=0;
var rank=0;
now = new Date();
y=now.getYear();
m=now.getMonth()+1;
d=now.getDate();
if(y<1900) {y=y+1900;}
if(m < birthmonth){age=y-birthyear-1}
if(m > birthmonth){age=y-birthyear}
if(m == birthmonth){
if(d < birthday){age=y-birthyear-1}
else{age=y-birthyear}
}
if(birthmonth > 3){ranka=y-birthyear}
if(birthmonth <= 3){ranka=y-birthyear+1}
if(m > 3){rank=ranka}
if(m <= 3){rank=ranka-1}
if(rank>19){rank=19;}
Gd=new Array(13);
Gd[7]="小学1年生";
Gd[8]="小学2年生";
Gd[9]="小学3年生";
Gd[10]="小学4年生";
Gd[11]="小学5年生";
Gd[12]="小学6年生";
Gd[13]="中学1年生";
Gd[14]="中学2年生";
Gd[15]="中学3年生";
Gd[16]="高校1年生";
Gd[17]="高校2年生";
Gd[18]="高校3年生";
Gd[19]="高卒以上";
document.write("　年齢："+age+"歳　");
document.write("　（"+Gd[rank]+"）");
}
