
function getpet () {
var toyear = 1997;
var birthyear = document.frm.inyear.value;
var birthpet="Ox"
x = (toyear - birthyear) % 12
if ((x == 1) || (x == -11)) {
birthpet="鼠" }
else {
if (x == 0) {
birthpet="牛" }
else {
if ((x == 11) || (x == -1)) {
birthpet="虎" }
else {
if ((x == 10) || (x == -2)) {
birthpet="兔" }
else {
if ((x == 9) || (x == -3)) {
birthpet="龙" }
else {
if ((x == 8) || (x == -4)) {
birthpet="蛇" }
else {
if ((x == 7) || (x == -5)) {
birthpet="马" }
else {
if ((x == 6) || (x == -6)) {
birthpet="羊" }
else {
if ((x == 5) || (x == -7)) {
birthpet="猴" }
else {
if ((x == 4) || (x == -8)) {
birthpet="鸡" }
else {
if ((x == 3) || (x == -9)) {
birthpet="狗" }
else {
if ((x == 2) || (x == -10)) {
birthpet="猪" }
}
}
}
}
}
}
}
}
}
}
}
document.frm.birth.value = birthpet;
}

